@quillsql/react 2.13.48 → 2.13.50
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 +2 -2
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +31 -43
- package/dist/cjs/ChartBuilder.d.ts +2 -2
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +172 -147
- package/dist/cjs/ChartEditor.d.ts +2 -2
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +3 -1
- package/dist/cjs/Context.d.ts +10 -3
- package/dist/cjs/Context.d.ts.map +1 -1
- package/dist/cjs/Context.js +328 -250
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +12 -25
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.js +32 -14
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts +24 -10
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.js +472 -96
- package/dist/cjs/QuillProvider.d.ts +7 -1
- package/dist/cjs/QuillProvider.d.ts.map +1 -1
- package/dist/cjs/QuillProvider.js +6 -5
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +23 -11
- package/dist/cjs/SQLEditor.d.ts +1 -1
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +52 -18
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/Table.js +20 -7
- package/dist/cjs/assets/ExclamationFilledIcon.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.js +4 -2
- package/dist/cjs/components/Chart/BarList.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarList.js +2 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.d.ts +1 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.d.ts.map +1 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.js +7 -6
- package/dist/cjs/components/Chart/GaugeChart.d.ts +1 -1
- package/dist/cjs/components/Chart/GaugeChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/GaugeChart.js +62 -35
- package/dist/cjs/components/Chart/InternalChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/InternalChart.js +32 -34
- package/dist/cjs/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/LineChart.js +5 -2
- package/dist/cjs/components/Chart/MapChart.d.ts +3 -3
- package/dist/cjs/components/Chart/MapChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/MapChart.js +62 -34
- package/dist/cjs/components/Chart/PieChart.d.ts +3 -1
- package/dist/cjs/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/PieChart.js +82 -40
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardFilter.js +4 -20
- package/dist/cjs/components/Dashboard/DashboardTemplate.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardTemplate.js +2 -1
- package/dist/cjs/components/Dashboard/DataLoader.d.ts +4 -4
- package/dist/cjs/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DataLoader.js +31 -14
- package/dist/cjs/components/Dashboard/MetricComponent.js +4 -3
- package/dist/cjs/components/Dashboard/util.d.ts +1 -1
- package/dist/cjs/components/Dashboard/util.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/util.js +7 -6
- package/dist/cjs/components/QuillMultiSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelect.js +15 -9
- package/dist/cjs/components/QuillMultiSelectSectionList.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectSectionList.js +52 -34
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectWithCombo.js +204 -171
- package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelect.js +93 -82
- package/dist/cjs/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelectWithCombo.js +101 -99
- package/dist/cjs/components/QuillTable.d.ts.map +1 -1
- package/dist/cjs/components/QuillTable.js +1 -0
- package/dist/cjs/components/ReportBuilder/FilterStack.d.ts +2 -1
- package/dist/cjs/components/ReportBuilder/FilterStack.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/FilterStack.js +3 -4
- package/dist/cjs/components/ReportBuilder/ui.d.ts +2 -2
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +5 -7
- package/dist/cjs/components/UiComponents.d.ts +7 -0
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +92 -5
- package/dist/cjs/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/cjs/hooks/useAskQuill.js +5 -1
- package/dist/cjs/hooks/useDashboard.d.ts.map +1 -1
- package/dist/cjs/hooks/useDashboard.js +96 -58
- package/dist/cjs/hooks/useExport.d.ts.map +1 -1
- package/dist/cjs/hooks/useExport.js +23 -13
- package/dist/cjs/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/cjs/hooks/useQuill.d.ts.map +1 -1
- package/dist/cjs/hooks/useQuill.js +8 -10
- package/dist/cjs/hooks/useReport.d.ts.map +1 -1
- package/dist/cjs/hooks/useVirtualTables.d.ts.map +1 -1
- package/dist/cjs/hooks/useVirtualTables.js +16 -22
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -1
- 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 +19 -7
- package/dist/cjs/models/Client.d.ts +0 -1
- package/dist/cjs/models/Client.d.ts.map +1 -1
- package/dist/cjs/models/Data.d.ts +20 -0
- package/dist/cjs/models/Data.d.ts.map +1 -0
- package/dist/cjs/models/Data.js +2 -0
- package/dist/cjs/models/Filter.d.ts +42 -4
- package/dist/cjs/models/Filter.d.ts.map +1 -1
- package/dist/cjs/models/Pivot.d.ts.map +1 -1
- package/dist/cjs/utils/astProcessing.d.ts +3 -2
- package/dist/cjs/utils/astProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/astProcessing.js +28 -37
- package/dist/cjs/utils/client.d.ts +3 -2
- package/dist/cjs/utils/client.d.ts.map +1 -1
- package/dist/cjs/utils/client.js +38 -39
- package/dist/cjs/utils/columnProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/columnProcessing.js +14 -3
- package/dist/cjs/utils/constants.d.ts +1 -0
- package/dist/cjs/utils/constants.d.ts.map +1 -1
- package/dist/cjs/utils/constants.js +2 -1
- package/dist/cjs/utils/dashboard.d.ts +3 -2
- package/dist/cjs/utils/dashboard.d.ts.map +1 -1
- package/dist/cjs/utils/dashboard.js +30 -12
- package/dist/cjs/utils/dataFetcher.d.ts +8 -5
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +188 -65
- package/dist/cjs/utils/filterProcessing.d.ts +2 -1
- package/dist/cjs/utils/filterProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/filterProcessing.js +24 -38
- package/dist/cjs/utils/getDomain.d.ts.map +1 -1
- package/dist/cjs/utils/pivotConstructor.d.ts +2 -1
- package/dist/cjs/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/cjs/utils/pivotConstructor.js +15 -11
- package/dist/cjs/utils/pivotProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/pivotProcessing.js +3 -5
- package/dist/cjs/utils/queryConstructor.js +1 -1
- package/dist/cjs/utils/report.d.ts +10 -7
- package/dist/cjs/utils/report.d.ts.map +1 -1
- package/dist/cjs/utils/report.js +52 -60
- package/dist/cjs/utils/schema.d.ts +4 -3
- package/dist/cjs/utils/schema.d.ts.map +1 -1
- package/dist/cjs/utils/schema.js +30 -44
- package/dist/cjs/utils/tableProcessing.d.ts +16 -10
- package/dist/cjs/utils/tableProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/tableProcessing.js +91 -90
- package/dist/cjs/utils/textProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/textProcessing.js +2 -1
- package/dist/cjs/utils/ui.d.ts.map +1 -1
- package/dist/esm/Chart.d.ts +2 -2
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +33 -45
- package/dist/esm/ChartBuilder.d.ts +2 -2
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +173 -148
- package/dist/esm/ChartEditor.d.ts +2 -2
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +4 -2
- package/dist/esm/Context.d.ts +10 -3
- package/dist/esm/Context.d.ts.map +1 -1
- package/dist/esm/Context.js +330 -252
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +14 -27
- package/dist/esm/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/QuillDateRangePicker.js +32 -14
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts +24 -10
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/dateRangePickerUtils.js +471 -95
- package/dist/esm/QuillProvider.d.ts +7 -1
- package/dist/esm/QuillProvider.d.ts.map +1 -1
- package/dist/esm/QuillProvider.js +6 -5
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +25 -13
- package/dist/esm/SQLEditor.d.ts +1 -1
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +55 -21
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/Table.js +21 -8
- package/dist/esm/assets/ExclamationFilledIcon.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.js +4 -2
- package/dist/esm/components/Chart/BarList.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarList.js +2 -1
- package/dist/esm/components/Chart/CustomReferenceLine.d.ts +1 -1
- package/dist/esm/components/Chart/CustomReferenceLine.d.ts.map +1 -1
- package/dist/esm/components/Chart/CustomReferenceLine.js +8 -7
- package/dist/esm/components/Chart/GaugeChart.d.ts +1 -1
- package/dist/esm/components/Chart/GaugeChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/GaugeChart.js +64 -37
- package/dist/esm/components/Chart/InternalChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/InternalChart.js +34 -36
- package/dist/esm/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/LineChart.js +5 -2
- package/dist/esm/components/Chart/MapChart.d.ts +3 -3
- package/dist/esm/components/Chart/MapChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/MapChart.js +67 -39
- package/dist/esm/components/Chart/PieChart.d.ts +3 -1
- package/dist/esm/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/PieChart.js +82 -40
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardFilter.js +5 -21
- package/dist/esm/components/Dashboard/DashboardSection.js +2 -2
- package/dist/esm/components/Dashboard/DashboardTemplate.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardTemplate.js +3 -2
- package/dist/esm/components/Dashboard/DataLoader.d.ts +4 -4
- package/dist/esm/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DataLoader.js +32 -15
- package/dist/esm/components/Dashboard/MetricComponent.js +4 -3
- package/dist/esm/components/Dashboard/util.d.ts +1 -1
- package/dist/esm/components/Dashboard/util.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/util.js +8 -7
- package/dist/esm/components/QuillMultiSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelect.js +15 -9
- package/dist/esm/components/QuillMultiSelectSectionList.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectSectionList.js +52 -34
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectWithCombo.js +205 -172
- package/dist/esm/components/QuillSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillSelect.js +95 -84
- package/dist/esm/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillSelectWithCombo.js +102 -100
- package/dist/esm/components/QuillTable.d.ts.map +1 -1
- package/dist/esm/components/QuillTable.js +1 -0
- package/dist/esm/components/ReportBuilder/FilterStack.d.ts +2 -1
- package/dist/esm/components/ReportBuilder/FilterStack.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/FilterStack.js +3 -4
- package/dist/esm/components/ReportBuilder/ui.d.ts +2 -2
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +5 -7
- package/dist/esm/components/UiComponents.d.ts +7 -0
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +90 -4
- package/dist/esm/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/esm/hooks/useAskQuill.js +6 -2
- package/dist/esm/hooks/useDashboard.d.ts.map +1 -1
- package/dist/esm/hooks/useDashboard.js +98 -60
- package/dist/esm/hooks/useExport.d.ts.map +1 -1
- package/dist/esm/hooks/useExport.js +25 -15
- package/dist/esm/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/esm/hooks/useQuill.d.ts.map +1 -1
- package/dist/esm/hooks/useQuill.js +9 -11
- package/dist/esm/hooks/useReport.d.ts.map +1 -1
- package/dist/esm/hooks/useReport.js +1 -1
- package/dist/esm/hooks/useVirtualTables.d.ts.map +1 -1
- package/dist/esm/hooks/useVirtualTables.js +17 -23
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- 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 +20 -8
- package/dist/esm/models/Client.d.ts +0 -1
- package/dist/esm/models/Client.d.ts.map +1 -1
- package/dist/esm/models/Data.d.ts +20 -0
- package/dist/esm/models/Data.d.ts.map +1 -0
- package/dist/esm/models/Data.js +1 -0
- package/dist/esm/models/Filter.d.ts +42 -4
- package/dist/esm/models/Filter.d.ts.map +1 -1
- package/dist/esm/models/Pivot.d.ts.map +1 -1
- package/dist/esm/utils/astProcessing.d.ts +3 -2
- package/dist/esm/utils/astProcessing.d.ts.map +1 -1
- package/dist/esm/utils/astProcessing.js +28 -37
- package/dist/esm/utils/client.d.ts +3 -2
- package/dist/esm/utils/client.d.ts.map +1 -1
- package/dist/esm/utils/client.js +38 -39
- package/dist/esm/utils/columnProcessing.d.ts.map +1 -1
- package/dist/esm/utils/columnProcessing.js +14 -3
- package/dist/esm/utils/constants.d.ts +1 -0
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +1 -0
- package/dist/esm/utils/dashboard.d.ts +3 -2
- package/dist/esm/utils/dashboard.d.ts.map +1 -1
- package/dist/esm/utils/dashboard.js +31 -13
- package/dist/esm/utils/dataFetcher.d.ts +8 -5
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +186 -65
- package/dist/esm/utils/filterProcessing.d.ts +2 -1
- package/dist/esm/utils/filterProcessing.d.ts.map +1 -1
- package/dist/esm/utils/filterProcessing.js +25 -39
- package/dist/esm/utils/getDomain.d.ts.map +1 -1
- package/dist/esm/utils/pivotConstructor.d.ts +2 -1
- package/dist/esm/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/esm/utils/pivotConstructor.js +16 -12
- package/dist/esm/utils/pivotProcessing.d.ts.map +1 -1
- package/dist/esm/utils/pivotProcessing.js +5 -7
- package/dist/esm/utils/queryConstructor.js +1 -1
- package/dist/esm/utils/report.d.ts +10 -7
- package/dist/esm/utils/report.d.ts.map +1 -1
- package/dist/esm/utils/report.js +53 -61
- package/dist/esm/utils/schema.d.ts +4 -3
- package/dist/esm/utils/schema.d.ts.map +1 -1
- package/dist/esm/utils/schema.js +30 -44
- package/dist/esm/utils/tableProcessing.d.ts +16 -10
- package/dist/esm/utils/tableProcessing.d.ts.map +1 -1
- package/dist/esm/utils/tableProcessing.js +93 -92
- package/dist/esm/utils/textProcessing.d.ts.map +1 -1
- package/dist/esm/utils/textProcessing.js +2 -1
- package/dist/esm/utils/ui.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { ClientContext, DashboardFiltersContext, ReportFiltersContext, ReportsContext, SchemaDataContext, TenantContext, } from '../../Context';
|
|
3
|
+
import { ClientContext, DashboardFiltersContext, FetchContext, ReportFiltersContext, ReportsContext, SchemaDataContext, TenantContext, } from '../../Context';
|
|
4
4
|
import { convertInternalReportToReport, EMPTY_INTERNAL_REPORT, fetchReport, fetchReportRowCount, } from '../../utils/report';
|
|
5
5
|
import { shouldFetchMore, DEFAULT_PAGINATION, shouldSortInMemory, } from '../../utils/paginationProcessing';
|
|
6
6
|
import { fetchResultsByReport, } from '../../utils/tableProcessing';
|
|
@@ -33,9 +33,13 @@ function filterValuesEquivalent(filters1, filters2) {
|
|
|
33
33
|
// Find the odd filters out and return false ONLY if they have a selected value or are a date filter
|
|
34
34
|
const filters1Labels = filters1.map((f) => f.label);
|
|
35
35
|
const filters2Labels = filters2.map((f) => f.label);
|
|
36
|
-
const oddFilters = filters1Labels.length > filters2Labels.length
|
|
36
|
+
const oddFilters = filters1Labels.length > filters2Labels.length
|
|
37
|
+
? filters1Labels.filter((label) => !filters2Labels.includes(label))
|
|
38
|
+
: filters2Labels.filter((label) => !filters1Labels.includes(label));
|
|
37
39
|
for (const filter of oddFilters) {
|
|
38
|
-
const filter1 = filters1Labels.length > filters2Labels.length
|
|
40
|
+
const filter1 = filters1Labels.length > filters2Labels.length
|
|
41
|
+
? filters1.find((f) => f.label === filter)
|
|
42
|
+
: filters2.find((f) => f.label === filter);
|
|
39
43
|
if (filter1?.selectedValue || filter1?.startDate || filter1?.endDate) {
|
|
40
44
|
return false;
|
|
41
45
|
}
|
|
@@ -157,13 +161,14 @@ function userFilterValuesEquivalent(filters1, filters2) {
|
|
|
157
161
|
function customFieldsEquivalent(customFields1, customFields2) {
|
|
158
162
|
return equal(customFields1, customFields2);
|
|
159
163
|
}
|
|
160
|
-
export default function DataLoader({ item, children, filters, userFilters, additionalProcessing: defaultAdditionalProcessing, dashboardName,
|
|
164
|
+
export default function DataLoader({ item, children, filters, userFilters, additionalProcessing: defaultAdditionalProcessing, dashboardName, propagateChanges, }) {
|
|
161
165
|
const [client] = useContext(ClientContext);
|
|
162
|
-
const { dashboardReports: dashboard, addReport, updateReport } = useDashboardReports(dashboardName);
|
|
166
|
+
const { dashboardReports: dashboard, addReport, updateReport, } = useDashboardReports(dashboardName);
|
|
163
167
|
const { dashboardFilters } = useContext(DashboardFiltersContext);
|
|
164
168
|
const { tenants, flags } = useContext(TenantContext);
|
|
165
169
|
const { reports, reportsDispatch, fetchIndividualReport } = useContext(ReportsContext);
|
|
166
170
|
const { reportFilters } = useContext(ReportFiltersContext);
|
|
171
|
+
const { getToken } = useContext(FetchContext);
|
|
167
172
|
const contextFilters = useMemo(() => {
|
|
168
173
|
return dashboardName
|
|
169
174
|
? Object.values(dashboardFilters[dashboardName] ?? {}).map((f) => f.filter)
|
|
@@ -210,7 +215,7 @@ export default function DataLoader({ item, children, filters, userFilters, addit
|
|
|
210
215
|
rowCountAbortController.current?.abort();
|
|
211
216
|
rowCountAbortController.current = new AbortController();
|
|
212
217
|
try {
|
|
213
|
-
const rowCount = await fetchReportRowCount(item.id, client, tenants, flags, true, filters.concat(userFilters ?? []), processing, schemaData.customFields, rowCountAbortController.current.signal);
|
|
218
|
+
const rowCount = await fetchReportRowCount(item.id, client, getToken, tenants, flags, true, filters.concat(userFilters ?? []), processing, schemaData.customFields, rowCountAbortController.current.signal);
|
|
214
219
|
rowCountAbortController.current = null;
|
|
215
220
|
if (rowCount) {
|
|
216
221
|
if (dashboardName) {
|
|
@@ -281,8 +286,7 @@ export default function DataLoader({ item, children, filters, userFilters, addit
|
|
|
281
286
|
const updatedProcessing = { ...additionalProcessing, ...processing };
|
|
282
287
|
const pivotQuery = (dashboardName ? dashboard : reports)[item.id]
|
|
283
288
|
?.pivotQuery;
|
|
284
|
-
const comparisonPivotQuery = (dashboardName ? dashboard : reports)[item.id]
|
|
285
|
-
?.comparisonPivotQuery;
|
|
289
|
+
const comparisonPivotQuery = (dashboardName ? dashboard : reports)[item.id]?.comparisonPivotQuery;
|
|
286
290
|
const paginatedRows = await fetchResultsByReport({
|
|
287
291
|
reportId: item.id,
|
|
288
292
|
client,
|
|
@@ -296,6 +300,7 @@ export default function DataLoader({ item, children, filters, userFilters, addit
|
|
|
296
300
|
pivotQuery,
|
|
297
301
|
comparisonPivotQuery,
|
|
298
302
|
getPivotRowCount: false,
|
|
303
|
+
getToken,
|
|
299
304
|
});
|
|
300
305
|
updateTableRowsAbortController.current = null;
|
|
301
306
|
if (paginatedRows.error) {
|
|
@@ -367,6 +372,7 @@ export default function DataLoader({ item, children, filters, userFilters, addit
|
|
|
367
372
|
rowsOnly: true,
|
|
368
373
|
rowCountOnly: false,
|
|
369
374
|
abortSignal: rowsAbortController.current.signal,
|
|
375
|
+
getToken,
|
|
370
376
|
});
|
|
371
377
|
addReport({
|
|
372
378
|
...fetchedReport,
|
|
@@ -390,7 +396,7 @@ export default function DataLoader({ item, children, filters, userFilters, addit
|
|
|
390
396
|
additionalProcessing: processing,
|
|
391
397
|
reportAbortController: rowsAbortController.current,
|
|
392
398
|
customFields: schemaData.customFields,
|
|
393
|
-
|
|
399
|
+
propagateChanges,
|
|
394
400
|
});
|
|
395
401
|
rowsAbortController.current = null;
|
|
396
402
|
setError(undefined);
|
|
@@ -425,7 +431,8 @@ export default function DataLoader({ item, children, filters, userFilters, addit
|
|
|
425
431
|
userFilterValuesEquivalent(previousUserFilters.current ?? [], userFilters ?? []) &&
|
|
426
432
|
// tenantsEquivalent(previousTenants.current ?? [], tenants ?? []) &&
|
|
427
433
|
customFieldsEquivalent(previousCustomFields.current, schemaData.customFields) &&
|
|
428
|
-
((dashboardName ? dashboard : reports)[item.id]?.rows !== undefined ||
|
|
434
|
+
((dashboardName ? dashboard : reports)[item.id]?.rows !== undefined ||
|
|
435
|
+
rowsAbortController.current))) {
|
|
429
436
|
if (!rowsAbortController.current && !schemaData.isSchemaLoading)
|
|
430
437
|
setLoading(false);
|
|
431
438
|
return;
|
|
@@ -452,7 +459,10 @@ export default function DataLoader({ item, children, filters, userFilters, addit
|
|
|
452
459
|
else if (tempReport?.error) {
|
|
453
460
|
setError(tempReport.error);
|
|
454
461
|
}
|
|
455
|
-
}, [
|
|
462
|
+
}, [
|
|
463
|
+
(dashboardName ? dashboard : reports)[item.id]?.triggerReload,
|
|
464
|
+
(dashboardName ? dashboard : reports)[item.id]?.error,
|
|
465
|
+
]);
|
|
456
466
|
return (_jsx(_Fragment, { children: children({
|
|
457
467
|
isLoading: loading,
|
|
458
468
|
error,
|
|
@@ -465,10 +475,11 @@ export default function DataLoader({ item, children, filters, userFilters, addit
|
|
|
465
475
|
}
|
|
466
476
|
// The same data-loader pattern as above, but with special logic for charts
|
|
467
477
|
// At some point these may be able to get merged into one function.
|
|
468
|
-
export const ChartDataLoader = ({ item, children, dateBucket, additionalProcessing, filters, userFilters, dashboardName,
|
|
478
|
+
export const ChartDataLoader = ({ item, children, dateBucket, additionalProcessing, filters, userFilters, dashboardName, propagateChanges, }) => {
|
|
469
479
|
const { dashboardReports: dashboard, addReport } = useDashboardReports(dashboardName);
|
|
470
480
|
const { dashboardFilters } = useContext(DashboardFiltersContext);
|
|
471
481
|
const { reports, fetchIndividualReport } = useContext(ReportsContext);
|
|
482
|
+
const { getToken } = useContext(FetchContext);
|
|
472
483
|
const { reportFilters } = useContext(ReportFiltersContext);
|
|
473
484
|
const { tenants, flags } = useContext(TenantContext);
|
|
474
485
|
const contextFilters = useMemo(() => {
|
|
@@ -527,6 +538,7 @@ export const ChartDataLoader = ({ item, children, dateBucket, additionalProcessi
|
|
|
527
538
|
dateBucket,
|
|
528
539
|
customFields: schemaData.customFields,
|
|
529
540
|
abortSignal: fetchReportAbortController.current.signal,
|
|
541
|
+
getToken,
|
|
530
542
|
});
|
|
531
543
|
addReport({
|
|
532
544
|
...report,
|
|
@@ -552,7 +564,7 @@ export const ChartDataLoader = ({ item, children, dateBucket, additionalProcessi
|
|
|
552
564
|
dateBucket,
|
|
553
565
|
reportAbortController: fetchReportAbortController.current,
|
|
554
566
|
customFields: schemaData.customFields,
|
|
555
|
-
|
|
567
|
+
propagateChanges,
|
|
556
568
|
});
|
|
557
569
|
setError(undefined);
|
|
558
570
|
}
|
|
@@ -586,7 +598,9 @@ export const ChartDataLoader = ({ item, children, dateBucket, additionalProcessi
|
|
|
586
598
|
// tenantsEquivalent(tenants ?? [], previousTenants.current ?? []) &&
|
|
587
599
|
previousDateBucket.current === dateBucket &&
|
|
588
600
|
customFieldsEquivalent(previousCustomFields.current, schemaData.customFields) &&
|
|
589
|
-
((dashboardName ? dashboard : reports)[item.id]?.rows?.length !==
|
|
601
|
+
((dashboardName ? dashboard : reports)[item.id]?.rows?.length !==
|
|
602
|
+
undefined ||
|
|
603
|
+
fetchReportAbortController.current))) {
|
|
590
604
|
if (!fetchReportAbortController.current && !schemaData.isSchemaLoading)
|
|
591
605
|
setLoading(false);
|
|
592
606
|
return;
|
|
@@ -614,7 +628,10 @@ export const ChartDataLoader = ({ item, children, dateBucket, additionalProcessi
|
|
|
614
628
|
else if (tempReport?.error) {
|
|
615
629
|
setError(tempReport.error);
|
|
616
630
|
}
|
|
617
|
-
}, [
|
|
631
|
+
}, [
|
|
632
|
+
(dashboardName ? dashboard : reports)[item.id]?.triggerReload,
|
|
633
|
+
(dashboardName ? dashboard : reports)[item.id]?.error,
|
|
634
|
+
]);
|
|
618
635
|
return children({
|
|
619
636
|
isLoading: !chartReport || loading,
|
|
620
637
|
data: chartReport,
|
|
@@ -63,18 +63,19 @@ export default function QuillMetricComponent({ report, onClick, error, isLoading
|
|
|
63
63
|
report.rows[0][report.xAxisField] === null ? (_jsx("div", { style: {
|
|
64
64
|
display: 'flex',
|
|
65
65
|
flex: '1 0 auto',
|
|
66
|
-
height: '100%',
|
|
66
|
+
// height: '100%',
|
|
67
67
|
margin: 'auto',
|
|
68
68
|
justifyContent: 'center',
|
|
69
69
|
alignItems: 'center',
|
|
70
70
|
fontSize: 13,
|
|
71
|
+
fontFamily: theme?.fontFamily,
|
|
71
72
|
color: theme?.secondaryTextColor,
|
|
72
73
|
maxWidth: '100%',
|
|
73
74
|
width: '100%',
|
|
74
75
|
}, children: "No results" })) : (_jsx(MetricDisplay, { dateFilter: dateFilter, primaryMetricLabel: primaryMetricLabel, comparisonLabel: comparisonLabel, theme: theme, children: children }))] }) }) }, report?.name));
|
|
75
76
|
}
|
|
76
77
|
const MetricDisplay = ({ children, dateFilter, primaryMetricLabel, comparisonLabel, theme, }) => {
|
|
77
|
-
return _jsx("div", { style: {
|
|
78
|
+
return (_jsx("div", { style: {
|
|
78
79
|
padding: 0,
|
|
79
80
|
height: '100%',
|
|
80
81
|
width: '100%',
|
|
@@ -127,5 +128,5 @@ const MetricDisplay = ({ children, dateFilter, primaryMetricLabel, comparisonLab
|
|
|
127
128
|
marginLeft: 2,
|
|
128
129
|
}, children: comparisonLabel
|
|
129
130
|
? 'in ' + comparisonLabel.toLowerCase()
|
|
130
|
-
: 'previous period' })] }))] }) });
|
|
131
|
+
: 'previous period' })] }))] }) }));
|
|
131
132
|
};
|
|
@@ -3,5 +3,5 @@ export declare function validateTemplatesAgainstFilters(filters: any[], template
|
|
|
3
3
|
valid: boolean;
|
|
4
4
|
error: string;
|
|
5
5
|
};
|
|
6
|
-
export declare function addTemplatesToDashboard(name: any, newTemplates: any[], client: QuillProviderClient, dashboardData: any): Promise<any>;
|
|
6
|
+
export declare function addTemplatesToDashboard(name: any, newTemplates: any[], client: QuillProviderClient, dashboardData: any, getToken: () => Promise<string>): Promise<any>;
|
|
7
7
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAK1D,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,GAAG,EAAE,EACd,SAAS,EAAE,GAAG,EAAE,GACf;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAiCnC;
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAK1D,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,GAAG,EAAE,EACd,SAAS,EAAE,GAAG,EAAE,GACf;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAiCnC;AAGD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,GAAG,EACT,YAAY,EAAE,GAAG,EAAE,EACnB,MAAM,EAAE,mBAAmB,EAC3B,aAAa,EAAE,GAAG,EAClB,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAC9B,OAAO,CAAC,GAAG,CAAC,CA8Cd"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { quillFetch } from '../../utils/dataFetcher';
|
|
2
2
|
// WARNING: all of this template code is stale and PROBABLY BROKEN
|
|
3
3
|
export function validateTemplatesAgainstFilters(filters, templates) {
|
|
4
4
|
let error = '';
|
|
@@ -35,23 +35,24 @@ export function validateTemplatesAgainstFilters(filters, templates) {
|
|
|
35
35
|
return { valid: false, error };
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
// TODO: Outdated, revisit and retest
|
|
39
|
+
export async function addTemplatesToDashboard(name, newTemplates, client, dashboardData, getToken) {
|
|
39
40
|
try {
|
|
40
41
|
const { publicKey, tenants } = client;
|
|
41
42
|
if (tenants) {
|
|
42
43
|
// need to implement a way to specify report tenant id
|
|
43
44
|
throw new Error('Adding from template not yet supported for tenants');
|
|
44
45
|
}
|
|
45
|
-
const
|
|
46
|
+
const { data: resp } = await quillFetch({
|
|
47
|
+
client,
|
|
48
|
+
task: 'add-from-template',
|
|
46
49
|
metadata: {
|
|
47
50
|
dashboardName: name,
|
|
48
|
-
task: 'add-from-template',
|
|
49
51
|
clientId: publicKey,
|
|
50
52
|
templateReportIds: newTemplates.map((template) => template._id),
|
|
51
53
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
'omit', hostedBody, null);
|
|
54
|
+
getToken,
|
|
55
|
+
});
|
|
55
56
|
if (resp.success && resp.newItems && resp.newItems.length > 0) {
|
|
56
57
|
const newData = {
|
|
57
58
|
newQueries: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillMultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/QuillMultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAiC3E;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,SAAS,GACV,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"QuillMultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/QuillMultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAiC3E;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,SAAS,GACV,EAAE,yBAAyB,2CAiP3B;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,4CA8DA,CAAC"}
|
|
@@ -76,7 +76,6 @@ export function QuillMultiSelectComponent({ options, width, onChange, label, val
|
|
|
76
76
|
fontWeight: 600,
|
|
77
77
|
}, children: label })), _jsxs("button", { style: {
|
|
78
78
|
fontFamily: theme?.fontFamily,
|
|
79
|
-
color: theme?.primaryTextColor,
|
|
80
79
|
width: '100%',
|
|
81
80
|
display: 'flex',
|
|
82
81
|
alignItems: 'center',
|
|
@@ -96,8 +95,8 @@ export function QuillMultiSelectComponent({ options, width, onChange, label, val
|
|
|
96
95
|
height: 40,
|
|
97
96
|
minHeight: 40,
|
|
98
97
|
maxHeight: 40,
|
|
99
|
-
}, className: "quill-select-button", onClick: () => setShowModal((showModal) => !showModal), ref: buttonRef, children: [_jsx("style", { children: ` .quill-select-button { background: ${theme?.backgroundColor}; }
|
|
100
|
-
.quill-select-button:hover { background: ${theme?.hoverBackgroundColor}; }
|
|
98
|
+
}, className: "quill-select-button", onClick: () => setShowModal((showModal) => !showModal), ref: buttonRef, children: [_jsx("style", { children: ` .quill-select-button { background: ${theme?.backgroundColor}; color: ${theme?.primaryTextColor}; }
|
|
99
|
+
.quill-select-button:hover { background: ${theme?.hoverBackgroundColor}; color: ${theme?.hoverTextColor}; }
|
|
101
100
|
` }), _jsx("span", { style: {
|
|
102
101
|
textOverflow: 'ellipsis',
|
|
103
102
|
whiteSpace: 'nowrap',
|
|
@@ -115,7 +114,7 @@ export function QuillMultiSelectComponent({ options, width, onChange, label, val
|
|
|
115
114
|
borderStyle: 'solid',
|
|
116
115
|
borderColor: theme?.borderColor,
|
|
117
116
|
borderRadius: 6,
|
|
118
|
-
background:
|
|
117
|
+
background: theme?.backgroundColor,
|
|
119
118
|
marginTop: 12,
|
|
120
119
|
zIndex: 100,
|
|
121
120
|
padding: 6,
|
|
@@ -161,10 +160,12 @@ export function QuillMultiSelectComponent({ options, width, onChange, label, val
|
|
|
161
160
|
debounce(updatedChangeEvent);
|
|
162
161
|
}, children: [_jsx("style", { children: `
|
|
163
162
|
.quill-option {
|
|
164
|
-
background:
|
|
163
|
+
background: ${theme?.backgroundColor};
|
|
164
|
+
color: ${theme?.primaryTextColor};
|
|
165
165
|
}
|
|
166
166
|
.quill-option:hover {
|
|
167
|
-
background:
|
|
167
|
+
background: ${theme?.hoverBackgroundColor};
|
|
168
|
+
color: ${theme?.hoverTextColor};
|
|
168
169
|
}
|
|
169
170
|
` }), _jsx("input", { type: "checkbox", checked: selectedOptions.includes(option.value), style: { width: '14px', height: '14px', margin: 'auto 0' }, readOnly: true }), _jsx("span", { style: {
|
|
170
171
|
textOverflow: 'ellipsis',
|
|
@@ -173,6 +174,7 @@ export function QuillMultiSelectComponent({ options, width, onChange, label, val
|
|
|
173
174
|
}, children: option.label ?? nullLabel })] }, option.value)))) : (_jsx(LoadingSpinner, {})) }))] }));
|
|
174
175
|
}
|
|
175
176
|
export const ListboxTextInput = ({ value, onChange, placeholder, }) => {
|
|
177
|
+
const [theme] = useContext(ThemeContext);
|
|
176
178
|
return (_jsxs("div", { style: {
|
|
177
179
|
position: 'relative',
|
|
178
180
|
display: 'flex',
|
|
@@ -185,7 +187,7 @@ export const ListboxTextInput = ({ value, onChange, placeholder, }) => {
|
|
|
185
187
|
height: 40px;
|
|
186
188
|
width: 180px;
|
|
187
189
|
z-index: 2;
|
|
188
|
-
color: #384151;
|
|
190
|
+
color: ${theme?.primaryTextColor ?? '#384151'};
|
|
189
191
|
border-radius: 4px;
|
|
190
192
|
text-align: left;
|
|
191
193
|
padding-right: 12px;
|
|
@@ -193,9 +195,13 @@ export const ListboxTextInput = ({ value, onChange, placeholder, }) => {
|
|
|
193
195
|
padding-bottom: 0px;
|
|
194
196
|
box-sizing: content-box;
|
|
195
197
|
margin-left: 6px;
|
|
196
|
-
border: 0 solid #e5e7eb;
|
|
198
|
+
border: 0 solid ${theme?.borderColor ?? '#e5e7eb'};
|
|
197
199
|
}
|
|
198
200
|
.quill-text-input:focus {
|
|
199
201
|
outline: none;
|
|
200
|
-
}` }), _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
|
|
202
|
+
}` }), _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, style: {
|
|
203
|
+
fontFamily: theme?.fontFamily,
|
|
204
|
+
color: theme?.primaryTextColor,
|
|
205
|
+
background: theme?.backgroundColor,
|
|
206
|
+
} })] }));
|
|
201
207
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillMultiSelectSectionList.d.ts","sourceRoot":"","sources":["../../../src/components/QuillMultiSelectSectionList.tsx"],"names":[],"mappings":"AAEA,OAAc,EACZ,aAAa,EAKd,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;
|
|
1
|
+
{"version":3,"file":"QuillMultiSelectSectionList.d.ts","sourceRoot":"","sources":["../../../src/components/QuillMultiSelectSectionList.tsx"],"names":[],"mappings":"AAEA,OAAc,EACZ,aAAa,EAKd,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;QAAE,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;IAC3C,OAAO,EAAE;QACP,CAAC,WAAW,EAAE,MAAM,GAAG;YACrB,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;SACf,EAAE,CAAC;KACL,CAAC;IACF,gBAAgB,CAAC,EAAE;QAAE,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACrD,QAAQ,EAAE,CAAC,KAAK,EAAE;QAChB,MAAM,EAAE;YAAE,KAAK,EAAE;gBAAE,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;aAAE,CAAA;SAAE,CAAC;KACxD,KAAK,IAAI,CAAC;IACX,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,2CAicA;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,4CA8DA,CAAC"}
|
|
@@ -38,19 +38,23 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
38
38
|
const isUuid = sample.value?.match(uuidRegex);
|
|
39
39
|
const isNumber = !isNaN(parseInt(sample.value));
|
|
40
40
|
const filteredOptions = Object.keys(options).reduce((acc, key) => {
|
|
41
|
-
acc[key] =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
acc[key] =
|
|
42
|
+
options[key]?.filter((option) => {
|
|
43
|
+
if (!option) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return (searchQuery === '' ||
|
|
47
|
+
option.label
|
|
48
|
+
.toLowerCase()
|
|
49
|
+
.replace(/\s+/g, '')
|
|
50
|
+
.includes(searchQuery.toLowerCase().replace(/\s+/g, '')) ||
|
|
51
|
+
(isNumber || isUuid
|
|
52
|
+
? option.value
|
|
53
|
+
.toLowerCase()
|
|
54
|
+
.replace(/\s+/g, '')
|
|
55
|
+
.includes(searchQuery.toLowerCase().replace(/\s+/g, ''))
|
|
56
|
+
: false));
|
|
57
|
+
}) ?? [];
|
|
54
58
|
return acc;
|
|
55
59
|
}, {});
|
|
56
60
|
const sliceSize = Math.ceil(20 / Object.keys(filteredOptions).length);
|
|
@@ -59,7 +63,9 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
59
63
|
filteredOptions[key] = filteredOptions[key].slice(0, sliceSize);
|
|
60
64
|
}
|
|
61
65
|
});
|
|
62
|
-
return Object.fromEntries(Object.entries(filteredOptions)
|
|
66
|
+
return Object.fromEntries(Object.entries(filteredOptions)
|
|
67
|
+
.filter(([, value]) => !!value?.length)
|
|
68
|
+
.sort(([key]) => (key === owner ? -1 : 1)));
|
|
63
69
|
}, [options, searchQuery]);
|
|
64
70
|
const filteredLength = React.useMemo(() => {
|
|
65
71
|
return Object.values(filteredItems).reduce((a, b) => a + b.length, 0);
|
|
@@ -91,7 +97,7 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
91
97
|
borderRadius: '6px',
|
|
92
98
|
width: width,
|
|
93
99
|
minWidth: width,
|
|
94
|
-
...style
|
|
100
|
+
...style,
|
|
95
101
|
}, children: [label && (_jsx("div", { style: {
|
|
96
102
|
fontSize: 14,
|
|
97
103
|
color: theme?.secondaryTextColor,
|
|
@@ -100,7 +106,6 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
100
106
|
fontWeight: 600,
|
|
101
107
|
}, children: label })), _jsxs("button", { style: {
|
|
102
108
|
fontFamily: theme?.fontFamily,
|
|
103
|
-
color: theme?.primaryTextColor,
|
|
104
109
|
width: '100%',
|
|
105
110
|
display: 'flex',
|
|
106
111
|
alignItems: 'center',
|
|
@@ -120,8 +125,8 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
120
125
|
height: 40,
|
|
121
126
|
minHeight: 40,
|
|
122
127
|
maxHeight: 40,
|
|
123
|
-
}, className: 'quill-select-button', onClick: () => setShowModal((showModal) => !showModal), disabled: disabled, ref: buttonRef, children: [_jsx("style", { children: ` .quill-select-button { background: ${theme?.backgroundColor}; }
|
|
124
|
-
.quill-select-button:hover { background: ${theme?.hoverBackgroundColor}; }
|
|
128
|
+
}, className: 'quill-select-button', onClick: () => setShowModal((showModal) => !showModal), disabled: disabled, ref: buttonRef, children: [_jsx("style", { children: ` .quill-select-button { background: ${theme?.backgroundColor}; color: ${theme?.primaryTextColor}; }
|
|
129
|
+
.quill-select-button:hover { background: ${theme?.hoverBackgroundColor}; color: ${theme?.hoverTextColor}; }
|
|
125
130
|
.quill-select-button:disabled {
|
|
126
131
|
cursor: not-allowed;
|
|
127
132
|
background: ${theme?.hoverBackgroundColor};
|
|
@@ -143,7 +148,7 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
143
148
|
borderStyle: 'solid',
|
|
144
149
|
borderColor: theme?.borderColor,
|
|
145
150
|
borderRadius: 6,
|
|
146
|
-
background:
|
|
151
|
+
background: theme?.backgroundColor,
|
|
147
152
|
marginTop: 12,
|
|
148
153
|
zIndex: 100,
|
|
149
154
|
padding: 6,
|
|
@@ -157,8 +162,7 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
157
162
|
height: 9,
|
|
158
163
|
width: 230,
|
|
159
164
|
borderTop: '1px solid #e7e7e7',
|
|
160
|
-
} })] })), !isLoading &&
|
|
161
|
-
(!filteredItems || filteredLength === 0) && (_jsxs("div", { style: {
|
|
165
|
+
} })] })), !isLoading && (!filteredItems || filteredLength === 0) && (_jsxs("div", { style: {
|
|
162
166
|
display: 'flex',
|
|
163
167
|
alignItems: 'center',
|
|
164
168
|
padding: 8,
|
|
@@ -178,17 +182,17 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
178
182
|
overflow: 'hidden',
|
|
179
183
|
}, children: [_jsx("style", { children: `
|
|
180
184
|
.quill-option {
|
|
181
|
-
background:
|
|
185
|
+
background: ${theme?.backgroundColor};
|
|
182
186
|
}
|
|
183
187
|
.quill-option:hover {
|
|
184
|
-
background:
|
|
188
|
+
background: ${theme?.hoverBackgroundColor};
|
|
185
189
|
}
|
|
186
190
|
` }), _jsx("span", { style: {
|
|
187
191
|
textOverflow: 'ellipsis',
|
|
188
192
|
whiteSpace: 'nowrap',
|
|
189
193
|
overflow: 'hidden',
|
|
190
194
|
cursor: 'default',
|
|
191
|
-
}, children: emptyLabel ?? 'No options available' })] })), !isLoading ? Object.keys(filteredItems).map((key) => (_jsxs("div", { children: [_jsxs("button", { style: {
|
|
195
|
+
}, children: emptyLabel ?? 'No options available' })] })), !isLoading ? (Object.keys(filteredItems).map((key) => (_jsxs("div", { children: [_jsxs("button", { style: {
|
|
192
196
|
display: 'flex',
|
|
193
197
|
alignItems: 'center',
|
|
194
198
|
padding: 8,
|
|
@@ -208,7 +212,8 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
208
212
|
overflow: 'hidden',
|
|
209
213
|
}, className: "quill-option", onClick: () => {
|
|
210
214
|
const updatedValue = options[key]?.length === value[key]?.length
|
|
211
|
-
? []
|
|
215
|
+
? []
|
|
216
|
+
: (options[key]?.map((option) => option.value) ?? []);
|
|
212
217
|
const updatedChangeEvent = {
|
|
213
218
|
target: {
|
|
214
219
|
value: {
|
|
@@ -221,17 +226,19 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
221
226
|
debounce(updatedChangeEvent);
|
|
222
227
|
}, children: [_jsx("style", { children: `
|
|
223
228
|
.quill-option {
|
|
224
|
-
background:
|
|
229
|
+
background: ${theme?.backgroundColor};
|
|
230
|
+
color: ${theme?.primaryTextColor};
|
|
225
231
|
}
|
|
226
232
|
.quill-option:hover {
|
|
227
|
-
background:
|
|
233
|
+
background: ${theme?.hoverBackgroundColor};
|
|
234
|
+
color: ${theme?.hoverTextColor};
|
|
228
235
|
}
|
|
229
236
|
` }), _jsx("input", { type: "checkbox", checked: options[key]?.length === value[key]?.length, style: { width: '14px', height: '14px', margin: 'auto 0' }, readOnly: true }), _jsx("span", { style: {
|
|
230
237
|
textOverflow: 'ellipsis',
|
|
231
238
|
whiteSpace: 'nowrap',
|
|
232
239
|
overflow: 'hidden',
|
|
233
240
|
fontWeight: 600,
|
|
234
|
-
}, children: sectionHeaderMap?.[key] ?? key })] },
|
|
241
|
+
}, children: sectionHeaderMap?.[key] ?? key })] }, 'sh-' + key), _jsx("div", { style: {
|
|
235
242
|
height: 1,
|
|
236
243
|
borderTop: '1px solid #e7e7e7',
|
|
237
244
|
marginTop: 2,
|
|
@@ -271,18 +278,25 @@ export function QuillMultiSelectSectionList({ options, width, onChange, label, s
|
|
|
271
278
|
debounce(updatedChangeEvent);
|
|
272
279
|
}, children: [_jsx("style", { children: `
|
|
273
280
|
.quill-option {
|
|
274
|
-
background:
|
|
281
|
+
background: ${theme?.backgroundColor};
|
|
282
|
+
color: ${theme?.primaryTextColor};
|
|
275
283
|
}
|
|
276
284
|
.quill-option:hover {
|
|
277
|
-
background:
|
|
285
|
+
background: ${theme?.hoverBackgroundColor};
|
|
286
|
+
color: ${theme?.hoverTextColor};
|
|
278
287
|
}
|
|
279
|
-
` }), _jsx("input", { type: "checkbox", checked: value[key]?.includes(option.value) ?? false, style: {
|
|
288
|
+
` }), _jsx("input", { type: "checkbox", checked: value[key]?.includes(option.value) ?? false, style: {
|
|
289
|
+
width: '14px',
|
|
290
|
+
height: '14px',
|
|
291
|
+
margin: 'auto 0',
|
|
292
|
+
}, readOnly: true }), _jsx("span", { style: {
|
|
280
293
|
textOverflow: 'ellipsis',
|
|
281
294
|
whiteSpace: 'nowrap',
|
|
282
295
|
overflow: 'hidden',
|
|
283
|
-
}, children: option.label })] },
|
|
296
|
+
}, children: option.label })] }, 'v-' + key + '-' + option.value)))] }, 'sp-' + key)))) : (_jsx("div", { children: _jsx(LoadingSpinner, {}) }))] }))] }));
|
|
284
297
|
}
|
|
285
298
|
export const ListboxTextInput = ({ value, onChange, placeholder, }) => {
|
|
299
|
+
const [theme] = useContext(ThemeContext);
|
|
286
300
|
return (_jsxs("div", { style: {
|
|
287
301
|
position: 'relative',
|
|
288
302
|
display: 'flex',
|
|
@@ -302,9 +316,13 @@ export const ListboxTextInput = ({ value, onChange, placeholder, }) => {
|
|
|
302
316
|
padding-bottom: 0px;
|
|
303
317
|
box-sizing: content-box;
|
|
304
318
|
margin-left: 6px;
|
|
305
|
-
border: 0 solid #e5e7eb;
|
|
319
|
+
border: 0 solid ${theme?.borderColor ?? '#e5e7eb'};
|
|
306
320
|
}
|
|
307
321
|
.quill-text-input:focus {
|
|
308
322
|
outline: none;
|
|
309
|
-
}` }), _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
|
|
323
|
+
}` }), _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, style: {
|
|
324
|
+
fontFamily: theme?.fontFamily,
|
|
325
|
+
color: theme?.primaryTextColor,
|
|
326
|
+
background: theme?.backgroundColor,
|
|
327
|
+
} })] }));
|
|
310
328
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuillMultiSelectWithCombo.d.ts","sourceRoot":"","sources":["../../../src/components/QuillMultiSelectWithCombo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuillMultiSelectWithCombo.d.ts","sourceRoot":"","sources":["../../../src/components/QuillMultiSelectWithCombo.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAc,EAEZ,aAAa,EAMd,MAAM,OAAO,CAAC;AAKf;;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;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,2CAwmBA;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,4CA8DA,CAAC"}
|