@majoo-ui/react 1.48.4 → 1.49.0
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/components/chart/index.d.ts +1 -0
- package/components/chart/lineChart/LineChart.d.ts +80 -0
- package/components/chart/lineChart/components/Comparator.d.ts +16 -0
- package/components/chart/lineChart/components/ComparatorController.d.ts +8 -0
- package/components/chart/lineChart/components/ComparatorItem.d.ts +10 -0
- package/components/chart/lineChart/components/ProductList.d.ts +10 -0
- package/components/chart/lineChart/components/TitleLegend.d.ts +19 -0
- package/components/chart/lineChart/components/Tooltip.d.ts +21 -0
- package/components/chart/lineChart/index.d.ts +1 -0
- package/components/chart/utils/index.d.ts +18 -0
- package/components/index.d.ts +1 -0
- package/index.esm.js +1296 -221
- package/index.umd.js +1387 -225
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lineChart';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ComparatorChangeType {
|
|
3
|
+
type: 'DELETE' | 'ADD' | 'SEARCH';
|
|
4
|
+
payload: any;
|
|
5
|
+
}
|
|
6
|
+
interface LineChartProps {
|
|
7
|
+
/**
|
|
8
|
+
* Title identity for a chart.
|
|
9
|
+
*/
|
|
10
|
+
title: string;
|
|
11
|
+
/**
|
|
12
|
+
* Additional description for a chart.
|
|
13
|
+
*/
|
|
14
|
+
description?: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Additional placeholder for comparator input select.
|
|
17
|
+
*/
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/**
|
|
20
|
+
* List of data to be used as a graph.
|
|
21
|
+
*/
|
|
22
|
+
data: any[];
|
|
23
|
+
/**
|
|
24
|
+
* Mapping of a data list.
|
|
25
|
+
*/
|
|
26
|
+
legendData: any[];
|
|
27
|
+
/**
|
|
28
|
+
* Key to bind xAxis data.
|
|
29
|
+
*/
|
|
30
|
+
xAxisKey: string;
|
|
31
|
+
/**
|
|
32
|
+
* Loading status of chart.
|
|
33
|
+
*/
|
|
34
|
+
isLoading?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Tick formatter period.
|
|
37
|
+
*/
|
|
38
|
+
period?: 'jam' | 'hari' | 'minggu' | 'bulan' | 'tahun';
|
|
39
|
+
/**
|
|
40
|
+
* Customize tooltip label format.
|
|
41
|
+
*/
|
|
42
|
+
chartTypeLabel?: string;
|
|
43
|
+
/**
|
|
44
|
+
* To round up yAxis data.
|
|
45
|
+
*/
|
|
46
|
+
roundUpYAxis?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* List of the comparator.
|
|
49
|
+
*/
|
|
50
|
+
comparatorList?: any[];
|
|
51
|
+
/**
|
|
52
|
+
* Customize xAxis tick formatter.
|
|
53
|
+
*/
|
|
54
|
+
customXAxisFormat?: (value: any) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Customize yAxis tick formatter.
|
|
57
|
+
*/
|
|
58
|
+
customYAxisFormat?: (value: any) => string;
|
|
59
|
+
/**
|
|
60
|
+
* Customize tooltip date format.
|
|
61
|
+
*/
|
|
62
|
+
customTooltipDate?: (value: any) => ReactNode;
|
|
63
|
+
/**
|
|
64
|
+
* on comparator change event handler.
|
|
65
|
+
*/
|
|
66
|
+
onComparatorChange?: (e: ComparatorChangeType) => void;
|
|
67
|
+
}
|
|
68
|
+
export declare const COMPARISON_LIMIT = 5;
|
|
69
|
+
declare function LineChart(props: LineChartProps): JSX.Element;
|
|
70
|
+
declare namespace LineChart {
|
|
71
|
+
var defaultProps: {
|
|
72
|
+
customXAxisFormat: undefined;
|
|
73
|
+
onComparatorChange: undefined;
|
|
74
|
+
comparatorList: never[];
|
|
75
|
+
placeholder: string;
|
|
76
|
+
roundUpYAxis: boolean;
|
|
77
|
+
period: undefined;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export default LineChart;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface ComparatorProps {
|
|
3
|
+
option: any;
|
|
4
|
+
onCloseClick: (any: any) => void;
|
|
5
|
+
onComparatorAdd: (any: any) => void;
|
|
6
|
+
legendData: any[];
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
onComparatorSearch: (string: any) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const Comparator: {
|
|
11
|
+
(props: ComparatorProps): JSX.Element;
|
|
12
|
+
defaultProps: {
|
|
13
|
+
option: {}[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default Comparator;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const ComparatorController: ({ option, onComparatorAdd, onComparatorSearch, placeholder }: {
|
|
3
|
+
option: any;
|
|
4
|
+
onComparatorAdd: any;
|
|
5
|
+
onComparatorSearch: any;
|
|
6
|
+
placeholder: any;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
export default ComparatorController;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface ComparatorItemProps {
|
|
3
|
+
dataKey: string;
|
|
4
|
+
color: string;
|
|
5
|
+
variants: [];
|
|
6
|
+
onCloseClick: () => void;
|
|
7
|
+
disableClose: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const ComparatorItem: (props: ComparatorItemProps) => JSX.Element;
|
|
10
|
+
export default ComparatorItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CSS } from '../../../../config/stitches.config';
|
|
3
|
+
interface ProductListProps {
|
|
4
|
+
variants: [];
|
|
5
|
+
name: string;
|
|
6
|
+
direction: string;
|
|
7
|
+
css: CSS;
|
|
8
|
+
}
|
|
9
|
+
declare const ProductList: (props: ProductListProps) => JSX.Element;
|
|
10
|
+
export default ProductList;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface TitleLegendProps {
|
|
3
|
+
title: string | undefined;
|
|
4
|
+
legendData: any[];
|
|
5
|
+
filteredData: any[];
|
|
6
|
+
setFilteredData: (any: any) => void;
|
|
7
|
+
isComparator?: boolean;
|
|
8
|
+
titleOnly?: boolean;
|
|
9
|
+
isDividedByThousand: boolean;
|
|
10
|
+
description: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
declare const TitleLegend: {
|
|
13
|
+
(props: TitleLegendProps): JSX.Element;
|
|
14
|
+
defaultProps: {
|
|
15
|
+
isComparator: undefined;
|
|
16
|
+
titleOnly: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default TitleLegend;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface TooltipProps {
|
|
3
|
+
hover?: string | null;
|
|
4
|
+
payload: any[];
|
|
5
|
+
active?: boolean;
|
|
6
|
+
legendData: any[];
|
|
7
|
+
maxValue: number;
|
|
8
|
+
xAxisKey: string;
|
|
9
|
+
chartTypeLabel?: string;
|
|
10
|
+
customTooltipDate?: (value: any) => ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const Tooltip: {
|
|
13
|
+
(props: TooltipProps): JSX.Element | null;
|
|
14
|
+
defaultProps: {
|
|
15
|
+
hover: null;
|
|
16
|
+
payload: undefined;
|
|
17
|
+
active: undefined;
|
|
18
|
+
legendData: never[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default Tooltip;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LineChart } from './LineChart';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const formatHour: (date: any) => string;
|
|
2
|
+
export declare const formatDay: (date: any) => string;
|
|
3
|
+
export declare const formatMonth: (date: any) => string;
|
|
4
|
+
export declare const formatYear: (date: any) => string;
|
|
5
|
+
export declare const handleXaxis: (date: any, period: any) => string;
|
|
6
|
+
export declare const currency: ({ value, type, thousandSeparator, decimal, convertMinus }: {
|
|
7
|
+
value: any;
|
|
8
|
+
type?: string | undefined;
|
|
9
|
+
thousandSeparator?: string | undefined;
|
|
10
|
+
decimal?: boolean | undefined;
|
|
11
|
+
convertMinus?: boolean | undefined;
|
|
12
|
+
}) => any;
|
|
13
|
+
export declare const numSeparator: (num: any) => string;
|
|
14
|
+
export declare const formatCurrency: (number: any, options: any) => string;
|
|
15
|
+
export declare const compactCurrency: (number: any) => string;
|
|
16
|
+
export declare const roundUp: (highestVal: any) => any;
|
|
17
|
+
export declare const roundDown: (lowestVal: any) => number;
|
|
18
|
+
export declare function isValidDate(date: any): boolean;
|
package/components/index.d.ts
CHANGED