@quillsql/react 2.13.31 → 2.13.33
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/ChartBuilder.d.ts +10 -10
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +134 -86
- package/dist/cjs/ChartEditor.d.ts +1 -5
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +3 -4
- package/dist/cjs/Context.d.ts.map +1 -1
- package/dist/cjs/Context.js +10 -0
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +49 -24
- package/dist/cjs/QuillProvider.d.ts +24 -6
- package/dist/cjs/QuillProvider.d.ts.map +1 -1
- package/dist/cjs/QuillProvider.js +14 -3
- package/dist/cjs/ReportBuilder.d.ts +2 -6
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +41 -102
- package/dist/cjs/SQLEditor.d.ts +2 -6
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +20 -30
- package/dist/cjs/components/Chart/InternalChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/InternalChart.js +6 -6
- package/dist/cjs/components/QuillMultiSelectSectionList.d.ts +39 -0
- package/dist/cjs/components/QuillMultiSelectSectionList.d.ts.map +1 -0
- package/dist/cjs/components/QuillMultiSelectSectionList.js +343 -0
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts +3 -1
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectWithCombo.js +4 -3
- package/dist/cjs/hooks/useExport.d.ts +2 -2
- package/dist/cjs/hooks/useExport.d.ts.map +1 -1
- package/dist/cjs/hooks/useExport.js +24 -19
- package/dist/cjs/models/Client.d.ts +6 -10
- package/dist/cjs/models/Client.d.ts.map +1 -1
- package/dist/cjs/models/Report.d.ts +1 -1
- package/dist/cjs/models/Report.d.ts.map +1 -1
- package/dist/cjs/utils/client.d.ts +2 -2
- package/dist/cjs/utils/client.d.ts.map +1 -1
- package/dist/cjs/utils/client.js +4 -12
- package/dist/cjs/utils/tenants.d.ts +0 -2
- package/dist/cjs/utils/tenants.d.ts.map +1 -1
- package/dist/cjs/utils/tenants.js +0 -11
- package/dist/esm/ChartBuilder.d.ts +10 -10
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +135 -87
- package/dist/esm/ChartEditor.d.ts +1 -5
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +3 -4
- package/dist/esm/Context.d.ts.map +1 -1
- package/dist/esm/Context.js +10 -0
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +49 -24
- package/dist/esm/QuillProvider.d.ts +24 -6
- package/dist/esm/QuillProvider.d.ts.map +1 -1
- package/dist/esm/QuillProvider.js +14 -3
- package/dist/esm/ReportBuilder.d.ts +2 -6
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +41 -102
- package/dist/esm/SQLEditor.d.ts +2 -6
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +21 -31
- package/dist/esm/components/Chart/InternalChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/InternalChart.js +6 -6
- package/dist/esm/components/QuillMultiSelectSectionList.d.ts +39 -0
- package/dist/esm/components/QuillMultiSelectSectionList.d.ts.map +1 -0
- package/dist/esm/components/QuillMultiSelectSectionList.js +317 -0
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts +3 -1
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectWithCombo.js +4 -3
- package/dist/esm/hooks/useExport.d.ts +2 -2
- package/dist/esm/hooks/useExport.d.ts.map +1 -1
- package/dist/esm/hooks/useExport.js +24 -19
- package/dist/esm/models/Client.d.ts +6 -10
- package/dist/esm/models/Client.d.ts.map +1 -1
- package/dist/esm/models/Report.d.ts +1 -1
- package/dist/esm/models/Report.d.ts.map +1 -1
- package/dist/esm/utils/client.d.ts +2 -2
- package/dist/esm/utils/client.d.ts.map +1 -1
- package/dist/esm/utils/client.js +4 -12
- package/dist/esm/utils/tenants.d.ts +0 -2
- package/dist/esm/utils/tenants.d.ts.map +1 -1
- package/dist/esm/utils/tenants.js +1 -9
- package/package.json +1 -1
package/dist/cjs/SQLEditor.js
CHANGED
|
@@ -91,7 +91,7 @@ function setEditorTheme(_editor, monaco, schema, databaseType, clientName) {
|
|
|
91
91
|
* ### SQLEditor API
|
|
92
92
|
* @see https://docs.quillsql.com/components/sql-editor
|
|
93
93
|
*/
|
|
94
|
-
function SQLEditor({ ButtonComponent = UiComponents_1.MemoizedButton, SecondaryButtonComponent = UiComponents_1.MemoizedSecondaryButton, DeleteButtonComponent = UiComponents_1.MemoizedDeleteButton, TextInputComponent = UiComponents_2.QuillTextInput, SelectComponent = QuillSelect_1.QuillSelectComponent, TableComponent = UiComponents_1.QuillTableSQLEditorComponent, isNewQueryEnabled = false, LoadingComponent = UiComponents_1.QuillLoadingComponent, ModalComponent = UiComponents_1.MemoizedModal, PopoverComponent = UiComponents_1.MemoizedPopover, CardComponent = QuillCard_1.QuillCard, LabelComponent = UiComponents_1.MemoizedLabel, HeaderComponent = UiComponents_1.MemoizedHeader, SubHeaderComponent = UiComponents_1.MemoizedSubHeader, TextComponent = UiComponents_1.MemoizedText, ErrorMessageComponent = UiComponents_1.QuillErrorMessageComponent, ChartBuilderInputRowContainer = UiComponents_1.QuillChartBuilderInputRowContainer, ChartBuilderInputColumnContainer = UiComponents_1.QuillChartBuilderInputColumnContainer, PivotRowContainer = UiComponents_1.QuillPivotRowContainer, PivotColumnContainer = UiComponents_1.QuillPivotColumnContainer, ChartBuilderFormContainer = UiComponents_1.QuillChartBuilderFormContainer, defaultQuery, destinationDashboard, onChangeQuery, onChangeData, onChangeColumns, onChangeFields, onDiscardChanges, onSaveChanges, onCloseChartBuilder, isChartBuilderEnabled = false, isAdminEnabled = false, chartBuilderTitle, runQueryOnMount = false, onAddToDashboardComplete, addToDashboardButtonLabel = 'Add to dashboard', report = undefined, organizationName = undefined, isChartBuilderHorizontalView = true, containerStyle = { height: '100vh' }, className, onClickChartElement,
|
|
94
|
+
function SQLEditor({ ButtonComponent = UiComponents_1.MemoizedButton, SecondaryButtonComponent = UiComponents_1.MemoizedSecondaryButton, DeleteButtonComponent = UiComponents_1.MemoizedDeleteButton, TextInputComponent = UiComponents_2.QuillTextInput, SelectComponent = QuillSelect_1.QuillSelectComponent, TableComponent = UiComponents_1.QuillTableSQLEditorComponent, isNewQueryEnabled = false, LoadingComponent = UiComponents_1.QuillLoadingComponent, ModalComponent = UiComponents_1.MemoizedModal, PopoverComponent = UiComponents_1.MemoizedPopover, CardComponent = QuillCard_1.QuillCard, LabelComponent = UiComponents_1.MemoizedLabel, HeaderComponent = UiComponents_1.MemoizedHeader, SubHeaderComponent = UiComponents_1.MemoizedSubHeader, TextComponent = UiComponents_1.MemoizedText, ErrorMessageComponent = UiComponents_1.QuillErrorMessageComponent, ChartBuilderInputRowContainer = UiComponents_1.QuillChartBuilderInputRowContainer, ChartBuilderInputColumnContainer = UiComponents_1.QuillChartBuilderInputColumnContainer, PivotRowContainer = UiComponents_1.QuillPivotRowContainer, PivotColumnContainer = UiComponents_1.QuillPivotColumnContainer, ChartBuilderFormContainer = UiComponents_1.QuillChartBuilderFormContainer, defaultQuery, destinationDashboard, onChangeQuery, onChangeData, onChangeColumns, onChangeFields, onDiscardChanges, onSaveChanges, onCloseChartBuilder, isChartBuilderEnabled = false, isAdminEnabled = false, chartBuilderTitle, runQueryOnMount = false, onAddToDashboardComplete, addToDashboardButtonLabel = 'Add to dashboard', report = undefined, organizationName = undefined, isChartBuilderHorizontalView = true, containerStyle = { height: '100vh' }, className, onClickChartElement, }) {
|
|
95
95
|
const [sqlPrompt, setSqlPrompt] = (0, react_1.useState)('');
|
|
96
96
|
const [client] = (0, react_1.useContext)(Context_1.ClientContext);
|
|
97
97
|
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
@@ -103,7 +103,6 @@ function SQLEditor({ ButtonComponent = UiComponents_1.MemoizedButton, SecondaryB
|
|
|
103
103
|
const [columns, setColumns] = (0, react_1.useState)([]);
|
|
104
104
|
const [schemaData] = (0, react_1.useContext)(Context_1.SchemaDataContext);
|
|
105
105
|
const { dashboardFilters } = (0, react_1.useContext)(Context_1.DashboardFiltersContext);
|
|
106
|
-
const [, dashboardDispatch] = (0, react_1.useContext)(Context_1.DashboardContext);
|
|
107
106
|
const specificDashboardFilters = (0, react_1.useMemo)(() => {
|
|
108
107
|
return Object.values(dashboardFilters[report?.dashboardName ?? destinationDashboard ?? ''] ??
|
|
109
108
|
{}).map((f) => f.filter);
|
|
@@ -489,21 +488,16 @@ function SQLEditor({ ButtonComponent = UiComponents_1.MemoizedButton, SecondaryB
|
|
|
489
488
|
}, label: "Run query" })), isNewQueryEnabled && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { onClick: handleClearQuery, label: "Clear query" })), addToDashboardButtonLabel ===
|
|
490
489
|
'Add to dashboard' && ((0, jsx_runtime_1.jsx)(ButtonComponent, { onClick: async () => {
|
|
491
490
|
onSaveChanges && onSaveChanges();
|
|
492
|
-
|
|
491
|
+
setTempReport({
|
|
492
|
+
...tempReport,
|
|
493
493
|
id: Report_1.TEMP_REPORT_ID,
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
rowCount: rowCount ?? 0,
|
|
502
|
-
queryString: query ?? '',
|
|
503
|
-
dashboardName: report?.dashboardName ??
|
|
504
|
-
destinationDashboard,
|
|
505
|
-
// flags: flagsToAdd,
|
|
506
|
-
},
|
|
494
|
+
rows,
|
|
495
|
+
columns: columns,
|
|
496
|
+
columnInternal: columns,
|
|
497
|
+
rowCount: rowCount ?? 0,
|
|
498
|
+
queryString: query ?? '',
|
|
499
|
+
dashboardName: report?.dashboardName ??
|
|
500
|
+
destinationDashboard,
|
|
507
501
|
});
|
|
508
502
|
setIsChartBuilderOpen(true);
|
|
509
503
|
}, label: addToDashboardButtonLabel, disabled: !!errorMessage ||
|
|
@@ -554,23 +548,19 @@ function SQLEditor({ ButtonComponent = UiComponents_1.MemoizedButton, SecondaryB
|
|
|
554
548
|
marginBottom: 5,
|
|
555
549
|
}, children: [onDiscardChanges && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { onClick: onDiscardChanges, label: "Discard changes" })), addToDashboardButtonLabel !== 'Add to dashboard' && ((0, jsx_runtime_1.jsx)(ButtonComponent, { onClick: async () => {
|
|
556
550
|
onSaveChanges && onSaveChanges();
|
|
557
|
-
|
|
551
|
+
setTempReport({
|
|
552
|
+
...tempReport,
|
|
558
553
|
id: Report_1.TEMP_REPORT_ID,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
rowCount: rowCount ?? 0,
|
|
567
|
-
queryString: query ?? '',
|
|
568
|
-
dashboardName: report?.dashboardName ?? destinationDashboard,
|
|
569
|
-
// flags: flagsToAdd,
|
|
570
|
-
},
|
|
554
|
+
rows,
|
|
555
|
+
columns: columns,
|
|
556
|
+
columnInternal: columns,
|
|
557
|
+
rowCount: rowCount ?? 0,
|
|
558
|
+
queryString: query ?? '',
|
|
559
|
+
dashboardName: report?.dashboardName ?? destinationDashboard,
|
|
560
|
+
// flags: flagsToAdd,
|
|
571
561
|
});
|
|
572
562
|
setIsChartBuilderOpen(true);
|
|
573
|
-
}, label: addToDashboardButtonLabel, disabled: !!errorMessage || !(lastSuccessfulQuery === query) }))] }))] })] }) }) })), (!isChartBuilderHorizontalView || isChartBuilderOpen) && ((0, jsx_runtime_1.jsx)(ChartBuilder_1.ChartBuilderWithModal, { isHorizontalView: isChartBuilderHorizontalView, isOpen: isChartBuilderOpen, setIsOpen: setIsChartBuilderOpen, onAddToDashboardComplete: onAddToDashboardComplete, isAdmin: isAdminEnabled, title: chartBuilderTitle, buttonLabel: addToDashboardButtonLabel, reportId: report?.id, organizationName: organizationName, CardComponent: CardComponent, TableComponent: TableComponent, ModalComponent: ModalComponent, ButtonComponent: ButtonComponent, TextInputComponent: TextInputComponent, SelectComponent: SelectComponent, SecondaryButtonComponent: SecondaryButtonComponent, HeaderComponent: HeaderComponent, SubHeaderComponent: SubHeaderComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, PopoverComponent: PopoverComponent, DeleteButtonComponent: DeleteButtonComponent, LoadingComponent: LoadingComponent, ChartBuilderInputRowContainer: ChartBuilderInputRowContainer, ChartBuilderInputColumnContainer: ChartBuilderInputColumnContainer, ErrorMessageComponent: ErrorMessageComponent, PivotRowContainer: PivotRowContainer, PivotColumnContainer: PivotColumnContainer, FormContainer: ChartBuilderFormContainer, hideDateRangeFilter: true, onClickChartElement: onClickChartElement, filtersEnabled: filtersEnabled, onFiltersEnabledChanged: (enabled) => setFiltersEnabled(enabled), isEditingMode: true
|
|
563
|
+
}, label: addToDashboardButtonLabel, disabled: !!errorMessage || !(lastSuccessfulQuery === query) }))] }))] })] }) }) })), (!isChartBuilderHorizontalView || isChartBuilderOpen) && ((0, jsx_runtime_1.jsx)(ChartBuilder_1.ChartBuilderWithModal, { isHorizontalView: isChartBuilderHorizontalView, isOpen: isChartBuilderOpen, setIsOpen: setIsChartBuilderOpen, onAddToDashboardComplete: onAddToDashboardComplete, isAdmin: isAdminEnabled, title: chartBuilderTitle, buttonLabel: addToDashboardButtonLabel, tempReport: tempReport, reportId: report?.id, organizationName: organizationName, CardComponent: CardComponent, TableComponent: TableComponent, ModalComponent: ModalComponent, ButtonComponent: ButtonComponent, TextInputComponent: TextInputComponent, SelectComponent: SelectComponent, SecondaryButtonComponent: SecondaryButtonComponent, HeaderComponent: HeaderComponent, SubHeaderComponent: SubHeaderComponent, LabelComponent: LabelComponent, TextComponent: TextComponent, PopoverComponent: PopoverComponent, DeleteButtonComponent: DeleteButtonComponent, LoadingComponent: LoadingComponent, ChartBuilderInputRowContainer: ChartBuilderInputRowContainer, ChartBuilderInputColumnContainer: ChartBuilderInputColumnContainer, ErrorMessageComponent: ErrorMessageComponent, PivotRowContainer: PivotRowContainer, PivotColumnContainer: PivotColumnContainer, FormContainer: ChartBuilderFormContainer, hideDateRangeFilter: true, onClickChartElement: onClickChartElement, filtersEnabled: filtersEnabled, onFiltersEnabledChanged: (enabled) => setFiltersEnabled(enabled), isEditingMode: true }))] }));
|
|
574
564
|
}
|
|
575
565
|
const SQLEditorComponent = ({ query, schema, databaseType, clientName, setQuery, setEditorMounted, handleRunQuery, defineEditorTheme, setEditorTheme, runQueryOnMount = false, theme, loading, LoadingComponent = UiComponents_1.QuillLoadingComponent, }) => {
|
|
576
566
|
const [editorKey, setEditorKey] = (0, react_1.useState)(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/InternalChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InternalChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/InternalChart.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAgB,UAAU,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AAOlE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,WAiH5D;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,WAKlE;AAkFD,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,MAAM,EACN,MAAM,EACN,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,2BAAmC,EACnC,yBAAgC,EAChC,wBAAgC,EAChC,sBAAgC,EAChC,sBAAsB,EACtB,mBAAmB,EACnB,mBAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAuC,EACvC,eAAsC,EACtC,oBAAyD,EACzD,wBAA+C,EAC/C,eAAsC,EACtC,OAAO,EACP,uBAAuB,EACvB,mBAAmB,EACnB,OAAO,EACP,KAAK,EACL,OAAO,EACP,oBAAoB,EACpB,aAAa,GACd,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG;IAChC,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uBAAuB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7D,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,2CA0cA"}
|
|
@@ -16,12 +16,12 @@ const Filter_1 = require("../../models/Filter");
|
|
|
16
16
|
const filterProcessing_1 = require("../../utils/filterProcessing");
|
|
17
17
|
const DashboardFilter_1 = require("../../components/Dashboard/DashboardFilter");
|
|
18
18
|
const QuillSelect_1 = require("../../components/QuillSelect");
|
|
19
|
-
const QuillMultiSelect_1 = require("../../components/QuillMultiSelect");
|
|
20
19
|
const QuillDateRangePicker_1 = require("../../DateRangePicker/QuillDateRangePicker");
|
|
21
20
|
const MetricComponent_1 = __importDefault(require("../../components/Dashboard/MetricComponent"));
|
|
22
21
|
const dateRangePickerUtils_1 = require("../../DateRangePicker/dateRangePickerUtils");
|
|
23
22
|
const Chart_1 = require("../../Chart");
|
|
24
23
|
const Report_1 = require("../../models/Report");
|
|
24
|
+
const QuillMultiSelectWithCombo_1 = require("../QuillMultiSelectWithCombo");
|
|
25
25
|
function areDatesNearby(date1, date2) {
|
|
26
26
|
return Math.abs((0, date_fns_1.differenceInHours)(date1, date2)) < 24;
|
|
27
27
|
}
|
|
@@ -166,15 +166,15 @@ const TogglePrimitive = ({ value, onClick, style, disabled, }) => {
|
|
|
166
166
|
color: '#607D8B',
|
|
167
167
|
} }))] }));
|
|
168
168
|
};
|
|
169
|
-
function InternalChart({ report, colors, className, containerStyle, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, hideHorizontalCartesianGrid = false, hideVerticalCartesianGrid = true, hideSubsequentXAxisTicks = false, cartesianGridLineStyle = 'solid', cartesianGridLineColor, comparisonLineStyle, hideDateRangeFilter = false, filtersEnabled, setFiltersEnabled, mapColorsToFields, LoadingComponent = ChartSkeleton_1.QuillLoadingSkeleton, SelectComponent = QuillSelect_1.QuillSelectComponent, MultiSelectComponent =
|
|
169
|
+
function InternalChart({ report, colors, className, containerStyle, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, hideHorizontalCartesianGrid = false, hideVerticalCartesianGrid = true, hideSubsequentXAxisTicks = false, cartesianGridLineStyle = 'solid', cartesianGridLineColor, comparisonLineStyle, hideDateRangeFilter = false, filtersEnabled, setFiltersEnabled, mapColorsToFields, LoadingComponent = ChartSkeleton_1.QuillLoadingSkeleton, SelectComponent = QuillSelect_1.QuillSelectComponent, MultiSelectComponent = QuillMultiSelectWithCombo_1.QuillMultiSelectComponentWithCombo, DateRangePickerComponent = QuillDateRangePicker_1.QuillDateRangePicker, MetricComponent = MetricComponent_1.default, filters, onDashboardFilterChange, onClickChartElement, loading, error, isAdmin, filterToggleDisabled, layoutChanged, }) {
|
|
170
170
|
const { reportFilters } = (0, react_1.useContext)(Context_1.ReportFiltersContext);
|
|
171
171
|
const { dashboardConfig } = (0, react_1.useContext)(Context_1.DashboardConfigContext);
|
|
172
172
|
const currentReportFilters = (0, react_1.useMemo)(() => {
|
|
173
173
|
const dashFilters = dashboardConfig[report?.dashboardName ?? '']?.config.filters;
|
|
174
174
|
if (!dashFilters)
|
|
175
|
-
return Object.values(reportFilters[report?.id ??
|
|
175
|
+
return Object.values(reportFilters[report?.id ?? Report_1.TEMP_REPORT_ID] ?? {});
|
|
176
176
|
// Sort the filters with "date_range" type first, followed by the rest in the same order as the dashFilters, by label.
|
|
177
|
-
return Object.values(reportFilters[report?.id ??
|
|
177
|
+
return Object.values(reportFilters[report?.id ?? Report_1.TEMP_REPORT_ID] ?? {}).sort((a, b) => {
|
|
178
178
|
if (a.filter.filterType === 'date_range' &&
|
|
179
179
|
b.filter.filterType !== 'date_range') {
|
|
180
180
|
return -1;
|
|
@@ -190,7 +190,7 @@ function InternalChart({ report, colors, className, containerStyle, isAnimationA
|
|
|
190
190
|
});
|
|
191
191
|
}, [reportFilters, report?.id]);
|
|
192
192
|
const reportDateFilter = (0, react_1.useMemo)(() => {
|
|
193
|
-
return Object.values(reportFilters[report?.id ??
|
|
193
|
+
return Object.values(reportFilters[report?.id ?? Report_1.TEMP_REPORT_ID] ?? {}).find((f) => f.filter.filterType === 'date_range')?.filter;
|
|
194
194
|
}, [reportFilters, report?.id]);
|
|
195
195
|
const presetOptions = (0, react_1.useMemo)(() => {
|
|
196
196
|
return reportDateFilter
|
|
@@ -463,5 +463,5 @@ function InternalChart({ report, colors, className, containerStyle, isAnimationA
|
|
|
463
463
|
width: '100%',
|
|
464
464
|
height: '100%',
|
|
465
465
|
minHeight: 300,
|
|
466
|
-
}, reportId:
|
|
466
|
+
}, reportId: report.id, colors: colors, className: className, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid, hideHorizontalCartesianGrid: hideHorizontalCartesianGrid, hideVerticalCartesianGrid: hideVerticalCartesianGrid, hideSubsequentXAxisTicks: hideSubsequentXAxisTicks, cartesianGridLineStyle: cartesianGridLineStyle, cartesianGridLineColor: cartesianGridLineColor, hideDateRangeFilter: hideDateRangeFilter, comparisonLineStyle: comparisonLineStyle, isAnimationActive: isAnimationActive, loading: loading, scrollable: true, colorMap: colorMap, LoadingComponent: LoadingComponent, onClickChartElement: onClickChartElement }))] }))] }));
|
|
467
467
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A robust select component that implements the new minimal Select interface.
|
|
4
|
+
*/
|
|
5
|
+
export declare function QuillMultiSelectSectionList({ options, width, onChange, label, sectionHeaderMap, value, isLoading, disabled, emptyLabel, allSelectedLabel, style, owner, }: {
|
|
6
|
+
label?: string;
|
|
7
|
+
width: number;
|
|
8
|
+
value: {
|
|
9
|
+
[tenantField: string]: string[];
|
|
10
|
+
};
|
|
11
|
+
options: {
|
|
12
|
+
[tenantField: string]: {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
sectionHeaderMap?: {
|
|
18
|
+
[tenantField: string]: string;
|
|
19
|
+
};
|
|
20
|
+
onChange: (event: {
|
|
21
|
+
target: {
|
|
22
|
+
value: {
|
|
23
|
+
[tenantField: string]: string[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}) => void;
|
|
27
|
+
isLoading?: boolean;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
emptyLabel?: string;
|
|
30
|
+
allSelectedLabel?: string;
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
owner?: string;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const ListboxTextInput: ({ value, onChange, placeholder, }: {
|
|
35
|
+
value: string;
|
|
36
|
+
onChange: (e: string) => void;
|
|
37
|
+
placeholder: string;
|
|
38
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=QuillMultiSelectSectionList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuillMultiSelectSectionList.d.ts","sourceRoot":"","sources":["../../../src/components/QuillMultiSelectSectionList.tsx"],"names":[],"mappings":"AAEA,OAAc,EACZ,aAAa,EAMd,MAAM,OAAO,CAAC;AAGf;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE;QAAC,CAAC,WAAW,EAAE,MAAM,GAAI,MAAM,EAAE,CAAA;KAAC,CAAC;IAC1C,OAAO,EAAE;QAAC,CAAC,WAAW,EAAE,MAAM,GAAI;YAChC,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;SACf,EAAE,CAAA;KAAC,CAAC;IACL,gBAAgB,CAAC,EAAE;QAAC,CAAC,WAAW,EAAE,MAAM,GAAI,MAAM,CAAA;KAAC,CAAC;IACpD,QAAQ,EAAE,CACR,KAAK,EAAE;QAAE,MAAM,EAAE;YAAE,KAAK,EAAE;gBAAE,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,KAC9D,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,2CAgbA;AAED,eAAO,MAAM,gBAAgB,sCAI1B;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;CACrB,4CAwDA,CAAC"}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ListboxTextInput = void 0;
|
|
27
|
+
exports.QuillMultiSelectSectionList = QuillMultiSelectSectionList;
|
|
28
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
const hooks_1 = require("../hooks");
|
|
30
|
+
const UiComponents_1 = require("./UiComponents");
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
32
|
+
const Context_1 = require("../Context");
|
|
33
|
+
/**
|
|
34
|
+
* A robust select component that implements the new minimal Select interface.
|
|
35
|
+
*/
|
|
36
|
+
function QuillMultiSelectSectionList({ options, width, onChange, label, sectionHeaderMap, value, isLoading, disabled, emptyLabel, allSelectedLabel, style, owner, }) {
|
|
37
|
+
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
38
|
+
// const [selectedOptions, setSelectedOptions] = useState<{[tenantField: string] : string[]}>({});
|
|
39
|
+
const [showModal, setShowModal] = (0, react_1.useState)(false);
|
|
40
|
+
const modalRef = (0, react_1.useRef)(null);
|
|
41
|
+
const buttonRef = (0, react_1.useRef)(null);
|
|
42
|
+
const debounceTimeoutId = (0, react_1.useRef)(null);
|
|
43
|
+
const [searchQuery, setSearchQuery] = react_1.default.useState('');
|
|
44
|
+
// const [exceedsLimit, setExceedsLimit] = useState(false);
|
|
45
|
+
(0, hooks_1.useOnClickOutside)(modalRef, (event) => {
|
|
46
|
+
if (!buttonRef.current?.contains(event.target))
|
|
47
|
+
setShowModal(false);
|
|
48
|
+
}, showModal);
|
|
49
|
+
const debounce = (updatedChangeEvent) => {
|
|
50
|
+
if (debounceTimeoutId.current) {
|
|
51
|
+
clearTimeout(debounceTimeoutId.current);
|
|
52
|
+
}
|
|
53
|
+
debounceTimeoutId.current = setTimeout(() => {
|
|
54
|
+
onChange(updatedChangeEvent);
|
|
55
|
+
}, 200);
|
|
56
|
+
};
|
|
57
|
+
const optionsLength = react_1.default.useMemo(() => {
|
|
58
|
+
return Object.values(options).reduce((a, b) => a + b.length, 0);
|
|
59
|
+
}, [options]);
|
|
60
|
+
const filteredItems = react_1.default.useMemo(() => {
|
|
61
|
+
if (searchQuery === '') {
|
|
62
|
+
return options;
|
|
63
|
+
}
|
|
64
|
+
const uuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/;
|
|
65
|
+
// Get the first element of the first non-empty array
|
|
66
|
+
const sample = Object.values(options).find((arr) => arr.length > 0)?.[0];
|
|
67
|
+
if (!sample) {
|
|
68
|
+
return {};
|
|
69
|
+
}
|
|
70
|
+
const isUuid = sample.value?.match(uuidRegex);
|
|
71
|
+
const isNumber = !isNaN(parseInt(sample.value));
|
|
72
|
+
const filteredOptions = Object.keys(options).reduce((acc, key) => {
|
|
73
|
+
acc[key] = options[key]?.filter((option) => {
|
|
74
|
+
if (!option) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return option.label
|
|
78
|
+
.toLowerCase()
|
|
79
|
+
.replace(/\s+/g, '')
|
|
80
|
+
.includes(searchQuery.toLowerCase().replace(/\s+/g, ''))
|
|
81
|
+
|| (isNumber || isUuid ? option.value
|
|
82
|
+
.toLowerCase()
|
|
83
|
+
.replace(/\s+/g, '')
|
|
84
|
+
.includes(searchQuery.toLowerCase().replace(/\s+/g, '')) : false);
|
|
85
|
+
}) ?? [];
|
|
86
|
+
return acc;
|
|
87
|
+
}, {});
|
|
88
|
+
const sliceSize = Math.ceil(20 / Object.keys(filteredOptions).length);
|
|
89
|
+
Object.keys(filteredOptions).forEach((key) => {
|
|
90
|
+
if (filteredOptions[key]) {
|
|
91
|
+
filteredOptions[key] = filteredOptions[key].slice(0, sliceSize);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return Object.fromEntries(Object.entries(filteredOptions).filter(([, value]) => !!value?.length).sort(([key]) => key === owner ? -1 : 1));
|
|
95
|
+
}, [options, searchQuery]);
|
|
96
|
+
const filteredLength = react_1.default.useMemo(() => {
|
|
97
|
+
return Object.values(filteredItems).reduce((a, b) => a + b.length, 0);
|
|
98
|
+
}, [filteredItems]);
|
|
99
|
+
const selectedOptionsLabel = (0, react_1.useMemo)(() => {
|
|
100
|
+
const valuesLength = Object.values(value).reduce((a, b) => a + b.length, 0);
|
|
101
|
+
if (!valuesLength) {
|
|
102
|
+
return 'Select';
|
|
103
|
+
}
|
|
104
|
+
const selectedOptionsLabels = Object.keys(value).map((key) => {
|
|
105
|
+
const matchingOptions = options[key]?.filter((elem) => value[key]?.includes(elem.value)) ?? [];
|
|
106
|
+
if (matchingOptions.length === 0) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
if (matchingOptions.length !== value[key]?.length) {
|
|
110
|
+
return value[key]?.join(', ') ?? null;
|
|
111
|
+
}
|
|
112
|
+
return matchingOptions
|
|
113
|
+
.map((elem) => elem.label)
|
|
114
|
+
.join(', ');
|
|
115
|
+
});
|
|
116
|
+
if (selectedOptionsLabels.length === optionsLength && allSelectedLabel) {
|
|
117
|
+
return allSelectedLabel;
|
|
118
|
+
}
|
|
119
|
+
return selectedOptionsLabels.filter((label) => label !== null).join(', ');
|
|
120
|
+
}, [options, value]);
|
|
121
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
122
|
+
position: 'relative',
|
|
123
|
+
borderRadius: '6px',
|
|
124
|
+
width: width,
|
|
125
|
+
minWidth: width,
|
|
126
|
+
...style
|
|
127
|
+
}, children: [label && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
128
|
+
fontSize: 14,
|
|
129
|
+
color: theme?.secondaryTextColor,
|
|
130
|
+
fontFamily: theme?.fontFamily,
|
|
131
|
+
paddingBottom: 5,
|
|
132
|
+
fontWeight: 600,
|
|
133
|
+
}, children: label })), (0, jsx_runtime_1.jsxs)("button", { style: {
|
|
134
|
+
fontFamily: theme?.fontFamily,
|
|
135
|
+
color: theme?.primaryTextColor,
|
|
136
|
+
width: '100%',
|
|
137
|
+
display: 'flex',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
justifyContent: 'space-between',
|
|
140
|
+
fontWeight: 'inherit',
|
|
141
|
+
lineHeight: 'inherit',
|
|
142
|
+
padding: '8px 12px',
|
|
143
|
+
fontSize: 14,
|
|
144
|
+
margin: 0,
|
|
145
|
+
boxSizing: 'border-box',
|
|
146
|
+
borderWidth: 1,
|
|
147
|
+
borderStyle: 'solid',
|
|
148
|
+
borderColor: theme?.borderColor,
|
|
149
|
+
borderRadius: 6,
|
|
150
|
+
paddingTop: 9,
|
|
151
|
+
paddingBottom: 9,
|
|
152
|
+
height: 40,
|
|
153
|
+
minHeight: 40,
|
|
154
|
+
maxHeight: 40,
|
|
155
|
+
}, className: 'quill-select-button', onClick: () => setShowModal((showModal) => !showModal), disabled: disabled, ref: buttonRef, children: [(0, jsx_runtime_1.jsx)("style", { children: ` .quill-select-button { background: ${theme?.backgroundColor}; }
|
|
156
|
+
.quill-select-button:hover { background: ${theme?.hoverBackgroundColor}; }
|
|
157
|
+
.quill-select-button:disabled {
|
|
158
|
+
cursor: not-allowed;
|
|
159
|
+
background: ${theme?.hoverBackgroundColor};
|
|
160
|
+
}
|
|
161
|
+
` }), (0, jsx_runtime_1.jsx)("span", { style: {
|
|
162
|
+
textOverflow: 'ellipsis',
|
|
163
|
+
whiteSpace: 'nowrap',
|
|
164
|
+
overflow: 'hidden',
|
|
165
|
+
width: '100%',
|
|
166
|
+
textAlign: 'left',
|
|
167
|
+
zIndex: 1,
|
|
168
|
+
}, children: selectedOptionsLabel }), (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", "data-slot": "icon", height: 20, width: 20, style: { minHeight: 20, minWidth: 20 }, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z", clipRule: "evenodd" }) })] }), showModal && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
169
|
+
position: 'absolute',
|
|
170
|
+
width: '100%',
|
|
171
|
+
display: 'flex',
|
|
172
|
+
flexDirection: 'column',
|
|
173
|
+
boxSizing: 'border-box',
|
|
174
|
+
borderWidth: 1,
|
|
175
|
+
borderStyle: 'solid',
|
|
176
|
+
borderColor: theme?.borderColor,
|
|
177
|
+
borderRadius: 6,
|
|
178
|
+
background: 'white',
|
|
179
|
+
marginTop: 12,
|
|
180
|
+
zIndex: 100,
|
|
181
|
+
padding: 6,
|
|
182
|
+
fontFamily: theme?.fontFamily,
|
|
183
|
+
maxHeight: '50vh',
|
|
184
|
+
overflow: 'scroll',
|
|
185
|
+
fontSize: 14,
|
|
186
|
+
}, ref: modalRef, children: [options && optionsLength > 20 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(exports.ListboxTextInput, { value: searchQuery, placeholder: "Search", onChange: (value) => {
|
|
187
|
+
setSearchQuery(value);
|
|
188
|
+
} }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
189
|
+
height: 9,
|
|
190
|
+
width: 230,
|
|
191
|
+
borderTop: '1px solid #e7e7e7',
|
|
192
|
+
} })] })), !isLoading &&
|
|
193
|
+
(!filteredItems || filteredLength === 0) && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
194
|
+
display: 'flex',
|
|
195
|
+
alignItems: 'center',
|
|
196
|
+
padding: 8,
|
|
197
|
+
margin: 0,
|
|
198
|
+
boxSizing: 'border-box',
|
|
199
|
+
borderWidth: 0,
|
|
200
|
+
fontSize: 14,
|
|
201
|
+
borderStyle: 'solid',
|
|
202
|
+
borderColor: theme?.borderColor,
|
|
203
|
+
borderRadius: 4,
|
|
204
|
+
fontFamily: theme?.fontFamily,
|
|
205
|
+
textOverflow: 'ellipsis',
|
|
206
|
+
whiteSpace: 'nowrap',
|
|
207
|
+
height: 34,
|
|
208
|
+
minHeight: 34,
|
|
209
|
+
gap: 6,
|
|
210
|
+
overflow: 'hidden',
|
|
211
|
+
}, children: [(0, jsx_runtime_1.jsx)("style", { children: `
|
|
212
|
+
.quill-option {
|
|
213
|
+
background: white;
|
|
214
|
+
}
|
|
215
|
+
.quill-option:hover {
|
|
216
|
+
background: #F4F4F5;
|
|
217
|
+
}
|
|
218
|
+
` }), (0, jsx_runtime_1.jsx)("span", { style: {
|
|
219
|
+
textOverflow: 'ellipsis',
|
|
220
|
+
whiteSpace: 'nowrap',
|
|
221
|
+
overflow: 'hidden',
|
|
222
|
+
cursor: 'default',
|
|
223
|
+
}, children: emptyLabel ?? 'No options available' })] })), !isLoading ? Object.keys(filteredItems).map((key) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { style: {
|
|
224
|
+
display: 'flex',
|
|
225
|
+
alignItems: 'center',
|
|
226
|
+
padding: 8,
|
|
227
|
+
margin: 0,
|
|
228
|
+
boxSizing: 'border-box',
|
|
229
|
+
borderWidth: 0,
|
|
230
|
+
fontSize: 14,
|
|
231
|
+
borderStyle: 'solid',
|
|
232
|
+
borderColor: theme?.borderColor,
|
|
233
|
+
borderRadius: 4,
|
|
234
|
+
fontFamily: theme?.fontFamily,
|
|
235
|
+
textOverflow: 'ellipsis',
|
|
236
|
+
whiteSpace: 'nowrap',
|
|
237
|
+
height: 34,
|
|
238
|
+
minHeight: 34,
|
|
239
|
+
gap: 6,
|
|
240
|
+
overflow: 'hidden',
|
|
241
|
+
}, className: "quill-option", onClick: () => {
|
|
242
|
+
const updatedValue = filteredItems[key]?.length === value[key]?.length
|
|
243
|
+
? [] : filteredItems[key]?.map((option) => option.value) ?? [];
|
|
244
|
+
const updatedChangeEvent = {
|
|
245
|
+
target: {
|
|
246
|
+
value: {
|
|
247
|
+
...value,
|
|
248
|
+
[key]: updatedValue,
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
// setSelectedOptions(updatedValue);
|
|
253
|
+
debounce(updatedChangeEvent);
|
|
254
|
+
}, children: [(0, jsx_runtime_1.jsx)("style", { children: `
|
|
255
|
+
.quill-option {
|
|
256
|
+
background: white;
|
|
257
|
+
}
|
|
258
|
+
.quill-option:hover {
|
|
259
|
+
background: #F4F4F5;
|
|
260
|
+
}
|
|
261
|
+
` }), (0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: filteredItems[key]?.length === value[key]?.length, style: { width: '14px', height: '14px', margin: 'auto 0' }, readOnly: true }), (0, jsx_runtime_1.jsx)("span", { style: {
|
|
262
|
+
textOverflow: 'ellipsis',
|
|
263
|
+
whiteSpace: 'nowrap',
|
|
264
|
+
overflow: 'hidden',
|
|
265
|
+
fontWeight: 600,
|
|
266
|
+
}, children: sectionHeaderMap?.[key] ?? key })] }, "section-header-" + key), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
267
|
+
height: 1,
|
|
268
|
+
borderTop: '1px solid #e7e7e7',
|
|
269
|
+
marginTop: 2,
|
|
270
|
+
marginBottom: 2,
|
|
271
|
+
} }), filteredItems[key]?.map((option) => ((0, jsx_runtime_1.jsxs)("button", { style: {
|
|
272
|
+
display: 'flex',
|
|
273
|
+
alignItems: 'center',
|
|
274
|
+
padding: 8,
|
|
275
|
+
paddingLeft: 16,
|
|
276
|
+
margin: 0,
|
|
277
|
+
boxSizing: 'border-box',
|
|
278
|
+
borderWidth: 0,
|
|
279
|
+
fontSize: 14,
|
|
280
|
+
borderStyle: 'solid',
|
|
281
|
+
borderColor: theme?.borderColor,
|
|
282
|
+
borderRadius: 4,
|
|
283
|
+
fontFamily: theme?.fontFamily,
|
|
284
|
+
textOverflow: 'ellipsis',
|
|
285
|
+
whiteSpace: 'nowrap',
|
|
286
|
+
height: 34,
|
|
287
|
+
minHeight: 34,
|
|
288
|
+
gap: 6,
|
|
289
|
+
overflow: 'hidden',
|
|
290
|
+
}, className: "quill-option", onClick: () => {
|
|
291
|
+
const updatedValue = value[key]?.includes(option.value)
|
|
292
|
+
? value[key]?.filter((val) => val !== option.value)
|
|
293
|
+
: [...(value[key] ?? []), option.value];
|
|
294
|
+
const updatedChangeEvent = {
|
|
295
|
+
target: {
|
|
296
|
+
value: {
|
|
297
|
+
...value,
|
|
298
|
+
[key]: updatedValue,
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
// setSelectedOptions(updatedValue);
|
|
303
|
+
debounce(updatedChangeEvent);
|
|
304
|
+
}, children: [(0, jsx_runtime_1.jsx)("style", { children: `
|
|
305
|
+
.quill-option {
|
|
306
|
+
background: white;
|
|
307
|
+
}
|
|
308
|
+
.quill-option:hover {
|
|
309
|
+
background: #F4F4F5;
|
|
310
|
+
}
|
|
311
|
+
` }), (0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: value[key]?.includes(option.value), style: { width: '14px', height: '14px', margin: 'auto 0' }, readOnly: true }), (0, jsx_runtime_1.jsx)("span", { style: {
|
|
312
|
+
textOverflow: 'ellipsis',
|
|
313
|
+
whiteSpace: 'nowrap',
|
|
314
|
+
overflow: 'hidden',
|
|
315
|
+
}, children: option.label })] }, "value-" + key + "-" + option.value)))] }))) : ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(UiComponents_1.LoadingSpinner, {}) }))] }))] }));
|
|
316
|
+
}
|
|
317
|
+
const ListboxTextInput = ({ value, onChange, placeholder, }) => {
|
|
318
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
319
|
+
position: 'relative',
|
|
320
|
+
display: 'flex',
|
|
321
|
+
flexDirection: 'row',
|
|
322
|
+
alignItems: 'center',
|
|
323
|
+
marginTop: 2,
|
|
324
|
+
}, children: [(0, jsx_runtime_1.jsx)("style", { children: `
|
|
325
|
+
.quill-text-input {
|
|
326
|
+
background-color: white;
|
|
327
|
+
height: 40px;
|
|
328
|
+
width: 145px;
|
|
329
|
+
z-index: 2;
|
|
330
|
+
color: #384151;
|
|
331
|
+
border-radius: 4px;
|
|
332
|
+
text-align: left;
|
|
333
|
+
padding-top: 0px;
|
|
334
|
+
padding-bottom: 0px;
|
|
335
|
+
box-sizing: content-box;
|
|
336
|
+
margin-left: 6px;
|
|
337
|
+
border: 0 solid #e5e7eb;
|
|
338
|
+
}
|
|
339
|
+
.quill-text-input:focus {
|
|
340
|
+
outline: none;
|
|
341
|
+
}` }), (0, jsx_runtime_1.jsx)("div", { style: { width: 6 } }), (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "rgba(56, 65, 81, 0.7)", height: "16", width: "16", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z", clipRule: "evenodd" }) }), (0, jsx_runtime_1.jsx)("input", { className: "quill-text-input", type: "text", value: value, onChange: (event) => onChange(event.target.value), placeholder: placeholder })] }));
|
|
342
|
+
};
|
|
343
|
+
exports.ListboxTextInput = ListboxTextInput;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { MultiSelectComponentProps } from './UiComponents';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* A robust select component that implements the new minimal Select interface.
|
|
4
5
|
*/
|
|
5
|
-
export declare function QuillMultiSelectComponentWithCombo({ options, width, onChange, label, value, isLoading, disabled, emptyLabel, allSelectedLabel, }: MultiSelectComponentProps & {
|
|
6
|
+
export declare function QuillMultiSelectComponentWithCombo({ options, width, onChange, label, value, isLoading, disabled, emptyLabel, allSelectedLabel, style, }: MultiSelectComponentProps & {
|
|
6
7
|
allSelectedLabel?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
7
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export declare const ListboxTextInput: ({ value, onChange, placeholder, }: {
|
|
9
11
|
value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillMultiSelectWithCombo.d.ts","sourceRoot":"","sources":["../../../src/components/QuillMultiSelectWithCombo.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"QuillMultiSelectWithCombo.d.ts","sourceRoot":"","sources":["../../../src/components/QuillMultiSelectWithCombo.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAc,EAEZ,aAAa,EAMd,MAAM,OAAO,CAAC;AAGf;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,EACjD,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,KAAK,GACN,EAAE,yBAAyB,GAAG;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,2CA4flF;AAED,eAAO,MAAM,gBAAgB,sCAI1B;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;CACrB,4CAwDA,CAAC"}
|
|
@@ -33,7 +33,7 @@ const Context_1 = require("../Context");
|
|
|
33
33
|
/**
|
|
34
34
|
* A robust select component that implements the new minimal Select interface.
|
|
35
35
|
*/
|
|
36
|
-
function QuillMultiSelectComponentWithCombo({ options, width, onChange, label, value, isLoading, disabled, emptyLabel, allSelectedLabel, }) {
|
|
36
|
+
function QuillMultiSelectComponentWithCombo({ options, width, onChange, label, value, isLoading, disabled, emptyLabel, allSelectedLabel, style, }) {
|
|
37
37
|
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
38
38
|
const [selectedOptions, setSelectedOptions] = (0, react_1.useState)([]);
|
|
39
39
|
const [showModal, setShowModal] = (0, react_1.useState)(false);
|
|
@@ -121,8 +121,8 @@ function QuillMultiSelectComponentWithCombo({ options, width, onChange, label, v
|
|
|
121
121
|
// But they don't have their proper labels, since we haven't stored/passed in the label
|
|
122
122
|
const filteredItems = react_1.default.useMemo(() => {
|
|
123
123
|
const uuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/;
|
|
124
|
-
const isUuid = potentialOptions[0]?.value?.match(uuidRegex);
|
|
125
|
-
const isNumber = !isNaN(parseInt(potentialOptions[0]?.value ?? ''));
|
|
124
|
+
const isUuid = potentialOptions?.[0]?.value?.toString()?.match(uuidRegex);
|
|
125
|
+
const isNumber = !isNaN(parseInt(potentialOptions?.[0]?.value ?? ''));
|
|
126
126
|
// Sort null to top
|
|
127
127
|
if (searchQuery === '') {
|
|
128
128
|
return potentialOptions
|
|
@@ -170,6 +170,7 @@ function QuillMultiSelectComponentWithCombo({ options, width, onChange, label, v
|
|
|
170
170
|
borderRadius: '6px',
|
|
171
171
|
width: width,
|
|
172
172
|
minWidth: width,
|
|
173
|
+
...style
|
|
173
174
|
}, children: [label && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
174
175
|
fontSize: 14,
|
|
175
176
|
color: theme?.secondaryTextColor,
|
|
@@ -4,9 +4,9 @@ export declare const useExport: (reportId?: string, { CustomDocumentComponent, m
|
|
|
4
4
|
maximumRowsPerPage?: number;
|
|
5
5
|
sectionField?: string;
|
|
6
6
|
}) => {
|
|
7
|
-
|
|
7
|
+
downloadCSV: () => void;
|
|
8
|
+
downloadPDF: () => void;
|
|
8
9
|
isPDFLoading: boolean;
|
|
9
|
-
downloadCSV: () => Promise<void>;
|
|
10
10
|
isCSVLoading: boolean;
|
|
11
11
|
};
|
|
12
12
|
interface QuillPDFProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAmE/C,eAAO,MAAM,SAAS,cACT,MAAM,mEAMd;IACD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,GAAG,CAAC,OAAO,CAAC;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,
|
|
1
|
+
{"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAmE/C,eAAO,MAAM,SAAS,cACT,MAAM,mEAMd;IACD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,GAAG,CAAC,OAAO,CAAC;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;;;;;CAqPF,CAAC;AAEF,UAAU,aAAa;IACrB,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
|