@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/esm/SQLEditor.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
4
|
import { useState, useContext, useEffect, useRef, useMemo, useCallback, } from 'react';
|
|
5
5
|
import MonacoEditor from '@monaco-editor/react';
|
|
6
|
-
import { ClientContext,
|
|
6
|
+
import { ClientContext, DashboardFiltersContext, SchemaDataContext, TenantContext, ThemeContext, } from './Context';
|
|
7
7
|
import { ChartBuilderWithModal, createInitialFormData } from './ChartBuilder';
|
|
8
8
|
import { MemoizedButton, MemoizedDeleteButton, MemoizedHeader, MemoizedLabel, MemoizedModal, MemoizedPopover, MemoizedSecondaryButton, MemoizedSubHeader, MemoizedText, OverflowContainer, QuillChartBuilderFormContainer, QuillChartBuilderInputColumnContainer, QuillChartBuilderInputRowContainer, QuillErrorMessageComponent, QuillLoadingComponent, QuillPivotColumnContainer, QuillPivotRowContainer, QuillTableSQLEditorComponent, } from './components/UiComponents';
|
|
9
9
|
import { QuillTextInput } from './components/UiComponents';
|
|
@@ -84,7 +84,7 @@ function setEditorTheme(_editor, monaco, schema, databaseType, clientName) {
|
|
|
84
84
|
* ### SQLEditor API
|
|
85
85
|
* @see https://docs.quillsql.com/components/sql-editor
|
|
86
86
|
*/
|
|
87
|
-
export default function SQLEditor({ ButtonComponent = MemoizedButton, SecondaryButtonComponent = MemoizedSecondaryButton, DeleteButtonComponent = MemoizedDeleteButton, TextInputComponent = QuillTextInput, SelectComponent = QuillSelectComponent, TableComponent = QuillTableSQLEditorComponent, isNewQueryEnabled = false, LoadingComponent = QuillLoadingComponent, ModalComponent = MemoizedModal, PopoverComponent = MemoizedPopover, CardComponent = QuillCard, LabelComponent = MemoizedLabel, HeaderComponent = MemoizedHeader, SubHeaderComponent = MemoizedSubHeader, TextComponent = MemoizedText, ErrorMessageComponent = QuillErrorMessageComponent, ChartBuilderInputRowContainer = QuillChartBuilderInputRowContainer, ChartBuilderInputColumnContainer = QuillChartBuilderInputColumnContainer, PivotRowContainer = QuillPivotRowContainer, PivotColumnContainer = QuillPivotColumnContainer, ChartBuilderFormContainer = 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,
|
|
87
|
+
export default function SQLEditor({ ButtonComponent = MemoizedButton, SecondaryButtonComponent = MemoizedSecondaryButton, DeleteButtonComponent = MemoizedDeleteButton, TextInputComponent = QuillTextInput, SelectComponent = QuillSelectComponent, TableComponent = QuillTableSQLEditorComponent, isNewQueryEnabled = false, LoadingComponent = QuillLoadingComponent, ModalComponent = MemoizedModal, PopoverComponent = MemoizedPopover, CardComponent = QuillCard, LabelComponent = MemoizedLabel, HeaderComponent = MemoizedHeader, SubHeaderComponent = MemoizedSubHeader, TextComponent = MemoizedText, ErrorMessageComponent = QuillErrorMessageComponent, ChartBuilderInputRowContainer = QuillChartBuilderInputRowContainer, ChartBuilderInputColumnContainer = QuillChartBuilderInputColumnContainer, PivotRowContainer = QuillPivotRowContainer, PivotColumnContainer = QuillPivotColumnContainer, ChartBuilderFormContainer = 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, }) {
|
|
88
88
|
const [sqlPrompt, setSqlPrompt] = useState('');
|
|
89
89
|
const [client] = useContext(ClientContext);
|
|
90
90
|
const [theme] = useContext(ThemeContext);
|
|
@@ -96,7 +96,6 @@ export default function SQLEditor({ ButtonComponent = MemoizedButton, SecondaryB
|
|
|
96
96
|
const [columns, setColumns] = useState([]);
|
|
97
97
|
const [schemaData] = useContext(SchemaDataContext);
|
|
98
98
|
const { dashboardFilters } = useContext(DashboardFiltersContext);
|
|
99
|
-
const [, dashboardDispatch] = useContext(DashboardContext);
|
|
100
99
|
const specificDashboardFilters = useMemo(() => {
|
|
101
100
|
return Object.values(dashboardFilters[report?.dashboardName ?? destinationDashboard ?? ''] ??
|
|
102
101
|
{}).map((f) => f.filter);
|
|
@@ -482,21 +481,16 @@ export default function SQLEditor({ ButtonComponent = MemoizedButton, SecondaryB
|
|
|
482
481
|
}, label: "Run query" })), isNewQueryEnabled && (_jsx(SecondaryButtonComponent, { onClick: handleClearQuery, label: "Clear query" })), addToDashboardButtonLabel ===
|
|
483
482
|
'Add to dashboard' && (_jsx(ButtonComponent, { onClick: async () => {
|
|
484
483
|
onSaveChanges && onSaveChanges();
|
|
485
|
-
|
|
484
|
+
setTempReport({
|
|
485
|
+
...tempReport,
|
|
486
486
|
id: TEMP_REPORT_ID,
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
rowCount: rowCount ?? 0,
|
|
495
|
-
queryString: query ?? '',
|
|
496
|
-
dashboardName: report?.dashboardName ??
|
|
497
|
-
destinationDashboard,
|
|
498
|
-
// flags: flagsToAdd,
|
|
499
|
-
},
|
|
487
|
+
rows,
|
|
488
|
+
columns: columns,
|
|
489
|
+
columnInternal: columns,
|
|
490
|
+
rowCount: rowCount ?? 0,
|
|
491
|
+
queryString: query ?? '',
|
|
492
|
+
dashboardName: report?.dashboardName ??
|
|
493
|
+
destinationDashboard,
|
|
500
494
|
});
|
|
501
495
|
setIsChartBuilderOpen(true);
|
|
502
496
|
}, label: addToDashboardButtonLabel, disabled: !!errorMessage ||
|
|
@@ -547,23 +541,19 @@ export default function SQLEditor({ ButtonComponent = MemoizedButton, SecondaryB
|
|
|
547
541
|
marginBottom: 5,
|
|
548
542
|
}, children: [onDiscardChanges && (_jsx(SecondaryButtonComponent, { onClick: onDiscardChanges, label: "Discard changes" })), addToDashboardButtonLabel !== 'Add to dashboard' && (_jsx(ButtonComponent, { onClick: async () => {
|
|
549
543
|
onSaveChanges && onSaveChanges();
|
|
550
|
-
|
|
544
|
+
setTempReport({
|
|
545
|
+
...tempReport,
|
|
551
546
|
id: TEMP_REPORT_ID,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
rowCount: rowCount ?? 0,
|
|
560
|
-
queryString: query ?? '',
|
|
561
|
-
dashboardName: report?.dashboardName ?? destinationDashboard,
|
|
562
|
-
// flags: flagsToAdd,
|
|
563
|
-
},
|
|
547
|
+
rows,
|
|
548
|
+
columns: columns,
|
|
549
|
+
columnInternal: columns,
|
|
550
|
+
rowCount: rowCount ?? 0,
|
|
551
|
+
queryString: query ?? '',
|
|
552
|
+
dashboardName: report?.dashboardName ?? destinationDashboard,
|
|
553
|
+
// flags: flagsToAdd,
|
|
564
554
|
});
|
|
565
555
|
setIsChartBuilderOpen(true);
|
|
566
|
-
}, label: addToDashboardButtonLabel, disabled: !!errorMessage || !(lastSuccessfulQuery === query) }))] }))] })] }) }) })), (!isChartBuilderHorizontalView || isChartBuilderOpen) && (_jsx(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
|
|
556
|
+
}, label: addToDashboardButtonLabel, disabled: !!errorMessage || !(lastSuccessfulQuery === query) }))] }))] })] }) }) })), (!isChartBuilderHorizontalView || isChartBuilderOpen) && (_jsx(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 }))] }));
|
|
567
557
|
}
|
|
568
558
|
const SQLEditorComponent = ({ query, schema, databaseType, clientName, setQuery, setEditorMounted, handleRunQuery, defineEditorTheme, setEditorTheme, runQueryOnMount = false, theme, loading, LoadingComponent = QuillLoadingComponent, }) => {
|
|
569
559
|
const [editorKey, setEditorKey] = 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"}
|
|
@@ -10,12 +10,12 @@ DashboardFilterType as DashboardFilterVariant, FilterType, } from '../../models/
|
|
|
10
10
|
import { applyCustomFilterToDashDateFilter } from '../../utils/filterProcessing';
|
|
11
11
|
import { DashboardFilter } from '../../components/Dashboard/DashboardFilter';
|
|
12
12
|
import { QuillSelectComponent } from '../../components/QuillSelect';
|
|
13
|
-
import { QuillMultiSelectComponent } from '../../components/QuillMultiSelect';
|
|
14
13
|
import { QuillDateRangePicker } from '../../DateRangePicker/QuillDateRangePicker';
|
|
15
14
|
import QuillMetricComponent from '../../components/Dashboard/MetricComponent';
|
|
16
15
|
import { COMPARISON_RANGE, defaultOptionsV2, getRangeFromPresetOptions, PRIMARY_RANGE, } from '../../DateRangePicker/dateRangePickerUtils';
|
|
17
16
|
import { ChartDisplay } from '../../Chart';
|
|
18
17
|
import { TEMP_REPORT_ID } from '../../models/Report';
|
|
18
|
+
import { QuillMultiSelectComponentWithCombo } from '../QuillMultiSelectWithCombo';
|
|
19
19
|
function areDatesNearby(date1, date2) {
|
|
20
20
|
return Math.abs(differenceInHours(date1, date2)) < 24;
|
|
21
21
|
}
|
|
@@ -160,15 +160,15 @@ const TogglePrimitive = ({ value, onClick, style, disabled, }) => {
|
|
|
160
160
|
color: '#607D8B',
|
|
161
161
|
} }))] }));
|
|
162
162
|
};
|
|
163
|
-
export default 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 = QuillLoadingSkeleton, SelectComponent = QuillSelectComponent, MultiSelectComponent =
|
|
163
|
+
export default 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 = QuillLoadingSkeleton, SelectComponent = QuillSelectComponent, MultiSelectComponent = QuillMultiSelectComponentWithCombo, DateRangePickerComponent = QuillDateRangePicker, MetricComponent = QuillMetricComponent, filters, onDashboardFilterChange, onClickChartElement, loading, error, isAdmin, filterToggleDisabled, layoutChanged, }) {
|
|
164
164
|
const { reportFilters } = useContext(ReportFiltersContext);
|
|
165
165
|
const { dashboardConfig } = useContext(DashboardConfigContext);
|
|
166
166
|
const currentReportFilters = useMemo(() => {
|
|
167
167
|
const dashFilters = dashboardConfig[report?.dashboardName ?? '']?.config.filters;
|
|
168
168
|
if (!dashFilters)
|
|
169
|
-
return Object.values(reportFilters[report?.id ??
|
|
169
|
+
return Object.values(reportFilters[report?.id ?? TEMP_REPORT_ID] ?? {});
|
|
170
170
|
// Sort the filters with "date_range" type first, followed by the rest in the same order as the dashFilters, by label.
|
|
171
|
-
return Object.values(reportFilters[report?.id ??
|
|
171
|
+
return Object.values(reportFilters[report?.id ?? TEMP_REPORT_ID] ?? {}).sort((a, b) => {
|
|
172
172
|
if (a.filter.filterType === 'date_range' &&
|
|
173
173
|
b.filter.filterType !== 'date_range') {
|
|
174
174
|
return -1;
|
|
@@ -184,7 +184,7 @@ export default function InternalChart({ report, colors, className, containerStyl
|
|
|
184
184
|
});
|
|
185
185
|
}, [reportFilters, report?.id]);
|
|
186
186
|
const reportDateFilter = useMemo(() => {
|
|
187
|
-
return Object.values(reportFilters[report?.id ??
|
|
187
|
+
return Object.values(reportFilters[report?.id ?? TEMP_REPORT_ID] ?? {}).find((f) => f.filter.filterType === 'date_range')?.filter;
|
|
188
188
|
}, [reportFilters, report?.id]);
|
|
189
189
|
const presetOptions = useMemo(() => {
|
|
190
190
|
return reportDateFilter
|
|
@@ -457,5 +457,5 @@ export default function InternalChart({ report, colors, className, containerStyl
|
|
|
457
457
|
width: '100%',
|
|
458
458
|
height: '100%',
|
|
459
459
|
minHeight: 300,
|
|
460
|
-
}, reportId:
|
|
460
|
+
}, 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 }))] }))] }));
|
|
461
461
|
}
|
|
@@ -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,317 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useOnClickOutside } from '../hooks';
|
|
3
|
+
import { LoadingSpinner } from './UiComponents';
|
|
4
|
+
import React, { useContext,
|
|
5
|
+
// useEffect,
|
|
6
|
+
useMemo, useRef, useState, } from 'react';
|
|
7
|
+
import { ThemeContext } from '../Context';
|
|
8
|
+
/**
|
|
9
|
+
* A robust select component that implements the new minimal Select interface.
|
|
10
|
+
*/
|
|
11
|
+
export function QuillMultiSelectSectionList({ options, width, onChange, label, sectionHeaderMap, value, isLoading, disabled, emptyLabel, allSelectedLabel, style, owner, }) {
|
|
12
|
+
const [theme] = useContext(ThemeContext);
|
|
13
|
+
// const [selectedOptions, setSelectedOptions] = useState<{[tenantField: string] : string[]}>({});
|
|
14
|
+
const [showModal, setShowModal] = useState(false);
|
|
15
|
+
const modalRef = useRef(null);
|
|
16
|
+
const buttonRef = useRef(null);
|
|
17
|
+
const debounceTimeoutId = useRef(null);
|
|
18
|
+
const [searchQuery, setSearchQuery] = React.useState('');
|
|
19
|
+
// const [exceedsLimit, setExceedsLimit] = useState(false);
|
|
20
|
+
useOnClickOutside(modalRef, (event) => {
|
|
21
|
+
if (!buttonRef.current?.contains(event.target))
|
|
22
|
+
setShowModal(false);
|
|
23
|
+
}, showModal);
|
|
24
|
+
const debounce = (updatedChangeEvent) => {
|
|
25
|
+
if (debounceTimeoutId.current) {
|
|
26
|
+
clearTimeout(debounceTimeoutId.current);
|
|
27
|
+
}
|
|
28
|
+
debounceTimeoutId.current = setTimeout(() => {
|
|
29
|
+
onChange(updatedChangeEvent);
|
|
30
|
+
}, 200);
|
|
31
|
+
};
|
|
32
|
+
const optionsLength = React.useMemo(() => {
|
|
33
|
+
return Object.values(options).reduce((a, b) => a + b.length, 0);
|
|
34
|
+
}, [options]);
|
|
35
|
+
const filteredItems = React.useMemo(() => {
|
|
36
|
+
if (searchQuery === '') {
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
39
|
+
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}$/;
|
|
40
|
+
// Get the first element of the first non-empty array
|
|
41
|
+
const sample = Object.values(options).find((arr) => arr.length > 0)?.[0];
|
|
42
|
+
if (!sample) {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
const isUuid = sample.value?.match(uuidRegex);
|
|
46
|
+
const isNumber = !isNaN(parseInt(sample.value));
|
|
47
|
+
const filteredOptions = Object.keys(options).reduce((acc, key) => {
|
|
48
|
+
acc[key] = options[key]?.filter((option) => {
|
|
49
|
+
if (!option) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return option.label
|
|
53
|
+
.toLowerCase()
|
|
54
|
+
.replace(/\s+/g, '')
|
|
55
|
+
.includes(searchQuery.toLowerCase().replace(/\s+/g, ''))
|
|
56
|
+
|| (isNumber || isUuid ? option.value
|
|
57
|
+
.toLowerCase()
|
|
58
|
+
.replace(/\s+/g, '')
|
|
59
|
+
.includes(searchQuery.toLowerCase().replace(/\s+/g, '')) : false);
|
|
60
|
+
}) ?? [];
|
|
61
|
+
return acc;
|
|
62
|
+
}, {});
|
|
63
|
+
const sliceSize = Math.ceil(20 / Object.keys(filteredOptions).length);
|
|
64
|
+
Object.keys(filteredOptions).forEach((key) => {
|
|
65
|
+
if (filteredOptions[key]) {
|
|
66
|
+
filteredOptions[key] = filteredOptions[key].slice(0, sliceSize);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return Object.fromEntries(Object.entries(filteredOptions).filter(([, value]) => !!value?.length).sort(([key]) => key === owner ? -1 : 1));
|
|
70
|
+
}, [options, searchQuery]);
|
|
71
|
+
const filteredLength = React.useMemo(() => {
|
|
72
|
+
return Object.values(filteredItems).reduce((a, b) => a + b.length, 0);
|
|
73
|
+
}, [filteredItems]);
|
|
74
|
+
const selectedOptionsLabel = useMemo(() => {
|
|
75
|
+
const valuesLength = Object.values(value).reduce((a, b) => a + b.length, 0);
|
|
76
|
+
if (!valuesLength) {
|
|
77
|
+
return 'Select';
|
|
78
|
+
}
|
|
79
|
+
const selectedOptionsLabels = Object.keys(value).map((key) => {
|
|
80
|
+
const matchingOptions = options[key]?.filter((elem) => value[key]?.includes(elem.value)) ?? [];
|
|
81
|
+
if (matchingOptions.length === 0) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
if (matchingOptions.length !== value[key]?.length) {
|
|
85
|
+
return value[key]?.join(', ') ?? null;
|
|
86
|
+
}
|
|
87
|
+
return matchingOptions
|
|
88
|
+
.map((elem) => elem.label)
|
|
89
|
+
.join(', ');
|
|
90
|
+
});
|
|
91
|
+
if (selectedOptionsLabels.length === optionsLength && allSelectedLabel) {
|
|
92
|
+
return allSelectedLabel;
|
|
93
|
+
}
|
|
94
|
+
return selectedOptionsLabels.filter((label) => label !== null).join(', ');
|
|
95
|
+
}, [options, value]);
|
|
96
|
+
return (_jsxs("div", { style: {
|
|
97
|
+
position: 'relative',
|
|
98
|
+
borderRadius: '6px',
|
|
99
|
+
width: width,
|
|
100
|
+
minWidth: width,
|
|
101
|
+
...style
|
|
102
|
+
}, children: [label && (_jsx("div", { style: {
|
|
103
|
+
fontSize: 14,
|
|
104
|
+
color: theme?.secondaryTextColor,
|
|
105
|
+
fontFamily: theme?.fontFamily,
|
|
106
|
+
paddingBottom: 5,
|
|
107
|
+
fontWeight: 600,
|
|
108
|
+
}, children: label })), _jsxs("button", { style: {
|
|
109
|
+
fontFamily: theme?.fontFamily,
|
|
110
|
+
color: theme?.primaryTextColor,
|
|
111
|
+
width: '100%',
|
|
112
|
+
display: 'flex',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
justifyContent: 'space-between',
|
|
115
|
+
fontWeight: 'inherit',
|
|
116
|
+
lineHeight: 'inherit',
|
|
117
|
+
padding: '8px 12px',
|
|
118
|
+
fontSize: 14,
|
|
119
|
+
margin: 0,
|
|
120
|
+
boxSizing: 'border-box',
|
|
121
|
+
borderWidth: 1,
|
|
122
|
+
borderStyle: 'solid',
|
|
123
|
+
borderColor: theme?.borderColor,
|
|
124
|
+
borderRadius: 6,
|
|
125
|
+
paddingTop: 9,
|
|
126
|
+
paddingBottom: 9,
|
|
127
|
+
height: 40,
|
|
128
|
+
minHeight: 40,
|
|
129
|
+
maxHeight: 40,
|
|
130
|
+
}, className: 'quill-select-button', onClick: () => setShowModal((showModal) => !showModal), disabled: disabled, ref: buttonRef, children: [_jsx("style", { children: ` .quill-select-button { background: ${theme?.backgroundColor}; }
|
|
131
|
+
.quill-select-button:hover { background: ${theme?.hoverBackgroundColor}; }
|
|
132
|
+
.quill-select-button:disabled {
|
|
133
|
+
cursor: not-allowed;
|
|
134
|
+
background: ${theme?.hoverBackgroundColor};
|
|
135
|
+
}
|
|
136
|
+
` }), _jsx("span", { style: {
|
|
137
|
+
textOverflow: 'ellipsis',
|
|
138
|
+
whiteSpace: 'nowrap',
|
|
139
|
+
overflow: 'hidden',
|
|
140
|
+
width: '100%',
|
|
141
|
+
textAlign: 'left',
|
|
142
|
+
zIndex: 1,
|
|
143
|
+
}, children: selectedOptionsLabel }), _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: _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 && (_jsxs("div", { style: {
|
|
144
|
+
position: 'absolute',
|
|
145
|
+
width: '100%',
|
|
146
|
+
display: 'flex',
|
|
147
|
+
flexDirection: 'column',
|
|
148
|
+
boxSizing: 'border-box',
|
|
149
|
+
borderWidth: 1,
|
|
150
|
+
borderStyle: 'solid',
|
|
151
|
+
borderColor: theme?.borderColor,
|
|
152
|
+
borderRadius: 6,
|
|
153
|
+
background: 'white',
|
|
154
|
+
marginTop: 12,
|
|
155
|
+
zIndex: 100,
|
|
156
|
+
padding: 6,
|
|
157
|
+
fontFamily: theme?.fontFamily,
|
|
158
|
+
maxHeight: '50vh',
|
|
159
|
+
overflow: 'scroll',
|
|
160
|
+
fontSize: 14,
|
|
161
|
+
}, ref: modalRef, children: [options && optionsLength > 20 && (_jsxs(_Fragment, { children: [_jsx(ListboxTextInput, { value: searchQuery, placeholder: "Search", onChange: (value) => {
|
|
162
|
+
setSearchQuery(value);
|
|
163
|
+
} }), _jsx("div", { style: {
|
|
164
|
+
height: 9,
|
|
165
|
+
width: 230,
|
|
166
|
+
borderTop: '1px solid #e7e7e7',
|
|
167
|
+
} })] })), !isLoading &&
|
|
168
|
+
(!filteredItems || filteredLength === 0) && (_jsxs("div", { style: {
|
|
169
|
+
display: 'flex',
|
|
170
|
+
alignItems: 'center',
|
|
171
|
+
padding: 8,
|
|
172
|
+
margin: 0,
|
|
173
|
+
boxSizing: 'border-box',
|
|
174
|
+
borderWidth: 0,
|
|
175
|
+
fontSize: 14,
|
|
176
|
+
borderStyle: 'solid',
|
|
177
|
+
borderColor: theme?.borderColor,
|
|
178
|
+
borderRadius: 4,
|
|
179
|
+
fontFamily: theme?.fontFamily,
|
|
180
|
+
textOverflow: 'ellipsis',
|
|
181
|
+
whiteSpace: 'nowrap',
|
|
182
|
+
height: 34,
|
|
183
|
+
minHeight: 34,
|
|
184
|
+
gap: 6,
|
|
185
|
+
overflow: 'hidden',
|
|
186
|
+
}, children: [_jsx("style", { children: `
|
|
187
|
+
.quill-option {
|
|
188
|
+
background: white;
|
|
189
|
+
}
|
|
190
|
+
.quill-option:hover {
|
|
191
|
+
background: #F4F4F5;
|
|
192
|
+
}
|
|
193
|
+
` }), _jsx("span", { style: {
|
|
194
|
+
textOverflow: 'ellipsis',
|
|
195
|
+
whiteSpace: 'nowrap',
|
|
196
|
+
overflow: 'hidden',
|
|
197
|
+
cursor: 'default',
|
|
198
|
+
}, children: emptyLabel ?? 'No options available' })] })), !isLoading ? Object.keys(filteredItems).map((key) => (_jsxs(_Fragment, { children: [_jsxs("button", { style: {
|
|
199
|
+
display: 'flex',
|
|
200
|
+
alignItems: 'center',
|
|
201
|
+
padding: 8,
|
|
202
|
+
margin: 0,
|
|
203
|
+
boxSizing: 'border-box',
|
|
204
|
+
borderWidth: 0,
|
|
205
|
+
fontSize: 14,
|
|
206
|
+
borderStyle: 'solid',
|
|
207
|
+
borderColor: theme?.borderColor,
|
|
208
|
+
borderRadius: 4,
|
|
209
|
+
fontFamily: theme?.fontFamily,
|
|
210
|
+
textOverflow: 'ellipsis',
|
|
211
|
+
whiteSpace: 'nowrap',
|
|
212
|
+
height: 34,
|
|
213
|
+
minHeight: 34,
|
|
214
|
+
gap: 6,
|
|
215
|
+
overflow: 'hidden',
|
|
216
|
+
}, className: "quill-option", onClick: () => {
|
|
217
|
+
const updatedValue = filteredItems[key]?.length === value[key]?.length
|
|
218
|
+
? [] : filteredItems[key]?.map((option) => option.value) ?? [];
|
|
219
|
+
const updatedChangeEvent = {
|
|
220
|
+
target: {
|
|
221
|
+
value: {
|
|
222
|
+
...value,
|
|
223
|
+
[key]: updatedValue,
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
// setSelectedOptions(updatedValue);
|
|
228
|
+
debounce(updatedChangeEvent);
|
|
229
|
+
}, children: [_jsx("style", { children: `
|
|
230
|
+
.quill-option {
|
|
231
|
+
background: white;
|
|
232
|
+
}
|
|
233
|
+
.quill-option:hover {
|
|
234
|
+
background: #F4F4F5;
|
|
235
|
+
}
|
|
236
|
+
` }), _jsx("input", { type: "checkbox", checked: filteredItems[key]?.length === value[key]?.length, style: { width: '14px', height: '14px', margin: 'auto 0' }, readOnly: true }), _jsx("span", { style: {
|
|
237
|
+
textOverflow: 'ellipsis',
|
|
238
|
+
whiteSpace: 'nowrap',
|
|
239
|
+
overflow: 'hidden',
|
|
240
|
+
fontWeight: 600,
|
|
241
|
+
}, children: sectionHeaderMap?.[key] ?? key })] }, "section-header-" + key), _jsx("div", { style: {
|
|
242
|
+
height: 1,
|
|
243
|
+
borderTop: '1px solid #e7e7e7',
|
|
244
|
+
marginTop: 2,
|
|
245
|
+
marginBottom: 2,
|
|
246
|
+
} }), filteredItems[key]?.map((option) => (_jsxs("button", { style: {
|
|
247
|
+
display: 'flex',
|
|
248
|
+
alignItems: 'center',
|
|
249
|
+
padding: 8,
|
|
250
|
+
paddingLeft: 16,
|
|
251
|
+
margin: 0,
|
|
252
|
+
boxSizing: 'border-box',
|
|
253
|
+
borderWidth: 0,
|
|
254
|
+
fontSize: 14,
|
|
255
|
+
borderStyle: 'solid',
|
|
256
|
+
borderColor: theme?.borderColor,
|
|
257
|
+
borderRadius: 4,
|
|
258
|
+
fontFamily: theme?.fontFamily,
|
|
259
|
+
textOverflow: 'ellipsis',
|
|
260
|
+
whiteSpace: 'nowrap',
|
|
261
|
+
height: 34,
|
|
262
|
+
minHeight: 34,
|
|
263
|
+
gap: 6,
|
|
264
|
+
overflow: 'hidden',
|
|
265
|
+
}, className: "quill-option", onClick: () => {
|
|
266
|
+
const updatedValue = value[key]?.includes(option.value)
|
|
267
|
+
? value[key]?.filter((val) => val !== option.value)
|
|
268
|
+
: [...(value[key] ?? []), option.value];
|
|
269
|
+
const updatedChangeEvent = {
|
|
270
|
+
target: {
|
|
271
|
+
value: {
|
|
272
|
+
...value,
|
|
273
|
+
[key]: updatedValue,
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
// setSelectedOptions(updatedValue);
|
|
278
|
+
debounce(updatedChangeEvent);
|
|
279
|
+
}, children: [_jsx("style", { children: `
|
|
280
|
+
.quill-option {
|
|
281
|
+
background: white;
|
|
282
|
+
}
|
|
283
|
+
.quill-option:hover {
|
|
284
|
+
background: #F4F4F5;
|
|
285
|
+
}
|
|
286
|
+
` }), _jsx("input", { type: "checkbox", checked: value[key]?.includes(option.value), style: { width: '14px', height: '14px', margin: 'auto 0' }, readOnly: true }), _jsx("span", { style: {
|
|
287
|
+
textOverflow: 'ellipsis',
|
|
288
|
+
whiteSpace: 'nowrap',
|
|
289
|
+
overflow: 'hidden',
|
|
290
|
+
}, children: option.label })] }, "value-" + key + "-" + option.value)))] }))) : (_jsx("div", { children: _jsx(LoadingSpinner, {}) }))] }))] }));
|
|
291
|
+
}
|
|
292
|
+
export const ListboxTextInput = ({ value, onChange, placeholder, }) => {
|
|
293
|
+
return (_jsxs("div", { style: {
|
|
294
|
+
position: 'relative',
|
|
295
|
+
display: 'flex',
|
|
296
|
+
flexDirection: 'row',
|
|
297
|
+
alignItems: 'center',
|
|
298
|
+
marginTop: 2,
|
|
299
|
+
}, children: [_jsx("style", { children: `
|
|
300
|
+
.quill-text-input {
|
|
301
|
+
background-color: white;
|
|
302
|
+
height: 40px;
|
|
303
|
+
width: 145px;
|
|
304
|
+
z-index: 2;
|
|
305
|
+
color: #384151;
|
|
306
|
+
border-radius: 4px;
|
|
307
|
+
text-align: left;
|
|
308
|
+
padding-top: 0px;
|
|
309
|
+
padding-bottom: 0px;
|
|
310
|
+
box-sizing: content-box;
|
|
311
|
+
margin-left: 6px;
|
|
312
|
+
border: 0 solid #e5e7eb;
|
|
313
|
+
}
|
|
314
|
+
.quill-text-input:focus {
|
|
315
|
+
outline: none;
|
|
316
|
+
}` }), _jsx("div", { style: { width: 6 } }), _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: _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" }) }), _jsx("input", { className: "quill-text-input", type: "text", value: value, onChange: (event) => onChange(event.target.value), placeholder: placeholder })] }));
|
|
317
|
+
};
|
|
@@ -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"}
|
|
@@ -6,7 +6,7 @@ import { ThemeContext } from '../Context';
|
|
|
6
6
|
/**
|
|
7
7
|
* A robust select component that implements the new minimal Select interface.
|
|
8
8
|
*/
|
|
9
|
-
export function QuillMultiSelectComponentWithCombo({ options, width, onChange, label, value, isLoading, disabled, emptyLabel, allSelectedLabel, }) {
|
|
9
|
+
export function QuillMultiSelectComponentWithCombo({ options, width, onChange, label, value, isLoading, disabled, emptyLabel, allSelectedLabel, style, }) {
|
|
10
10
|
const [theme] = useContext(ThemeContext);
|
|
11
11
|
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
12
12
|
const [showModal, setShowModal] = useState(false);
|
|
@@ -94,8 +94,8 @@ export function QuillMultiSelectComponentWithCombo({ options, width, onChange, l
|
|
|
94
94
|
// But they don't have their proper labels, since we haven't stored/passed in the label
|
|
95
95
|
const filteredItems = React.useMemo(() => {
|
|
96
96
|
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}$/;
|
|
97
|
-
const isUuid = potentialOptions[0]?.value?.match(uuidRegex);
|
|
98
|
-
const isNumber = !isNaN(parseInt(potentialOptions[0]?.value ?? ''));
|
|
97
|
+
const isUuid = potentialOptions?.[0]?.value?.toString()?.match(uuidRegex);
|
|
98
|
+
const isNumber = !isNaN(parseInt(potentialOptions?.[0]?.value ?? ''));
|
|
99
99
|
// Sort null to top
|
|
100
100
|
if (searchQuery === '') {
|
|
101
101
|
return potentialOptions
|
|
@@ -143,6 +143,7 @@ export function QuillMultiSelectComponentWithCombo({ options, width, onChange, l
|
|
|
143
143
|
borderRadius: '6px',
|
|
144
144
|
width: width,
|
|
145
145
|
minWidth: width,
|
|
146
|
+
...style
|
|
146
147
|
}, children: [label && (_jsx("div", { style: {
|
|
147
148
|
fontSize: 14,
|
|
148
149
|
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"}
|