@dcs-tech/ui 0.3.0 → 0.4.0
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/README.md +1 -6
- package/dist/ChartImageMenu-HILSfn5A.js +1115 -0
- package/dist/ChartView-Cehrcr05.js +1703 -0
- package/dist/{SummaryChart-D4jcOv-K.js → SummaryChart-y27q_BBN.js} +8 -10
- package/dist/{SummaryImage-BSbatHym.js → SummaryImage-DDNEEu_K.js} +3 -4
- package/dist/{SummarySeeAll-vnaL3pdy.js → SummarySeeAll-0dX-_LFe.js} +24 -20
- package/dist/{defaults-BbLB8QmD.js → defaults-DL745PK1.js} +1 -2
- package/dist/{exportContext-CAX8VPrP.js → exportContext-CdpsOzE8.js} +7 -15
- package/dist/{exportEngine-C4n1MiOw.js → exportEngine-DL-jEXFU.js} +6 -7
- package/dist/geometry-CG2nOEnw.js +1796 -0
- package/dist/index.js +14847 -17480
- package/dist/scrollArea-CkPGDYH2.js +210 -0
- package/dist/style.css +1 -1
- package/dist/{summaryChartData-CU_W5ocv.js → summaryChartData-Djo73zb8.js} +2 -3
- package/dist/types/{shared-web-ui/src → components}/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/Button.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/ButtonGroup.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/ButtonGroupContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Charts/ChartTooltip.d.ts +17 -3
- package/dist/types/{shared-web-ui/src → components}/Charts/geometry.d.ts +5 -3
- package/dist/types/{shared-web-ui/src → components}/Charts/parts.d.ts +1 -0
- package/dist/types/{shared-web-ui/src → components}/Charts/ui.d.ts +1 -1
- package/dist/types/components/Charts/useUiScale.d.ts +1 -0
- package/dist/types/{shared-web-ui/src → components}/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Checkbox/CheckboxGroup.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Checkbox/CheckboxGroupContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Checkbox/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/ChipInput/ChipInput.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/ChipInput/index.d.ts +2 -2
- package/dist/types/{shared-web-ui/src → components}/ChipInput/useChipSuggestions.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/Collapsible.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/CollapsibleContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/CollapsibleItem.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/ColorSchemeSelect/ColorSchemeSelect.d.ts +2 -2
- package/dist/types/components/DataTable/DataTable.storyData.d.ts +23 -0
- package/dist/types/components/DataTable/PressButton.d.ts +2 -0
- package/dist/types/components/DataTable/filters/FilterChips.d.ts +9 -0
- package/dist/types/components/DataTable/menu/layers.d.ts +1 -0
- package/dist/types/components/DataTable/rows/PressRow.d.ts +7 -0
- package/dist/types/{shared-web-ui/src → components}/DataTable/summary/summaryWidth.d.ts +1 -1
- package/dist/types/components/DataTable/ui-local/scrollLock.d.ts +1 -0
- package/dist/types/{shared-web-ui/src → components}/DatePicker/Calendar.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/DatePicker/DatePicker.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/DatePicker/TimeField.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/DatePicker/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Dialog/DialogHost.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTable.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableActions.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableCell.d.ts +2 -2
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableRow.d.ts +3 -3
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableSummary.d.ts +2 -2
- package/dist/types/{shared-web-ui/src → components}/EditableTable/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/EditableTable/useEditableTable.d.ts +3 -3
- package/dist/types/{shared-web-ui/src → components}/FieldContext/FieldContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldContext/FieldProvider.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldContext/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldContext/useField.d.ts +2 -2
- package/dist/types/{shared-web-ui/src → components}/FieldContext/useFieldSurface.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldContext/useFormKeyboard.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldWrapper/FieldWrapper.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldWrapper/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/Field.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/FieldButton.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/Fields.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldBlur.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldChange.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldCondition.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldDisabled.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldRender.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldSelect.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldValidation.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldValue.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Form/Form.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Form/index.d.ts +1 -1
- package/dist/types/components/Image/ImagePicker.d.ts +23 -0
- package/dist/types/components/Image/ImageStrip.d.ts +13 -0
- package/dist/types/components/Image/ImageViewer.d.ts +16 -0
- package/dist/types/components/Image/index.d.ts +8 -0
- package/dist/types/components/Image/prepareImage.d.ts +19 -0
- package/dist/types/{shared-web-ui/src → components}/Input/Input.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Input/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Popover/Popover.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Popover/floatingPosition.d.ts +1 -1
- package/dist/types/components/Press/index.d.ts +2 -0
- package/dist/types/components/Press/usePress.d.ts +9 -0
- package/dist/types/{shared-web-ui/src → components}/Radio/Radio.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Radio/RadioGroup.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Radio/RadioGroupContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Radio/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Select/Select.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Select/index.d.ts +1 -1
- package/dist/types/components/Select/useSelect.d.ts +2 -0
- package/dist/types/{shared-web-ui/src → components}/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/components/Stepper/Stepper.d.ts +17 -0
- package/dist/types/components/Stepper/index.d.ts +2 -0
- package/dist/types/{shared-web-ui/src → components}/Suggest/Suggest.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Suggest/SuggestionList.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Suggest/index.d.ts +2 -2
- package/dist/types/{shared-web-ui/src → components}/Suggest/searchFilters.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Suggest/useSuggest.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Switch/Switch.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Switch/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Tooltip/useTooltip.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Typography/Typography.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Typography/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/UIProvider/UIProvider.d.ts +1 -1
- package/dist/types/core/hooks/index.d.ts +3 -0
- package/dist/types/core/hooks/useDebounced.d.ts +7 -0
- package/dist/types/core/hooks/usePresence.d.ts +5 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/button.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/cellRules.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/chipinput.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/collapsible.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/datePicker.logic.d.ts +1 -1
- package/dist/types/core/logic/displayOrder.logic.d.ts +4 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/editableTable.logic.d.ts +5 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/fieldControl.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/fieldWrapper.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/fields.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/index.d.ts +4 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/keyboard.logic.d.ts +1 -1
- package/dist/types/core/logic/motion.logic.d.ts +1 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/navigation.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/popupList.logic.d.ts +1 -1
- package/dist/types/core/logic/press.logic.d.ts +14 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/quickAddGrid.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/select.logic.d.ts +1 -1
- package/dist/types/core/logic/stepper.logic.d.ts +6 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/suggest.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/tableLayout.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/tableSummary.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/tooltip.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/typography.logic.d.ts +1 -1
- package/dist/types/core/logic/uiScale.logic.d.ts +1 -0
- package/dist/types/{shared-types/src/ui → core/types}/button.types.d.ts +1 -0
- package/dist/types/{shared-types/src/ui → core/types}/suggest.types.d.ts +1 -0
- package/dist/types/{shared-web-ui/src/index.d.ts → index.d.ts} +86 -83
- package/package.json +27 -28
- package/dist/ChartImageMenu-gvNAYVkY.js +0 -2938
- package/dist/Charts-COljjy0x.js +0 -1759
- package/dist/fuseSearch-vLQR3O5a.js +0 -37
- package/dist/types/published/dcs-ui/src/index.d.ts +0 -4
- package/dist/types/published/dcs-ui/src/publicLogic.d.ts +0 -2
- package/dist/types/published/dcs-ui/src/publicTypes.d.ts +0 -2
- package/dist/types/shared-logic/src/report/aggregate.d.ts +0 -8
- package/dist/types/shared-logic/src/report/canvas.d.ts +0 -51
- package/dist/types/shared-logic/src/report/conditions.d.ts +0 -4
- package/dist/types/shared-logic/src/report/constants.d.ts +0 -7
- package/dist/types/shared-logic/src/report/dataset.d.ts +0 -23
- package/dist/types/shared-logic/src/report/edit.d.ts +0 -126
- package/dist/types/shared-logic/src/report/fields.d.ts +0 -29
- package/dist/types/shared-logic/src/report/format.d.ts +0 -5
- package/dist/types/shared-logic/src/report/fromColumns.d.ts +0 -31
- package/dist/types/shared-logic/src/report/index.d.ts +0 -19
- package/dist/types/shared-logic/src/report/layout.d.ts +0 -31
- package/dist/types/shared-logic/src/report/metrics.d.ts +0 -17
- package/dist/types/shared-logic/src/report/migrate.d.ts +0 -17
- package/dist/types/shared-logic/src/report/paginate.d.ts +0 -8
- package/dist/types/shared-logic/src/report/renderers/html.d.ts +0 -8
- package/dist/types/shared-logic/src/report/renderers/pdfmake.d.ts +0 -18
- package/dist/types/shared-logic/src/report/resolve.d.ts +0 -11
- package/dist/types/shared-logic/src/report/scope.d.ts +0 -24
- package/dist/types/shared-logic/src/report/storage.d.ts +0 -36
- package/dist/types/shared-logic/src/report/validate.d.ts +0 -10
- package/dist/types/shared-types/src/report/bands.d.ts +0 -12
- package/dist/types/shared-types/src/report/blocks.d.ts +0 -122
- package/dist/types/shared-types/src/report/conditions.d.ts +0 -11
- package/dist/types/shared-types/src/report/dataset.d.ts +0 -53
- package/dist/types/shared-types/src/report/document.d.ts +0 -121
- package/dist/types/shared-types/src/report/index.d.ts +0 -9
- package/dist/types/shared-types/src/report/primitives.d.ts +0 -69
- package/dist/types/shared-types/src/report/registry.d.ts +0 -39
- package/dist/types/shared-types/src/report/storage.d.ts +0 -10
- package/dist/types/shared-types/src/report/template.d.ts +0 -32
- package/dist/types/shared-web-ui/src/ReportDesigner/AlignedRowsEditor.d.ts +0 -4
- package/dist/types/shared-web-ui/src/ReportDesigner/BandList.d.ts +0 -18
- package/dist/types/shared-web-ui/src/ReportDesigner/BlockEditor.d.ts +0 -33
- package/dist/types/shared-web-ui/src/ReportDesigner/ColumnEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/ConditionEditor.d.ts +0 -5
- package/dist/types/shared-web-ui/src/ReportDesigner/FieldPicker.d.ts +0 -12
- package/dist/types/shared-web-ui/src/ReportDesigner/FieldSelect.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/FormatEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/Inspector.d.ts +0 -7
- package/dist/types/shared-web-ui/src/ReportDesigner/OptionsEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/ReportDesigner.d.ts +0 -12
- package/dist/types/shared-web-ui/src/ReportDesigner/StyleEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/TableEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/WatermarkEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/chipSources.d.ts +0 -5
- package/dist/types/shared-web-ui/src/ReportDesigner/icons.d.ts +0 -21
- package/dist/types/shared-web-ui/src/ReportDesigner/index.d.ts +0 -16
- package/dist/types/shared-web-ui/src/ReportDesigner/labels.d.ts +0 -22
- package/dist/types/shared-web-ui/src/ReportDesigner/parts.d.ts +0 -33
- package/dist/types/shared-web-ui/src/ReportDesigner/types.d.ts +0 -67
- package/dist/types/shared-web-ui/src/ReportPreview/ReportPreview.d.ts +0 -20
- package/dist/types/shared-web-ui/src/ReportPreview/index.d.ts +0 -1
- package/dist/types/shared-web-ui/src/Select/useSelect.d.ts +0 -2
- package/dist/ui-DJFwpPdX.js +0 -4997
- /package/dist/types/{shared-web-ui/src → components}/AppBar/AppBar.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/AppBar/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/ArrowKeyFocus/useArrowKeyFocus.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Avatar/Avatar.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Avatar/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Badge/Badge.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Badge/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Breadcrumbs/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Card/Card.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Card/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/AnchoredMenu.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/BarList.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/CalendarHeatmap.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/Chart.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/ChartIcon.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/ChartImageMenu.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/ChartTable.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/ChartView.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/ColumnChart.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/Donut.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/Funnel.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/Gauge.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/Legend.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/LineChart.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/NumberTrend.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/Progress.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/StackedBar.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/Treemap.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/chartData.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/chartImage.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/labels.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/menuPlacement.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/palette.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/pointer.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/types.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/useBoxSize.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Charts/useLegendFit.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/ColorSchemeSelect/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/CommandPalette/CommandPalette.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/CommandPalette/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/DataTable.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/DisplayPopover.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/HeaderMenu.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/ManageModal.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/SingleRowView.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/SortModal.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/StatusRow.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/TableColumnModal.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/TableControls.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/TablePagination.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/TableScrollStrip.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/TableToolbar.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/TableView.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/bulk/BulkConfirmDialog.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/bulk/TableToast.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/bulk/bulkActions.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/cards/CardFieldsEditor.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/cards/CardView.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/cards/cardFields.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/cards/rowParts.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/data/useServerData.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/defaults.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/detail/BuiltInDetail.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/detail/DetailHost.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/ExportPopover.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/ExportPreviewModal.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/ExportSettingsModal.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/ExportTemplateCards.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/exportContext.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/exportEngine.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/exportRows.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/templateDisplay.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/templateOptions.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/export/useTableExport.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/filters/ColumnFilterPopover.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/filters/FilterConditionRow.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/filters/FilterGroup.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/filters/FilterModal.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/filters/FilterRow.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/filters/columnFilterModel.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/filters/filterEngine.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/filters/filterRowModel.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/filters/quickFilterMatch.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/grouping/GroupUi.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/grouping/groupModel.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/grouping/useGrouping.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/host.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/keyboard/ShortcutsDialog.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/keyboard/shortcuts.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/keyboard/useGridKeyboard.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/labels.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/layout/LayoutSwitcher.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/layout/layouts.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/layout/scrollArea.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/layout/useFillHeight.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/menu/RowMenu.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/menu/buildRowMenu.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/menu/clipboard.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/menu/valueFilter.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/motion/useRowMotion.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/persistence/adapters.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/persistence/reconcile.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/persistence/useColumnPersistence.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/persistence/useManagePrefs.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/persistence/useOrphanPrefs.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/pinning.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/rows/RowActions.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/rows/rowPress.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/sharing/Sharing.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/split/SplitView.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/ManageSummaryCards.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/SummaryChart.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/SummaryControls.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/SummaryImage.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/SummarySeeAll.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/TableSummary.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/summaryCatalogue.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/summaryChartData.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/summaryModel.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/summary/useTableSummary.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/types.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/ui-local/AutoHeight.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/ui-local/DateRangePicker.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/ui-local/DragAndDropList/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/ui-local/DragAndDropList/types.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/ui-local/ReactModal.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/ui.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/useDataChangeTracker.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/useTable.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/vendor/columnOrder.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/vendor/diff.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/vendor/fileActions.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/vendor/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DataTable/virtual/useVirtualLines.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DatePicker/useOneMonthPane.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Dialog/Dialog.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Dialog/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DropdownMenu/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/EditableTable/useRowAnimation.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Floating/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Floating/layers.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Floating/scrollLock.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Floating/useFloatingLayer.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Popover/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Scroll/ScrollRule.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Scroll/ScrollStrip.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Scroll/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Scroll/labels.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Scroll/scrollActivity.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Scroll/ui.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Sidebar/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Skeleton/Skeleton.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Skeleton/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Suggest/fuseSearch.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Tabs/Tabs.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Tabs/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Toast/ToastHost.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Toast/ToastItem.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Toast/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Toast/toast.types.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Tooltip/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/UIProvider/UIPortalContext.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/UIProvider/UIThemeContext.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/UIProvider/index.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/checkbox.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/colorScheme.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/columnOrder.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/form.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/input.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/popover.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/radio.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/switch.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/timeField.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/useMergeRefs.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/checkbox.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/chipinput.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/collapsible.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/common.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/control.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/datePicker.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/editableTable.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/field.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/fieldWrapper.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/fields.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/form.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/index.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/input.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/keyboard.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/navigation.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/radio.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/select.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/switch.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/table.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/tooltip.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/typography.types.d.ts +0 -0
|
@@ -0,0 +1,1796 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { l as e, n as t, r as n } from "./defaults-DL745PK1.js";
|
|
3
|
+
import { createContext as r, useContext as i, useMemo as a } from "react";
|
|
4
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
// src/core/logic/tooltip.logic.ts
|
|
6
|
+
function l(e) {
|
|
7
|
+
if (e == null || e === !1 || e === "") return null;
|
|
8
|
+
let t = typeof e == "object" && !Array.isArray(e) && !("$$typeof" in e) && "content" in e ? e : { content: e };
|
|
9
|
+
return t.disabled || t.content === null || t.content === void 0 || t.content === "" ? null : t;
|
|
10
|
+
}
|
|
11
|
+
function ee(e) {
|
|
12
|
+
return e.openedBy !== "pointer" || e.anchorTo === "element" ? !1 : e.anchorTo === "pointer" || e.anchorWidth > e.tooltipWidth;
|
|
13
|
+
}
|
|
14
|
+
var te = {
|
|
15
|
+
top: "bottom",
|
|
16
|
+
bottom: "top",
|
|
17
|
+
left: "right",
|
|
18
|
+
right: "left"
|
|
19
|
+
};
|
|
20
|
+
function ne(e) {
|
|
21
|
+
let t = e === "top" || e === "bottom" ? ["right", "left"] : ["bottom", "top"];
|
|
22
|
+
return [
|
|
23
|
+
e,
|
|
24
|
+
te[e],
|
|
25
|
+
...t
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
function re(e, { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 }) {
|
|
29
|
+
switch (e) {
|
|
30
|
+
case "top": return t.top - i - n.height >= a;
|
|
31
|
+
case "bottom": return t.top + t.height + i + n.height <= r.height - a;
|
|
32
|
+
case "left": return t.left - i - n.width >= a;
|
|
33
|
+
case "right": return t.left + t.width + i + n.width <= r.width - a;
|
|
34
|
+
default: return !1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
var ie = (e, t, n) => Math.min(Math.max(e, t), n);
|
|
38
|
+
function ae(e) {
|
|
39
|
+
let { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 } = e, o = ne(e.placement).find((t) => re(t, e)) || e.placement, s, c;
|
|
40
|
+
switch (o) {
|
|
41
|
+
case "bottom":
|
|
42
|
+
s = t.top + t.height + i, c = t.left + t.width / 2 - n.width / 2;
|
|
43
|
+
break;
|
|
44
|
+
case "left":
|
|
45
|
+
s = t.top + t.height / 2 - n.height / 2, c = t.left - i - n.width;
|
|
46
|
+
break;
|
|
47
|
+
case "right":
|
|
48
|
+
s = t.top + t.height / 2 - n.height / 2, c = t.left + t.width + i;
|
|
49
|
+
break;
|
|
50
|
+
default: s = t.top - i - n.height, c = t.left + t.width / 2 - n.width / 2;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
placement: o,
|
|
54
|
+
left: ie(c, a, Math.max(a, r.width - n.width - a)),
|
|
55
|
+
top: ie(s, a, Math.max(a, r.height - n.height - a))
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// src/components/UIProvider/UIPortalContext.ts
|
|
59
|
+
var oe = r(null), se = () => i(oe) || (typeof document > "u" ? null : document.body), ce = {
|
|
60
|
+
title: 1,
|
|
61
|
+
subtitle: 1,
|
|
62
|
+
badge: 1,
|
|
63
|
+
details: 4,
|
|
64
|
+
more: 40
|
|
65
|
+
}, le = {
|
|
66
|
+
title: 1,
|
|
67
|
+
subtitle: 2,
|
|
68
|
+
badge: 1
|
|
69
|
+
}, ue = ["top", "bottom"], u = {
|
|
70
|
+
value: ["number", "numberTrend"],
|
|
71
|
+
ratio: [
|
|
72
|
+
"bar",
|
|
73
|
+
"gauge",
|
|
74
|
+
"ring",
|
|
75
|
+
"donut",
|
|
76
|
+
"pie"
|
|
77
|
+
],
|
|
78
|
+
breakdown: [
|
|
79
|
+
"donut",
|
|
80
|
+
"pie",
|
|
81
|
+
"bars",
|
|
82
|
+
"stacked",
|
|
83
|
+
"treemap"
|
|
84
|
+
],
|
|
85
|
+
trend: [
|
|
86
|
+
"columns",
|
|
87
|
+
"line",
|
|
88
|
+
"area",
|
|
89
|
+
"grouped",
|
|
90
|
+
"stacked",
|
|
91
|
+
"calendar"
|
|
92
|
+
],
|
|
93
|
+
funnel: ["funnel"]
|
|
94
|
+
}, de = [
|
|
95
|
+
"auto",
|
|
96
|
+
"quarter",
|
|
97
|
+
"half",
|
|
98
|
+
"full"
|
|
99
|
+
], fe = [
|
|
100
|
+
"top5",
|
|
101
|
+
"top10",
|
|
102
|
+
"least5",
|
|
103
|
+
"least10",
|
|
104
|
+
"all"
|
|
105
|
+
], pe = {
|
|
106
|
+
month: [
|
|
107
|
+
3,
|
|
108
|
+
6,
|
|
109
|
+
12,
|
|
110
|
+
24,
|
|
111
|
+
36
|
|
112
|
+
],
|
|
113
|
+
day: [
|
|
114
|
+
30,
|
|
115
|
+
91,
|
|
116
|
+
182,
|
|
117
|
+
365
|
|
118
|
+
]
|
|
119
|
+
}, me = {
|
|
120
|
+
month: {
|
|
121
|
+
min: 1,
|
|
122
|
+
max: 60
|
|
123
|
+
},
|
|
124
|
+
day: {
|
|
125
|
+
min: 7,
|
|
126
|
+
max: 400
|
|
127
|
+
}
|
|
128
|
+
}, he = 6, ge = 24;
|
|
129
|
+
function d(e) {
|
|
130
|
+
return "logic" in e && "conditions" in e;
|
|
131
|
+
}
|
|
132
|
+
// src/components/DataTable/filters/filterEngine.ts
|
|
133
|
+
var _e = [
|
|
134
|
+
"contains",
|
|
135
|
+
"not_contains",
|
|
136
|
+
"starts_with",
|
|
137
|
+
"ends_with",
|
|
138
|
+
"equals",
|
|
139
|
+
"not_equals",
|
|
140
|
+
"regex",
|
|
141
|
+
"is_empty",
|
|
142
|
+
"is_not_empty"
|
|
143
|
+
], ve = [
|
|
144
|
+
"equals",
|
|
145
|
+
"not_equals",
|
|
146
|
+
"gt",
|
|
147
|
+
"gte",
|
|
148
|
+
"lt",
|
|
149
|
+
"lte",
|
|
150
|
+
"between",
|
|
151
|
+
"not_between",
|
|
152
|
+
"is_empty",
|
|
153
|
+
"is_not_empty"
|
|
154
|
+
], ye = [
|
|
155
|
+
"in_range",
|
|
156
|
+
"not_in_range",
|
|
157
|
+
"equals",
|
|
158
|
+
"before",
|
|
159
|
+
"after",
|
|
160
|
+
"is_empty",
|
|
161
|
+
"is_not_empty"
|
|
162
|
+
], be = [
|
|
163
|
+
"is_true",
|
|
164
|
+
"is_false",
|
|
165
|
+
"is_empty",
|
|
166
|
+
"is_not_empty"
|
|
167
|
+
], xe = [
|
|
168
|
+
"is",
|
|
169
|
+
"is_not",
|
|
170
|
+
"is_any_of",
|
|
171
|
+
"is_not_any_of",
|
|
172
|
+
"is_empty",
|
|
173
|
+
"is_not_empty"
|
|
174
|
+
], Se = [
|
|
175
|
+
"includes",
|
|
176
|
+
"not_includes",
|
|
177
|
+
"includes_any",
|
|
178
|
+
"includes_all",
|
|
179
|
+
"includes_only",
|
|
180
|
+
"is_empty",
|
|
181
|
+
"is_not_empty",
|
|
182
|
+
"length_equals",
|
|
183
|
+
"length_gt",
|
|
184
|
+
"length_gte",
|
|
185
|
+
"length_lt",
|
|
186
|
+
"length_lte",
|
|
187
|
+
"length_between",
|
|
188
|
+
"length_not_between"
|
|
189
|
+
];
|
|
190
|
+
function f(e) {
|
|
191
|
+
switch (e) {
|
|
192
|
+
case "number": return ve;
|
|
193
|
+
case "date": return ye;
|
|
194
|
+
case "boolean": return be;
|
|
195
|
+
case "select": return xe;
|
|
196
|
+
case "array": return Se;
|
|
197
|
+
default: return _e;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
var Ce = {
|
|
201
|
+
date: ["not_equals"],
|
|
202
|
+
select: ["contains", "equals"],
|
|
203
|
+
array: ["contains", "equals"]
|
|
204
|
+
};
|
|
205
|
+
function we(e) {
|
|
206
|
+
let t = Ce[e];
|
|
207
|
+
return t ? [...f(e), ...t] : f(e);
|
|
208
|
+
}
|
|
209
|
+
var Te = [
|
|
210
|
+
"is",
|
|
211
|
+
"is_not",
|
|
212
|
+
"is_any_of",
|
|
213
|
+
"is_not_any_of",
|
|
214
|
+
"includes_any",
|
|
215
|
+
"includes_all",
|
|
216
|
+
"includes_only"
|
|
217
|
+
];
|
|
218
|
+
function p(t, n = e) {
|
|
219
|
+
let r = n[`op_${t}`];
|
|
220
|
+
return typeof r == "string" ? r : t;
|
|
221
|
+
}
|
|
222
|
+
function Ee(t, n = e) {
|
|
223
|
+
return f(t).map((e) => ({
|
|
224
|
+
value: e,
|
|
225
|
+
label: p(e, n)
|
|
226
|
+
}));
|
|
227
|
+
}
|
|
228
|
+
var De = (e) => String(e).padStart(2, "0");
|
|
229
|
+
function m(e) {
|
|
230
|
+
if (e == null || e === "") return null;
|
|
231
|
+
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e.trim())) return e.trim();
|
|
232
|
+
let t = e instanceof Date ? e : new Date(e);
|
|
233
|
+
return Number.isNaN(t.getTime()) ? null : `${t.getFullYear()}-${De(t.getMonth() + 1)}-${De(t.getDate())}`;
|
|
234
|
+
}
|
|
235
|
+
function Oe(e, t, n) {
|
|
236
|
+
let r = m(t?.from), i = m(t?.to);
|
|
237
|
+
if (!r && !i) return !0;
|
|
238
|
+
let a = m(e);
|
|
239
|
+
if (!a) return !1;
|
|
240
|
+
let o = (!r || a >= r) && (!i || a <= i);
|
|
241
|
+
return n ? o : !o;
|
|
242
|
+
}
|
|
243
|
+
function h(e, t, r) {
|
|
244
|
+
if (!t.enabled || !t.column || !t.operator) return !0;
|
|
245
|
+
let i = r?.find((e) => e.key === t.column), a = n(e, t.column), o = i?.filterAccessor ? i.filterAccessor(a) : a, s = t.value, c = i?.type === "number";
|
|
246
|
+
switch (t.operator) {
|
|
247
|
+
case "is_empty": return Array.isArray(o) ? o.length === 0 : o == null || String(o).trim() === "";
|
|
248
|
+
case "is_not_empty": return Array.isArray(o) ? o.length > 0 : o != null && String(o).trim() !== "";
|
|
249
|
+
case "contains": return String(o ?? "").toLowerCase().includes(String(s ?? "").toLowerCase());
|
|
250
|
+
case "not_contains": return !String(o ?? "").toLowerCase().includes(String(s ?? "").toLowerCase());
|
|
251
|
+
case "starts_with": return String(o ?? "").toLowerCase().startsWith(String(s ?? "").toLowerCase());
|
|
252
|
+
case "ends_with": return String(o ?? "").toLowerCase().endsWith(String(s ?? "").toLowerCase());
|
|
253
|
+
case "equals": return c || typeof o == "number" ? Number(o) === Number(s) : String(o ?? "").toLowerCase() === String(s ?? "").toLowerCase();
|
|
254
|
+
case "not_equals": return c || typeof o == "number" ? Number(o) !== Number(s) : String(o ?? "").toLowerCase() !== String(s ?? "").toLowerCase();
|
|
255
|
+
case "regex": try {
|
|
256
|
+
return new RegExp(s, "i").test(String(o ?? ""));
|
|
257
|
+
} catch {
|
|
258
|
+
return !0;
|
|
259
|
+
}
|
|
260
|
+
case "gt": return Number(o) > Number(s);
|
|
261
|
+
case "gte": return Number(o) >= Number(s);
|
|
262
|
+
case "lt": return Number(o) < Number(s);
|
|
263
|
+
case "lte": return Number(o) <= Number(s);
|
|
264
|
+
case "between": {
|
|
265
|
+
let e = Number(o), t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
|
|
266
|
+
return e >= t && e <= n;
|
|
267
|
+
}
|
|
268
|
+
case "not_between": {
|
|
269
|
+
let e = Number(o), t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
|
|
270
|
+
return e < t || e > n;
|
|
271
|
+
}
|
|
272
|
+
case "in_range": return Oe(o, s, !0);
|
|
273
|
+
case "not_in_range": return Oe(o, s, !1);
|
|
274
|
+
case "before": return new Date(o) < new Date(s);
|
|
275
|
+
case "after": return new Date(o) > new Date(s);
|
|
276
|
+
case "is_true": return !!o;
|
|
277
|
+
case "is_false": return !o;
|
|
278
|
+
case "is": return String(o ?? "").toLowerCase() === String(s ?? "").toLowerCase();
|
|
279
|
+
case "is_not": return String(o ?? "").toLowerCase() !== String(s ?? "").toLowerCase();
|
|
280
|
+
case "is_any_of": return (Array.isArray(s) ? s : [s]).some((e) => String(o ?? "").toLowerCase() === String(e ?? "").toLowerCase());
|
|
281
|
+
case "is_not_any_of": return !(Array.isArray(s) ? s : [s]).some((e) => String(o ?? "").toLowerCase() === String(e ?? "").toLowerCase());
|
|
282
|
+
case "includes": {
|
|
283
|
+
let e = Array.isArray(o) ? o : [], t = String(s ?? "").toLowerCase(), n = i?.filterOptions;
|
|
284
|
+
return e.some((e) => {
|
|
285
|
+
if (String(e).toLowerCase().includes(t)) return !0;
|
|
286
|
+
if (n) {
|
|
287
|
+
let r = n.find((t) => String(t.value) === String(e))?.label;
|
|
288
|
+
if (r && r.toLowerCase().includes(t)) return !0;
|
|
289
|
+
}
|
|
290
|
+
return !1;
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
case "not_includes": {
|
|
294
|
+
let e = Array.isArray(o) ? o : [], t = String(s ?? "").toLowerCase(), n = i?.filterOptions;
|
|
295
|
+
return !e.some((e) => {
|
|
296
|
+
if (String(e).toLowerCase().includes(t)) return !0;
|
|
297
|
+
if (n) {
|
|
298
|
+
let r = n.find((t) => String(t.value) === String(e))?.label;
|
|
299
|
+
if (r && r.toLowerCase().includes(t)) return !0;
|
|
300
|
+
}
|
|
301
|
+
return !1;
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
case "includes_any": {
|
|
305
|
+
let e = Array.isArray(o) ? o : [];
|
|
306
|
+
return (Array.isArray(s) ? s : [s]).some((t) => e.some((e) => String(e).toLowerCase() === String(t).toLowerCase()));
|
|
307
|
+
}
|
|
308
|
+
case "includes_all": {
|
|
309
|
+
let e = Array.isArray(o) ? o : [];
|
|
310
|
+
return (Array.isArray(s) ? s : [s]).every((t) => e.some((e) => String(e).toLowerCase() === String(t).toLowerCase()));
|
|
311
|
+
}
|
|
312
|
+
case "includes_only": {
|
|
313
|
+
let e = Array.isArray(o) ? o : [], t = Array.isArray(s) ? s : [s];
|
|
314
|
+
return e.length === t.length && t.every((t) => e.some((e) => String(e).toLowerCase() === String(t).toLowerCase())) && e.every((e) => t.some((t) => String(e).toLowerCase() === String(t).toLowerCase()));
|
|
315
|
+
}
|
|
316
|
+
case "length_equals": return (Array.isArray(o) ? o.length : 0) === Number(s);
|
|
317
|
+
case "length_gt": return (Array.isArray(o) ? o.length : 0) > Number(s);
|
|
318
|
+
case "length_gte": return (Array.isArray(o) ? o.length : 0) >= Number(s);
|
|
319
|
+
case "length_lt": return (Array.isArray(o) ? o.length : 0) < Number(s);
|
|
320
|
+
case "length_lte": return (Array.isArray(o) ? o.length : 0) <= Number(s);
|
|
321
|
+
case "length_between": {
|
|
322
|
+
let e = Array.isArray(o) ? o.length : 0, t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
|
|
323
|
+
return e >= t && e <= n;
|
|
324
|
+
}
|
|
325
|
+
case "length_not_between": {
|
|
326
|
+
let e = Array.isArray(o) ? o.length : 0, t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
|
|
327
|
+
return e < t || e > n;
|
|
328
|
+
}
|
|
329
|
+
default: return !0;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function g(e, t, n) {
|
|
333
|
+
if (!t.conditions || t.conditions.length === 0) return !0;
|
|
334
|
+
let r;
|
|
335
|
+
return r = t.logic === "AND" ? t.conditions.every((t) => d(t) ? g(e, t, n) : h(e, t, n)) : t.conditions.some((t) => d(t) ? g(e, t, n) : h(e, t, n)), t.negated ? !r : r;
|
|
336
|
+
}
|
|
337
|
+
function ke(t, n, r = e) {
|
|
338
|
+
let i = [];
|
|
339
|
+
function a(e) {
|
|
340
|
+
for (let t of e) if (d(t)) a(t.conditions);
|
|
341
|
+
else if (t.enabled && t.column && t.operator) {
|
|
342
|
+
let e = n.find((e) => e.key === t.column), a = f(e?.type || "string").includes(t.operator);
|
|
343
|
+
i.push({
|
|
344
|
+
id: t.id,
|
|
345
|
+
column: t.column,
|
|
346
|
+
columnLabel: e?.header || t.column,
|
|
347
|
+
operator: t.operator,
|
|
348
|
+
operatorLabel: a ? p(t.operator, r) : t.operator,
|
|
349
|
+
value: t.value,
|
|
350
|
+
displayValue: je(t.value, t.operator, e?.filterOptions, r)
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return a(t.conditions), i;
|
|
355
|
+
}
|
|
356
|
+
function Ae(e, t) {
|
|
357
|
+
if (!t) return String(e ?? "");
|
|
358
|
+
let n = t.find((t) => String(t.value) === String(e));
|
|
359
|
+
return n ? n.label : String(e ?? "");
|
|
360
|
+
}
|
|
361
|
+
function je(e, t, n, r) {
|
|
362
|
+
if (t === "is_empty" || t === "is_not_empty") return "";
|
|
363
|
+
if (t === "is_true") return r.filterTrue;
|
|
364
|
+
if (t === "is_false") return r.filterFalse;
|
|
365
|
+
if (t === "between" || t === "not_between") return `${e?.from ?? e?.[0] ?? ""} - ${e?.to ?? e?.[1] ?? ""}`;
|
|
366
|
+
if (t === "in_range" || t === "not_in_range") {
|
|
367
|
+
let t = e?.from ?? "", n = e?.to ?? "";
|
|
368
|
+
return t && n ? r.filterRangeBoth(String(t), String(n)) : t ? r.filterRangeFrom(String(t)) : n ? r.filterRangeUntil(String(n)) : "";
|
|
369
|
+
}
|
|
370
|
+
return (t === "is_any_of" || t === "is_not_any_of" || t === "includes_any" || t === "includes_all" || t === "includes_only") && Array.isArray(e) ? e.map((e) => Ae(e, n)).join(", ") : e == null ? "" : Ae(e, n);
|
|
371
|
+
}
|
|
372
|
+
function Me(e, t) {
|
|
373
|
+
let n = e.conditions.filter((e) => d(e) ? !0 : e.id !== t).map((e) => d(e) ? Me(e, t) : e).filter((e) => !d(e) || e.conditions.length > 0);
|
|
374
|
+
return {
|
|
375
|
+
...e,
|
|
376
|
+
conditions: n
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
function Ne(e) {
|
|
380
|
+
return e.conditions.some((e) => d(e) ? Ne(e) : e.enabled && e.column && e.operator);
|
|
381
|
+
}
|
|
382
|
+
// src/components/DataTable/grouping/groupModel.ts
|
|
383
|
+
var Pe = 3, _ = (e) => JSON.stringify(e.map((e) => [e.key, e.value]));
|
|
384
|
+
function Fe(e, t) {
|
|
385
|
+
let n = e.grouping, r = typeof n == "object" && n ? n : {};
|
|
386
|
+
return {
|
|
387
|
+
enabled: n !== !1 && t.allowed && (!t.serverMode || t.hasGroupsSource),
|
|
388
|
+
maxDepth: Math.max(1, Math.min(r.maxDepth ?? 3, 6)),
|
|
389
|
+
defaultLevels: r.defaultGroupBy ?? []
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function Ie(e, t) {
|
|
393
|
+
return e.filter((e) => e.authorized !== !1 && v(e, t));
|
|
394
|
+
}
|
|
395
|
+
function v(e, t) {
|
|
396
|
+
return e.groupable ?? (!t && (e.type === "select" || e.type === "boolean"));
|
|
397
|
+
}
|
|
398
|
+
function Le(e, t, n) {
|
|
399
|
+
let r = [];
|
|
400
|
+
for (let n of e ?? []) t.includes(n) && !r.includes(n) && r.push(n);
|
|
401
|
+
return r.slice(0, n);
|
|
402
|
+
}
|
|
403
|
+
function y(e, t) {
|
|
404
|
+
let r = n(t, e.key);
|
|
405
|
+
if (e.filterAccessor && (r = e.filterAccessor(r)), r == null || r === "") return null;
|
|
406
|
+
if (Array.isArray(r)) {
|
|
407
|
+
let e = r.filter((e) => e != null && e !== "").map(String).sort();
|
|
408
|
+
return e.length ? e.join("|") : null;
|
|
409
|
+
}
|
|
410
|
+
return r instanceof Date ? r.toISOString().slice(0, 10) : e.type === "date" ? String(r).slice(0, 10) : typeof r == "boolean" || typeof r == "number" ? r : String(r);
|
|
411
|
+
}
|
|
412
|
+
function b(e, t, n, r) {
|
|
413
|
+
if (t == null) return r || n.groupEmpty;
|
|
414
|
+
if (r) return r;
|
|
415
|
+
if (typeof t == "boolean") return t ? n.yes : n.no;
|
|
416
|
+
if (e?.type === "boolean" && (t === "true" || t === "false")) return t === "true" ? n.yes : n.no;
|
|
417
|
+
let i = (t) => e?.filterOptions?.find((e) => String(e.value) === t)?.label ?? t;
|
|
418
|
+
return e?.type === "array" && typeof t == "string" ? t.split("|").map(i).join(", ") : i(String(t));
|
|
419
|
+
}
|
|
420
|
+
var x = typeof Intl < "u" ? new Intl.Collator(void 0, {
|
|
421
|
+
numeric: !0,
|
|
422
|
+
sensitivity: "base"
|
|
423
|
+
}) : null, Re = (e, t) => x ? x.compare(e, t) : e.localeCompare(t);
|
|
424
|
+
function ze(e, t) {
|
|
425
|
+
return [...e].sort((e, n) => {
|
|
426
|
+
if (e.value === null && n.value !== null) return 1;
|
|
427
|
+
if (n.value === null && e.value !== null) return -1;
|
|
428
|
+
let r = typeof e.value == "number" && typeof n.value == "number" ? e.value - n.value : Re(e.label, n.label);
|
|
429
|
+
return t ? -r : r;
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
function S(e, t, n, r) {
|
|
433
|
+
if (!t.length) return [];
|
|
434
|
+
let [i, ...a] = t, o = r.parent ?? [], s = /* @__PURE__ */ new Map();
|
|
435
|
+
for (let t of e) {
|
|
436
|
+
let e = y(i, n(t)), r = JSON.stringify(e), a = s.get(r);
|
|
437
|
+
a || s.set(r, a = {
|
|
438
|
+
value: e,
|
|
439
|
+
rows: []
|
|
440
|
+
}), a.rows.push(t);
|
|
441
|
+
}
|
|
442
|
+
return ze(Array.from(s.values()).map((e) => {
|
|
443
|
+
let t = [...o, {
|
|
444
|
+
key: i.key,
|
|
445
|
+
field: i.field || i.key,
|
|
446
|
+
value: e.value
|
|
447
|
+
}];
|
|
448
|
+
return {
|
|
449
|
+
key: _(t),
|
|
450
|
+
path: t,
|
|
451
|
+
depth: o.length,
|
|
452
|
+
columnKey: i.key,
|
|
453
|
+
value: e.value,
|
|
454
|
+
label: b(i, e.value, r.labels),
|
|
455
|
+
count: e.rows.length,
|
|
456
|
+
rows: e.rows,
|
|
457
|
+
children: a.length ? S(e.rows, a, n, {
|
|
458
|
+
...r,
|
|
459
|
+
parent: t
|
|
460
|
+
}) : void 0
|
|
461
|
+
};
|
|
462
|
+
}), r.sortedDesc?.(i.key) === !0);
|
|
463
|
+
}
|
|
464
|
+
function Be(e, t = []) {
|
|
465
|
+
for (let n of e ?? []) t.push(n.key), Be(n.children, t);
|
|
466
|
+
return t;
|
|
467
|
+
}
|
|
468
|
+
function Ve(e, t) {
|
|
469
|
+
let n = [], r = (e) => {
|
|
470
|
+
for (let i of e) {
|
|
471
|
+
let e = t.expanded.has(i.key);
|
|
472
|
+
if (n.push({
|
|
473
|
+
kind: "group",
|
|
474
|
+
key: `g:${i.key}`,
|
|
475
|
+
node: i,
|
|
476
|
+
expanded: e
|
|
477
|
+
}), !e) continue;
|
|
478
|
+
let a = i.depth >= t.levels - 1;
|
|
479
|
+
if (!t.loadState) {
|
|
480
|
+
if (!a && i.children) r(i.children);
|
|
481
|
+
else for (let e of i.rows ?? []) n.push({
|
|
482
|
+
kind: "row",
|
|
483
|
+
key: `r:${t.rowKey(e)}`,
|
|
484
|
+
row: e,
|
|
485
|
+
depth: i.depth + 1
|
|
486
|
+
});
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
let o = t.loadState(i);
|
|
490
|
+
if (!a) {
|
|
491
|
+
i.children ? r(i.children) : n.push({
|
|
492
|
+
kind: "status",
|
|
493
|
+
key: `s:${i.key}`,
|
|
494
|
+
node: i,
|
|
495
|
+
status: o?.status === "error" ? "error" : "loading"
|
|
496
|
+
});
|
|
497
|
+
continue;
|
|
498
|
+
}
|
|
499
|
+
if (!o || o.status !== "done" && !o.rows?.length) {
|
|
500
|
+
n.push({
|
|
501
|
+
kind: "status",
|
|
502
|
+
key: `s:${i.key}`,
|
|
503
|
+
node: i,
|
|
504
|
+
status: o?.status === "error" ? "error" : "loading"
|
|
505
|
+
});
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
let s = o.rows ?? [];
|
|
509
|
+
for (let e of s) n.push({
|
|
510
|
+
kind: "row",
|
|
511
|
+
key: `r:${t.rowKey(e)}`,
|
|
512
|
+
row: e,
|
|
513
|
+
depth: i.depth + 1
|
|
514
|
+
});
|
|
515
|
+
s.length < i.count && n.push({
|
|
516
|
+
kind: "more",
|
|
517
|
+
key: `m:${i.key}`,
|
|
518
|
+
node: i,
|
|
519
|
+
shown: s.length,
|
|
520
|
+
loading: !!o.loadingMore,
|
|
521
|
+
capped: !!o.capped
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
return r(e), n;
|
|
526
|
+
}
|
|
527
|
+
var He = (e) => e.kind === "group" ? e.node.depth : e.kind === "row" ? e.depth : e.node.depth + 1;
|
|
528
|
+
function Ue(e, t, n) {
|
|
529
|
+
let r = t * n, i = e.slice(r, r + n), a = i[0];
|
|
530
|
+
if (!a || r === 0) return i;
|
|
531
|
+
let o = [];
|
|
532
|
+
for (let t = 0; t < r; t++) {
|
|
533
|
+
let n = e[t];
|
|
534
|
+
n.kind === "group" && (o.length = n.node.depth, o.push(n));
|
|
535
|
+
}
|
|
536
|
+
let s = He(a);
|
|
537
|
+
return [...o.slice(0, s).map((e) => ({
|
|
538
|
+
...e,
|
|
539
|
+
key: `${e.key}:cont`,
|
|
540
|
+
continued: !0
|
|
541
|
+
})), ...i];
|
|
542
|
+
}
|
|
543
|
+
function We(e, t, n, r) {
|
|
544
|
+
return r === null ? {
|
|
545
|
+
id: e,
|
|
546
|
+
column: t,
|
|
547
|
+
operator: "is_empty",
|
|
548
|
+
value: "",
|
|
549
|
+
enabled: !0
|
|
550
|
+
} : n?.type === "boolean" || typeof r == "boolean" ? {
|
|
551
|
+
id: e,
|
|
552
|
+
column: t,
|
|
553
|
+
operator: r === !0 || r === "true" ? "is_true" : "is_false",
|
|
554
|
+
value: "",
|
|
555
|
+
enabled: !0
|
|
556
|
+
} : n?.type === "array" ? {
|
|
557
|
+
id: e,
|
|
558
|
+
column: t,
|
|
559
|
+
operator: "includes",
|
|
560
|
+
value: r,
|
|
561
|
+
enabled: !0
|
|
562
|
+
} : n?.type === "select" ? {
|
|
563
|
+
id: e,
|
|
564
|
+
column: t,
|
|
565
|
+
operator: "is",
|
|
566
|
+
value: r,
|
|
567
|
+
enabled: !0
|
|
568
|
+
} : {
|
|
569
|
+
id: e,
|
|
570
|
+
column: t,
|
|
571
|
+
operator: "equals",
|
|
572
|
+
value: r,
|
|
573
|
+
enabled: !0
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
function Ge(e) {
|
|
577
|
+
return [...e.type === "boolean" ? ["is_true", "is_false"] : e.type === "array" ? ["includes"] : e.type === "select" ? ["is"] : ["equals"], "is_empty"];
|
|
578
|
+
}
|
|
579
|
+
function Ke(e, t) {
|
|
580
|
+
return e.map((e, n) => We(`group:${n}:${e.key}`, e.key, t.find((t) => t.key === e.key), e.value));
|
|
581
|
+
}
|
|
582
|
+
function qe(e, t, n) {
|
|
583
|
+
let r = Ke(t, n);
|
|
584
|
+
return r.length ? e.logic === "AND" && !e.negated ? {
|
|
585
|
+
...e,
|
|
586
|
+
conditions: [...e.conditions, ...r]
|
|
587
|
+
} : {
|
|
588
|
+
id: "group-path",
|
|
589
|
+
logic: "AND",
|
|
590
|
+
conditions: e.conditions.length ? [e, ...r] : r
|
|
591
|
+
} : e;
|
|
592
|
+
}
|
|
593
|
+
// src/components/DataTable/summary/summaryModel.ts
|
|
594
|
+
var Je = "summary:", C = (e) => `${Je}${e}`, Ye = (e) => e.kind === "breakdown" || e.kind === "trend" || e.kind === "funnel";
|
|
595
|
+
function Xe(e) {
|
|
596
|
+
return e.kind === "value" ? e.trend ? u.value : ["number"] : e.kind === "trend" ? [
|
|
597
|
+
...e.period === "day" ? ["calendar"] : [],
|
|
598
|
+
"columns",
|
|
599
|
+
"line",
|
|
600
|
+
"area",
|
|
601
|
+
...e.split ? ["grouped", "stacked"] : []
|
|
602
|
+
] : u[e.kind];
|
|
603
|
+
}
|
|
604
|
+
function w(e) {
|
|
605
|
+
let t = Xe(e), n = "chart" in e ? e.chart : void 0;
|
|
606
|
+
return n && t.includes(n) ? n : t[0];
|
|
607
|
+
}
|
|
608
|
+
function Ze(e) {
|
|
609
|
+
return e.kind === "value" ? [e.value, ...e.sub ? [e.sub.value] : []] : e.kind === "ratio" ? [
|
|
610
|
+
e.value,
|
|
611
|
+
e.total,
|
|
612
|
+
...e.sub ? [e.sub.value] : []
|
|
613
|
+
] : [];
|
|
614
|
+
}
|
|
615
|
+
var Qe = 9;
|
|
616
|
+
function $e(e) {
|
|
617
|
+
if (e === "all") return { from: "all" };
|
|
618
|
+
let t = /^(top|least)(\d+)$/.exec(e);
|
|
619
|
+
return {
|
|
620
|
+
from: t[1],
|
|
621
|
+
count: Number(t[2])
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
function T(e, t = 9) {
|
|
625
|
+
return e.show ? $e(e.show) : w(e) === "bars" ? { from: "all" } : {
|
|
626
|
+
from: "top",
|
|
627
|
+
count: t
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
var et = (e) => e.label ?? (e.value === null ? "" : String(e.value));
|
|
631
|
+
function tt(e, t) {
|
|
632
|
+
let n = [...e].sort((e, t) => t.count - e.count || et(e).localeCompare(et(t)));
|
|
633
|
+
return t.from === "all" || t.count >= n.length ? {
|
|
634
|
+
buckets: t.from === "least" ? n.reverse() : n,
|
|
635
|
+
others: 0,
|
|
636
|
+
values: e.length
|
|
637
|
+
} : {
|
|
638
|
+
buckets: t.from === "top" ? n.slice(0, t.count) : n.slice(-t.count).reverse(),
|
|
639
|
+
others: (t.from === "top" ? n.slice(t.count) : n.slice(0, -t.count)).reduce((e, t) => e + t.count, 0),
|
|
640
|
+
values: e.length
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
var nt = (e) => !!e.within && w(e) === "treemap", E = (e) => !!e.split && (w(e) === "grouped" || w(e) === "stacked"), rt = (e) => !!e.trend && w(e) === "numberTrend";
|
|
644
|
+
function it(e, t) {
|
|
645
|
+
switch (e.kind) {
|
|
646
|
+
case "trend": return `${e.id}.${e.period === "day" ? "d" : "m"}${e.count}${E(e) ? `.s${e.split}` : ""}`;
|
|
647
|
+
case "funnel": return `${e.id}.f`;
|
|
648
|
+
case "value": return `${e.id}.t${e.trend?.period === "day" ? "d" : "m"}${e.trend?.count ?? 0}`;
|
|
649
|
+
case "breakdown": {
|
|
650
|
+
let n = T(e, t);
|
|
651
|
+
return `${e.id}.${n.from === "all" ? "all" : `${n.from}${n.count}`}${nt(e) ? `.w${e.within}` : ""}`;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
function at(e, t) {
|
|
656
|
+
let n = Array.from(new Set(e.flatMap((e) => Ze(e).map((e) => e.id)))), r = (e) => t.find((t) => t.key === e)?.field || e, i = /* @__PURE__ */ new Map();
|
|
657
|
+
for (let t of e) {
|
|
658
|
+
if (t.kind === "ratio" || t.kind === "value" && !rt(t)) continue;
|
|
659
|
+
let e = it(t);
|
|
660
|
+
if (!i.has(e)) switch (t.kind) {
|
|
661
|
+
case "value":
|
|
662
|
+
i.set(e, {
|
|
663
|
+
key: e,
|
|
664
|
+
id: t.id,
|
|
665
|
+
kind: "series",
|
|
666
|
+
value: t.value.id,
|
|
667
|
+
field: r(t.trend.column),
|
|
668
|
+
period: t.trend.period,
|
|
669
|
+
count: t.trend.count
|
|
670
|
+
});
|
|
671
|
+
break;
|
|
672
|
+
case "breakdown":
|
|
673
|
+
i.set(e, {
|
|
674
|
+
key: e,
|
|
675
|
+
id: t.id,
|
|
676
|
+
kind: "breakdown",
|
|
677
|
+
field: r(t.column),
|
|
678
|
+
part: T(t),
|
|
679
|
+
...nt(t) ? { within: r(t.within) } : {}
|
|
680
|
+
});
|
|
681
|
+
break;
|
|
682
|
+
case "trend":
|
|
683
|
+
i.set(e, {
|
|
684
|
+
key: e,
|
|
685
|
+
id: t.id,
|
|
686
|
+
kind: "trend",
|
|
687
|
+
field: r(t.column),
|
|
688
|
+
period: t.period,
|
|
689
|
+
count: t.count,
|
|
690
|
+
...E(t) ? { split: r(t.split) } : {}
|
|
691
|
+
});
|
|
692
|
+
break;
|
|
693
|
+
case "funnel": i.set(e, {
|
|
694
|
+
key: e,
|
|
695
|
+
id: t.id,
|
|
696
|
+
kind: "funnel",
|
|
697
|
+
steps: t.steps.map((e) => e.value.id)
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
return {
|
|
702
|
+
values: n,
|
|
703
|
+
cards: Array.from(i.values())
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
function ot(e, t) {
|
|
707
|
+
if (e.logic !== "AND" || e.negated) return;
|
|
708
|
+
let n = C(t);
|
|
709
|
+
return e.conditions.find((e) => !d(e) && e.id === n && e.enabled);
|
|
710
|
+
}
|
|
711
|
+
function st(e, t) {
|
|
712
|
+
let n = ot(e, t);
|
|
713
|
+
return n ? {
|
|
714
|
+
...e,
|
|
715
|
+
conditions: e.conditions.filter((e) => e !== n)
|
|
716
|
+
} : e;
|
|
717
|
+
}
|
|
718
|
+
function ct(e, n, r) {
|
|
719
|
+
let i = C(n), a = e.logic === "AND" && !e.negated ? e : {
|
|
720
|
+
id: t(),
|
|
721
|
+
logic: "AND",
|
|
722
|
+
conditions: e.conditions.length ? [e] : []
|
|
723
|
+
}, o = a.conditions.filter((e) => d(e) || e.id !== i);
|
|
724
|
+
return {
|
|
725
|
+
...a,
|
|
726
|
+
conditions: r ? [...o, r] : o
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
function lt(e, t, n) {
|
|
730
|
+
return We(C(e.id), e.column, t, n);
|
|
731
|
+
}
|
|
732
|
+
function ut(e, t) {
|
|
733
|
+
let n = C(e.id);
|
|
734
|
+
if (t.length > 7) return {
|
|
735
|
+
id: n,
|
|
736
|
+
column: e.column,
|
|
737
|
+
operator: "in_range",
|
|
738
|
+
value: {
|
|
739
|
+
from: t,
|
|
740
|
+
to: t
|
|
741
|
+
},
|
|
742
|
+
enabled: !0
|
|
743
|
+
};
|
|
744
|
+
let [r, i] = t.split("-").map(Number), a = new Date(r, i, 0).getDate();
|
|
745
|
+
return {
|
|
746
|
+
id: n,
|
|
747
|
+
column: e.column,
|
|
748
|
+
operator: "in_range",
|
|
749
|
+
value: {
|
|
750
|
+
from: `${t}-01`,
|
|
751
|
+
to: `${t}-${String(a).padStart(2, "0")}`
|
|
752
|
+
},
|
|
753
|
+
enabled: !0
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
function dt(e, t) {
|
|
757
|
+
let n = e.steps.find((e) => e.id === t);
|
|
758
|
+
return n?.condition ? {
|
|
759
|
+
id: C(e.id),
|
|
760
|
+
...n.condition,
|
|
761
|
+
enabled: !0
|
|
762
|
+
} : null;
|
|
763
|
+
}
|
|
764
|
+
var D = (e) => e === null ? "" : String(e), ft = "\0others";
|
|
765
|
+
function pt(e, t) {
|
|
766
|
+
if (!t) return null;
|
|
767
|
+
if (e.kind === "trend") {
|
|
768
|
+
let n = t.value?.from;
|
|
769
|
+
return typeof n == "string" ? n.slice(0, e.period === "day" ? 10 : 7) : null;
|
|
770
|
+
}
|
|
771
|
+
return e.kind === "funnel" ? e.steps.find((e) => !!e.condition && e.condition.column === t.column && e.condition.operator === t.operator && JSON.stringify(e.condition.value) === JSON.stringify(t.value))?.id ?? null : t.operator === "is_empty" ? "" : t.operator === "is_true" ? "true" : t.operator === "is_false" ? "false" : String(t.value);
|
|
772
|
+
}
|
|
773
|
+
function O(e, t) {
|
|
774
|
+
return e.compute ? e.compute(t) : t.length;
|
|
775
|
+
}
|
|
776
|
+
function k(e, t) {
|
|
777
|
+
let n = /* @__PURE__ */ new Map();
|
|
778
|
+
for (let r of e) {
|
|
779
|
+
let e = y(t, r), i = D(e), a = n.get(i);
|
|
780
|
+
a ? a.count++ : n.set(i, {
|
|
781
|
+
value: e,
|
|
782
|
+
count: 1
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
return Array.from(n.values());
|
|
786
|
+
}
|
|
787
|
+
function mt(e, t, n, r) {
|
|
788
|
+
return {
|
|
789
|
+
...e,
|
|
790
|
+
buckets: e.buckets.map((e) => ({
|
|
791
|
+
...e,
|
|
792
|
+
children: k(t.filter((t) => D(y(n, t)) === D(e.value)), r)
|
|
793
|
+
}))
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
function ht(e, t = /* @__PURE__ */ new Date()) {
|
|
797
|
+
return Array.from({ length: e }, (n, r) => {
|
|
798
|
+
let i = new Date(t.getFullYear(), t.getMonth() - (e - 1 - r), 1);
|
|
799
|
+
return `${i.getFullYear()}-${String(i.getMonth() + 1).padStart(2, "0")}`;
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
function A(e, t = /* @__PURE__ */ new Date()) {
|
|
803
|
+
let n = (e) => String(e).padStart(2, "0");
|
|
804
|
+
return Array.from({ length: e }, (r, i) => {
|
|
805
|
+
let a = new Date(t.getFullYear(), t.getMonth(), t.getDate() - (e - 1 - i));
|
|
806
|
+
return `${a.getFullYear()}-${n(a.getMonth() + 1)}-${n(a.getDate())}`;
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
function gt(e, t, r, i) {
|
|
810
|
+
let a = new Map(r.map((e) => [e, []]));
|
|
811
|
+
for (let r of e) {
|
|
812
|
+
let e = m(n(r, t.key)), o = e === null ? null : i === "month" ? e.slice(0, 7) : e;
|
|
813
|
+
o !== null && a.get(o)?.push(r);
|
|
814
|
+
}
|
|
815
|
+
return a;
|
|
816
|
+
}
|
|
817
|
+
function _t(e, t, n, r, i, a) {
|
|
818
|
+
let o = n === "month" ? ht(r, i) : A(r, i), s = gt(e, t, o, n);
|
|
819
|
+
return o.map((e) => {
|
|
820
|
+
let t = s.get(e);
|
|
821
|
+
return {
|
|
822
|
+
period: e,
|
|
823
|
+
count: t.length,
|
|
824
|
+
...a ? { split: k(t, a) } : {}
|
|
825
|
+
};
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
function vt(e, t, n, r, i, a) {
|
|
829
|
+
let o = r === "month" ? ht(2 * i, a) : A(2 * i, a), s = gt(e, n, o, r), c = o.slice(0, i).flatMap((e) => s.get(e));
|
|
830
|
+
return {
|
|
831
|
+
points: o.slice(i).map((e) => ({
|
|
832
|
+
period: e,
|
|
833
|
+
count: O(t, s.get(e))
|
|
834
|
+
})),
|
|
835
|
+
previous: O(t, c)
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
function yt(e, t, n, r, i, a) {
|
|
839
|
+
let o = n.buckets.map((e) => ({
|
|
840
|
+
...e,
|
|
841
|
+
key: D(e.value),
|
|
842
|
+
label: b(t, e.value, r, e.label)
|
|
843
|
+
})), s = T(e, i).from === "least";
|
|
844
|
+
o.sort((e, t) => (s ? e.count - t.count : t.count - e.count) || e.label.localeCompare(t.label));
|
|
845
|
+
let c = o.map((t, n) => ({
|
|
846
|
+
key: t.key,
|
|
847
|
+
value: t.value,
|
|
848
|
+
label: t.label,
|
|
849
|
+
count: t.count,
|
|
850
|
+
slot: e.slots?.[t.key] ?? n + 1,
|
|
851
|
+
...t.children ? { children: [...t.children].sort((e, t) => t.count - e.count).map((e) => ({
|
|
852
|
+
key: D(e.value),
|
|
853
|
+
label: b(a, e.value, r, e.label),
|
|
854
|
+
count: e.count
|
|
855
|
+
})) } : {}
|
|
856
|
+
}));
|
|
857
|
+
return n.others > 0 && c.push({
|
|
858
|
+
key: ft,
|
|
859
|
+
value: null,
|
|
860
|
+
label: r.others,
|
|
861
|
+
count: n.others,
|
|
862
|
+
slot: "rest",
|
|
863
|
+
others: !0
|
|
864
|
+
}), c;
|
|
865
|
+
}
|
|
866
|
+
var bt = (e, t) => {
|
|
867
|
+
try {
|
|
868
|
+
return new Intl.DateTimeFormat(e, t);
|
|
869
|
+
} catch {
|
|
870
|
+
return new Intl.DateTimeFormat(void 0, t);
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
function xt(e, t, n) {
|
|
874
|
+
let r = bt(n, t === "month" ? { month: "short" } : {
|
|
875
|
+
day: "numeric",
|
|
876
|
+
month: "short"
|
|
877
|
+
}), i = bt(n, t === "month" ? {
|
|
878
|
+
month: "long",
|
|
879
|
+
year: "numeric"
|
|
880
|
+
} : { dateStyle: "medium" });
|
|
881
|
+
return e.map(({ period: e, count: t }) => {
|
|
882
|
+
let [n, a, o] = e.split("-").map(Number), s = new Date(n, a - 1, o ?? 1);
|
|
883
|
+
return {
|
|
884
|
+
key: e,
|
|
885
|
+
label: r.format(s),
|
|
886
|
+
fullLabel: i.format(s),
|
|
887
|
+
count: t
|
|
888
|
+
};
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
function St(e, t, n, r) {
|
|
892
|
+
let i = /* @__PURE__ */ new Map(), a = t.map((e) => {
|
|
893
|
+
let t = {};
|
|
894
|
+
for (let a of e.split ?? []) {
|
|
895
|
+
let e = D(a.value);
|
|
896
|
+
t[e] = (t[e] ?? 0) + a.count;
|
|
897
|
+
let o = i.get(e) ?? {
|
|
898
|
+
value: a.value,
|
|
899
|
+
label: b(n, a.value, r, a.label),
|
|
900
|
+
count: 0
|
|
901
|
+
};
|
|
902
|
+
o.count += a.count, i.set(e, o);
|
|
903
|
+
}
|
|
904
|
+
return t;
|
|
905
|
+
});
|
|
906
|
+
return {
|
|
907
|
+
series: Array.from(i.entries()).sort((e, t) => t[1].count - e[1].count || e[1].label.localeCompare(t[1].label)).map(([t, n], r) => ({
|
|
908
|
+
key: t,
|
|
909
|
+
label: n.label,
|
|
910
|
+
slot: e.slots?.[t] ?? r + 1
|
|
911
|
+
})),
|
|
912
|
+
perPeriod: a
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
var j = (e, t) => t > 0 ? e / t * 100 : 0;
|
|
916
|
+
function M(e) {
|
|
917
|
+
return e > 0 && e < 1 ? "<1%" : e > 99 && e < 100 ? ">99%" : `${Math.round(e)}%`;
|
|
918
|
+
}
|
|
919
|
+
function Ct(e, t) {
|
|
920
|
+
return e.text ? e.text(t) : `${e.label}: ${t}`;
|
|
921
|
+
}
|
|
922
|
+
function wt(e, t) {
|
|
923
|
+
return e.flatMap((e) => e.kind === "value" && e.value !== null ? [`${e.card.title} ${t(e.value)}`] : e.kind === "ratio" && e.value !== null && e.total !== null ? [`${e.card.title} ${M(j(e.value, e.total))}`] : []).join(" · ");
|
|
924
|
+
}
|
|
925
|
+
function Tt(e, t, n) {
|
|
926
|
+
let r = {}, i = [];
|
|
927
|
+
for (let a of e) {
|
|
928
|
+
if (a.kind === "value" && a.value !== null && (r[a.card.title] = a.value), a.kind === "ratio" && a.value !== null && a.total !== null && (r[a.card.title] = `${n(a.value)} / ${n(a.total)} (${M(j(a.value, a.total))})`), (a.kind === "value" || a.kind === "ratio") && a.sub && a.sub.value !== null && (r[a.sub.line.label] = a.sub.value), a.kind === "breakdown" && a.buckets && i.push({
|
|
929
|
+
id: a.key,
|
|
930
|
+
title: a.card.title,
|
|
931
|
+
header: [a.column?.header ?? a.card.column, t.summaryCount],
|
|
932
|
+
rows: a.buckets.map((e) => ({
|
|
933
|
+
label: e.label,
|
|
934
|
+
count: e.count
|
|
935
|
+
}))
|
|
936
|
+
}), a.kind === "trend" && a.periods) {
|
|
937
|
+
let e = a.card.period === "day", n = (e ? a.periods.filter((e) => e.count > 0) : a.periods).map((e) => ({
|
|
938
|
+
label: e.fullLabel,
|
|
939
|
+
count: e.count
|
|
940
|
+
}));
|
|
941
|
+
i.push({
|
|
942
|
+
id: a.key,
|
|
943
|
+
title: a.card.title,
|
|
944
|
+
header: [e ? t.summaryDay : t.summaryMonth, t.summaryCount],
|
|
945
|
+
rows: n
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
a.kind === "funnel" && a.steps && i.push({
|
|
949
|
+
id: a.key,
|
|
950
|
+
title: a.card.title,
|
|
951
|
+
header: [t.summaryStep, t.summaryCount],
|
|
952
|
+
rows: a.steps.map((e) => ({
|
|
953
|
+
label: e.label,
|
|
954
|
+
count: e.count
|
|
955
|
+
}))
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
return {
|
|
959
|
+
items: r,
|
|
960
|
+
...i.length ? { tables: i } : {}
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
// src/components/Charts/palette.ts
|
|
964
|
+
var Et = 10, N = {
|
|
965
|
+
light: {
|
|
966
|
+
1: "#2a78d6",
|
|
967
|
+
2: "#eb6834",
|
|
968
|
+
3: "#1baf7a",
|
|
969
|
+
4: "#9257d1",
|
|
970
|
+
5: "#d9a40e",
|
|
971
|
+
6: "#d6457f",
|
|
972
|
+
7: "#1592b0",
|
|
973
|
+
8: "#9c6b3f",
|
|
974
|
+
9: "#728a1c",
|
|
975
|
+
10: "#cf3c3c",
|
|
976
|
+
rest: "#b3b7bf",
|
|
977
|
+
positive: "#2e7d4f",
|
|
978
|
+
warning: "#d98a00",
|
|
979
|
+
negative: "#c62828",
|
|
980
|
+
info: "#3b6fd8",
|
|
981
|
+
neutral: "#8a8a99"
|
|
982
|
+
},
|
|
983
|
+
dark: {
|
|
984
|
+
1: "#3987e5",
|
|
985
|
+
2: "#d95926",
|
|
986
|
+
3: "#199e70",
|
|
987
|
+
4: "#a676e3",
|
|
988
|
+
5: "#e2b53a",
|
|
989
|
+
6: "#e5679a",
|
|
990
|
+
7: "#2fadcb",
|
|
991
|
+
8: "#b98a5f",
|
|
992
|
+
9: "#93ab3a",
|
|
993
|
+
10: "#e66363",
|
|
994
|
+
rest: "#4a4f59",
|
|
995
|
+
positive: "#3fa56b",
|
|
996
|
+
warning: "#e0a030",
|
|
997
|
+
negative: "#ef5350",
|
|
998
|
+
info: "#6b95ea",
|
|
999
|
+
neutral: "#737380"
|
|
1000
|
+
}
|
|
1001
|
+
}, Dt = {
|
|
1002
|
+
light: {
|
|
1003
|
+
lightness: [
|
|
1004
|
+
.46,
|
|
1005
|
+
.54,
|
|
1006
|
+
.62,
|
|
1007
|
+
.7,
|
|
1008
|
+
.78
|
|
1009
|
+
],
|
|
1010
|
+
chroma: [
|
|
1011
|
+
.09,
|
|
1012
|
+
.13,
|
|
1013
|
+
.17
|
|
1014
|
+
],
|
|
1015
|
+
hueStep: 8,
|
|
1016
|
+
background: "#ffffff"
|
|
1017
|
+
},
|
|
1018
|
+
dark: {
|
|
1019
|
+
lightness: [
|
|
1020
|
+
.58,
|
|
1021
|
+
.66,
|
|
1022
|
+
.74,
|
|
1023
|
+
.82,
|
|
1024
|
+
.9
|
|
1025
|
+
],
|
|
1026
|
+
chroma: [
|
|
1027
|
+
.09,
|
|
1028
|
+
.13,
|
|
1029
|
+
.17
|
|
1030
|
+
],
|
|
1031
|
+
hueStep: 8,
|
|
1032
|
+
background: "#1f1f1f"
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
function Ot(e, t, n) {
|
|
1036
|
+
let r = n * Math.PI / 180, i = t * Math.cos(r), a = t * Math.sin(r), o = (e + .3963377774 * i + .2158037573 * a) ** 3, s = (e - .1055613458 * i - .0638541728 * a) ** 3, c = (e - .0894841775 * i - 1.291485548 * a) ** 3;
|
|
1037
|
+
return [
|
|
1038
|
+
4.0767416621 * o - 3.3077115913 * s + .2309699292 * c,
|
|
1039
|
+
-1.2684380046 * o + 2.6097574011 * s - .3413193965 * c,
|
|
1040
|
+
-.0041960863 * o - .7034186147 * s + 1.707614701 * c
|
|
1041
|
+
];
|
|
1042
|
+
}
|
|
1043
|
+
var kt = (e) => `#${e.map((e) => {
|
|
1044
|
+
let t = Math.min(1, Math.max(0, e)), n = t <= .0031308 ? 12.92 * t : 1.055 * t ** (1 / 2.4) - .055;
|
|
1045
|
+
return Math.round(n * 255).toString(16).padStart(2, "0");
|
|
1046
|
+
}).join("")}`, At = (e, t, n) => kt(Ot(e, t, n));
|
|
1047
|
+
function P(e) {
|
|
1048
|
+
let t = (t) => {
|
|
1049
|
+
let n = parseInt(e.slice(t, t + 2), 16) / 255;
|
|
1050
|
+
return n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4;
|
|
1051
|
+
}, [n, r, i] = [
|
|
1052
|
+
t(1),
|
|
1053
|
+
t(3),
|
|
1054
|
+
t(5)
|
|
1055
|
+
], a = Math.cbrt(.4122214708 * n + .5363325363 * r + .0514459929 * i), o = Math.cbrt(.2119034982 * n + .6806995451 * r + .1073969566 * i), s = Math.cbrt(.0883024619 * n + .2817188376 * r + .6299787005 * i);
|
|
1056
|
+
return [
|
|
1057
|
+
.2104542553 * a + .793617785 * o - .0040720468 * s,
|
|
1058
|
+
1.9779984951 * a - 2.428592205 * o + .4505937099 * s,
|
|
1059
|
+
.0259040371 * a + .7827717662 * o - .808675766 * s
|
|
1060
|
+
];
|
|
1061
|
+
}
|
|
1062
|
+
var F = (e, t) => Math.hypot(e[0] - t[0], e[1] - t[1], e[2] - t[2]), jt = {};
|
|
1063
|
+
function Mt(e) {
|
|
1064
|
+
let t = jt[e];
|
|
1065
|
+
if (t) return t;
|
|
1066
|
+
let n = Dt[e], r = [];
|
|
1067
|
+
for (let e of n.lightness) for (let t of n.chroma) for (let i = 0; i < 360; i += n.hueStep) {
|
|
1068
|
+
let n = Ot(e, t, i);
|
|
1069
|
+
if (n.some((e) => e < -5e-4 || e > 1.0005)) continue;
|
|
1070
|
+
let a = kt(n);
|
|
1071
|
+
r.push({
|
|
1072
|
+
hex: a,
|
|
1073
|
+
lab: P(a)
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
let i = Array.from({ length: 10 }, (t, n) => N[e][n + 1]), a = [
|
|
1077
|
+
...i,
|
|
1078
|
+
N[e].rest,
|
|
1079
|
+
n.background
|
|
1080
|
+
].map(P), o = {
|
|
1081
|
+
colours: i,
|
|
1082
|
+
candidates: r,
|
|
1083
|
+
nearest: r.map((e) => Math.min(...a.map((t) => F(t, e.lab))))
|
|
1084
|
+
};
|
|
1085
|
+
return jt[e] = o, o;
|
|
1086
|
+
}
|
|
1087
|
+
function Nt(e) {
|
|
1088
|
+
let t = -1;
|
|
1089
|
+
for (let n = 0; n < e.candidates.length; n++) (t < 0 || e.nearest[n] > e.nearest[t]) && (t = n);
|
|
1090
|
+
if (t < 0 || e.nearest[t] <= 0) {
|
|
1091
|
+
e.colours.push(e.colours[10 + (e.colours.length - 10) % Math.max(1, e.candidates.length)] ?? e.colours[0]);
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
let n = e.candidates[t];
|
|
1095
|
+
e.colours.push(n.hex);
|
|
1096
|
+
for (let t = 0; t < e.candidates.length; t++) e.nearest[t] = Math.min(e.nearest[t], F(n.lab, e.candidates[t].lab));
|
|
1097
|
+
}
|
|
1098
|
+
function I(e, t) {
|
|
1099
|
+
let n = Mt(t);
|
|
1100
|
+
for (; n.colours.length <= e;) Nt(n);
|
|
1101
|
+
return n.colours[e];
|
|
1102
|
+
}
|
|
1103
|
+
var Pt = (e, t) => typeof e == "number" ? I(e - 1, t) : N[t][e];
|
|
1104
|
+
function Ft(e) {
|
|
1105
|
+
return typeof e != "number" || e <= 10 ? `var(--chart-series-${e})` : `var(--chart-scheme-light, ${I(e - 1, "light")}) var(--chart-scheme-dark, ${I(e - 1, "dark")})`;
|
|
1106
|
+
}
|
|
1107
|
+
var It = {
|
|
1108
|
+
bands: [{
|
|
1109
|
+
below: 20,
|
|
1110
|
+
color: "negative"
|
|
1111
|
+
}, {
|
|
1112
|
+
below: 80,
|
|
1113
|
+
color: "warning"
|
|
1114
|
+
}],
|
|
1115
|
+
above: "positive"
|
|
1116
|
+
}, Lt = (e) => typeof e == "object" && !!e;
|
|
1117
|
+
function Rt(e, t) {
|
|
1118
|
+
return Lt(e) ? e.bands.find((e) => t < e.below)?.color ?? e.above : e;
|
|
1119
|
+
}
|
|
1120
|
+
var zt = (e) => typeof e == "string" && e.startsWith("#"), Bt = (e) => zt(e) ? e : Ft(e), L = (e, t) => zt(e) ? e : Pt(e, t), Vt = {
|
|
1121
|
+
light: [
|
|
1122
|
+
"#e8eff9",
|
|
1123
|
+
"#bcd3f2",
|
|
1124
|
+
"#7faee9",
|
|
1125
|
+
"#4081d2",
|
|
1126
|
+
"#155aa7"
|
|
1127
|
+
],
|
|
1128
|
+
dark: [
|
|
1129
|
+
"#242930",
|
|
1130
|
+
"#2c4462",
|
|
1131
|
+
"#39659b",
|
|
1132
|
+
"#4f8bd6",
|
|
1133
|
+
"#82baff"
|
|
1134
|
+
]
|
|
1135
|
+
}, Ht = (e) => `var(--chart-heat-${Math.max(0, Math.min(Vt.light.length - 1, e))})`, R = {
|
|
1136
|
+
dark: "#0f0f0f",
|
|
1137
|
+
light: "#ffffff"
|
|
1138
|
+
};
|
|
1139
|
+
function Ut(e) {
|
|
1140
|
+
let t = (t) => {
|
|
1141
|
+
let n = parseInt(e.slice(t, t + 2), 16) / 255;
|
|
1142
|
+
return n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4;
|
|
1143
|
+
};
|
|
1144
|
+
return .2126 * t(1) + .7152 * t(3) + .0722 * t(5);
|
|
1145
|
+
}
|
|
1146
|
+
function z(e) {
|
|
1147
|
+
let t = Ut(e);
|
|
1148
|
+
return (t + .05) / .05 > 1.05 / (t + .05) ? R.dark : R.light;
|
|
1149
|
+
}
|
|
1150
|
+
function Wt(e) {
|
|
1151
|
+
return `var(--chart-scheme-light, ${z(L(e, "light"))}) var(--chart-scheme-dark, ${z(L(e, "dark"))})`;
|
|
1152
|
+
}
|
|
1153
|
+
// src/components/Charts/labels.ts
|
|
1154
|
+
var Gt = {
|
|
1155
|
+
legend: "Legend",
|
|
1156
|
+
total: "Total",
|
|
1157
|
+
empty: "No records",
|
|
1158
|
+
count: "Count",
|
|
1159
|
+
rest: "Rest",
|
|
1160
|
+
kinds: {
|
|
1161
|
+
donut: "Donut",
|
|
1162
|
+
pie: "Pie",
|
|
1163
|
+
bars: "Bars",
|
|
1164
|
+
stacked: "Stacked",
|
|
1165
|
+
treemap: "Treemap",
|
|
1166
|
+
columns: "Columns",
|
|
1167
|
+
line: "Line",
|
|
1168
|
+
area: "Area",
|
|
1169
|
+
grouped: "Grouped",
|
|
1170
|
+
calendar: "Calendar",
|
|
1171
|
+
bar: "Bar",
|
|
1172
|
+
gauge: "Gauge",
|
|
1173
|
+
ring: "Ring",
|
|
1174
|
+
funnel: "Funnel",
|
|
1175
|
+
number: "Number",
|
|
1176
|
+
numberTrend: "Trend"
|
|
1177
|
+
},
|
|
1178
|
+
chartChoice: "Chart",
|
|
1179
|
+
imageMenu: "Share or save the image",
|
|
1180
|
+
imageDownload: "Download",
|
|
1181
|
+
imageCopy: "Copy",
|
|
1182
|
+
imageShare: "Share",
|
|
1183
|
+
imageCopied: "Copied",
|
|
1184
|
+
imageFailed: "The image could not be made",
|
|
1185
|
+
vsPrevious: "vs the previous period",
|
|
1186
|
+
deltaUp: "up",
|
|
1187
|
+
deltaDown: "down",
|
|
1188
|
+
deltaSame: "no change",
|
|
1189
|
+
deltaNew: "new",
|
|
1190
|
+
ofTotal: (e, t) => `${e} of ${t}`,
|
|
1191
|
+
shareOf: (e, t) => `${e} of ${t}`,
|
|
1192
|
+
moreValues: (e) => `${e} more`,
|
|
1193
|
+
less: "Less",
|
|
1194
|
+
more: "More",
|
|
1195
|
+
busiest: "Busiest day",
|
|
1196
|
+
funnelOfFirst: "Of the first step",
|
|
1197
|
+
funnelDrop: "Drop from the step before"
|
|
1198
|
+
}, B = (e, t = !1) => `chart-root ${e}${t ? " chart-compact" : ""}`;
|
|
1199
|
+
function Kt({ title: e, children: t }) {
|
|
1200
|
+
return e == null || e === "" ? /* @__PURE__ */ s(o, { children: t }) : /* @__PURE__ */ c("figure", {
|
|
1201
|
+
className: B("chart-titled"),
|
|
1202
|
+
children: [/* @__PURE__ */ s("figcaption", {
|
|
1203
|
+
className: "chart-title",
|
|
1204
|
+
children: e
|
|
1205
|
+
}), t]
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
function V(e) {
|
|
1209
|
+
return e > 0 && e < .1 ? "<0.1%" : e < 100 && e > 99.9 ? ">99.9%" : `${e.toFixed(1)}%`;
|
|
1210
|
+
}
|
|
1211
|
+
var qt = (e) => e === 0 ? V(0) : `${e > 0 ? "−" : "+"}${V(Math.abs(e))}`;
|
|
1212
|
+
function Jt({ locale: e = "en-IN", format: t, labels: n }) {
|
|
1213
|
+
return {
|
|
1214
|
+
nf: a(() => {
|
|
1215
|
+
if (t) return t;
|
|
1216
|
+
let n;
|
|
1217
|
+
try {
|
|
1218
|
+
n = new Intl.NumberFormat(e);
|
|
1219
|
+
} catch {
|
|
1220
|
+
n = new Intl.NumberFormat();
|
|
1221
|
+
}
|
|
1222
|
+
return (e) => n.format(e);
|
|
1223
|
+
}, [e, t]),
|
|
1224
|
+
L: a(() => ({
|
|
1225
|
+
...Gt,
|
|
1226
|
+
...n
|
|
1227
|
+
}), [n])
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
function Yt({ ariaLabel: e, text: t, compact: n }) {
|
|
1231
|
+
return /* @__PURE__ */ s("div", {
|
|
1232
|
+
className: B("chart-empty", n),
|
|
1233
|
+
role: "img",
|
|
1234
|
+
"aria-label": `${e}: ${t}`,
|
|
1235
|
+
children: t
|
|
1236
|
+
});
|
|
1237
|
+
}
|
|
1238
|
+
function Xt(e, t, n, r = {}) {
|
|
1239
|
+
if (n <= 0) return null;
|
|
1240
|
+
let i = {
|
|
1241
|
+
ArrowLeft: -1,
|
|
1242
|
+
ArrowRight: 1,
|
|
1243
|
+
ArrowUp: -1,
|
|
1244
|
+
ArrowDown: 1,
|
|
1245
|
+
...r
|
|
1246
|
+
};
|
|
1247
|
+
return e === "Home" ? 0 : e === "End" ? n - 1 : !(e in i) || i[e] === 0 ? null : t === null ? i[e] > 0 ? 0 : n - 1 : Math.max(0, Math.min(n - 1, t + i[e]));
|
|
1248
|
+
}
|
|
1249
|
+
function Zt(e, t, n, r = {}, i = () => !0) {
|
|
1250
|
+
let a = Xt(e, t, n, r);
|
|
1251
|
+
if (a === null || i(a)) return a;
|
|
1252
|
+
let o = e === "Home" ? !0 : e === "End" ? !1 : t === null ? a === 0 : a > t;
|
|
1253
|
+
for (let e = a; e >= 0 && e < n; e += o ? 1 : -1) if (i(e)) return e;
|
|
1254
|
+
return t !== null && i(t) ? t : null;
|
|
1255
|
+
}
|
|
1256
|
+
function Qt({ text: e }) {
|
|
1257
|
+
return /* @__PURE__ */ s("span", {
|
|
1258
|
+
className: "chart-sr-only",
|
|
1259
|
+
"aria-live": "polite",
|
|
1260
|
+
children: e
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
// src/components/Charts/chartData.ts
|
|
1264
|
+
var H = (e) => (e?.length ?? 0) > 0;
|
|
1265
|
+
function U(e) {
|
|
1266
|
+
switch (e.type) {
|
|
1267
|
+
case "values": return H(e.series) ? ["bars"] : [
|
|
1268
|
+
"donut",
|
|
1269
|
+
"pie",
|
|
1270
|
+
"bars",
|
|
1271
|
+
"stacked",
|
|
1272
|
+
"treemap"
|
|
1273
|
+
];
|
|
1274
|
+
case "time": return [...e.period === "day" ? ["calendar"] : [], ...H(e.series) ? [
|
|
1275
|
+
"grouped",
|
|
1276
|
+
"stacked",
|
|
1277
|
+
"line",
|
|
1278
|
+
"area"
|
|
1279
|
+
] : [
|
|
1280
|
+
"columns",
|
|
1281
|
+
"line",
|
|
1282
|
+
"area"
|
|
1283
|
+
]];
|
|
1284
|
+
case "part": return [
|
|
1285
|
+
"bar",
|
|
1286
|
+
"gauge",
|
|
1287
|
+
"ring",
|
|
1288
|
+
"donut",
|
|
1289
|
+
"pie"
|
|
1290
|
+
];
|
|
1291
|
+
case "steps": return ["funnel", "bars"];
|
|
1292
|
+
case "number": return e.points?.length ? ["numberTrend", "number"] : ["number"];
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
function $t(e, t, n) {
|
|
1296
|
+
let r = U(e).filter((e) => !n || n.includes(e)), i = r.length ? r : U(e);
|
|
1297
|
+
return t && i.includes(t) ? t : i[0];
|
|
1298
|
+
}
|
|
1299
|
+
var W = (e) => [{
|
|
1300
|
+
key: "n",
|
|
1301
|
+
label: e,
|
|
1302
|
+
slot: 1
|
|
1303
|
+
}], en = (e, t) => ({
|
|
1304
|
+
...e.key === void 0 ? {} : { key: e.key },
|
|
1305
|
+
label: e.label,
|
|
1306
|
+
...e.fullLabel === void 0 ? {} : { fullLabel: e.fullLabel },
|
|
1307
|
+
values: t ? e.counts ?? {} : { n: e.count ?? 0 },
|
|
1308
|
+
...e.selectable === !1 ? { selectable: !1 } : {},
|
|
1309
|
+
...e.href ? { href: e.href } : {},
|
|
1310
|
+
...e.slot === void 0 ? {} : { slot: e.slot }
|
|
1311
|
+
}), G = (e, t) => e.slot ?? t + 1;
|
|
1312
|
+
function tn(e, t, n, r) {
|
|
1313
|
+
let i = $t(e, t, r);
|
|
1314
|
+
switch (e.type) {
|
|
1315
|
+
case "values": {
|
|
1316
|
+
let t = H(e.series) ? e.series : W(n.count);
|
|
1317
|
+
if (i === "bars") return {
|
|
1318
|
+
kind: "bars",
|
|
1319
|
+
series: t,
|
|
1320
|
+
data: e.values.map((t) => en(t, H(e.series)))
|
|
1321
|
+
};
|
|
1322
|
+
if (i === "treemap") return {
|
|
1323
|
+
kind: "treemap",
|
|
1324
|
+
nodes: e.values.map((e, t) => ({
|
|
1325
|
+
key: e.key ?? e.label,
|
|
1326
|
+
label: e.label,
|
|
1327
|
+
value: e.count ?? 0,
|
|
1328
|
+
slot: G(e, t),
|
|
1329
|
+
...e.selectable === !1 ? { selectable: !1 } : {},
|
|
1330
|
+
...e.children ? { children: e.children.map((n) => ({
|
|
1331
|
+
key: n.key ?? n.label,
|
|
1332
|
+
label: n.label,
|
|
1333
|
+
value: n.count,
|
|
1334
|
+
slot: G(e, t)
|
|
1335
|
+
})) } : {}
|
|
1336
|
+
}))
|
|
1337
|
+
};
|
|
1338
|
+
let r = e.values.map((e, t) => ({
|
|
1339
|
+
key: e.key ?? e.label,
|
|
1340
|
+
label: e.label,
|
|
1341
|
+
value: e.count ?? 0,
|
|
1342
|
+
slot: G(e, t),
|
|
1343
|
+
...e.selectable === !1 ? { selectable: !1 } : {}
|
|
1344
|
+
}));
|
|
1345
|
+
return {
|
|
1346
|
+
kind: i === "stacked" ? "stacked" : i === "pie" ? "pie" : "donut",
|
|
1347
|
+
slices: r
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
case "time": {
|
|
1351
|
+
if (i === "calendar") return {
|
|
1352
|
+
kind: "calendar",
|
|
1353
|
+
days: e.points.map((e) => ({
|
|
1354
|
+
day: e.key,
|
|
1355
|
+
count: e.count ?? Object.values(e.counts ?? {}).reduce((e, t) => e + t, 0)
|
|
1356
|
+
}))
|
|
1357
|
+
};
|
|
1358
|
+
let t = H(e.series), r = t ? e.series : W(n.count), a = e.points.map((e) => en(e, t));
|
|
1359
|
+
if (i === "line" || i === "area") return {
|
|
1360
|
+
kind: "line",
|
|
1361
|
+
area: i === "area",
|
|
1362
|
+
series: r,
|
|
1363
|
+
data: a
|
|
1364
|
+
};
|
|
1365
|
+
let o = t ? i === "grouped" ? "grouped" : "stacked" : void 0;
|
|
1366
|
+
return {
|
|
1367
|
+
kind: "columns",
|
|
1368
|
+
series: r,
|
|
1369
|
+
data: a,
|
|
1370
|
+
...o ? { mode: o } : {}
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
case "part": {
|
|
1374
|
+
let t = {
|
|
1375
|
+
label: e.label,
|
|
1376
|
+
value: e.value,
|
|
1377
|
+
total: e.total,
|
|
1378
|
+
...e.color === void 0 ? {} : { color: e.color }
|
|
1379
|
+
};
|
|
1380
|
+
if (i === "gauge" || i === "ring") return {
|
|
1381
|
+
kind: "gauge",
|
|
1382
|
+
variant: i === "ring" ? "ring" : "half",
|
|
1383
|
+
rows: [t]
|
|
1384
|
+
};
|
|
1385
|
+
if (i === "donut" || i === "pie") {
|
|
1386
|
+
let t = e.total > 0 ? e.value / e.total * 100 : 0;
|
|
1387
|
+
return {
|
|
1388
|
+
kind: i,
|
|
1389
|
+
slices: [{
|
|
1390
|
+
key: "value",
|
|
1391
|
+
label: e.label,
|
|
1392
|
+
value: e.value,
|
|
1393
|
+
slot: Rt(e.color ?? 1, t)
|
|
1394
|
+
}, {
|
|
1395
|
+
key: "rest",
|
|
1396
|
+
label: n.rest,
|
|
1397
|
+
value: Math.max(0, e.total - e.value),
|
|
1398
|
+
slot: "rest",
|
|
1399
|
+
selectable: !1
|
|
1400
|
+
}]
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
return {
|
|
1404
|
+
kind: "progress",
|
|
1405
|
+
rows: [t]
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
case "steps": return i === "bars" ? {
|
|
1409
|
+
kind: "bars",
|
|
1410
|
+
series: W(n.count),
|
|
1411
|
+
data: e.steps.map((e) => ({
|
|
1412
|
+
key: e.key,
|
|
1413
|
+
label: e.label,
|
|
1414
|
+
values: { n: e.count },
|
|
1415
|
+
...e.slot === void 0 ? {} : { slot: e.slot },
|
|
1416
|
+
...e.selectable === !1 ? { selectable: !1 } : {}
|
|
1417
|
+
}))
|
|
1418
|
+
} : {
|
|
1419
|
+
kind: "funnel",
|
|
1420
|
+
steps: e.steps.map((e) => ({
|
|
1421
|
+
key: e.key,
|
|
1422
|
+
label: e.label,
|
|
1423
|
+
value: e.count,
|
|
1424
|
+
slot: e.slot ?? 1,
|
|
1425
|
+
...e.selectable === !1 ? { selectable: !1 } : {}
|
|
1426
|
+
}))
|
|
1427
|
+
};
|
|
1428
|
+
case "number": return {
|
|
1429
|
+
kind: "number",
|
|
1430
|
+
value: e.value,
|
|
1431
|
+
...i === "numberTrend" && e.points ? {
|
|
1432
|
+
points: e.points,
|
|
1433
|
+
...e.previous === void 0 ? {} : { previous: e.previous },
|
|
1434
|
+
...e.good ? { good: e.good } : {}
|
|
1435
|
+
} : {}
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
// src/components/Charts/geometry.ts
|
|
1440
|
+
var nn = (e) => e.key ?? e.label, rn = (e, t) => t.reduce((t, n) => t + (e.values[n.key] ?? 0), 0), an = 2 * Math.PI * 40, on = 1.2;
|
|
1441
|
+
function sn(e) {
|
|
1442
|
+
let t = e.reduce((e, t) => e + t.value, 0);
|
|
1443
|
+
if (!t) return [];
|
|
1444
|
+
let n = e.filter((e) => e.value > 0).length > 1 ? on : 0, r = 0, i = [];
|
|
1445
|
+
for (let a of e) {
|
|
1446
|
+
let e = a.value / t * an;
|
|
1447
|
+
a.value > 0 && i.push({
|
|
1448
|
+
slice: a,
|
|
1449
|
+
start: r,
|
|
1450
|
+
length: Math.max(.01, e - n)
|
|
1451
|
+
}), r += e;
|
|
1452
|
+
}
|
|
1453
|
+
return i;
|
|
1454
|
+
}
|
|
1455
|
+
var K = (e, t) => t ? e / t * 100 : 0;
|
|
1456
|
+
function cn(e) {
|
|
1457
|
+
if (e <= 5) return 5;
|
|
1458
|
+
let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
|
|
1459
|
+
return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * t;
|
|
1460
|
+
}
|
|
1461
|
+
function ln(e) {
|
|
1462
|
+
let t = cn(Math.max(1, ...e));
|
|
1463
|
+
return {
|
|
1464
|
+
max: t,
|
|
1465
|
+
ticks: [
|
|
1466
|
+
0,
|
|
1467
|
+
t / 2,
|
|
1468
|
+
t
|
|
1469
|
+
]
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
var un = (e) => Math.max(1, ...e), dn = (e, t) => t <= 12 || e % Math.ceil(t / 12) === 0, fn = (e, t, n = "stacked") => n === "grouped" ? e.flatMap((e) => t.map((t) => e.values[t.key] ?? 0)) : e.map((e) => rn(e, t));
|
|
1473
|
+
function pn(e, t, n = 2) {
|
|
1474
|
+
if (e <= 0) return [];
|
|
1475
|
+
let r = Math.max(0, (t - n * (e - 1)) / e);
|
|
1476
|
+
return Array.from({ length: e }, (e, t) => ({
|
|
1477
|
+
x: t * (r + n),
|
|
1478
|
+
width: r
|
|
1479
|
+
}));
|
|
1480
|
+
}
|
|
1481
|
+
var q = (e, t, n) => t <= 1 ? n / 2 : e / (t - 1) * n;
|
|
1482
|
+
function mn(e, t, n, r) {
|
|
1483
|
+
return e.map((i, a) => ({
|
|
1484
|
+
x: q(a, e.length, t),
|
|
1485
|
+
y: n - Math.max(0, i) / (r || 1) * n
|
|
1486
|
+
}));
|
|
1487
|
+
}
|
|
1488
|
+
var J = (e) => Math.round(e * 100) / 100, hn = (e) => e.map((e, t) => `${t ? "L" : "M"}${J(e.x)} ${J(e.y)}`).join(" ");
|
|
1489
|
+
function gn(e, t) {
|
|
1490
|
+
return e.length ? `${hn(e)} L${J(e[e.length - 1].x)} ${J(t)} L${J(e[0].x)} ${J(t)} Z` : "";
|
|
1491
|
+
}
|
|
1492
|
+
function _n(e, t, n) {
|
|
1493
|
+
return n <= 1 || t <= 0 ? 0 : Math.max(0, Math.min(n - 1, Math.round(e / t * (n - 1))));
|
|
1494
|
+
}
|
|
1495
|
+
function vn(e, t = 6) {
|
|
1496
|
+
if (e <= 0) return [];
|
|
1497
|
+
if (e <= t) return Array.from({ length: e }, (e, t) => t);
|
|
1498
|
+
let n = (e - 1) / (t - 1);
|
|
1499
|
+
return Array.from(new Set(Array.from({ length: t }, (e, t) => Math.round(t * n))));
|
|
1500
|
+
}
|
|
1501
|
+
function yn(e, t, n) {
|
|
1502
|
+
if (!e.length) return [];
|
|
1503
|
+
let r = Math.min(...e), i = Math.max(...e);
|
|
1504
|
+
return e.map((a, o) => ({
|
|
1505
|
+
x: q(o, e.length, t),
|
|
1506
|
+
y: i === r ? n / 2 : n - (a - r) / (i - r) * n
|
|
1507
|
+
}));
|
|
1508
|
+
}
|
|
1509
|
+
function bn(e, t) {
|
|
1510
|
+
let n = e - t;
|
|
1511
|
+
return {
|
|
1512
|
+
direction: n > 0 ? "up" : n < 0 ? "down" : "same",
|
|
1513
|
+
diff: n,
|
|
1514
|
+
percent: t ? n / t * 100 : n ? null : 0
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
function xn(e, t) {
|
|
1518
|
+
return e === "same" || t === "none" ? "neutral" : e === t ? "positive" : "negative";
|
|
1519
|
+
}
|
|
1520
|
+
function Y(e, t, n, r) {
|
|
1521
|
+
return {
|
|
1522
|
+
x: e + n * Math.sin(r),
|
|
1523
|
+
y: t - n * Math.cos(r)
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
var X = (e) => Math.round(e * 1e4) / 1e4;
|
|
1527
|
+
function Sn(e, t, n, r, i) {
|
|
1528
|
+
if (i - r >= 2 * Math.PI - 1e-9) {
|
|
1529
|
+
let i = Y(e, t, n, r + Math.PI), a = Y(e, t, n, r + 2 * Math.PI - 1e-4), o = Y(e, t, n, r);
|
|
1530
|
+
return `M${X(o.x)} ${X(o.y)} A${n} ${n} 0 0 1 ${X(i.x)} ${X(i.y)} A${n} ${n} 0 0 1 ${X(a.x)} ${X(a.y)}`;
|
|
1531
|
+
}
|
|
1532
|
+
let a = Y(e, t, n, r), o = Y(e, t, n, i);
|
|
1533
|
+
return `M${X(a.x)} ${X(a.y)} A${n} ${n} 0 ${+(i - r > Math.PI)} 1 ${X(o.x)} ${X(o.y)}`;
|
|
1534
|
+
}
|
|
1535
|
+
function Cn(e, t, n, r, i) {
|
|
1536
|
+
if (i - r >= 2 * Math.PI - 1e-9) return `M${X(e)} ${X(t - n)} A${n} ${n} 0 1 1 ${X(e)} ${X(t + n)} A${n} ${n} 0 1 1 ${X(e)} ${X(t - n)} Z`;
|
|
1537
|
+
let a = Y(e, t, n, r), o = Y(e, t, n, i);
|
|
1538
|
+
return `M${X(e)} ${X(t)} L${X(a.x)} ${X(a.y)} A${n} ${n} 0 ${+(i - r > Math.PI)} 1 ${X(o.x)} ${X(o.y)} Z`;
|
|
1539
|
+
}
|
|
1540
|
+
var wn = 864e5;
|
|
1541
|
+
function Z(e) {
|
|
1542
|
+
let [t, n, r] = e.split("-").map(Number);
|
|
1543
|
+
return Date.UTC(t, n - 1, r);
|
|
1544
|
+
}
|
|
1545
|
+
var Tn = (e) => new Date(e).toISOString().slice(0, 10), En = (e) => (new Date(Z(e)).getUTCDay() + 6) % 7;
|
|
1546
|
+
function Dn(e, t) {
|
|
1547
|
+
let n = Z(e), r = Math.min(371, Math.max(0, Math.round((Z(t) - n) / wn) + 1));
|
|
1548
|
+
return Array.from({ length: r }, (e, t) => Tn(n + t * wn));
|
|
1549
|
+
}
|
|
1550
|
+
var On = 371;
|
|
1551
|
+
function kn(e, t) {
|
|
1552
|
+
return e <= 0 || t <= 0 ? 0 : Math.min(4, Math.max(1, Math.ceil(e / t * 4)));
|
|
1553
|
+
}
|
|
1554
|
+
function An(e) {
|
|
1555
|
+
if (!e.length) return {
|
|
1556
|
+
cells: [],
|
|
1557
|
+
weeks: 0,
|
|
1558
|
+
months: [],
|
|
1559
|
+
max: 0,
|
|
1560
|
+
total: 0
|
|
1561
|
+
};
|
|
1562
|
+
let t = [...e].sort((e, t) => e.day.localeCompare(t.day)), n = new Map(t.map((e) => [e.day, e.count])), r = Dn(t[0].day, t[t.length - 1].day), i = En(r[0]), a = Math.max(0, ...r.map((e) => n.get(e) ?? 0)), o = r.map((e, t) => {
|
|
1563
|
+
let r = n.get(e) ?? 0;
|
|
1564
|
+
return {
|
|
1565
|
+
day: e,
|
|
1566
|
+
count: r,
|
|
1567
|
+
week: Math.floor((t + i) / 7),
|
|
1568
|
+
weekday: (t + i) % 7,
|
|
1569
|
+
level: kn(r, a)
|
|
1570
|
+
};
|
|
1571
|
+
}), s = o.filter((e) => e.day.endsWith("-01")).map((e) => ({
|
|
1572
|
+
month: e.day.slice(0, 7),
|
|
1573
|
+
week: e.week
|
|
1574
|
+
}));
|
|
1575
|
+
return !r[0].endsWith("-01") && (s[0]?.week ?? Infinity) >= 2 && s.unshift({
|
|
1576
|
+
month: r[0].slice(0, 7),
|
|
1577
|
+
week: 0
|
|
1578
|
+
}), {
|
|
1579
|
+
cells: o,
|
|
1580
|
+
weeks: o[o.length - 1].week + 1,
|
|
1581
|
+
months: s,
|
|
1582
|
+
max: a,
|
|
1583
|
+
total: o.reduce((e, t) => e + t.count, 0)
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
var Q = {
|
|
1587
|
+
min: 4,
|
|
1588
|
+
max: 16,
|
|
1589
|
+
compactMax: 12
|
|
1590
|
+
}, jn = 8;
|
|
1591
|
+
function Mn(e, t, n = Q.max, r = 1) {
|
|
1592
|
+
let i = Math.floor(n * r), a = jn * r;
|
|
1593
|
+
if (!e || t <= 0) return {
|
|
1594
|
+
cell: i,
|
|
1595
|
+
gap: 2,
|
|
1596
|
+
weekdays: !0
|
|
1597
|
+
};
|
|
1598
|
+
let o = (e) => {
|
|
1599
|
+
let n = 2, r = Math.floor((e - n * (t - 1)) / t);
|
|
1600
|
+
return r < a && (n = 1, r = Math.floor((e - n * (t - 1)) / t)), {
|
|
1601
|
+
cell: r,
|
|
1602
|
+
gap: n
|
|
1603
|
+
};
|
|
1604
|
+
}, s = o(e - Nn(r));
|
|
1605
|
+
if (s.cell >= a) return {
|
|
1606
|
+
cell: Math.min(i, s.cell),
|
|
1607
|
+
gap: s.gap,
|
|
1608
|
+
weekdays: !0
|
|
1609
|
+
};
|
|
1610
|
+
let c = o(e);
|
|
1611
|
+
return {
|
|
1612
|
+
cell: Math.max(Q.min, Math.min(i, c.cell)),
|
|
1613
|
+
gap: c.gap,
|
|
1614
|
+
weekdays: !1
|
|
1615
|
+
};
|
|
1616
|
+
}
|
|
1617
|
+
var Nn = (e = 1) => Math.round(28 * e), Pn = (e = 1) => 26 * e;
|
|
1618
|
+
function Fn(e, t, n = 1) {
|
|
1619
|
+
let r = [];
|
|
1620
|
+
for (let i of e) {
|
|
1621
|
+
let e = r[r.length - 1];
|
|
1622
|
+
(!e || (i.week - e.week) * t >= Pn(n)) && r.push(i);
|
|
1623
|
+
}
|
|
1624
|
+
return r;
|
|
1625
|
+
}
|
|
1626
|
+
function $(e, t) {
|
|
1627
|
+
let n = e.map(() => ({
|
|
1628
|
+
x: t.x,
|
|
1629
|
+
y: t.y,
|
|
1630
|
+
w: 0,
|
|
1631
|
+
h: 0
|
|
1632
|
+
})), r = e.reduce((e, t) => e + Math.max(0, t), 0);
|
|
1633
|
+
if (r <= 0 || t.w <= 0 || t.h <= 0) return n;
|
|
1634
|
+
let i = t.w * t.h / r, a = e.map((e, t) => ({
|
|
1635
|
+
i: t,
|
|
1636
|
+
a: Math.max(0, e) * i
|
|
1637
|
+
})).filter((e) => e.a > 0), o = { ...t }, s = (e, t) => {
|
|
1638
|
+
let n = e.reduce((e, t) => e + t, 0), r = Math.max(...e), i = Math.min(...e);
|
|
1639
|
+
return Math.max(t * t * r / (n * n), n * n / (t * t * i));
|
|
1640
|
+
}, c = (e) => {
|
|
1641
|
+
let t = e.reduce((e, t) => e + t.a, 0);
|
|
1642
|
+
if (o.w >= o.h) {
|
|
1643
|
+
let r = t / o.h, i = o.y;
|
|
1644
|
+
for (let t of e) {
|
|
1645
|
+
let e = t.a / r;
|
|
1646
|
+
n[t.i] = {
|
|
1647
|
+
x: o.x,
|
|
1648
|
+
y: i,
|
|
1649
|
+
w: r,
|
|
1650
|
+
h: e
|
|
1651
|
+
}, i += e;
|
|
1652
|
+
}
|
|
1653
|
+
o = {
|
|
1654
|
+
x: o.x + r,
|
|
1655
|
+
y: o.y,
|
|
1656
|
+
w: o.w - r,
|
|
1657
|
+
h: o.h
|
|
1658
|
+
};
|
|
1659
|
+
} else {
|
|
1660
|
+
let r = t / o.w, i = o.x;
|
|
1661
|
+
for (let t of e) {
|
|
1662
|
+
let e = t.a / r;
|
|
1663
|
+
n[t.i] = {
|
|
1664
|
+
x: i,
|
|
1665
|
+
y: o.y,
|
|
1666
|
+
w: e,
|
|
1667
|
+
h: r
|
|
1668
|
+
}, i += e;
|
|
1669
|
+
}
|
|
1670
|
+
o = {
|
|
1671
|
+
x: o.x,
|
|
1672
|
+
y: o.y + r,
|
|
1673
|
+
w: o.w,
|
|
1674
|
+
h: o.h - r
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
}, l = [];
|
|
1678
|
+
for (let e of a) {
|
|
1679
|
+
let t = Math.min(o.w, o.h);
|
|
1680
|
+
!l.length || s([...l.map((e) => e.a), e.a], t) <= s(l.map((e) => e.a), t) ? l.push(e) : (c(l), l = [e]);
|
|
1681
|
+
}
|
|
1682
|
+
return l.length && c(l), n;
|
|
1683
|
+
}
|
|
1684
|
+
var In = {
|
|
1685
|
+
w: 44,
|
|
1686
|
+
h: 28
|
|
1687
|
+
};
|
|
1688
|
+
function Ln(e, t, n, r = 1) {
|
|
1689
|
+
let i = {
|
|
1690
|
+
w: In.w * r,
|
|
1691
|
+
h: In.h * r
|
|
1692
|
+
}, a = 16 * r, o = (e) => e.w >= i.w && e.h >= i.h, s = [], c = $(e.map((e) => e.value), {
|
|
1693
|
+
x: 0,
|
|
1694
|
+
y: 0,
|
|
1695
|
+
w: t,
|
|
1696
|
+
h: n
|
|
1697
|
+
});
|
|
1698
|
+
return e.forEach((e, t) => {
|
|
1699
|
+
let n = c[t];
|
|
1700
|
+
if (n.w <= 0 || n.h <= 0) return;
|
|
1701
|
+
let r = (e.children ?? []).filter((e) => e.value > 0);
|
|
1702
|
+
if (!r.length) {
|
|
1703
|
+
s.push({
|
|
1704
|
+
node: e,
|
|
1705
|
+
parent: null,
|
|
1706
|
+
rect: n,
|
|
1707
|
+
label: o(n)
|
|
1708
|
+
});
|
|
1709
|
+
return;
|
|
1710
|
+
}
|
|
1711
|
+
let l = n.h >= a + i.h && n.w >= i.w ? a : 0;
|
|
1712
|
+
s.push({
|
|
1713
|
+
node: e,
|
|
1714
|
+
parent: null,
|
|
1715
|
+
rect: n,
|
|
1716
|
+
label: l > 0
|
|
1717
|
+
});
|
|
1718
|
+
let ee = {
|
|
1719
|
+
x: n.x + 2,
|
|
1720
|
+
y: n.y + l + 2,
|
|
1721
|
+
w: Math.max(0, n.w - 4),
|
|
1722
|
+
h: Math.max(0, n.h - l - 4)
|
|
1723
|
+
};
|
|
1724
|
+
$(r.map((e) => e.value), ee).forEach((t, n) => {
|
|
1725
|
+
t.w > 0 && t.h > 0 && s.push({
|
|
1726
|
+
node: r[n],
|
|
1727
|
+
parent: e,
|
|
1728
|
+
rect: t,
|
|
1729
|
+
label: o(t)
|
|
1730
|
+
});
|
|
1731
|
+
});
|
|
1732
|
+
}), s;
|
|
1733
|
+
}
|
|
1734
|
+
var Rn = (e) => Math.max(.55, 1 - e * .09);
|
|
1735
|
+
function zn(e) {
|
|
1736
|
+
let t = Math.max(0, ...e.map((e) => e.value)), n = e[0]?.value ?? 0;
|
|
1737
|
+
return e.map((r, i) => {
|
|
1738
|
+
let a = i > 0 ? e[i - 1].value : 0;
|
|
1739
|
+
return {
|
|
1740
|
+
step: r,
|
|
1741
|
+
width: t > 0 ? Math.max(0, r.value) / t : 0,
|
|
1742
|
+
ofFirst: K(r.value, n),
|
|
1743
|
+
drop: i > 0 && a > 0 ? (a - r.value) / a * 100 : null
|
|
1744
|
+
};
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
var Bn = {
|
|
1748
|
+
half: {
|
|
1749
|
+
width: 120,
|
|
1750
|
+
height: 68,
|
|
1751
|
+
cx: 60,
|
|
1752
|
+
cy: 62,
|
|
1753
|
+
r: 50,
|
|
1754
|
+
from: -Math.PI / 2,
|
|
1755
|
+
to: Math.PI / 2
|
|
1756
|
+
},
|
|
1757
|
+
ring: {
|
|
1758
|
+
width: 100,
|
|
1759
|
+
height: 100,
|
|
1760
|
+
cx: 50,
|
|
1761
|
+
cy: 50,
|
|
1762
|
+
r: 40,
|
|
1763
|
+
from: 0,
|
|
1764
|
+
to: 2 * Math.PI
|
|
1765
|
+
}
|
|
1766
|
+
};
|
|
1767
|
+
function Vn(e, t) {
|
|
1768
|
+
let n = Bn[e], r = Math.max(0, Math.min(100, t)) / 100;
|
|
1769
|
+
return {
|
|
1770
|
+
a0: n.from,
|
|
1771
|
+
a1: n.to,
|
|
1772
|
+
end: n.from + (n.to - n.from) * r
|
|
1773
|
+
};
|
|
1774
|
+
}
|
|
1775
|
+
var Hn = .62, Un = 8;
|
|
1776
|
+
function Wn(e, t = 48, n = 50) {
|
|
1777
|
+
let r = e.reduce((e, t) => e + t.value, 0);
|
|
1778
|
+
if (!r) return [];
|
|
1779
|
+
let i = 0, a = [];
|
|
1780
|
+
for (let o of e) {
|
|
1781
|
+
if (o.value <= 0) continue;
|
|
1782
|
+
let e = K(o.value, r), s = i + o.value / r * 2 * Math.PI, c = e < 8 ? null : e >= 100 ? {
|
|
1783
|
+
x: n,
|
|
1784
|
+
y: n
|
|
1785
|
+
} : Y(n, n, t * Hn, (i + s) / 2);
|
|
1786
|
+
a.push({
|
|
1787
|
+
slice: o,
|
|
1788
|
+
a0: i,
|
|
1789
|
+
a1: s,
|
|
1790
|
+
share: e,
|
|
1791
|
+
label: c
|
|
1792
|
+
}), i = s;
|
|
1793
|
+
}
|
|
1794
|
+
return a;
|
|
1795
|
+
}
|
|
1796
|
+
export { Dt as $, S as $t, Wn as A, d as An, dt as At, $t as B, St as Bt, sn as C, ge as Cn, T as Ct, hn as D, me as Dn, _t as Dt, pn as E, pe as En, O as Et, yn as F, ne as Fn, M as Ft, Qt as G, C as Gt, W as H, Ct as Ht, $ as I, ee as In, xt as It, V as J, ut as Jt, Kt as K, Tt as Kt, Ln as L, pt as Lt, Y as M, se as Mn, wt as Mt, K as N, ae as Nn, ot as Nt, mn as O, he as On, k as Ot, dn as P, l as Pn, tt as Pt, Gt as Q, Be as Qt, bn as R, ct as Rt, xn as S, u as Sn, lt as St, Vn as T, ue as Tn, w as Tt, tn as U, it as Ut, U as V, E as Vt, Yt as W, Xe as Wt, Zt as X, st as Xt, qt as Y, mt as Yt, Jt as Z, Pe as Zt, fn as _, Ne as _n, Pt as _t, Un as a, v as an, I as at, Z as b, ce as bn, Je as bt, vn as c, Fe as cn, Ht as ct, An as d, Te as dn, Lt as dt, Ve as en, Vt as et, Fn as f, we as fn, Rt as ft, ln as g, Ee as gn, Ft as gt, Rn as h, ke as hn, At as ht, Bn as i, Le as in, Et as it, q as j, oe as jn, Ye as jt, _n as k, de as kn, vt as kt, un as l, Ge as ln, P as lt, Nn as m, g as mn, F as mt, On as n, b as nn, It as nt, Sn as o, Ue as on, Bt as ot, Pn as p, h as pn, Ut as pt, B as q, at as qt, an as r, Ie as rn, N as rt, gn as s, _ as sn, L as st, Q as t, Ke as tn, R as tt, Mn as u, qe as un, z as ut, nn as v, p as vn, Wt as vt, zn as w, fe as wn, yt as wt, Dn as x, le as xn, Qe as xt, rn as y, Me as yn, ft as yt, Cn as z, j as zt };
|