@spaced-out/ui-design-system 0.5.0 → 0.5.2
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/.cspell/custom-words.txt +9 -7
- package/.storybook/{SenseTheme.js → SenseTheme.ts} +4 -2
- package/.storybook/{main.js → main.ts} +24 -24
- package/.storybook/manager-head.html +4 -0
- package/.storybook/{manager.js → manager.ts} +0 -3
- package/.storybook/paths-macro.d.ts +6 -0
- package/.storybook/preview.ts +67 -0
- package/.storybook/tsconfig.json +14 -0
- package/CHANGELOG.md +28 -0
- package/lib/components/Charts/ChartTooltip/index.d.ts +2 -2
- package/lib/components/Charts/ChartTooltip/index.d.ts.map +1 -1
- package/lib/components/Charts/ColumnChart/ColumnChart.d.ts +2 -1
- package/lib/components/Charts/ColumnChart/ColumnChart.d.ts.map +1 -1
- package/lib/components/Charts/DonutChart/DonutChart.d.ts +3 -2
- package/lib/components/Charts/DonutChart/DonutChart.d.ts.map +1 -1
- package/lib/components/Charts/FunnelChart/FunnelChart.d.ts +2 -1
- package/lib/components/Charts/FunnelChart/FunnelChart.d.ts.map +1 -1
- package/lib/components/Charts/LineChart/LineChart.d.ts +2 -1
- package/lib/components/Charts/LineChart/LineChart.d.ts.map +1 -1
- package/lib/components/Charts/SpiderChart/SpiderChart.d.ts +2 -1
- package/lib/components/Charts/SpiderChart/SpiderChart.d.ts.map +1 -1
- package/lib/components/Charts/index.d.ts.map +1 -1
- package/lib/components/ChatBubble/ChatBubble.d.ts +2 -1
- package/lib/components/ChatBubble/ChatBubble.d.ts.map +1 -1
- package/lib/components/FileUpload/FileBlock/FileBlock.d.ts +1 -0
- package/lib/components/FileUpload/FileBlock/FileBlock.d.ts.map +1 -1
- package/lib/components/FileUpload/FileBlock/FileBlock.js +3 -2
- package/lib/components/FileUpload/FileBlock/FileBlock.stories.d.ts +14 -0
- package/lib/components/FileUpload/FileBlock/FileBlock.stories.d.ts.map +1 -1
- package/lib/components/InContextAlert/InContextAlert.d.ts +9 -0
- package/lib/components/InContextAlert/InContextAlert.d.ts.map +1 -1
- package/lib/components/InContextAlert/InContextAlert.js +4 -2
- package/lib/components/InContextAlert/InContextAlert.stories.d.ts +17 -0
- package/lib/components/InContextAlert/InContextAlert.stories.d.ts.map +1 -1
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts +12 -0
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts.map +1 -0
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.js +78 -0
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.module.css +91 -0
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.stories.d.ts +249 -0
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.stories.d.ts.map +1 -0
- package/lib/components/InContextAlertWithMultipleActions/index.d.ts +2 -0
- package/lib/components/InContextAlertWithMultipleActions/index.d.ts.map +1 -0
- package/lib/components/InContextAlertWithMultipleActions/index.js +16 -0
- package/lib/components/OptionButton/SimpleOptionButton.d.ts +0 -1
- package/lib/components/OptionButton/SimpleOptionButton.d.ts.map +1 -1
- package/lib/components/ScoreBar/ScoreBar.d.ts +2 -1
- package/lib/components/ScoreBar/ScoreBar.d.ts.map +1 -1
- package/lib/components/Table/StaticTable.d.ts.map +1 -1
- package/lib/components/Table/Table.d.ts +2 -2
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/types/charts.d.ts +19 -10
- package/lib/types/charts.d.ts.map +1 -1
- package/lib/utils/charts/charts.d.ts.map +1 -1
- package/lib/utils/charts/charts.js +0 -4
- package/lib/utils/charts/columnChart.d.ts.map +1 -1
- package/lib/utils/charts/columnChart.js +0 -1
- package/lib/utils/charts/donutChart.d.ts.map +1 -1
- package/lib/utils/charts/donutChart.js +1 -7
- package/lib/utils/charts/funnelChart.d.ts.map +1 -1
- package/lib/utils/charts/funnelChart.js +0 -3
- package/lib/utils/charts/lineChart.d.ts.map +1 -1
- package/lib/utils/charts/lineChart.js +0 -1
- package/lib/utils/classify/index.d.ts.map +1 -1
- package/lib/utils/classify/index.js +4 -2
- package/lib/utils/click-away/click-away.d.ts +9 -13
- package/lib/utils/click-away/click-away.d.ts.map +1 -1
- package/lib/utils/click-away/click-away.js +6 -18
- package/lib/utils/date-range-picker/date-range-picker.d.ts +12 -11
- package/lib/utils/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/lib/utils/date-range-picker/date-range-picker.js +12 -34
- package/lib/utils/date-range-picker/timezones.d.ts +1 -254
- package/lib/utils/date-range-picker/timezones.d.ts.map +1 -1
- package/lib/utils/dom/dom.d.ts +5 -13
- package/lib/utils/dom/dom.d.ts.map +1 -1
- package/lib/utils/dom/dom.js +21 -20
- package/lib/utils/makeClassNameComponent/makeClassNameComponent.d.ts +17 -5
- package/lib/utils/makeClassNameComponent/makeClassNameComponent.d.ts.map +1 -1
- package/lib/utils/makeClassNameComponent/makeClassNameComponent.js +28 -47
- package/lib/utils/merge-refs/merge-refs.d.ts +1 -1
- package/lib/utils/merge-refs/merge-refs.d.ts.map +1 -1
- package/lib/utils/merge-refs/merge-refs.js +0 -1
- package/package.json +32 -26
- package/tsconfig.json +3 -5
- package/.storybook/preview.js +0 -124
package/lib/types/charts.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export type ChartOptions = {
|
|
|
2
2
|
chart?: {
|
|
3
3
|
polar?: boolean;
|
|
4
4
|
type?: string;
|
|
5
|
-
spacing?: Array<number>;
|
|
6
5
|
margin?: Array<number>;
|
|
7
6
|
style?: CSSObject;
|
|
8
7
|
spacing?: [number, number, number, number];
|
|
@@ -10,6 +9,9 @@ export type ChartOptions = {
|
|
|
10
9
|
spacingLeft?: number;
|
|
11
10
|
spacingRight?: number;
|
|
12
11
|
spacingTop?: number;
|
|
12
|
+
events?: {
|
|
13
|
+
render?: (this: any) => void;
|
|
14
|
+
};
|
|
13
15
|
};
|
|
14
16
|
title?: {
|
|
15
17
|
align?: string;
|
|
@@ -44,12 +46,11 @@ export type ChartOptions = {
|
|
|
44
46
|
width?: number;
|
|
45
47
|
};
|
|
46
48
|
credits?: Credits;
|
|
47
|
-
tooltip?:
|
|
49
|
+
tooltip?: ChartTooltip;
|
|
48
50
|
xAxis?: AxisOptions;
|
|
49
51
|
yAxis?: AxisOptions;
|
|
50
52
|
zAxis?: AxisOptions;
|
|
51
53
|
drilldown?: Drilldown;
|
|
52
|
-
legend?: LegendOptionsType;
|
|
53
54
|
plotOptions?: PlotOptionsType;
|
|
54
55
|
series?: Array<SeriesOptionsType>;
|
|
55
56
|
subtitle?: {
|
|
@@ -64,7 +65,7 @@ export type ChartOptions = {
|
|
|
64
65
|
center?: [string, string];
|
|
65
66
|
size?: string;
|
|
66
67
|
};
|
|
67
|
-
legend?:
|
|
68
|
+
legend?: LegendOptionsType;
|
|
68
69
|
navigation?: Navigation;
|
|
69
70
|
};
|
|
70
71
|
export type AxisOptions = {
|
|
@@ -83,10 +84,13 @@ export type AxisOptions = {
|
|
|
83
84
|
style?: CSSObject;
|
|
84
85
|
};
|
|
85
86
|
type?: string;
|
|
87
|
+
padding?: number;
|
|
88
|
+
lineColor?: string;
|
|
86
89
|
};
|
|
87
90
|
export type BreadcrumbsOptions = {
|
|
88
91
|
floating?: boolean;
|
|
89
92
|
style?: CSSObject;
|
|
93
|
+
buttonTheme?: ButtonTheme;
|
|
90
94
|
};
|
|
91
95
|
export type LegendOptionsType = {
|
|
92
96
|
layout?: string;
|
|
@@ -98,6 +102,8 @@ export type LegendOptionsType = {
|
|
|
98
102
|
enabled?: boolean;
|
|
99
103
|
symbolHeight?: number;
|
|
100
104
|
symbolWidth?: number;
|
|
105
|
+
symbolPadding?: number;
|
|
106
|
+
width?: string;
|
|
101
107
|
};
|
|
102
108
|
export type CSSObject = {
|
|
103
109
|
alignItems?: string;
|
|
@@ -119,6 +125,8 @@ export type CSSObject = {
|
|
|
119
125
|
overflow?: string;
|
|
120
126
|
textOverflow?: string;
|
|
121
127
|
zIndex?: number;
|
|
128
|
+
paddingTop?: string;
|
|
129
|
+
transform?: string;
|
|
122
130
|
};
|
|
123
131
|
export type DataOptionsType = {
|
|
124
132
|
y?: number;
|
|
@@ -153,15 +161,15 @@ export type PlotOptionsType = Partial<Record<'pie' | 'line' | 'funnel', {
|
|
|
153
161
|
showInLegend?: boolean;
|
|
154
162
|
center?: [string, string];
|
|
155
163
|
size?: string;
|
|
156
|
-
minSize?: number | string;
|
|
157
164
|
borderWidth?: number;
|
|
158
165
|
borderRadius?: number;
|
|
159
166
|
neckWidth?: string | number;
|
|
160
167
|
neckHeight?: string | number;
|
|
161
168
|
minSize?: string | number;
|
|
162
169
|
width?: string | number;
|
|
170
|
+
clip?: boolean;
|
|
163
171
|
}>>;
|
|
164
|
-
export type
|
|
172
|
+
export type ChartTooltip = {
|
|
165
173
|
useHTML?: boolean;
|
|
166
174
|
followPointer?: boolean;
|
|
167
175
|
backgroundColor?: string;
|
|
@@ -183,8 +191,6 @@ export type Legend = {
|
|
|
183
191
|
floating?: boolean;
|
|
184
192
|
itemDistance?: number;
|
|
185
193
|
itemMarginBottom?: number;
|
|
186
|
-
itemMarginBottom?: number;
|
|
187
|
-
itemMarginBottom?: number;
|
|
188
194
|
labelFormat?: string;
|
|
189
195
|
layout?: 'horizontal' | 'vertical' | 'proximate';
|
|
190
196
|
margin?: number;
|
|
@@ -205,12 +211,15 @@ export type Credits = {
|
|
|
205
211
|
};
|
|
206
212
|
};
|
|
207
213
|
export type Navigation = {
|
|
208
|
-
breadcrumbs?:
|
|
214
|
+
breadcrumbs?: ChartBreadcrumbs;
|
|
209
215
|
};
|
|
210
|
-
export type
|
|
216
|
+
export type ChartBreadcrumbs = {
|
|
211
217
|
position?: Position;
|
|
212
218
|
style?: CSSObject;
|
|
213
219
|
buttonTheme?: ButtonTheme;
|
|
220
|
+
separator?: {
|
|
221
|
+
text?: string;
|
|
222
|
+
};
|
|
214
223
|
};
|
|
215
224
|
export type ButtonTheme = {
|
|
216
225
|
style?: CSSObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../src/types/charts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../src/types/charts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACvB,KAAK,CAAC,EAAE,SAAS,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE;YACP,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;SAC9B,CAAC;KACH,CAAC;IACF,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE;YACN,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;QACF,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,O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,
|
|
1
|
+
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../../src/utils/charts/charts.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AASrD,eAAO,MAAM,eAAe,mGASlB,CAAC;AAEX,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,KAAG,MAGnD,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;CAGlB,CAAC;AAEX,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,YAAY,CA4DpD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,gBAAgB,YAAY,EAC5B,aAAa,YAAY,KACxB,YAAsD,CAAC"}
|
|
@@ -54,14 +54,12 @@ const commonChartOptions = exports.commonChartOptions = {
|
|
|
54
54
|
breadcrumbs: {
|
|
55
55
|
floating: true,
|
|
56
56
|
style: breadcrumbStyle,
|
|
57
|
-
// @ts-ignore - TS2322 - Type '{ floating: true; style: { readonly color: "#565656"; readonly fontSize: "12px"; readonly letterSpacing: "0em"; readonly fontFamily: "Centra No 2"; readonly fontStyle: "normal"; readonly margin: 0; readonly fontWeight: "500"; readonly display: "flex"; readonly alignItems: "center"; }; buttonTheme: { ...; }; }' is not assignable to type 'BreadcrumbsOptions'.
|
|
58
57
|
buttonTheme: {
|
|
59
58
|
style: breadcrumbStyle
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
},
|
|
63
62
|
legend: {
|
|
64
|
-
// @ts-ignore - TS2322 - Type '{ paddingTop: string; fontSize: "12px"; fontFamily: "Centra No 2"; fontStyle: "normal"; margin: 0; color: "#17172A"; letterSpacing: "0em"; fontWeight: "500"; display: "flex"; alignItems: "center"; }' is not assignable to type 'CSSObject'.
|
|
65
63
|
itemStyle: {
|
|
66
64
|
..._typography.formLabelSmall,
|
|
67
65
|
paddingTop: '1px'
|
|
@@ -71,7 +69,6 @@ const commonChartOptions = exports.commonChartOptions = {
|
|
|
71
69
|
},
|
|
72
70
|
xAxis: {
|
|
73
71
|
type: 'category',
|
|
74
|
-
// @ts-ignore - TS2322 - Type '{ type: string; padding: number; }' is not assignable to type 'AxisOptions'.
|
|
75
72
|
padding: 0
|
|
76
73
|
},
|
|
77
74
|
navigation: {
|
|
@@ -81,7 +78,6 @@ const commonChartOptions = exports.commonChartOptions = {
|
|
|
81
78
|
color: _color.colorFillInversePrimary
|
|
82
79
|
}
|
|
83
80
|
},
|
|
84
|
-
// @ts-ignore - TS2322 - Type '{ buttonTheme: { style: { color: string; }; }; separator: { text: string; }; }' is not assignable to type 'Breadcrumbs'.
|
|
85
81
|
separator: {
|
|
86
82
|
text: '>'
|
|
87
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnChart.d.ts","sourceRoot":"","sources":["../../../src/utils/charts/columnChart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAYrD;;;GAGG;AAEH,eAAO,MAAM,qBAAqB,QAAO,
|
|
1
|
+
{"version":3,"file":"columnChart.d.ts","sourceRoot":"","sources":["../../../src/utils/charts/columnChart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAYrD;;;GAGG;AAEH,eAAO,MAAM,qBAAqB,QAAO,YAwCvC,CAAC;AAEH,eAAO,MAAM,eAAe,KAAK,CAAC"}
|
|
@@ -32,7 +32,6 @@ const getColumnChartOptions = () => ({
|
|
|
32
32
|
margin: 12,
|
|
33
33
|
style: _helpers.xAxisTitleStyle
|
|
34
34
|
},
|
|
35
|
-
// @ts-ignore - TS2322 - Type '{ labels: { style: { readonly fontSize: "12px"; readonly letterSpacing: "0.01em"; readonly fontFamily: "Centra No 2"; readonly fontStyle: "normal"; readonly margin: 0; readonly color: "#17172A"; readonly fontWeight: "500"; readonly display: "flex"; readonly alignItems: "center"; }; }; ... 6 more ...; type?: string |...' is not assignable to type 'AxisOptions'.
|
|
36
35
|
lineColor: _color.colorBorderPrimary
|
|
37
36
|
},
|
|
38
37
|
yAxis: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"donutChart.d.ts","sourceRoot":"","sources":["../../../src/utils/charts/donutChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAMxE,KAAK,mBAAmB,GAAG;IACzB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAWF,eAAO,MAAM,iBAAiB;;;;;;;;CASpB,CAAC;AAEX;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,GAAI,gCAGlC,mBAAmB,KAAG,
|
|
1
|
+
{"version":3,"file":"donutChart.d.ts","sourceRoot":"","sources":["../../../src/utils/charts/donutChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAMxE,KAAK,mBAAmB,GAAG;IACzB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAWF,eAAO,MAAM,iBAAiB;;;;;;;;CASpB,CAAC;AAEX;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,GAAI,gCAGlC,mBAAmB,KAAG,YA4ExB,CAAC"}
|
|
@@ -45,18 +45,13 @@ const getDonutChartOptions = _ref => {
|
|
|
45
45
|
type: 'pie',
|
|
46
46
|
spacing: [0, 0, 0, 0],
|
|
47
47
|
margin: [0, 0, 0, 0],
|
|
48
|
-
// @ts-ignore - TS2322 - Type '{ type: string; spacing: number[]; margin: number[]; events: { render(): void; }; polar?: boolean | undefined; style?: CSSObject | undefined; spacingBottom?: number | undefined; spacingLeft?: number | undefined; spacingRight?: number | undefined; spacingTop?: number | undefined; }' is not assignable to type '{ polar?: boolean | undefined; type?: string | undefined; spacing?: number[] | undefined; margin?: number[] | undefined; style?: CSSObject | undefined; spacingBottom?: number | undefined; spacingLeft?: number | undefined; spacingRight?: number | undefined; spacingTop?: number | undefined; }'.
|
|
49
48
|
events: {
|
|
50
49
|
render() {
|
|
51
50
|
const chart = this;
|
|
52
|
-
// @ts-ignore - TS2551 - Property 'renderTo' does not exist on type '{ render(): void; }'. Did you mean 'render'?
|
|
53
51
|
const containerWidth = chart.renderTo.offsetWidth;
|
|
54
52
|
const desiredHeight = CHART_WIDTH * containerWidth;
|
|
55
53
|
// 5px adjustment required due to borderWidth mostly.
|
|
56
|
-
const centerTextX = isLegendEnabled ?
|
|
57
|
-
// @ts-ignore - TS2339 - Property 'plotWidth' does not exist on type '{ render(): void; }'.
|
|
58
|
-
parseInt(chart.plotWidth) * CHART_CENTER + 5 : 0;
|
|
59
|
-
// @ts-ignore - TS2339 - Property 'update' does not exist on type '{ render(): void; }'.
|
|
54
|
+
const centerTextX = isLegendEnabled ? parseInt(chart.plotWidth) * CHART_CENTER + 5 : 0;
|
|
60
55
|
chart.update({
|
|
61
56
|
chart: {
|
|
62
57
|
height: desiredHeight // Set the height dynamically based on the container's width
|
|
@@ -88,7 +83,6 @@ const getDonutChartOptions = _ref => {
|
|
|
88
83
|
borderWidth: 5,
|
|
89
84
|
borderRadius: 10,
|
|
90
85
|
minSize: 240,
|
|
91
|
-
// @ts-ignore - TS2322 - Type '{ innerSize: string; allowPointSelect: true; cursor: "pointer"; dataLabels: { enabled: boolean; distance: number; }; showInLegend: true; center: [string, string]; size: string; borderWidth: number; borderRadius: number; minSize: number; clip: false; }' is not assignable to type '{ innerSize?: string | undefined; allowPointSelect?: boolean | undefined; cursor?: "pointer" | undefined; dataLabels?: { enabled?: boolean | undefined; distance?: number | undefined; connectorColor?: string | undefined; useHTML?: boolean | undefined; format?: string | undefined; style?: CSSObject | undefined; } | un...'.
|
|
92
86
|
clip: false
|
|
93
87
|
}
|
|
94
88
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"funnelChart.d.ts","sourceRoot":"","sources":["../../../src/utils/charts/funnelChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iDAAiD,CAAC;AAEtF,OAAO,KAAK,EACV,YAAY,EAEZ,SAAS,
|
|
1
|
+
{"version":3,"file":"funnelChart.d.ts","sourceRoot":"","sources":["../../../src/utils/charts/funnelChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iDAAiD,CAAC;AAEtF,OAAO,KAAK,EACV,YAAY,EAEZ,SAAS,EAEV,MAAM,oBAAoB,CAAC;AAW5B;;;GAGG;AAEH,eAAO,MAAM,qBAAqB,QAAO,YAmDvC,CAAC;AAEH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,KAAK,CAAC,gBAAgB,CAAC,EAC/B,eAAc,OAAc,KAC3B,KAAK,CAAC,gBAAgB,CAQpB,CAAC;AAEN,eAAO,MAAM,gCAAgC,GAC3C,iBAAiB,SAAS,EAC1B,eAAc,OAAc,KAC3B,SASD,CAAC"}
|
|
@@ -32,7 +32,6 @@ const getFunnelChartOptions = () => ({
|
|
|
32
32
|
margin: 12,
|
|
33
33
|
style: _helpers.xAxisTitleStyle
|
|
34
34
|
},
|
|
35
|
-
// @ts-ignore - TS2322 - Type '{ labels: { style: { readonly fontSize: "12px"; readonly fontFamily: "Centra No 2"; readonly fontStyle: "normal"; readonly margin: 0; readonly color: "#17172A"; readonly letterSpacing: "0em"; readonly fontWeight: "500"; readonly display: "flex"; readonly alignItems: "center"; }; }; ... 6 more ...; type?: string | un...' is not assignable to type 'AxisOptions'.
|
|
36
35
|
lineColor: _color.colorBorderPrimary
|
|
37
36
|
},
|
|
38
37
|
yAxis: {
|
|
@@ -83,10 +82,8 @@ exports.addColorsToFunnelSeries = addColorsToFunnelSeries;
|
|
|
83
82
|
const addColorsToFunnelDrilldownSeries = function (drilldownSeries) {
|
|
84
83
|
let showInLegend = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
85
84
|
return {
|
|
86
|
-
// @ts-ignore - TS7006 - Parameter 'series' implicitly has an 'any' type.
|
|
87
85
|
series: drilldownSeries.series?.map(series => ({
|
|
88
86
|
...series,
|
|
89
|
-
// @ts-ignore - TS7006 - Parameter 'dataPoint' implicitly has an 'any' type. | TS7006 - Parameter 'index' implicitly has an 'any' type.
|
|
90
87
|
data: series.data.map((dataPoint, index) => ({
|
|
91
88
|
...dataPoint,
|
|
92
89
|
color: (0, _charts.getDataVizColor)(index) // Assign a color dynamically based on index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineChart.d.ts","sourceRoot":"","sources":["../../../src/utils/charts/lineChart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAWrD;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,QAAO,
|
|
1
|
+
{"version":3,"file":"lineChart.d.ts","sourceRoot":"","sources":["../../../src/utils/charts/lineChart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAWrD;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,QAAO,YAgCrC,CAAC"}
|
|
@@ -32,7 +32,6 @@ const getLineChartOptions = () => ({
|
|
|
32
32
|
margin: 12,
|
|
33
33
|
style: _helpers.xAxisTitleStyle
|
|
34
34
|
},
|
|
35
|
-
// @ts-ignore - TS2322 - Type '{ labels: { style: { readonly fontSize: "12px"; readonly fontFamily: "Centra No 2"; readonly fontStyle: "normal"; readonly margin: 0; readonly color: "#17172A"; readonly letterSpacing: "0em"; readonly fontWeight: "500"; readonly display: "flex"; readonly alignItems: "center"; }; }; ... 6 more ...; type?: string | un...' is not assignable to type 'AxisOptions'.
|
|
36
35
|
lineColor: _color.colorBorderPrimary
|
|
37
36
|
},
|
|
38
37
|
yAxis: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/classify/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/classify/index.ts"],"names":[],"mappings":"AAQA,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,MAAM,CAmBxD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -8,14 +8,16 @@ exports.default = void 0;
|
|
|
8
8
|
var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject"));
|
|
9
9
|
var _map = _interopRequireDefault(require("lodash/map"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function isPlainObjectRecord(v) {
|
|
12
|
+
return (0, _isPlainObject.default)(v);
|
|
13
|
+
}
|
|
11
14
|
function classify() {
|
|
12
15
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
16
|
args[_key] = arguments[_key];
|
|
14
17
|
}
|
|
15
18
|
return args.map(arg => {
|
|
16
19
|
let mappedArg = arg;
|
|
17
|
-
if ((
|
|
18
|
-
// @ts-ignore - TS2769 - No overload matches this call.
|
|
20
|
+
if (isPlainObjectRecord(arg)) {
|
|
19
21
|
mappedArg = (0, _map.default)(arg, (test, name) => test ? name : null);
|
|
20
22
|
}
|
|
21
23
|
return mappedArg;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
type BoundaryRefType<T> =
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
type TriggerRefType<T> = {
|
|
6
|
-
current: T | null | undefined;
|
|
7
|
-
};
|
|
2
|
+
type BoundaryRefType<T> = React.RefObject<T | null>;
|
|
3
|
+
type TriggerRefType<T> = React.RefObject<T | null>;
|
|
8
4
|
export type ChildProps = {
|
|
9
5
|
onOpen: () => void;
|
|
10
6
|
isOpen: boolean;
|
|
11
7
|
height: number | null | undefined;
|
|
12
8
|
pageBottom: number | null | undefined;
|
|
13
9
|
clickAway: () => void;
|
|
14
|
-
boundaryRef: BoundaryRefType<HTMLElement
|
|
15
|
-
triggerRef: TriggerRefType<HTMLElement
|
|
10
|
+
boundaryRef: BoundaryRefType<HTMLElement>;
|
|
11
|
+
triggerRef: TriggerRefType<HTMLElement>;
|
|
16
12
|
};
|
|
17
13
|
export type ClickAwayRefType = {
|
|
18
14
|
current: {
|
|
@@ -60,18 +56,18 @@ export declare class ClickAway extends React.Component<ClickAwayProps, ClickAway
|
|
|
60
56
|
};
|
|
61
57
|
state: ClickAwayState;
|
|
62
58
|
el: HTMLElement | null | undefined;
|
|
63
|
-
boundaryRef: BoundaryRefType<HTMLElement
|
|
64
|
-
triggerRef: TriggerRefType<HTMLElement
|
|
59
|
+
boundaryRef: BoundaryRefType<HTMLElement>;
|
|
60
|
+
triggerRef: TriggerRefType<HTMLElement>;
|
|
65
61
|
componentDidMount(): void;
|
|
66
|
-
componentDidUpdate(
|
|
62
|
+
componentDidUpdate(_prevProps: ClickAwayProps, prevState: ClickAwayState): void;
|
|
67
63
|
componentWillUnmount(): void;
|
|
68
64
|
render(): React.ReactNode;
|
|
69
65
|
handleOpenClick: () => void;
|
|
70
66
|
handleCloseClick: (evt: MouseEvent) => void;
|
|
71
|
-
handleCloseOnEscapeKeypress: (evt?:
|
|
67
|
+
handleCloseOnEscapeKeypress: (evt?: KeyboardEvent) => void;
|
|
72
68
|
forceClose: () => void;
|
|
73
69
|
handleOnChange: () => unknown;
|
|
74
|
-
pageBottom():
|
|
70
|
+
pageBottom(): number;
|
|
75
71
|
}
|
|
76
72
|
export {};
|
|
77
73
|
//# sourceMappingURL=click-away.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-away.d.ts","sourceRoot":"","sources":["../../../src/utils/click-away/click-away.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;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K,cAAc,GAAG;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAIF,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAC5E,MAAM,CAAC,YAAY,EAAE;QACnB,6BAA6B,CAAC,EAAE,OAAO,CAAC;QACxC,qBAAqB,CAAC,EAAE,OAAO,CAAC;KACjC,CAGC;IAEF,KAAK,EAAE,cAAc,CAInB;IAEF,EAAE,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAQ;IAC1C,WAAW,EAAE,eAAe,CAAC,WAAW,CAAC,CAAkC;IAC3E,UAAU,EAAE,cAAc,CAAC,WAAW,CAAC,CAAkC;IAEzE,iBAAiB;IASjB,kBAAkB,CAAC,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc;IAyBxE,oBAAoB;IAUpB,MAAM,IAAI,KAAK,CAAC,SAAS;IAoBzB,eAAe,EAAE,MAAM,IAAI,CAezB;IAEF,gBAAgB,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,CAmCzC;IAEF,2BAA2B,EAAE,CAAC,GAAG,CAAC,EAAE,aAAa,KAAK,IAAI,CAMxD;IAEF,UAAU,EAAE,MAAM,IAAI,CAEpB;IAEF,cAAc,EAAE,MAAM,OAAO,CACmC;IAEhE,UAAU,IAAI,MAAM;CAKrB"}
|
|
@@ -32,9 +32,7 @@ class ClickAway extends React.Component {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
// @ts-ignore - TS6133 - 'prevProps' is declared but its value is never read.
|
|
37
|
-
componentDidUpdate(prevProps, prevState) {
|
|
35
|
+
componentDidUpdate(_prevProps, prevState) {
|
|
38
36
|
const {
|
|
39
37
|
isOpen
|
|
40
38
|
} = this.state;
|
|
@@ -44,17 +42,13 @@ class ClickAway extends React.Component {
|
|
|
44
42
|
capture: true
|
|
45
43
|
});
|
|
46
44
|
if (this.props.closeOnEscapeKeypress) {
|
|
47
|
-
window.document.addEventListener('keyup',
|
|
48
|
-
// @ts-ignore - TS2769 - No overload matches this call.
|
|
49
|
-
this.handleCloseOnEscapeKeypress);
|
|
45
|
+
window.document.addEventListener('keyup', this.handleCloseOnEscapeKeypress);
|
|
50
46
|
}
|
|
51
47
|
} else {
|
|
52
48
|
window.document.removeEventListener('click', this.handleCloseClick, {
|
|
53
49
|
capture: true
|
|
54
50
|
});
|
|
55
|
-
window.document.removeEventListener('keyup',
|
|
56
|
-
// @ts-ignore - TS2769 - No overload matches this call.
|
|
57
|
-
this.handleCloseOnEscapeKeypress);
|
|
51
|
+
window.document.removeEventListener('keyup', this.handleCloseOnEscapeKeypress);
|
|
58
52
|
}
|
|
59
53
|
}
|
|
60
54
|
}
|
|
@@ -62,9 +56,7 @@ class ClickAway extends React.Component {
|
|
|
62
56
|
window.document.removeEventListener('click', this.handleCloseClick, {
|
|
63
57
|
capture: true
|
|
64
58
|
});
|
|
65
|
-
window.document.removeEventListener('keyup',
|
|
66
|
-
// @ts-ignore - TS2769 - No overload matches this call.
|
|
67
|
-
this.handleCloseOnEscapeKeypress);
|
|
59
|
+
window.document.removeEventListener('keyup', this.handleCloseOnEscapeKeypress);
|
|
68
60
|
}
|
|
69
61
|
render() {
|
|
70
62
|
const {
|
|
@@ -109,14 +101,10 @@ class ClickAway extends React.Component {
|
|
|
109
101
|
if (evt.target instanceof Node && this.props.containsNestedFloatingPortals && this.boundaryRef.current?.parentElement && (this.boundaryRef.current.parentElement === evt.target || this.boundaryRef.current.parentElement.contains(evt.target))) {
|
|
110
102
|
return;
|
|
111
103
|
}
|
|
112
|
-
if (evt.target instanceof Node && this.boundaryRef && (
|
|
113
|
-
// @ts-ignore - TS2367 - This condition will always return 'false' since the types 'BoundaryRefType<HTMLElement | null | undefined>' and 'Node' have no overlap.
|
|
114
|
-
this.boundaryRef === evt.target || this.boundaryRef.current?.contains(evt.target))) {
|
|
104
|
+
if (evt.target instanceof Node && this.boundaryRef && (this.boundaryRef.current === evt.target || this.boundaryRef.current?.contains(evt.target))) {
|
|
115
105
|
return;
|
|
116
106
|
}
|
|
117
|
-
if (evt.target instanceof Node && this.triggerRef && (
|
|
118
|
-
// @ts-ignore - TS2367 - This condition will always return 'false' since the types 'TriggerRefType<HTMLElement | null | undefined>' and 'Node' have no overlap.
|
|
119
|
-
this.triggerRef === evt.target || this.triggerRef.current?.contains(evt.target))) {
|
|
107
|
+
if (evt.target instanceof Node && this.triggerRef && (this.triggerRef.current === evt.target || this.triggerRef.current?.contains(evt.target))) {
|
|
120
108
|
return;
|
|
121
109
|
}
|
|
122
110
|
this.setState({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Moment } from 'moment';
|
|
1
2
|
import type { DateRange, DateRangePickerError, DateRangePickerErrorTypes, DateRangeWithTimezone, TimeUnit } from 'src/types/date-range-picker';
|
|
2
3
|
import type { MenuOption } from '../../components/Menu';
|
|
3
4
|
export declare const makeKey: (value: string) => string;
|
|
@@ -13,16 +14,16 @@ export declare const WEEKDAYS: readonly ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa
|
|
|
13
14
|
export declare const getMonths: (t?: ((key: string, fallback: string) => string) | null) => Array<MenuOption>;
|
|
14
15
|
export declare const getDateRangePickerErrors: (t?: ((key: string, fallback: string) => string) | null) => DateRangePickerErrorTypes;
|
|
15
16
|
export declare const checkRangeValidity: (rangeStart: string | null | undefined, rangeEnd: string | null | undefined, errorBody: DateRangePickerError, onError?: (arg1: DateRangePickerError) => void) => boolean;
|
|
16
|
-
export declare const wrangleMoment: (date?: string | Date) => Date;
|
|
17
|
-
export declare const formatIsoDate: (date?: string | Date, format?: string) => string;
|
|
17
|
+
export declare const wrangleMoment: (date?: string | Date | Moment) => Date;
|
|
18
|
+
export declare const formatIsoDate: (date?: Moment | string | Date, format?: string) => string;
|
|
18
19
|
export declare const isStartOfRange: ({ startDate }: DateRange, date: string) => boolean;
|
|
19
20
|
export declare const isEndOfRange: ({ endDate }: DateRange, date: string) => boolean;
|
|
20
21
|
export declare const inDateRange: ({ startDate, endDate }: DateRange, date: string) => boolean;
|
|
21
22
|
export declare const isStartDateEndDateSame: ({ startDate, endDate, }: DateRange) => boolean;
|
|
22
23
|
export declare const getDaysInMonth: (date: string) => Array<Array<string>>;
|
|
23
|
-
export declare const getAddedDate: (date: string, addCount: number, timeUnit: TimeUnit) => string;
|
|
24
|
-
export declare const getSubtractedDate: (date: string, subtractCount: number, timeUnit: TimeUnit) => string;
|
|
25
|
-
export declare const getMonthEndDate: (date: string) => string;
|
|
24
|
+
export declare const getAddedDate: (date: Moment | string, addCount: number, timeUnit: TimeUnit) => string;
|
|
25
|
+
export declare const getSubtractedDate: (date: Moment | string, subtractCount: number, timeUnit: TimeUnit) => string;
|
|
26
|
+
export declare const getMonthEndDate: (date: Moment | string) => string;
|
|
26
27
|
export declare const getTimezones: (t?: ((key: string, fallback: string) => string) | null) => Array<MenuOption>;
|
|
27
28
|
export declare const generateAvailableYears: ({ marker, minDate, maxDate, rangeStartMonth, rangeEndMonth, }: {
|
|
28
29
|
marker: (typeof MARKERS)[keyof typeof MARKERS];
|
|
@@ -51,12 +52,12 @@ export declare const getValidDates: ({ selectedDateRange, minDate, maxDate, toda
|
|
|
51
52
|
validMaxDate: string;
|
|
52
53
|
validDateRange: DateRange;
|
|
53
54
|
};
|
|
54
|
-
export declare const isSame: (date1: string, date2: string, unit: "d" | "month") => boolean;
|
|
55
|
-
export declare const isBefore: (date1: string, date2: string) => boolean;
|
|
56
|
-
export declare const isAfter: (date1: string, date2: string) => boolean;
|
|
57
|
-
export declare const isSameOrBefore: (date1?: string | null, date2?: string | null, unit?: "d" | "month") => boolean;
|
|
58
|
-
export declare const isSameOrAfter: (date1?: string | null, date2?: string | null, unit?: "d" | "month") => boolean;
|
|
59
|
-
export declare const isBetween: (date: string, startRange: string, endRange: string) => boolean;
|
|
55
|
+
export declare const isSame: (date1: Moment | string | Date, date2: Moment | string | Date, unit: "d" | "month") => boolean;
|
|
56
|
+
export declare const isBefore: (date1: Moment | string | Date, date2: Moment | string | Date) => boolean;
|
|
57
|
+
export declare const isAfter: (date1: Moment | string | Date, date2: Moment | string | Date) => boolean;
|
|
58
|
+
export declare const isSameOrBefore: (date1?: Moment | string | Date | null, date2?: Moment | string | Date | null, unit?: "d" | "month") => boolean;
|
|
59
|
+
export declare const isSameOrAfter: (date1?: Moment | string | Date | null, date2?: Moment | string | Date | null, unit?: "d" | "month") => boolean;
|
|
60
|
+
export declare const isBetween: (date: Moment | string | Date, startRange: Moment | string | Date, endRange: Moment | string | Date) => boolean;
|
|
60
61
|
export declare const isValid: (date?: string | null) => boolean;
|
|
61
62
|
export declare const getFormattedDate: (marker: string, dateRange: DateRange, locale?: string) => string;
|
|
62
63
|
export declare const getTranslation: (t: ((key: string, fallback: string) => string) | null | undefined, labelToTranslate: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-range-picker.d.ts","sourceRoot":"","sources":["../../../src/utils/date-range-picker/date-range-picker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date-range-picker.d.ts","sourceRoot":"","sources":["../../../src/utils/date-range-picker/date-range-picker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAEnC,OAAO,KAAK,EACV,SAAS,EACT,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,QAAQ,EACT,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAKtD,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,KAAG,MAcvC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;EAG5B,CAAC;AACH,eAAO,MAAM,OAAO;;;EAGlB,CAAC;AACH,e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,EAClC,UAAU,MAAM,GAAG,MAAM,GAAG,IAAI,KAC/B,OAGqE,CAAC;AAGzE,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,GAAG,IAAI,KAAG,OACnB,CAAC;AAE7B,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,MAAM,EACd,WAAW,SAAS,EACpB,SAAS,MAAM,KACd,MAkBF,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,EACjE,kBAAkB,MAAM,KACvB,MACoE,CAAC"}
|
|
@@ -108,8 +108,7 @@ const wrangleMoment = date => {
|
|
|
108
108
|
} else if (!date) {
|
|
109
109
|
return new Date();
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
return date instanceof _moment.default ? date.toDate() : (0, _parseISO.default)(date);
|
|
111
|
+
return _moment.default.isMoment(date) ? date.toDate() : (0, _parseISO.default)(date);
|
|
113
112
|
};
|
|
114
113
|
exports.wrangleMoment = wrangleMoment;
|
|
115
114
|
const formatIsoDate = function (date) {
|
|
@@ -140,7 +139,6 @@ const inDateRange = (_ref3, date) => {
|
|
|
140
139
|
const momentDay = _moment.default.utc(date);
|
|
141
140
|
const momentStartDate = _moment.default.utc(startDate);
|
|
142
141
|
const momentEndDate = _moment.default.utc(endDate);
|
|
143
|
-
// @ts-ignore - TS2345 - Argument of type 'Moment' is not assignable to parameter of type 'string'.
|
|
144
142
|
return isBetween(momentDay, momentStartDate, momentEndDate);
|
|
145
143
|
}
|
|
146
144
|
return false;
|
|
@@ -164,10 +162,8 @@ const getMonthAndYear = date => {
|
|
|
164
162
|
const getDaysInMonth = date => {
|
|
165
163
|
const startWeek = _moment.default.utc(date).startOf('month').startOf('week');
|
|
166
164
|
const endWeek = _moment.default.utc(date).endOf('month').endOf('week');
|
|
167
|
-
const days = []
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
// @ts-ignore - TS2345 - Argument of type 'Moment' is not assignable to parameter of type 'string'.
|
|
165
|
+
const days = [];
|
|
166
|
+
const current = startWeek.clone();
|
|
171
167
|
while (isBefore(current, endWeek)) {
|
|
172
168
|
days.push(current.clone().format('YYYY-MM-DD'));
|
|
173
169
|
current.add(1, 'd');
|
|
@@ -176,10 +172,8 @@ const getDaysInMonth = date => {
|
|
|
176
172
|
|
|
177
173
|
// if total rows in calendar are 5 add one more week to the calendar
|
|
178
174
|
if (daysInChunks.length === 5) {
|
|
179
|
-
// @ts-ignore - TS2345 - Argument of type 'Moment' is not assignable to parameter of type 'string'.
|
|
180
175
|
const nextWeek = getAddedDate(endWeek, WEEKDAYS.length, 'd');
|
|
181
176
|
const extraDays = [];
|
|
182
|
-
// @ts-ignore - TS2345 - Argument of type 'Moment' is not assignable to parameter of type 'string'.
|
|
183
177
|
while (isSameOrBefore(current, nextWeek)) {
|
|
184
178
|
extraDays.push(current.clone().format('YYYY-MM-DD'));
|
|
185
179
|
current.add(1, 'd');
|
|
@@ -188,30 +182,18 @@ const getDaysInMonth = date => {
|
|
|
188
182
|
}
|
|
189
183
|
return daysInChunks;
|
|
190
184
|
};
|
|
191
|
-
|
|
192
|
-
// @ts-ignore - TS2345 - Argument of type 'Moment' is not assignable to parameter of type 'string | Date | undefined'.
|
|
193
185
|
exports.getDaysInMonth = getDaysInMonth;
|
|
194
|
-
const getAddedDate = (date, addCount, timeUnit
|
|
195
|
-
//@ts-expect-error
|
|
196
|
-
) => formatIsoDate(_moment.default.utc(date).add(addCount, timeUnit));
|
|
197
|
-
|
|
198
|
-
// @ts-ignore - TS2345 - Argument of type 'Moment' is not assignable to parameter of type 'string | Date | undefined'.
|
|
186
|
+
const getAddedDate = (date, addCount, timeUnit) => formatIsoDate(_moment.default.utc(date).add(addCount, timeUnit));
|
|
199
187
|
exports.getAddedDate = getAddedDate;
|
|
200
|
-
const getSubtractedDate = (date, subtractCount, timeUnit
|
|
201
|
-
//@ts-expect-error
|
|
202
|
-
) => formatIsoDate(_moment.default.utc(date).subtract(subtractCount, timeUnit));
|
|
203
|
-
|
|
204
|
-
// @ts-ignore - TS2345 - Argument of type 'Moment' is not assignable to parameter of type 'string | Date | undefined'.
|
|
188
|
+
const getSubtractedDate = (date, subtractCount, timeUnit) => formatIsoDate(_moment.default.utc(date).subtract(subtractCount, timeUnit));
|
|
205
189
|
exports.getSubtractedDate = getSubtractedDate;
|
|
206
|
-
const getMonthEndDate = date =>
|
|
207
|
-
//@ts-expect-error
|
|
208
|
-
formatIsoDate(_moment.default.utc(date).endOf('M'));
|
|
190
|
+
const getMonthEndDate = date => formatIsoDate(_moment.default.utc(date).endOf('M'));
|
|
209
191
|
exports.getMonthEndDate = getMonthEndDate;
|
|
210
192
|
const getTimezones = t => Object.keys(_timezones.TIMEZONES).reduce((menuOptions, key) => {
|
|
193
|
+
const label = _timezones.TIMEZONES[key];
|
|
211
194
|
menuOptions.push({
|
|
212
195
|
key,
|
|
213
|
-
|
|
214
|
-
label: getTranslation(t, _timezones.TIMEZONES[key])
|
|
196
|
+
label: getTranslation(t, label)
|
|
215
197
|
});
|
|
216
198
|
return menuOptions;
|
|
217
199
|
}, []);
|
|
@@ -252,21 +234,17 @@ const getAvailableMonths = _ref6 => {
|
|
|
252
234
|
const isFirstAndMinDateYearSame = rangeStartYear === minDateYear;
|
|
253
235
|
const isSecondAndMaxDateYearSame = rangeEndYear === maxDateYear;
|
|
254
236
|
if (marker === MARKERS.DATE_RANGE_START) {
|
|
255
|
-
|
|
256
|
-
if (isSameYear && month.key >= rangeEndMonthKey) {
|
|
237
|
+
if (isSameYear && Number(month.key) >= rangeEndMonthKey) {
|
|
257
238
|
return false;
|
|
258
|
-
|
|
259
|
-
} else if (isFirstAndMinDateYearSame && month.key < minDateMonth) {
|
|
239
|
+
} else if (isFirstAndMinDateYearSame && Number(month.key) < minDateMonth) {
|
|
260
240
|
return false;
|
|
261
241
|
} else {
|
|
262
242
|
return true;
|
|
263
243
|
}
|
|
264
244
|
} else {
|
|
265
|
-
|
|
266
|
-
if (isSameYear && month.key <= rangeStartMonthKey) {
|
|
245
|
+
if (isSameYear && Number(month.key) <= rangeStartMonthKey) {
|
|
267
246
|
return false;
|
|
268
|
-
|
|
269
|
-
} else if (isSecondAndMaxDateYearSame && month.key > maxDateMonth) {
|
|
247
|
+
} else if (isSecondAndMaxDateYearSame && Number(month.key) > maxDateMonth) {
|
|
270
248
|
return false;
|
|
271
249
|
} else {
|
|
272
250
|
return true;
|