@quillsql/react 2.8.6 → 2.8.8
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/AddToDashboardModal.js +181 -146
- package/dist/BarList.js +44 -36
- package/dist/Chart.js +132 -99
- package/dist/ChartBuilder.js +89 -80
- package/dist/ChartEditor.js +21 -14
- package/dist/Context.js +57 -52
- package/dist/Dashboard.js +213 -180
- package/dist/Dashboard.js.map +1 -1
- package/dist/DateRangePicker/Calendar.js +46 -41
- package/dist/DateRangePicker/DateRangePicker.js +61 -32
- package/dist/DateRangePicker/DateRangePickerButton.js +17 -14
- package/dist/DateRangePicker/dateRangePickerUtils.js +90 -76
- package/dist/DateRangePicker/dateRangePickerUtils.js.map +1 -1
- package/dist/DateRangePicker/index.js +9 -1
- package/dist/PieChart.js +70 -35
- package/dist/QuillProvider.js +7 -4
- package/dist/ReportBuilder.js +129 -120
- package/dist/SQLEditor.js +65 -56
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +71 -60
- package/dist/Table.js.map +1 -1
- package/dist/TableChart.js +45 -17
- package/dist/assets/ArrowDownHeadIcon.js +6 -3
- package/dist/assets/ArrowDownIcon.js +6 -3
- package/dist/assets/ArrowDownRightIcon.js +6 -3
- package/dist/assets/ArrowLeftHeadIcon.js +6 -3
- package/dist/assets/ArrowRightHeadIcon.js +6 -3
- package/dist/assets/ArrowRightIcon.js +6 -3
- package/dist/assets/ArrowUpHeadIcon.js +6 -3
- package/dist/assets/ArrowUpIcon.js +6 -3
- package/dist/assets/ArrowUpRightIcon.js +6 -3
- package/dist/assets/CalendarIcon.js +6 -3
- package/dist/assets/CalendarNormalIcon.js +6 -3
- package/dist/assets/DoubleArrowLeftHeadIcon.js +6 -3
- package/dist/assets/DoubleArrowRightHeadIcon.js +6 -3
- package/dist/assets/ExclamationFilledIcon.js +6 -3
- package/dist/assets/FilterIcon.js +6 -3
- package/dist/assets/LoadingSpinner.js +6 -3
- package/dist/assets/RefreshIcon.js +6 -3
- package/dist/assets/SearchIcon.js +6 -3
- package/dist/assets/UpLeftArrowsIcon.js +6 -3
- package/dist/assets/XCircleIcon.js +6 -3
- package/dist/assets/XIcon.js +6 -3
- package/dist/assets/index.js +49 -21
- package/dist/components/BigModal/BigModal.js +39 -13
- package/dist/components/Dropdown/Dropdown.js +53 -24
- package/dist/components/Dropdown/DropdownItem.js +35 -9
- package/dist/components/Dropdown/index.js +11 -2
- package/dist/components/Modal/Modal.js +39 -13
- package/dist/components/Modal/index.js +9 -1
- package/dist/components/QuillCard.js +13 -8
- package/dist/components/SqlTextEditor.js +11 -4
- package/dist/components/SqlTextEditor.js.map +1 -0
- package/dist/components/UiComponents.js +51 -37
- package/dist/components/selectUtils.js +17 -6
- package/dist/contexts/BaseColorContext.js +6 -3
- package/dist/contexts/HoveredValueContext.js +6 -3
- package/dist/contexts/RootStylesContext.js +6 -3
- package/dist/contexts/SelectedValueContext.js +6 -3
- package/dist/contexts/index.js +15 -4
- package/dist/hooks/index.js +15 -4
- package/dist/hooks/useDashboard.js +17 -11
- package/dist/hooks/useDashboard.js.map +1 -0
- package/dist/hooks/useInternalState.js +6 -3
- package/dist/hooks/useOnClickOutside.js +6 -3
- package/dist/hooks/useOnWindowResize.js +7 -4
- package/dist/hooks/useQuill.js +16 -11
- package/dist/hooks/useSelectOnKeyDown.js +7 -4
- package/dist/index.js +33 -13
- package/dist/index.js.map +1 -1
- package/dist/internals/ReportBuilder/PivotList.js +20 -14
- package/dist/internals/ReportBuilder/PivotModal.js +92 -84
- package/dist/internals/ReportBuilder/PivotModal.spec.js +73 -70
- package/dist/lib/font.js +6 -2
- package/dist/lib/index.js +20 -3
- package/dist/lib/inputTypes.js +3 -1
- package/dist/lib/utils.js +19 -8
- package/dist/utils/aggregate.js +35 -28
- package/dist/utils/colorToHex.js +5 -1
- package/dist/utils/dataFetcher.js +8 -2
- package/dist/utils/downloadCSV.js +6 -1
- package/package.json +2 -1
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.hasValue = exports.getSelectButtonColors = exports.getFilteredOptions = exports.constructValueToNameMapping = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function constructValueToNameMapping(children) {
|
|
3
9
|
const valueToNameMapping = new Map();
|
|
4
|
-
|
|
10
|
+
react_1.default.Children.map(children, (child) => {
|
|
5
11
|
valueToNameMapping.set(child.props.value, child.props.text ?? child.props.value);
|
|
6
12
|
});
|
|
7
13
|
return valueToNameMapping;
|
|
8
14
|
}
|
|
9
|
-
|
|
15
|
+
exports.constructValueToNameMapping = constructValueToNameMapping;
|
|
16
|
+
function getFilteredOptions(searchQuery, options) {
|
|
10
17
|
return searchQuery === ''
|
|
11
18
|
? options
|
|
12
19
|
: options.filter((option) => {
|
|
@@ -14,7 +21,8 @@ export function getFilteredOptions(searchQuery, options) {
|
|
|
14
21
|
return optionText.toLowerCase().includes(searchQuery.toLowerCase());
|
|
15
22
|
});
|
|
16
23
|
}
|
|
17
|
-
|
|
24
|
+
exports.getFilteredOptions = getFilteredOptions;
|
|
25
|
+
const getSelectButtonColors = (hasSelection, isDisabled, hasError = false) => {
|
|
18
26
|
return null;
|
|
19
27
|
// return twMerge(
|
|
20
28
|
// isDisabled
|
|
@@ -34,4 +42,7 @@ export const getSelectButtonColors = (hasSelection, isDisabled, hasError = false
|
|
|
34
42
|
// : getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor
|
|
35
43
|
// );
|
|
36
44
|
};
|
|
37
|
-
|
|
45
|
+
exports.getSelectButtonColors = getSelectButtonColors;
|
|
46
|
+
const hasValue = (value) => value !== null && value !== undefined && value !== '';
|
|
47
|
+
exports.hasValue = hasValue;
|
|
48
|
+
//# sourceMappingURL=selectUtils.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const BaseColorContext = (0, react_1.createContext)('blue');
|
|
5
|
+
exports.default = BaseColorContext;
|
|
6
|
+
//# sourceMappingURL=BaseColorContext.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const HoveredValueContext = (0, react_1.createContext)({
|
|
3
5
|
hoveredValue: undefined,
|
|
4
6
|
});
|
|
5
|
-
|
|
7
|
+
exports.default = HoveredValueContext;
|
|
8
|
+
//# sourceMappingURL=HoveredValueContext.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const RootStylesContext = (0, react_1.createContext)(undefined);
|
|
5
|
+
exports.default = RootStylesContext;
|
|
6
|
+
//# sourceMappingURL=RootStylesContext.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const SelectedValueContext = (0, react_1.createContext)({
|
|
3
5
|
selectedValue: undefined,
|
|
4
6
|
handleValueChange: undefined,
|
|
5
7
|
});
|
|
6
|
-
|
|
8
|
+
exports.default = SelectedValueContext;
|
|
9
|
+
//# sourceMappingURL=SelectedValueContext.js.map
|
package/dist/contexts/index.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SelectedValueContext = exports.RootStylesContext = exports.HoveredValueContext = exports.BaseColorContext = void 0;
|
|
7
|
+
var BaseColorContext_1 = require("./BaseColorContext");
|
|
8
|
+
Object.defineProperty(exports, "BaseColorContext", { enumerable: true, get: function () { return __importDefault(BaseColorContext_1).default; } });
|
|
9
|
+
var HoveredValueContext_1 = require("./HoveredValueContext");
|
|
10
|
+
Object.defineProperty(exports, "HoveredValueContext", { enumerable: true, get: function () { return __importDefault(HoveredValueContext_1).default; } });
|
|
11
|
+
var RootStylesContext_1 = require("./RootStylesContext");
|
|
12
|
+
Object.defineProperty(exports, "RootStylesContext", { enumerable: true, get: function () { return __importDefault(RootStylesContext_1).default; } });
|
|
13
|
+
var SelectedValueContext_1 = require("./SelectedValueContext");
|
|
14
|
+
Object.defineProperty(exports, "SelectedValueContext", { enumerable: true, get: function () { return __importDefault(SelectedValueContext_1).default; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useSelectOnKeyDown = exports.useOnWindowResize = exports.useOnClickOutside = exports.useInternalState = void 0;
|
|
7
|
+
var useInternalState_1 = require("./useInternalState");
|
|
8
|
+
Object.defineProperty(exports, "useInternalState", { enumerable: true, get: function () { return __importDefault(useInternalState_1).default; } });
|
|
9
|
+
var useOnClickOutside_1 = require("./useOnClickOutside");
|
|
10
|
+
Object.defineProperty(exports, "useOnClickOutside", { enumerable: true, get: function () { return __importDefault(useOnClickOutside_1).default; } });
|
|
11
|
+
var useOnWindowResize_1 = require("./useOnWindowResize");
|
|
12
|
+
Object.defineProperty(exports, "useOnWindowResize", { enumerable: true, get: function () { return __importDefault(useOnWindowResize_1).default; } });
|
|
13
|
+
var useSelectOnKeyDown_1 = require("./useSelectOnKeyDown");
|
|
14
|
+
Object.defineProperty(exports, "useSelectOnKeyDown", { enumerable: true, get: function () { return __importDefault(useSelectOnKeyDown_1).default; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDashboard = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const Context_1 = require("../Context");
|
|
6
|
+
const dataFetcher_1 = require("../utils/dataFetcher");
|
|
7
|
+
const useDashboard = (dashboardName) => {
|
|
5
8
|
// if (dashboardName === undefined || dashboardName === null) {
|
|
6
9
|
// throw new Error('useDashboard requires a dashboard name parameter');
|
|
7
10
|
// }
|
|
8
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
9
|
-
const [error, setError] = useState(null);
|
|
10
|
-
const [data, setData] = useState(null);
|
|
11
|
-
const [client] = useContext(ClientContext);
|
|
11
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
12
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
13
|
+
const [data, setData] = (0, react_1.useState)(null);
|
|
14
|
+
const [client] = (0, react_1.useContext)(Context_1.ClientContext);
|
|
12
15
|
const handleReload = () => {
|
|
13
|
-
console.log('reloading...');
|
|
14
16
|
getDashboards();
|
|
15
17
|
};
|
|
16
18
|
async function getDashboards() {
|
|
19
|
+
if (dashboardName === null || dashboardName === undefined)
|
|
20
|
+
return;
|
|
17
21
|
setIsLoading(true);
|
|
18
22
|
const { publicKey, customerId } = client;
|
|
19
23
|
try {
|
|
@@ -30,7 +34,7 @@ export const useDashboard = (dashboardName) => {
|
|
|
30
34
|
...(customerId ? { orgId: customerId } : {}),
|
|
31
35
|
},
|
|
32
36
|
};
|
|
33
|
-
const resp = await getData(client, `dashconfig?${searchParams}`, 'omit', hostedBody, null, 'GET');
|
|
37
|
+
const resp = await (0, dataFetcher_1.getData)(client, `dashconfig?${searchParams}`, 'omit', hostedBody, null, 'GET');
|
|
34
38
|
setData(resp);
|
|
35
39
|
setError(null);
|
|
36
40
|
}
|
|
@@ -41,8 +45,10 @@ export const useDashboard = (dashboardName) => {
|
|
|
41
45
|
}
|
|
42
46
|
setIsLoading(false);
|
|
43
47
|
}
|
|
44
|
-
useEffect(() => {
|
|
48
|
+
(0, react_1.useEffect)(() => {
|
|
45
49
|
getDashboards();
|
|
46
50
|
}, [dashboardName, client]);
|
|
47
51
|
return { data, isLoading, error, reload: handleReload };
|
|
48
52
|
};
|
|
53
|
+
exports.useDashboard = useDashboard;
|
|
54
|
+
//# sourceMappingURL=useDashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDashboard.js","sourceRoot":"","sources":["../../src/hooks/useDashboard.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AACxD,wCAA2C;AAC3C,sDAA+C;AAExC,MAAM,YAAY,GAAG,CAAC,aAAqB,EAAE,EAAE;IACpD,+DAA+D;IAC/D,yEAAyE;IACzE,IAAI;IACJ,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAM,IAAI,CAAC,CAAC;IAC9C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAM,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,kBAAU,EAAC,uBAAa,CAAC,CAAC;IAE3C,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,aAAa,EAAE,CAAC;IAClB,CAAC,CAAC;IAEF,KAAK,UAAU,aAAa;QAC1B,IAAI,aAAa,KAAK,IAAI,IAAI,aAAa,KAAK,SAAS;YAAE,OAAO;QAClE,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,MAAa,CAAC;QAChD,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC;gBACvC,SAAS,EAAE,SAAS;gBACpB,KAAK,EAAE,UAAU;gBACjB,IAAI,EAAE,aAAa;aACpB,CAAC,CAAC,QAAQ,EAAE,CAAC;YAEd,MAAM,UAAU,GAAG;gBACjB,QAAQ,EAAE;oBACR,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,SAAS;oBACnB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAC7C;aACF,CAAC;YAEF,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAO,EACxB,MAAM,EACN,cAAc,YAAY,EAAE,EAC5B,MAAM,EACN,UAAU,EACV,IAAI,EACJ,KAAK,CACN,CAAC;YAEF,OAAO,CAAC,IAAI,CAAC,CAAC;YACd,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,IAAI,CAAC,CAAC;YACf,QAAQ,CAAC,KAAY,CAAC,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;QAC/C,CAAC;QACD,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,aAAa,EAAE,CAAC;IAClB,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;IAE5B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAC1D,CAAC,CAAC;AAzDW,QAAA,YAAY,gBAyDvB"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
2
4
|
const useInternalState = (defaultValueProp, valueProp) => {
|
|
3
5
|
const isControlled = valueProp !== undefined;
|
|
4
|
-
const [valueState, setValueState] = useState(defaultValueProp);
|
|
6
|
+
const [valueState, setValueState] = (0, react_1.useState)(defaultValueProp);
|
|
5
7
|
const value = isControlled ? valueProp : valueState;
|
|
6
8
|
const setValue = (nextValue) => {
|
|
7
9
|
if (isControlled) {
|
|
@@ -11,4 +13,5 @@ const useInternalState = (defaultValueProp, valueProp) => {
|
|
|
11
13
|
};
|
|
12
14
|
return [value, setValue];
|
|
13
15
|
};
|
|
14
|
-
|
|
16
|
+
exports.default = useInternalState;
|
|
17
|
+
//# sourceMappingURL=useInternalState.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
2
4
|
const useOnClickOutside = (ref, handler) => {
|
|
3
|
-
useEffect(() => {
|
|
5
|
+
(0, react_1.useEffect)(() => {
|
|
4
6
|
const listener = (event) => {
|
|
5
7
|
if (!ref.current || ref.current.contains(event.target)) {
|
|
6
8
|
return;
|
|
@@ -15,4 +17,5 @@ const useOnClickOutside = (ref, handler) => {
|
|
|
15
17
|
};
|
|
16
18
|
}, [ref, handler]);
|
|
17
19
|
};
|
|
18
|
-
|
|
20
|
+
exports.default = useOnClickOutside;
|
|
21
|
+
//# sourceMappingURL=useOnClickOutside.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
2
4
|
const useOnWindowResize = (handler, initialWindowSize) => {
|
|
3
|
-
const [windowSize, setWindowSize] = useState(initialWindowSize);
|
|
4
|
-
useEffect(() => {
|
|
5
|
+
const [windowSize, setWindowSize] = (0, react_1.useState)(initialWindowSize);
|
|
6
|
+
(0, react_1.useEffect)(() => {
|
|
5
7
|
const handleResize = () => {
|
|
6
8
|
setWindowSize(window.innerWidth);
|
|
7
9
|
handler();
|
|
@@ -11,4 +13,5 @@ const useOnWindowResize = (handler, initialWindowSize) => {
|
|
|
11
13
|
return () => window.removeEventListener("resize", handleResize);
|
|
12
14
|
}, [handler, windowSize]);
|
|
13
15
|
};
|
|
14
|
-
|
|
16
|
+
exports.default = useOnWindowResize;
|
|
17
|
+
//# sourceMappingURL=useOnWindowResize.js.map
|
package/dist/hooks/useQuill.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useQuill = void 0;
|
|
1
4
|
// @ts-nocheck
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Context_1 = require("../Context");
|
|
7
|
+
const dataFetcher_1 = require("../utils/dataFetcher");
|
|
8
|
+
const useQuill = (chartId) => {
|
|
6
9
|
// @ts-ignore
|
|
7
|
-
const { dashboard, dispatch } = useContext(DashboardContext);
|
|
8
|
-
const [client] = useContext(ClientContext);
|
|
9
|
-
const [data, setData] = useState(null);
|
|
10
|
-
const [loading, setLoading] = useState(true);
|
|
11
|
-
const [error, setError] = useState(null);
|
|
12
|
-
useEffect(() => {
|
|
10
|
+
const { dashboard, dispatch } = (0, react_1.useContext)(Context_1.DashboardContext);
|
|
11
|
+
const [client] = (0, react_1.useContext)(Context_1.ClientContext);
|
|
12
|
+
const [data, setData] = (0, react_1.useState)(null);
|
|
13
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
14
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
13
16
|
let isSubscribed = true;
|
|
14
17
|
async function getChartOptions(id) {
|
|
15
18
|
if (isSubscribed) {
|
|
@@ -30,7 +33,7 @@ export const useQuill = (chartId) => {
|
|
|
30
33
|
id,
|
|
31
34
|
filters: [],
|
|
32
35
|
};
|
|
33
|
-
const resp = await getData(client, 'itempost', 'same-origin', hostedBody, cloudBody);
|
|
36
|
+
const resp = await (0, dataFetcher_1.getData)(client, 'itempost', 'same-origin', hostedBody, cloudBody);
|
|
34
37
|
if (resp) {
|
|
35
38
|
setLoading(false);
|
|
36
39
|
setData(resp);
|
|
@@ -56,6 +59,7 @@ export const useQuill = (chartId) => {
|
|
|
56
59
|
}, [chartId, dashboard]);
|
|
57
60
|
return { data, loading, error };
|
|
58
61
|
};
|
|
62
|
+
exports.useQuill = useQuill;
|
|
59
63
|
function stringifyIfObject(e) {
|
|
60
64
|
if (typeof e === 'string') {
|
|
61
65
|
// do nothing if e is a string
|
|
@@ -67,3 +71,4 @@ function stringifyIfObject(e) {
|
|
|
67
71
|
}
|
|
68
72
|
return e; // returns the input as is for other types
|
|
69
73
|
}
|
|
74
|
+
//# sourceMappingURL=useQuill.js.map
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
2
4
|
const useSelectOnKeyDown = (onValueChange, optionValues, isFocused, handleFocusChange, value) => {
|
|
3
5
|
const NO_SELECTION_IDX = -1;
|
|
4
|
-
const [hoveredIdx, setHoveredIdx] = useState(NO_SELECTION_IDX);
|
|
6
|
+
const [hoveredIdx, setHoveredIdx] = (0, react_1.useState)(NO_SELECTION_IDX);
|
|
5
7
|
const getHoveredValue = (hoveredIdx, optionValues) => {
|
|
6
8
|
if (hoveredIdx < 0)
|
|
7
9
|
return undefined;
|
|
8
10
|
return optionValues[hoveredIdx];
|
|
9
11
|
};
|
|
10
|
-
useEffect(() => {
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
11
13
|
const getIndexOfSelectedValue = () => {
|
|
12
14
|
if (!isFocused) {
|
|
13
15
|
setHoveredIdx(NO_SELECTION_IDX);
|
|
@@ -60,4 +62,5 @@ const useSelectOnKeyDown = (onValueChange, optionValues, isFocused, handleFocusC
|
|
|
60
62
|
};
|
|
61
63
|
return [hoveredValue, handleKeyDown];
|
|
62
64
|
};
|
|
63
|
-
|
|
65
|
+
exports.default = useSelectOnKeyDown;
|
|
66
|
+
//# sourceMappingURL=useSelectOnKeyDown.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.downloadCSV = exports.useQuill = exports.useDashboard = exports.SqlTextEditor = exports.AddToDashboardModal = exports.ChartEditor = exports.ChartBuilder = exports.ReportBuilder = exports.SQLEditor = exports.Table = exports.Chart = exports.QuillProvider = exports.Dashboard = void 0;
|
|
1
7
|
// src/index.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
var Dashboard_1 = require("./Dashboard");
|
|
9
|
+
Object.defineProperty(exports, "Dashboard", { enumerable: true, get: function () { return __importDefault(Dashboard_1).default; } });
|
|
10
|
+
var QuillProvider_1 = require("./QuillProvider");
|
|
11
|
+
Object.defineProperty(exports, "QuillProvider", { enumerable: true, get: function () { return __importDefault(QuillProvider_1).default; } });
|
|
12
|
+
var Chart_1 = require("./Chart");
|
|
13
|
+
Object.defineProperty(exports, "Chart", { enumerable: true, get: function () { return __importDefault(Chart_1).default; } });
|
|
14
|
+
var Table_1 = require("./Table");
|
|
15
|
+
Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return __importDefault(Table_1).default; } });
|
|
16
|
+
var SQLEditor_1 = require("./SQLEditor");
|
|
17
|
+
Object.defineProperty(exports, "SQLEditor", { enumerable: true, get: function () { return __importDefault(SQLEditor_1).default; } });
|
|
18
|
+
var ReportBuilder_1 = require("./ReportBuilder");
|
|
19
|
+
Object.defineProperty(exports, "ReportBuilder", { enumerable: true, get: function () { return __importDefault(ReportBuilder_1).default; } });
|
|
20
|
+
var ChartBuilder_1 = require("./ChartBuilder");
|
|
21
|
+
Object.defineProperty(exports, "ChartBuilder", { enumerable: true, get: function () { return __importDefault(ChartBuilder_1).default; } });
|
|
22
|
+
var ChartEditor_1 = require("./ChartEditor");
|
|
23
|
+
Object.defineProperty(exports, "ChartEditor", { enumerable: true, get: function () { return __importDefault(ChartEditor_1).default; } });
|
|
24
|
+
var AddToDashboardModal_1 = require("./AddToDashboardModal");
|
|
25
|
+
Object.defineProperty(exports, "AddToDashboardModal", { enumerable: true, get: function () { return __importDefault(AddToDashboardModal_1).default; } });
|
|
26
|
+
var SqlTextEditor_1 = require("./components/SqlTextEditor");
|
|
27
|
+
Object.defineProperty(exports, "SqlTextEditor", { enumerable: true, get: function () { return __importDefault(SqlTextEditor_1).default; } });
|
|
28
|
+
var useDashboard_1 = require("./hooks/useDashboard");
|
|
29
|
+
Object.defineProperty(exports, "useDashboard", { enumerable: true, get: function () { return useDashboard_1.useDashboard; } });
|
|
30
|
+
var useQuill_1 = require("./hooks/useQuill");
|
|
31
|
+
Object.defineProperty(exports, "useQuill", { enumerable: true, get: function () { return useQuill_1.useQuill; } });
|
|
32
|
+
var downloadCSV_1 = require("./utils/downloadCSV");
|
|
33
|
+
Object.defineProperty(exports, "downloadCSV", { enumerable: true, get: function () { return downloadCSV_1.downloadCSV; } });
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,eAAe;AACf,yCAAmD;AAA1C,uHAAA,OAAO,OAAa;AAC7B,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,iCAA2C;AAAlC,+GAAA,OAAO,OAAS;AACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,eAAe;AACf,yCAAmD;AAA1C,uHAAA,OAAO,OAAa;AAC7B,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,iCAA2C;AAAlC,+GAAA,OAAO,OAAS;AACzB,iCAA4C;AAAnC,+GAAA,OAAO,OAAS;AACzB,yCAAmD;AAA1C,uHAAA,OAAO,OAAa;AAC7B,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,6DAAuE;AAA9D,2IAAA,OAAO,OAAuB;AACvC,4DAAsE;AAA7D,+HAAA,OAAO,OAAiB;AACjC,qDAAoD;AAA3C,4GAAA,YAAY,OAAA;AACrB,6CAA4C;AAAnC,oGAAA,QAAQ,OAAA;AACjB,mDAAkD;AAAzC,0GAAA,WAAW,OAAA"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PivotList = exports.PivotCard = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const QuillCard_1 = require("../../components/QuillCard");
|
|
6
|
+
const PivotCard = ({ pivotTable, theme, index, onSelectPivot, selectedPivotIndex, onEditPivot, ButtonComponent, showEdit = false, clickable = true, onClose = null, minHeight = 0, LabelComponent, TextComponent, HeaderComponent, }) => {
|
|
4
7
|
const maxRowsInPivotPeak = 5;
|
|
5
|
-
return (
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(QuillCard_1.QuillCard, { theme: theme, onClick: () => onSelectPivot(pivotTable.pivot, index), isSelected: index === selectedPivotIndex, clickable: clickable, onClose: onClose, minHeight: minHeight, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
6
9
|
fontSize: 14,
|
|
7
10
|
display: 'flex',
|
|
8
11
|
flexDirection: 'column',
|
|
9
12
|
justifyContent: 'space-between',
|
|
10
13
|
height: minHeight,
|
|
11
|
-
}, children: [
|
|
14
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [pivotTable.pivot.title && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
12
15
|
display: 'flex',
|
|
13
16
|
flex: 1,
|
|
14
17
|
justifyContent: 'space-between',
|
|
@@ -16,37 +19,38 @@ export const PivotCard = ({ pivotTable, theme, index, onSelectPivot, selectedPiv
|
|
|
16
19
|
whiteSpace: 'nowrap',
|
|
17
20
|
textOverflow: 'ellipsis',
|
|
18
21
|
paddingBottom: 6,
|
|
19
|
-
}, children:
|
|
22
|
+
}, children: (0, jsx_runtime_1.jsx)(HeaderComponent, { children: pivotTable.pivot.title }) })), (0, jsx_runtime_1.jsxs)("table", { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsx)("tr", { children: pivotTable.columns.map(column => ((0, jsx_runtime_1.jsx)("th", { style: {
|
|
20
23
|
fontWeight: 600,
|
|
21
24
|
paddingRight: 5,
|
|
22
25
|
flex: 1,
|
|
23
26
|
textAlign: 'left',
|
|
24
27
|
whiteSpace: 'nowrap',
|
|
25
28
|
textOverflow: 'ellipsis',
|
|
26
|
-
}, children:
|
|
29
|
+
}, children: (0, jsx_runtime_1.jsx)(LabelComponent, { children: column.label }) }, column.field))) }) }), (0, jsx_runtime_1.jsx)("tbody", { children: pivotTable.rows
|
|
27
30
|
.slice(0, maxRowsInPivotPeak)
|
|
28
|
-
.map((row, index) => (
|
|
31
|
+
.map((row, index) => ((0, jsx_runtime_1.jsx)("tr", { children: pivotTable.columns.map((colum, i) => ((0, jsx_runtime_1.jsx)("td", { style: {
|
|
29
32
|
paddingRight: 5,
|
|
30
33
|
flex: 1,
|
|
31
34
|
whiteSpace: 'nowrap',
|
|
32
35
|
textOverflow: 'ellipsis',
|
|
33
|
-
}, children:
|
|
36
|
+
}, children: (0, jsx_runtime_1.jsx)(TextComponent, { children: row[colum.field] }) }, i))) }, index))) })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
34
37
|
display: 'flex',
|
|
35
38
|
justifyContent: 'space-between',
|
|
36
|
-
}, children: [pivotTable.rows.length > maxRowsInPivotPeak ? (
|
|
39
|
+
}, children: [pivotTable.rows.length > maxRowsInPivotPeak ? ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(TextComponent, { children: ["...", pivotTable.rows.length - maxRowsInPivotPeak < 5
|
|
37
40
|
? ''
|
|
38
|
-
: pivotTable.rows.length - maxRowsInPivotPeak, ' ', "more rows"] }) })) : (
|
|
41
|
+
: pivotTable.rows.length - maxRowsInPivotPeak, ' ', "more rows"] }) })) : ((0, jsx_runtime_1.jsx)("div", {})), showEdit && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ButtonComponent, { id: "edit-pivot", primary: false, onClick: (e) => {
|
|
39
42
|
e.stopPropagation();
|
|
40
43
|
onEditPivot(pivotTable.pivot, index);
|
|
41
44
|
}, label: 'Edit' }) }))] })] }) }));
|
|
42
45
|
};
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
exports.PivotCard = PivotCard;
|
|
47
|
+
const PivotList = ({ recommendedPivotTables, createdPivotTables, onSelectRecommendedPivot, onSelectCreatedPivot, theme, selectedPivotIndex, selectedPivotType, ButtonComponent, showCreatePivot = false, onEditRecommendedPivot, onEditCreatedPivot, showPivotEditButton = false, LabelComponent, TextComponent, HeaderComponent, }) => {
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
45
49
|
display: 'grid',
|
|
46
50
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
47
51
|
gap: 16,
|
|
48
52
|
gridAutoRows: '220px',
|
|
49
|
-
}, children: [recommendedPivotTables.map((pivotTable, index) => (
|
|
53
|
+
}, children: [recommendedPivotTables.map((pivotTable, index) => ((0, jsx_runtime_1.jsx)(exports.PivotCard, { pivotTable: pivotTable, theme: theme, index: index, onSelectPivot: onSelectRecommendedPivot, selectedPivotIndex: selectedPivotType === 'recommended' ? selectedPivotIndex : -1, onEditPivot: onEditRecommendedPivot, ButtonComponent: ButtonComponent, showPivotEditButton: showPivotEditButton, minHeight: 180, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }, index))), createdPivotTables.map((pivotTable, index) => ((0, jsx_runtime_1.jsx)(exports.PivotCard, { pivotTable: pivotTable, theme: theme, index: index, onSelectPivot: onSelectCreatedPivot, selectedPivotIndex: selectedPivotType === 'created' ? selectedPivotIndex : -1, onEditPivot: onEditCreatedPivot, ButtonComponent: ButtonComponent, showPivotEditButton: showPivotEditButton, minHeight: 180, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }, index))), showCreatePivot && ((0, jsx_runtime_1.jsx)(QuillCard_1.QuillCard, { theme: theme, onClick: () => onEditCreatedPivot({}, null), style: {
|
|
50
54
|
display: 'flex',
|
|
51
55
|
justifyContent: 'center',
|
|
52
56
|
alignItems: 'center',
|
|
@@ -54,3 +58,5 @@ export const PivotList = ({ recommendedPivotTables, createdPivotTables, onSelect
|
|
|
54
58
|
boxShadow: 'none',
|
|
55
59
|
}, children: "Create pivot +" }))] }) }));
|
|
56
60
|
};
|
|
61
|
+
exports.PivotList = PivotList;
|
|
62
|
+
//# sourceMappingURL=PivotList.js.map
|