@oliasoft-open-source/charts-library 3.4.7-beta-1 → 3.4.8-beta-1

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.
Files changed (60) hide show
  1. package/dist/declaration.d.ts +0 -2
  2. package/dist/index.js +612 -659
  3. package/dist/index.js.map +1 -1
  4. package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +26 -30
  5. package/dist/src/components/bar-chart/bar-chart.interface.d.ts +70 -37
  6. package/dist/src/components/bar-chart/get-bar-chart-data-labels.d.ts +14 -11
  7. package/dist/src/components/bar-chart/get-bar-chart-scales.d.ts +2 -3
  8. package/dist/src/components/bar-chart/get-bar-chart-tooltips.d.ts +16 -3
  9. package/dist/src/components/controls/axes-options/axes-options-interfaces.d.ts +19 -0
  10. package/dist/src/components/{line-chart/controls → controls}/axes-options/axes-options.d.ts +1 -1
  11. package/dist/src/components/line-chart/controls/axes-options/axes-options-form-state.d.ts +3 -8
  12. package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +32 -18
  13. package/dist/src/components/line-chart/controls/controls-portal.d.ts +1 -6
  14. package/dist/src/components/line-chart/controls/controls.d.ts +1 -1
  15. package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +5 -5
  16. package/dist/src/components/line-chart/controls/line-options.d.ts +1 -9
  17. package/dist/src/components/line-chart/hooks/hooks.interface.d.ts +13 -0
  18. package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +6 -28
  19. package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +37 -0
  20. package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +1 -2
  21. package/dist/src/components/line-chart/initialize/config.d.ts +2 -2
  22. package/dist/src/components/line-chart/legend/legend-interface.d.ts +18 -24
  23. package/dist/src/components/line-chart/legend/legend-panel.d.ts +2 -2
  24. package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +30 -38
  25. package/dist/src/components/line-chart/line-chart.interface.d.ts +61 -48
  26. package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +1 -14
  27. package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +4 -5
  28. package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +2 -2
  29. package/dist/src/components/line-chart/state/initial-state.d.ts +2 -20
  30. package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +1 -2
  31. package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +2 -3
  32. package/dist/src/components/line-chart/state/state.interfaces.d.ts +7 -32
  33. package/dist/src/components/line-chart/{hooks → state}/use-chart-state.d.ts +1 -13
  34. package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +1 -1
  35. package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +1 -3
  36. package/dist/src/components/line-chart/utils/get-axes-ranges-from-chart.d.ts +2 -9
  37. package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +2 -3
  38. package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +4 -4
  39. package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +2 -2
  40. package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +1 -2
  41. package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +8 -12
  42. package/dist/src/components/pie-chart/pie-chart-utils.d.ts +2 -0
  43. package/dist/src/components/pie-chart/pie-chart.d.ts +2 -1
  44. package/dist/src/components/pie-chart/pie-chart.interface.d.ts +51 -52
  45. package/dist/src/components/scatter-chart/scatter-chart.d.ts +1 -1
  46. package/dist/src/components/scatter-chart/scatter-chart.intefrace.d.ts +16 -6
  47. package/dist/src/helpers/chart-border-plugin.d.ts +7 -0
  48. package/dist/src/helpers/chart-interface.d.ts +85 -0
  49. package/dist/src/{components/common/helpers → helpers}/enums.d.ts +1 -2
  50. package/dist/src/helpers/get-chart-annotation.d.ts +12 -0
  51. package/dist/src/helpers/get-draggableData.d.ts +18 -0
  52. package/dist/src/{components/common/helpers → helpers}/range/range.d.ts +6 -6
  53. package/package.json +1 -1
  54. package/dist/src/components/common/common.interface.d.ts +0 -139
  55. package/dist/src/components/common/helpers/chart-border-plugin.d.ts +0 -8
  56. package/dist/src/components/common/helpers/get-chart-annotation.d.ts +0 -27
  57. package/dist/src/components/common/helpers/get-draggableData.d.ts +0 -18
  58. package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +0 -52
  59. /package/dist/src/{components/common/helpers → helpers}/chart-consts.d.ts +0 -0
  60. /package/dist/src/{components/common/helpers → helpers}/range/estimate-data-series-have-close-values.d.ts +0 -0
@@ -1,55 +1,54 @@
1
- import { ICommonData, ICommonDataset, ICommonDataValue, ICommonLegend, ICommonOptions } from '../common/common.interface';
2
- export interface IPieLegend extends ICommonLegend {
3
- useDataset?: boolean;
4
- }
5
- export interface IPieGraph {
6
- showDataLabels?: boolean;
7
- stacked?: boolean;
8
- cutout?: number | string;
9
- }
10
- export interface IPieOptions extends ICommonOptions {
11
- graph?: IPieGraph;
12
- legend?: IPieLegend;
13
- }
14
- export interface IPieDataValue extends ICommonDataValue {
15
- label: string;
16
- borderWidth: string | number;
17
- value: number;
18
- backgroundColor?: string | string[];
19
- borderColor?: string;
20
- labels: string[];
21
- }
22
- export interface IPieChartDataset extends ICommonDataset {
23
- data: IPieDataValue[];
24
- hideLegend?: boolean;
25
- }
26
- export interface IPieData {
27
- labels?: string[];
28
- datasets?: IPieChartDataset[];
29
- xUnit?: string;
30
- yUnit?: string;
31
- }
32
- export interface IPieChartData extends ICommonData {
33
- data?: IPieData;
34
- options: IPieOptions;
1
+ export interface IChartInteractions {
2
+ onLegendClick: (legendItem: string, hidden: boolean) => any;
3
+ onPointHover: () => any;
4
+ onPointUnhover: () => any;
5
+ onPieHover: (evt: Event, datasetIndex: string | number, index: string | number, generatedDataset: any) => any;
6
+ onPieUnhover: (evt: Event) => any;
7
+ }
8
+ export interface IChartOptions {
9
+ enableZoom: boolean;
10
+ enablePan: boolean;
11
+ }
12
+ export interface IChartLegend {
13
+ display: boolean;
14
+ position: 'top' | 'bottom' | 'right';
15
+ align: 'start' | 'center' | 'end';
16
+ useDataset: boolean;
17
+ }
18
+ export interface IChartGraph {
19
+ showDataLabels: boolean;
20
+ stacked: boolean;
21
+ cutout: number | string;
22
+ }
23
+ export interface IChartTooltip {
24
+ tooltips: boolean;
25
+ showLabelsInTooltips: boolean;
26
+ }
27
+ export interface IChartStyling {
28
+ width: number | string;
29
+ height: number | string;
30
+ maintainAspectRatio: boolean;
31
+ staticChartHeight: boolean;
32
+ performanceMode: boolean;
33
+ }
34
+ export interface IOptions {
35
+ title: string | string[];
36
+ chartStyling: IChartStyling;
37
+ tooltip: IChartTooltip;
38
+ graph: IChartGraph;
39
+ legend: IChartLegend;
40
+ chartOptions: IChartOptions;
41
+ interactions: IChartInteractions;
42
+ }
43
+ export interface IChartData {
44
+ labels: string;
45
+ datasets: any[];
46
+ }
47
+ export interface IChartProps {
48
+ testId: string | null;
49
+ data: IChartData;
50
+ options: IOptions;
35
51
  }
36
52
  export interface IPieChartProps {
37
- chart: IPieChartData;
38
- }
39
- export interface IPieGeneratedLabel {
40
- text: string;
41
- fillStyle: string;
42
- strokeStyle: string;
43
- index: number;
44
- }
45
- export interface IPieLegendItemFilter {
46
- index: number;
47
- datasetIndex: number;
48
- hidden: boolean;
49
- }
50
- export interface IPiesDataLabelsOptions {
51
- display?: 'auto' | boolean;
52
- align?: 'center';
53
- anchor?: 'center';
54
- formatter?: (_value: any, context: any) => any;
53
+ chart: IChartProps;
55
54
  }
@@ -1,7 +1,7 @@
1
1
  import { IScatterChartProps } from './scatter-chart.intefrace';
2
2
  /**
3
3
  *
4
- * @param {IScatterChartProps} props
4
+ * @param {import('./scatter-chart.intefrace').IScatterChartProps} props
5
5
  */
6
6
  declare const ScatterChart: (props: IScatterChartProps) => JSX.Element;
7
7
  export default ScatterChart;
@@ -1,13 +1,23 @@
1
- import { ICommonChartPlugins, ICommonData, ICommonDataset, ICommonOptions } from '../common/common.interface';
2
- export interface IScatterChartOptions extends Partial<ICommonOptions> {
1
+ import { IChartPlugins } from '../../helpers/chart-interface';
2
+ export interface IScatterChartOptions {
3
3
  responsive: boolean;
4
4
  maintainAspectRatio: boolean;
5
- plugins: ICommonChartPlugins;
5
+ plugins: IChartPlugins;
6
6
  }
7
- export interface IScatterChartDataset extends ICommonDataset {
8
- showLine: boolean;
7
+ export interface IScatterChartPoint {
8
+ x: number | string;
9
+ y: number | string;
10
+ label?: string;
9
11
  }
10
- export interface IScatterChartData extends ICommonData {
12
+ export interface IScatterChartDataset {
13
+ label: string;
14
+ data: IScatterChartPoint[];
15
+ borderColor: string;
16
+ backgroundColor: string;
17
+ showLine: Boolean;
18
+ }
19
+ export interface IScatterChartData {
20
+ testId: string | null;
11
21
  data: {
12
22
  datasets: IScatterChartDataset[];
13
23
  };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Chart border plugin config
3
+ */
4
+ export declare const chartAreaBorderPlugin: {
5
+ id: string;
6
+ beforeDraw(chart: any, args: any, options: any): void;
7
+ };
@@ -0,0 +1,85 @@
1
+ import { Plugin } from 'chart.js';
2
+ export interface IChartDraggableData {
3
+ enableDragData: boolean;
4
+ showTooltip: boolean;
5
+ roundPoints: boolean;
6
+ dragX: boolean;
7
+ dragY: boolean;
8
+ onDragStart: () => any;
9
+ onDrag: () => any;
10
+ onDragEnd: () => any;
11
+ }
12
+ export interface IChartAnnotationsData {
13
+ adjustScaleRange: boolean;
14
+ annotationAxis: 'x' | 'y';
15
+ color: string;
16
+ endValue: number;
17
+ label: string;
18
+ type: string;
19
+ value: number;
20
+ xMin: number;
21
+ xMax: number;
22
+ yMin: number;
23
+ yMax: number;
24
+ }
25
+ export interface ILabelAnnotation {
26
+ showLabel: boolean;
27
+ text: string | string[];
28
+ position?: string;
29
+ fontSize?: number;
30
+ xOffset?: number;
31
+ yOffset?: number;
32
+ maxWidth?: number;
33
+ lineHeight?: number;
34
+ }
35
+ export interface IChartAnnotations {
36
+ showAnnotations: boolean;
37
+ controlAnnotation: boolean;
38
+ annotationsData: IChartAnnotationsData[];
39
+ labelAnnotation: ILabelAnnotation;
40
+ }
41
+ export interface IChartStyling {
42
+ width: number | string;
43
+ height: number | string;
44
+ maintainAspectRatio: boolean;
45
+ squareAspectRatio?: boolean;
46
+ staticChartHeight: boolean;
47
+ performanceMode: boolean;
48
+ layoutPadding: any;
49
+ }
50
+ export interface ICustomLegend {
51
+ customLegendPlugin: Plugin | null;
52
+ customLegendContainerID: string;
53
+ }
54
+ export interface IChartLegend {
55
+ display: boolean;
56
+ position: 'top' | 'bottom' | 'right';
57
+ align: 'start' | 'center' | 'end';
58
+ customLegend?: ICustomLegend;
59
+ usePointStyle: boolean;
60
+ }
61
+ export interface IChartInteractions {
62
+ onLegendClick: () => any;
63
+ onPointHover: () => any;
64
+ onPointUnhover: () => any;
65
+ onAnimationComplete: () => any;
66
+ }
67
+ export interface IInitialState {
68
+ zoomEnabled?: boolean;
69
+ panEnabled?: boolean;
70
+ pointsEnabled?: boolean;
71
+ lineEnabled?: boolean;
72
+ legendEnabled?: boolean;
73
+ axes?: any;
74
+ showAnnotationLineIndex: [];
75
+ enableDragData?: boolean;
76
+ }
77
+ export interface IChartPlugins {
78
+ legend: {
79
+ position: 'top' | 'right' | 'bottom' | 'left';
80
+ };
81
+ title: {
82
+ display: boolean;
83
+ text: string;
84
+ };
85
+ }
@@ -57,8 +57,7 @@ export declare enum ChartHoverMode {
57
57
  export declare enum PanZoomMode {
58
58
  X = "x",
59
59
  Y = "y",
60
- XY = "xy",
61
- Z = "z"
60
+ XY = "xy"
62
61
  }
63
62
  export declare enum Key {
64
63
  Shift = "Shift"
@@ -0,0 +1,12 @@
1
+ import { ILineChartOptions } from '../components/line-chart/line-chart.interface';
2
+ import { IInitialState } from './chart-interface';
3
+ /**
4
+ * @param {import('../components/bar-chart/bar-chart.interface').IBarChartOptions |
5
+ * import('../components/line-chart/line-chart.interface').ILineChartOptions} options - chart options object
6
+ * @param {import('./chart-interface').IInitialState} state - chart state object controlled by useReducer or similar
7
+ * @return {{annotations: []}}
8
+ */
9
+ declare const getAnnotation: (options: ILineChartOptions, state: IInitialState) => {
10
+ annotations: {} | null;
11
+ };
12
+ export default getAnnotation;
@@ -0,0 +1,18 @@
1
+ import { ILineChartOptions } from '../components/line-chart/line-chart.interface';
2
+ /**
3
+ * @param {import('./line-chart.interface').ILineChartOptions} options - line chart options object
4
+ */
5
+ declare const getDraggableData: (options: ILineChartOptions) => {
6
+ dragData: {
7
+ dragX: any;
8
+ dragY: any;
9
+ round: any;
10
+ showTooltip: any;
11
+ onDragStart: any;
12
+ onDrag: any;
13
+ onDragEnd: any;
14
+ };
15
+ } | {
16
+ dragData?: undefined;
17
+ };
18
+ export default getDraggableData;
@@ -1,8 +1,3 @@
1
- interface IGetSuggestedAxisRange {
2
- data: number[];
3
- beginAtZero: boolean;
4
- autoAxisPadding: boolean;
5
- }
6
1
  /**
7
2
  * Overrides the default chart.js axis range for some edge-cases:
8
3
  * - when no data -> default range
@@ -23,7 +18,12 @@ interface IGetSuggestedAxisRange {
23
18
  * @param {boolean>} [args.autoAxisPadding]
24
19
  * @returns {object} returns {min, max} pair
25
20
  */
26
- export declare const getSuggestedAxisRange: ({ data, beginAtZero, autoAxisPadding, }: IGetSuggestedAxisRange) => {
21
+ interface IGetuggestedAxisRange {
22
+ data: any;
23
+ beginAtZero: boolean;
24
+ autoAxisPadding: boolean;
25
+ }
26
+ export declare const getSuggestedAxisRange: ({ data, beginAtZero, autoAxisPadding, }: IGetuggestedAxisRange) => {
27
27
  min: number;
28
28
  max: number;
29
29
  } | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "3.4.7-beta-1",
3
+ "version": "3.4.8-beta-1",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
6
6
  "bugs": {
@@ -1,139 +0,0 @@
1
- import { ChartEvent, ChartTypeRegistry, LinearScaleOptions, Plugin } from 'chart.js';
2
- import { AlignOptions, Position } from './helpers/enums';
3
- export interface ICommonDataValue {
4
- x: number;
5
- y: number;
6
- label?: string;
7
- }
8
- export interface ICommonDataset {
9
- label?: string;
10
- borderColor?: string;
11
- backgroundColor?: string | string[];
12
- borderWidth?: number;
13
- data: ICommonDataValue[];
14
- }
15
- export interface ICommonScales extends Partial<Record<string, LinearScaleOptions>> {
16
- x: LinearScaleOptions;
17
- y: LinearScaleOptions;
18
- }
19
- export interface ICommonAnnotationsData {
20
- adjustScaleRange: boolean;
21
- annotationAxis: 'x' | 'y';
22
- color: string;
23
- endValue: number;
24
- label: string;
25
- type: string;
26
- value: number;
27
- xMin: number;
28
- xMax: number;
29
- yMin: number;
30
- yMax: number;
31
- }
32
- export interface ICommonStyling {
33
- width?: number | string;
34
- height?: number | string;
35
- maintainAspectRatio?: boolean;
36
- staticChartHeight?: boolean;
37
- performanceMode?: boolean;
38
- }
39
- export interface ICommonLegend {
40
- display: boolean;
41
- position: Position;
42
- align: AlignOptions;
43
- }
44
- export interface ICommonTooltip {
45
- tooltips: boolean;
46
- showLabelsInTooltips: boolean;
47
- }
48
- export interface ICommonAdditionalAxesOptions {
49
- chartScaleType?: 'linear' | 'logarithmic';
50
- reverse: boolean;
51
- beginAtZero: boolean;
52
- stepSize?: number;
53
- stacked?: boolean;
54
- suggestedMin?: number;
55
- suggestedMax?: number;
56
- min?: number;
57
- max?: number;
58
- }
59
- export interface ICommonAnnotation {
60
- showLabel: boolean;
61
- text: string | string[];
62
- position: string;
63
- fontSize: number;
64
- xOffset: number;
65
- yOffset: number;
66
- maxWidth: number;
67
- lineHeight: number;
68
- }
69
- export interface ICommonAnnotations {
70
- showAnnotations?: boolean;
71
- controlAnnotation?: boolean;
72
- annotationsData?: ICommonAnnotationsData[];
73
- labelAnnotation?: ICommonAnnotation;
74
- }
75
- export interface ICommonGraph {
76
- lineTension?: number;
77
- spanGaps?: boolean;
78
- showDataLabels?: boolean;
79
- showMinorGridlines?: boolean;
80
- }
81
- export interface ICommonInteractions {
82
- onLegendClick?: (text: string, hidden: boolean) => void;
83
- onHover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: any[]) => void;
84
- onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: any[]) => void;
85
- }
86
- export interface ICommonCustomLegend<T extends keyof ChartTypeRegistry> {
87
- customLegendPlugin: Plugin<T> | null;
88
- customLegendContainerID: string;
89
- }
90
- export interface ICommonChartOptions {
91
- enableZoom: boolean;
92
- enablePan: boolean;
93
- }
94
- export interface ICommonDragData {
95
- enableDragData?: boolean;
96
- showTooltip?: boolean;
97
- roundPoints?: boolean;
98
- dragX?: boolean;
99
- dragY?: boolean;
100
- onDragStart?: () => void;
101
- onDrag?: () => void;
102
- onDragEnd?: () => void;
103
- }
104
- export interface ICommonOptions {
105
- title?: string | string[];
106
- chartStyling?: ICommonStyling;
107
- tooltip?: ICommonTooltip;
108
- legend?: ICommonLegend;
109
- chartOptions?: ICommonChartOptions;
110
- interactions?: ICommonInteractions;
111
- dragData?: ICommonDragData;
112
- }
113
- export interface ICommonData {
114
- testId?: string;
115
- data?: {
116
- labels?: string[];
117
- datasets?: ICommonDataset[];
118
- };
119
- options: ICommonOptions;
120
- }
121
- export interface ICommonHoveredItems {
122
- index: number;
123
- datasetIndex: number;
124
- }
125
- export interface ICommonChartPlugins {
126
- legend: {
127
- position: 'top' | 'right' | 'bottom' | 'left';
128
- };
129
- title: {
130
- display: boolean;
131
- text: string;
132
- };
133
- }
134
- export interface ICommonAxis<PositionType> {
135
- label: string;
136
- position: PositionType;
137
- color: string | string[];
138
- unit: string;
139
- }
@@ -1,8 +0,0 @@
1
- import { Chart, ChartConfiguration, Plugin } from 'chart.js';
2
- /**
3
- * Chart border plugin config
4
- */
5
- export declare const chartAreaBorderPlugin: {
6
- id: string;
7
- beforeDraw(chart: Chart, _args: Plugin, options: ChartConfiguration): void;
8
- };
@@ -1,27 +0,0 @@
1
- interface IAnnotationData {
2
- annotationAxis?: string;
3
- color?: string;
4
- type?: string;
5
- adjustScaleRange?: boolean;
6
- label?: string;
7
- value?: number;
8
- }
9
- interface IAnnotations {
10
- annotationsData?: IAnnotationData[];
11
- showAnnotations?: boolean;
12
- }
13
- interface IOptions {
14
- annotations?: IAnnotations;
15
- }
16
- interface IState {
17
- showAnnotationLineIndex?: number[];
18
- }
19
- /**
20
- * @param {ICommonChartOptions} options - chart options object
21
- * @param {IInitialState} state - chart state object controlled by useReducer or similar
22
- * @return {{annotations: []}}
23
- */
24
- declare const getAnnotation: (options: IOptions, state: IState) => {
25
- annotations: IAnnotationData | undefined;
26
- };
27
- export default getAnnotation;
@@ -1,18 +0,0 @@
1
- import { ICommonOptions } from '../common.interface';
2
- /**
3
- * @param {ICommonChartOptions} options - line chart options object
4
- */
5
- declare const getDraggableData: (options: ICommonOptions) => {
6
- dragData: {
7
- dragX: boolean | undefined;
8
- dragY: boolean | undefined;
9
- round: boolean | undefined;
10
- showTooltip: boolean | undefined;
11
- onDragStart: () => void;
12
- onDrag: () => void;
13
- onDragEnd: () => void;
14
- };
15
- } | {
16
- dragData?: undefined;
17
- };
18
- export default getDraggableData;
@@ -1,52 +0,0 @@
1
- import { IUnitOptions } from '../../line-chart.interface.ts';
2
- import { IAxisState, IInitAxisRange } from '../../state/state.interfaces.ts';
3
- export interface IDepthType {
4
- selectedDepthType?: string;
5
- setSelectedDepthType?: (type: string) => void;
6
- options?: Array<string>;
7
- }
8
- export interface IAxisControlLabel {
9
- id: string;
10
- label: string;
11
- }
12
- export interface IAxesOptions {
13
- initialAxesRanges: IInitAxisRange[];
14
- axes: IAxisState[];
15
- controlsAxesLabels: IAxisControlLabel[];
16
- onUpdateAxes: (axes: IAxisState) => void;
17
- onResetAxes: () => void;
18
- depthType: IDepthType;
19
- close?: () => void;
20
- }
21
- export interface IOnEdit {
22
- name?: string;
23
- value?: string;
24
- id?: string;
25
- }
26
- export interface IAxisFormState {
27
- id: string;
28
- min: number | string;
29
- max: number | string;
30
- unit: string | IUnitOptions;
31
- }
32
- export type IInitializeAxisFormState = IAxisFormState[];
33
- export interface IError {
34
- id: string;
35
- min: string[];
36
- max: string[];
37
- }
38
- export interface IFormState extends IInitializeAxisFormState {
39
- errors?: IError[];
40
- valid?: boolean;
41
- }
42
- type ActionType = 'reset' | 'valueUpdated' | 'unitUpdated';
43
- export type AxisKey = 'min' | 'max' | 'unit';
44
- interface ActionPayload extends IOnEdit {
45
- initialAxesRanges?: IInitAxisRange[];
46
- axes?: IAxisState[];
47
- }
48
- export interface IAction {
49
- type: ActionType;
50
- payload: ActionPayload;
51
- }
52
- export {};