@quillsql/react 2.11.17 → 2.11.18
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/cjs/Chart.d.ts +0 -8
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.d.ts +11 -1
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +6 -5
- package/dist/cjs/ChartEditor.d.ts +11 -3
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +3 -3
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +7 -9
- package/dist/cjs/ReportBuilder.d.ts +7 -1
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +112 -37
- package/dist/cjs/SQLEditor.d.ts +7 -5
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +3 -2
- package/dist/cjs/Table.d.ts +2 -2
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/components/QuillCard.d.ts +2 -7
- package/dist/cjs/components/QuillCard.d.ts.map +1 -1
- package/dist/cjs/components/QuillCard.js +15 -9
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddColumnPopover.js +2 -0
- package/dist/cjs/components/ReportBuilder/AddLimitPopover.js +1 -1
- package/dist/cjs/components/ReportBuilder/convert.d.ts +1 -0
- package/dist/cjs/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/convert.js +20 -1
- package/dist/cjs/components/ReportBuilder/operators.d.ts +15 -10
- package/dist/cjs/components/ReportBuilder/operators.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/operators.js +23 -10
- package/dist/cjs/components/ReportBuilder/ui.d.ts +1 -2
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +4 -4
- package/dist/cjs/components/ReportBuilder/util.d.ts +8 -3
- package/dist/cjs/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/util.js +110 -64
- package/dist/cjs/components/UiComponents.d.ts +0 -6
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +2 -44
- package/dist/cjs/internals/ReportBuilder/PivotList.d.ts +5 -2
- package/dist/cjs/internals/ReportBuilder/PivotList.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotList.js +11 -11
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +2 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +4 -3
- package/dist/cjs/utils/parserBigQuery.d.ts +6 -0
- package/dist/cjs/utils/parserBigQuery.d.ts.map +1 -0
- package/dist/cjs/utils/parserBigQuery.js +60 -0
- package/dist/cjs/utils/parserPostgres.d.ts +3 -0
- package/dist/cjs/utils/parserPostgres.d.ts.map +1 -0
- package/dist/cjs/utils/parserPostgres.js +42 -0
- package/dist/esm/Chart.d.ts +0 -8
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.d.ts +11 -1
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +6 -5
- package/dist/esm/ChartEditor.d.ts +11 -3
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +3 -3
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +8 -10
- package/dist/esm/ReportBuilder.d.ts +7 -1
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +113 -38
- package/dist/esm/SQLEditor.d.ts +7 -5
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +3 -2
- package/dist/esm/Table.d.ts +2 -2
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/components/QuillCard.d.ts +2 -7
- package/dist/esm/components/QuillCard.d.ts.map +1 -1
- package/dist/esm/components/QuillCard.js +15 -9
- package/dist/esm/components/ReportBuilder/AddColumnPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddColumnPopover.js +2 -0
- package/dist/esm/components/ReportBuilder/AddLimitPopover.js +1 -1
- package/dist/esm/components/ReportBuilder/convert.d.ts +1 -0
- package/dist/esm/components/ReportBuilder/convert.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/convert.js +18 -0
- package/dist/esm/components/ReportBuilder/operators.d.ts +15 -10
- package/dist/esm/components/ReportBuilder/operators.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/operators.js +23 -10
- package/dist/esm/components/ReportBuilder/ui.d.ts +1 -2
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +4 -4
- package/dist/esm/components/ReportBuilder/util.d.ts +8 -3
- package/dist/esm/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/util.js +101 -60
- package/dist/esm/components/UiComponents.d.ts +0 -6
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +3 -44
- package/dist/esm/internals/ReportBuilder/PivotList.d.ts +5 -2
- package/dist/esm/internals/ReportBuilder/PivotList.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotList.js +11 -11
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +2 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +4 -3
- package/dist/esm/utils/parserBigQuery.d.ts +6 -0
- package/dist/esm/utils/parserBigQuery.d.ts.map +1 -0
- package/dist/esm/utils/parserBigQuery.js +52 -0
- package/dist/esm/utils/parserPostgres.d.ts +3 -0
- package/dist/esm/utils/parserPostgres.d.ts.map +1 -0
- package/dist/esm/utils/parserPostgres.js +37 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.QuillEmptyDashboardComponent = exports.
|
|
6
|
+
exports.QuillEmptyDashboardComponent = exports.QuillTableComponent = exports.LoadingSpinner = exports.MemoizedDeleteButton = exports.MemoizedModal = exports.MemoizedPopover = exports.MemoizedText = exports.QuillTabs = exports.DEFAULT_TAB_OPTIONS = exports.MemoizedCheckbox = exports.MemoizedLabel = exports.MemoizedHeader = exports.MemoizedSecondaryButton = exports.MemoizedButton = exports.MemoizedTextInput = exports.QuillTextInput = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
// @ts-nocheck
|
|
9
9
|
const react_1 = require("react");
|
|
@@ -319,50 +319,8 @@ const QuillTableComponent = ({ rows, columns, isLoading = false, }) => {
|
|
|
319
319
|
if (isLoading) {
|
|
320
320
|
return ((0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'column', margin: 'auto' }, children: (0, jsx_runtime_1.jsx)(exports.LoadingSpinner, {}) }));
|
|
321
321
|
}
|
|
322
|
-
return (0, jsx_runtime_1.jsx)(QuillTable_1.default, { rows: rows, columns: columns, rowsPerPage:
|
|
322
|
+
return (0, jsx_runtime_1.jsx)(QuillTable_1.default, { rows: rows, columns: columns, rowsPerPage: 20 });
|
|
323
323
|
};
|
|
324
324
|
exports.QuillTableComponent = QuillTableComponent;
|
|
325
|
-
const QuillDropdownComponent = ({ onChange, value, label, options, }) => {
|
|
326
|
-
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
327
|
-
const handleOnChange = (0, react_1.useCallback)((event) => onChange(event), [onChange]);
|
|
328
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [label && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
329
|
-
marginBottom: 6,
|
|
330
|
-
fontWeight: theme.labelFontWeight || '600',
|
|
331
|
-
color: theme.secondaryTextColor,
|
|
332
|
-
fontFamily: theme.fontFamily,
|
|
333
|
-
fontSize: 14,
|
|
334
|
-
}, children: label })), (0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', height: 38 }, children: [(0, jsx_runtime_1.jsxs)("select", { id: "reportbuilderdropdown", onChange: handleOnChange, value: value ?? '', style: {
|
|
335
|
-
width: '100%',
|
|
336
|
-
WebkitAppearance: 'none',
|
|
337
|
-
minWidth: 230,
|
|
338
|
-
outline: 'none',
|
|
339
|
-
textAlign: 'left',
|
|
340
|
-
whiteSpace: 'nowrap',
|
|
341
|
-
overflow: 'hidden',
|
|
342
|
-
textOverflow: 'ellipsis',
|
|
343
|
-
borderRadius: 6,
|
|
344
|
-
paddingLeft: 12,
|
|
345
|
-
paddingRight: 12,
|
|
346
|
-
height: 38,
|
|
347
|
-
borderWidth: theme.borderWidth,
|
|
348
|
-
borderColor: theme.borderColor,
|
|
349
|
-
background: theme.backgroundColor,
|
|
350
|
-
color: theme.primaryTextColor,
|
|
351
|
-
boxShadow: '0 1px 2px 0 rgba(0,0,0,.05)',
|
|
352
|
-
fontFamily: theme.fontFamily,
|
|
353
|
-
fontSize: 14,
|
|
354
|
-
fontWeight: 500,
|
|
355
|
-
boxSizing: 'border-box',
|
|
356
|
-
}, children: [(0, jsx_runtime_1.jsx)("option", { value: "", children: "Select" }), options.map((option, index) => ((0, jsx_runtime_1.jsx)("option", { value: option.value, children: option.label }, option.label + index)))] }), (0, jsx_runtime_1.jsx)(assets_1.ArrowDownHeadIcon, { style: {
|
|
357
|
-
height: '20px',
|
|
358
|
-
width: '20px',
|
|
359
|
-
flex: 'none',
|
|
360
|
-
position: 'absolute',
|
|
361
|
-
right: 8,
|
|
362
|
-
top: 9,
|
|
363
|
-
color: theme?.secondaryTextColor,
|
|
364
|
-
}, "aria-hidden": "true" })] })] }));
|
|
365
|
-
};
|
|
366
|
-
exports.QuillDropdownComponent = QuillDropdownComponent;
|
|
367
325
|
const QuillEmptyDashboardComponent = () => (0, jsx_runtime_1.jsx)("div", {});
|
|
368
326
|
exports.QuillEmptyDashboardComponent = QuillEmptyDashboardComponent;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { QuillCard } from '../../components/QuillCard';
|
|
2
|
+
export declare const PivotCard: ({ pivotTable, theme, index, onSelectPivot, selectedPivotIndex, onEditPivot, ButtonComponent, showEdit, clickable, onClose, minHeight, CardComponent, LabelComponent, TextComponent, HeaderComponent, }: {
|
|
2
3
|
pivotTable: any;
|
|
3
4
|
theme: any;
|
|
4
5
|
index: any;
|
|
@@ -10,11 +11,12 @@ export declare const PivotCard: ({ pivotTable, theme, index, onSelectPivot, sele
|
|
|
10
11
|
clickable?: boolean | undefined;
|
|
11
12
|
onClose?: (() => void) | undefined;
|
|
12
13
|
minHeight?: number | undefined;
|
|
14
|
+
CardComponent?: typeof QuillCard | undefined;
|
|
13
15
|
LabelComponent: any;
|
|
14
16
|
TextComponent: any;
|
|
15
17
|
HeaderComponent: any;
|
|
16
18
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare const PivotList: ({ recommendedPivotTables, createdPivotTables, onSelectRecommendedPivot, onSelectCreatedPivot, theme, selectedPivotIndex, selectedPivotType, ButtonComponent, showCreatePivot, onEditRecommendedPivot, onEditCreatedPivot, showPivotEditButton, LabelComponent, TextComponent, HeaderComponent, }: {
|
|
19
|
+
export declare const PivotList: ({ recommendedPivotTables, createdPivotTables, onSelectRecommendedPivot, onSelectCreatedPivot, theme, selectedPivotIndex, selectedPivotType, ButtonComponent, showCreatePivot, onEditRecommendedPivot, onEditCreatedPivot, showPivotEditButton, CardComponent, LabelComponent, TextComponent, HeaderComponent, }: {
|
|
18
20
|
recommendedPivotTables: any;
|
|
19
21
|
createdPivotTables: any;
|
|
20
22
|
onSelectRecommendedPivot: any;
|
|
@@ -27,6 +29,7 @@ export declare const PivotList: ({ recommendedPivotTables, createdPivotTables, o
|
|
|
27
29
|
onEditRecommendedPivot: any;
|
|
28
30
|
onEditCreatedPivot: any;
|
|
29
31
|
showPivotEditButton?: boolean | undefined;
|
|
32
|
+
CardComponent?: typeof QuillCard | undefined;
|
|
30
33
|
LabelComponent: any;
|
|
31
34
|
TextComponent: any;
|
|
32
35
|
HeaderComponent: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PivotList.d.ts","sourceRoot":"","sources":["../../../../src/internals/ReportBuilder/PivotList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PivotList.d.ts","sourceRoot":"","sources":["../../../../src/internals/ReportBuilder/PivotList.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;6CAiNrB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;6CAqFrB,CAAC"}
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PivotList = exports.PivotCard = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
|
|
5
|
+
// @ts-nocheck
|
|
6
6
|
const valueFormatter_1 = require("../../utils/valueFormatter");
|
|
7
7
|
const textProcessing_1 = require("../../utils/textProcessing");
|
|
8
|
-
const
|
|
8
|
+
const QuillCard_1 = require("../../components/QuillCard");
|
|
9
|
+
const PivotCard = ({ pivotTable, theme, index, onSelectPivot, selectedPivotIndex, onEditPivot, ButtonComponent, showEdit = false, clickable = true, onClose = () => { }, minHeight = 0, CardComponent = QuillCard_1.QuillCard, LabelComponent, TextComponent, HeaderComponent, }) => {
|
|
9
10
|
const maxRowsInPivotPeak = 5;
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(CardComponent, { onClick: () => onSelectPivot(pivotTable.pivot, index), onDelete: onClose, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
11
12
|
fontSize: 14,
|
|
12
13
|
display: 'flex',
|
|
13
14
|
flexDirection: 'column',
|
|
@@ -76,18 +77,17 @@ const PivotCard = ({ pivotTable, theme, index, onSelectPivot, selectedPivotIndex
|
|
|
76
77
|
}, label: 'Edit' }) }))] })] }) }));
|
|
77
78
|
};
|
|
78
79
|
exports.PivotCard = PivotCard;
|
|
79
|
-
const PivotList = ({ recommendedPivotTables, createdPivotTables, onSelectRecommendedPivot, onSelectCreatedPivot, theme, selectedPivotIndex, selectedPivotType, ButtonComponent, showCreatePivot = false, onEditRecommendedPivot, onEditCreatedPivot, showPivotEditButton = false, LabelComponent, TextComponent, HeaderComponent, }) => {
|
|
80
|
+
const PivotList = ({ recommendedPivotTables, createdPivotTables, onSelectRecommendedPivot, onSelectCreatedPivot, theme, selectedPivotIndex, selectedPivotType, ButtonComponent, showCreatePivot = false, onEditRecommendedPivot, onEditCreatedPivot, showPivotEditButton = false, CardComponent = QuillCard_1.QuillCard, LabelComponent, TextComponent, HeaderComponent, }) => {
|
|
80
81
|
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
81
82
|
display: 'grid',
|
|
82
83
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
83
84
|
gap: 16,
|
|
84
85
|
gridAutoRows: '220px',
|
|
85
|
-
}, children: [recommendedPivotTables.map((pivotTable, index) => ((0, jsx_runtime_1.jsx)(exports.PivotCard, { pivotTable: pivotTable, theme: theme, index: index, onSelectPivot: onSelectRecommendedPivot, selectedPivotIndex: selectedPivotType === 'recommended' ? selectedPivotIndex : -1, onEditPivot: onEditRecommendedPivot, ButtonComponent: ButtonComponent, showPivotEditButton: showPivotEditButton, minHeight: 180, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }, index))), createdPivotTables.map((pivotTable, index) => ((0, jsx_runtime_1.jsx)(exports.PivotCard, { pivotTable: pivotTable, theme: theme, index: index, onSelectPivot: onSelectCreatedPivot, selectedPivotIndex: selectedPivotType === 'created' ? selectedPivotIndex : -1, onEditPivot: onEditCreatedPivot, ButtonComponent: ButtonComponent, showPivotEditButton: showPivotEditButton, minHeight: 180, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }, index))), showCreatePivot && ((0, jsx_runtime_1.jsx)(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}, children: "Create pivot +" }))] }) }));
|
|
86
|
+
}, children: [recommendedPivotTables.map((pivotTable, index) => ((0, jsx_runtime_1.jsx)(exports.PivotCard, { pivotTable: pivotTable, theme: theme, index: index, onSelectPivot: onSelectRecommendedPivot, selectedPivotIndex: selectedPivotType === 'recommended' ? selectedPivotIndex : -1, onEditPivot: onEditRecommendedPivot, ButtonComponent: ButtonComponent, showPivotEditButton: showPivotEditButton, minHeight: 180, CardComponent: CardComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }, index))), createdPivotTables.map((pivotTable, index) => ((0, jsx_runtime_1.jsx)(exports.PivotCard, { pivotTable: pivotTable, theme: theme, index: index, onSelectPivot: onSelectCreatedPivot, selectedPivotIndex: selectedPivotType === 'created' ? selectedPivotIndex : -1, onEditPivot: onEditCreatedPivot, ButtonComponent: ButtonComponent, showPivotEditButton: showPivotEditButton, minHeight: 180, CardComponent: CardComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }, index))), showCreatePivot && ((0, jsx_runtime_1.jsx)(CardComponent, { onClick: () => onEditCreatedPivot({}, null), children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
87
|
+
display: 'flex',
|
|
88
|
+
justifyContent: 'center',
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
width: '100%',
|
|
91
|
+
}, children: "Create pivot +" }) }))] }) }));
|
|
92
92
|
};
|
|
93
93
|
exports.PivotList = PivotList;
|
|
@@ -24,6 +24,7 @@ export interface PivotModalProps {
|
|
|
24
24
|
selectedTable: any;
|
|
25
25
|
SelectComponent: any;
|
|
26
26
|
ButtonComponent: any;
|
|
27
|
+
CardComponent: any;
|
|
27
28
|
SecondaryButtonComponent: (props: ButtonComponentProps) => JSX.Element;
|
|
28
29
|
PopoverComponent: (props: {
|
|
29
30
|
isOpen: boolean;
|
|
@@ -66,7 +67,7 @@ export interface PivotModalProps {
|
|
|
66
67
|
parentRef: any;
|
|
67
68
|
recommendPivotCount?: number;
|
|
68
69
|
}
|
|
69
|
-
export declare const PivotModal: ({ pivotRowField, setPivotRowField, pivotColumnField, setPivotColumnField, pivotValueField, setPivotValueField, pivotAggregation, setPivotAggregation, popUpTitle, setPopUpTitle, selectedTable, SelectComponent, ButtonComponent, SecondaryButtonComponent, PopoverComponent, HeaderComponent, LabelComponent, TextComponent, selectedPivotIndex, setSelectedPivotIndex, removePivot, selectPivot, showUpdatePivot, setShowUpdatePivot, data, columns, theme, isOpen, setIsOpen, dateRange, createdPivots, setCreatedPivots, recommendedPivots, setRecommendedPivots, triggerButtonText, showPivotEditButton, showEditOnPivotClick, selectPivotOnEdit, showTrigger, rightAlign, parentRef, recommendPivotCount, }: PivotModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
export declare const PivotModal: ({ pivotRowField, setPivotRowField, pivotColumnField, setPivotColumnField, pivotValueField, setPivotValueField, pivotAggregation, setPivotAggregation, popUpTitle, setPopUpTitle, selectedTable, SelectComponent, ButtonComponent, SecondaryButtonComponent, PopoverComponent, CardComponent, HeaderComponent, LabelComponent, TextComponent, selectedPivotIndex, setSelectedPivotIndex, removePivot, selectPivot, showUpdatePivot, setShowUpdatePivot, data, columns, theme, isOpen, setIsOpen, dateRange, createdPivots, setCreatedPivots, recommendedPivots, setRecommendedPivots, triggerButtonText, showPivotEditButton, showEditOnPivotClick, selectPivotOnEdit, showTrigger, rightAlign, parentRef, recommendPivotCount, }: PivotModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
70
71
|
export declare function generatePivotTableYAxis(pivot: any, cols: any, format: any): any;
|
|
71
72
|
export declare function isDateField(fieldType: any): boolean;
|
|
72
73
|
export declare function generatePivotTable(pivot: Pivot, data: any, dateRange: any, isComparison: boolean, rowLimit?: number, compRange?: any): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PivotModal.d.ts","sourceRoot":"","sources":["../../../../src/internals/ReportBuilder/PivotModal.tsx"],"names":[],"mappings":"AACA,OAAc,EAOZ,SAAS,EACV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PivotModal.d.ts","sourceRoot":"","sources":["../../../../src/internals/ReportBuilder/PivotModal.tsx"],"names":[],"mappings":"AACA,OAAc,EAOZ,SAAS,EACV,MAAM,OAAO,CAAC;AAuBf,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAkBD,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;IACtB,gBAAgB,EAAE,GAAG,CAAC;IACtB,mBAAmB,EAAE,GAAG,CAAC;IACzB,eAAe,EAAE,GAAG,CAAC;IACrB,kBAAkB,EAAE,GAAG,CAAC;IACxB,gBAAgB,EAAE,GAAG,CAAC;IACtB,mBAAmB,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AG,CAAC;IACf,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;IACtB,iBAAiB,EAAE,GAAG,CAAC;IACvB,oBAAoB,EAAE,GAAG,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,GAAG,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,UAAU,qsBA4CpB,eAAe,4CAwqBjB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA,EAAE,MAAM,KAAA,OAyB1D;AAkHD,wBAAgB,WAAW,CAAC,SAAS,KAAA,WAYpC;AAgCD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,GAAG,EACT,SAAS,EAAE,GAAG,EACd,YAAY,EAAE,OAAO,EACrB,QAAQ,SAAK,EACb,SAAS,GAAE,GAAU;;;;;;EAubtB"}
|
|
@@ -13,6 +13,7 @@ const ChartBuilder_1 = require("../../ChartBuilder");
|
|
|
13
13
|
const textProcessing_1 = require("../../utils/textProcessing");
|
|
14
14
|
const util_1 = require("../../components/ReportBuilder/util");
|
|
15
15
|
const ast_1 = require("../../components/ReportBuilder/ast");
|
|
16
|
+
const QuillCard_1 = require("../../components/QuillCard");
|
|
16
17
|
const QuillHover = () => {
|
|
17
18
|
return ((0, jsx_runtime_1.jsx)("style", { children: `
|
|
18
19
|
.quill-hover {
|
|
@@ -26,7 +27,7 @@ const QuillHover = () => {
|
|
|
26
27
|
}
|
|
27
28
|
` }));
|
|
28
29
|
};
|
|
29
|
-
const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivotColumnField, pivotValueField, setPivotValueField, pivotAggregation, setPivotAggregation, popUpTitle, setPopUpTitle, selectedTable, SelectComponent, ButtonComponent, SecondaryButtonComponent, PopoverComponent, HeaderComponent, LabelComponent, TextComponent, selectedPivotIndex, setSelectedPivotIndex, removePivot, selectPivot, showUpdatePivot, setShowUpdatePivot, data, columns, theme, isOpen, setIsOpen, dateRange, createdPivots, setCreatedPivots, recommendedPivots, setRecommendedPivots, triggerButtonText = 'Pivot', showPivotEditButton = false, showEditOnPivotClick = true, selectPivotOnEdit = false, showTrigger = true, rightAlign = false, parentRef, recommendPivotCount = 6, }) => {
|
|
30
|
+
const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivotColumnField, pivotValueField, setPivotValueField, pivotAggregation, setPivotAggregation, popUpTitle, setPopUpTitle, selectedTable, SelectComponent, ButtonComponent, SecondaryButtonComponent, PopoverComponent, CardComponent = QuillCard_1.QuillCard, HeaderComponent, LabelComponent, TextComponent, selectedPivotIndex, setSelectedPivotIndex, removePivot, selectPivot, showUpdatePivot, setShowUpdatePivot, data, columns, theme, isOpen, setIsOpen, dateRange, createdPivots, setCreatedPivots, recommendedPivots, setRecommendedPivots, triggerButtonText = 'Pivot', showPivotEditButton = false, showEditOnPivotClick = true, selectPivotOnEdit = false, showTrigger = true, rightAlign = false, parentRef, recommendPivotCount = 6, }) => {
|
|
30
31
|
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
31
32
|
const [pivotUpdateIndex, setPivotUpdateIndex] = (0, react_1.useState)(null);
|
|
32
33
|
const [selectedPivotType, setSelectedPivotType] = (0, react_1.useState)('recommended');
|
|
@@ -368,7 +369,7 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
|
|
|
368
369
|
columns: selectedPivotTable?.columns,
|
|
369
370
|
}, theme: theme, index: 0, onSelectPivot: () => { }, selectedPivotIndex: -1, onEditPivot: () => { }, ButtonComponent: ButtonComponent, showEdit: false, onClose: () => {
|
|
370
371
|
removePivot();
|
|
371
|
-
}, clickable: true, minHeight: 180, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }) }) })) : ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
372
|
+
}, clickable: true, minHeight: 180, CardComponent: CardComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent }) }) })) : ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
372
373
|
display: 'flex',
|
|
373
374
|
flexDirection: 'row',
|
|
374
375
|
width: '100%',
|
|
@@ -396,7 +397,7 @@ const PivotModal = ({ pivotRowField, setPivotRowField, pivotColumnField, setPivo
|
|
|
396
397
|
display: 'flex',
|
|
397
398
|
margin: '0px auto',
|
|
398
399
|
justifyContent: 'center',
|
|
399
|
-
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { height: 100 } }), (0, jsx_runtime_1.jsxs)("svg", { width: "24", height: "24", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 6)", stroke: theme?.primaryTextColor || '#364153', fill: "none", transform: "rotate(-90 12 12)", children: (0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "-180 12 12", to: "180 12 12", dur: "0.8s", repeatCount: "indefinite" }) }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 1 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", stroke: '#ADB1B9', fill: "none", transform: "rotate(90 12 12)", children: (0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "0 12 12", to: "360 12 12", dur: "0.8s", repeatCount: "indefinite" }) })] })] })) : ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(PivotList_1.PivotList, { recommendedPivotTables: recommendedPivotTables, createdPivotTables: createdPivotTables, theme: theme, onSelectRecommendedPivot: onSelectRecommendedPivot, onSelectCreatedPivot: onSelectCreatedPivot, selectedPivotIndex: selectedPivotIndex, selectedPivotType: selectedPivotType, ButtonComponent: ButtonComponent, HeaderComponent: HeaderComponent, onEditRecommendedPivot: onEditRecommendedPivot, onEditCreatedPivot: onEditPivot, showCreatePivot: true, showPivotEditButton: showPivotEditButton, LabelComponent: LabelComponent, TextComponent: TextComponent }) }))] })) })) }) })] }) }));
|
|
400
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { height: 100 } }), (0, jsx_runtime_1.jsxs)("svg", { width: "24", height: "24", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 6)", stroke: theme?.primaryTextColor || '#364153', fill: "none", transform: "rotate(-90 12 12)", children: (0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "-180 12 12", to: "180 12 12", dur: "0.8s", repeatCount: "indefinite" }) }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "9.375", strokeWidth: "3.75", strokeDasharray: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 1 / 3)", strokeDashoffset: "calc(2 * 3.14 * 9.375 / 3) calc(2 * 3.14 * 9.375 * 2 / 3)", stroke: '#ADB1B9', fill: "none", transform: "rotate(90 12 12)", children: (0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "0 12 12", to: "360 12 12", dur: "0.8s", repeatCount: "indefinite" }) })] })] })) : ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(PivotList_1.PivotList, { recommendedPivotTables: recommendedPivotTables, createdPivotTables: createdPivotTables, theme: theme, onSelectRecommendedPivot: onSelectRecommendedPivot, onSelectCreatedPivot: onSelectCreatedPivot, selectedPivotIndex: selectedPivotIndex, selectedPivotType: selectedPivotType, ButtonComponent: ButtonComponent, HeaderComponent: HeaderComponent, onEditRecommendedPivot: onEditRecommendedPivot, onEditCreatedPivot: onEditPivot, showCreatePivot: true, showPivotEditButton: showPivotEditButton, LabelComponent: LabelComponent, TextComponent: TextComponent, CardComponent: CardComponent }) }))] })) })) }) })] }) }));
|
|
400
401
|
};
|
|
401
402
|
exports.PivotModal = PivotModal;
|
|
402
403
|
function generatePivotTableYAxis(pivot, cols, format) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const isInTheLastIntervalBigQuery: (node: any) => boolean;
|
|
2
|
+
export declare const isAfterBigQuery: (node: any) => boolean;
|
|
3
|
+
export declare const isBeforeBigQuery: (node: any) => boolean;
|
|
4
|
+
export declare const isTheCurrentIntervalBigQuery: (node: any) => boolean;
|
|
5
|
+
export declare const isEqualsBigQuery: (node: any) => any;
|
|
6
|
+
//# sourceMappingURL=parserBigQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parserBigQuery.d.ts","sourceRoot":"","sources":["../../../src/utils/parserBigQuery.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B,SAAU,GAAG,YAYpD,CAAC;AAEF,eAAO,MAAM,eAAe,SAAU,GAAG,YAUxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,GAAG,YAUzC,CAAC;AAEF,eAAO,MAAM,4BAA4B,SAAU,GAAG,KAAG,OAUxD,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,GAAG,QASzC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Functions use to parse BigQuery SQL
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.isEqualsBigQuery = exports.isTheCurrentIntervalBigQuery = exports.isBeforeBigQuery = exports.isAfterBigQuery = exports.isInTheLastIntervalBigQuery = void 0;
|
|
5
|
+
const isInTheLastIntervalBigQuery = (node) => {
|
|
6
|
+
const isOutsideOfDateTrunc = ['>=', '>'].includes(node.operator) &&
|
|
7
|
+
(node.left.type === 'column_ref' ||
|
|
8
|
+
(node.left.type === 'function' &&
|
|
9
|
+
node.left.name.toLowerCase() === 'timestamp')) &&
|
|
10
|
+
node.right.type === 'function' &&
|
|
11
|
+
node.right.name.toLowerCase() === 'timestamp_sub' &&
|
|
12
|
+
node.right.args.value[0].type === 'function' &&
|
|
13
|
+
node.right.args.value[1].type === 'interval' &&
|
|
14
|
+
['current_timestamp'].includes(node.right.args.value[0].name.toLowerCase());
|
|
15
|
+
return isOutsideOfDateTrunc;
|
|
16
|
+
};
|
|
17
|
+
exports.isInTheLastIntervalBigQuery = isInTheLastIntervalBigQuery;
|
|
18
|
+
const isAfterBigQuery = (node) => {
|
|
19
|
+
const isOutsideOfDateTrunc = ['>=', '>'].includes(node.operator) &&
|
|
20
|
+
(node.left.type === 'column_ref' ||
|
|
21
|
+
(node.left.type === 'function' &&
|
|
22
|
+
node.left.name.toLowerCase() === 'timestamp')) &&
|
|
23
|
+
((node.right.type === 'function' &&
|
|
24
|
+
node.right.name.toLowerCase() === 'timestamp') ||
|
|
25
|
+
node.right.type === 'timestamp');
|
|
26
|
+
return isOutsideOfDateTrunc;
|
|
27
|
+
};
|
|
28
|
+
exports.isAfterBigQuery = isAfterBigQuery;
|
|
29
|
+
const isBeforeBigQuery = (node) => {
|
|
30
|
+
const isOutsideOfDateTrunc = ['<=', '<'].includes(node.operator) &&
|
|
31
|
+
(node.left.type === 'column_ref' ||
|
|
32
|
+
(node.left.type === 'function' &&
|
|
33
|
+
node.left.name.toLowerCase() === 'timestamp')) &&
|
|
34
|
+
((node.right.type === 'function' &&
|
|
35
|
+
node.right.name.toLowerCase() === 'timestamp') ||
|
|
36
|
+
node.right.type === 'timestamp');
|
|
37
|
+
return isOutsideOfDateTrunc;
|
|
38
|
+
};
|
|
39
|
+
exports.isBeforeBigQuery = isBeforeBigQuery;
|
|
40
|
+
const isTheCurrentIntervalBigQuery = (node) => {
|
|
41
|
+
const isInsideOfDateTrunc = ['='].includes(node.operator) &&
|
|
42
|
+
node.left.type === 'function' &&
|
|
43
|
+
node.left.name &&
|
|
44
|
+
node.left.name.toLowerCase() === 'timestamp_trunc' &&
|
|
45
|
+
node.right.type === 'function' &&
|
|
46
|
+
node.right.name.toLowerCase() === 'timestamp_trunc' &&
|
|
47
|
+
node.right.args?.value[0]?.name?.toLowerCase() === 'current_timestamp';
|
|
48
|
+
return isInsideOfDateTrunc;
|
|
49
|
+
};
|
|
50
|
+
exports.isTheCurrentIntervalBigQuery = isTheCurrentIntervalBigQuery;
|
|
51
|
+
const isEqualsBigQuery = (node) => {
|
|
52
|
+
const isEquals = ['='].includes(node.operator) &&
|
|
53
|
+
node.left.type === 'function' &&
|
|
54
|
+
node.left.name &&
|
|
55
|
+
node.left.name.toLowerCase() === 'timestamp_trunc' &&
|
|
56
|
+
node.right.name.toLowerCase() === 'timestamp_trunc' &&
|
|
57
|
+
node.right.args.value[0].type.toLowerCase() === 'timestamp';
|
|
58
|
+
return isEquals;
|
|
59
|
+
};
|
|
60
|
+
exports.isEqualsBigQuery = isEqualsBigQuery;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parserPostgres.d.ts","sourceRoot":"","sources":["../../../src/utils/parserPostgres.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,SAAU,GAAG,KAAG,OAyBvD,CAAC;AAEF,eAAO,MAAM,4BAA4B,SAAU,GAAG,KAAG,OAiBxD,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTheCurrentIntervalPostgres = exports.isInTheLastIntervalPostgres = void 0;
|
|
4
|
+
const isInTheLastIntervalPostgres = (node) => {
|
|
5
|
+
const isOutsideOfDateTrunc = ['>=', '>'].includes(node.operator) &&
|
|
6
|
+
node.left.type === 'column_ref' &&
|
|
7
|
+
node.right.type === 'binary_expr' &&
|
|
8
|
+
node.right.operator === '-' &&
|
|
9
|
+
node.right.left.type === 'function' &&
|
|
10
|
+
node.right.left.name.toLowerCase() === 'date_trunc' &&
|
|
11
|
+
node.right.left.args.value[0].type === 'single_quote_string' &&
|
|
12
|
+
node.right.left.args.value[1].type === 'function' &&
|
|
13
|
+
['current_date', 'now'].includes(node.right.left.args.value[1].name.toLowerCase()) &&
|
|
14
|
+
node.right.right.type.toLowerCase() === 'interval' &&
|
|
15
|
+
node.right.right.expr.type === 'single_quote_string';
|
|
16
|
+
const noDateTrunc = ['>=', '>'].includes(node.operator) &&
|
|
17
|
+
node.left.type === 'column_ref' &&
|
|
18
|
+
node.right.type === 'binary_expr' &&
|
|
19
|
+
node.right.operator === '-' &&
|
|
20
|
+
node.right.left.type === 'function' &&
|
|
21
|
+
['current_date', 'now'].includes(node.right.left.name.toLowerCase()) &&
|
|
22
|
+
node.right.right.type.toLowerCase() === 'interval' &&
|
|
23
|
+
node.right.right.expr.type === 'single_quote_string';
|
|
24
|
+
return isOutsideOfDateTrunc || noDateTrunc;
|
|
25
|
+
};
|
|
26
|
+
exports.isInTheLastIntervalPostgres = isInTheLastIntervalPostgres;
|
|
27
|
+
const isTheCurrentIntervalPostgres = (node) => {
|
|
28
|
+
const isInsideOfDateTrunc = ['AND'].includes(node.operator) &&
|
|
29
|
+
(node.left.operator === '=' || node.left.type === 'double_quote_string') &&
|
|
30
|
+
node.right.operator === '=' &&
|
|
31
|
+
node.right.name &&
|
|
32
|
+
node.right.name.toLowerCase() === 'date_trunc' &&
|
|
33
|
+
node.args.value[0].type === 'single_quote_string' &&
|
|
34
|
+
node.args.value[1].type === 'binary_expr' &&
|
|
35
|
+
node.args.value[1].operator === '-' &&
|
|
36
|
+
node.args.value[1].left.type === 'function' &&
|
|
37
|
+
['now', 'current_date'].includes(node.args.value[1].left.name.toLowerCase()) &&
|
|
38
|
+
node.args.value[1].right.type === 'interval' &&
|
|
39
|
+
node.args.value[1].right.expr.type === 'single_quote_string';
|
|
40
|
+
return isInsideOfDateTrunc;
|
|
41
|
+
};
|
|
42
|
+
exports.isTheCurrentIntervalPostgres = isTheCurrentIntervalPostgres;
|
package/dist/esm/Chart.d.ts
CHANGED
|
@@ -42,14 +42,6 @@ export interface ChartProps {
|
|
|
42
42
|
* chart would use the colors for each bar.
|
|
43
43
|
*/
|
|
44
44
|
colors?: string[];
|
|
45
|
-
/**
|
|
46
|
-
* Applies the given date filter to this chart, if any.
|
|
47
|
-
*/
|
|
48
|
-
dateFilter?: any;
|
|
49
|
-
/**
|
|
50
|
-
* Whether this chart has a date filter.
|
|
51
|
-
*/
|
|
52
|
-
isDateFilter?: boolean;
|
|
53
45
|
/**
|
|
54
46
|
* Whether to show animations on render complete.
|
|
55
47
|
*/
|
package/dist/esm/Chart.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../src/Chart.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAgB7C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../src/Chart.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAgB7C,OA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AW,UAAU,4CAqC/B,CAAC;AA+hBF,eAAe,KAAK,CAAC"}
|
|
@@ -57,6 +57,12 @@ export interface ChartBuilderProps {
|
|
|
57
57
|
TextComponent?: (props: {
|
|
58
58
|
label: string;
|
|
59
59
|
}) => JSX.Element;
|
|
60
|
+
/** A card component used as a dismissable container of pivot information. */
|
|
61
|
+
CardComponent?: (props: {
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
onClick?: () => void;
|
|
64
|
+
onDelete?: () => void;
|
|
65
|
+
}) => JSX.Element;
|
|
60
66
|
/**
|
|
61
67
|
* A modal component.
|
|
62
68
|
*/
|
|
@@ -174,6 +180,10 @@ export interface ChartBuilderProps {
|
|
|
174
180
|
dateColumn?: string;
|
|
175
181
|
/** The name of the current organization. */
|
|
176
182
|
organizationName?: string;
|
|
183
|
+
/** Whether to hide the delete button. */
|
|
184
|
+
hideDeleteButton?: boolean;
|
|
185
|
+
/** Whether to hide the submit button. */
|
|
186
|
+
hideSubmitButton?: boolean;
|
|
177
187
|
}
|
|
178
188
|
/**
|
|
179
189
|
* ### Quill Chart Builder with Modal
|
|
@@ -223,7 +233,7 @@ export declare function ChartBuilderWithModal(props: ChartBuilderProps): import(
|
|
|
223
233
|
* ### Chart Builder API
|
|
224
234
|
* @see https://docs.quillsql.com/components/chart-builder
|
|
225
235
|
*/
|
|
226
|
-
export default function ChartBuilder({ TextInputComponent, SelectComponent, ButtonComponent, SecondaryButtonComponent, HeaderComponent, LabelComponent, DeleteButtonComponent, TextComponent, PopoverComponent, isOpen, isHorizontalView, pivot, setIsOpen, rows, columns, query, queryNoDateColumn, dateRange: dr, showTableFormatOptions, showDateFieldOptions, showAccessControlOptions, showDashboardDropdown, onAddToDashboardComplete, onDelete, fields: fieldsProp, dashboardItem, recommendedPivots: rp, createdPivots: cp, destinationDashboard, dateColumn, buttonLabel, organizationName, pivotData, }: ChartBuilderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
236
|
+
export default function ChartBuilder({ TextInputComponent, SelectComponent, ButtonComponent, SecondaryButtonComponent, HeaderComponent, LabelComponent, DeleteButtonComponent, TextComponent, PopoverComponent, CardComponent, isOpen, isHorizontalView, pivot, setIsOpen, rows, columns, query, queryNoDateColumn, dateRange: dr, showTableFormatOptions, showDateFieldOptions, showAccessControlOptions, showDashboardDropdown, onAddToDashboardComplete, onDelete, fields: fieldsProp, dashboardItem, recommendedPivots: rp, createdPivots: cp, destinationDashboard, dateColumn, buttonLabel, organizationName, pivotData, hideDeleteButton, hideSubmitButton, }: ChartBuilderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
227
237
|
export declare function DashboardFilterModal({ isOpen, setIsOpen, override, theme, issues, }: {
|
|
228
238
|
isOpen: boolean;
|
|
229
239
|
setIsOpen: (e: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartBuilder.d.ts","sourceRoot":"","sources":["../../src/ChartBuilder.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAOZ,SAAS,EACV,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartBuilder.d.ts","sourceRoot":"","sources":["../../src/ChartBuilder.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAOZ,SAAS,EACV,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA8B7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAmK5C,eAAO,MAAM,mBAAmB,UAM/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAO7B,CAAC;AA8BF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAEhB,6CAA6C;IAC7C,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAErC,0BAA0B;IAC1B,eAAe,CAAC,EAAE,CAAC,K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ryButton,
|
|
|
11
11
|
import { mergeComparisonRange } from './utils/merge';
|
|
12
12
|
import { removeDoubleQuotes, snakeCaseToTitleCase, } from './utils/textProcessing';
|
|
13
13
|
import { QuillSelectComponent } from './components/QuillSelect';
|
|
14
|
+
import { QuillCard } from './components/QuillCard';
|
|
14
15
|
const CHART_TYPES = ['column', 'line', 'table', 'metric', 'bar', 'pie'];
|
|
15
16
|
const POSTGRES_DATE_TYPES = [
|
|
16
17
|
'timestamp',
|
|
@@ -207,7 +208,7 @@ export function ChartBuilderWithModal(props) {
|
|
|
207
208
|
* ### Chart Builder API
|
|
208
209
|
* @see https://docs.quillsql.com/components/chart-builder
|
|
209
210
|
*/
|
|
210
|
-
export default function ChartBuilder({ TextInputComponent = QuillTextInput, SelectComponent = QuillSelectComponent, ButtonComponent = MemoizedButton, SecondaryButtonComponent = MemoizedSecondaryButton, HeaderComponent = MemoizedHeader, LabelComponent = MemoizedLabel, DeleteButtonComponent = MemoizedDeleteButton, TextComponent = MemoizedText, PopoverComponent = MemoizedPopover, isOpen, isHorizontalView = true, pivot, setIsOpen, rows, columns, query, queryNoDateColumn, dateRange: dr, showTableFormatOptions = false, showDateFieldOptions = false, showAccessControlOptions = false, showDashboardDropdown = true, onAddToDashboardComplete, onDelete, fields: fieldsProp, dashboardItem = undefined, recommendedPivots: rp = [], createdPivots: cp = [], destinationDashboard, dateColumn, buttonLabel, organizationName, pivotData, }) {
|
|
211
|
+
export default function ChartBuilder({ TextInputComponent = QuillTextInput, SelectComponent = QuillSelectComponent, ButtonComponent = MemoizedButton, SecondaryButtonComponent = MemoizedSecondaryButton, HeaderComponent = MemoizedHeader, LabelComponent = MemoizedLabel, DeleteButtonComponent = MemoizedDeleteButton, TextComponent = MemoizedText, PopoverComponent = MemoizedPopover, CardComponent = QuillCard, isOpen, isHorizontalView = true, pivot, setIsOpen, rows, columns, query, queryNoDateColumn, dateRange: dr, showTableFormatOptions = false, showDateFieldOptions = false, showAccessControlOptions = false, showDashboardDropdown = true, onAddToDashboardComplete, onDelete, fields: fieldsProp, dashboardItem = undefined, recommendedPivots: rp = [], createdPivots: cp = [], destinationDashboard, dateColumn, buttonLabel, organizationName, pivotData, hideDeleteButton = false, hideSubmitButton = false, }) {
|
|
211
212
|
const dateRange = dr || [null, null, null];
|
|
212
213
|
const [client] = useContext(ClientContext);
|
|
213
214
|
const [theme] = useContext(ThemeContext);
|
|
@@ -797,7 +798,7 @@ export default function ChartBuilder({ TextInputComponent = QuillTextInput, Sele
|
|
|
797
798
|
// marginTop: 6,
|
|
798
799
|
display: 'flex',
|
|
799
800
|
flexDirection: 'column',
|
|
800
|
-
}, children: _jsx(PivotModal, { pivotRowField: pivotRowField, setPivotRowField: setPivotRowField, pivotColumnField: pivotColumnField, setPivotColumnField: setPivotColumnField, pivotValueField: pivotValueField, setPivotValueField: setPivotValueField, pivotAggregation: pivotAggregation, setPivotAggregation: setPivotAggregation, createdPivots: createdPivots, setCreatedPivots: setCreatedPivots, recommendedPivots: recommendedPivots, setRecommendedPivots: setRecommendedPivots, popUpTitle: pivotPopUpTitle, setPopUpTitle: setPivotPopUpTitle, selectedTable: selectedTable, SelectComponent: SelectComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, PopoverComponent: PopoverComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent, theme: theme, isOpen: showPivotPopover, setIsOpen: setShowPivotPopover, showUpdatePivot: isEdittingPivot, setShowUpdatePivot: setIsEdittingPivot, parentRef: parentRef, data: rows, columns: columns, triggerButtonText: 'Add pivot +', selectedPivotIndex: selectedPivotIndex, setSelectedPivotIndex: setSelectedPivotIndex, removePivot: handleDeletePivot, selectPivot: handleAddPivot, dateRange: dateRange, selectPivotOnEdit: true, showTrigger: !formData.pivot }) }), formData.pivot && (_jsx("div", { style: {
|
|
801
|
+
}, children: _jsx(PivotModal, { pivotRowField: pivotRowField, setPivotRowField: setPivotRowField, pivotColumnField: pivotColumnField, setPivotColumnField: setPivotColumnField, pivotValueField: pivotValueField, setPivotValueField: setPivotValueField, pivotAggregation: pivotAggregation, setPivotAggregation: setPivotAggregation, createdPivots: createdPivots, setCreatedPivots: setCreatedPivots, recommendedPivots: recommendedPivots, setRecommendedPivots: setRecommendedPivots, popUpTitle: pivotPopUpTitle, setPopUpTitle: setPivotPopUpTitle, selectedTable: selectedTable, SelectComponent: SelectComponent, ButtonComponent: ButtonComponent, CardComponent: CardComponent, SecondaryButtonComponent: SecondaryButtonComponent, PopoverComponent: PopoverComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, HeaderComponent: HeaderComponent, theme: theme, isOpen: showPivotPopover, setIsOpen: setShowPivotPopover, showUpdatePivot: isEdittingPivot, setShowUpdatePivot: setIsEdittingPivot, parentRef: parentRef, data: rows, columns: columns, triggerButtonText: 'Add pivot +', selectedPivotIndex: selectedPivotIndex, setSelectedPivotIndex: setSelectedPivotIndex, removePivot: handleDeletePivot, selectPivot: handleAddPivot, dateRange: dateRange, selectPivotOnEdit: true, showTrigger: !formData.pivot }) }), formData.pivot && (_jsx("div", { style: {
|
|
801
802
|
// width: 592,
|
|
802
803
|
paddingRight: 42,
|
|
803
804
|
maxWidth: 750,
|
|
@@ -813,7 +814,7 @@ export default function ChartBuilder({ TextInputComponent = QuillTextInput, Sele
|
|
|
813
814
|
setPivotValueField(formData.pivot?.valueField);
|
|
814
815
|
setPivotAggregation(formData.pivot?.aggregationType);
|
|
815
816
|
setPivotPopUpTitle('Edit Pivot');
|
|
816
|
-
}, selectedPivotIndex: -1, onEditPivot: () => { }, ButtonComponent: ButtonComponent, HeaderComponent: HeaderComponent, showEdit: false, onClose: handleDeletePivot, minHeight: 180, LabelComponent: LabelComponent, TextComponent: TextComponent }) }) }))] })] }), _jsx("br", {}), (formData.pivot || formData.chartType !== 'table') && (_jsxs("div", { children: [CHART_TO_LABELS[formData.chartType]?.xAxisLabel && (_jsx("div", { style: {
|
|
817
|
+
}, selectedPivotIndex: -1, onEditPivot: () => { }, CardComponent: CardComponent, ButtonComponent: ButtonComponent, HeaderComponent: HeaderComponent, showEdit: false, onClose: handleDeletePivot, minHeight: 180, LabelComponent: LabelComponent, TextComponent: TextComponent }) }) }))] })] }), _jsx("br", {}), (formData.pivot || formData.chartType !== 'table') && (_jsxs("div", { children: [CHART_TO_LABELS[formData.chartType]?.xAxisLabel && (_jsx("div", { style: {
|
|
817
818
|
display: 'flex',
|
|
818
819
|
flexDirection: 'column',
|
|
819
820
|
gap: 6,
|
|
@@ -938,11 +939,11 @@ export default function ChartBuilder({ TextInputComponent = QuillTextInput, Sele
|
|
|
938
939
|
justifyContent: 'flex-end',
|
|
939
940
|
marginTop: 'auto',
|
|
940
941
|
gap: 10,
|
|
941
|
-
}, children: [!isHorizontalView && dashboardItem && (_jsx(SecondaryButtonComponent, { onClick: deleteChart, label: 'Delete' })), _jsx(ButtonComponent, { onClick: () => editChart(), label: buttonLabel
|
|
942
|
+
}, children: [!hideDeleteButton && !isHorizontalView && dashboardItem && (_jsx(SecondaryButtonComponent, { onClick: deleteChart, label: 'Delete' })), !hideSubmitButton && (_jsx(ButtonComponent, { onClick: () => editChart(), label: buttonLabel
|
|
942
943
|
? buttonLabel
|
|
943
944
|
: dashboardItem
|
|
944
945
|
? 'Save changes'
|
|
945
|
-
: 'Add to dashboard' })] })] }))] }), _jsx(DashboardFilterModal, { isOpen: showFilterModal, setIsOpen: setShowFilterModal, override: () => editChart(true), theme: theme, issues: filterIssues })] }));
|
|
946
|
+
: 'Add to dashboard' }))] })] }))] }), _jsx(DashboardFilterModal, { isOpen: showFilterModal, setIsOpen: setShowFilterModal, override: () => editChart(true), theme: theme, issues: filterIssues })] }));
|
|
946
947
|
}
|
|
947
948
|
function SegmentedControl({ onChange, value, theme, organizationName, }) {
|
|
948
949
|
return (_jsxs("div", { style: {
|
|
@@ -11,8 +11,6 @@ export interface ChartEditorProps {
|
|
|
11
11
|
chartId: string;
|
|
12
12
|
/** Whether the editor has administrative priveleges. */
|
|
13
13
|
isAdmin?: boolean;
|
|
14
|
-
/** Whether the editor is editing an existing query. */
|
|
15
|
-
isEditMode?: boolean;
|
|
16
14
|
/** The title of the chart builder form. */
|
|
17
15
|
chartBuilderTitle?: string;
|
|
18
16
|
/** The button label for the chart builder. */
|
|
@@ -69,6 +67,12 @@ export interface ChartEditorProps {
|
|
|
69
67
|
TextComponent?: (props: {
|
|
70
68
|
label: string;
|
|
71
69
|
}) => JSX.Element;
|
|
70
|
+
/** A card component used as a dismissable container of pivot information. */
|
|
71
|
+
CardComponent?: (props: {
|
|
72
|
+
children: ReactNode;
|
|
73
|
+
onClick?: () => void;
|
|
74
|
+
onDelete?: () => void;
|
|
75
|
+
}) => JSX.Element;
|
|
72
76
|
/**
|
|
73
77
|
* A modal component.
|
|
74
78
|
*/
|
|
@@ -94,6 +98,10 @@ export interface ChartEditorProps {
|
|
|
94
98
|
organizationName?: string;
|
|
95
99
|
/** Whether the ChartBuilder is in horizontal view mode. */
|
|
96
100
|
isHorizontalView?: boolean;
|
|
101
|
+
/** Whether to hide the delete button. */
|
|
102
|
+
hideDeleteButton?: boolean;
|
|
103
|
+
/** Whether to hide the submit button. */
|
|
104
|
+
hideSubmitButton?: boolean;
|
|
97
105
|
}
|
|
98
106
|
/**
|
|
99
107
|
* ### Quill Chart Editor
|
|
@@ -121,5 +129,5 @@ export interface ChartEditorProps {
|
|
|
121
129
|
* ### Chart Editor API
|
|
122
130
|
* @see https://docs.quillsql.com/components/chart-editor
|
|
123
131
|
*/
|
|
124
|
-
export default function ChartEditor({ isOpen, chartId, isAdmin, destinationDashboard, chartBuilderTitle, chartBuilderButtonLabel, onAddToDashboardComplete, organizationName, isHorizontalView, onDelete, setIsOpen, SelectComponent, TextInputComponent, ButtonComponent, SecondaryButtonComponent, HeaderComponent, LabelComponent, TextComponent, DeleteButtonComponent, ModalComponent, PopoverComponent, }: ChartEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
132
|
+
export default function ChartEditor({ isOpen, chartId, isAdmin, destinationDashboard, chartBuilderTitle, chartBuilderButtonLabel, onAddToDashboardComplete, organizationName, isHorizontalView, onDelete, setIsOpen, SelectComponent, TextInputComponent, ButtonComponent, SecondaryButtonComponent, HeaderComponent, LabelComponent, TextComponent, DeleteButtonComponent, ModalComponent, CardComponent, PopoverComponent, hideDeleteButton, hideSubmitButton, }: ChartEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
125
133
|
//# sourceMappingURL=ChartEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartEditor.d.ts","sourceRoot":"","sources":["../../src/ChartEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,SAAS,EAKV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartEditor.d.ts","sourceRoot":"","sources":["../../src/ChartEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,SAAS,EAKV,MAAM,OAAO,CAAC;AAYf;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAEhB,6CAA6C;IAC7C,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAErC,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAEhB,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,2CAA2C;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,8CAA8C;IAC9C,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtC,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB,0BAA0B;IAC1B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QACxB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,EAAE;YACP,KAAK,E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B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,OAAO,EACP,OAAe,EACf,oBAAoB,EACpB,iBAAgC,EAChC,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAuB,EACvB,QAAQ,EACR,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,cAA8B,EAC9B,aAAyB,EACzB,gBAAgB,EAChB,gBAAwB,EACxB,gBAAwB,GACzB,EAAE,gBAAgB,2CAiJlB"}
|
package/dist/esm/ChartEditor.js
CHANGED
|
@@ -6,6 +6,7 @@ import { DashboardContext, DashboardFiltersContext, ClientContext, } from './Con
|
|
|
6
6
|
import { MemoizedModal } from './components/UiComponents';
|
|
7
7
|
import { getData } from './utils/dataFetcher';
|
|
8
8
|
import { mergeComparisonRange } from './utils/merge';
|
|
9
|
+
import { QuillCard } from './components/QuillCard';
|
|
9
10
|
/**
|
|
10
11
|
* ### Quill Chart Editor
|
|
11
12
|
*
|
|
@@ -32,7 +33,7 @@ import { mergeComparisonRange } from './utils/merge';
|
|
|
32
33
|
* ### Chart Editor API
|
|
33
34
|
* @see https://docs.quillsql.com/components/chart-editor
|
|
34
35
|
*/
|
|
35
|
-
export default function ChartEditor({ isOpen, chartId, isAdmin = false, destinationDashboard, chartBuilderTitle = 'Edit chart', chartBuilderButtonLabel, onAddToDashboardComplete, organizationName, isHorizontalView = true, onDelete, setIsOpen, SelectComponent, TextInputComponent, ButtonComponent, SecondaryButtonComponent, HeaderComponent, LabelComponent, TextComponent, DeleteButtonComponent, ModalComponent = MemoizedModal, PopoverComponent, }) {
|
|
36
|
+
export default function ChartEditor({ isOpen, chartId, isAdmin = false, destinationDashboard, chartBuilderTitle = 'Edit chart', chartBuilderButtonLabel, onAddToDashboardComplete, organizationName, isHorizontalView = true, onDelete, setIsOpen, SelectComponent, TextInputComponent, ButtonComponent, SecondaryButtonComponent, HeaderComponent, LabelComponent, TextComponent, DeleteButtonComponent, ModalComponent = MemoizedModal, CardComponent = QuillCard, PopoverComponent, hideDeleteButton = false, hideSubmitButton = false, }) {
|
|
36
37
|
const parentRef = useRef(null);
|
|
37
38
|
const [modalWidth, setModalWidth] = useState(200);
|
|
38
39
|
const [modalHeight, setModalHeight] = useState(200);
|
|
@@ -112,9 +113,8 @@ export default function ChartEditor({ isOpen, chartId, isAdmin = false, destinat
|
|
|
112
113
|
if (!dashboardItem) {
|
|
113
114
|
return _jsx("div", {});
|
|
114
115
|
}
|
|
115
|
-
console.log('isOpen', isOpen);
|
|
116
116
|
return (_jsx("div", { ref: parentRef, children: _jsx(ModalComponent, { isOpen: isOpen, setIsOpen: setIsOpen, title: chartBuilderTitle || 'Add to dashboard',
|
|
117
117
|
// For isHorizontalView, use full viewport size minus 80px for padding,
|
|
118
118
|
// otherwise use the default layout method of the modal (contents).
|
|
119
|
-
width: isHorizontalView ? modalWidth : undefined, height: isHorizontalView ? modalHeight : undefined, children: _jsx(ChartBuilder, { dashboardItem: dashboardItem, rows: dashboardItem.rows, columns: dashboardItem.columns, fields: dashboardItem.fields, query: dashboardItem.queryString, pivot: dashboardItem.pivot, isOpen: isOpen, setIsOpen: setIsOpen, showTableFormatOptions: isAdmin, showDateFieldOptions: isAdmin, showAccessControlOptions: isAdmin, showDashboardDropdown: isAdmin, destinationDashboard: destinationDashboard, onAddToDashboardComplete: onAddToDashboardComplete, dateRange: dateRange, SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, HeaderComponent: HeaderComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, DeleteButtonComponent: DeleteButtonComponent, ModalComponent: ModalComponent, isHorizontalView: isHorizontalView, PopoverComponent: PopoverComponent, onDelete: onDelete, title: chartBuilderTitle, buttonLabel: chartBuilderButtonLabel, organizationName: organizationName }) }) }));
|
|
119
|
+
width: isHorizontalView ? modalWidth : undefined, height: isHorizontalView ? modalHeight : undefined, children: _jsx(ChartBuilder, { dashboardItem: dashboardItem, rows: dashboardItem.rows, columns: dashboardItem.columns, fields: dashboardItem.fields, query: dashboardItem.queryString, pivot: dashboardItem.pivot, isOpen: isOpen, setIsOpen: setIsOpen, showTableFormatOptions: isAdmin, showDateFieldOptions: isAdmin, showAccessControlOptions: isAdmin, showDashboardDropdown: isAdmin, destinationDashboard: destinationDashboard, onAddToDashboardComplete: onAddToDashboardComplete, dateRange: dateRange, SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, HeaderComponent: HeaderComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, DeleteButtonComponent: DeleteButtonComponent, CardComponent: CardComponent, ModalComponent: ModalComponent, isHorizontalView: isHorizontalView, PopoverComponent: PopoverComponent, onDelete: onDelete, title: chartBuilderTitle, buttonLabel: chartBuilderButtonLabel, organizationName: organizationName, hideSubmitButton: hideSubmitButton, hideDeleteButton: hideDeleteButton }) }) }));
|
|
120
120
|
}
|