@quillsql/react 2.11.20 → 2.11.23
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/cjs/Chart.d.ts +6 -0
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +13 -13
- package/dist/cjs/ChartBuilder.d.ts +16 -6
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +109 -44
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +8 -2
- package/dist/cjs/Dashboard.d.ts +3 -2
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.js +1 -1
- package/dist/cjs/ReportBuilder.d.ts +11 -1
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +75 -50
- package/dist/cjs/SQLEditor.d.ts +7 -1
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +3 -6
- package/dist/cjs/Table.d.ts +6 -0
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/Table.js +4 -4
- package/dist/cjs/components/Chart/BarChart.d.ts +2 -1
- package/dist/cjs/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.js +6 -4
- package/dist/cjs/components/Chart/BarList.d.ts +3 -2
- package/dist/cjs/components/Chart/BarList.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarList.js +3 -3
- package/dist/cjs/components/Chart/ChartError.d.ts +1 -1
- package/dist/cjs/components/Chart/ChartError.d.ts.map +1 -1
- package/dist/cjs/components/Chart/ChartError.js +2 -2
- package/dist/cjs/components/Chart/ChartSkeleton.d.ts +2 -1
- package/dist/cjs/components/Chart/ChartSkeleton.d.ts.map +1 -1
- package/dist/cjs/components/Chart/ChartSkeleton.js +2 -2
- package/dist/cjs/components/Chart/LineChart.d.ts +2 -1
- package/dist/cjs/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/LineChart.js +3 -3
- package/dist/cjs/components/Chart/PieChart.d.ts +1 -0
- package/dist/cjs/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/PieChart.js +4 -100
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts +2 -1
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardFilter.js +2 -2
- package/dist/cjs/components/QuillCard.d.ts +1 -1
- package/dist/cjs/components/QuillCard.d.ts.map +1 -1
- package/dist/cjs/components/QuillCard.js +1 -1
- package/dist/cjs/components/QuillSelect.d.ts +1 -1
- package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelect.js +5 -3
- package/dist/cjs/components/QuillTable.d.ts +2 -1
- package/dist/cjs/components/QuillTable.d.ts.map +1 -1
- package/dist/cjs/components/QuillTable.js +5 -5
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.js +2 -9
- package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddSortPopover.js +2 -2
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +4 -16
- package/dist/cjs/components/UiComponents.d.ts +9 -9
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +32 -17
- package/dist/cjs/internals/ReportBuilder/PivotList.d.ts +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotList.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotList.js +3 -3
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +25 -24
- package/dist/cjs/utils/color.d.ts +6 -0
- package/dist/cjs/utils/color.d.ts.map +1 -1
- package/dist/cjs/utils/color.js +98 -1
- package/dist/cjs/utils/valueFormatter.d.ts.map +1 -1
- package/dist/cjs/utils/valueFormatter.js +32 -2
- package/dist/esm/Chart.d.ts +6 -0
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +13 -13
- package/dist/esm/ChartBuilder.d.ts +16 -6
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +109 -44
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +8 -2
- package/dist/esm/Dashboard.d.ts +3 -2
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/QuillDateRangePicker.js +1 -1
- package/dist/esm/ReportBuilder.d.ts +11 -1
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +75 -50
- package/dist/esm/SQLEditor.d.ts +7 -1
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +3 -6
- package/dist/esm/Table.d.ts +6 -0
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/Table.js +4 -4
- package/dist/esm/components/Chart/BarChart.d.ts +2 -1
- package/dist/esm/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.js +7 -5
- package/dist/esm/components/Chart/BarList.d.ts +3 -2
- package/dist/esm/components/Chart/BarList.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarList.js +3 -3
- package/dist/esm/components/Chart/ChartError.d.ts +1 -1
- package/dist/esm/components/Chart/ChartError.d.ts.map +1 -1
- package/dist/esm/components/Chart/ChartError.js +2 -2
- package/dist/esm/components/Chart/ChartSkeleton.d.ts +2 -1
- package/dist/esm/components/Chart/ChartSkeleton.d.ts.map +1 -1
- package/dist/esm/components/Chart/ChartSkeleton.js +2 -2
- package/dist/esm/components/Chart/LineChart.d.ts +2 -1
- package/dist/esm/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/LineChart.js +3 -3
- package/dist/esm/components/Chart/PieChart.d.ts +1 -0
- package/dist/esm/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/PieChart.js +3 -99
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts +2 -1
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardFilter.js +2 -2
- package/dist/esm/components/QuillCard.d.ts +1 -1
- package/dist/esm/components/QuillCard.d.ts.map +1 -1
- package/dist/esm/components/QuillCard.js +1 -1
- package/dist/esm/components/QuillSelect.d.ts +1 -1
- package/dist/esm/components/QuillSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillSelect.js +5 -3
- package/dist/esm/components/QuillTable.d.ts +2 -1
- package/dist/esm/components/QuillTable.d.ts.map +1 -1
- package/dist/esm/components/QuillTable.js +5 -5
- package/dist/esm/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddColumnPopover.js +2 -9
- package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddSortPopover.js +2 -2
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +4 -16
- package/dist/esm/components/UiComponents.d.ts +9 -9
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +32 -17
- package/dist/esm/internals/ReportBuilder/PivotList.d.ts +1 -1
- package/dist/esm/internals/ReportBuilder/PivotList.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotList.js +3 -3
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +25 -24
- package/dist/esm/utils/color.d.ts +6 -0
- package/dist/esm/utils/color.d.ts.map +1 -1
- package/dist/esm/utils/color.js +96 -0
- package/dist/esm/utils/valueFormatter.d.ts.map +1 -1
- package/dist/esm/utils/valueFormatter.js +32 -2
- package/package.json +1 -1
|
@@ -5,7 +5,6 @@ import MemoizedQuillTable from '../QuillTable';
|
|
|
5
5
|
import { ThemeContext } from '../../Context';
|
|
6
6
|
import { isNodeEmptyCollection, allNumericNodesValidInTree } from './util';
|
|
7
7
|
import { downloadCSV } from '../../utils/csv';
|
|
8
|
-
import { snakeCaseToTitleCase } from '../../utils/textProcessing';
|
|
9
8
|
/**
|
|
10
9
|
* This file is a collection of basic UI components that conform to the shape
|
|
11
10
|
* expected by the Report Builder. Where possible, we use our existing
|
|
@@ -178,21 +177,10 @@ export const QuillSelectColumn = ({ label, isSelected, setSelected, DragHandle,
|
|
|
178
177
|
display: 'flex',
|
|
179
178
|
alignItems: 'center',
|
|
180
179
|
backgroundColor: theme?.backgroundColor || 'white',
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
textOverflow: 'ellipsis',
|
|
186
|
-
overflow: 'hidden',
|
|
187
|
-
}, children: [_jsx(MemoizedCheckbox, { isChecked: isSelected, onChange: () => setSelected() }), _jsx("span", { style: {
|
|
188
|
-
marginLeft: 6,
|
|
189
|
-
display: 'block',
|
|
190
|
-
whiteSpace: 'nowrap',
|
|
191
|
-
textOverflow: 'ellipsis',
|
|
192
|
-
overflow: 'hidden',
|
|
193
|
-
fontFamily: theme?.fontFamily,
|
|
194
|
-
color: theme?.primaryTextColor,
|
|
195
|
-
}, children: snakeCaseToTitleCase(label) })] })] }));
|
|
180
|
+
whiteSpace: 'nowrap',
|
|
181
|
+
textOverflow: 'ellipsis',
|
|
182
|
+
overflow: 'hidden',
|
|
183
|
+
}, children: [_jsx(DragHandle, { dragIcon: QuillHandleButton }), _jsx(MemoizedCheckbox, { isChecked: isSelected, label: label, onChange: () => setSelected() })] }));
|
|
196
184
|
};
|
|
197
185
|
/**
|
|
198
186
|
* A draggable card with a grab-handle and a column name
|
|
@@ -59,19 +59,18 @@ export interface ContainerComponentProps {
|
|
|
59
59
|
*/
|
|
60
60
|
export declare const QuillTextInput: ({ id, value, width, placeholder, onChange, }: TextInputComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
61
61
|
export declare const MemoizedTextInput: ({ value, onChange, placeholder, id, }: TextInputComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
-
export declare const MemoizedButton: ({ label, onClick,
|
|
63
|
-
label:
|
|
64
|
-
onClick:
|
|
65
|
-
primary?: boolean | undefined;
|
|
66
|
-
isLoading?: boolean | undefined;
|
|
62
|
+
export declare const MemoizedButton: ({ label, onClick, }: {
|
|
63
|
+
label: string;
|
|
64
|
+
onClick: () => void;
|
|
67
65
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
-
export declare const MemoizedSecondaryButton: ({ label, onClick }: {
|
|
69
|
-
label:
|
|
70
|
-
onClick:
|
|
66
|
+
export declare const MemoizedSecondaryButton: ({ label, onClick, }: {
|
|
67
|
+
label: string;
|
|
68
|
+
onClick: () => void;
|
|
71
69
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
72
70
|
export interface SelectComponentProps {
|
|
73
71
|
value: string;
|
|
74
72
|
label?: string;
|
|
73
|
+
width: number;
|
|
75
74
|
options: {
|
|
76
75
|
value: string;
|
|
77
76
|
label: string;
|
|
@@ -88,9 +87,10 @@ export interface LabelComponentProps {
|
|
|
88
87
|
export declare const MemoizedLabel: ({ label }: LabelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
89
88
|
export interface CheckboxComponentProps {
|
|
90
89
|
isChecked: boolean;
|
|
90
|
+
label: string;
|
|
91
91
|
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
92
92
|
}
|
|
93
|
-
export declare const MemoizedCheckbox: ({ isChecked, onChange, }: CheckboxComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
export declare const MemoizedCheckbox: ({ isChecked, label, onChange, }: CheckboxComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
94
94
|
export declare const DEFAULT_TAB_OPTIONS: {
|
|
95
95
|
label: string;
|
|
96
96
|
value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiComponents.d.ts","sourceRoot":"","sources":["../../../src/components/UiComponents.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,WAAW,EAEX,SAAS,EAMV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UiComponents.d.ts","sourceRoot":"","sources":["../../../src/components/UiComponents.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,WAAW,EAEX,SAAS,EAMV,MAAM,OAAO,CAAC;AAOf,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAA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E,OAAO,KAAK,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,GAAG,CAAC,OAAO,CA2Fd;AAED,eAAO,MAAM,oBAAoB,iBAE9B,0BAA0B,4CAyB5B,CAAC;AAEF,eAAO,MAAM,cAAc,+CAwD1B,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,CAAC;IAC/B,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,mBAAmB,kCAI7B,mBAAmB,4CASrB,CAAC;AAEF,eAAO,MAAM,4BAA4B,+CAAgB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useContext, useEffect, useRef, } from 'react';
|
|
4
4
|
import { XIcon } from '../assets';
|
|
5
5
|
import { ThemeContext } from '../Context';
|
|
6
|
+
import { useTheme } from '../hooks';
|
|
6
7
|
import QuillTable from './QuillTable';
|
|
7
8
|
/**
|
|
8
9
|
* The fallback TextInput element for Quill.
|
|
@@ -46,7 +47,7 @@ export const MemoizedTextInput = ({ value, onChange, placeholder, id, }) => {
|
|
|
46
47
|
box-sizing: border-box;
|
|
47
48
|
}` }), _jsx("input", { id: id, className: "quill-text-input", type: "text", value: value, onChange: onChange, placeholder: placeholder, style: { fontFamily: theme?.fontFamily } })] }));
|
|
48
49
|
};
|
|
49
|
-
export const MemoizedButton = ({ label, onClick,
|
|
50
|
+
export const MemoizedButton = ({ label, onClick, }) => {
|
|
50
51
|
const [theme] = useContext(ThemeContext);
|
|
51
52
|
return (_jsxs("button", { className: "quill-button", onClick: onClick, style: { fontFamily: theme?.fontFamily }, children: [_jsx("style", { children: `
|
|
52
53
|
.quill-button {
|
|
@@ -66,9 +67,9 @@ export const MemoizedButton = ({ label, onClick, primary = true, isLoading = fal
|
|
|
66
67
|
.quill-button:hover {
|
|
67
68
|
background-color: rgba(56, 65, 81, 0.9);
|
|
68
69
|
border-radius: 6px;
|
|
69
|
-
}` }),
|
|
70
|
+
}` }), label] }));
|
|
70
71
|
};
|
|
71
|
-
export const MemoizedSecondaryButton = ({ label, onClick }) => {
|
|
72
|
+
export const MemoizedSecondaryButton = ({ label, onClick, }) => {
|
|
72
73
|
const [theme] = useContext(ThemeContext);
|
|
73
74
|
return (_jsxs("button", { className: "quill-secondary-button", onClick: onClick, style: { fontFamily: theme?.fontFamily }, children: [_jsx("style", { children: `
|
|
74
75
|
.quill-secondary-button {
|
|
@@ -109,11 +110,30 @@ export const MemoizedLabel = ({ label }) => {
|
|
|
109
110
|
fontFamily: theme?.fontFamily,
|
|
110
111
|
color: theme?.secondaryTextColor || '#575E6A',
|
|
111
112
|
userSelect: 'none',
|
|
112
|
-
paddingBottom: 5,
|
|
113
113
|
margin: 0,
|
|
114
114
|
}, children: label }));
|
|
115
115
|
};
|
|
116
|
-
export const MemoizedCheckbox = ({ isChecked, onChange, }) =>
|
|
116
|
+
export const MemoizedCheckbox = ({ isChecked, label, onChange, }) => {
|
|
117
|
+
const theme = useTheme();
|
|
118
|
+
return (_jsxs("label", { style: {
|
|
119
|
+
display: 'flex',
|
|
120
|
+
width: '100%',
|
|
121
|
+
whiteSpace: 'nowrap',
|
|
122
|
+
textOverflow: 'ellipsis',
|
|
123
|
+
overflow: 'hidden',
|
|
124
|
+
gap: 4,
|
|
125
|
+
}, children: [_jsx("input", { type: "checkbox", checked: isChecked, onChange: onChange, style: { width: '14px', height: '14px', margin: 'auto 0' } }), _jsx("span", { style: {
|
|
126
|
+
display: 'block',
|
|
127
|
+
marginTop: 'auto',
|
|
128
|
+
marginBottom: 'auto',
|
|
129
|
+
marginLeft: '6px',
|
|
130
|
+
whiteSpace: 'nowrap',
|
|
131
|
+
textOverflow: 'ellipsis',
|
|
132
|
+
overflow: 'hidden',
|
|
133
|
+
fontFamily: theme?.fontFamily,
|
|
134
|
+
color: theme?.primaryTextColor,
|
|
135
|
+
}, children: label })] }));
|
|
136
|
+
};
|
|
117
137
|
export const DEFAULT_TAB_OPTIONS = [
|
|
118
138
|
{ label: 'or', value: 'OR' },
|
|
119
139
|
{ label: 'and', value: 'AND' },
|
|
@@ -134,14 +154,12 @@ export const QuillTabs = ({ options = DEFAULT_TAB_OPTIONS, value, onChange, }) =
|
|
|
134
154
|
outlineStyle: 'none',
|
|
135
155
|
transitionProperty: 'background-color, border-color, color, fill, stroke, opacity, box-shadow, transform',
|
|
136
156
|
transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',
|
|
137
|
-
transitionDuration:
|
|
138
|
-
borderColor: '#e7e7e7',
|
|
157
|
+
transitionDuration: '300ms',
|
|
139
158
|
margin: '0px',
|
|
140
159
|
paddingTop: '0.375rem',
|
|
141
160
|
paddingBottom: '0.375rem',
|
|
142
161
|
paddingLeft: '0.75rem',
|
|
143
162
|
paddingRight: '0.75rem',
|
|
144
|
-
color: '12px',
|
|
145
163
|
...(option.value === value
|
|
146
164
|
? {
|
|
147
165
|
fontWeight: 700,
|
|
@@ -244,16 +262,10 @@ export function MemoizedModal({ isOpen, setIsOpen, title, children, width, heigh
|
|
|
244
262
|
}, children: _jsxs("div", { style: {
|
|
245
263
|
width: '100%',
|
|
246
264
|
height: '100%',
|
|
247
|
-
maxWidth: 'calc(100vw - 82px)',
|
|
248
|
-
maxHeight: 'calc(100vh - 82px)',
|
|
249
265
|
overflowY: 'scroll',
|
|
250
|
-
// maxWidth: "700px",
|
|
251
266
|
backgroundColor: '#ffffff',
|
|
252
|
-
// padding: "20px",
|
|
253
|
-
// borderRadius: "8px",
|
|
254
267
|
display: 'flex',
|
|
255
268
|
flexDirection: 'column',
|
|
256
|
-
// alignItems: 'center',
|
|
257
269
|
position: 'relative',
|
|
258
270
|
fontFamily: theme?.fontFamily,
|
|
259
271
|
}, children: [_jsxs("div", { id: "quill-modal-header", style: {
|
|
@@ -262,15 +274,18 @@ export function MemoizedModal({ isOpen, setIsOpen, title, children, width, heigh
|
|
|
262
274
|
width: '100%',
|
|
263
275
|
justifyContent: 'space-between',
|
|
264
276
|
alignItems: 'center',
|
|
277
|
+
padding: 10,
|
|
265
278
|
}, children: [_jsx("h2", { style: {
|
|
266
279
|
fontSize: 18,
|
|
267
280
|
fontWeight: '600',
|
|
268
|
-
marginLeft: 20,
|
|
269
281
|
// width: '90%',
|
|
270
282
|
textAlign: 'left',
|
|
271
|
-
|
|
283
|
+
paddingLeft: 10,
|
|
272
284
|
color: theme?.primaryTextColor,
|
|
273
|
-
}, children: title }), _jsx(
|
|
285
|
+
}, children: title }), _jsx(MemoizedDeleteButton, { onClick: () => setIsOpen(false) })] }), _jsx("div", { style: {
|
|
286
|
+
height: 'calc(100% - 60px)', // full height minus title
|
|
287
|
+
width: '100%', // full width minus margin
|
|
288
|
+
}, children: children })] }) })] }));
|
|
274
289
|
}
|
|
275
290
|
export const MemoizedDeleteButton = ({ onClick, }) => (_jsxs("button", { className: "quill-delete-button", type: "button", onClick: onClick, style: {
|
|
276
291
|
height: 40,
|
|
@@ -9,7 +9,7 @@ export declare const PivotCard: ({ pivotTable, theme, index, onSelectPivot, sele
|
|
|
9
9
|
ButtonComponent: any;
|
|
10
10
|
showEdit?: boolean | undefined;
|
|
11
11
|
clickable?: boolean | undefined;
|
|
12
|
-
onClose
|
|
12
|
+
onClose: any;
|
|
13
13
|
minHeight?: number | undefined;
|
|
14
14
|
CardComponent?: typeof QuillCard | undefined;
|
|
15
15
|
LabelComponent: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PivotList.d.ts","sourceRoot":"","sources":["../../../../src/internals/ReportBuilder/PivotList.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"PivotList.d.ts","sourceRoot":"","sources":["../../../../src/internals/ReportBuilder/PivotList.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;6CAmNrB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;6CAqFrB,CAAC"}
|
|
@@ -3,9 +3,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { quillFormat } from '../../utils/valueFormatter';
|
|
4
4
|
import { snakeCaseToTitleCase } from '../../utils/textProcessing';
|
|
5
5
|
import { QuillCard } from '../../components/QuillCard';
|
|
6
|
-
export const PivotCard = ({ pivotTable, theme, index, onSelectPivot, selectedPivotIndex, onEditPivot, ButtonComponent, showEdit = false, clickable = true, onClose
|
|
6
|
+
export const PivotCard = ({ pivotTable, theme, index, onSelectPivot, selectedPivotIndex, onEditPivot, ButtonComponent, showEdit = false, clickable = true, onClose, minHeight = 0, CardComponent = QuillCard, LabelComponent, TextComponent, HeaderComponent, }) => {
|
|
7
7
|
const maxRowsInPivotPeak = 5;
|
|
8
|
-
return (_jsx(CardComponent, { onClick: () => onSelectPivot(pivotTable.pivot, index), onDelete: onClose, children: _jsxs("div", { style: {
|
|
8
|
+
return (_jsx(CardComponent, { onClick: onSelectPivot ? () => onSelectPivot(pivotTable.pivot, index) : undefined, onDelete: onClose, children: _jsxs("div", { style: {
|
|
9
9
|
fontSize: 14,
|
|
10
10
|
display: 'flex',
|
|
11
11
|
flexDirection: 'column',
|
|
@@ -84,5 +84,5 @@ export const PivotList = ({ recommendedPivotTables, createdPivotTables, onSelect
|
|
|
84
84
|
justifyContent: 'center',
|
|
85
85
|
alignItems: 'center',
|
|
86
86
|
width: '100%',
|
|
87
|
-
}, children: "Create pivot +" }) }))] }) }));
|
|
87
|
+
}, children: _jsx(LabelComponent, { label: "Create pivot +" }) }) }))] }) }));
|
|
88
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PivotModal.d.ts","sourceRoot":"","sources":["../../../../src/internals/ReportBuilder/PivotModal.tsx"],"names":[],"mappings":"AACA,OAAc,EAOZ,SAAS,EACV,MAAM,OAAO,CAAC;AAuBf,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAkBD,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;IACtB,gBAAgB,EAAE,GAAG,CAAC;IACtB,mBAAmB,EAAE,GAAG,CAAC;IACzB,eAAe,EAAE,GAAG,CAAC;IACrB,kBAAkB,EAAE,GAAG,CAAC;IACxB,gBAAgB,EAAE,GAAG,CAAC;IACtB,mBAAmB,EAAE,GAAG,CAAC;IACzB,UAAU,EAAE,GAAG,CAAC;IAChB,aAAa,EAAE,GAAG,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC;IACnB,eAAe,EAAE,GAAG,CAAC;IACrB,eAAe,EAAE,GAAG,CAAC;IACrB,aAAa,EAAE,GAAG,CAAC;IACnB,wBAAwB,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,GAAG,CAAC,OAAO,CAAC;IACv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BAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,GAAG,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,UAAU,qsBA4CpB,eAAe,4CA+rBjB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA,EAAE,MAAM,KAAA,OAyB1D;AAkHD,wBAAgB,WAAW,CAAC,SAAS,KAAA,WAYpC;AAgCD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,GAAG,EACT,SAAS,EAAE,GAAG,EACd,YAAY,EAAE,OAAO,EACrB,QAAQ,SAAK,EACb,SAAS,GAAE,GAAU;;;;;;EAubtB"}
|
|
@@ -248,11 +248,17 @@ export const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField,
|
|
|
248
248
|
setPopUpTitle('Add Pivot');
|
|
249
249
|
}
|
|
250
250
|
setIsOpen(isOpen);
|
|
251
|
-
},
|
|
251
|
+
}, popoverTitle: showUpdatePivot ? popUpTitle : 'Recommended pivots', popoverChildren: _jsx("div", { style: {
|
|
252
|
+
paddingTop: showUpdatePivot ? 0 : 20,
|
|
253
|
+
position: 'relative',
|
|
254
|
+
}, children: showUpdatePivot ? (_jsxs("div", { className: "ref-in-use", ref: editModalRef, style: {
|
|
252
255
|
backgroundColor: 'rgb(255, 255, 255)',
|
|
253
256
|
display: 'flex',
|
|
254
257
|
flexDirection: 'column',
|
|
255
|
-
}, children: [_jsx(
|
|
258
|
+
}, children: [_jsx("div", { style: { height: 12 } }), _jsx("div", { style: { width: divWidth }, children: samplePivotTable && (_jsx("div", { style: {
|
|
259
|
+
marginBottom: 20,
|
|
260
|
+
minHeight: 160,
|
|
261
|
+
}, children: _jsx(PivotCard, { pivotTable: samplePivotTable, theme: theme, index: 0, selectedPivotIndex: -1, onEditPivot: () => { }, ButtonComponent: ButtonComponent, showEdit: false, clickable: false, minHeight: 140, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent, CardComponent: CardComponent }) })) }), _jsxs("div", { style: {
|
|
256
262
|
display: 'flex',
|
|
257
263
|
flexDirection: 'column',
|
|
258
264
|
gap: 10,
|
|
@@ -274,7 +280,7 @@ export const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField,
|
|
|
274
280
|
dateFormatOptions.includes(format) ||
|
|
275
281
|
isIdColumn(option.value));
|
|
276
282
|
}),
|
|
277
|
-
] })] }), _jsxs("div", { children: [_jsx(LabelComponent, { label: "Column Field" }), _jsx(SelectComponent, { id: "pivot-row-field", value: pivotColumnField, onChange: (e) => {
|
|
283
|
+
], width: 200 })] }), _jsxs("div", { children: [_jsx(LabelComponent, { label: "Column Field" }), _jsx(SelectComponent, { id: "pivot-row-field", value: pivotColumnField, onChange: (e) => {
|
|
278
284
|
setPivotColumnField(e.target.value === ''
|
|
279
285
|
? undefined
|
|
280
286
|
: e.target.value);
|
|
@@ -282,7 +288,7 @@ export const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField,
|
|
|
282
288
|
...columnSelectOptions.filter((option) => {
|
|
283
289
|
return (columns.find((col) => col.field === option.value)?.format === 'string');
|
|
284
290
|
}),
|
|
285
|
-
] })] })] }), _jsxs("div", { style: {
|
|
291
|
+
], width: 200 })] })] }), _jsxs("div", { style: {
|
|
286
292
|
display: 'flex',
|
|
287
293
|
flexDirection: 'row',
|
|
288
294
|
gap: 20,
|
|
@@ -297,7 +303,7 @@ export const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField,
|
|
|
297
303
|
numberFormatOptions.includes(columns.find((col) => col.field === option.value)?.format)) &&
|
|
298
304
|
!isIdColumn(option.value));
|
|
299
305
|
}),
|
|
300
|
-
] })] }), _jsxs("div", { children: [_jsx(LabelComponent, { label: "Aggregation Type" }), _jsx(SelectComponent, { id: "pivot-row-field", value: pivotAggregation, onChange: (e) => {
|
|
306
|
+
], width: 200 })] }), _jsxs("div", { children: [_jsx(LabelComponent, { label: "Aggregation Type" }), _jsx(SelectComponent, { id: "pivot-row-field", value: pivotAggregation, onChange: (e) => {
|
|
301
307
|
if (e.target.value !== 'count' &&
|
|
302
308
|
pivotValueField &&
|
|
303
309
|
!numberFormatOptions.includes(columns.find((col) => col.field === pivotValueField)?.format)) {
|
|
@@ -310,7 +316,7 @@ export const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField,
|
|
|
310
316
|
...['sum', 'average', 'count', 'max', 'min'].map((option) => {
|
|
311
317
|
return { label: option, value: option };
|
|
312
318
|
}),
|
|
313
|
-
] })] })] })] }), _jsx("div", { children: _jsx(ButtonComponent, { id: "custom-button", onClick: () => {
|
|
319
|
+
], width: 200 })] })] })] }), _jsx("div", { children: _jsx(ButtonComponent, { id: "custom-button", onClick: () => {
|
|
314
320
|
const errors = [];
|
|
315
321
|
if (!pivotValueField && pivotAggregation !== 'count') {
|
|
316
322
|
errors.push("Value field cannot be empty when aggregation is not 'count'");
|
|
@@ -366,24 +372,19 @@ export const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField,
|
|
|
366
372
|
columns: selectedPivotTable?.columns,
|
|
367
373
|
}, theme: theme, index: 0, onSelectPivot: () => { }, selectedPivotIndex: -1, onEditPivot: () => { }, ButtonComponent: ButtonComponent, showEdit: false, onClose: () => {
|
|
368
374
|
removePivot();
|
|
369
|
-
}, clickable: true, minHeight: 180, CardComponent: CardComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }) }) })) : (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
whiteSpace: 'nowrap',
|
|
383
|
-
alignItems: 'center',
|
|
384
|
-
gap: 6,
|
|
385
|
-
fontSize: 14,
|
|
386
|
-
}, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", style: { width: 16, height: 16 }, children: _jsx("path", { fillRule: "evenodd", d: "M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5ZM16.5 15a.75.75 0 0 1 .712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 0 1 0 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 0 1-1.422 0l-.395-1.183a1.5 1.5 0 0 0-.948-.948l-1.183-.395a.75.75 0 0 1 0-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0 1 16.5 15Z", clipRule: "evenodd" }) }), "Regenerate"] }) }) })] }), isLoading ? (_jsxs("div", { style: {
|
|
375
|
+
}, clickable: true, minHeight: 180, CardComponent: CardComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }) }) })) : (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: {
|
|
376
|
+
// position button inline with the popover title
|
|
377
|
+
position: 'absolute',
|
|
378
|
+
top: -36,
|
|
379
|
+
right: 0,
|
|
380
|
+
}, children: _jsx(SecondaryButtonComponent, { onClick: refreshPivots, label: _jsxs("div", { style: {
|
|
381
|
+
display: 'flex',
|
|
382
|
+
flexDirection: 'row',
|
|
383
|
+
whiteSpace: 'nowrap',
|
|
384
|
+
alignItems: 'center',
|
|
385
|
+
gap: 6,
|
|
386
|
+
fontSize: 14,
|
|
387
|
+
}, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", style: { width: 16, height: 16 }, children: _jsx("path", { fillRule: "evenodd", d: "M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5ZM16.5 15a.75.75 0 0 1 .712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 0 1 0 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 0 1-1.422 0l-.395-1.183a1.5 1.5 0 0 0-.948-.948l-1.183-.395a.75.75 0 0 1 0-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0 1 16.5 15Z", clipRule: "evenodd" }) }), "Regenerate"] }) }) }), isLoading ? (_jsxs("div", { style: {
|
|
387
388
|
background: theme.backgroundColor,
|
|
388
389
|
width: 250,
|
|
389
390
|
minWidth: 250,
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates an array of colors by interpolating between colors in the given array.
|
|
3
|
+
* @param colors - The array of colors to interpolate between.
|
|
4
|
+
* @param length - The desired length of the resulting array.
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateArrayFromColor(colors: string | string[], length: number): string[];
|
|
1
7
|
declare const colorValues: readonly ["red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"];
|
|
2
8
|
export type Color = (typeof colorValues)[number];
|
|
3
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/utils/color.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW,mKAkBP,CAAC;AAEX,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,UAuBxE;AAyDD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,UAK5C;AAwJD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,YA4B9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,YAuB9C"}
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/utils/color.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EACzB,MAAM,EAAE,MAAM,GACb,MAAM,EAAE,CAwBV;AA6ED,QAAA,MAAM,WAAW,mKAkBP,CAAC;AAEX,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,UAuBxE;AAyDD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,UAK5C;AAwJD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,YA4B9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,YAuB9C"}
|
package/dist/esm/utils/color.js
CHANGED
|
@@ -1,3 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates an array of colors by interpolating between colors in the given array.
|
|
3
|
+
* @param colors - The array of colors to interpolate between.
|
|
4
|
+
* @param length - The desired length of the resulting array.
|
|
5
|
+
*/
|
|
6
|
+
export function generateArrayFromColor(colors, length) {
|
|
7
|
+
if (typeof colors === 'string') {
|
|
8
|
+
return monochromaticInterpolation(colors, length);
|
|
9
|
+
}
|
|
10
|
+
if (colors.length === 1) {
|
|
11
|
+
return monochromaticInterpolation(colors[0], length);
|
|
12
|
+
}
|
|
13
|
+
const pairs = colors.length - 1;
|
|
14
|
+
const needed = length - colors.length;
|
|
15
|
+
const baseAmount = Math.floor(needed / pairs);
|
|
16
|
+
const extras = needed % pairs;
|
|
17
|
+
let result = [];
|
|
18
|
+
let i = 0;
|
|
19
|
+
let j = 1;
|
|
20
|
+
while (j < colors.length) {
|
|
21
|
+
const additional = i < extras ? 1 : 0;
|
|
22
|
+
const interpLength = 2 + baseAmount + additional;
|
|
23
|
+
const interp = interpolateBetween(colors[i], colors[j], interpLength);
|
|
24
|
+
const lastIndex = j === colors.length - 1 ? undefined : -1;
|
|
25
|
+
result = result.concat(interp.slice(0, lastIndex));
|
|
26
|
+
i++;
|
|
27
|
+
j++;
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
function hexToRgb(hex) {
|
|
32
|
+
const r = parseInt(hex.substring(1, 3), 16);
|
|
33
|
+
const g = parseInt(hex.substring(3, 5), 16);
|
|
34
|
+
const b = parseInt(hex.substring(5, 7), 16);
|
|
35
|
+
return { r, g, b };
|
|
36
|
+
}
|
|
37
|
+
function rgbToHex(rgb) {
|
|
38
|
+
const rHex = rgb.r.toString(16).padStart(2, '0');
|
|
39
|
+
const gHex = rgb.g.toString(16).padStart(2, '0');
|
|
40
|
+
const bHex = rgb.b.toString(16).padStart(2, '0');
|
|
41
|
+
return `#${rHex}${gHex}${bHex}`;
|
|
42
|
+
}
|
|
43
|
+
function colorToHSL(color) {
|
|
44
|
+
const colorHex = namedColorToHex(color);
|
|
45
|
+
const { r, g, b } = hexToRgb(colorHex);
|
|
46
|
+
return rgbToHsl(r, g, b);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Interpolates between two colors using HSL color space.
|
|
50
|
+
* @param leftColor - The left color in hexadecimal format.
|
|
51
|
+
* @param rightColor - The right color in hexadecimal format.
|
|
52
|
+
* @param length - The number of interpolated colors to generate between the
|
|
53
|
+
* left and right colors.
|
|
54
|
+
*/
|
|
55
|
+
function interpolateBetween(leftColor, rightColor, length = 3) {
|
|
56
|
+
const [h, s, _l] = colorToHSL(leftColor);
|
|
57
|
+
const [h2, s2, _l2] = colorToHSL(rightColor);
|
|
58
|
+
const hues = linspace(h, h2, length);
|
|
59
|
+
const saturations = linspace(s, s2, length);
|
|
60
|
+
const lightnesses = linspace(_l, _l2, length);
|
|
61
|
+
return Array.from({ length }).map((_, i) => {
|
|
62
|
+
const [r, g, b] = HSLtoRGB(hues[i], saturations[i], lightnesses[i]);
|
|
63
|
+
return rgbToHex({ r: Math.round(r), g: Math.round(g), b: Math.round(b) });
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Generates monochromatic interpolation of a given color.
|
|
68
|
+
* @param color - The base color in hexadecimal format.
|
|
69
|
+
* @param length - The number of interpolated colors to generate.
|
|
70
|
+
*/
|
|
71
|
+
function monochromaticInterpolation(color, length) {
|
|
72
|
+
const [h, s, _l] = colorToHSL(color);
|
|
73
|
+
const hues = linspace(h, h, length);
|
|
74
|
+
const saturations = linspace(s, s, length);
|
|
75
|
+
const lightnesses = linspace(0.6, 0.9, length);
|
|
76
|
+
return Array.from({ length }).map((_, i) => {
|
|
77
|
+
const [r, g, b] = HSLtoRGB(hues[i], saturations[i], lightnesses[i]);
|
|
78
|
+
return rgbToHex({ r: Math.round(r), g: Math.round(g), b: Math.round(b) });
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Generates an array of numbers linearly spaced between start and end.
|
|
83
|
+
* @param start - The starting number of the sequence.
|
|
84
|
+
* @param end - The end number of the sequence.
|
|
85
|
+
* @param num - The number of samples to generate.
|
|
86
|
+
*/
|
|
87
|
+
function linspace(start, end, num) {
|
|
88
|
+
if (num <= 1)
|
|
89
|
+
return [start];
|
|
90
|
+
const step = (end - start) / (num - 1);
|
|
91
|
+
const result = new Array(num);
|
|
92
|
+
for (let i = 0; i < num; i++) {
|
|
93
|
+
result[i] = start + step * i;
|
|
94
|
+
}
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
1
97
|
const colorValues = [
|
|
2
98
|
'red',
|
|
3
99
|
'orange',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueFormatter.d.ts","sourceRoot":"","sources":["../../../src/utils/valueFormatter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACjC,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAQ7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,6BAA8B,KAAK,KAAG,MAwChE,CAAC;AAEF,eAAO,MAAM,WAAW;WAIf,GAAG;YACF,MAAM;MACZ,MAoCH,CAAC;
|
|
1
|
+
{"version":3,"file":"valueFormatter.d.ts","sourceRoot":"","sources":["../../../src/utils/valueFormatter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACjC,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAQ7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,6BAA8B,KAAK,KAAG,MAwChE,CAAC;AAEF,eAAO,MAAM,WAAW;WAIf,GAAG;YACF,MAAM;MACZ,MAoCH,CAAC;AAyKF,eAAO,MAAM,aAAa;;;;WAGhB,MAAM,KACb,MAoCF,CAAC"}
|
|
@@ -218,6 +218,26 @@ const format_wo_yyyy = (value) => {
|
|
|
218
218
|
return 'Invalid date';
|
|
219
219
|
return `${getWeek(utcDate)},${utcDate.getFullYear()}`;
|
|
220
220
|
};
|
|
221
|
+
/**
|
|
222
|
+
* Parses a numeric string back into a number, taking into account that
|
|
223
|
+
* users in different locales will format numbers differently (eg. 1,234 means
|
|
224
|
+
* something different from 1.234 in different countries).
|
|
225
|
+
*
|
|
226
|
+
* see: https://stackoverflow.com/a/45309230/9566888
|
|
227
|
+
*/
|
|
228
|
+
function parseNumber(value) {
|
|
229
|
+
if (typeof value === 'number')
|
|
230
|
+
return value;
|
|
231
|
+
if (typeof value !== 'string')
|
|
232
|
+
return Number.NaN;
|
|
233
|
+
const example = localeFormatter.format(1.1);
|
|
234
|
+
const cleanPattern = new RegExp(`[^-+0-9${example.charAt(1)}]`, 'g');
|
|
235
|
+
const cleaned = value.replace(cleanPattern, '');
|
|
236
|
+
const normalized = cleaned.replace(example.charAt(1), '.');
|
|
237
|
+
return parseFloat(normalized);
|
|
238
|
+
}
|
|
239
|
+
// Moved this out of parseNumber for perf reasons
|
|
240
|
+
const localeFormatter = Intl.NumberFormat(typeof navigator !== 'undefined' ? navigator.language : 'en-US');
|
|
221
241
|
export const compareValues = (a, b, column) => {
|
|
222
242
|
const valueA = a[column];
|
|
223
243
|
const valueB = b[column];
|
|
@@ -231,9 +251,19 @@ export const compareValues = (a, b, column) => {
|
|
|
231
251
|
else if (valueB === null) {
|
|
232
252
|
return 1; // ValueB is null, consider it smaller
|
|
233
253
|
}
|
|
254
|
+
// Undefined checks
|
|
255
|
+
if (valueA === undefined && valueB === undefined) {
|
|
256
|
+
return 0; // Both values are undefined, consider them equal
|
|
257
|
+
}
|
|
258
|
+
else if (valueA === undefined) {
|
|
259
|
+
return -1; // ValueA is undefined, consider it smaller
|
|
260
|
+
}
|
|
261
|
+
else if (valueB === undefined) {
|
|
262
|
+
return 1; // ValueB is undefined, consider it smaller
|
|
263
|
+
}
|
|
234
264
|
// For numbers
|
|
235
|
-
if (!isNaN(valueA) && !isNaN(valueB)) {
|
|
236
|
-
return valueA - valueB;
|
|
265
|
+
if (!isNaN(parseNumber(valueA)) && !isNaN(parseNumber(valueB))) {
|
|
266
|
+
return parseNumber(valueA) - parseNumber(valueB);
|
|
237
267
|
}
|
|
238
268
|
// For dates
|
|
239
269
|
const dateA = new Date(valueA);
|