@quillsql/react 1.7.1 → 1.7.3
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/lib/AddToDashboardModal.js +2 -2
- package/lib/AddToDashboardModal.js.map +1 -1
- package/lib/Chart.d.ts +0 -1
- package/lib/Chart.js +5 -15
- package/lib/Chart.js.map +1 -1
- package/lib/Context.d.ts +1 -2
- package/lib/Context.js +1 -3
- package/lib/Context.js.map +1 -1
- package/lib/Dashboard.js +5 -5
- package/lib/Dashboard.js.map +1 -1
- package/lib/PieChart.js +2 -2
- package/lib/PieChart.js.map +1 -1
- package/lib/QuillProvider.d.ts +1 -2
- package/lib/QuillProvider.js +2 -2
- package/lib/QuillProvider.js.map +1 -1
- package/lib/ReportBuilder.js +2 -2
- package/lib/ReportBuilder.js.map +1 -1
- package/lib/SQLEditor.js +4 -5
- package/lib/SQLEditor.js.map +1 -1
- package/lib/Table.js +2 -12
- package/lib/Table.js.map +1 -1
- package/lib/hooks/useQuill.js +2 -2
- package/lib/hooks/useQuill.js.map +1 -1
- package/lib/lib/font.d.ts +13 -0
- package/lib/lib/font.js +17 -0
- package/lib/lib/font.js.map +1 -0
- package/lib/lib/index.d.ts +3 -0
- package/lib/lib/index.js +20 -0
- package/lib/lib/index.js.map +1 -0
- package/lib/lib/inputTypes.d.ts +20 -0
- package/lib/lib/inputTypes.js +57 -0
- package/lib/lib/inputTypes.js.map +1 -0
- package/lib/lib/utils.d.ts +9 -0
- package/lib/lib/utils.js +46 -0
- package/lib/lib/utils.js.map +1 -0
- package/package.json +6 -13
- package/src/AddToDashboardModal.tsx +2 -9
- package/src/Chart.tsx +49 -20
- package/src/Context.tsx +0 -3
- package/src/Dashboard.tsx +2 -3
- package/src/PieChart.tsx +2 -2
- package/src/QuillProvider.tsx +0 -3
- package/src/ReportBuilder.tsx +3 -9
- package/src/SQLEditor.tsx +99 -12
- package/src/Table.tsx +51 -8
- package/src/hooks/useQuill.ts +1 -2
- package/src/lib/font.ts +14 -0
- package/src/lib/index.ts +3 -0
- package/src/lib/inputTypes.ts +81 -0
- package/src/lib/utils.tsx +46 -0
- package/tsconfig.json +3 -3
- package/rollup.config.ts +0 -21
package/src/hooks/useQuill.ts
CHANGED
|
@@ -74,14 +74,13 @@ export const useQuill = (
|
|
|
74
74
|
environment,
|
|
75
75
|
queryEndpoint,
|
|
76
76
|
queryHeaders,
|
|
77
|
-
withCredentials,
|
|
78
77
|
} = client;
|
|
79
78
|
try {
|
|
80
79
|
if (queryEndpoint) {
|
|
81
80
|
const resp = await axios.post(
|
|
82
81
|
queryEndpoint,
|
|
83
82
|
{ metadata: { id: chartId, task: 'item' } },
|
|
84
|
-
{ headers: queryHeaders
|
|
83
|
+
{ headers: queryHeaders }
|
|
85
84
|
);
|
|
86
85
|
setLoading(false);
|
|
87
86
|
setData({
|
package/src/lib/font.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const fontSize = {
|
|
2
|
+
xs: 'qq-text-xs',
|
|
3
|
+
sm: 'qq-text-sm',
|
|
4
|
+
md: 'qq-text-base',
|
|
5
|
+
lg: 'qq-text-lg',
|
|
6
|
+
xl: 'qq-text-xl',
|
|
7
|
+
threeXl: 'qq-text-3xl',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const fontWeight = {
|
|
11
|
+
sm: 'qq-font-normal',
|
|
12
|
+
md: 'qq-font-medium',
|
|
13
|
+
lg: 'qq-font-semibold',
|
|
14
|
+
};
|
package/src/lib/index.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export type ValueFormatter = {
|
|
2
|
+
(value: number): string;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
const iconVariantValues = [
|
|
6
|
+
'simple',
|
|
7
|
+
'light',
|
|
8
|
+
'shadow',
|
|
9
|
+
'solid',
|
|
10
|
+
'outlined',
|
|
11
|
+
] as const;
|
|
12
|
+
|
|
13
|
+
export type IconVariant = (typeof iconVariantValues)[number];
|
|
14
|
+
|
|
15
|
+
export type HorizontalPosition = 'left' | 'right';
|
|
16
|
+
|
|
17
|
+
export type VerticalPosition = 'top' | 'bottom';
|
|
18
|
+
|
|
19
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'light';
|
|
20
|
+
|
|
21
|
+
const deltaTypeValues = [
|
|
22
|
+
'increase',
|
|
23
|
+
'moderateIncrease',
|
|
24
|
+
'decrease',
|
|
25
|
+
'moderateDecrease',
|
|
26
|
+
'unchanged',
|
|
27
|
+
] as const;
|
|
28
|
+
|
|
29
|
+
export type DeltaType = (typeof deltaTypeValues)[number];
|
|
30
|
+
|
|
31
|
+
const sizeValues = ['xs', 'sm', 'md', 'lg', 'xl'] as const;
|
|
32
|
+
|
|
33
|
+
export type Size = (typeof sizeValues)[number];
|
|
34
|
+
|
|
35
|
+
const colorValues = [
|
|
36
|
+
'slate',
|
|
37
|
+
'gray',
|
|
38
|
+
'zinc',
|
|
39
|
+
'neutral',
|
|
40
|
+
'stone',
|
|
41
|
+
'red',
|
|
42
|
+
'orange',
|
|
43
|
+
'amber',
|
|
44
|
+
'yellow',
|
|
45
|
+
'lime',
|
|
46
|
+
'green',
|
|
47
|
+
'emerald',
|
|
48
|
+
'teal',
|
|
49
|
+
'cyan',
|
|
50
|
+
'sky',
|
|
51
|
+
'blue',
|
|
52
|
+
'indigo',
|
|
53
|
+
'violet',
|
|
54
|
+
'purple',
|
|
55
|
+
'fuchsia',
|
|
56
|
+
'pink',
|
|
57
|
+
'rose',
|
|
58
|
+
] as const;
|
|
59
|
+
|
|
60
|
+
export type Color = (typeof colorValues)[number];
|
|
61
|
+
|
|
62
|
+
const justifyContentValues = [
|
|
63
|
+
'start',
|
|
64
|
+
'end',
|
|
65
|
+
'center',
|
|
66
|
+
'between',
|
|
67
|
+
'around',
|
|
68
|
+
'evenly',
|
|
69
|
+
] as const;
|
|
70
|
+
export type JustifyContent = (typeof justifyContentValues)[number];
|
|
71
|
+
|
|
72
|
+
const alignItemsValues = [
|
|
73
|
+
'start',
|
|
74
|
+
'end',
|
|
75
|
+
'center',
|
|
76
|
+
'baseline',
|
|
77
|
+
'stretch',
|
|
78
|
+
] as const;
|
|
79
|
+
export type AlignItems = (typeof alignItemsValues)[number];
|
|
80
|
+
|
|
81
|
+
export type FlexDirection = 'row' | 'col' | 'row-reverse' | 'col-reverse';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ValueFormatter } from './inputTypes';
|
|
2
|
+
|
|
3
|
+
export const defaultValueFormatter: ValueFormatter = (value: number) =>
|
|
4
|
+
value.toString();
|
|
5
|
+
|
|
6
|
+
export const sumNumericArray = (arr: number[]) =>
|
|
7
|
+
arr.reduce((prefixSum, num) => prefixSum + num, 0);
|
|
8
|
+
|
|
9
|
+
export const removeValueFromArray = (value: any, array: any[]): any[] => {
|
|
10
|
+
const index = array.indexOf(value);
|
|
11
|
+
if (index > -1) {
|
|
12
|
+
array.splice(index, 1);
|
|
13
|
+
}
|
|
14
|
+
return array;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const isValueInArray = (value: any, array: any[]): boolean => {
|
|
18
|
+
for (let i = 0; i < array.length; i++) {
|
|
19
|
+
if (array[i] === value) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const stringIsNumeric = (str: string | undefined): boolean => {
|
|
27
|
+
return !isNaN(Number(str)) && str !== undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const stringEndsWithNumber = (str: string): boolean => {
|
|
31
|
+
return stringIsNumeric(str.split('-').pop());
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function mergeRefs<T = any>(
|
|
35
|
+
refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>
|
|
36
|
+
): React.RefCallback<T> {
|
|
37
|
+
return value => {
|
|
38
|
+
refs.forEach(ref => {
|
|
39
|
+
if (typeof ref === 'function') {
|
|
40
|
+
ref(value);
|
|
41
|
+
} else if (ref != null) {
|
|
42
|
+
(ref as React.MutableRefObject<T | null>).current = value;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"lib": ["dom", "dom.iterable", "
|
|
3
|
+
"target": "es2022",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "es2022"],
|
|
5
5
|
"allowJs": true,
|
|
6
6
|
"skipLibCheck": true,
|
|
7
7
|
"esModuleInterop": true,
|
|
8
8
|
"allowSyntheticDefaultImports": true,
|
|
9
9
|
"strict": true,
|
|
10
10
|
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"module": "
|
|
11
|
+
"module": "commonjs",
|
|
12
12
|
"moduleResolution": "node",
|
|
13
13
|
"resolveJsonModule": true,
|
|
14
14
|
"isolatedModules": true,
|
package/rollup.config.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import typescript from '@rollup/plugin-typescript';
|
|
2
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
-
|
|
4
|
-
export default [
|
|
5
|
-
// {
|
|
6
|
-
// input: 'src/index.ts',
|
|
7
|
-
// output: {
|
|
8
|
-
// file: 'lib/cjs/index.js',
|
|
9
|
-
// format: 'cjs',
|
|
10
|
-
// },
|
|
11
|
-
// plugins: [typescript() , resolve()],
|
|
12
|
-
// },
|
|
13
|
-
{
|
|
14
|
-
input: 'src/index.ts',
|
|
15
|
-
output: {
|
|
16
|
-
file: 'lib/esm/index.js',
|
|
17
|
-
format: 'esm',
|
|
18
|
-
},
|
|
19
|
-
plugins: [typescript(), resolve()],
|
|
20
|
-
},
|
|
21
|
-
];
|