@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.
Files changed (82) hide show
  1. package/dist/AddToDashboardModal.js +181 -146
  2. package/dist/BarList.js +44 -36
  3. package/dist/Chart.js +132 -99
  4. package/dist/ChartBuilder.js +89 -80
  5. package/dist/ChartEditor.js +21 -14
  6. package/dist/Context.js +57 -52
  7. package/dist/Dashboard.js +213 -180
  8. package/dist/Dashboard.js.map +1 -1
  9. package/dist/DateRangePicker/Calendar.js +46 -41
  10. package/dist/DateRangePicker/DateRangePicker.js +61 -32
  11. package/dist/DateRangePicker/DateRangePickerButton.js +17 -14
  12. package/dist/DateRangePicker/dateRangePickerUtils.js +90 -76
  13. package/dist/DateRangePicker/dateRangePickerUtils.js.map +1 -1
  14. package/dist/DateRangePicker/index.js +9 -1
  15. package/dist/PieChart.js +70 -35
  16. package/dist/QuillProvider.js +7 -4
  17. package/dist/ReportBuilder.js +129 -120
  18. package/dist/SQLEditor.js +65 -56
  19. package/dist/Table.d.ts.map +1 -1
  20. package/dist/Table.js +71 -60
  21. package/dist/Table.js.map +1 -1
  22. package/dist/TableChart.js +45 -17
  23. package/dist/assets/ArrowDownHeadIcon.js +6 -3
  24. package/dist/assets/ArrowDownIcon.js +6 -3
  25. package/dist/assets/ArrowDownRightIcon.js +6 -3
  26. package/dist/assets/ArrowLeftHeadIcon.js +6 -3
  27. package/dist/assets/ArrowRightHeadIcon.js +6 -3
  28. package/dist/assets/ArrowRightIcon.js +6 -3
  29. package/dist/assets/ArrowUpHeadIcon.js +6 -3
  30. package/dist/assets/ArrowUpIcon.js +6 -3
  31. package/dist/assets/ArrowUpRightIcon.js +6 -3
  32. package/dist/assets/CalendarIcon.js +6 -3
  33. package/dist/assets/CalendarNormalIcon.js +6 -3
  34. package/dist/assets/DoubleArrowLeftHeadIcon.js +6 -3
  35. package/dist/assets/DoubleArrowRightHeadIcon.js +6 -3
  36. package/dist/assets/ExclamationFilledIcon.js +6 -3
  37. package/dist/assets/FilterIcon.js +6 -3
  38. package/dist/assets/LoadingSpinner.js +6 -3
  39. package/dist/assets/RefreshIcon.js +6 -3
  40. package/dist/assets/SearchIcon.js +6 -3
  41. package/dist/assets/UpLeftArrowsIcon.js +6 -3
  42. package/dist/assets/XCircleIcon.js +6 -3
  43. package/dist/assets/XIcon.js +6 -3
  44. package/dist/assets/index.js +49 -21
  45. package/dist/components/BigModal/BigModal.js +39 -13
  46. package/dist/components/Dropdown/Dropdown.js +53 -24
  47. package/dist/components/Dropdown/DropdownItem.js +35 -9
  48. package/dist/components/Dropdown/index.js +11 -2
  49. package/dist/components/Modal/Modal.js +39 -13
  50. package/dist/components/Modal/index.js +9 -1
  51. package/dist/components/QuillCard.js +13 -8
  52. package/dist/components/SqlTextEditor.js +11 -4
  53. package/dist/components/SqlTextEditor.js.map +1 -0
  54. package/dist/components/UiComponents.js +51 -37
  55. package/dist/components/selectUtils.js +17 -6
  56. package/dist/contexts/BaseColorContext.js +6 -3
  57. package/dist/contexts/HoveredValueContext.js +6 -3
  58. package/dist/contexts/RootStylesContext.js +6 -3
  59. package/dist/contexts/SelectedValueContext.js +6 -3
  60. package/dist/contexts/index.js +15 -4
  61. package/dist/hooks/index.js +15 -4
  62. package/dist/hooks/useDashboard.js +17 -11
  63. package/dist/hooks/useDashboard.js.map +1 -0
  64. package/dist/hooks/useInternalState.js +6 -3
  65. package/dist/hooks/useOnClickOutside.js +6 -3
  66. package/dist/hooks/useOnWindowResize.js +7 -4
  67. package/dist/hooks/useQuill.js +16 -11
  68. package/dist/hooks/useSelectOnKeyDown.js +7 -4
  69. package/dist/index.js +33 -13
  70. package/dist/index.js.map +1 -1
  71. package/dist/internals/ReportBuilder/PivotList.js +20 -14
  72. package/dist/internals/ReportBuilder/PivotModal.js +92 -84
  73. package/dist/internals/ReportBuilder/PivotModal.spec.js +73 -70
  74. package/dist/lib/font.js +6 -2
  75. package/dist/lib/index.js +20 -3
  76. package/dist/lib/inputTypes.js +3 -1
  77. package/dist/lib/utils.js +19 -8
  78. package/dist/utils/aggregate.js +35 -28
  79. package/dist/utils/colorToHex.js +5 -1
  80. package/dist/utils/dataFetcher.js +8 -2
  81. package/dist/utils/downloadCSV.js +6 -1
  82. package/package.json +2 -1
@@ -1,32 +1,60 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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
- import React, { useRef, useState } from 'react';
4
- import { HoveredValueContext, SelectedValueContext } from '../../contexts';
5
- import { useInternalState, useSelectOnKeyDown } from '../../hooks';
6
- import { ArrowDownHeadIcon } from '../../assets';
7
- import { mergeRefs } from '../../lib';
8
- import { constructValueToNameMapping, hasValue } from '../selectUtils';
9
- import Modal from '../Modal';
10
- const Dropdown = React.forwardRef((props, ref) => {
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 = React.Children.map(children, (child) => child.props.value);
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 (_jsxs("div", { ref: mergeRefs([dropdownRef, ref]), onKeyDown: handleKeyDown, style: {
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: [_jsxs("button", { style: {
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: [_jsxs("div", { style: {
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 ? (_jsx(Icon, { style: {
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, _jsx("p", { style: {
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 })] }), _jsx(ArrowDownHeadIcon, { style: {
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" })] }), _jsx(Modal, { theme: theme, showModal: isFocused, setShowModal: setIsFocused, parentRef: dropdownRef, children: _jsx(SelectedValueContext.Provider, { value: { selectedValue, handleValueChange }, children: _jsx(HoveredValueContext.Provider, { value: { hoveredValue }, children: React.Children.map(children, (child) => React.cloneElement(child)) }) }) })] }));
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
- export default Dropdown;
99
+ exports.default = Dropdown;
100
+ //# sourceMappingURL=Dropdown.js.map
@@ -1,15 +1,40 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
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
- import React, { useContext } from 'react';
4
- import { HoveredValueContext, SelectedValueContext } from '../../contexts';
5
- const DropdownItem = React.forwardRef((props, ref) => {
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 (_jsx("button", { ref: ref, style: {
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: _jsx("p", { style: {
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
- export default DropdownItem;
67
+ exports.default = DropdownItem;
68
+ //# sourceMappingURL=DropdownItem.js.map
@@ -1,2 +1,11 @@
1
- export { default as Dropdown } from "./Dropdown";
2
- export { default as DropdownItem } from "./DropdownItem";
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
- import { jsx as _jsx } from "react/jsx-runtime";
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
- import React, { useCallback, useEffect, useRef, useState } from 'react';
5
- import { useOnClickOutside, useOnWindowResize } from '../../hooks';
6
- import { mergeRefs } from '../../lib';
7
- const Modal = React.forwardRef((props, ref) => {
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 ? (_jsx("div", { ref: mergeRefs([modalRef, ref]), style: {
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
- export default Modal;
90
+ exports.default = Modal;
91
+ //# sourceMappingURL=Modal.js.map
@@ -1 +1,9 @@
1
- export { default } from "./Modal";
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
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { XIcon } from '../assets';
3
- export function QuillCard({ children, theme, onClick, isSelected = false, clickable = true, onClose, minHeight = 0, style = {}, }) {
4
- return (_jsxs("div", { className: clickable ? 'quill-card-hover' : '', style: {
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: [_jsx("style", { 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 && (_jsxs("button", { className: "quill-delete-button", type: "button", onClick: e => {
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: [_jsx("style", { 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
- }` }), _jsx(XIcon, { height: "20", width: "20", fill: "#6C727F" })] })), _jsx("div", { style: { overflowX: 'scroll' }, children: children })] }));
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,7 +1,12 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import MonacoEditor from '@monaco-editor/react';
3
- export default function SqlTextEditor({ containerStyle, value, setValue, }) {
4
- return (_jsx("div", { style: { ...containerStyle, padding: '10px 0px' }, children: _jsx(MonacoEditor, { height: "100px", defaultLanguage: "pgsql", defaultValue: "", value: value, loading: _jsx("div", {}), options: {
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"));
8
+ function SqlTextEditor({ containerStyle, value, setValue, }) {
9
+ return ((0, jsx_runtime_1.jsx)("div", { style: { ...containerStyle, padding: '10px 0px' }, children: (0, jsx_runtime_1.jsx)(react_1.default, { height: "100px", defaultLanguage: "pgsql", defaultValue: "", value: value, loading: (0, jsx_runtime_1.jsx)("div", {}), options: {
5
10
  wordWrap: 'on',
6
11
  minimap: {
7
12
  enabled: false,
@@ -12,3 +17,5 @@ export default function SqlTextEditor({ containerStyle, value, setValue, }) {
12
17
  setValue(query);
13
18
  } }) }));
14
19
  }
20
+ exports.default = SqlTextEditor;
21
+ //# sourceMappingURL=SqlTextEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqlTextEditor.js","sourceRoot":"","sources":["../../src/components/SqlTextEditor.tsx"],"names":[],"mappings":";;;;;;AACA,iEAAgD;AAEhD,SAAwB,aAAa,CAAC,EACpC,cAAc,EACd,KAAK,EACL,QAAQ,GAKT;IACC,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,YACpD,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,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACnB,QAAQ,CAAC,KAAM,CAAC,CAAC;YACnB,CAAC,GACD,GACE,CACP,CAAC;AACJ,CAAC;AA/BD,gCA+BC"}
@@ -1,11 +1,14 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MemoizedDeleteButton = exports.MemoizedModal = exports.MemoizedPopover = exports.MemoizedText = exports.MemoizedLabel = exports.MemoizedHeader = exports.MemoizedSelect = exports.MemoizedSecondaryButton = exports.MemoizedButton = exports.MemoizedTextInput = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
2
5
  // @ts-nocheck
3
- import { useContext, useEffect, useRef } from 'react';
4
- import { ArrowDownHeadIcon, XIcon } from '../assets';
5
- import { ThemeContext } from '../Context';
6
- export const MemoizedTextInput = ({ value, onChange, placeholder, id }) => {
7
- const [theme] = useContext(ThemeContext);
8
- return (_jsxs("div", { style: { position: 'relative' }, children: [_jsx("style", { children: `
6
+ const react_1 = require("react");
7
+ const assets_1 = require("../assets");
8
+ const Context_1 = require("../Context");
9
+ const MemoizedTextInput = ({ value, onChange, placeholder, id }) => {
10
+ const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
11
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative' }, children: [(0, jsx_runtime_1.jsx)("style", { children: `
9
12
  .quill-text-input {
10
13
  background-color: white;
11
14
  height: 40px;
@@ -20,11 +23,12 @@ export const MemoizedTextInput = ({ value, onChange, placeholder, id }) => {
20
23
  padding-top: 0px;
21
24
  padding-bottom: 0px;
22
25
  box-sizing: content-box;
23
- }` }), _jsx("input", { id: id, className: "quill-text-input", type: "text", value: value, onChange: event => onChange(event.target.value), placeholder: placeholder, style: { fontFamily: theme?.fontFamily } })] }));
26
+ }` }), (0, jsx_runtime_1.jsx)("input", { id: id, className: "quill-text-input", type: "text", value: value, onChange: event => onChange(event.target.value), placeholder: placeholder, style: { fontFamily: theme?.fontFamily } })] }));
24
27
  };
25
- export const MemoizedButton = ({ label, onClick, primary = true }) => {
26
- const [theme] = useContext(ThemeContext);
27
- return (_jsxs("button", { className: "quill-button", onClick: onClick, style: { fontFamily: theme?.fontFamily }, children: [_jsx("style", { children: `
28
+ exports.MemoizedTextInput = MemoizedTextInput;
29
+ const MemoizedButton = ({ label, onClick, primary = true }) => {
30
+ const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
31
+ return ((0, jsx_runtime_1.jsxs)("button", { className: "quill-button", onClick: onClick, style: { fontFamily: theme?.fontFamily }, children: [(0, jsx_runtime_1.jsx)("style", { children: `
28
32
  .quill-button {
29
33
  background-color: #384151;
30
34
  color: white;
@@ -45,9 +49,10 @@ export const MemoizedButton = ({ label, onClick, primary = true }) => {
45
49
  overflow: hidden;
46
50
  }` }), label] }));
47
51
  };
48
- export const MemoizedSecondaryButton = ({ label, onClick }) => {
49
- const [theme] = useContext(ThemeContext);
50
- return (_jsxs("button", { className: "quill-secondary-button", onClick: onClick, style: { fontFamily: theme?.fontFamily }, children: [_jsx("style", { children: `
52
+ exports.MemoizedButton = MemoizedButton;
53
+ const MemoizedSecondaryButton = ({ label, onClick }) => {
54
+ const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
55
+ return ((0, jsx_runtime_1.jsxs)("button", { className: "quill-secondary-button", onClick: onClick, style: { fontFamily: theme?.fontFamily }, children: [(0, jsx_runtime_1.jsx)("style", { children: `
51
56
  .quill-secondary-button {
52
57
  background-color: #F5F5F6;
53
58
  color: rgba(56, 65, 81, 0.75);
@@ -65,12 +70,13 @@ export const MemoizedSecondaryButton = ({ label, onClick }) => {
65
70
  background-color: rgba(56, 65, 81, 0.09);
66
71
  }` }), label] }));
67
72
  };
68
- export const MemoizedSelect = ({ value, onChange, options, disabled = false, label, }) => {
69
- const [theme] = useContext(ThemeContext);
70
- return (_jsxs("div", { style: {
73
+ exports.MemoizedSecondaryButton = MemoizedSecondaryButton;
74
+ const MemoizedSelect = ({ value, onChange, options, disabled = false, label, }) => {
75
+ const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
76
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
71
77
  position: 'relative',
72
78
  maxWidth: 206,
73
- }, children: [_jsx("style", { children: `
79
+ }, children: [(0, jsx_runtime_1.jsx)("style", { children: `
74
80
  .quill-select {
75
81
  background-color: white;
76
82
  height: 42px;
@@ -82,7 +88,7 @@ export const MemoizedSelect = ({ value, onChange, options, disabled = false, lab
82
88
  box-shadow: 0px 1px 4px 0px rgba(56, 65, 81, 0.08);
83
89
  padding-left: 12px;
84
90
  padding-right: 12px;
85
- }` }), _jsx("select", { style: { WebkitAppearance: 'none', fontFamily: theme?.fontFamily }, className: "quill-select", value: value, disabled: disabled, onChange: event => onChange(event.target.value), children: options.map(option => (_jsx("option", { className: "quill-option", value: option.value, children: option.label }, option.value))) }), _jsx(ArrowDownHeadIcon, { style: {
91
+ }` }), (0, jsx_runtime_1.jsx)("select", { style: { WebkitAppearance: 'none', fontFamily: theme?.fontFamily }, className: "quill-select", value: value, disabled: disabled, onChange: event => onChange(event.target.value), children: options.map(option => ((0, jsx_runtime_1.jsx)("option", { className: "quill-option", value: option.value, children: option.label }, option.value))) }), (0, jsx_runtime_1.jsx)(assets_1.ArrowDownHeadIcon, { style: {
86
92
  height: '20px',
87
93
  width: '20px',
88
94
  flex: 'none',
@@ -92,7 +98,8 @@ export const MemoizedSelect = ({ value, onChange, options, disabled = false, lab
92
98
  color: '#6C727F',
93
99
  }, "aria-hidden": "true" })] }));
94
100
  };
95
- export const MemoizedHeader = ({ children }) => (_jsx("h1", { style: {
101
+ exports.MemoizedSelect = MemoizedSelect;
102
+ const MemoizedHeader = ({ children }) => ((0, jsx_runtime_1.jsx)("h1", { style: {
96
103
  fontSize: 16,
97
104
  fontWeight: 600,
98
105
  color: '#384151',
@@ -100,22 +107,25 @@ export const MemoizedHeader = ({ children }) => (_jsx("h1", { style: {
100
107
  margin: 0,
101
108
  padding: 0,
102
109
  }, children: children }));
103
- export const MemoizedLabel = ({ children }) => (_jsx("h1", { style: {
110
+ exports.MemoizedHeader = MemoizedHeader;
111
+ const MemoizedLabel = ({ children }) => ((0, jsx_runtime_1.jsx)("h1", { style: {
104
112
  fontSize: 14,
105
113
  fontWeight: 600,
106
114
  color: '#575E6A',
107
115
  userSelect: 'none',
108
116
  paddingBottom: 5,
109
117
  }, children: children }));
110
- export const MemoizedText = ({ children }) => (_jsx("p", { style: {
118
+ exports.MemoizedLabel = MemoizedLabel;
119
+ const MemoizedText = ({ children }) => ((0, jsx_runtime_1.jsx)("p", { style: {
111
120
  fontSize: 12,
112
121
  fontWeight: 400,
113
122
  margin: 0,
114
123
  color: '#575E6A',
115
124
  userSelect: 'none',
116
125
  }, children: children }));
126
+ exports.MemoizedText = MemoizedText;
117
127
  const useOnClickOutside = (ref, handler) => {
118
- useEffect(() => {
128
+ (0, react_1.useEffect)(() => {
119
129
  const listener = (event) => {
120
130
  if (!ref.current || ref.current.contains(event.target)) {
121
131
  return;
@@ -130,8 +140,8 @@ const useOnClickOutside = (ref, handler) => {
130
140
  };
131
141
  }, [ref, handler]);
132
142
  };
133
- export function MemoizedPopover({ onClose, parentRef, children, style = {}, onClick, label, showTrigger = true, isOpen, setIsOpen, }) {
134
- const modalRef = useRef(null);
143
+ function MemoizedPopover({ onClose, parentRef, children, style = {}, onClick, label, showTrigger = true, isOpen, setIsOpen, }) {
144
+ const modalRef = (0, react_1.useRef)(null);
135
145
  useOnClickOutside(modalRef, e => {
136
146
  // Exclude click on trigger button (e.g. Dropdown Button) from outside click handler
137
147
  const isTriggerElem = parentRef
@@ -147,12 +157,12 @@ export function MemoizedPopover({ onClose, parentRef, children, style = {}, onCl
147
157
  onClose();
148
158
  }
149
159
  };
150
- return (_jsxs("div", { children: [showTrigger && (_jsx(MemoizedSecondaryButton, { onClick: e => {
160
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [showTrigger && ((0, jsx_runtime_1.jsx)(exports.MemoizedSecondaryButton, { onClick: e => {
151
161
  setIsOpen(isOpen => !isOpen);
152
162
  if (onClick) {
153
163
  onClick(e);
154
164
  }
155
- }, label: label })), isOpen && (_jsx("div", { id: "quill-popover-modal", ref: modalRef, style: { position: 'relative' }, children: _jsx("div", { style: {
165
+ }, label: label })), isOpen && ((0, jsx_runtime_1.jsx)("div", { id: "quill-popover-modal", ref: modalRef, style: { position: 'relative' }, children: (0, jsx_runtime_1.jsx)("div", { style: {
156
166
  background: 'white',
157
167
  position: 'absolute',
158
168
  boxShadow: '0px 1px 12px 0px rgba(56, 65, 81, 0.1)',
@@ -166,11 +176,12 @@ export function MemoizedPopover({ onClose, parentRef, children, style = {}, onCl
166
176
  ...style,
167
177
  }, children: children }) }))] }));
168
178
  }
169
- export function MemoizedModal({ isOpen, onClose, setIsOpen, title, children, theme, }) {
179
+ exports.MemoizedPopover = MemoizedPopover;
180
+ function MemoizedModal({ isOpen, onClose, setIsOpen, title, children, theme, }) {
170
181
  if (!isOpen) {
171
182
  return null;
172
183
  }
173
- return (_jsxs(_Fragment, { children: [_jsx("div", { style: {
184
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: {
174
185
  position: 'fixed',
175
186
  top: '0',
176
187
  right: '0',
@@ -179,7 +190,7 @@ export function MemoizedModal({ isOpen, onClose, setIsOpen, title, children, the
179
190
  zIndex: '50',
180
191
  backgroundColor: 'rgba(255, 255, 255, 0.8)',
181
192
  backdropFilter: 'blur(5px)',
182
- }, onClick: onClose }), _jsx("div", { style: {
193
+ }, onClick: onClose }), (0, jsx_runtime_1.jsx)("div", { style: {
183
194
  // position: "absolute",
184
195
  position: 'fixed',
185
196
  left: '50%',
@@ -199,7 +210,7 @@ export function MemoizedModal({ isOpen, onClose, setIsOpen, title, children, the
199
210
  borderColor: '#e7e7e7',
200
211
  overflow: 'hidden',
201
212
  // zIndex: 1000,
202
- }, children: _jsxs("div", { style: {
213
+ }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
203
214
  // width: "80%",
204
215
  maxHeight: '90vh',
205
216
  overflowY: 'scroll',
@@ -211,13 +222,13 @@ export function MemoizedModal({ isOpen, onClose, setIsOpen, title, children, the
211
222
  flexDirection: 'column',
212
223
  alignItems: 'center',
213
224
  fontFamily: theme?.fontFamily,
214
- }, children: [_jsxs("div", { style: {
225
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
215
226
  display: 'flex',
216
227
  flexDirection: 'row',
217
228
  width: '100%',
218
229
  justifyContent: 'space-between',
219
230
  alignItems: 'center',
220
- }, children: [_jsx("h2", { style: {
231
+ }, children: [(0, jsx_runtime_1.jsx)("h2", { style: {
221
232
  fontSize: 18,
222
233
  fontWeight: '600',
223
234
  marginLeft: 20,
@@ -225,9 +236,10 @@ export function MemoizedModal({ isOpen, onClose, setIsOpen, title, children, the
225
236
  textAlign: 'left',
226
237
  paddingTop: 18,
227
238
  color: theme?.primaryTextColor,
228
- }, children: title }), _jsx(MemoizedDeleteButton, { onClick: onClose, style: { marginRight: 10, marginTop: 10 } })] }), children] }) })] }));
239
+ }, children: title }), (0, jsx_runtime_1.jsx)(exports.MemoizedDeleteButton, { onClick: onClose, style: { marginRight: 10, marginTop: 10 } })] }), children] }) })] }));
229
240
  }
230
- export const MemoizedDeleteButton = ({ onClick, style }) => (_jsxs("button", { className: "quill-delete-button", type: "button", onClick: onClick, style: {
241
+ exports.MemoizedModal = MemoizedModal;
242
+ const MemoizedDeleteButton = ({ onClick, style }) => ((0, jsx_runtime_1.jsxs)("button", { className: "quill-delete-button", type: "button", onClick: onClick, style: {
231
243
  height: 42,
232
244
  width: 42,
233
245
  border: 'none',
@@ -237,10 +249,12 @@ export const MemoizedDeleteButton = ({ onClick, style }) => (_jsxs("button", { c
237
249
  justifyContent: 'center',
238
250
  borderRadius: 6,
239
251
  ...style,
240
- }, children: [_jsx("style", { children: `
252
+ }, children: [(0, jsx_runtime_1.jsx)("style", { children: `
241
253
  .quill-delete-button {
242
254
  background-color: white;
243
255
  }
244
256
  .quill-delete-button:hover {
245
257
  background-color: rgba(56, 65, 81, 0.03);
246
- }` }), _jsx(XIcon, { height: "20", width: "20", fill: "#6C727F" })] }));
258
+ }` }), (0, jsx_runtime_1.jsx)(assets_1.XIcon, { height: "20", width: "20", fill: "#6C727F" })] }));
259
+ exports.MemoizedDeleteButton = MemoizedDeleteButton;
260
+ //# sourceMappingURL=UiComponents.js.map