Skip to content

Commit

Permalink
Fix: metergroup typos (#6699)
Browse files Browse the repository at this point in the history
* fix: Error in type definition

* fix: Typos
  • Loading branch information
ivanpajon authored May 29, 2024
1 parent 8aff3eb commit ad68424
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -35862,7 +35862,7 @@
"relatedProp": "",
"props": [
{
"name": "totaLPercent",
"name": "totalPercent",
"optional": false,
"readonly": false,
"type": "number"
Expand Down
6 changes: 3 additions & 3 deletions components/lib/metergroup/MeterGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export const MeterGroup = (inProps) => {
useHandleStyle(MeterGroupBase.css.styles, isUnstyled, { name: 'metergroup' });

let totalPercent = 0;
let precentages = [];
let percentages = [];

values.map((item) => {
totalPercent = totalPercent + item.value;
precentages.push(Math.round((item.value / totalPercent) * 100));
percentages.push(Math.round((item.value / totalPercent) * 100));
});

const calculatePercentage = (meterValue = 0) => {
Expand Down Expand Up @@ -143,7 +143,7 @@ export const MeterGroup = (inProps) => {

const templateProps = {
totalPercent,
precentages,
percentages,
values
};

Expand Down
13 changes: 3 additions & 10 deletions components/lib/metergroup/metergroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@
*
*/
import * as React from 'react';
import { ComponentType, ReactNode } from 'react';
import { ReactNode } from 'react';
import { CSSTransitionProps as ReactCSSTransitionProps } from 'react-transition-group/CSSTransition';
import { CheckboxPassThroughOptions } from '../checkbox/checkbox';
import { ComponentHooks } from '../componentbase/componentbase';
import { CSSTransitionProps } from '../csstransition/csstransition';
import { PassThroughOptions } from '../passthrough';
import { SelectItemOptionsType } from '../selectitem/selectitem';
import { TooltipPassThroughOptions } from '../tooltip/tooltip';
import { TooltipOptions } from '../tooltip/tooltipoptions';
import { IconType, PassThroughType } from '../utils/utils';
import { VirtualScrollerPassThroughOptions, VirtualScrollerProps } from '../virtualscroller/virtualscroller';
import { PassThroughType } from '../utils/utils';

export declare type MeterGroupPassThroughType<T> = PassThroughType<T, MeterGroupPassThroughMethodOptions>;
export declare type MeterGroupPassThroughTransitionType = ReactCSSTransitionProps | ((options: MeterGroupPassThroughMethodOptions) => ReactCSSTransitionProps) | undefined;
Expand Down Expand Up @@ -85,7 +78,7 @@ interface MeterGroupValue {
}

interface CustomRenderProps {
totaLPercent: number;
totalPercent: number;
percentages: number[];
values: MeterGroupValue[];
}
Expand Down

0 comments on commit ad68424

Please sign in to comment.