Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: metergroup typos #6699

Merged
merged 5 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading