@foodpilot/foods 2.2.10 → 2.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Chart/DoughnutChart/useDoughnutChartInteractions.d.ts +1 -1
- package/dist/components/Chart/Legend/Legend.d.ts +1 -0
- package/dist/components/Chart/Legend/LegendBottom.d.ts +1 -0
- package/dist/components/Chart/Legend/LegendRight.d.ts +1 -0
- package/dist/components/Chart/PolymorphicChart/PolymorphicChart.d.ts +30 -0
- package/dist/components/Chart/PolymorphicChart/PolymorphicChartRenderer.d.ts +30 -0
- package/dist/components/Chart/PolymorphicChart/PolymorphicChartTooltip.d.ts +20 -0
- package/dist/components/Chart/PolymorphicChart/charts/PolymorphicBarChart.d.ts +17 -0
- package/dist/components/Chart/{DoughnutChart/DoughnutPieChart.d.ts → PolymorphicChart/charts/PolymorphicDoughnutChart.d.ts} +7 -5
- package/dist/components/Chart/PolymorphicChart/charts/PolymorphicLineChart.d.ts +17 -0
- package/dist/components/Chart/PolymorphicChart/charts/PolymorphicPieChart.d.ts +28 -0
- package/dist/components/Chart/PolymorphicChart/charts/PolymorphicRadarChart.d.ts +17 -0
- package/dist/components/Chart/PolymorphicChart/charts/PolymorphicTable.d.ts +28 -0
- package/dist/components/Chart/PolymorphicChart/index.d.ts +3 -0
- package/dist/components/Chart/index.d.ts +1 -0
- package/dist/main.js +30575 -27892
- package/dist/main.umd.cjs +166 -166
- package/package.json +3 -3
|
@@ -8,7 +8,7 @@ export type RechartsMouseEventHandler = {
|
|
|
8
8
|
innerRadius: number;
|
|
9
9
|
};
|
|
10
10
|
export declare const useDoughnutChartInteractions: (data: DoughnutChartData[], chartRef: RefObject<HTMLDivElement>) => {
|
|
11
|
-
|
|
11
|
+
HoveredChartElementIndex: number | null;
|
|
12
12
|
tooltipPos: TooltipPosition | undefined;
|
|
13
13
|
handleLegendHover: (index: number | null, event?: React.MouseEvent<HTMLElement>) => void;
|
|
14
14
|
handleMouseEnter: (event: RechartsMouseEventHandler, index: number) => void;
|
|
@@ -12,5 +12,6 @@ export type ChartLegendProps = {
|
|
|
12
12
|
hidePercentage?: boolean;
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
chartRef?: React.RefObject<HTMLElement>;
|
|
15
|
+
isLoading?: boolean;
|
|
15
16
|
};
|
|
16
17
|
export declare const Legend: (props: ChartLegendProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -12,6 +12,7 @@ type ChartLegendVariantProps = {
|
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
chartRef?: React.RefObject<HTMLElement>;
|
|
14
14
|
hidePercentage?: boolean;
|
|
15
|
+
isLoading?: boolean;
|
|
15
16
|
};
|
|
16
17
|
export declare const LegendBottom: (props: ChartLegendVariantProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -12,6 +12,7 @@ type ChartLegendVariantProps = {
|
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
chartRef?: React.RefObject<HTMLElement>;
|
|
14
14
|
hidePercentage?: boolean;
|
|
15
|
+
isLoading?: boolean;
|
|
15
16
|
};
|
|
16
17
|
export declare const LegendRight: (props: ChartLegendVariantProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TypographyProps } from '@mui/material';
|
|
3
|
+
import { Property } from 'csstype';
|
|
4
|
+
import { ChartLegend } from '../Legend';
|
|
5
|
+
export type ChartType = "donut" | "bar" | "line" | "pie" | "radar" | "table";
|
|
6
|
+
export type PolymorphicChartProps = {
|
|
7
|
+
chartType: ChartType;
|
|
8
|
+
values?: number[];
|
|
9
|
+
valuesUnit?: string;
|
|
10
|
+
labels?: string[];
|
|
11
|
+
colors?: Property.Color[];
|
|
12
|
+
legend?: ChartLegend;
|
|
13
|
+
icons?: ReactNode[];
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
valuesFormatterFn?: (value: number, precision?: number) => string;
|
|
17
|
+
createPalette?: boolean;
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
displayTotal?: string | boolean;
|
|
20
|
+
displayTotalVariant?: TypographyProps["variant"];
|
|
21
|
+
spacing?: number;
|
|
22
|
+
borderWidth?: number;
|
|
23
|
+
borderColor?: Property.Color;
|
|
24
|
+
fullWidthLegend?: boolean;
|
|
25
|
+
hoverOffset?: number;
|
|
26
|
+
showTooltip?: boolean;
|
|
27
|
+
width?: string;
|
|
28
|
+
height?: number;
|
|
29
|
+
};
|
|
30
|
+
export declare const PolymorphicChart: (props: PolymorphicChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Property } from 'csstype';
|
|
3
|
+
import { DoughnutChartData } from '../DoughnutChart/utils';
|
|
4
|
+
import { RechartsMouseEventHandler } from '../DoughnutChart/useDoughnutChartInteractions';
|
|
5
|
+
import { ChartType } from './PolymorphicChart';
|
|
6
|
+
type PolymorphicChartRendererProps = {
|
|
7
|
+
chartType: ChartType;
|
|
8
|
+
data: DoughnutChartData[];
|
|
9
|
+
HoveredChartElementIndex: number | null;
|
|
10
|
+
spacing: number;
|
|
11
|
+
borderWidth: number;
|
|
12
|
+
borderColor?: Property.Color;
|
|
13
|
+
showTooltip: boolean;
|
|
14
|
+
tooltipPos: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
angle?: number;
|
|
18
|
+
} | undefined;
|
|
19
|
+
valuesFormatterFn?: (value: number, precision?: number) => string;
|
|
20
|
+
language: string;
|
|
21
|
+
valuesUnit?: string;
|
|
22
|
+
icons?: ReactNode[];
|
|
23
|
+
isLoading?: boolean;
|
|
24
|
+
height: number;
|
|
25
|
+
onMouseEnter: (event: RechartsMouseEventHandler, index: number) => void;
|
|
26
|
+
onMouseLeave: () => void;
|
|
27
|
+
onLegendAction?: (index: number) => void;
|
|
28
|
+
};
|
|
29
|
+
export declare const PolymorphicChartRenderer: (props: PolymorphicChartRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type PolymorphicChartTooltipProps = {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
hoveredIndex: number | null;
|
|
5
|
+
data: Array<{
|
|
6
|
+
name: string;
|
|
7
|
+
value: number;
|
|
8
|
+
color: string;
|
|
9
|
+
index?: number;
|
|
10
|
+
}>;
|
|
11
|
+
coordinate?: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
formatter?: (value: number, precision?: number) => string;
|
|
16
|
+
unit?: string;
|
|
17
|
+
icons?: ReactNode[];
|
|
18
|
+
};
|
|
19
|
+
export declare const PolymorphicChartTooltip: (props: PolymorphicChartTooltipProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DoughnutChartData } from '../../DoughnutChart/utils';
|
|
3
|
+
type PolymorphicBarChartProps = {
|
|
4
|
+
data: DoughnutChartData[];
|
|
5
|
+
HoveredChartElementIndex: number | null;
|
|
6
|
+
showTooltip: boolean;
|
|
7
|
+
valuesFormatterFn?: (value: number, precision?: number) => string;
|
|
8
|
+
valuesUnit?: string;
|
|
9
|
+
icons?: ReactNode[];
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
height?: number;
|
|
12
|
+
onMouseEnter: (index: number) => void;
|
|
13
|
+
onMouseLeave: () => void;
|
|
14
|
+
onLegendAction?: (index: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const PolymorphicBarChart: (props: PolymorphicBarChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Property } from 'csstype';
|
|
3
|
-
import { DoughnutChartData } from '
|
|
4
|
-
import { RechartsMouseEventHandler } from '
|
|
5
|
-
type
|
|
3
|
+
import { DoughnutChartData } from '../../DoughnutChart/utils';
|
|
4
|
+
import { RechartsMouseEventHandler } from '../../DoughnutChart/useDoughnutChartInteractions';
|
|
5
|
+
type PolymorphicDoughnutChartProps = {
|
|
6
6
|
data: DoughnutChartData[];
|
|
7
|
-
|
|
7
|
+
HoveredChartElementIndex: number | null;
|
|
8
8
|
spacing: number;
|
|
9
9
|
borderWidth: number;
|
|
10
10
|
borderColor?: Property.Color;
|
|
@@ -18,9 +18,11 @@ type DoughnutPieChartProps = {
|
|
|
18
18
|
language: string;
|
|
19
19
|
valuesUnit?: string;
|
|
20
20
|
icons?: ReactNode[];
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
height?: number;
|
|
21
23
|
onMouseEnter: (event: RechartsMouseEventHandler, index: number) => void;
|
|
22
24
|
onMouseLeave: () => void;
|
|
23
25
|
onLegendAction?: (index: number) => void;
|
|
24
26
|
};
|
|
25
|
-
export declare const
|
|
27
|
+
export declare const PolymorphicDoughnutChart: (props: PolymorphicDoughnutChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
28
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DoughnutChartData } from '../../DoughnutChart/utils';
|
|
3
|
+
type PolymorphicLineChartProps = {
|
|
4
|
+
data: DoughnutChartData[];
|
|
5
|
+
HoveredChartElementIndex: number | null;
|
|
6
|
+
showTooltip: boolean;
|
|
7
|
+
valuesFormatterFn?: (value: number, precision?: number) => string;
|
|
8
|
+
valuesUnit?: string;
|
|
9
|
+
icons?: ReactNode[];
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
height?: number;
|
|
12
|
+
onMouseEnter: (index: number) => void;
|
|
13
|
+
onMouseLeave: () => void;
|
|
14
|
+
onLegendAction?: (index: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const PolymorphicLineChart: (props: PolymorphicLineChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Property } from 'csstype';
|
|
3
|
+
import { DoughnutChartData } from '../../DoughnutChart/utils';
|
|
4
|
+
import { RechartsMouseEventHandler } from '../../DoughnutChart/useDoughnutChartInteractions';
|
|
5
|
+
type PolymorphicPieChartProps = {
|
|
6
|
+
data: DoughnutChartData[];
|
|
7
|
+
HoveredChartElementIndex: number | null;
|
|
8
|
+
spacing: number;
|
|
9
|
+
borderWidth: number;
|
|
10
|
+
borderColor?: Property.Color;
|
|
11
|
+
showTooltip: boolean;
|
|
12
|
+
tooltipPos: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
angle?: number;
|
|
16
|
+
} | undefined;
|
|
17
|
+
valuesFormatterFn?: (value: number, precision?: number) => string;
|
|
18
|
+
language: string;
|
|
19
|
+
valuesUnit?: string;
|
|
20
|
+
icons?: ReactNode[];
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
height?: number;
|
|
23
|
+
onMouseEnter: (event: RechartsMouseEventHandler, index: number) => void;
|
|
24
|
+
onMouseLeave: () => void;
|
|
25
|
+
onLegendAction?: (index: number) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare const PolymorphicPieChart: (props: PolymorphicPieChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DoughnutChartData } from '../../DoughnutChart/utils';
|
|
3
|
+
type PolymorphicRadarChartProps = {
|
|
4
|
+
data: DoughnutChartData[];
|
|
5
|
+
HoveredChartElementIndex: number | null;
|
|
6
|
+
showTooltip: boolean;
|
|
7
|
+
valuesFormatterFn?: (value: number, precision?: number) => string;
|
|
8
|
+
valuesUnit?: string;
|
|
9
|
+
icons?: ReactNode[];
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
height?: number;
|
|
12
|
+
onMouseEnter: (index: number) => void;
|
|
13
|
+
onMouseLeave: () => void;
|
|
14
|
+
onLegendAction?: (index: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const PolymorphicRadarChart: (props: PolymorphicRadarChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Property } from 'csstype';
|
|
3
|
+
import { DoughnutChartData } from '../../DoughnutChart/utils';
|
|
4
|
+
import { RechartsMouseEventHandler } from '../../DoughnutChart/useDoughnutChartInteractions';
|
|
5
|
+
type PolymorphicTableProps = {
|
|
6
|
+
data: DoughnutChartData[];
|
|
7
|
+
HoveredChartElementIndex: number | null;
|
|
8
|
+
spacing?: number;
|
|
9
|
+
borderWidth?: number;
|
|
10
|
+
borderColor?: Property.Color;
|
|
11
|
+
showTooltip?: boolean;
|
|
12
|
+
tooltipPos?: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
angle?: number;
|
|
16
|
+
} | undefined;
|
|
17
|
+
valuesFormatterFn?: (value: number, precision?: number) => string;
|
|
18
|
+
language?: string;
|
|
19
|
+
valuesUnit?: string;
|
|
20
|
+
icons?: ReactNode[];
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
height?: number;
|
|
23
|
+
onMouseEnter?: (event: RechartsMouseEventHandler, index: number) => void;
|
|
24
|
+
onMouseLeave?: () => void;
|
|
25
|
+
onLegendAction?: (index: number) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare const PolymorphicTable: (props: PolymorphicTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|