@quillsql/react 2.11.14 → 2.11.16

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 (67) hide show
  1. package/dist/cjs/ChartBuilder.d.ts +7 -4
  2. package/dist/cjs/ChartBuilder.d.ts.map +1 -1
  3. package/dist/cjs/ChartBuilder.js +11 -10
  4. package/dist/cjs/Dashboard.d.ts +1 -0
  5. package/dist/cjs/Dashboard.d.ts.map +1 -1
  6. package/dist/cjs/Dashboard.js +3 -3
  7. package/dist/cjs/ReportBuilder.d.ts +18 -10
  8. package/dist/cjs/ReportBuilder.d.ts.map +1 -1
  9. package/dist/cjs/ReportBuilder.js +134 -72
  10. package/dist/cjs/SQLEditor.d.ts +1 -7
  11. package/dist/cjs/SQLEditor.d.ts.map +1 -1
  12. package/dist/cjs/SQLEditor.js +19 -4
  13. package/dist/cjs/components/ReportBuilder/AddColumnPopover.d.ts +24 -1
  14. package/dist/cjs/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
  15. package/dist/cjs/components/ReportBuilder/AddColumnPopover.js +26 -9
  16. package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts +13 -2
  17. package/dist/cjs/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -1
  18. package/dist/cjs/components/ReportBuilder/AddLimitPopover.js +18 -8
  19. package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts +2 -2
  20. package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
  21. package/dist/cjs/components/ReportBuilder/AddSortPopover.js +8 -8
  22. package/dist/cjs/components/ReportBuilder/ui.d.ts +0 -1
  23. package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
  24. package/dist/cjs/components/ReportBuilder/ui.js +31 -24
  25. package/dist/cjs/components/ReportBuilder/util.d.ts +1 -0
  26. package/dist/cjs/components/ReportBuilder/util.d.ts.map +1 -1
  27. package/dist/cjs/components/ReportBuilder/util.js +20 -1
  28. package/dist/cjs/components/UiComponents.d.ts +15 -14
  29. package/dist/cjs/components/UiComponents.d.ts.map +1 -1
  30. package/dist/cjs/components/UiComponents.js +26 -16
  31. package/dist/cjs/utils/width.d.ts +12 -0
  32. package/dist/cjs/utils/width.d.ts.map +1 -0
  33. package/dist/cjs/utils/width.js +25 -0
  34. package/dist/esm/ChartBuilder.d.ts +7 -4
  35. package/dist/esm/ChartBuilder.d.ts.map +1 -1
  36. package/dist/esm/ChartBuilder.js +11 -10
  37. package/dist/esm/Dashboard.d.ts +1 -0
  38. package/dist/esm/Dashboard.d.ts.map +1 -1
  39. package/dist/esm/Dashboard.js +3 -3
  40. package/dist/esm/ReportBuilder.d.ts +18 -10
  41. package/dist/esm/ReportBuilder.d.ts.map +1 -1
  42. package/dist/esm/ReportBuilder.js +136 -74
  43. package/dist/esm/SQLEditor.d.ts +1 -7
  44. package/dist/esm/SQLEditor.d.ts.map +1 -1
  45. package/dist/esm/SQLEditor.js +19 -4
  46. package/dist/esm/components/ReportBuilder/AddColumnPopover.d.ts +24 -1
  47. package/dist/esm/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
  48. package/dist/esm/components/ReportBuilder/AddColumnPopover.js +27 -10
  49. package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts +13 -2
  50. package/dist/esm/components/ReportBuilder/AddLimitPopover.d.ts.map +1 -1
  51. package/dist/esm/components/ReportBuilder/AddLimitPopover.js +19 -9
  52. package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts +2 -2
  53. package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
  54. package/dist/esm/components/ReportBuilder/AddSortPopover.js +8 -8
  55. package/dist/esm/components/ReportBuilder/ui.d.ts +0 -1
  56. package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
  57. package/dist/esm/components/ReportBuilder/ui.js +31 -23
  58. package/dist/esm/components/ReportBuilder/util.d.ts +1 -0
  59. package/dist/esm/components/ReportBuilder/util.d.ts.map +1 -1
  60. package/dist/esm/components/ReportBuilder/util.js +18 -0
  61. package/dist/esm/components/UiComponents.d.ts +15 -14
  62. package/dist/esm/components/UiComponents.d.ts.map +1 -1
  63. package/dist/esm/components/UiComponents.js +26 -16
  64. package/dist/esm/utils/width.d.ts +12 -0
  65. package/dist/esm/utils/width.d.ts.map +1 -0
  66. package/dist/esm/utils/width.js +21 -0
  67. package/package.json +1 -1
@@ -1,2 +1,25 @@
1
- export default function AddColumnPopover({ onSave, orderedColumnNames, setOrderedColumnNames, selectedColumns, setSelectedColumns, isSelectedAllColumns, clearAllState, nameToColumn, baseAst, setBaseAst, pivot, initialTableName, defaultAST, defaultTable, setPivot, TextInput, SelectColumn, SecondaryButton, Button, HandleButton, }: any): import("react/jsx-runtime").JSX.Element;
1
+ /// <reference types="react" />
2
+ import { TextInputComponentProps } from '../UiComponents';
3
+ export default function AddColumnPopover({ onSave, orderedColumnNames, setOrderedColumnNames, selectedColumns, setSelectedColumns, isSelectedAllColumns, clearAllState, nameToColumn, baseAst, setBaseAst, pivot, initialTableName, defaultAST, defaultTable, setPivot, TextInput, SelectColumn, SecondaryButton, Button, HandleButton, }: {
4
+ onSave: any;
5
+ orderedColumnNames: any;
6
+ setOrderedColumnNames: any;
7
+ selectedColumns: any;
8
+ setSelectedColumns: any;
9
+ isSelectedAllColumns: any;
10
+ clearAllState: any;
11
+ nameToColumn: any;
12
+ baseAst: any;
13
+ setBaseAst: any;
14
+ pivot: any;
15
+ initialTableName: any;
16
+ defaultAST: any;
17
+ defaultTable: any;
18
+ setPivot: any;
19
+ TextInput: (props: TextInputComponentProps) => JSX.Element;
20
+ SelectColumn: any;
21
+ SecondaryButton: any;
22
+ Button: any;
23
+ HandleButton: any;
24
+ }): import("react/jsx-runtime").JSX.Element;
2
25
  //# sourceMappingURL=AddColumnPopover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddColumnPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/AddColumnPopover.tsx"],"names":[],"mappings":"AAoBA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,eAAe,EACf,MAAM,EACN,YAAY,GACb,EAAE,GAAG,2CAgML"}
1
+ {"version":3,"file":"AddColumnPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/AddColumnPopover.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAI1D,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,eAAe,EACf,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,GAAG,CAAC;IACZ,kBAAkB,EAAE,GAAG,CAAC;IACxB,qBAAqB,EAAE,GAAG,CAAC;IAC3B,eAAe,EAAE,GAAG,CAAC;IACrB,kBAAkB,EAAE,GAAG,CAAC;IACxB,oBAAoB,EAAE,GAAG,CAAC;IAC1B,aAAa,EAAE,GAAG,CAAC;IACnB,YAAY,EAAE,GAAG,CAAC;IAClB,OAAO,EAAE,GAAG,CAAC;IACb,UAAU,EAAE,GAAG,CAAC;IAChB,KAAK,EAAE,GAAG,CAAC;IACX,gBAAgB,EAAE,GAAG,CAAC;IACtB,UAAU,EAAE,GAAG,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC;IACd,SAAS,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,GAAG,CAAC,OAAO,CAAC;IAC3D,YAAY,EAAE,GAAG,CAAC;IAClB,eAAe,EAAE,GAAG,CAAC;IACrB,MAAM,EAAE,GAAG,CAAC;IACZ,YAAY,EAAE,GAAG,CAAC;CACnB,2CAsNA"}
@@ -6,9 +6,19 @@ const core_1 = require("@dnd-kit/core");
6
6
  const sortable_1 = require("@dnd-kit/sortable");
7
7
  const utilities_1 = require("@dnd-kit/utilities");
8
8
  const Context_1 = require("../../Context");
9
+ const width_1 = require("../../utils/width");
10
+ const textProcessing_1 = require("../../utils/textProcessing");
9
11
  function AddColumnPopover({ onSave, orderedColumnNames, setOrderedColumnNames, selectedColumns, setSelectedColumns, isSelectedAllColumns, clearAllState, nameToColumn, baseAst, setBaseAst, pivot, initialTableName, defaultAST, defaultTable, setPivot, TextInput, SelectColumn, SecondaryButton, Button, HandleButton, }) {
10
12
  const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
11
13
  const [search, setSearch] = (0, react_1.useState)('');
14
+ const [searchResults, setSearchResults] = (0, react_1.useState)(orderedColumnNames);
15
+ const textInputContainerRef = (0, react_1.useRef)(null);
16
+ const [searchInputWidth, setSearchInputWidth] = (0, react_1.useState)(200);
17
+ (0, react_1.useEffect)(() => {
18
+ // Since the TextInput component takes a required numeric width parameter,
19
+ // we dynamically calculate the width of this component onload here.
20
+ (0, width_1.updateFirstChildWidth)(textInputContainerRef, setSearchInputWidth);
21
+ }, []);
12
22
  const sensors = (0, core_1.useSensors)((0, core_1.useSensor)(core_1.PointerSensor), (0, core_1.useSensor)(core_1.KeyboardSensor, {
13
23
  coordinateGetter: sortable_1.sortableKeyboardCoordinates,
14
24
  }));
@@ -29,25 +39,32 @@ function AddColumnPopover({ onSave, orderedColumnNames, setOrderedColumnNames, s
29
39
  const { valueField, rowField, columnField } = pivot;
30
40
  return [valueField, rowField, columnField].filter(Boolean);
31
41
  };
32
- const searchResults = orderedColumnNames
33
- .filter((row) => {
34
- const [table, _column] = row.split('.');
35
- return (selectedColumns.length === 0 || selectedColumns[0].startsWith(table));
36
- })
37
- .filter((row) => search.length === 0 || row.includes(search));
42
+ (0, react_1.useEffect)(() => {
43
+ setSearchResults(orderedColumnNames
44
+ .filter((row) => {
45
+ const [table, _column] = row.split('.');
46
+ return (selectedColumns.length === 0 || selectedColumns[0].startsWith(table));
47
+ })
48
+ .filter((row) => search.length === 0 ||
49
+ row.includes(search) ||
50
+ (0, textProcessing_1.snakeCaseToTitleCase)(row)
51
+ .toLowerCase()
52
+ .includes(search.toLowerCase())));
53
+ }, [search, orderedColumnNames, selectedColumns]);
38
54
  return ((0, jsx_runtime_1.jsxs)("div", { style: {
39
55
  display: 'flex',
40
56
  flexDirection: 'column',
41
57
  gap: 2,
42
58
  minWidth: 300,
43
59
  maxHeight: 500,
44
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
60
+ }, children: [(0, jsx_runtime_1.jsx)("div", { ref: textInputContainerRef, style: {
45
61
  position: 'relative',
46
62
  display: 'flex',
47
63
  flexDirection: 'row',
48
64
  alignItems: 'center',
49
65
  marginTop: 2,
50
- }, children: (0, jsx_runtime_1.jsx)(TextInput, { type: "text", value: search, placeholder: 'Search...', style: { marginBottom: 6, width: '100%' }, onChange: (e) => setSearch(e.target.value) }) }), (0, jsx_runtime_1.jsx)(core_1.DndContext, { sensors: sensors, collisionDetection: core_1.closestCenter, onDragEnd: handleDragEnd, children: (0, jsx_runtime_1.jsx)(sortable_1.SortableContext, { items: orderedColumnNames, strategy: sortable_1.verticalListSortingStrategy, children: (0, jsx_runtime_1.jsxs)("div", { style: {
66
+ marginBottom: 6,
67
+ }, children: (0, jsx_runtime_1.jsx)(TextInput, { id: 'add_column_search_bar', value: search, placeholder: 'Search...', width: searchInputWidth, onChange: (e) => setSearch(e.target.value) }) }), (0, jsx_runtime_1.jsx)(core_1.DndContext, { sensors: sensors, collisionDetection: core_1.closestCenter, onDragEnd: handleDragEnd, children: (0, jsx_runtime_1.jsx)(sortable_1.SortableContext, { items: orderedColumnNames, strategy: sortable_1.verticalListSortingStrategy, children: (0, jsx_runtime_1.jsxs)("div", { style: {
51
68
  display: 'flex',
52
69
  flexDirection: 'column',
53
70
  gap: 8,
@@ -62,7 +79,7 @@ function AddColumnPopover({ onSave, orderedColumnNames, setOrderedColumnNames, s
62
79
  gap: 8,
63
80
  justifyContent: 'end',
64
81
  marginTop: 12,
65
- }, children: [selectedColumns.length > 0 && !isSelectedAllColumns() && ((0, jsx_runtime_1.jsx)(SecondaryButton, { onClick: () => setSelectedColumns(orderedColumnNames.filter((row) => {
82
+ }, children: [selectedColumns.length > 0 && !isSelectedAllColumns() && ((0, jsx_runtime_1.jsx)(SecondaryButton, { onClick: () => setSelectedColumns(searchResults.filter((row) => {
66
83
  const [table, _column] = row.split('.');
67
84
  return selectedColumns[0].startsWith(table);
68
85
  })), label: "Select all" })), selectedColumns.length > 0 && isSelectedAllColumns() && ((0, jsx_runtime_1.jsx)(SecondaryButton, { onClick: () => setSelectedColumns([]), label: "Clear" })), (0, jsx_runtime_1.jsx)(Button, { onClick: () => {
@@ -1,3 +1,14 @@
1
- export declare const LimitSentence: ({ limit, handleDelete, setOpenPopover, onSave, popoverTitle, LimitPopover, EditPopover, children, }: any) => import("react/jsx-runtime").JSX.Element;
2
- export declare const AddLimitPopover: ({ onSave, initialLimit, isEdit, onDelete, }: any) => import("react/jsx-runtime").JSX.Element;
1
+ /// <reference types="react" />
2
+ import { ButtonComponentProps, TextInputComponentProps } from '../UiComponents';
3
+ export declare const LimitSentence: ({ limit, handleDelete, setOpenPopover, onSave, popoverTitle, LimitPopover, EditPopover, TextInput, Button, SecondaryButton, children, }: any) => import("react/jsx-runtime").JSX.Element;
4
+ export interface AddLimitPopoverProps {
5
+ onSave: (limit: number) => void;
6
+ initialLimit?: number;
7
+ isEdit?: boolean;
8
+ onDelete?: () => void;
9
+ TextInput?: (props: TextInputComponentProps) => JSX.Element;
10
+ Button?: (props: ButtonComponentProps) => JSX.Element;
11
+ SecondaryButton?: (props: ButtonComponentProps) => JSX.Element;
12
+ }
13
+ export declare const AddLimitPopover: ({ onSave, initialLimit, isEdit, onDelete, TextInput, Button, SecondaryButton, }: AddLimitPopoverProps) => import("react/jsx-runtime").JSX.Element;
3
14
  //# sourceMappingURL=AddLimitPopover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddLimitPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/AddLimitPopover.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,aAAa,wGASvB,GAAG,4CAiCL,CAAC;AAEF,eAAO,MAAM,eAAe,gDAKzB,GAAG,4CAmCL,CAAC"}
1
+ {"version":3,"file":"AddLimitPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/AddLimitPopover.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,oBAAoB,EAIpB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAUzB,eAAO,MAAM,aAAa,4IAYvB,GAAG,4CAoCL,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,GAAG,CAAC,OAAO,CAAC;IAC5D,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,GAAG,CAAC,OAAO,CAAC;IACtD,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,GAAG,CAAC,OAAO,CAAC;CAChE;AAED,eAAO,MAAM,eAAe,oFAQzB,oBAAoB,4CA+CtB,CAAC"}
@@ -5,12 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const UiComponents_1 = require("../UiComponents");
7
7
  const Context_1 = require("../../Context");
8
- const ui_1 = require("./ui");
9
8
  const SORT_VALUE_TO_LABEL = {
10
9
  ASC: 'ascending',
11
10
  DESC: 'descending',
12
11
  };
13
- const LimitSentence = ({ limit, handleDelete, setOpenPopover, onSave, popoverTitle = 'Edit limit', LimitPopover, EditPopover, children, }) => {
12
+ const LimitSentence = ({ limit, handleDelete, setOpenPopover, onSave, popoverTitle = 'Edit limit', LimitPopover, EditPopover, TextInput = UiComponents_1.QuillTextInput, Button = UiComponents_1.MemoizedButton, SecondaryButton = UiComponents_1.MemoizedSecondaryButton, children, }) => {
14
13
  const [isOpen, setIsOpen] = (0, react_1.useState)(false);
15
14
  const handleClickDelete = (e) => {
16
15
  setOpenPopover(null);
@@ -23,21 +22,32 @@ const LimitSentence = ({ limit, handleDelete, setOpenPopover, onSave, popoverTit
23
22
  filterLabel: `limit ${limit.value[0].value}`, onClickDelete: handleClickDelete, popoverTitle: popoverTitle, popoverChildren: (0, jsx_runtime_1.jsx)(EditPopover, { onSave: (column, direction) => {
24
23
  setIsOpen(false);
25
24
  onSave(column, direction);
26
- }, isEdit: true, onDelete: handleClickDelete, initialLimit: limit.value[0].value }), isOpen: isOpen, setIsOpen: setIsOpen, onDelete: () => {
25
+ }, isEdit: true, onDelete: handleClickDelete, initialLimit: limit.value[0].value, TextInput: TextInput, Button: Button, SecondaryButton: SecondaryButton }), isOpen: isOpen, setIsOpen: setIsOpen, onDelete: () => {
27
26
  handleDelete();
28
27
  } }) }));
29
28
  };
30
29
  exports.LimitSentence = LimitSentence;
31
- const AddLimitPopover = ({ onSave, initialLimit, isEdit, onDelete, }) => {
32
- const [limit, setLimit] = (0, react_1.useState)(initialLimit || 0);
30
+ const AddLimitPopover = ({ onSave, initialLimit = 0, isEdit = false, onDelete = () => { }, TextInput = UiComponents_1.QuillTextInput, Button = UiComponents_1.MemoizedButton, SecondaryButton = UiComponents_1.MemoizedSecondaryButton, }) => {
31
+ const [limit, setLimit] = (0, react_1.useState)(initialLimit);
33
32
  const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
34
- return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: 12 }, children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'row', gap: 12, padding: '6px 0px' }, children: (0, jsx_runtime_1.jsx)(ui_1.QuillTextInput, { value: limit, type: "number", style: { width: 200, minHeight: 32, padding: '6px 12px' }, onChange: (e) => {
35
- setLimit(e.target.value);
33
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: 12 }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
34
+ display: 'flex',
35
+ flexDirection: 'row',
36
+ gap: 12,
37
+ padding: '6px 0px',
38
+ }, children: (0, jsx_runtime_1.jsx)(TextInput, { id: 'add_limit_input', value: limit, width: 200,
39
+ // style={{ minHeight: 32, padding: '6px 12px' }}
40
+ onChange: (e) => {
41
+ if (Number.isNaN(parseFloat(e.target.value || '0'))) {
42
+ alert('Please input a number.');
43
+ return;
44
+ }
45
+ setLimit(parseFloat(e.target.value || '0'));
36
46
  } }) }), (0, jsx_runtime_1.jsx)("div", { style: {
37
47
  display: 'flex',
38
48
  flexDirection: 'row',
39
49
  justifyContent: 'end',
40
50
  gap: 12,
41
- }, children: isEdit ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(UiComponents_1.MemoizedSecondaryButton, { onClick: onDelete, label: "Delete" }), (0, jsx_runtime_1.jsx)(UiComponents_1.MemoizedButton, { onClick: () => onSave(limit), label: "Edit limit" })] })) : ((0, jsx_runtime_1.jsx)(UiComponents_1.MemoizedButton, { onClick: () => onSave(limit), label: "Add limit" })) })] }));
51
+ }, children: isEdit ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SecondaryButton, { onClick: onDelete, label: "Delete" }), (0, jsx_runtime_1.jsx)(Button, { onClick: () => onSave(limit), label: "Edit limit" })] })) : ((0, jsx_runtime_1.jsx)(Button, { onClick: () => onSave(limit), label: "Add limit" })) })] }));
42
52
  };
43
53
  exports.AddLimitPopover = AddLimitPopover;
@@ -1,3 +1,3 @@
1
- export declare const SortSentence: ({ sortData, keyPrefix, columns, handleDelete, setEditPopoverKey, setOpenPopover, setActiveEditItem, setIsPending, setActivePath, onSave, popoverTitle, SortPopover, EditPopover, children, }: any) => import("react/jsx-runtime").JSX.Element | undefined;
2
- export declare const AddSortPopover: ({ onSave, columns, isEdit, onDelete, column, }: any) => import("react/jsx-runtime").JSX.Element;
1
+ export declare const SortSentence: ({ sortData, keyPrefix, columns, handleDelete, setEditPopoverKey, setOpenPopover, setActiveEditItem, setIsPending, setActivePath, onSave, popoverTitle, SortPopover, EditPopover, Select, Button, SecondaryButton, children, }: any) => import("react/jsx-runtime").JSX.Element | null;
2
+ export declare const AddSortPopover: ({ onSave, columns, isEdit, onDelete, column, Select, Button, SecondaryButton, }: any) => import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=AddSortPopover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddSortPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/AddSortPopover.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,YAAY,iMAetB,GAAG,wDA2CL,CAAC;AAEF,eAAO,MAAM,cAAc,mDAMxB,GAAG,4CAiEL,CAAC"}
1
+ {"version":3,"file":"AddSortPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/AddSortPopover.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,YAAY,kOAkBtB,GAAG,mDA8CL,CAAC;AAEF,eAAO,MAAM,cAAc,oFASxB,GAAG,4CAiEL,CAAC"}
@@ -11,7 +11,7 @@ const SORT_VALUE_TO_LABEL = {
11
11
  ASC: 'ascending',
12
12
  DESC: 'descending',
13
13
  };
14
- const SortSentence = ({ sortData, keyPrefix, columns, handleDelete, setEditPopoverKey, setOpenPopover, setActiveEditItem, setIsPending, setActivePath, onSave, popoverTitle = 'Edit Sort', SortPopover, EditPopover, children, }) => {
14
+ const SortSentence = ({ sortData, keyPrefix, columns, handleDelete, setEditPopoverKey, setOpenPopover, setActiveEditItem, setIsPending, setActivePath, onSave, popoverTitle = 'Edit Sort', SortPopover, EditPopover, Select = QuillSelect_1.QuillSelectComponent, Button = UiComponents_1.MemoizedButton, SecondaryButton = UiComponents_1.MemoizedSecondaryButton, children, }) => {
15
15
  const [isOpen, setIsOpen] = (0, react_1.useState)(false);
16
16
  const handleClickDelete = (e) => {
17
17
  e.stopPropagation(); // don't call onClick handler
@@ -22,23 +22,23 @@ const SortSentence = ({ sortData, keyPrefix, columns, handleDelete, setEditPopov
22
22
  setEditPopoverKey(null);
23
23
  };
24
24
  if (!sortData && (!sortData.expr.column || !sortData.expr.value)) {
25
- return;
25
+ return null;
26
26
  }
27
- return ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)(SortPopover
27
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(SortPopover
28
28
  // @ts-ignore
29
29
  , {
30
30
  // @ts-ignore
31
31
  filterLabel: `${(0, textProcessing_1.snakeCaseToTitleCase)(sortData.expr.column) || (0, textProcessing_1.snakeCaseToTitleCase)(sortData.expr.value)} ${SORT_VALUE_TO_LABEL[sortData.type]}`, onClickDelete: handleClickDelete, popoverTitle: popoverTitle, popoverChildren: (0, jsx_runtime_1.jsx)(EditPopover, { onSave: (column, direction) => {
32
32
  setIsOpen(false);
33
33
  onSave(column, direction);
34
- }, columns: columns, isEdit: true, onDelete: handleClickDelete, column: sortData.expr.column || sortData.expr.value }), isOpen: isOpen, setIsOpen: setIsOpen, onDelete: () => {
34
+ }, columns: columns, isEdit: true, onDelete: handleClickDelete, column: sortData.expr.column || sortData.expr.value, Select: Select, Button: Button, SecondaryButton: SecondaryButton }), isOpen: isOpen, setIsOpen: setIsOpen, onDelete: () => {
35
35
  setIsPending(false);
36
36
  setActiveEditItem(null);
37
37
  setActivePath(null);
38
38
  } }) }));
39
39
  };
40
40
  exports.SortSentence = SortSentence;
41
- const AddSortPopover = ({ onSave, columns, isEdit, onDelete, column, }) => {
41
+ const AddSortPopover = ({ onSave, columns, isEdit, onDelete, column, Select = QuillSelect_1.QuillSelectComponent, Button = UiComponents_1.MemoizedButton, SecondaryButton = UiComponents_1.MemoizedSecondaryButton, }) => {
42
42
  const [sortColumn, setSortColumn] = (0, react_1.useState)(column || '');
43
43
  const [sortDirection, setSortDirection] = (0, react_1.useState)('ASC');
44
44
  const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
@@ -47,14 +47,14 @@ const AddSortPopover = ({ onSave, columns, isEdit, onDelete, column, }) => {
47
47
  flexDirection: 'row',
48
48
  gap: 12,
49
49
  padding: '6px 0px',
50
- }, children: [(0, jsx_runtime_1.jsx)(QuillSelect_1.QuillSelectComponent, { theme: theme, value: sortColumn, onChange: (value) => {
50
+ }, children: [(0, jsx_runtime_1.jsx)(Select, { theme: theme, value: sortColumn, onChange: (value) => {
51
51
  setSortColumn(value);
52
52
  }, options: [
53
53
  ...columns.map((column) => ({
54
54
  label: (0, textProcessing_1.snakeCaseToTitleCase)(column.split('.')[1] || ''),
55
55
  value: column.split('.')[1],
56
56
  })),
57
- ] }), (0, jsx_runtime_1.jsx)(QuillSelect_1.QuillSelectComponent, { theme: theme, value: sortDirection, onChange: (value) => {
57
+ ] }), (0, jsx_runtime_1.jsx)(Select, { theme: theme, value: sortDirection, onChange: (value) => {
58
58
  setSortDirection(value);
59
59
  }, options: [
60
60
  { label: 'Ascending', value: 'ASC' },
@@ -64,6 +64,6 @@ const AddSortPopover = ({ onSave, columns, isEdit, onDelete, column, }) => {
64
64
  flexDirection: 'row',
65
65
  justifyContent: 'end',
66
66
  gap: 12,
67
- }, children: isEdit ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(UiComponents_1.MemoizedSecondaryButton, { onClick: onDelete, label: "Delete" }), (0, jsx_runtime_1.jsx)(UiComponents_1.MemoizedButton, { onClick: () => onSave(sortColumn, sortDirection), label: "Edit sort" })] })) : ((0, jsx_runtime_1.jsx)(UiComponents_1.MemoizedButton, { onClick: () => onSave(sortColumn, sortDirection), label: "Add sort" })) })] }));
67
+ }, children: isEdit ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SecondaryButton, { onClick: onDelete, label: "Delete" }), (0, jsx_runtime_1.jsx)(Button, { onClick: () => onSave(sortColumn, sortDirection), label: "Edit sort" })] })) : ((0, jsx_runtime_1.jsx)(Button, { onClick: () => onSave(sortColumn, sortDirection), label: "Add sort" })) })] }));
68
68
  };
69
69
  exports.AddSortPopover = AddSortPopover;
@@ -7,7 +7,6 @@
7
7
  */
8
8
  export declare const QuillButton: ({ children, ...props }: any) => import("react/jsx-runtime").JSX.Element;
9
9
  export declare const QuillSecondaryButton: ({ children, ...props }: any) => import("react/jsx-runtime").JSX.Element;
10
- export declare const QuillTextInput: (props: any) => import("react/jsx-runtime").JSX.Element;
11
10
  export declare const QuillReportBuilderTable: ({ rows, columns, error, ...props }: any) => import("react/jsx-runtime").JSX.Element;
12
11
  export declare const QuillTag: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
13
12
  export declare const QuillSidebarHeading: ({ label }: any) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/ui.tsx"],"names":[],"mappings":";AAiBA;;;;;GAKG;AAEH,eAAO,MAAM,WAAW,2BAA4B,GAAG,4CA2BtD,CAAC;AAEF,eAAO,MAAM,oBAAoB,2BAA4B,GAAG,4CA2B/D,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW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default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AddFilterPopover = exports.TagWrapper = exports.QuillSortPopover = exports.QuillFilterPopover = exports.EditPopover = exports.QuillTabs = exports.DEFAULT_TAB_OPTIONS = exports.QuillTableLoadingState = exports.QuillButtonLoadingState = exports.QuillDraggableColumn = exports.QuillSelectColumn = exports.QuillHandleButton = exports.QuillPopover = exports.MemoizedPopover = exports.QuillSelect = exports.CustomContainer = exports.QuillSidebar = exports.QuillSidebarSubHeading = exports.QuillSidebarHeading = exports.QuillTag = exports.QuillReportBuilderTable = exports.QuillTextInput = exports.QuillSecondaryButton = exports.QuillButton = void 0;
6
+ exports.AddFilterPopover = exports.TagWrapper = exports.QuillSortPopover = exports.QuillFilterPopover = exports.EditPopover = exports.QuillTabs = exports.DEFAULT_TAB_OPTIONS = exports.QuillTableLoadingState = exports.QuillButtonLoadingState = exports.QuillDraggableColumn = exports.QuillSelectColumn = exports.QuillHandleButton = exports.QuillPopover = exports.MemoizedPopover = exports.QuillSelect = exports.CustomContainer = exports.QuillSidebar = exports.QuillSidebarSubHeading = exports.QuillSidebarHeading = exports.QuillTag = exports.QuillReportBuilderTable = exports.QuillSecondaryButton = exports.QuillButton = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
9
  const UiComponents_1 = require("../UiComponents");
@@ -60,25 +60,6 @@ const QuillSecondaryButton = ({ children, ...props }) => {
60
60
  }, children: children }));
61
61
  };
62
62
  exports.QuillSecondaryButton = QuillSecondaryButton;
63
- const QuillTextInput = (props) => {
64
- const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
65
- return ((0, jsx_runtime_1.jsx)("input", { ...props, style: {
66
- color: theme?.primaryTextColor,
67
- backgroundColor: theme?.backgroundColor || 'white',
68
- fontFamily: theme?.fontFamily,
69
- fontWeight: 'medium',
70
- borderWidth: '1px',
71
- borderColor: theme?.borderColor || '#E7E7E7',
72
- borderStyle: 'solid',
73
- borderRadius: '6px',
74
- boxShadow: 'rgba(0, 0, 0, 0.1) 0px 1px 5px 0px',
75
- padding: '0 12px',
76
- display: 'block',
77
- minHeight: 32,
78
- ...props.style,
79
- } }));
80
- };
81
- exports.QuillTextInput = QuillTextInput;
82
63
  const QuillReportBuilderTable = ({ rows, columns, error, ...props }) => {
83
64
  const reformattedColumns = columns.map((c) => ({ label: c, field: c }));
84
65
  return ((0, jsx_runtime_1.jsx)("div", { style: { height: '100%', overflow: 'auto' }, children: (0, jsx_runtime_1.jsx)(QuillTable_1.default, { rows: rows, columns: reformattedColumns, rowsPerPage: 10, showDownloadCSVButton: rows?.length > 0, downloadCSV: () => (0, csv_1.downloadCSV)({ rows, fields: reformattedColumns, name: 'my_report' }), emptyStateLabel: error || 'No results', ...props }) }));
@@ -90,15 +71,27 @@ exports.QuillTag = (0, react_1.forwardRef)(({ label, onClick, children, onClickD
90
71
  boxShadow: '0px 1px 4px #e2e8f005',
91
72
  border: '1px solid #e2e8f0',
92
73
  borderRadius: 6,
74
+ paddingLeft: 8,
93
75
  display: 'flex',
76
+ minHeight: 30,
94
77
  flexDirection: 'row',
95
78
  width: '100%',
96
- padding: '4px 8px',
97
79
  alignItems: 'center',
98
80
  backgroundColor: theme?.backgroundColor || 'white',
99
81
  fontFamily: theme?.fontFamily,
100
82
  fontSize: 14,
101
- }, ref: forwardedRef, onClick: onClick, children: [label ?? children, !hideDelete && ((0, jsx_runtime_1.jsx)("div", { style: {
83
+ whiteSpace: 'nowrap',
84
+ textOverflow: 'ellipsis',
85
+ maxWidth: '100%',
86
+ }, ref: forwardedRef, onClick: onClick, children: [(0, jsx_runtime_1.jsx)("div", { style: {
87
+ alignItems: 'center',
88
+ fontFamily: theme?.fontFamily,
89
+ fontSize: 14,
90
+ whiteSpace: 'nowrap',
91
+ textOverflow: 'ellipsis',
92
+ maxWidth: '90%',
93
+ overflow: 'hidden',
94
+ }, children: label ?? children }), !hideDelete && ((0, jsx_runtime_1.jsx)("div", { style: {
102
95
  marginLeft: 'auto',
103
96
  marginRight: '8px',
104
97
  display: 'flex',
@@ -312,6 +305,13 @@ exports.DEFAULT_TAB_OPTIONS = [
312
305
  ];
313
306
  exports.QuillTabs = (0, react_1.forwardRef)(({ options = exports.DEFAULT_TAB_OPTIONS, ...props }, ref) => ((0, jsx_runtime_1.jsx)(UiComponents_1.MemoizedTabs, { ref: ref, options: options, ...props })));
314
307
  const EditPopover = ({ onSave, onDelete, Button, renderNode, activeEditItem, }) => {
308
+ const handleOnClick = () => {
309
+ if (!(0, util_1.allNumericNodesValidInTree)(activeEditItem)) {
310
+ alert('Please input a number.');
311
+ return;
312
+ }
313
+ onSave();
314
+ };
315
315
  return ((0, jsx_runtime_1.jsxs)("div", { style: {
316
316
  display: 'flex',
317
317
  flexDirection: 'column',
@@ -322,7 +322,7 @@ const EditPopover = ({ onSave, onDelete, Button, renderNode, activeEditItem, })
322
322
  justifyContent: 'end',
323
323
  gap: 8,
324
324
  width: '100%',
325
- }, children: [(0, jsx_runtime_1.jsx)(UiComponents_1.MemoizedSecondaryButton, { onClick: onDelete, label: "Delete" }), (0, jsx_runtime_1.jsx)(Button, { onClick: onSave, label: "Save" })] })] }));
325
+ }, children: [(0, jsx_runtime_1.jsx)(UiComponents_1.MemoizedSecondaryButton, { onClick: onDelete, label: "Delete" }), (0, jsx_runtime_1.jsx)(Button, { onClick: handleOnClick, label: "Save" })] })] }));
326
326
  };
327
327
  exports.EditPopover = EditPopover;
328
328
  const QuillFilterPopover = ({ filterLabel, onClickDeleteFilter, popoverTitle, popoverChildren, isOpen, setIsOpen, }) => {
@@ -413,10 +413,17 @@ const TagWrapper = ({ isCard, isRow, editPopoverKey, keyPrefix, formData, active
413
413
  };
414
414
  exports.TagWrapper = TagWrapper;
415
415
  const AddFilterPopover = ({ onSave, Button, renderNode, activeEditItem, }) => {
416
+ const handleOnClick = () => {
417
+ if (!(0, util_1.allNumericNodesValidInTree)(activeEditItem)) {
418
+ alert('Please input a number.');
419
+ return;
420
+ }
421
+ onSave();
422
+ };
416
423
  return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: 12 }, children: [activeEditItem && renderNode(activeEditItem), (0, jsx_runtime_1.jsx)("div", { style: {
417
424
  display: 'flex',
418
425
  flexDirection: 'row',
419
426
  justifyContent: 'end',
420
- }, children: (0, jsx_runtime_1.jsx)(Button, { onClick: onSave, label: 'Add filter' }) })] }));
427
+ }, children: (0, jsx_runtime_1.jsx)(Button, { onClick: handleOnClick, label: 'Add filter' }) })] }));
421
428
  };
422
429
  exports.AddFilterPopover = AddFilterPopover;
@@ -74,4 +74,5 @@ export declare const getDateFilterInfo: (node: any) => {
74
74
  intervalPaths: any;
75
75
  };
76
76
  export declare function removeNonSelectedTableReferences(ast: any, table: string): any;
77
+ export declare function allNumericNodesValidInTree(node: any): boolean;
77
78
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/components/ReportBuilder/util.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,qBAAqB,SAAU,GAAG,YAW9C,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,WAa1C;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,WAK5C;AAGD,eAAO,MAAM,WAAW,SAAU,GAAG,YAuBpC,CAAC;AAKF,eAAO,MAAM,oBAAoB,SAAU,GAAG,QAE7C,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG;;;;;;;;EAU3C;AAKD,eAAO,MAAM,eAAe,QAAS,GAAG,QAMvC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,WAiBvD;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,GAAG,iBAQjD;AAED,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,GAAG,EACT,YAAY,EAAE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,7 @@
1
1
  "use strict";
2
2
  // A collection of reusable, pure, utility functions for the Report Builder.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.removeNonSelectedTableReferences = exports.getDateFilterInfo = exports.trimEndS = exports.deepCopy = exports.getPostgresBasicType = exports.showNodeAsRow = exports.isExtractEquals = exports.isDateTruncEquals = exports.tryConvertDateEquality = exports.extractSuffixToString = exports.dateTruncSuffixToString = exports.newUTCDate = exports.isColumnComparison = exports.isTheCurrentIntervalBigQuery = exports.isThePreviousInterval = exports.isTheCurrentInterval = exports.isInTheLastIntervalBigQuery = exports.isInTheLastInterval = exports.getInThePreviousIntervalSentence = exports.getInTheLastIntervalSentence = exports.getInTheCurrentIntervalSentence = exports.formatDateComparisonNode = exports.areObjectsEqualish = exports.isColumnDateish = exports.generateColumnExpr = exports.isColumnReferenceish = exports.isDateTrunc = exports.hasTopLevelOrBoolean = exports.isTopLevelBoolean = exports.isNodeEmptyCollection = void 0;
4
+ exports.allNumericNodesValidInTree = exports.removeNonSelectedTableReferences = exports.getDateFilterInfo = exports.trimEndS = exports.deepCopy = exports.getPostgresBasicType = exports.showNodeAsRow = exports.isExtractEquals = exports.isDateTruncEquals = exports.tryConvertDateEquality = exports.extractSuffixToString = exports.dateTruncSuffixToString = exports.newUTCDate = exports.isColumnComparison = exports.isTheCurrentIntervalBigQuery = exports.isThePreviousInterval = exports.isTheCurrentInterval = exports.isInTheLastIntervalBigQuery = exports.isInTheLastInterval = exports.getInThePreviousIntervalSentence = exports.getInTheLastIntervalSentence = exports.getInTheCurrentIntervalSentence = exports.formatDateComparisonNode = exports.areObjectsEqualish = exports.isColumnDateish = exports.generateColumnExpr = exports.isColumnReferenceish = exports.isDateTrunc = exports.hasTopLevelOrBoolean = exports.isTopLevelBoolean = exports.isNodeEmptyCollection = void 0;
5
5
  const date_fns_1 = require("date-fns");
6
6
  const bigDateMap_1 = require("./bigDateMap");
7
7
  const textProcessing_1 = require("../../utils/textProcessing");
@@ -695,3 +695,22 @@ function removeNonSelectedTableReferences(ast, table) {
695
695
  return ast;
696
696
  }
697
697
  exports.removeNonSelectedTableReferences = removeNonSelectedTableReferences;
698
+ function allNumericNodesValidInTree(node) {
699
+ if (!node)
700
+ return true;
701
+ if (node.type === 'number') {
702
+ const value = parseFloat(node.value);
703
+ console.log(node.value, value);
704
+ if (Number.isNaN(value)) {
705
+ return false;
706
+ }
707
+ else {
708
+ node.value = value;
709
+ return true;
710
+ }
711
+ }
712
+ const isLeftValid = allNumericNodesValidInTree(node.left);
713
+ const isRightValid = allNumericNodesValidInTree(node.right);
714
+ return isLeftValid && isRightValid;
715
+ }
716
+ exports.allNumericNodesValidInTree = allNumericNodesValidInTree;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { CSSProperties } from 'react';
2
2
  export interface Option {
3
3
  value: string;
4
4
  label: string;
@@ -9,7 +9,8 @@ export interface SelectComponentProps {
9
9
  options: Option[];
10
10
  disabled?: boolean;
11
11
  label?: string;
12
- theme: any;
12
+ theme?: any;
13
+ style?: CSSProperties;
13
14
  }
14
15
  export interface ButtonComponentProps {
15
16
  onClick: () => void;
@@ -31,13 +32,15 @@ export interface TableComponentProps {
31
32
  rowsPerPage?: number;
32
33
  emptyStateLabel?: string;
33
34
  }
35
+ /**
36
+ * An input element used to accept data from the user.
37
+ */
34
38
  export interface TextInputComponentProps {
35
- onChange: (e: any) => void;
36
- value: string;
37
39
  id: string;
38
- placeholder: string;
39
- theme?: any;
40
- width?: string;
40
+ width: number;
41
+ value: string | number | undefined | null;
42
+ placeholder?: string;
43
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
41
44
  }
42
45
  export interface ModalComponentProps {
43
46
  children: any;
@@ -61,13 +64,11 @@ export interface DeleteButtonProps {
61
64
  onClick: () => void;
62
65
  style: any;
63
66
  }
64
- export declare const QuillTextInput: ({ value, onChange, placeholder, id, theme, }: TextInputComponentProps) => import("react/jsx-runtime").JSX.Element;
65
- export declare const MemoizedTextInput: ({ value, onChange, placeholder, id }: {
66
- value: any;
67
- onChange: any;
68
- placeholder: any;
69
- id: any;
70
- }) => import("react/jsx-runtime").JSX.Element;
67
+ /**
68
+ * The fallback TextInput element for Quill.
69
+ */
70
+ export declare const QuillTextInput: ({ id, value, width, placeholder, onChange, }: TextInputComponentProps) => import("react/jsx-runtime").JSX.Element;
71
+ export declare const MemoizedTextInput: ({ value, onChange, placeholder, id, }: TextInputComponentProps) => import("react/jsx-runtime").JSX.Element;
71
72
  export declare const MemoizedButton: ({ label, onClick, primary, isLoading, }: {
72
73
  label: any;
73
74
  onClick: any;
@@ -1 +1 @@
1
- {"version":3,"file":"UiComponents.d.ts","sourceRoot":"","sources":["../../../src/components/UiComponents.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO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AAM,cAAc,+CAwD1B,CAAC"}
@@ -6,7 +6,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_1 = require("react");
7
7
  const assets_1 = require("../assets");
8
8
  const Context_1 = require("../Context");
9
- const QuillTextInput = ({ value, onChange, placeholder, id, theme, }) => {
9
+ /**
10
+ * The fallback TextInput element for Quill.
11
+ */
12
+ const QuillTextInput = ({ id, value, width, placeholder, onChange, }) => {
13
+ const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
10
14
  return ((0, jsx_runtime_1.jsx)("input", { style: {
11
15
  display: 'flex',
12
16
  height: 40,
@@ -17,15 +21,16 @@ const QuillTextInput = ({ value, onChange, placeholder, id, theme, }) => {
17
21
  fontSize: 14,
18
22
  boxSizing: 'border-box',
19
23
  paddingLeft: 13,
20
- backgroundColor: theme.backgroundColor,
21
- color: theme.primaryTextColor,
22
- fontFamily: theme.fontFamily,
23
- width: 200,
24
- minWidth: 200,
25
- }, id: id, type: "text", value: value, onChange: (event) => onChange(event.target.value), placeholder: placeholder }));
24
+ backgroundColor: theme?.backgroundColor,
25
+ color: theme?.primaryTextColor,
26
+ fontFamily: theme?.fontFamily,
27
+ width: width,
28
+ minWidth: width,
29
+ }, id: id, value: value, placeholder: placeholder, onChange: onChange }));
26
30
  };
27
31
  exports.QuillTextInput = QuillTextInput;
28
- const MemoizedTextInput = ({ value, onChange, placeholder, id }) => {
32
+ // TODO: depreciate this component in favor of QuillTextInput (or vice versa)
33
+ const MemoizedTextInput = ({ value, onChange, placeholder, id, }) => {
29
34
  const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
30
35
  return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative' }, children: [(0, jsx_runtime_1.jsx)("style", { children: `
31
36
  .quill-text-input {
@@ -42,7 +47,7 @@ const MemoizedTextInput = ({ value, onChange, placeholder, id }) => {
42
47
  padding-top: 0px;
43
48
  padding-bottom: 0px;
44
49
  box-sizing: border-box;
45
- }` }), (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 } })] }));
50
+ }` }), (0, jsx_runtime_1.jsx)("input", { id: id, className: "quill-text-input", type: "text", value: value, onChange: onChange, placeholder: placeholder, style: { fontFamily: theme?.fontFamily } })] }));
46
51
  };
47
52
  exports.MemoizedTextInput = MemoizedTextInput;
48
53
  const MemoizedButton = ({ label, onClick, primary = true, isLoading = false, }) => {
@@ -149,6 +154,7 @@ const MemoizedLabel = ({ children }) => {
149
154
  color: theme?.secondaryTextColor || '#575E6A',
150
155
  userSelect: 'none',
151
156
  paddingBottom: 5,
157
+ margin: 0,
152
158
  }, children: children }));
153
159
  };
154
160
  exports.MemoizedLabel = MemoizedLabel;
@@ -190,13 +196,17 @@ const MemoizedTabs = ({ defaultValue, options, onValueChange }) => ((0, jsx_runt
190
196
  }),
191
197
  }, children: label }))) }));
192
198
  exports.MemoizedTabs = MemoizedTabs;
193
- const MemoizedText = ({ children }) => ((0, jsx_runtime_1.jsx)("p", { style: {
194
- fontSize: 12,
195
- fontWeight: 400,
196
- margin: 0,
197
- color: '#575E6A',
198
- userSelect: 'none',
199
- }, children: children }));
199
+ const MemoizedText = ({ children }) => {
200
+ const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
201
+ return ((0, jsx_runtime_1.jsx)("p", { style: {
202
+ fontSize: 12,
203
+ fontWeight: 400,
204
+ margin: 0,
205
+ color: '#575E6A',
206
+ userSelect: 'none',
207
+ fontFamily: theme?.fontFamily,
208
+ }, children: children }));
209
+ };
200
210
  exports.MemoizedText = MemoizedText;
201
211
  const useOnClickOutside = (ref, handler) => {
202
212
  (0, react_1.useEffect)(() => {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Calculates the width that the first child of the given container should be
3
+ * such that the first child takes up as much space as possible in the container
4
+ * without crowding out the rest of its siblings. Also respects flexbox gap.
5
+ * @param containerRef the ref of the container element
6
+ * @param setState a callback to set the new width of the first child
7
+ * @param options config options ('gap' sets the size of the flexbox gap)
8
+ */
9
+ export declare const updateFirstChildWidth: (containerRef: React.RefObject<HTMLElement>, setState: (value: React.SetStateAction<number>) => void, options?: {
10
+ gap: number;
11
+ }) => void;
12
+ //# sourceMappingURL=width.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"width.d.ts","sourceRoot":"","sources":["../../../src/utils/width.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,iBAClB,MAAM,SAAS,CAAC,WAAW,CAAC,oBACxB,MAAM,cAAc,CAAC,MAAM,CAAC,KAAK,IAAI,YAC9C;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,SAazB,CAAC"}