@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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ValueFormatter = {
|
|
2
|
+
(value: number): string;
|
|
3
|
+
};
|
|
4
|
+
declare const iconVariantValues: readonly ["simple", "light", "shadow", "solid", "outlined"];
|
|
5
|
+
export type IconVariant = (typeof iconVariantValues)[number];
|
|
6
|
+
export type HorizontalPosition = 'left' | 'right';
|
|
7
|
+
export type VerticalPosition = 'top' | 'bottom';
|
|
8
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'light';
|
|
9
|
+
declare const deltaTypeValues: readonly ["increase", "moderateIncrease", "decrease", "moderateDecrease", "unchanged"];
|
|
10
|
+
export type DeltaType = (typeof deltaTypeValues)[number];
|
|
11
|
+
declare const sizeValues: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
12
|
+
export type Size = (typeof sizeValues)[number];
|
|
13
|
+
declare const colorValues: readonly ["slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"];
|
|
14
|
+
export type Color = (typeof colorValues)[number];
|
|
15
|
+
declare const justifyContentValues: readonly ["start", "end", "center", "between", "around", "evenly"];
|
|
16
|
+
export type JustifyContent = (typeof justifyContentValues)[number];
|
|
17
|
+
declare const alignItemsValues: readonly ["start", "end", "center", "baseline", "stretch"];
|
|
18
|
+
export type AlignItems = (typeof alignItemsValues)[number];
|
|
19
|
+
export type FlexDirection = 'row' | 'col' | 'row-reverse' | 'col-reverse';
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const iconVariantValues = [
|
|
4
|
+
'simple',
|
|
5
|
+
'light',
|
|
6
|
+
'shadow',
|
|
7
|
+
'solid',
|
|
8
|
+
'outlined',
|
|
9
|
+
];
|
|
10
|
+
const deltaTypeValues = [
|
|
11
|
+
'increase',
|
|
12
|
+
'moderateIncrease',
|
|
13
|
+
'decrease',
|
|
14
|
+
'moderateDecrease',
|
|
15
|
+
'unchanged',
|
|
16
|
+
];
|
|
17
|
+
const sizeValues = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
18
|
+
const colorValues = [
|
|
19
|
+
'slate',
|
|
20
|
+
'gray',
|
|
21
|
+
'zinc',
|
|
22
|
+
'neutral',
|
|
23
|
+
'stone',
|
|
24
|
+
'red',
|
|
25
|
+
'orange',
|
|
26
|
+
'amber',
|
|
27
|
+
'yellow',
|
|
28
|
+
'lime',
|
|
29
|
+
'green',
|
|
30
|
+
'emerald',
|
|
31
|
+
'teal',
|
|
32
|
+
'cyan',
|
|
33
|
+
'sky',
|
|
34
|
+
'blue',
|
|
35
|
+
'indigo',
|
|
36
|
+
'violet',
|
|
37
|
+
'purple',
|
|
38
|
+
'fuchsia',
|
|
39
|
+
'pink',
|
|
40
|
+
'rose',
|
|
41
|
+
];
|
|
42
|
+
const justifyContentValues = [
|
|
43
|
+
'start',
|
|
44
|
+
'end',
|
|
45
|
+
'center',
|
|
46
|
+
'between',
|
|
47
|
+
'around',
|
|
48
|
+
'evenly',
|
|
49
|
+
];
|
|
50
|
+
const alignItemsValues = [
|
|
51
|
+
'start',
|
|
52
|
+
'end',
|
|
53
|
+
'center',
|
|
54
|
+
'baseline',
|
|
55
|
+
'stretch',
|
|
56
|
+
];
|
|
57
|
+
//# sourceMappingURL=inputTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputTypes.js","sourceRoot":"","sources":["../../src/lib/inputTypes.ts"],"names":[],"mappings":";;AAIA,MAAM,iBAAiB,GAAG;IACxB,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,OAAO;IACP,UAAU;CACF,CAAC;AAUX,MAAM,eAAe,GAAG;IACtB,UAAU;IACV,kBAAkB;IAClB,UAAU;IACV,kBAAkB;IAClB,WAAW;CACH,CAAC;AAIX,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAI3D,MAAM,WAAW,GAAG;IAClB,OAAO;IACP,MAAM;IACN,MAAM;IACN,SAAS;IACT,OAAO;IACP,KAAK;IACL,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,MAAM;IACN,MAAM;CACE,CAAC;AAIX,MAAM,oBAAoB,GAAG;IAC3B,OAAO;IACP,KAAK;IACL,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;CACA,CAAC;AAGX,MAAM,gBAAgB,GAAG;IACvB,OAAO;IACP,KAAK;IACL,QAAQ;IACR,UAAU;IACV,SAAS;CACD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ValueFormatter } from './inputTypes';
|
|
3
|
+
export declare const defaultValueFormatter: ValueFormatter;
|
|
4
|
+
export declare const sumNumericArray: (arr: number[]) => number;
|
|
5
|
+
export declare const removeValueFromArray: (value: any, array: any[]) => any[];
|
|
6
|
+
export declare const isValueInArray: (value: any, array: any[]) => boolean;
|
|
7
|
+
export declare const stringIsNumeric: (str: string | undefined) => boolean;
|
|
8
|
+
export declare const stringEndsWithNumber: (str: string) => boolean;
|
|
9
|
+
export declare function mergeRefs<T = any>(refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>): React.RefCallback<T>;
|
package/lib/lib/utils.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeRefs = exports.stringEndsWithNumber = exports.stringIsNumeric = exports.isValueInArray = exports.removeValueFromArray = exports.sumNumericArray = exports.defaultValueFormatter = void 0;
|
|
4
|
+
const defaultValueFormatter = (value) => value.toString();
|
|
5
|
+
exports.defaultValueFormatter = defaultValueFormatter;
|
|
6
|
+
const sumNumericArray = (arr) => arr.reduce((prefixSum, num) => prefixSum + num, 0);
|
|
7
|
+
exports.sumNumericArray = sumNumericArray;
|
|
8
|
+
const removeValueFromArray = (value, array) => {
|
|
9
|
+
const index = array.indexOf(value);
|
|
10
|
+
if (index > -1) {
|
|
11
|
+
array.splice(index, 1);
|
|
12
|
+
}
|
|
13
|
+
return array;
|
|
14
|
+
};
|
|
15
|
+
exports.removeValueFromArray = removeValueFromArray;
|
|
16
|
+
const isValueInArray = (value, array) => {
|
|
17
|
+
for (let i = 0; i < array.length; i++) {
|
|
18
|
+
if (array[i] === value) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
24
|
+
exports.isValueInArray = isValueInArray;
|
|
25
|
+
const stringIsNumeric = (str) => {
|
|
26
|
+
return !isNaN(Number(str)) && str !== undefined;
|
|
27
|
+
};
|
|
28
|
+
exports.stringIsNumeric = stringIsNumeric;
|
|
29
|
+
const stringEndsWithNumber = (str) => {
|
|
30
|
+
return (0, exports.stringIsNumeric)(str.split('-').pop());
|
|
31
|
+
};
|
|
32
|
+
exports.stringEndsWithNumber = stringEndsWithNumber;
|
|
33
|
+
function mergeRefs(refs) {
|
|
34
|
+
return value => {
|
|
35
|
+
refs.forEach(ref => {
|
|
36
|
+
if (typeof ref === 'function') {
|
|
37
|
+
ref(value);
|
|
38
|
+
}
|
|
39
|
+
else if (ref != null) {
|
|
40
|
+
ref.current = value;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.mergeRefs = mergeRefs;
|
|
46
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.tsx"],"names":[],"mappings":";;;AAEO,MAAM,qBAAqB,GAAmB,CAAC,KAAa,EAAE,EAAE,CACrE,KAAK,CAAC,QAAQ,EAAE,CAAC;AADN,QAAA,qBAAqB,yBACf;AAEZ,MAAM,eAAe,GAAG,CAAC,GAAa,EAAE,EAAE,CAC/C,GAAG,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AADxC,QAAA,eAAe,mBACyB;AAE9C,MAAM,oBAAoB,GAAG,CAAC,KAAU,EAAE,KAAY,EAAS,EAAE;IACtE,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;QACd,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KACxB;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B;AAEK,MAAM,cAAc,GAAG,CAAC,KAAU,EAAE,KAAY,EAAW,EAAE;IAClE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;YACtB,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAPW,QAAA,cAAc,kBAOzB;AAEK,MAAM,eAAe,GAAG,CAAC,GAAuB,EAAW,EAAE;IAClE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,KAAK,SAAS,CAAC;AAClD,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B;AAEK,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAW,EAAE;IAC3D,OAAO,IAAA,uBAAe,EAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B;AAEF,SAAgB,SAAS,CACvB,IAA2D;IAE3D,OAAO,KAAK,CAAC,EAAE;QACb,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACjB,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;gBAC7B,GAAG,CAAC,KAAK,CAAC,CAAC;aACZ;iBAAM,IAAI,GAAG,IAAI,IAAI,EAAE;gBACrB,GAAwC,CAAC,OAAO,GAAG,KAAK,CAAC;aAC3D;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAZD,8BAYC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillsql/react",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"access": "public",
|
|
5
5
|
"description": "Quill React components for building dashboards and reporting.",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"build:foo": "rollup --config rollup.config.ts --configPlugin typescript",
|
|
10
9
|
"watch": "tsc -w",
|
|
11
10
|
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
|
12
11
|
"lint:fix": "eslint --fix 'src/**/*.{ts,tsx}'",
|
|
@@ -19,26 +18,19 @@
|
|
|
19
18
|
"dependencies": {
|
|
20
19
|
"@heroicons/react": "^2.0.18",
|
|
21
20
|
"@monaco-editor/react": "^4.5.1",
|
|
22
|
-
"
|
|
23
|
-
"axios": "^1.3.5",
|
|
21
|
+
"axios": "^0.7.0",
|
|
24
22
|
"date-fns": "^2.29.3",
|
|
25
23
|
"date-fns-tz": "^2.0.0",
|
|
26
24
|
"formik": "^2.4.2",
|
|
27
|
-
"react-loader-spinner": "^5.3.4",
|
|
28
|
-
"react-loading-skeleton": "^3.2.1",
|
|
29
25
|
"recharts": "^2.5.0",
|
|
30
|
-
"size-limit": "^8.2.6",
|
|
31
26
|
"tslib": "^2.5.0",
|
|
32
27
|
"typescript": "^5.0.3"
|
|
33
28
|
},
|
|
34
29
|
"peerDependencies": {
|
|
35
|
-
"react": "^18.
|
|
36
|
-
"react-dom": "^18.
|
|
30
|
+
"react": "^18.0.0",
|
|
31
|
+
"react-dom": "^18.0.0"
|
|
37
32
|
},
|
|
38
33
|
"devDependencies": {
|
|
39
|
-
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
40
|
-
"@rollup/plugin-typescript": "^11.1.2",
|
|
41
|
-
"@size-limit/preset-small-lib": "^8.2.6",
|
|
42
34
|
"@types/react": "^18.0.33",
|
|
43
35
|
"@types/react-dom": "^18.0.11",
|
|
44
36
|
"@typescript-eslint/eslint-plugin": "^5.57.1",
|
|
@@ -49,6 +41,7 @@
|
|
|
49
41
|
"eslint-plugin-react": "^7.32.2",
|
|
50
42
|
"glob": "^10.2.2",
|
|
51
43
|
"prettier": "^2.8.7",
|
|
52
|
-
"
|
|
44
|
+
"react": "^18.0.0",
|
|
45
|
+
"react-dom": "^18.0.0"
|
|
53
46
|
}
|
|
54
47
|
}
|
|
@@ -97,14 +97,7 @@ export default function AddToDashboardModal({
|
|
|
97
97
|
}, [schema]);
|
|
98
98
|
|
|
99
99
|
const editChart = async ({ report, values, yAxisFields, columns, query }) => {
|
|
100
|
-
const {
|
|
101
|
-
publicKey,
|
|
102
|
-
orgId,
|
|
103
|
-
authToken,
|
|
104
|
-
queryEndpoint,
|
|
105
|
-
queryHeaders,
|
|
106
|
-
withCredentials,
|
|
107
|
-
} = client;
|
|
100
|
+
const { publicKey, orgId, authToken, queryEndpoint, queryHeaders } = client;
|
|
108
101
|
const {
|
|
109
102
|
xAxisLabel,
|
|
110
103
|
yAxisLabel,
|
|
@@ -168,7 +161,7 @@ export default function AddToDashboardModal({
|
|
|
168
161
|
task: 'create',
|
|
169
162
|
},
|
|
170
163
|
},
|
|
171
|
-
{ headers: queryHeaders
|
|
164
|
+
{ headers: queryHeaders }
|
|
172
165
|
);
|
|
173
166
|
} else {
|
|
174
167
|
response = await axios.post(
|
package/src/Chart.tsx
CHANGED
|
@@ -23,8 +23,6 @@ import {
|
|
|
23
23
|
ThemeContext,
|
|
24
24
|
DashboardFiltersContext,
|
|
25
25
|
} from './Context';
|
|
26
|
-
import Skeleton from 'react-loading-skeleton';
|
|
27
|
-
import 'react-loading-skeleton/dist/skeleton.css';
|
|
28
26
|
import TableChart from './TableChart';
|
|
29
27
|
import { QuillTheme } from './QuillProvider';
|
|
30
28
|
|
|
@@ -550,7 +548,6 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
550
548
|
environment,
|
|
551
549
|
queryEndpoint,
|
|
552
550
|
queryHeaders,
|
|
553
|
-
withCredentials,
|
|
554
551
|
} = client;
|
|
555
552
|
//queryEndpoint = undefined;
|
|
556
553
|
setLoading(true);
|
|
@@ -586,7 +583,7 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
586
583
|
},
|
|
587
584
|
},
|
|
588
585
|
},
|
|
589
|
-
{ headers: queryHeaders
|
|
586
|
+
{ headers: queryHeaders }
|
|
590
587
|
);
|
|
591
588
|
|
|
592
589
|
if (resp.data) {
|
|
@@ -688,25 +685,57 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
688
685
|
height: containerStyle?.height || 300,
|
|
689
686
|
width: '100%',
|
|
690
687
|
boxSizing: 'content-box',
|
|
688
|
+
borderRadius: 8,
|
|
689
|
+
overflow: 'hidden',
|
|
691
690
|
}}
|
|
692
691
|
>
|
|
693
|
-
<
|
|
694
|
-
count={1}
|
|
695
|
-
// height={containerStyle?.height}
|
|
696
|
-
height={
|
|
697
|
-
containerStyle?.height && containerStyle?.marginTop
|
|
698
|
-
? containerStyle?.height + containerStyle?.marginTop
|
|
699
|
-
: containerStyle?.height
|
|
700
|
-
? containerStyle?.height
|
|
701
|
-
: 300
|
|
702
|
-
}
|
|
703
|
-
borderRadius={8}
|
|
704
|
-
// highlightColor="#F7F7F8"
|
|
705
|
-
highlightColor="#FDFDFD"
|
|
706
|
-
// baseColor="#F3F4F6"
|
|
707
|
-
baseColor="#F9F9FA"
|
|
692
|
+
<svg
|
|
708
693
|
width="100%"
|
|
709
|
-
|
|
694
|
+
height="100%"
|
|
695
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
696
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
697
|
+
>
|
|
698
|
+
<rect width="100%" height="100%" fill="#F9F9FA" />
|
|
699
|
+
|
|
700
|
+
<defs fill="#F9F9FA">
|
|
701
|
+
<linearGradient
|
|
702
|
+
id="skeletonGradient"
|
|
703
|
+
x1="0%"
|
|
704
|
+
y1="0%"
|
|
705
|
+
x2="10%"
|
|
706
|
+
y2="0%"
|
|
707
|
+
gradientUnits="userSpaceOnUse"
|
|
708
|
+
>
|
|
709
|
+
<stop offset="0%" stop-color="rgba(255,255,255,0)" />
|
|
710
|
+
<stop offset="50%" stop-color="#FEFEFE" />
|
|
711
|
+
<stop offset="100%" stop-color="rgba(255,255,255,0)" />
|
|
712
|
+
<animate
|
|
713
|
+
attributeName="x1"
|
|
714
|
+
from="-100%"
|
|
715
|
+
to="100%"
|
|
716
|
+
dur="2s"
|
|
717
|
+
repeatCount="indefinite"
|
|
718
|
+
/>
|
|
719
|
+
<animate
|
|
720
|
+
attributeName="x2"
|
|
721
|
+
from="-50%"
|
|
722
|
+
to="150%"
|
|
723
|
+
dur="2s"
|
|
724
|
+
repeatCount="indefinite"
|
|
725
|
+
/>
|
|
726
|
+
</linearGradient>
|
|
727
|
+
</defs>
|
|
728
|
+
|
|
729
|
+
<rect width="50%" height="100%" fill="url(#skeletonGradient)">
|
|
730
|
+
<animate
|
|
731
|
+
attributeName="x"
|
|
732
|
+
from="-100%"
|
|
733
|
+
to="100%"
|
|
734
|
+
dur="2s"
|
|
735
|
+
repeatCount="indefinite"
|
|
736
|
+
/>
|
|
737
|
+
</rect>
|
|
738
|
+
</svg>
|
|
710
739
|
</div>
|
|
711
740
|
</div>
|
|
712
741
|
);
|
package/src/Context.tsx
CHANGED
|
@@ -90,7 +90,6 @@ export const ContextProvider = ({
|
|
|
90
90
|
userId,
|
|
91
91
|
queryEndpoint,
|
|
92
92
|
queryHeaders,
|
|
93
|
-
withCredentials,
|
|
94
93
|
}) => {
|
|
95
94
|
const [client, setClient] = useState(null);
|
|
96
95
|
const [theme, setTheme] =
|
|
@@ -136,7 +135,6 @@ export const ContextProvider = ({
|
|
|
136
135
|
environment,
|
|
137
136
|
queryEndpoint,
|
|
138
137
|
queryHeaders,
|
|
139
|
-
withCredentials,
|
|
140
138
|
});
|
|
141
139
|
}
|
|
142
140
|
}, [
|
|
@@ -147,7 +145,6 @@ export const ContextProvider = ({
|
|
|
147
145
|
client,
|
|
148
146
|
environment,
|
|
149
147
|
queryEndpoint,
|
|
150
|
-
withCredentials,
|
|
151
148
|
queryHeaders,
|
|
152
149
|
]);
|
|
153
150
|
|
package/src/Dashboard.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from './Context';
|
|
11
11
|
import { startOfToday, sub } from 'date-fns';
|
|
12
12
|
import { DateRangePicker } from './DateRangePicker/index';
|
|
13
|
-
import axios from 'axios';
|
|
13
|
+
import axios from 'axios/index';
|
|
14
14
|
import Modal from './components/Modal/Modal';
|
|
15
15
|
import { HoveredValueContext, SelectedValueContext } from './contexts';
|
|
16
16
|
import { DropdownItem } from './components/Dropdown';
|
|
@@ -59,7 +59,6 @@ export default function Dashboard({
|
|
|
59
59
|
environment,
|
|
60
60
|
queryEndpoint,
|
|
61
61
|
queryHeaders,
|
|
62
|
-
withCredentials,
|
|
63
62
|
} = client;
|
|
64
63
|
try {
|
|
65
64
|
// const response = await fetch(
|
|
@@ -68,6 +67,7 @@ export default function Dashboard({
|
|
|
68
67
|
|
|
69
68
|
if (queryEndpoint) {
|
|
70
69
|
//&& queryHeaders
|
|
70
|
+
// @ts-ignore
|
|
71
71
|
const response = await axios.post(
|
|
72
72
|
queryEndpoint,
|
|
73
73
|
{
|
|
@@ -75,7 +75,6 @@ export default function Dashboard({
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
headers: queryHeaders,
|
|
78
|
-
withCredentials,
|
|
79
78
|
}
|
|
80
79
|
);
|
|
81
80
|
|
package/src/PieChart.tsx
CHANGED
|
@@ -567,12 +567,12 @@ function rgbToHsl(rgb) {
|
|
|
567
567
|
const max = Math.max(r, g, b);
|
|
568
568
|
const min = Math.min(r, g, b);
|
|
569
569
|
|
|
570
|
-
|
|
570
|
+
let h = 0,
|
|
571
571
|
s = 0,
|
|
572
572
|
l = (max + min) / 2;
|
|
573
573
|
|
|
574
574
|
if (max !== min) {
|
|
575
|
-
|
|
575
|
+
let d = max - min;
|
|
576
576
|
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
577
577
|
|
|
578
578
|
switch (max) {
|
package/src/QuillProvider.tsx
CHANGED
|
@@ -19,7 +19,6 @@ interface WithQueryEndpoint extends BaseQuillProviderProps {
|
|
|
19
19
|
organizationId?: never;
|
|
20
20
|
queryEndpoint: string;
|
|
21
21
|
queryHeaders: object;
|
|
22
|
-
withCredentials?: boolean;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
type QuillProviderProps = WithOrganizationId | WithQueryEndpoint;
|
|
@@ -61,7 +60,6 @@ const QuillProvider = ({
|
|
|
61
60
|
environment,
|
|
62
61
|
children,
|
|
63
62
|
theme = defaultTheme,
|
|
64
|
-
withCredentials = false,
|
|
65
63
|
}: QuillProviderProps) => {
|
|
66
64
|
return (
|
|
67
65
|
<ContextProvider
|
|
@@ -71,7 +69,6 @@ const QuillProvider = ({
|
|
|
71
69
|
customerId={organizationId}
|
|
72
70
|
queryEndpoint={queryEndpoint}
|
|
73
71
|
queryHeaders={queryHeaders}
|
|
74
|
-
withCredentials={withCredentials}
|
|
75
72
|
>
|
|
76
73
|
{children}
|
|
77
74
|
</ContextProvider>
|
package/src/ReportBuilder.tsx
CHANGED
|
@@ -161,21 +161,15 @@ export default function ReportBuilder({
|
|
|
161
161
|
}, []);
|
|
162
162
|
|
|
163
163
|
const runQuery = async query => {
|
|
164
|
-
const {
|
|
165
|
-
|
|
166
|
-
customerId,
|
|
167
|
-
environment,
|
|
168
|
-
queryEndpoint,
|
|
169
|
-
queryHeaders,
|
|
170
|
-
withCredentials,
|
|
171
|
-
} = client;
|
|
164
|
+
const { publicKey, customerId, environment, queryEndpoint, queryHeaders } =
|
|
165
|
+
client;
|
|
172
166
|
|
|
173
167
|
let response;
|
|
174
168
|
if (queryEndpoint) {
|
|
175
169
|
response = await axios.post(
|
|
176
170
|
queryEndpoint,
|
|
177
171
|
{ metadata: { query, task: 'query' } },
|
|
178
|
-
{ headers: queryHeaders
|
|
172
|
+
{ headers: queryHeaders }
|
|
179
173
|
);
|
|
180
174
|
} else {
|
|
181
175
|
response = await axios.post(
|
package/src/SQLEditor.tsx
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
} from '@heroicons/react/20/solid';
|
|
14
14
|
import { QuillTheme } from './QuillProvider';
|
|
15
15
|
import { SpecialTable } from './Table';
|
|
16
|
-
import { TailSpin } from 'react-loader-spinner';
|
|
17
16
|
|
|
18
17
|
export function convertPostgresColumn(column) {
|
|
19
18
|
let format;
|
|
@@ -256,14 +255,8 @@ export default function QueryEditor({
|
|
|
256
255
|
};
|
|
257
256
|
|
|
258
257
|
const handleRunQuery = async () => {
|
|
259
|
-
const {
|
|
260
|
-
|
|
261
|
-
customerId,
|
|
262
|
-
environment,
|
|
263
|
-
queryEndpoint,
|
|
264
|
-
queryHeaders,
|
|
265
|
-
withCredentials,
|
|
266
|
-
} = client;
|
|
258
|
+
const { publicKey, customerId, environment, queryEndpoint, queryHeaders } =
|
|
259
|
+
client;
|
|
267
260
|
try {
|
|
268
261
|
let response;
|
|
269
262
|
setSqlQueryLoading(true);
|
|
@@ -271,7 +264,7 @@ export default function QueryEditor({
|
|
|
271
264
|
response = await axios.post(
|
|
272
265
|
queryEndpoint,
|
|
273
266
|
{ metadata: { query, task: 'query' } },
|
|
274
|
-
{ headers: queryHeaders
|
|
267
|
+
{ headers: queryHeaders }
|
|
275
268
|
);
|
|
276
269
|
} else {
|
|
277
270
|
response = await axios.post(
|
|
@@ -679,7 +672,54 @@ const SQLEditorComponent = ({
|
|
|
679
672
|
>
|
|
680
673
|
{LoadingComponent && <LoadingComponent />}
|
|
681
674
|
{!LoadingComponent && (
|
|
682
|
-
<
|
|
675
|
+
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">
|
|
676
|
+
<defs>
|
|
677
|
+
<linearGradient
|
|
678
|
+
id="circleGradient"
|
|
679
|
+
gradientUnits="objectBoundingBox"
|
|
680
|
+
>
|
|
681
|
+
<stop offset="0%" stop-color="#F9F9FA" />
|
|
682
|
+
<stop offset="5%" stop-color="#F9F9FA" />
|
|
683
|
+
<stop offset="100%" stop-color="#D1D1D1" />
|
|
684
|
+
</linearGradient>
|
|
685
|
+
<mask id="mask">
|
|
686
|
+
<circle cx="12" cy="12" r="12" fill="white" />
|
|
687
|
+
<path
|
|
688
|
+
id="sector"
|
|
689
|
+
fill="black"
|
|
690
|
+
d="M15,15 L15,1.8 A13.2,13.2 0 0,1 15,1.8 Z"
|
|
691
|
+
>
|
|
692
|
+
<animate
|
|
693
|
+
attributeName="d"
|
|
694
|
+
from="M15,15 L15,1.8 A13.2,13.2 0 0,0 15,1.8 Z"
|
|
695
|
+
to="M15,15 L15,1.8 A13.2,13.2 0 1,1 15,1.8 Z"
|
|
696
|
+
dur="2s"
|
|
697
|
+
repeatCount="indefinite"
|
|
698
|
+
/>
|
|
699
|
+
</path>
|
|
700
|
+
</mask>
|
|
701
|
+
</defs>
|
|
702
|
+
<g transform="rotate(0 15 15)">
|
|
703
|
+
<animateTransform
|
|
704
|
+
attributeName="transform"
|
|
705
|
+
attributeType="XML"
|
|
706
|
+
type="rotate"
|
|
707
|
+
from="0 12 12"
|
|
708
|
+
to="360 12 12"
|
|
709
|
+
dur="2s"
|
|
710
|
+
repeatCount="indefinite"
|
|
711
|
+
/>
|
|
712
|
+
<circle
|
|
713
|
+
cx="12"
|
|
714
|
+
cy="12"
|
|
715
|
+
r="12"
|
|
716
|
+
fill="none"
|
|
717
|
+
stroke="url(#circleGradient)"
|
|
718
|
+
stroke-width="8"
|
|
719
|
+
mask="url(#mask)"
|
|
720
|
+
/>
|
|
721
|
+
</g>
|
|
722
|
+
</svg>
|
|
683
723
|
)}
|
|
684
724
|
</div>
|
|
685
725
|
) : (
|
|
@@ -824,7 +864,54 @@ const SchemaListComponent = ({ schema, theme, loading, LoadingComponent }) => {
|
|
|
824
864
|
<div style={{ height: 100 }} />
|
|
825
865
|
{LoadingComponent && <LoadingComponent />}
|
|
826
866
|
{!LoadingComponent && (
|
|
827
|
-
<
|
|
867
|
+
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">
|
|
868
|
+
<defs>
|
|
869
|
+
<linearGradient
|
|
870
|
+
id="circleGradient"
|
|
871
|
+
gradientUnits="objectBoundingBox"
|
|
872
|
+
>
|
|
873
|
+
<stop offset="0%" stop-color="#F9F9FA" />
|
|
874
|
+
<stop offset="5%" stop-color="#F9F9FA" />
|
|
875
|
+
<stop offset="100%" stop-color="#D1D1D1" />
|
|
876
|
+
</linearGradient>
|
|
877
|
+
<mask id="mask">
|
|
878
|
+
<circle cx="12" cy="12" r="12" fill="white" />
|
|
879
|
+
<path
|
|
880
|
+
id="sector"
|
|
881
|
+
fill="black"
|
|
882
|
+
d="M15,15 L15,1.8 A13.2,13.2 0 0,1 15,1.8 Z"
|
|
883
|
+
>
|
|
884
|
+
<animate
|
|
885
|
+
attributeName="d"
|
|
886
|
+
from="M15,15 L15,1.8 A13.2,13.2 0 0,0 15,1.8 Z"
|
|
887
|
+
to="M15,15 L15,1.8 A13.2,13.2 0 1,1 15,1.8 Z"
|
|
888
|
+
dur="2s"
|
|
889
|
+
repeatCount="indefinite"
|
|
890
|
+
/>
|
|
891
|
+
</path>
|
|
892
|
+
</mask>
|
|
893
|
+
</defs>
|
|
894
|
+
<g transform="rotate(0 15 15)">
|
|
895
|
+
<animateTransform
|
|
896
|
+
attributeName="transform"
|
|
897
|
+
attributeType="XML"
|
|
898
|
+
type="rotate"
|
|
899
|
+
from="0 12 12"
|
|
900
|
+
to="360 12 12"
|
|
901
|
+
dur="2s"
|
|
902
|
+
repeatCount="indefinite"
|
|
903
|
+
/>
|
|
904
|
+
<circle
|
|
905
|
+
cx="12"
|
|
906
|
+
cy="12"
|
|
907
|
+
r="12"
|
|
908
|
+
fill="none"
|
|
909
|
+
stroke="url(#circleGradient)"
|
|
910
|
+
stroke-width="8"
|
|
911
|
+
mask="url(#mask)"
|
|
912
|
+
/>
|
|
913
|
+
</g>
|
|
914
|
+
</svg>
|
|
828
915
|
)}
|
|
829
916
|
</div>
|
|
830
917
|
);
|
package/src/Table.tsx
CHANGED
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import axios from 'axios';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
DashboardContext,
|
|
8
|
-
ThemeContext,
|
|
9
|
-
} from './Context';
|
|
10
|
-
import Skeleton from 'react-loading-skeleton';
|
|
5
|
+
import { ClientContext, DashboardContext, ThemeContext } from './Context';
|
|
6
|
+
// import Skeleton from 'react-loading-skeleton';
|
|
11
7
|
import { valueFormatter } from './Chart';
|
|
12
8
|
// import { SpecialTable } from './SQLEditor';
|
|
13
9
|
import { QuillTheme } from './QuillProvider';
|
|
@@ -834,7 +830,54 @@ const ChartUpdater = ({
|
|
|
834
830
|
boxSizing: 'content-box',
|
|
835
831
|
}}
|
|
836
832
|
>
|
|
837
|
-
<
|
|
833
|
+
<svg
|
|
834
|
+
width="100%"
|
|
835
|
+
height="100%"
|
|
836
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
837
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
838
|
+
>
|
|
839
|
+
<rect width="100%" height="100%" fill="#F9F9FA" />
|
|
840
|
+
|
|
841
|
+
<defs fill="#F9F9FA">
|
|
842
|
+
<linearGradient
|
|
843
|
+
id="skeletonGradient"
|
|
844
|
+
x1="0%"
|
|
845
|
+
y1="0%"
|
|
846
|
+
x2="10%"
|
|
847
|
+
y2="0%"
|
|
848
|
+
gradientUnits="userSpaceOnUse"
|
|
849
|
+
>
|
|
850
|
+
<stop offset="0%" stop-color="rgba(255,255,255,0)" />
|
|
851
|
+
<stop offset="50%" stop-color="#FEFEFE" />
|
|
852
|
+
<stop offset="100%" stop-color="rgba(255,255,255,0)" />
|
|
853
|
+
<animate
|
|
854
|
+
attributeName="x1"
|
|
855
|
+
from="-100%"
|
|
856
|
+
to="100%"
|
|
857
|
+
dur="2s"
|
|
858
|
+
repeatCount="indefinite"
|
|
859
|
+
/>
|
|
860
|
+
<animate
|
|
861
|
+
attributeName="x2"
|
|
862
|
+
from="-50%"
|
|
863
|
+
to="150%"
|
|
864
|
+
dur="2s"
|
|
865
|
+
repeatCount="indefinite"
|
|
866
|
+
/>
|
|
867
|
+
</linearGradient>
|
|
868
|
+
</defs>
|
|
869
|
+
|
|
870
|
+
<rect width="50%" height="100%" fill="url(#skeletonGradient)">
|
|
871
|
+
<animate
|
|
872
|
+
attributeName="x"
|
|
873
|
+
from="-100%"
|
|
874
|
+
to="100%"
|
|
875
|
+
dur="2s"
|
|
876
|
+
repeatCount="indefinite"
|
|
877
|
+
/>
|
|
878
|
+
</rect>
|
|
879
|
+
</svg>
|
|
880
|
+
{/* <Skeleton
|
|
838
881
|
count={1}
|
|
839
882
|
// height={containerStyle?.height}
|
|
840
883
|
height={
|
|
@@ -850,7 +893,7 @@ const ChartUpdater = ({
|
|
|
850
893
|
// baseColor="#F3F4F6"
|
|
851
894
|
baseColor="#F9F9FA"
|
|
852
895
|
width="100%"
|
|
853
|
-
/>
|
|
896
|
+
/> */}
|
|
854
897
|
</div>
|
|
855
898
|
</div>
|
|
856
899
|
);
|