@quillsql/react 2.8.9 → 2.9.0
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/BarList.js.map +1 -1
- package/dist/Chart.js +119 -87
- package/dist/Chart.js.map +1 -1
- package/dist/ChartBuilder.js +93 -83
- package/dist/ChartBuilder.js.map +1 -1
- package/dist/ChartEditor.js +21 -14
- package/dist/ChartEditor.js.map +1 -1
- package/dist/Context.js +57 -52
- package/dist/Dashboard.js +212 -179
- package/dist/Dashboard.js.map +1 -1
- package/dist/DateRangePicker/Calendar.js +46 -41
- package/dist/DateRangePicker/DateRangePicker.js +61 -32
- package/dist/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/DateRangePicker/DateRangePickerButton.js +17 -14
- package/dist/DateRangePicker/dateRangePickerUtils.js +90 -76
- 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/SQLEditor.js.map +1 -1
- package/dist/Table.js +65 -60
- package/dist/Table.js.map +1 -1
- package/dist/TableChart.js +45 -17
- package/dist/TableChart.js.map +1 -1
- package/dist/assets/ArrowDownHeadIcon.js +6 -3
- package/dist/assets/ArrowDownHeadIcon.js.map +1 -1
- 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/Banner/index.js +10 -6
- package/dist/components/Banner/index.js.map +1 -0
- 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 -1
- package/dist/components/UiComponents.js +51 -37
- package/dist/components/UiComponents.js.map +1 -1
- 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 +15 -10
- 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/internals/ReportBuilder/PivotList.js +20 -14
- package/dist/internals/ReportBuilder/PivotModal.js +92 -84
- package/dist/internals/ReportBuilder/PivotModal.js.map +1 -1
- 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/axisFormatter.js +24 -19
- package/dist/utils/axisFormatter.js.map +1 -0
- package/dist/utils/colorToHex.js +5 -1
- package/dist/utils/dataFetcher.js +8 -2
- package/dist/utils/downloadCSV.js +6 -1
- package/dist/utils/valueFormatter.js +24 -19
- package/dist/utils/valueFormatter.js.map +1 -0
- package/dist/utils/valueFormatterCSV.js +24 -19
- package/dist/utils/valueFormatterCSV.js.map +1 -0
- package/package.json +2 -1
|
@@ -1,14 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
2
27
|
// @ts-nocheck
|
|
3
28
|
/* eslint-disable react/display-name */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const BigModal =
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const hooks_1 = require("../../hooks");
|
|
31
|
+
const lib_1 = require("../../lib");
|
|
32
|
+
const BigModal = react_1.default.forwardRef((props, ref) => {
|
|
8
33
|
const { showModal, setShowModal, parentRef, width, maxHeight = '18rem', children, className, theme, ...other } = props;
|
|
9
|
-
const [modalExceedsWindow, setModalExceedsWindow] = useState(false);
|
|
10
|
-
const modalRef = useRef(null);
|
|
11
|
-
const checkModalExceedsWindow = useCallback((modalWidth, windowWidth) => {
|
|
34
|
+
const [modalExceedsWindow, setModalExceedsWindow] = (0, react_1.useState)(false);
|
|
35
|
+
const modalRef = (0, react_1.useRef)(null);
|
|
36
|
+
const checkModalExceedsWindow = (0, react_1.useCallback)((modalWidth, windowWidth) => {
|
|
12
37
|
if (!parentRef.current) {
|
|
13
38
|
return false;
|
|
14
39
|
}
|
|
@@ -18,7 +43,7 @@ const BigModal = React.forwardRef((props, ref) => {
|
|
|
18
43
|
const getAbsoluteSpacing = () => {
|
|
19
44
|
return modalExceedsWindow ? '0' : '0';
|
|
20
45
|
};
|
|
21
|
-
useOnClickOutside(modalRef, e => {
|
|
46
|
+
(0, hooks_1.useOnClickOutside)(modalRef, e => {
|
|
22
47
|
// Exclude click on trigger button (e.g. Dropdown Button) from outside click handler
|
|
23
48
|
const isTriggerElem = parentRef
|
|
24
49
|
? parentRef.current?.contains(e.target)
|
|
@@ -28,17 +53,17 @@ const BigModal = React.forwardRef((props, ref) => {
|
|
|
28
53
|
}
|
|
29
54
|
});
|
|
30
55
|
// Execute only when modal is of absolute size
|
|
31
|
-
useEffect(() => {
|
|
56
|
+
(0, react_1.useEffect)(() => {
|
|
32
57
|
if (width) {
|
|
33
58
|
setModalExceedsWindow(checkModalExceedsWindow(width, window.innerWidth));
|
|
34
59
|
}
|
|
35
60
|
}, [checkModalExceedsWindow, parentRef, width]);
|
|
36
|
-
useOnWindowResize(() => {
|
|
61
|
+
(0, hooks_1.useOnWindowResize)(() => {
|
|
37
62
|
if (width) {
|
|
38
63
|
setModalExceedsWindow(checkModalExceedsWindow(width, window.innerWidth));
|
|
39
64
|
}
|
|
40
65
|
});
|
|
41
|
-
return showModal ? (
|
|
66
|
+
return showModal ? ((0, jsx_runtime_1.jsx)("div", { ref: (0, lib_1.mergeRefs)([modalRef, ref]), style: {
|
|
42
67
|
position: 'absolute',
|
|
43
68
|
zIndex: 10,
|
|
44
69
|
overflowY: 'auto',
|
|
@@ -59,4 +84,5 @@ const BigModal = React.forwardRef((props, ref) => {
|
|
|
59
84
|
transform: 'translate(-50%, -50%)',
|
|
60
85
|
}, ...other, children: children })) : null;
|
|
61
86
|
});
|
|
62
|
-
|
|
87
|
+
exports.default = BigModal;
|
|
88
|
+
//# sourceMappingURL=BigModal.js.map
|
|
@@ -1,32 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
2
30
|
/* eslint-disable react/display-name */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const Dropdown =
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
32
|
+
const contexts_1 = require("../../contexts");
|
|
33
|
+
const hooks_1 = require("../../hooks");
|
|
34
|
+
const assets_1 = require("../../assets");
|
|
35
|
+
const lib_1 = require("../../lib");
|
|
36
|
+
const selectUtils_1 = require("../selectUtils");
|
|
37
|
+
const Modal_1 = __importDefault(require("../Modal"));
|
|
38
|
+
const Dropdown = react_1.default.forwardRef((props, ref) => {
|
|
11
39
|
const { defaultValue, value, onValueChange, placeholder = 'Select...', disabled = false, icon, children, className, theme, ...other } = props;
|
|
12
|
-
const [selectedValue, setSelectedValue] = useInternalState(defaultValue, value);
|
|
13
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
14
|
-
const dropdownRef = useRef(null);
|
|
40
|
+
const [selectedValue, setSelectedValue] = (0, hooks_1.useInternalState)(defaultValue, value);
|
|
41
|
+
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
42
|
+
const dropdownRef = (0, react_1.useRef)(null);
|
|
15
43
|
const Icon = icon;
|
|
16
|
-
const valueToNameMapping = constructValueToNameMapping(children);
|
|
17
|
-
const optionValues =
|
|
44
|
+
const valueToNameMapping = (0, selectUtils_1.constructValueToNameMapping)(children);
|
|
45
|
+
const optionValues = react_1.default.Children.map(children, (child) => child.props.value);
|
|
18
46
|
const handleValueChange = (value) => {
|
|
19
47
|
setSelectedValue(value);
|
|
20
48
|
setIsFocused(false);
|
|
21
49
|
onValueChange?.(value);
|
|
22
50
|
};
|
|
23
|
-
const [hoveredValue, handleKeyDown] = useSelectOnKeyDown(handleValueChange, optionValues, isFocused, setIsFocused, selectedValue);
|
|
24
|
-
const hasSelection = hasValue(selectedValue);
|
|
25
|
-
return (
|
|
51
|
+
const [hoveredValue, handleKeyDown] = (0, hooks_1.useSelectOnKeyDown)(handleValueChange, optionValues, isFocused, setIsFocused, selectedValue);
|
|
52
|
+
const hasSelection = (0, selectUtils_1.hasValue)(selectedValue);
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: (0, lib_1.mergeRefs)([dropdownRef, ref]), onKeyDown: handleKeyDown, style: {
|
|
26
54
|
position: 'relative',
|
|
27
55
|
width: '100%',
|
|
28
56
|
minWidth: '10rem',
|
|
29
|
-
}, ...other, children: [
|
|
57
|
+
}, ...other, children: [(0, jsx_runtime_1.jsxs)("button", { style: {
|
|
30
58
|
display: 'flex',
|
|
31
59
|
justifyContent: 'space-between',
|
|
32
60
|
alignItems: 'center',
|
|
@@ -38,20 +66,20 @@ const Dropdown = React.forwardRef((props, ref) => {
|
|
|
38
66
|
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
39
67
|
cursor: 'pointer',
|
|
40
68
|
background: 'white',
|
|
41
|
-
}, type: "button", onClick: () => setIsFocused(!isFocused), disabled: disabled, children: [
|
|
69
|
+
}, type: "button", onClick: () => setIsFocused(!isFocused), disabled: disabled, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
42
70
|
display: 'flex',
|
|
43
71
|
justifyContent: 'start',
|
|
44
72
|
alignItems: 'center',
|
|
45
73
|
whiteSpace: 'nowrap',
|
|
46
74
|
overflow: 'hidden',
|
|
47
75
|
textOverflow: 'ellipsis',
|
|
48
|
-
}, children: [Icon ? (
|
|
76
|
+
}, children: [Icon ? ((0, jsx_runtime_1.jsx)(Icon, { style: {
|
|
49
77
|
flexShrink: 0,
|
|
50
78
|
height: '1.5rem',
|
|
51
79
|
width: '1.5rem',
|
|
52
80
|
color: theme?.secondaryTextColor || '#6C727F',
|
|
53
81
|
marginRight: '1.5rem',
|
|
54
|
-
}, "aria-hidden": "true" })) : null,
|
|
82
|
+
}, "aria-hidden": "true" })) : null, (0, jsx_runtime_1.jsx)("p", { style: {
|
|
55
83
|
margin: 0,
|
|
56
84
|
fontSize: '13px',
|
|
57
85
|
fontWeight: '500',
|
|
@@ -60,12 +88,13 @@ const Dropdown = React.forwardRef((props, ref) => {
|
|
|
60
88
|
textOverflow: 'ellipsis',
|
|
61
89
|
}, children: selectedValue
|
|
62
90
|
? valueToNameMapping.get(selectedValue)
|
|
63
|
-
: placeholder })] }),
|
|
91
|
+
: placeholder })] }), (0, jsx_runtime_1.jsx)(assets_1.ArrowDownHeadIcon, { style: {
|
|
64
92
|
flexShrink: 0,
|
|
65
93
|
height: '1.5rem',
|
|
66
94
|
width: '1.5rem',
|
|
67
95
|
marginRight: '-0.25rem',
|
|
68
96
|
color: theme?.secondaryTextColor || '#6C727F',
|
|
69
|
-
}, "aria-hidden": "true" })] }),
|
|
97
|
+
}, "aria-hidden": "true" })] }), (0, jsx_runtime_1.jsx)(Modal_1.default, { theme: theme, showModal: isFocused, setShowModal: setIsFocused, parentRef: dropdownRef, children: (0, jsx_runtime_1.jsx)(contexts_1.SelectedValueContext.Provider, { value: { selectedValue, handleValueChange }, children: (0, jsx_runtime_1.jsx)(contexts_1.HoveredValueContext.Provider, { value: { hoveredValue }, children: react_1.default.Children.map(children, (child) => react_1.default.cloneElement(child)) }) }) })] }));
|
|
70
98
|
});
|
|
71
|
-
|
|
99
|
+
exports.default = Dropdown;
|
|
100
|
+
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1,15 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
2
27
|
/* eslint-disable react/display-name */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const DropdownItem =
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const contexts_1 = require("../../contexts");
|
|
30
|
+
const DropdownItem = react_1.default.forwardRef((props, ref) => {
|
|
6
31
|
const { value, text, icon, className, theme, lastItem, ...other } = props;
|
|
7
|
-
const { selectedValue, handleValueChange } = useContext(SelectedValueContext);
|
|
8
|
-
const { hoveredValue } = useContext(HoveredValueContext);
|
|
32
|
+
const { selectedValue, handleValueChange } = (0, react_1.useContext)(contexts_1.SelectedValueContext);
|
|
33
|
+
const { hoveredValue } = (0, react_1.useContext)(contexts_1.HoveredValueContext);
|
|
9
34
|
const isActive = selectedValue === value;
|
|
10
35
|
const isHovered = hoveredValue === value;
|
|
11
36
|
const Icon = icon ? icon : null;
|
|
12
|
-
return (
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)("button", { ref: ref, style: {
|
|
13
38
|
display: 'flex',
|
|
14
39
|
alignItems: 'center',
|
|
15
40
|
justifyContent: 'start',
|
|
@@ -30,7 +55,7 @@ const DropdownItem = React.forwardRef((props, ref) => {
|
|
|
30
55
|
borderLeft: 'none',
|
|
31
56
|
cursor: 'pointer',
|
|
32
57
|
color: theme?.secondaryTextColor || '#364153',
|
|
33
|
-
}, type: "button", onClick: () => handleValueChange?.(value), ...other, children:
|
|
58
|
+
}, type: "button", onClick: () => handleValueChange?.(value), ...other, children: (0, jsx_runtime_1.jsx)("p", { style: {
|
|
34
59
|
margin: 0,
|
|
35
60
|
fontFamily: theme?.fontFamily,
|
|
36
61
|
color: theme?.primaryTextColor,
|
|
@@ -39,4 +64,5 @@ const DropdownItem = React.forwardRef((props, ref) => {
|
|
|
39
64
|
textOverflow: 'ellipsis',
|
|
40
65
|
}, children: text ?? value }) }));
|
|
41
66
|
});
|
|
42
|
-
|
|
67
|
+
exports.default = DropdownItem;
|
|
68
|
+
//# sourceMappingURL=DropdownItem.js.map
|
|
@@ -1,2 +1,11 @@
|
|
|
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.DropdownItem = exports.Dropdown = void 0;
|
|
7
|
+
var Dropdown_1 = require("./Dropdown");
|
|
8
|
+
Object.defineProperty(exports, "Dropdown", { enumerable: true, get: function () { return __importDefault(Dropdown_1).default; } });
|
|
9
|
+
var DropdownItem_1 = require("./DropdownItem");
|
|
10
|
+
Object.defineProperty(exports, "DropdownItem", { enumerable: true, get: function () { return __importDefault(DropdownItem_1).default; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,14 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
2
27
|
// @ts-nocheck
|
|
3
28
|
/* eslint-disable react/display-name */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const Modal =
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const hooks_1 = require("../../hooks");
|
|
31
|
+
const lib_1 = require("../../lib");
|
|
32
|
+
const Modal = react_1.default.forwardRef((props, ref) => {
|
|
8
33
|
const { showModal, setShowModal, parentRef, width, maxHeight = '18rem', children, className, theme, ...other } = props;
|
|
9
|
-
const [modalExceedsWindow, setModalExceedsWindow] = useState(false);
|
|
10
|
-
const modalRef = useRef(null);
|
|
11
|
-
const checkModalExceedsWindow = useCallback((modalWidth, windowWidth) => {
|
|
34
|
+
const [modalExceedsWindow, setModalExceedsWindow] = (0, react_1.useState)(false);
|
|
35
|
+
const modalRef = (0, react_1.useRef)(null);
|
|
36
|
+
const checkModalExceedsWindow = (0, react_1.useCallback)((modalWidth, windowWidth) => {
|
|
12
37
|
if (!parentRef.current) {
|
|
13
38
|
return false;
|
|
14
39
|
}
|
|
@@ -18,7 +43,7 @@ const Modal = React.forwardRef((props, ref) => {
|
|
|
18
43
|
const getAbsoluteSpacing = () => {
|
|
19
44
|
return modalExceedsWindow ? '0' : '0';
|
|
20
45
|
};
|
|
21
|
-
useOnClickOutside(modalRef, e => {
|
|
46
|
+
(0, hooks_1.useOnClickOutside)(modalRef, e => {
|
|
22
47
|
// Exclude click on trigger button (e.g. Dropdown Button) from outside click handler
|
|
23
48
|
const isTriggerElem = parentRef
|
|
24
49
|
? parentRef.current?.contains(e.target)
|
|
@@ -28,17 +53,17 @@ const Modal = React.forwardRef((props, ref) => {
|
|
|
28
53
|
}
|
|
29
54
|
});
|
|
30
55
|
// Execute only when modal is of absolute size
|
|
31
|
-
useEffect(() => {
|
|
56
|
+
(0, react_1.useEffect)(() => {
|
|
32
57
|
if (width) {
|
|
33
58
|
setModalExceedsWindow(checkModalExceedsWindow(width, window.innerWidth));
|
|
34
59
|
}
|
|
35
60
|
}, [checkModalExceedsWindow, parentRef, width]);
|
|
36
|
-
useOnWindowResize(() => {
|
|
61
|
+
(0, hooks_1.useOnWindowResize)(() => {
|
|
37
62
|
if (width) {
|
|
38
63
|
setModalExceedsWindow(checkModalExceedsWindow(width, window.innerWidth));
|
|
39
64
|
}
|
|
40
65
|
});
|
|
41
|
-
return showModal ? (
|
|
66
|
+
return showModal ? ((0, jsx_runtime_1.jsx)("div", { ref: (0, lib_1.mergeRefs)([modalRef, ref]), style: {
|
|
42
67
|
position: 'absolute',
|
|
43
68
|
zIndex: 10,
|
|
44
69
|
overflowY: 'auto',
|
|
@@ -62,4 +87,5 @@ const Modal = React.forwardRef((props, ref) => {
|
|
|
62
87
|
boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
|
|
63
88
|
}, ...other, children: children })) : null;
|
|
64
89
|
});
|
|
65
|
-
|
|
90
|
+
exports.default = Modal;
|
|
91
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
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.default = void 0;
|
|
7
|
+
var Modal_1 = require("./Modal");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Modal_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuillCard = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const assets_1 = require("../assets");
|
|
6
|
+
function QuillCard({ children, theme, onClick, isSelected = false, clickable = true, onClose, minHeight = 0, style = {}, }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: clickable ? 'quill-card-hover' : '', style: {
|
|
5
8
|
backgroundColor: theme.backgroundColor || 'white',
|
|
6
9
|
cursor: clickable ? 'pointer' : 'default',
|
|
7
10
|
padding: 16,
|
|
@@ -14,7 +17,7 @@ export function QuillCard({ children, theme, onClick, isSelected = false, clicka
|
|
|
14
17
|
position: 'relative',
|
|
15
18
|
minHeight: minHeight,
|
|
16
19
|
...style,
|
|
17
|
-
}, onClick: onClick, children: [
|
|
20
|
+
}, onClick: onClick, children: [(0, jsx_runtime_1.jsx)("style", { children: `
|
|
18
21
|
.quill-card-hover:hover {
|
|
19
22
|
background-color: #f9f9f9 !important;
|
|
20
23
|
.quill-delete-button {
|
|
@@ -24,7 +27,7 @@ export function QuillCard({ children, theme, onClick, isSelected = false, clicka
|
|
|
24
27
|
background-color: #f5f5f5;
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
|
-
` }), onClose && (
|
|
30
|
+
` }), onClose && ((0, jsx_runtime_1.jsxs)("button", { className: "quill-delete-button", type: "button", onClick: e => {
|
|
28
31
|
e.stopPropagation();
|
|
29
32
|
onClose();
|
|
30
33
|
}, style: {
|
|
@@ -42,11 +45,13 @@ export function QuillCard({ children, theme, onClick, isSelected = false, clicka
|
|
|
42
45
|
justifyContent: 'center',
|
|
43
46
|
borderRadius: 6,
|
|
44
47
|
float: 'right',
|
|
45
|
-
}, children: [
|
|
48
|
+
}, children: [(0, jsx_runtime_1.jsx)("style", { children: `
|
|
46
49
|
.quill-delete-button {
|
|
47
50
|
background-color: white;
|
|
48
51
|
}
|
|
49
52
|
.quill-delete-button:hover {
|
|
50
53
|
background-color: rgba(56, 65, 81, 0.03);
|
|
51
|
-
}` }),
|
|
54
|
+
}` }), (0, jsx_runtime_1.jsx)(assets_1.XIcon, { height: "20", width: "20", fill: "#6C727F" })] })), (0, jsx_runtime_1.jsx)("div", { style: { overflowX: 'scroll' }, children: children })] }));
|
|
52
55
|
}
|
|
56
|
+
exports.QuillCard = QuillCard;
|
|
57
|
+
//# sourceMappingURL=QuillCard.js.map
|
|
@@ -1,5 +1,10 @@
|
|
|
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
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = __importDefault(require("@monaco-editor/react"));
|
|
3
8
|
function defineEditorTheme(monaco) {
|
|
4
9
|
monaco.editor.defineTheme('onedark', {
|
|
5
10
|
base: 'vs',
|
|
@@ -25,8 +30,8 @@ function setEditorTheme(editor, monaco) {
|
|
|
25
30
|
console.log('ERROR: ', e);
|
|
26
31
|
}
|
|
27
32
|
}
|
|
28
|
-
|
|
29
|
-
return (
|
|
33
|
+
function SqlTextEditor({ containerStyle, value, setValue, }) {
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { ...containerStyle }, children: (0, jsx_runtime_1.jsx)(react_1.default, { height: "224px", defaultLanguage: "pgsql", defaultValue: "", value: value, loading: (0, jsx_runtime_1.jsx)("div", {}), options: {
|
|
30
35
|
wordWrap: 'on',
|
|
31
36
|
minimap: {
|
|
32
37
|
enabled: false,
|
|
@@ -36,3 +41,5 @@ export default function SqlTextEditor({ containerStyle, value, setValue, }) {
|
|
|
36
41
|
setValue(query);
|
|
37
42
|
}, beforeMount: (monaco) => defineEditorTheme(monaco), onMount: setEditorTheme }) }));
|
|
38
43
|
}
|
|
44
|
+
exports.default = SqlTextEditor;
|
|
45
|
+
//# sourceMappingURL=SqlTextEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqlTextEditor.js","sourceRoot":"","sources":["../../src/components/SqlTextEditor.tsx"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"SqlTextEditor.js","sourceRoot":"","sources":["../../src/components/SqlTextEditor.tsx"],"names":[],"mappings":";;;;;;AAGA,iEAAgD;AAEhD,SAAS,iBAAiB,CAAC,MAAM;IAC/B,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE;QACnC,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;QACb,KAAK,EAAE;YACL;gBACE,KAAK,EAAE,SAAS;gBAChB,UAAU,EAAE,SAAS;gBACrB,SAAS,EAAE,QAAQ;aACpB;YACD,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE;SAC7C;QACD,MAAM,EAAE;YACN,mBAAmB,EAAE,SAAS;SAC/B;KACF,CAAC,CAAC;AACL,CAAC;AACD,SAAS,cAAc,CAAC,MAAM,EAAE,MAAM;IACpC,IAAI,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,SAAwB,aAAa,CAAC,EACpC,cAAc,EACd,KAAK,EACL,QAAQ,GAKT;IACC,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,GAAG,cAAc,EAAE,YAC/B,uBAAC,eAAY,IACX,MAAM,EAAC,OAAO,EACd,eAAe,EAAC,OAAO,EACvB,YAAY,EAAC,EAAE,EACf,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iCAAO,EAChB,OAAO,EAAE;gBACP,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE;oBACP,OAAO,EAAE,KAAK;iBACf;gBACD,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;aACrB,EACD,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,QAAQ,CAAC,KAAM,CAAC,CAAC;YACnB,CAAC,EACD,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAClD,OAAO,EAAE,cAAc,GACvB,GACE,CACP,CAAC;AACJ,CAAC;AAhCD,gCAgCC"}
|