@dcs-tech/ui 0.3.0 → 0.6.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-CuuFnW9q.js +1481 -0
- package/dist/ChartView-nS4f4EU_.js +1703 -0
- package/dist/{SummaryChart-D4jcOv-K.js → SummaryChart-CVg6i2mx.js} +8 -10
- package/dist/{SummaryImage-BSbatHym.js → SummaryImage-CoEFzMl6.js} +3 -4
- package/dist/{SummarySeeAll-vnaL3pdy.js → SummarySeeAll-C_OUs3kn.js} +24 -20
- package/dist/assets/fileTask.worker-FQSUtwcz.js +1 -0
- package/dist/columnValue-K98ElfJc.js +610 -0
- package/dist/exportContext-CJaIv8R-.js +166 -0
- package/dist/{exportEngine-C4n1MiOw.js → exportEngine-CDLYHH0d.js} +142 -139
- package/dist/fileActions-KSaVGnaE.js +144 -0
- package/dist/geometry-ChwYB45B.js +1732 -0
- package/dist/index.js +14895 -17391
- package/dist/{defaults-BbLB8QmD.js → labels-CnqqTrne.js} +4 -81
- package/dist/runFileTask-BClLQjmv.js +109 -0
- package/dist/scrollArea-DAlVT5U7.js +214 -0
- package/dist/style.css +1 -1
- package/dist/{summaryChartData-CU_W5ocv.js → summaryChartData-pNvzaEHp.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 +2 -1
- 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/{shared-web-ui/src → components}/DataTable/DataTable.d.ts +1 -1
- package/dist/types/components/DataTable/DataTable.storyData.d.ts +23 -0
- package/dist/types/components/DataTable/PressButton.d.ts +2 -0
- package/dist/types/{shared-web-ui/src → components}/DataTable/cards/cardFields.d.ts +2 -4
- package/dist/types/components/DataTable/columnValue.d.ts +19 -0
- package/dist/types/components/DataTable/export/exportCells.d.ts +13 -0
- package/dist/types/{shared-web-ui/src → components}/DataTable/export/exportEngine.d.ts +2 -0
- package/dist/types/{shared-web-ui/src → components}/DataTable/export/useTableExport.d.ts +2 -0
- package/dist/types/components/DataTable/filters/FilterChips.d.ts +9 -0
- package/dist/types/{shared-web-ui/src → components}/DataTable/host.d.ts +2 -0
- package/dist/types/components/DataTable/index.d.ts +18 -0
- package/dist/types/{shared-web-ui/src → components}/DataTable/labels.d.ts +2 -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/{shared-web-ui/src → components}/DataTable/types.d.ts +11 -0
- package/dist/types/components/DataTable/ui-local/scrollLock.d.ts +1 -0
- package/dist/types/{shared-web-ui/src → components}/DataTable/useTable.d.ts +4 -1
- package/dist/types/{shared-web-ui/src → components}/DataTable/vendor/index.d.ts +1 -1
- 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 +3 -3
- 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/components/FileEngine/FileEngineContext.d.ts +17 -0
- package/dist/types/components/FileEngine/FileEngineProvider.d.ts +12 -0
- package/dist/types/components/FileEngine/FileJobsTray.d.ts +10 -0
- package/dist/types/components/FileEngine/index.d.ts +8 -0
- package/dist/types/components/FileEngine/labels.d.ts +29 -0
- 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}/Toast/ToastHost.d.ts +1 -0
- 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/components/UIProvider/UIFormatContext.d.ts +7 -0
- package/dist/types/components/UIProvider/UILabelsContext.d.ts +116 -0
- package/dist/types/{shared-web-ui/src → components}/UIProvider/UIProvider.d.ts +7 -2
- package/dist/types/{shared-web-ui/src → components}/UIProvider/index.d.ts +4 -0
- 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 +6 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/datePicker.logic.d.ts +6 -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/core/logic/exportSafety.logic.d.ts +1 -0
- 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/core/logic/fileQueue.logic.d.ts +28 -0
- package/dist/types/core/logic/format.logic.d.ts +4 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/index.d.ts +8 -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/core/logic/tableDate.logic.d.ts +7 -0
- 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 +3 -3
- 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}/collapsible.types.d.ts +4 -16
- package/dist/types/core/types/fileEngine.types.d.ts +65 -0
- package/dist/types/core/types/format.types.d.ts +15 -0
- package/dist/types/{shared-types/src/ui → core/types}/index.d.ts +2 -0
- package/dist/types/{shared-types/src/ui → core/types}/suggest.types.d.ts +1 -0
- package/dist/types/{shared-types/src/ui → core/types}/table.types.d.ts +1 -0
- package/dist/types/{shared-web-ui/src/DataTable/vendor → file}/fileActions.d.ts +17 -7
- package/dist/types/file/fileEngine.d.ts +48 -0
- package/dist/types/file/tasks/fileTask.worker.d.ts +1 -0
- package/dist/types/file/tasks/runFileTask.d.ts +6 -0
- package/dist/types/file/workerPool.d.ts +17 -0
- package/dist/types/index.d.ts +93 -0
- package/package.json +27 -28
- package/dist/ChartImageMenu-gvNAYVkY.js +0 -2938
- package/dist/Charts-COljjy0x.js +0 -1759
- package/dist/exportContext-CAX8VPrP.js +0 -243
- 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/DataTable/index.d.ts +0 -18
- 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/types/shared-web-ui/src/index.d.ts +0 -83
- 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/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/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/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/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/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/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/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/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/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/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-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}/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}/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}/tooltip.types.d.ts +0 -0
- /package/dist/types/{shared-types/src/ui → core/types}/typography.types.d.ts +0 -0
|
@@ -1,2938 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { l as e, n as t, r as n } from "./defaults-BbLB8QmD.js";
|
|
3
|
-
import r, { cloneElement as i, createContext as a, forwardRef as o, isValidElement as s, useCallback as c, useContext as l, useEffect as u, useId as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
4
|
-
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
5
|
-
import { createPortal as y } from "react-dom";
|
|
6
|
-
//#region ../../shared-logic/src/ui/button.logic.ts
|
|
7
|
-
function ee(e) {
|
|
8
|
-
let t = e.isIconOnly && e.shape === "rounded" ? "circle" : e.shape, n = [
|
|
9
|
-
"root",
|
|
10
|
-
`variant_${e.variant}`,
|
|
11
|
-
`size_${e.size}`,
|
|
12
|
-
`color_${e.color}`,
|
|
13
|
-
`shape_${t}`
|
|
14
|
-
];
|
|
15
|
-
return e.disabled && n.push("disabled"), e.loading && (n.push("loading"), n.push(`loading_${e.loadingPosition}`)), e.fullWidth && n.push("fullWidth"), e.disableTextTransform && n.push("disableTextTransform"), e.disableElevation && n.push("disableElevation"), e.showFocusRing && n.push("showFocusRing"), e.isIconOnly && n.push("iconOnly"), n;
|
|
16
|
-
}
|
|
17
|
-
function b(e) {
|
|
18
|
-
let t = ["group", `orientation_${e.orientation}`];
|
|
19
|
-
return e.fullWidth && t.push("groupFullWidth"), t;
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region ../../shared-logic/src/ui/tooltip.logic.ts
|
|
23
|
-
function x(e) {
|
|
24
|
-
if (e == null || e === !1 || e === "") return null;
|
|
25
|
-
let t = typeof e == "object" && !Array.isArray(e) && !("$$typeof" in e) && "content" in e ? e : { content: e };
|
|
26
|
-
return t.disabled || t.content === null || t.content === void 0 || t.content === "" ? null : t;
|
|
27
|
-
}
|
|
28
|
-
function S(e) {
|
|
29
|
-
return e.openedBy !== "pointer" || e.anchorTo === "element" ? !1 : e.anchorTo === "pointer" || e.anchorWidth > e.tooltipWidth;
|
|
30
|
-
}
|
|
31
|
-
var C = {
|
|
32
|
-
top: "bottom",
|
|
33
|
-
bottom: "top",
|
|
34
|
-
left: "right",
|
|
35
|
-
right: "left"
|
|
36
|
-
};
|
|
37
|
-
function w(e) {
|
|
38
|
-
let t = e === "top" || e === "bottom" ? ["right", "left"] : ["bottom", "top"];
|
|
39
|
-
return [
|
|
40
|
-
e,
|
|
41
|
-
C[e],
|
|
42
|
-
...t
|
|
43
|
-
];
|
|
44
|
-
}
|
|
45
|
-
function T(e, { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 }) {
|
|
46
|
-
switch (e) {
|
|
47
|
-
case "top": return t.top - i - n.height >= a;
|
|
48
|
-
case "bottom": return t.top + t.height + i + n.height <= r.height - a;
|
|
49
|
-
case "left": return t.left - i - n.width >= a;
|
|
50
|
-
case "right": return t.left + t.width + i + n.width <= r.width - a;
|
|
51
|
-
default: return !1;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
var E = (e, t, n) => Math.min(Math.max(e, t), n);
|
|
55
|
-
function te(e) {
|
|
56
|
-
let { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 } = e, o = w(e.placement).find((t) => T(t, e)) || e.placement, s, c;
|
|
57
|
-
switch (o) {
|
|
58
|
-
case "bottom":
|
|
59
|
-
s = t.top + t.height + i, c = t.left + t.width / 2 - n.width / 2;
|
|
60
|
-
break;
|
|
61
|
-
case "left":
|
|
62
|
-
s = t.top + t.height / 2 - n.height / 2, c = t.left - i - n.width;
|
|
63
|
-
break;
|
|
64
|
-
case "right":
|
|
65
|
-
s = t.top + t.height / 2 - n.height / 2, c = t.left + t.width + i;
|
|
66
|
-
break;
|
|
67
|
-
default:
|
|
68
|
-
s = t.top - i - n.height, c = t.left + t.width / 2 - n.width / 2;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
placement: o,
|
|
73
|
-
left: E(c, a, Math.max(a, r.width - n.width - a)),
|
|
74
|
-
top: E(s, a, Math.max(a, r.height - n.height - a))
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region ../../shared-logic/src/ui/useMergeRefs.ts
|
|
79
|
-
function ne(...e) {
|
|
80
|
-
let t = m(e);
|
|
81
|
-
return t.current = e, c((e) => {
|
|
82
|
-
for (let n of t.current) n && (typeof n == "function" ? n(e) : n.current = e);
|
|
83
|
-
}, []);
|
|
84
|
-
}
|
|
85
|
-
var re = {
|
|
86
|
-
tooltip: "_tooltip_1m98r_14",
|
|
87
|
-
open: "_open_1m98r_42",
|
|
88
|
-
placement_top: "_placement_top_1m98r_81",
|
|
89
|
-
placement_bottom: "_placement_bottom_1m98r_82",
|
|
90
|
-
placement_left: "_placement_left_1m98r_83",
|
|
91
|
-
placement_right: "_placement_right_1m98r_84",
|
|
92
|
-
measured: "_measured_1m98r_90",
|
|
93
|
-
helpIcon: "_helpIcon_1m98r_98",
|
|
94
|
-
disabledAnchor: "_disabledAnchor_1m98r_131"
|
|
95
|
-
}, ie = 500, D = 100, O = 8, ae = 16, oe = 300, se = 0, ce = () => Date.now() - se < oe, le = () => typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --probe"), ue = () => typeof HTMLElement < "u" && Object.prototype.hasOwnProperty.call(HTMLElement.prototype, "popover");
|
|
96
|
-
function k(e) {
|
|
97
|
-
let t = x(e), n = `tooltip-${d().replace(/:/g, "")}`, [r, i] = h(!1), [a, o] = h(t?.placement || "top"), [s, l] = h(!1), f = m(null), p = m(null), g = m(void 0), v = m(void 0), y = m(null), ee = m("pointer"), b = t?.placement || "top", C = t?.anchorTo || "auto", w = t?.delay ?? ie, T = t?.closeDelay ?? D, E = c(() => {
|
|
98
|
-
let e = f.current, t = p.current;
|
|
99
|
-
if (!e || !t) return;
|
|
100
|
-
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = y.current, a = te({
|
|
101
|
-
anchor: i && S({
|
|
102
|
-
anchorTo: C,
|
|
103
|
-
openedBy: ee.current,
|
|
104
|
-
anchorWidth: n.width,
|
|
105
|
-
tooltipWidth: r.width
|
|
106
|
-
}) && i ? {
|
|
107
|
-
top: i.y - ae / 2,
|
|
108
|
-
left: i.x - ae / 2,
|
|
109
|
-
width: ae,
|
|
110
|
-
height: ae
|
|
111
|
-
} : {
|
|
112
|
-
top: n.top,
|
|
113
|
-
left: n.left,
|
|
114
|
-
width: n.width,
|
|
115
|
-
height: n.height
|
|
116
|
-
},
|
|
117
|
-
tooltip: {
|
|
118
|
-
width: r.width,
|
|
119
|
-
height: r.height
|
|
120
|
-
},
|
|
121
|
-
viewport: {
|
|
122
|
-
width: window.innerWidth,
|
|
123
|
-
height: window.innerHeight
|
|
124
|
-
},
|
|
125
|
-
placement: b,
|
|
126
|
-
offset: O
|
|
127
|
-
});
|
|
128
|
-
e.style.top = `${a.top}px`, e.style.left = `${a.left}px`, o(a.placement);
|
|
129
|
-
}, [b, C]), ne = () => {
|
|
130
|
-
window.clearTimeout(g.current), window.clearTimeout(v.current);
|
|
131
|
-
}, oe = c((e, t) => {
|
|
132
|
-
p.current = e, ee.current = t, l(t === "pointer" && C !== "element"), le() && e.style.setProperty("anchor-name", `--${n}`), i(!0);
|
|
133
|
-
}, [n, C]), k = c(() => {
|
|
134
|
-
i(!1), se = Date.now();
|
|
135
|
-
}, []), de = c((e, t) => {
|
|
136
|
-
ne();
|
|
137
|
-
let n = ce() ? 0 : w;
|
|
138
|
-
if (n === 0) {
|
|
139
|
-
oe(e, t);
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
g.current = window.setTimeout(() => oe(e, t), n);
|
|
143
|
-
}, [w, oe]), fe = c(() => {
|
|
144
|
-
ne(), v.current = window.setTimeout(k, T);
|
|
145
|
-
}, [T, k]);
|
|
146
|
-
return u(() => {
|
|
147
|
-
let e = f.current;
|
|
148
|
-
if (!e) return;
|
|
149
|
-
if (!r) {
|
|
150
|
-
ue() && e.matches(":popover-open") && e.hidePopover();
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
if (ue() && !e.matches(":popover-open") && e.showPopover(), le() && !s) return;
|
|
154
|
-
E();
|
|
155
|
-
let t = () => E();
|
|
156
|
-
return window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), () => {
|
|
157
|
-
window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
|
|
158
|
-
};
|
|
159
|
-
}, [
|
|
160
|
-
r,
|
|
161
|
-
s,
|
|
162
|
-
E
|
|
163
|
-
]), u(() => {
|
|
164
|
-
if (!r) return;
|
|
165
|
-
let e = (e) => {
|
|
166
|
-
e.key === "Escape" && (ne(), k());
|
|
167
|
-
};
|
|
168
|
-
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
169
|
-
}, [r, k]), u(() => ne, []), t ? {
|
|
170
|
-
hasTooltip: !0,
|
|
171
|
-
tooltipNode: /* @__PURE__ */ _("div", {
|
|
172
|
-
ref: f,
|
|
173
|
-
id: n,
|
|
174
|
-
role: "tooltip",
|
|
175
|
-
popover: ue() ? "manual" : void 0,
|
|
176
|
-
className: [
|
|
177
|
-
re.tooltip,
|
|
178
|
-
re[`placement_${a}`],
|
|
179
|
-
r ? re.open : "",
|
|
180
|
-
s ? re.measured : "",
|
|
181
|
-
t.className || ""
|
|
182
|
-
].filter(Boolean).join(" "),
|
|
183
|
-
style: { "--tooltip-anchor": `--${n}` },
|
|
184
|
-
children: t.content
|
|
185
|
-
}),
|
|
186
|
-
triggerProps: {
|
|
187
|
-
onPointerEnter: (e) => {
|
|
188
|
-
e.pointerType !== "touch" && (y.current = {
|
|
189
|
-
x: e.clientX,
|
|
190
|
-
y: e.clientY
|
|
191
|
-
}, de(e.currentTarget, "pointer"));
|
|
192
|
-
},
|
|
193
|
-
onPointerMove: (e) => {
|
|
194
|
-
e.pointerType === "touch" || r || g.current === void 0 || (y.current = {
|
|
195
|
-
x: e.clientX,
|
|
196
|
-
y: e.clientY
|
|
197
|
-
});
|
|
198
|
-
},
|
|
199
|
-
onPointerLeave: fe,
|
|
200
|
-
onFocus: (e) => {
|
|
201
|
-
e.currentTarget.matches(":focus-visible") && (y.current = null, de(e.currentTarget, "focus"));
|
|
202
|
-
},
|
|
203
|
-
onBlur: fe,
|
|
204
|
-
"aria-describedby": r ? n : void 0
|
|
205
|
-
}
|
|
206
|
-
} : {
|
|
207
|
-
triggerProps: {
|
|
208
|
-
onPointerEnter: () => {},
|
|
209
|
-
onPointerMove: () => {},
|
|
210
|
-
onPointerLeave: () => {},
|
|
211
|
-
onFocus: () => {},
|
|
212
|
-
onBlur: () => {}
|
|
213
|
-
},
|
|
214
|
-
tooltipNode: null,
|
|
215
|
-
hasTooltip: !1
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region ../../shared-web-ui/src/Tooltip/Tooltip.tsx
|
|
220
|
-
var de = ({ children: e, ...t }) => {
|
|
221
|
-
let { triggerProps: n, tooltipNode: r } = k(t);
|
|
222
|
-
if (!s(e)) return /* @__PURE__ */ _(g, { children: e });
|
|
223
|
-
let a = e.props;
|
|
224
|
-
return /* @__PURE__ */ v(g, { children: [i(e, {
|
|
225
|
-
...n,
|
|
226
|
-
onPointerEnter: (e) => {
|
|
227
|
-
a.onPointerEnter?.(e), n.onPointerEnter(e);
|
|
228
|
-
},
|
|
229
|
-
onPointerMove: (e) => {
|
|
230
|
-
a.onPointerMove?.(e), n.onPointerMove(e);
|
|
231
|
-
},
|
|
232
|
-
onPointerLeave: (e) => {
|
|
233
|
-
a.onPointerLeave?.(e), n.onPointerLeave();
|
|
234
|
-
},
|
|
235
|
-
onFocus: (e) => {
|
|
236
|
-
a.onFocus?.(e), n.onFocus(e);
|
|
237
|
-
},
|
|
238
|
-
onBlur: (e) => {
|
|
239
|
-
a.onBlur?.(e), n.onBlur();
|
|
240
|
-
},
|
|
241
|
-
"aria-describedby": n["aria-describedby"] || a["aria-describedby"]
|
|
242
|
-
}), r] });
|
|
243
|
-
}, fe = () => /* @__PURE__ */ v("svg", {
|
|
244
|
-
viewBox: "0 0 24 24",
|
|
245
|
-
fill: "none",
|
|
246
|
-
stroke: "currentColor",
|
|
247
|
-
strokeWidth: "2",
|
|
248
|
-
strokeLinecap: "round",
|
|
249
|
-
"aria-hidden": "true",
|
|
250
|
-
children: [
|
|
251
|
-
/* @__PURE__ */ _("circle", {
|
|
252
|
-
cx: "12",
|
|
253
|
-
cy: "12",
|
|
254
|
-
r: "9"
|
|
255
|
-
}),
|
|
256
|
-
/* @__PURE__ */ _("line", {
|
|
257
|
-
x1: "12",
|
|
258
|
-
y1: "11",
|
|
259
|
-
x2: "12",
|
|
260
|
-
y2: "16"
|
|
261
|
-
}),
|
|
262
|
-
/* @__PURE__ */ _("line", {
|
|
263
|
-
x1: "12",
|
|
264
|
-
y1: "7.5",
|
|
265
|
-
x2: "12",
|
|
266
|
-
y2: "7.6"
|
|
267
|
-
})
|
|
268
|
-
]
|
|
269
|
-
}), pe = ({ tooltip: e, label: t = "More information" }) => {
|
|
270
|
-
let { triggerProps: n, tooltipNode: r, hasTooltip: i } = k(e);
|
|
271
|
-
return i ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
|
|
272
|
-
type: "button",
|
|
273
|
-
className: re.helpIcon,
|
|
274
|
-
"aria-label": t,
|
|
275
|
-
...n,
|
|
276
|
-
children: /* @__PURE__ */ _(fe, {})
|
|
277
|
-
}), r] }) : null;
|
|
278
|
-
}, me = a(null);
|
|
279
|
-
function he() {
|
|
280
|
-
return l(me);
|
|
281
|
-
}
|
|
282
|
-
var A = {
|
|
283
|
-
root: "_root_vam6j_6",
|
|
284
|
-
size_xxs: "_size_xxs_vam6j_36",
|
|
285
|
-
size_xs: "_size_xs_vam6j_43",
|
|
286
|
-
size_small: "_size_small_vam6j_50",
|
|
287
|
-
size_medium: "_size_medium_vam6j_57",
|
|
288
|
-
size_large: "_size_large_vam6j_64",
|
|
289
|
-
size_xl: "_size_xl_vam6j_71",
|
|
290
|
-
iconOnly: "_iconOnly_vam6j_80",
|
|
291
|
-
shape_rectangle: "_shape_rectangle_vam6j_89",
|
|
292
|
-
shape_rounded: "_shape_rounded_vam6j_93",
|
|
293
|
-
shape_pill: "_shape_pill_vam6j_97",
|
|
294
|
-
shape_circle: "_shape_circle_vam6j_101",
|
|
295
|
-
shape_square: "_shape_square_vam6j_113",
|
|
296
|
-
color_primary: "_color_primary_vam6j_127",
|
|
297
|
-
color_secondary: "_color_secondary_vam6j_136",
|
|
298
|
-
color_success: "_color_success_vam6j_145",
|
|
299
|
-
color_error: "_color_error_vam6j_154",
|
|
300
|
-
color_warning: "_color_warning_vam6j_163",
|
|
301
|
-
color_info: "_color_info_vam6j_172",
|
|
302
|
-
color_neutral: "_color_neutral_vam6j_181",
|
|
303
|
-
variant_filled: "_variant_filled_vam6j_191",
|
|
304
|
-
disabled: "_disabled_vam6j_196",
|
|
305
|
-
disableElevation: "_disableElevation_vam6j_206",
|
|
306
|
-
variant_outlined: "_variant_outlined_vam6j_216",
|
|
307
|
-
variant_text: "_variant_text_vam6j_236",
|
|
308
|
-
variant_elevated: "_variant_elevated_vam6j_253",
|
|
309
|
-
variant_tonal: "_variant_tonal_vam6j_272",
|
|
310
|
-
loading: "_loading_vam6j_294",
|
|
311
|
-
fullWidth: "_fullWidth_vam6j_298",
|
|
312
|
-
disableTextTransform: "_disableTextTransform_vam6j_302",
|
|
313
|
-
showFocusRing: "_showFocusRing_vam6j_313",
|
|
314
|
-
content: "_content_vam6j_320",
|
|
315
|
-
loading_overlay: "_loading_overlay_vam6j_328",
|
|
316
|
-
loading_center: "_loading_center_vam6j_329",
|
|
317
|
-
icon: "_icon_vam6j_80",
|
|
318
|
-
loadingWrapper: "_loadingWrapper_vam6j_347",
|
|
319
|
-
loading_start: "_loading_start_vam6j_359",
|
|
320
|
-
loading_end: "_loading_end_vam6j_360",
|
|
321
|
-
spinner: "_spinner_vam6j_365",
|
|
322
|
-
spin: "_spin_vam6j_365",
|
|
323
|
-
srOnly: "_srOnly_vam6j_376",
|
|
324
|
-
ripple: "_ripple_vam6j_396",
|
|
325
|
-
group: "_group_vam6j_430",
|
|
326
|
-
orientation_horizontal: "_orientation_horizontal_vam6j_435",
|
|
327
|
-
orientation_vertical: "_orientation_vertical_vam6j_439",
|
|
328
|
-
groupFullWidth: "_groupFullWidth_vam6j_443"
|
|
329
|
-
}, ge = () => /* @__PURE__ */ _("span", {
|
|
330
|
-
className: A.spinner,
|
|
331
|
-
role: "status",
|
|
332
|
-
"aria-label": "Loading",
|
|
333
|
-
children: /* @__PURE__ */ _("span", {
|
|
334
|
-
className: A.srOnly,
|
|
335
|
-
children: "Loading..."
|
|
336
|
-
})
|
|
337
|
-
}), _e = o(({ type: e = "button", name: t, value: n, onClick: i, onFocus: a, onBlur: o, onMouseEnter: s, onMouseLeave: l, onPointerEnter: u, onPointerMove: f, onPointerLeave: h, onKeyDown: y, children: b, label: S, startIcon: C, endIcon: w, icon: T, tooltip: E, tooltipTrigger: te, disabled: ie = !1, loading: D = !1, loadingPosition: O = "center", loadingIndicator: ae, autoFocus: oe = !1, tabIndex: se, preventDefault: ce = !1, stopPropagation: le = !1, variant: ue = "elevated", size: de = "small", color: fe = "primary", shape: pe = "rounded", className: me = "", style: _e = {}, fullWidth: ve = !1, disableTextTransform: ye = !1, disableElevation: be = !1, ripple: xe = !0, showFocusRing: Se = !0, id: Ce, buttonRef: we, href: Te, target: Ee, rel: De, download: Oe, component: ke, componentProps: Ae = {}, "aria-label": j, "aria-labelledby": je, "aria-describedby": Me, "aria-pressed": Ne, "aria-expanded": Pe, "aria-controls": Fe, "aria-haspopup": Ie, role: Le }, Re) => {
|
|
338
|
-
let ze = he(), Be = ze?.size || de, Ve = ze?.variant || ue, He = ze?.color || fe, M = ze?.disabled || ie, Ue = d(), We = Ce || Ue, N = m(null), Ge = ne(Re, we, N);
|
|
339
|
-
r.useEffect(() => {
|
|
340
|
-
oe && N.current && N.current.focus();
|
|
341
|
-
}, [oe]);
|
|
342
|
-
let Ke = !!T && !b && !S, qe = b || S || "", Je = c((e) => {
|
|
343
|
-
M || D || (ce && e.preventDefault(), le && e.stopPropagation(), i?.(e));
|
|
344
|
-
}, [
|
|
345
|
-
M,
|
|
346
|
-
D,
|
|
347
|
-
ce,
|
|
348
|
-
le,
|
|
349
|
-
i
|
|
350
|
-
]), Ye = p(() => {
|
|
351
|
-
let e = ee({
|
|
352
|
-
variant: Ve,
|
|
353
|
-
size: Be,
|
|
354
|
-
color: He,
|
|
355
|
-
shape: pe,
|
|
356
|
-
isIconOnly: Ke,
|
|
357
|
-
disabled: M,
|
|
358
|
-
loading: D,
|
|
359
|
-
loadingPosition: O,
|
|
360
|
-
fullWidth: ve,
|
|
361
|
-
disableTextTransform: ye,
|
|
362
|
-
disableElevation: be,
|
|
363
|
-
showFocusRing: Se
|
|
364
|
-
}).map((e) => A[e]).filter(Boolean);
|
|
365
|
-
return me && e.push(me), e.join(" ");
|
|
366
|
-
}, [
|
|
367
|
-
Ve,
|
|
368
|
-
Be,
|
|
369
|
-
He,
|
|
370
|
-
pe,
|
|
371
|
-
Ke,
|
|
372
|
-
M,
|
|
373
|
-
D,
|
|
374
|
-
O,
|
|
375
|
-
ve,
|
|
376
|
-
ye,
|
|
377
|
-
be,
|
|
378
|
-
Se,
|
|
379
|
-
me
|
|
380
|
-
]), { triggerProps: P, tooltipNode: Xe, hasTooltip: Ze } = k(E), Qe = x(E), $e = typeof Qe?.content == "string" ? Qe.content : void 0, et = (M || D) && Ze, tt = c((e) => {
|
|
381
|
-
a?.(e), P.onFocus(e);
|
|
382
|
-
}, [a, P]), nt = c((e) => {
|
|
383
|
-
o?.(e), P.onBlur();
|
|
384
|
-
}, [o, P]), F = c((e) => {
|
|
385
|
-
u?.(e), P.onPointerEnter(e);
|
|
386
|
-
}, [u, P]), rt = c((e) => {
|
|
387
|
-
f?.(e), P.onPointerMove(e);
|
|
388
|
-
}, [f, P]), it = c((e) => {
|
|
389
|
-
h?.(e), P.onPointerLeave();
|
|
390
|
-
}, [h, P]), at = ae || /* @__PURE__ */ _(ge, {}), ot = () => O === "overlay" || O === "center" ? /* @__PURE__ */ _("span", {
|
|
391
|
-
className: `${A.loadingWrapper} ${A[`loading_${O}`] || ""}`,
|
|
392
|
-
children: at
|
|
393
|
-
}) : at, st = () => Ke ? /* @__PURE__ */ _("span", {
|
|
394
|
-
className: A.icon,
|
|
395
|
-
children: T
|
|
396
|
-
}) : /* @__PURE__ */ v("span", {
|
|
397
|
-
className: A.content,
|
|
398
|
-
children: [
|
|
399
|
-
D && O === "start" && /* @__PURE__ */ _("span", {
|
|
400
|
-
className: `${A.loadingWrapper} ${A.loading_start || ""}`,
|
|
401
|
-
children: ot()
|
|
402
|
-
}),
|
|
403
|
-
C && !D && /* @__PURE__ */ _("span", {
|
|
404
|
-
className: `${A.icon} ${A.iconStart || ""}`,
|
|
405
|
-
children: C
|
|
406
|
-
}),
|
|
407
|
-
qe && /* @__PURE__ */ _("span", { children: qe }),
|
|
408
|
-
w && !D && /* @__PURE__ */ _("span", {
|
|
409
|
-
className: `${A.icon} ${A.iconEnd || ""}`,
|
|
410
|
-
children: w
|
|
411
|
-
}),
|
|
412
|
-
D && O === "end" && /* @__PURE__ */ _("span", {
|
|
413
|
-
className: `${A.loadingWrapper} ${A.loading_end || ""}`,
|
|
414
|
-
children: ot()
|
|
415
|
-
})
|
|
416
|
-
]
|
|
417
|
-
}), ct = D && (O === "overlay" || O === "center"), lt = {
|
|
418
|
-
ref: Ge,
|
|
419
|
-
id: We,
|
|
420
|
-
name: t,
|
|
421
|
-
value: n,
|
|
422
|
-
disabled: M || D,
|
|
423
|
-
tabIndex: se,
|
|
424
|
-
className: Ye,
|
|
425
|
-
style: _e,
|
|
426
|
-
onClick: Je,
|
|
427
|
-
onFocus: tt,
|
|
428
|
-
onBlur: nt,
|
|
429
|
-
onMouseEnter: s,
|
|
430
|
-
onMouseLeave: l,
|
|
431
|
-
onKeyDown: y,
|
|
432
|
-
"aria-label": j || (Ke ? $e : void 0),
|
|
433
|
-
"aria-labelledby": je,
|
|
434
|
-
"aria-describedby": P["aria-describedby"] || Me,
|
|
435
|
-
onPointerEnter: F,
|
|
436
|
-
onPointerMove: rt,
|
|
437
|
-
onPointerLeave: it,
|
|
438
|
-
"aria-pressed": Ne,
|
|
439
|
-
"aria-expanded": Pe,
|
|
440
|
-
"aria-controls": Fe,
|
|
441
|
-
"aria-haspopup": Ie,
|
|
442
|
-
"aria-busy": D || void 0,
|
|
443
|
-
"aria-disabled": M || void 0,
|
|
444
|
-
role: Le || (Te ? "link" : void 0),
|
|
445
|
-
...Ae
|
|
446
|
-
}, ut = /* @__PURE__ */ v(g, { children: [
|
|
447
|
-
st(),
|
|
448
|
-
ct && ot(),
|
|
449
|
-
xe && /* @__PURE__ */ _("span", { className: A.ripple })
|
|
450
|
-
] }), dt = () => {
|
|
451
|
-
if (Te) {
|
|
452
|
-
let { disabled: e, ref: t, ...n } = lt;
|
|
453
|
-
return /* @__PURE__ */ _("a", {
|
|
454
|
-
...n,
|
|
455
|
-
href: Te,
|
|
456
|
-
target: Ee,
|
|
457
|
-
rel: De || (Ee === "_blank" ? "noopener noreferrer" : void 0),
|
|
458
|
-
download: Oe,
|
|
459
|
-
children: ut
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
return _(ke || "button", {
|
|
463
|
-
...lt,
|
|
464
|
-
type: e,
|
|
465
|
-
children: ut
|
|
466
|
-
});
|
|
467
|
-
};
|
|
468
|
-
return Ze ? /* @__PURE__ */ v(g, { children: [et ? /* @__PURE__ */ _("span", {
|
|
469
|
-
className: re.disabledAnchor,
|
|
470
|
-
onPointerEnter: P.onPointerEnter,
|
|
471
|
-
onPointerLeave: P.onPointerLeave,
|
|
472
|
-
children: dt()
|
|
473
|
-
}) : dt(), Xe] }) : dt();
|
|
474
|
-
});
|
|
475
|
-
_e.displayName = "Button";
|
|
476
|
-
//#endregion
|
|
477
|
-
//#region ../../shared-web-ui/src/Button/ButtonGroup.tsx
|
|
478
|
-
var ve = ({ orientation: e = "horizontal", size: t, variant: n, color: r, disabled: i = !1, fullWidth: a = !1, className: o = "", style: s = {}, children: c, "aria-label": l, role: u = "group" }) => {
|
|
479
|
-
let d = p(() => ({
|
|
480
|
-
size: t,
|
|
481
|
-
variant: n,
|
|
482
|
-
color: r,
|
|
483
|
-
disabled: i
|
|
484
|
-
}), [
|
|
485
|
-
t,
|
|
486
|
-
n,
|
|
487
|
-
r,
|
|
488
|
-
i
|
|
489
|
-
]), f = p(() => {
|
|
490
|
-
let t = b({
|
|
491
|
-
orientation: e,
|
|
492
|
-
fullWidth: a
|
|
493
|
-
}).map((e) => A[e]).filter(Boolean);
|
|
494
|
-
return o && t.push(o), t.join(" ");
|
|
495
|
-
}, [
|
|
496
|
-
e,
|
|
497
|
-
a,
|
|
498
|
-
o
|
|
499
|
-
]);
|
|
500
|
-
return /* @__PURE__ */ _(me.Provider, {
|
|
501
|
-
value: d,
|
|
502
|
-
children: /* @__PURE__ */ _("div", {
|
|
503
|
-
className: f,
|
|
504
|
-
style: s,
|
|
505
|
-
role: u,
|
|
506
|
-
"aria-label": l,
|
|
507
|
-
children: c
|
|
508
|
-
})
|
|
509
|
-
});
|
|
510
|
-
}, ye = a(null), be = () => l(ye) || (typeof document > "u" ? null : document.body), xe = {
|
|
511
|
-
title: 1,
|
|
512
|
-
subtitle: 1,
|
|
513
|
-
badge: 1,
|
|
514
|
-
details: 4,
|
|
515
|
-
more: 40
|
|
516
|
-
}, Se = {
|
|
517
|
-
title: 1,
|
|
518
|
-
subtitle: 2,
|
|
519
|
-
badge: 1
|
|
520
|
-
}, Ce = ["top", "bottom"], we = {
|
|
521
|
-
value: ["number", "numberTrend"],
|
|
522
|
-
ratio: [
|
|
523
|
-
"bar",
|
|
524
|
-
"gauge",
|
|
525
|
-
"ring",
|
|
526
|
-
"donut",
|
|
527
|
-
"pie"
|
|
528
|
-
],
|
|
529
|
-
breakdown: [
|
|
530
|
-
"donut",
|
|
531
|
-
"pie",
|
|
532
|
-
"bars",
|
|
533
|
-
"stacked",
|
|
534
|
-
"treemap"
|
|
535
|
-
],
|
|
536
|
-
trend: [
|
|
537
|
-
"columns",
|
|
538
|
-
"line",
|
|
539
|
-
"area",
|
|
540
|
-
"grouped",
|
|
541
|
-
"stacked",
|
|
542
|
-
"calendar"
|
|
543
|
-
],
|
|
544
|
-
funnel: ["funnel"]
|
|
545
|
-
}, Te = [
|
|
546
|
-
"auto",
|
|
547
|
-
"quarter",
|
|
548
|
-
"half",
|
|
549
|
-
"full"
|
|
550
|
-
], Ee = [
|
|
551
|
-
"top5",
|
|
552
|
-
"top10",
|
|
553
|
-
"least5",
|
|
554
|
-
"least10",
|
|
555
|
-
"all"
|
|
556
|
-
], De = {
|
|
557
|
-
month: [
|
|
558
|
-
3,
|
|
559
|
-
6,
|
|
560
|
-
12,
|
|
561
|
-
24,
|
|
562
|
-
36
|
|
563
|
-
],
|
|
564
|
-
day: [
|
|
565
|
-
30,
|
|
566
|
-
91,
|
|
567
|
-
182,
|
|
568
|
-
365
|
|
569
|
-
]
|
|
570
|
-
}, Oe = {
|
|
571
|
-
month: {
|
|
572
|
-
min: 1,
|
|
573
|
-
max: 60
|
|
574
|
-
},
|
|
575
|
-
day: {
|
|
576
|
-
min: 7,
|
|
577
|
-
max: 400
|
|
578
|
-
}
|
|
579
|
-
}, ke = 6, Ae = 24;
|
|
580
|
-
function j(e) {
|
|
581
|
-
return "logic" in e && "conditions" in e;
|
|
582
|
-
}
|
|
583
|
-
//#endregion
|
|
584
|
-
//#region ../../shared-web-ui/src/DataTable/filters/filterEngine.ts
|
|
585
|
-
var je = [
|
|
586
|
-
"contains",
|
|
587
|
-
"not_contains",
|
|
588
|
-
"starts_with",
|
|
589
|
-
"ends_with",
|
|
590
|
-
"equals",
|
|
591
|
-
"not_equals",
|
|
592
|
-
"regex",
|
|
593
|
-
"is_empty",
|
|
594
|
-
"is_not_empty"
|
|
595
|
-
], Me = [
|
|
596
|
-
"equals",
|
|
597
|
-
"not_equals",
|
|
598
|
-
"gt",
|
|
599
|
-
"gte",
|
|
600
|
-
"lt",
|
|
601
|
-
"lte",
|
|
602
|
-
"between",
|
|
603
|
-
"not_between",
|
|
604
|
-
"is_empty",
|
|
605
|
-
"is_not_empty"
|
|
606
|
-
], Ne = [
|
|
607
|
-
"in_range",
|
|
608
|
-
"not_in_range",
|
|
609
|
-
"equals",
|
|
610
|
-
"before",
|
|
611
|
-
"after",
|
|
612
|
-
"is_empty",
|
|
613
|
-
"is_not_empty"
|
|
614
|
-
], Pe = [
|
|
615
|
-
"is_true",
|
|
616
|
-
"is_false",
|
|
617
|
-
"is_empty",
|
|
618
|
-
"is_not_empty"
|
|
619
|
-
], Fe = [
|
|
620
|
-
"is",
|
|
621
|
-
"is_not",
|
|
622
|
-
"is_any_of",
|
|
623
|
-
"is_not_any_of",
|
|
624
|
-
"is_empty",
|
|
625
|
-
"is_not_empty"
|
|
626
|
-
], Ie = [
|
|
627
|
-
"includes",
|
|
628
|
-
"not_includes",
|
|
629
|
-
"includes_any",
|
|
630
|
-
"includes_all",
|
|
631
|
-
"includes_only",
|
|
632
|
-
"is_empty",
|
|
633
|
-
"is_not_empty",
|
|
634
|
-
"length_equals",
|
|
635
|
-
"length_gt",
|
|
636
|
-
"length_gte",
|
|
637
|
-
"length_lt",
|
|
638
|
-
"length_lte",
|
|
639
|
-
"length_between",
|
|
640
|
-
"length_not_between"
|
|
641
|
-
];
|
|
642
|
-
function Le(e) {
|
|
643
|
-
switch (e) {
|
|
644
|
-
case "number": return Me;
|
|
645
|
-
case "date": return Ne;
|
|
646
|
-
case "boolean": return Pe;
|
|
647
|
-
case "select": return Fe;
|
|
648
|
-
case "array": return Ie;
|
|
649
|
-
default: return je;
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
var Re = {
|
|
653
|
-
date: ["not_equals"],
|
|
654
|
-
select: ["contains", "equals"],
|
|
655
|
-
array: ["contains", "equals"]
|
|
656
|
-
};
|
|
657
|
-
function ze(e) {
|
|
658
|
-
let t = Re[e];
|
|
659
|
-
return t ? [...Le(e), ...t] : Le(e);
|
|
660
|
-
}
|
|
661
|
-
var Be = [
|
|
662
|
-
"is",
|
|
663
|
-
"is_not",
|
|
664
|
-
"is_any_of",
|
|
665
|
-
"is_not_any_of",
|
|
666
|
-
"includes_any",
|
|
667
|
-
"includes_all",
|
|
668
|
-
"includes_only"
|
|
669
|
-
];
|
|
670
|
-
function Ve(t, n = e) {
|
|
671
|
-
let r = n[`op_${t}`];
|
|
672
|
-
return typeof r == "string" ? r : t;
|
|
673
|
-
}
|
|
674
|
-
function He(t, n = e) {
|
|
675
|
-
return Le(t).map((e) => ({
|
|
676
|
-
value: e,
|
|
677
|
-
label: Ve(e, n)
|
|
678
|
-
}));
|
|
679
|
-
}
|
|
680
|
-
var M = (e) => String(e).padStart(2, "0");
|
|
681
|
-
function Ue(e) {
|
|
682
|
-
if (e == null || e === "") return null;
|
|
683
|
-
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e.trim())) return e.trim();
|
|
684
|
-
let t = e instanceof Date ? e : new Date(e);
|
|
685
|
-
return Number.isNaN(t.getTime()) ? null : `${t.getFullYear()}-${M(t.getMonth() + 1)}-${M(t.getDate())}`;
|
|
686
|
-
}
|
|
687
|
-
function We(e, t, n) {
|
|
688
|
-
let r = Ue(t?.from), i = Ue(t?.to);
|
|
689
|
-
if (!r && !i) return !0;
|
|
690
|
-
let a = Ue(e);
|
|
691
|
-
if (!a) return !1;
|
|
692
|
-
let o = (!r || a >= r) && (!i || a <= i);
|
|
693
|
-
return n ? o : !o;
|
|
694
|
-
}
|
|
695
|
-
function N(e, t, r) {
|
|
696
|
-
if (!t.enabled || !t.column || !t.operator) return !0;
|
|
697
|
-
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";
|
|
698
|
-
switch (t.operator) {
|
|
699
|
-
case "is_empty": return Array.isArray(o) ? o.length === 0 : o == null || String(o).trim() === "";
|
|
700
|
-
case "is_not_empty": return Array.isArray(o) ? o.length > 0 : o != null && String(o).trim() !== "";
|
|
701
|
-
case "contains": return String(o ?? "").toLowerCase().includes(String(s ?? "").toLowerCase());
|
|
702
|
-
case "not_contains": return !String(o ?? "").toLowerCase().includes(String(s ?? "").toLowerCase());
|
|
703
|
-
case "starts_with": return String(o ?? "").toLowerCase().startsWith(String(s ?? "").toLowerCase());
|
|
704
|
-
case "ends_with": return String(o ?? "").toLowerCase().endsWith(String(s ?? "").toLowerCase());
|
|
705
|
-
case "equals": return c || typeof o == "number" ? Number(o) === Number(s) : String(o ?? "").toLowerCase() === String(s ?? "").toLowerCase();
|
|
706
|
-
case "not_equals": return c || typeof o == "number" ? Number(o) !== Number(s) : String(o ?? "").toLowerCase() !== String(s ?? "").toLowerCase();
|
|
707
|
-
case "regex": try {
|
|
708
|
-
return new RegExp(s, "i").test(String(o ?? ""));
|
|
709
|
-
} catch {
|
|
710
|
-
return !0;
|
|
711
|
-
}
|
|
712
|
-
case "gt": return Number(o) > Number(s);
|
|
713
|
-
case "gte": return Number(o) >= Number(s);
|
|
714
|
-
case "lt": return Number(o) < Number(s);
|
|
715
|
-
case "lte": return Number(o) <= Number(s);
|
|
716
|
-
case "between": {
|
|
717
|
-
let e = Number(o), t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
|
|
718
|
-
return e >= t && e <= n;
|
|
719
|
-
}
|
|
720
|
-
case "not_between": {
|
|
721
|
-
let e = Number(o), t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
|
|
722
|
-
return e < t || e > n;
|
|
723
|
-
}
|
|
724
|
-
case "in_range": return We(o, s, !0);
|
|
725
|
-
case "not_in_range": return We(o, s, !1);
|
|
726
|
-
case "before": return new Date(o) < new Date(s);
|
|
727
|
-
case "after": return new Date(o) > new Date(s);
|
|
728
|
-
case "is_true": return !!o;
|
|
729
|
-
case "is_false": return !o;
|
|
730
|
-
case "is": return String(o ?? "").toLowerCase() === String(s ?? "").toLowerCase();
|
|
731
|
-
case "is_not": return String(o ?? "").toLowerCase() !== String(s ?? "").toLowerCase();
|
|
732
|
-
case "is_any_of": return (Array.isArray(s) ? s : [s]).some((e) => String(o ?? "").toLowerCase() === String(e ?? "").toLowerCase());
|
|
733
|
-
case "is_not_any_of": return !(Array.isArray(s) ? s : [s]).some((e) => String(o ?? "").toLowerCase() === String(e ?? "").toLowerCase());
|
|
734
|
-
case "includes": {
|
|
735
|
-
let e = Array.isArray(o) ? o : [], t = String(s ?? "").toLowerCase(), n = i?.filterOptions;
|
|
736
|
-
return e.some((e) => {
|
|
737
|
-
if (String(e).toLowerCase().includes(t)) return !0;
|
|
738
|
-
if (n) {
|
|
739
|
-
let r = n.find((t) => String(t.value) === String(e))?.label;
|
|
740
|
-
if (r && r.toLowerCase().includes(t)) return !0;
|
|
741
|
-
}
|
|
742
|
-
return !1;
|
|
743
|
-
});
|
|
744
|
-
}
|
|
745
|
-
case "not_includes": {
|
|
746
|
-
let e = Array.isArray(o) ? o : [], t = String(s ?? "").toLowerCase(), n = i?.filterOptions;
|
|
747
|
-
return !e.some((e) => {
|
|
748
|
-
if (String(e).toLowerCase().includes(t)) return !0;
|
|
749
|
-
if (n) {
|
|
750
|
-
let r = n.find((t) => String(t.value) === String(e))?.label;
|
|
751
|
-
if (r && r.toLowerCase().includes(t)) return !0;
|
|
752
|
-
}
|
|
753
|
-
return !1;
|
|
754
|
-
});
|
|
755
|
-
}
|
|
756
|
-
case "includes_any": {
|
|
757
|
-
let e = Array.isArray(o) ? o : [];
|
|
758
|
-
return (Array.isArray(s) ? s : [s]).some((t) => e.some((e) => String(e).toLowerCase() === String(t).toLowerCase()));
|
|
759
|
-
}
|
|
760
|
-
case "includes_all": {
|
|
761
|
-
let e = Array.isArray(o) ? o : [];
|
|
762
|
-
return (Array.isArray(s) ? s : [s]).every((t) => e.some((e) => String(e).toLowerCase() === String(t).toLowerCase()));
|
|
763
|
-
}
|
|
764
|
-
case "includes_only": {
|
|
765
|
-
let e = Array.isArray(o) ? o : [], t = Array.isArray(s) ? s : [s];
|
|
766
|
-
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()));
|
|
767
|
-
}
|
|
768
|
-
case "length_equals": return (Array.isArray(o) ? o.length : 0) === Number(s);
|
|
769
|
-
case "length_gt": return (Array.isArray(o) ? o.length : 0) > Number(s);
|
|
770
|
-
case "length_gte": return (Array.isArray(o) ? o.length : 0) >= Number(s);
|
|
771
|
-
case "length_lt": return (Array.isArray(o) ? o.length : 0) < Number(s);
|
|
772
|
-
case "length_lte": return (Array.isArray(o) ? o.length : 0) <= Number(s);
|
|
773
|
-
case "length_between": {
|
|
774
|
-
let e = Array.isArray(o) ? o.length : 0, t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
|
|
775
|
-
return e >= t && e <= n;
|
|
776
|
-
}
|
|
777
|
-
case "length_not_between": {
|
|
778
|
-
let e = Array.isArray(o) ? o.length : 0, t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
|
|
779
|
-
return e < t || e > n;
|
|
780
|
-
}
|
|
781
|
-
default: return !0;
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
function Ge(e, t, n) {
|
|
785
|
-
if (!t.conditions || t.conditions.length === 0) return !0;
|
|
786
|
-
let r;
|
|
787
|
-
return r = t.logic === "AND" ? t.conditions.every((t) => j(t) ? Ge(e, t, n) : N(e, t, n)) : t.conditions.some((t) => j(t) ? Ge(e, t, n) : N(e, t, n)), t.negated ? !r : r;
|
|
788
|
-
}
|
|
789
|
-
function Ke(t, n, r = e) {
|
|
790
|
-
let i = [];
|
|
791
|
-
function a(e) {
|
|
792
|
-
for (let t of e) if (j(t)) a(t.conditions);
|
|
793
|
-
else if (t.enabled && t.column && t.operator) {
|
|
794
|
-
let e = n.find((e) => e.key === t.column), a = Le(e?.type || "string").includes(t.operator);
|
|
795
|
-
i.push({
|
|
796
|
-
id: t.id,
|
|
797
|
-
column: t.column,
|
|
798
|
-
columnLabel: e?.header || t.column,
|
|
799
|
-
operator: t.operator,
|
|
800
|
-
operatorLabel: a ? Ve(t.operator, r) : t.operator,
|
|
801
|
-
value: t.value,
|
|
802
|
-
displayValue: Je(t.value, t.operator, e?.filterOptions, r)
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
return a(t.conditions), i;
|
|
807
|
-
}
|
|
808
|
-
function qe(e, t) {
|
|
809
|
-
if (!t) return String(e ?? "");
|
|
810
|
-
let n = t.find((t) => String(t.value) === String(e));
|
|
811
|
-
return n ? n.label : String(e ?? "");
|
|
812
|
-
}
|
|
813
|
-
function Je(e, t, n, r) {
|
|
814
|
-
if (t === "is_empty" || t === "is_not_empty") return "";
|
|
815
|
-
if (t === "is_true") return r.filterTrue;
|
|
816
|
-
if (t === "is_false") return r.filterFalse;
|
|
817
|
-
if (t === "between" || t === "not_between") return `${e?.from ?? e?.[0] ?? ""} - ${e?.to ?? e?.[1] ?? ""}`;
|
|
818
|
-
if (t === "in_range" || t === "not_in_range") {
|
|
819
|
-
let t = e?.from ?? "", n = e?.to ?? "";
|
|
820
|
-
return t && n ? r.filterRangeBoth(String(t), String(n)) : t ? r.filterRangeFrom(String(t)) : n ? r.filterRangeUntil(String(n)) : "";
|
|
821
|
-
}
|
|
822
|
-
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) => qe(e, n)).join(", ") : e == null ? "" : qe(e, n);
|
|
823
|
-
}
|
|
824
|
-
function Ye(e, t) {
|
|
825
|
-
let n = e.conditions.filter((e) => j(e) ? !0 : e.id !== t).map((e) => j(e) ? Ye(e, t) : e).filter((e) => !j(e) || e.conditions.length > 0);
|
|
826
|
-
return {
|
|
827
|
-
...e,
|
|
828
|
-
conditions: n
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
function P(e) {
|
|
832
|
-
return e.conditions.some((e) => j(e) ? P(e) : e.enabled && e.column && e.operator);
|
|
833
|
-
}
|
|
834
|
-
//#endregion
|
|
835
|
-
//#region ../../shared-web-ui/src/DataTable/grouping/groupModel.ts
|
|
836
|
-
var Xe = 3, Ze = (e) => JSON.stringify(e.map((e) => [e.key, e.value]));
|
|
837
|
-
function Qe(e, t) {
|
|
838
|
-
let n = e.grouping, r = typeof n == "object" && n ? n : {};
|
|
839
|
-
return {
|
|
840
|
-
enabled: n !== !1 && t.allowed && (!t.serverMode || t.hasGroupsSource),
|
|
841
|
-
maxDepth: Math.max(1, Math.min(r.maxDepth ?? 3, 6)),
|
|
842
|
-
defaultLevels: r.defaultGroupBy ?? []
|
|
843
|
-
};
|
|
844
|
-
}
|
|
845
|
-
function $e(e, t) {
|
|
846
|
-
return e.filter((e) => e.authorized !== !1 && et(e, t));
|
|
847
|
-
}
|
|
848
|
-
function et(e, t) {
|
|
849
|
-
return e.groupable ?? (!t && (e.type === "select" || e.type === "boolean"));
|
|
850
|
-
}
|
|
851
|
-
function tt(e, t, n) {
|
|
852
|
-
let r = [];
|
|
853
|
-
for (let n of e ?? []) t.includes(n) && !r.includes(n) && r.push(n);
|
|
854
|
-
return r.slice(0, n);
|
|
855
|
-
}
|
|
856
|
-
function nt(e, t) {
|
|
857
|
-
let r = n(t, e.key);
|
|
858
|
-
if (e.filterAccessor && (r = e.filterAccessor(r)), r == null || r === "") return null;
|
|
859
|
-
if (Array.isArray(r)) {
|
|
860
|
-
let e = r.filter((e) => e != null && e !== "").map(String).sort();
|
|
861
|
-
return e.length ? e.join("|") : null;
|
|
862
|
-
}
|
|
863
|
-
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);
|
|
864
|
-
}
|
|
865
|
-
function F(e, t, n, r) {
|
|
866
|
-
if (t == null) return r || n.groupEmpty;
|
|
867
|
-
if (r) return r;
|
|
868
|
-
if (typeof t == "boolean") return t ? n.yes : n.no;
|
|
869
|
-
if (e?.type === "boolean" && (t === "true" || t === "false")) return t === "true" ? n.yes : n.no;
|
|
870
|
-
let i = (t) => e?.filterOptions?.find((e) => String(e.value) === t)?.label ?? t;
|
|
871
|
-
return e?.type === "array" && typeof t == "string" ? t.split("|").map(i).join(", ") : i(String(t));
|
|
872
|
-
}
|
|
873
|
-
var rt = typeof Intl < "u" ? new Intl.Collator(void 0, {
|
|
874
|
-
numeric: !0,
|
|
875
|
-
sensitivity: "base"
|
|
876
|
-
}) : null, it = (e, t) => rt ? rt.compare(e, t) : e.localeCompare(t);
|
|
877
|
-
function at(e, t) {
|
|
878
|
-
return [...e].sort((e, n) => {
|
|
879
|
-
if (e.value === null && n.value !== null) return 1;
|
|
880
|
-
if (n.value === null && e.value !== null) return -1;
|
|
881
|
-
let r = typeof e.value == "number" && typeof n.value == "number" ? e.value - n.value : it(e.label, n.label);
|
|
882
|
-
return t ? -r : r;
|
|
883
|
-
});
|
|
884
|
-
}
|
|
885
|
-
function ot(e, t, n, r) {
|
|
886
|
-
if (!t.length) return [];
|
|
887
|
-
let [i, ...a] = t, o = r.parent ?? [], s = /* @__PURE__ */ new Map();
|
|
888
|
-
for (let t of e) {
|
|
889
|
-
let e = nt(i, n(t)), r = JSON.stringify(e), a = s.get(r);
|
|
890
|
-
a || s.set(r, a = {
|
|
891
|
-
value: e,
|
|
892
|
-
rows: []
|
|
893
|
-
}), a.rows.push(t);
|
|
894
|
-
}
|
|
895
|
-
return at(Array.from(s.values()).map((e) => {
|
|
896
|
-
let t = [...o, {
|
|
897
|
-
key: i.key,
|
|
898
|
-
field: i.field || i.key,
|
|
899
|
-
value: e.value
|
|
900
|
-
}];
|
|
901
|
-
return {
|
|
902
|
-
key: Ze(t),
|
|
903
|
-
path: t,
|
|
904
|
-
depth: o.length,
|
|
905
|
-
columnKey: i.key,
|
|
906
|
-
value: e.value,
|
|
907
|
-
label: F(i, e.value, r.labels),
|
|
908
|
-
count: e.rows.length,
|
|
909
|
-
rows: e.rows,
|
|
910
|
-
children: a.length ? ot(e.rows, a, n, {
|
|
911
|
-
...r,
|
|
912
|
-
parent: t
|
|
913
|
-
}) : void 0
|
|
914
|
-
};
|
|
915
|
-
}), r.sortedDesc?.(i.key) === !0);
|
|
916
|
-
}
|
|
917
|
-
function st(e, t = []) {
|
|
918
|
-
for (let n of e ?? []) t.push(n.key), st(n.children, t);
|
|
919
|
-
return t;
|
|
920
|
-
}
|
|
921
|
-
function ct(e, t) {
|
|
922
|
-
let n = [], r = (e) => {
|
|
923
|
-
for (let i of e) {
|
|
924
|
-
let e = t.expanded.has(i.key);
|
|
925
|
-
if (n.push({
|
|
926
|
-
kind: "group",
|
|
927
|
-
key: `g:${i.key}`,
|
|
928
|
-
node: i,
|
|
929
|
-
expanded: e
|
|
930
|
-
}), !e) continue;
|
|
931
|
-
let a = i.depth >= t.levels - 1;
|
|
932
|
-
if (!t.loadState) {
|
|
933
|
-
if (!a && i.children) r(i.children);
|
|
934
|
-
else for (let e of i.rows ?? []) n.push({
|
|
935
|
-
kind: "row",
|
|
936
|
-
key: `r:${t.rowKey(e)}`,
|
|
937
|
-
row: e,
|
|
938
|
-
depth: i.depth + 1
|
|
939
|
-
});
|
|
940
|
-
continue;
|
|
941
|
-
}
|
|
942
|
-
let o = t.loadState(i);
|
|
943
|
-
if (!a) {
|
|
944
|
-
i.children ? r(i.children) : n.push({
|
|
945
|
-
kind: "status",
|
|
946
|
-
key: `s:${i.key}`,
|
|
947
|
-
node: i,
|
|
948
|
-
status: o?.status === "error" ? "error" : "loading"
|
|
949
|
-
});
|
|
950
|
-
continue;
|
|
951
|
-
}
|
|
952
|
-
if (!o || o.status !== "done" && !o.rows?.length) {
|
|
953
|
-
n.push({
|
|
954
|
-
kind: "status",
|
|
955
|
-
key: `s:${i.key}`,
|
|
956
|
-
node: i,
|
|
957
|
-
status: o?.status === "error" ? "error" : "loading"
|
|
958
|
-
});
|
|
959
|
-
continue;
|
|
960
|
-
}
|
|
961
|
-
let s = o.rows ?? [];
|
|
962
|
-
for (let e of s) n.push({
|
|
963
|
-
kind: "row",
|
|
964
|
-
key: `r:${t.rowKey(e)}`,
|
|
965
|
-
row: e,
|
|
966
|
-
depth: i.depth + 1
|
|
967
|
-
});
|
|
968
|
-
s.length < i.count && n.push({
|
|
969
|
-
kind: "more",
|
|
970
|
-
key: `m:${i.key}`,
|
|
971
|
-
node: i,
|
|
972
|
-
shown: s.length,
|
|
973
|
-
loading: !!o.loadingMore,
|
|
974
|
-
capped: !!o.capped
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
};
|
|
978
|
-
return r(e), n;
|
|
979
|
-
}
|
|
980
|
-
var lt = (e) => e.kind === "group" ? e.node.depth : e.kind === "row" ? e.depth : e.node.depth + 1;
|
|
981
|
-
function ut(e, t, n) {
|
|
982
|
-
let r = t * n, i = e.slice(r, r + n), a = i[0];
|
|
983
|
-
if (!a || r === 0) return i;
|
|
984
|
-
let o = [];
|
|
985
|
-
for (let t = 0; t < r; t++) {
|
|
986
|
-
let n = e[t];
|
|
987
|
-
n.kind === "group" && (o.length = n.node.depth, o.push(n));
|
|
988
|
-
}
|
|
989
|
-
let s = lt(a);
|
|
990
|
-
return [...o.slice(0, s).map((e) => ({
|
|
991
|
-
...e,
|
|
992
|
-
key: `${e.key}:cont`,
|
|
993
|
-
continued: !0
|
|
994
|
-
})), ...i];
|
|
995
|
-
}
|
|
996
|
-
function dt(e, t, n, r) {
|
|
997
|
-
return r === null ? {
|
|
998
|
-
id: e,
|
|
999
|
-
column: t,
|
|
1000
|
-
operator: "is_empty",
|
|
1001
|
-
value: "",
|
|
1002
|
-
enabled: !0
|
|
1003
|
-
} : n?.type === "boolean" || typeof r == "boolean" ? {
|
|
1004
|
-
id: e,
|
|
1005
|
-
column: t,
|
|
1006
|
-
operator: r === !0 || r === "true" ? "is_true" : "is_false",
|
|
1007
|
-
value: "",
|
|
1008
|
-
enabled: !0
|
|
1009
|
-
} : n?.type === "array" ? {
|
|
1010
|
-
id: e,
|
|
1011
|
-
column: t,
|
|
1012
|
-
operator: "includes",
|
|
1013
|
-
value: r,
|
|
1014
|
-
enabled: !0
|
|
1015
|
-
} : n?.type === "select" ? {
|
|
1016
|
-
id: e,
|
|
1017
|
-
column: t,
|
|
1018
|
-
operator: "is",
|
|
1019
|
-
value: r,
|
|
1020
|
-
enabled: !0
|
|
1021
|
-
} : {
|
|
1022
|
-
id: e,
|
|
1023
|
-
column: t,
|
|
1024
|
-
operator: "equals",
|
|
1025
|
-
value: r,
|
|
1026
|
-
enabled: !0
|
|
1027
|
-
};
|
|
1028
|
-
}
|
|
1029
|
-
function ft(e) {
|
|
1030
|
-
return [...e.type === "boolean" ? ["is_true", "is_false"] : e.type === "array" ? ["includes"] : e.type === "select" ? ["is"] : ["equals"], "is_empty"];
|
|
1031
|
-
}
|
|
1032
|
-
function pt(e, t) {
|
|
1033
|
-
return e.map((e, n) => dt(`group:${n}:${e.key}`, e.key, t.find((t) => t.key === e.key), e.value));
|
|
1034
|
-
}
|
|
1035
|
-
function mt(e, t, n) {
|
|
1036
|
-
let r = pt(t, n);
|
|
1037
|
-
return r.length ? e.logic === "AND" && !e.negated ? {
|
|
1038
|
-
...e,
|
|
1039
|
-
conditions: [...e.conditions, ...r]
|
|
1040
|
-
} : {
|
|
1041
|
-
id: "group-path",
|
|
1042
|
-
logic: "AND",
|
|
1043
|
-
conditions: e.conditions.length ? [e, ...r] : r
|
|
1044
|
-
} : e;
|
|
1045
|
-
}
|
|
1046
|
-
//#endregion
|
|
1047
|
-
//#region ../../shared-web-ui/src/DataTable/summary/summaryModel.ts
|
|
1048
|
-
var ht = "summary:", I = (e) => `${ht}${e}`, gt = (e) => e.kind === "breakdown" || e.kind === "trend" || e.kind === "funnel";
|
|
1049
|
-
function _t(e) {
|
|
1050
|
-
return e.kind === "value" ? e.trend ? we.value : ["number"] : e.kind === "trend" ? [
|
|
1051
|
-
...e.period === "day" ? ["calendar"] : [],
|
|
1052
|
-
"columns",
|
|
1053
|
-
"line",
|
|
1054
|
-
"area",
|
|
1055
|
-
...e.split ? ["grouped", "stacked"] : []
|
|
1056
|
-
] : we[e.kind];
|
|
1057
|
-
}
|
|
1058
|
-
function L(e) {
|
|
1059
|
-
let t = _t(e), n = "chart" in e ? e.chart : void 0;
|
|
1060
|
-
return n && t.includes(n) ? n : t[0];
|
|
1061
|
-
}
|
|
1062
|
-
function vt(e) {
|
|
1063
|
-
return e.kind === "value" ? [e.value, ...e.sub ? [e.sub.value] : []] : e.kind === "ratio" ? [
|
|
1064
|
-
e.value,
|
|
1065
|
-
e.total,
|
|
1066
|
-
...e.sub ? [e.sub.value] : []
|
|
1067
|
-
] : [];
|
|
1068
|
-
}
|
|
1069
|
-
var yt = 9;
|
|
1070
|
-
function bt(e) {
|
|
1071
|
-
if (e === "all") return { from: "all" };
|
|
1072
|
-
let t = /^(top|least)(\d+)$/.exec(e);
|
|
1073
|
-
return {
|
|
1074
|
-
from: t[1],
|
|
1075
|
-
count: Number(t[2])
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
function xt(e, t = 9) {
|
|
1079
|
-
return e.show ? bt(e.show) : L(e) === "bars" ? { from: "all" } : {
|
|
1080
|
-
from: "top",
|
|
1081
|
-
count: t
|
|
1082
|
-
};
|
|
1083
|
-
}
|
|
1084
|
-
var St = (e) => e.label ?? (e.value === null ? "" : String(e.value));
|
|
1085
|
-
function Ct(e, t) {
|
|
1086
|
-
let n = [...e].sort((e, t) => t.count - e.count || St(e).localeCompare(St(t)));
|
|
1087
|
-
return t.from === "all" || t.count >= n.length ? {
|
|
1088
|
-
buckets: t.from === "least" ? n.reverse() : n,
|
|
1089
|
-
others: 0,
|
|
1090
|
-
values: e.length
|
|
1091
|
-
} : {
|
|
1092
|
-
buckets: t.from === "top" ? n.slice(0, t.count) : n.slice(-t.count).reverse(),
|
|
1093
|
-
others: (t.from === "top" ? n.slice(t.count) : n.slice(0, -t.count)).reduce((e, t) => e + t.count, 0),
|
|
1094
|
-
values: e.length
|
|
1095
|
-
};
|
|
1096
|
-
}
|
|
1097
|
-
var wt = (e) => !!e.within && L(e) === "treemap", Tt = (e) => !!e.split && (L(e) === "grouped" || L(e) === "stacked"), Et = (e) => !!e.trend && L(e) === "numberTrend";
|
|
1098
|
-
function Dt(e, t) {
|
|
1099
|
-
switch (e.kind) {
|
|
1100
|
-
case "trend": return `${e.id}.${e.period === "day" ? "d" : "m"}${e.count}${Tt(e) ? `.s${e.split}` : ""}`;
|
|
1101
|
-
case "funnel": return `${e.id}.f`;
|
|
1102
|
-
case "value": return `${e.id}.t${e.trend?.period === "day" ? "d" : "m"}${e.trend?.count ?? 0}`;
|
|
1103
|
-
case "breakdown": {
|
|
1104
|
-
let n = xt(e, t);
|
|
1105
|
-
return `${e.id}.${n.from === "all" ? "all" : `${n.from}${n.count}`}${wt(e) ? `.w${e.within}` : ""}`;
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
function Ot(e, t) {
|
|
1110
|
-
let n = Array.from(new Set(e.flatMap((e) => vt(e).map((e) => e.id)))), r = (e) => t.find((t) => t.key === e)?.field || e, i = /* @__PURE__ */ new Map();
|
|
1111
|
-
for (let t of e) {
|
|
1112
|
-
if (t.kind === "ratio" || t.kind === "value" && !Et(t)) continue;
|
|
1113
|
-
let e = Dt(t);
|
|
1114
|
-
if (!i.has(e)) switch (t.kind) {
|
|
1115
|
-
case "value":
|
|
1116
|
-
i.set(e, {
|
|
1117
|
-
key: e,
|
|
1118
|
-
id: t.id,
|
|
1119
|
-
kind: "series",
|
|
1120
|
-
value: t.value.id,
|
|
1121
|
-
field: r(t.trend.column),
|
|
1122
|
-
period: t.trend.period,
|
|
1123
|
-
count: t.trend.count
|
|
1124
|
-
});
|
|
1125
|
-
break;
|
|
1126
|
-
case "breakdown":
|
|
1127
|
-
i.set(e, {
|
|
1128
|
-
key: e,
|
|
1129
|
-
id: t.id,
|
|
1130
|
-
kind: "breakdown",
|
|
1131
|
-
field: r(t.column),
|
|
1132
|
-
part: xt(t),
|
|
1133
|
-
...wt(t) ? { within: r(t.within) } : {}
|
|
1134
|
-
});
|
|
1135
|
-
break;
|
|
1136
|
-
case "trend":
|
|
1137
|
-
i.set(e, {
|
|
1138
|
-
key: e,
|
|
1139
|
-
id: t.id,
|
|
1140
|
-
kind: "trend",
|
|
1141
|
-
field: r(t.column),
|
|
1142
|
-
period: t.period,
|
|
1143
|
-
count: t.count,
|
|
1144
|
-
...Tt(t) ? { split: r(t.split) } : {}
|
|
1145
|
-
});
|
|
1146
|
-
break;
|
|
1147
|
-
case "funnel":
|
|
1148
|
-
i.set(e, {
|
|
1149
|
-
key: e,
|
|
1150
|
-
id: t.id,
|
|
1151
|
-
kind: "funnel",
|
|
1152
|
-
steps: t.steps.map((e) => e.value.id)
|
|
1153
|
-
});
|
|
1154
|
-
break;
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
return {
|
|
1158
|
-
values: n,
|
|
1159
|
-
cards: Array.from(i.values())
|
|
1160
|
-
};
|
|
1161
|
-
}
|
|
1162
|
-
function kt(e, t) {
|
|
1163
|
-
if (e.logic !== "AND" || e.negated) return;
|
|
1164
|
-
let n = I(t);
|
|
1165
|
-
return e.conditions.find((e) => !j(e) && e.id === n && e.enabled);
|
|
1166
|
-
}
|
|
1167
|
-
function At(e, t) {
|
|
1168
|
-
let n = kt(e, t);
|
|
1169
|
-
return n ? {
|
|
1170
|
-
...e,
|
|
1171
|
-
conditions: e.conditions.filter((e) => e !== n)
|
|
1172
|
-
} : e;
|
|
1173
|
-
}
|
|
1174
|
-
function jt(e, n, r) {
|
|
1175
|
-
let i = I(n), a = e.logic === "AND" && !e.negated ? e : {
|
|
1176
|
-
id: t(),
|
|
1177
|
-
logic: "AND",
|
|
1178
|
-
conditions: e.conditions.length ? [e] : []
|
|
1179
|
-
}, o = a.conditions.filter((e) => j(e) || e.id !== i);
|
|
1180
|
-
return {
|
|
1181
|
-
...a,
|
|
1182
|
-
conditions: r ? [...o, r] : o
|
|
1183
|
-
};
|
|
1184
|
-
}
|
|
1185
|
-
function Mt(e, t, n) {
|
|
1186
|
-
return dt(I(e.id), e.column, t, n);
|
|
1187
|
-
}
|
|
1188
|
-
function Nt(e, t) {
|
|
1189
|
-
let n = I(e.id);
|
|
1190
|
-
if (t.length > 7) return {
|
|
1191
|
-
id: n,
|
|
1192
|
-
column: e.column,
|
|
1193
|
-
operator: "in_range",
|
|
1194
|
-
value: {
|
|
1195
|
-
from: t,
|
|
1196
|
-
to: t
|
|
1197
|
-
},
|
|
1198
|
-
enabled: !0
|
|
1199
|
-
};
|
|
1200
|
-
let [r, i] = t.split("-").map(Number), a = new Date(r, i, 0).getDate();
|
|
1201
|
-
return {
|
|
1202
|
-
id: n,
|
|
1203
|
-
column: e.column,
|
|
1204
|
-
operator: "in_range",
|
|
1205
|
-
value: {
|
|
1206
|
-
from: `${t}-01`,
|
|
1207
|
-
to: `${t}-${String(a).padStart(2, "0")}`
|
|
1208
|
-
},
|
|
1209
|
-
enabled: !0
|
|
1210
|
-
};
|
|
1211
|
-
}
|
|
1212
|
-
function Pt(e, t) {
|
|
1213
|
-
let n = e.steps.find((e) => e.id === t);
|
|
1214
|
-
return n?.condition ? {
|
|
1215
|
-
id: I(e.id),
|
|
1216
|
-
...n.condition,
|
|
1217
|
-
enabled: !0
|
|
1218
|
-
} : null;
|
|
1219
|
-
}
|
|
1220
|
-
var R = (e) => e === null ? "" : String(e), Ft = "\0others";
|
|
1221
|
-
function It(e, t) {
|
|
1222
|
-
if (!t) return null;
|
|
1223
|
-
if (e.kind === "trend") {
|
|
1224
|
-
let n = t.value?.from;
|
|
1225
|
-
return typeof n == "string" ? n.slice(0, e.period === "day" ? 10 : 7) : null;
|
|
1226
|
-
}
|
|
1227
|
-
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);
|
|
1228
|
-
}
|
|
1229
|
-
function Lt(e, t) {
|
|
1230
|
-
return e.compute ? e.compute(t) : t.length;
|
|
1231
|
-
}
|
|
1232
|
-
function Rt(e, t) {
|
|
1233
|
-
let n = /* @__PURE__ */ new Map();
|
|
1234
|
-
for (let r of e) {
|
|
1235
|
-
let e = nt(t, r), i = R(e), a = n.get(i);
|
|
1236
|
-
a ? a.count++ : n.set(i, {
|
|
1237
|
-
value: e,
|
|
1238
|
-
count: 1
|
|
1239
|
-
});
|
|
1240
|
-
}
|
|
1241
|
-
return Array.from(n.values());
|
|
1242
|
-
}
|
|
1243
|
-
function zt(e, t, n, r) {
|
|
1244
|
-
return {
|
|
1245
|
-
...e,
|
|
1246
|
-
buckets: e.buckets.map((e) => ({
|
|
1247
|
-
...e,
|
|
1248
|
-
children: Rt(t.filter((t) => R(nt(n, t)) === R(e.value)), r)
|
|
1249
|
-
}))
|
|
1250
|
-
};
|
|
1251
|
-
}
|
|
1252
|
-
function Bt(e, t = /* @__PURE__ */ new Date()) {
|
|
1253
|
-
return Array.from({ length: e }, (n, r) => {
|
|
1254
|
-
let i = new Date(t.getFullYear(), t.getMonth() - (e - 1 - r), 1);
|
|
1255
|
-
return `${i.getFullYear()}-${String(i.getMonth() + 1).padStart(2, "0")}`;
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
function Vt(e, t = /* @__PURE__ */ new Date()) {
|
|
1259
|
-
let n = (e) => String(e).padStart(2, "0");
|
|
1260
|
-
return Array.from({ length: e }, (r, i) => {
|
|
1261
|
-
let a = new Date(t.getFullYear(), t.getMonth(), t.getDate() - (e - 1 - i));
|
|
1262
|
-
return `${a.getFullYear()}-${n(a.getMonth() + 1)}-${n(a.getDate())}`;
|
|
1263
|
-
});
|
|
1264
|
-
}
|
|
1265
|
-
function Ht(e, t, r, i) {
|
|
1266
|
-
let a = new Map(r.map((e) => [e, []]));
|
|
1267
|
-
for (let r of e) {
|
|
1268
|
-
let e = Ue(n(r, t.key)), o = e === null ? null : i === "month" ? e.slice(0, 7) : e;
|
|
1269
|
-
o !== null && a.get(o)?.push(r);
|
|
1270
|
-
}
|
|
1271
|
-
return a;
|
|
1272
|
-
}
|
|
1273
|
-
function Ut(e, t, n, r, i, a) {
|
|
1274
|
-
let o = n === "month" ? Bt(r, i) : Vt(r, i), s = Ht(e, t, o, n);
|
|
1275
|
-
return o.map((e) => {
|
|
1276
|
-
let t = s.get(e);
|
|
1277
|
-
return {
|
|
1278
|
-
period: e,
|
|
1279
|
-
count: t.length,
|
|
1280
|
-
...a ? { split: Rt(t, a) } : {}
|
|
1281
|
-
};
|
|
1282
|
-
});
|
|
1283
|
-
}
|
|
1284
|
-
function Wt(e, t, n, r, i, a) {
|
|
1285
|
-
let o = r === "month" ? Bt(2 * i, a) : Vt(2 * i, a), s = Ht(e, n, o, r), c = o.slice(0, i).flatMap((e) => s.get(e));
|
|
1286
|
-
return {
|
|
1287
|
-
points: o.slice(i).map((e) => ({
|
|
1288
|
-
period: e,
|
|
1289
|
-
count: Lt(t, s.get(e))
|
|
1290
|
-
})),
|
|
1291
|
-
previous: Lt(t, c)
|
|
1292
|
-
};
|
|
1293
|
-
}
|
|
1294
|
-
function Gt(e, t, n, r, i, a) {
|
|
1295
|
-
let o = n.buckets.map((e) => ({
|
|
1296
|
-
...e,
|
|
1297
|
-
key: R(e.value),
|
|
1298
|
-
label: F(t, e.value, r, e.label)
|
|
1299
|
-
})), s = xt(e, i).from === "least";
|
|
1300
|
-
o.sort((e, t) => (s ? e.count - t.count : t.count - e.count) || e.label.localeCompare(t.label));
|
|
1301
|
-
let c = o.map((t, n) => ({
|
|
1302
|
-
key: t.key,
|
|
1303
|
-
value: t.value,
|
|
1304
|
-
label: t.label,
|
|
1305
|
-
count: t.count,
|
|
1306
|
-
slot: e.slots?.[t.key] ?? n + 1,
|
|
1307
|
-
...t.children ? { children: [...t.children].sort((e, t) => t.count - e.count).map((e) => ({
|
|
1308
|
-
key: R(e.value),
|
|
1309
|
-
label: F(a, e.value, r, e.label),
|
|
1310
|
-
count: e.count
|
|
1311
|
-
})) } : {}
|
|
1312
|
-
}));
|
|
1313
|
-
return n.others > 0 && c.push({
|
|
1314
|
-
key: Ft,
|
|
1315
|
-
value: null,
|
|
1316
|
-
label: r.others,
|
|
1317
|
-
count: n.others,
|
|
1318
|
-
slot: "rest",
|
|
1319
|
-
others: !0
|
|
1320
|
-
}), c;
|
|
1321
|
-
}
|
|
1322
|
-
var Kt = (e, t) => {
|
|
1323
|
-
try {
|
|
1324
|
-
return new Intl.DateTimeFormat(e, t);
|
|
1325
|
-
} catch {
|
|
1326
|
-
return new Intl.DateTimeFormat(void 0, t);
|
|
1327
|
-
}
|
|
1328
|
-
};
|
|
1329
|
-
function qt(e, t, n) {
|
|
1330
|
-
let r = Kt(n, t === "month" ? { month: "short" } : {
|
|
1331
|
-
day: "numeric",
|
|
1332
|
-
month: "short"
|
|
1333
|
-
}), i = Kt(n, t === "month" ? {
|
|
1334
|
-
month: "long",
|
|
1335
|
-
year: "numeric"
|
|
1336
|
-
} : { dateStyle: "medium" });
|
|
1337
|
-
return e.map(({ period: e, count: t }) => {
|
|
1338
|
-
let [n, a, o] = e.split("-").map(Number), s = new Date(n, a - 1, o ?? 1);
|
|
1339
|
-
return {
|
|
1340
|
-
key: e,
|
|
1341
|
-
label: r.format(s),
|
|
1342
|
-
fullLabel: i.format(s),
|
|
1343
|
-
count: t
|
|
1344
|
-
};
|
|
1345
|
-
});
|
|
1346
|
-
}
|
|
1347
|
-
function Jt(e, t, n, r) {
|
|
1348
|
-
let i = /* @__PURE__ */ new Map(), a = t.map((e) => {
|
|
1349
|
-
let t = {};
|
|
1350
|
-
for (let a of e.split ?? []) {
|
|
1351
|
-
let e = R(a.value);
|
|
1352
|
-
t[e] = (t[e] ?? 0) + a.count;
|
|
1353
|
-
let o = i.get(e) ?? {
|
|
1354
|
-
value: a.value,
|
|
1355
|
-
label: F(n, a.value, r, a.label),
|
|
1356
|
-
count: 0
|
|
1357
|
-
};
|
|
1358
|
-
o.count += a.count, i.set(e, o);
|
|
1359
|
-
}
|
|
1360
|
-
return t;
|
|
1361
|
-
});
|
|
1362
|
-
return {
|
|
1363
|
-
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) => ({
|
|
1364
|
-
key: t,
|
|
1365
|
-
label: n.label,
|
|
1366
|
-
slot: e.slots?.[t] ?? r + 1
|
|
1367
|
-
})),
|
|
1368
|
-
perPeriod: a
|
|
1369
|
-
};
|
|
1370
|
-
}
|
|
1371
|
-
var Yt = (e, t) => t > 0 ? e / t * 100 : 0;
|
|
1372
|
-
function Xt(e) {
|
|
1373
|
-
return e > 0 && e < 1 ? "<1%" : e > 99 && e < 100 ? ">99%" : `${Math.round(e)}%`;
|
|
1374
|
-
}
|
|
1375
|
-
function Zt(e, t) {
|
|
1376
|
-
return e.text ? e.text(t) : `${e.label}: ${t}`;
|
|
1377
|
-
}
|
|
1378
|
-
function Qt(e, t) {
|
|
1379
|
-
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} ${Xt(Yt(e.value, e.total))}`] : []).join(" · ");
|
|
1380
|
-
}
|
|
1381
|
-
function $t(e, t, n) {
|
|
1382
|
-
let r = {}, i = [];
|
|
1383
|
-
for (let a of e) {
|
|
1384
|
-
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)} (${Xt(Yt(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({
|
|
1385
|
-
id: a.key,
|
|
1386
|
-
title: a.card.title,
|
|
1387
|
-
header: [a.column?.header ?? a.card.column, t.summaryCount],
|
|
1388
|
-
rows: a.buckets.map((e) => ({
|
|
1389
|
-
label: e.label,
|
|
1390
|
-
count: e.count
|
|
1391
|
-
}))
|
|
1392
|
-
}), a.kind === "trend" && a.periods) {
|
|
1393
|
-
let e = a.card.period === "day", n = (e ? a.periods.filter((e) => e.count > 0) : a.periods).map((e) => ({
|
|
1394
|
-
label: e.fullLabel,
|
|
1395
|
-
count: e.count
|
|
1396
|
-
}));
|
|
1397
|
-
i.push({
|
|
1398
|
-
id: a.key,
|
|
1399
|
-
title: a.card.title,
|
|
1400
|
-
header: [e ? t.summaryDay : t.summaryMonth, t.summaryCount],
|
|
1401
|
-
rows: n
|
|
1402
|
-
});
|
|
1403
|
-
}
|
|
1404
|
-
a.kind === "funnel" && a.steps && i.push({
|
|
1405
|
-
id: a.key,
|
|
1406
|
-
title: a.card.title,
|
|
1407
|
-
header: [t.summaryStep, t.summaryCount],
|
|
1408
|
-
rows: a.steps.map((e) => ({
|
|
1409
|
-
label: e.label,
|
|
1410
|
-
count: e.count
|
|
1411
|
-
}))
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
return {
|
|
1415
|
-
items: r,
|
|
1416
|
-
...i.length ? { tables: i } : {}
|
|
1417
|
-
};
|
|
1418
|
-
}
|
|
1419
|
-
//#endregion
|
|
1420
|
-
//#region ../../shared-web-ui/src/Charts/palette.ts
|
|
1421
|
-
var en = 10, tn = {
|
|
1422
|
-
light: {
|
|
1423
|
-
1: "#2a78d6",
|
|
1424
|
-
2: "#eb6834",
|
|
1425
|
-
3: "#1baf7a",
|
|
1426
|
-
4: "#9257d1",
|
|
1427
|
-
5: "#d9a40e",
|
|
1428
|
-
6: "#d6457f",
|
|
1429
|
-
7: "#1592b0",
|
|
1430
|
-
8: "#9c6b3f",
|
|
1431
|
-
9: "#728a1c",
|
|
1432
|
-
10: "#cf3c3c",
|
|
1433
|
-
rest: "#b3b7bf",
|
|
1434
|
-
positive: "#2e7d4f",
|
|
1435
|
-
warning: "#d98a00",
|
|
1436
|
-
negative: "#c62828",
|
|
1437
|
-
info: "#3b6fd8",
|
|
1438
|
-
neutral: "#8a8a99"
|
|
1439
|
-
},
|
|
1440
|
-
dark: {
|
|
1441
|
-
1: "#3987e5",
|
|
1442
|
-
2: "#d95926",
|
|
1443
|
-
3: "#199e70",
|
|
1444
|
-
4: "#a676e3",
|
|
1445
|
-
5: "#e2b53a",
|
|
1446
|
-
6: "#e5679a",
|
|
1447
|
-
7: "#2fadcb",
|
|
1448
|
-
8: "#b98a5f",
|
|
1449
|
-
9: "#93ab3a",
|
|
1450
|
-
10: "#e66363",
|
|
1451
|
-
rest: "#4a4f59",
|
|
1452
|
-
positive: "#3fa56b",
|
|
1453
|
-
warning: "#e0a030",
|
|
1454
|
-
negative: "#ef5350",
|
|
1455
|
-
info: "#6b95ea",
|
|
1456
|
-
neutral: "#737380"
|
|
1457
|
-
}
|
|
1458
|
-
}, nn = {
|
|
1459
|
-
light: {
|
|
1460
|
-
lightness: [
|
|
1461
|
-
.46,
|
|
1462
|
-
.54,
|
|
1463
|
-
.62,
|
|
1464
|
-
.7,
|
|
1465
|
-
.78
|
|
1466
|
-
],
|
|
1467
|
-
chroma: [
|
|
1468
|
-
.09,
|
|
1469
|
-
.13,
|
|
1470
|
-
.17
|
|
1471
|
-
],
|
|
1472
|
-
hueStep: 8,
|
|
1473
|
-
background: "#ffffff"
|
|
1474
|
-
},
|
|
1475
|
-
dark: {
|
|
1476
|
-
lightness: [
|
|
1477
|
-
.58,
|
|
1478
|
-
.66,
|
|
1479
|
-
.74,
|
|
1480
|
-
.82,
|
|
1481
|
-
.9
|
|
1482
|
-
],
|
|
1483
|
-
chroma: [
|
|
1484
|
-
.09,
|
|
1485
|
-
.13,
|
|
1486
|
-
.17
|
|
1487
|
-
],
|
|
1488
|
-
hueStep: 8,
|
|
1489
|
-
background: "#1f1f1f"
|
|
1490
|
-
}
|
|
1491
|
-
};
|
|
1492
|
-
function rn(e, t, n) {
|
|
1493
|
-
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;
|
|
1494
|
-
return [
|
|
1495
|
-
4.0767416621 * o - 3.3077115913 * s + .2309699292 * c,
|
|
1496
|
-
-1.2684380046 * o + 2.6097574011 * s - .3413193965 * c,
|
|
1497
|
-
-.0041960863 * o - .7034186147 * s + 1.707614701 * c
|
|
1498
|
-
];
|
|
1499
|
-
}
|
|
1500
|
-
var an = (e) => `#${e.map((e) => {
|
|
1501
|
-
let t = Math.min(1, Math.max(0, e)), n = t <= .0031308 ? 12.92 * t : 1.055 * t ** (1 / 2.4) - .055;
|
|
1502
|
-
return Math.round(n * 255).toString(16).padStart(2, "0");
|
|
1503
|
-
}).join("")}`, on = (e, t, n) => an(rn(e, t, n));
|
|
1504
|
-
function sn(e) {
|
|
1505
|
-
let t = (t) => {
|
|
1506
|
-
let n = parseInt(e.slice(t, t + 2), 16) / 255;
|
|
1507
|
-
return n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4;
|
|
1508
|
-
}, [n, r, i] = [
|
|
1509
|
-
t(1),
|
|
1510
|
-
t(3),
|
|
1511
|
-
t(5)
|
|
1512
|
-
], 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);
|
|
1513
|
-
return [
|
|
1514
|
-
.2104542553 * a + .793617785 * o - .0040720468 * s,
|
|
1515
|
-
1.9779984951 * a - 2.428592205 * o + .4505937099 * s,
|
|
1516
|
-
.0259040371 * a + .7827717662 * o - .808675766 * s
|
|
1517
|
-
];
|
|
1518
|
-
}
|
|
1519
|
-
var cn = (e, t) => Math.hypot(e[0] - t[0], e[1] - t[1], e[2] - t[2]), ln = {};
|
|
1520
|
-
function un(e) {
|
|
1521
|
-
let t = ln[e];
|
|
1522
|
-
if (t) return t;
|
|
1523
|
-
let n = nn[e], r = [];
|
|
1524
|
-
for (let e of n.lightness) for (let t of n.chroma) for (let i = 0; i < 360; i += n.hueStep) {
|
|
1525
|
-
let n = rn(e, t, i);
|
|
1526
|
-
if (n.some((e) => e < -5e-4 || e > 1.0005)) continue;
|
|
1527
|
-
let a = an(n);
|
|
1528
|
-
r.push({
|
|
1529
|
-
hex: a,
|
|
1530
|
-
lab: sn(a)
|
|
1531
|
-
});
|
|
1532
|
-
}
|
|
1533
|
-
let i = Array.from({ length: 10 }, (t, n) => tn[e][n + 1]), a = [
|
|
1534
|
-
...i,
|
|
1535
|
-
tn[e].rest,
|
|
1536
|
-
n.background
|
|
1537
|
-
].map(sn), o = {
|
|
1538
|
-
colours: i,
|
|
1539
|
-
candidates: r,
|
|
1540
|
-
nearest: r.map((e) => Math.min(...a.map((t) => cn(t, e.lab))))
|
|
1541
|
-
};
|
|
1542
|
-
return ln[e] = o, o;
|
|
1543
|
-
}
|
|
1544
|
-
function dn(e) {
|
|
1545
|
-
let t = -1;
|
|
1546
|
-
for (let n = 0; n < e.candidates.length; n++) (t < 0 || e.nearest[n] > e.nearest[t]) && (t = n);
|
|
1547
|
-
if (t < 0 || e.nearest[t] <= 0) {
|
|
1548
|
-
e.colours.push(e.colours[10 + (e.colours.length - 10) % Math.max(1, e.candidates.length)] ?? e.colours[0]);
|
|
1549
|
-
return;
|
|
1550
|
-
}
|
|
1551
|
-
let n = e.candidates[t];
|
|
1552
|
-
e.colours.push(n.hex);
|
|
1553
|
-
for (let t = 0; t < e.candidates.length; t++) e.nearest[t] = Math.min(e.nearest[t], cn(n.lab, e.candidates[t].lab));
|
|
1554
|
-
}
|
|
1555
|
-
function fn(e, t) {
|
|
1556
|
-
let n = un(t);
|
|
1557
|
-
for (; n.colours.length <= e;) dn(n);
|
|
1558
|
-
return n.colours[e];
|
|
1559
|
-
}
|
|
1560
|
-
var pn = (e, t) => typeof e == "number" ? fn(e - 1, t) : tn[t][e];
|
|
1561
|
-
function mn(e) {
|
|
1562
|
-
return typeof e != "number" || e <= 10 ? `var(--chart-series-${e})` : `var(--chart-scheme-light, ${fn(e - 1, "light")}) var(--chart-scheme-dark, ${fn(e - 1, "dark")})`;
|
|
1563
|
-
}
|
|
1564
|
-
var hn = {
|
|
1565
|
-
bands: [{
|
|
1566
|
-
below: 20,
|
|
1567
|
-
color: "negative"
|
|
1568
|
-
}, {
|
|
1569
|
-
below: 80,
|
|
1570
|
-
color: "warning"
|
|
1571
|
-
}],
|
|
1572
|
-
above: "positive"
|
|
1573
|
-
}, gn = (e) => typeof e == "object" && !!e;
|
|
1574
|
-
function _n(e, t) {
|
|
1575
|
-
return gn(e) ? e.bands.find((e) => t < e.below)?.color ?? e.above : e;
|
|
1576
|
-
}
|
|
1577
|
-
var vn = (e) => typeof e == "string" && e.startsWith("#"), yn = (e) => vn(e) ? e : mn(e), z = (e, t) => vn(e) ? e : pn(e, t), bn = {
|
|
1578
|
-
light: [
|
|
1579
|
-
"#e8eff9",
|
|
1580
|
-
"#bcd3f2",
|
|
1581
|
-
"#7faee9",
|
|
1582
|
-
"#4081d2",
|
|
1583
|
-
"#155aa7"
|
|
1584
|
-
],
|
|
1585
|
-
dark: [
|
|
1586
|
-
"#242930",
|
|
1587
|
-
"#2c4462",
|
|
1588
|
-
"#39659b",
|
|
1589
|
-
"#4f8bd6",
|
|
1590
|
-
"#82baff"
|
|
1591
|
-
]
|
|
1592
|
-
}, xn = (e) => `var(--chart-heat-${Math.max(0, Math.min(bn.light.length - 1, e))})`, Sn = {
|
|
1593
|
-
dark: "#0f0f0f",
|
|
1594
|
-
light: "#ffffff"
|
|
1595
|
-
};
|
|
1596
|
-
function Cn(e) {
|
|
1597
|
-
let t = (t) => {
|
|
1598
|
-
let n = parseInt(e.slice(t, t + 2), 16) / 255;
|
|
1599
|
-
return n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4;
|
|
1600
|
-
};
|
|
1601
|
-
return .2126 * t(1) + .7152 * t(3) + .0722 * t(5);
|
|
1602
|
-
}
|
|
1603
|
-
function B(e) {
|
|
1604
|
-
let t = Cn(e);
|
|
1605
|
-
return (t + .05) / .05 > 1.05 / (t + .05) ? Sn.dark : Sn.light;
|
|
1606
|
-
}
|
|
1607
|
-
function wn(e) {
|
|
1608
|
-
return `var(--chart-scheme-light, ${B(z(e, "light"))}) var(--chart-scheme-dark, ${B(z(e, "dark"))})`;
|
|
1609
|
-
}
|
|
1610
|
-
//#endregion
|
|
1611
|
-
//#region ../../shared-web-ui/src/Charts/labels.ts
|
|
1612
|
-
var Tn = {
|
|
1613
|
-
legend: "Legend",
|
|
1614
|
-
total: "Total",
|
|
1615
|
-
empty: "No records",
|
|
1616
|
-
count: "Count",
|
|
1617
|
-
rest: "Rest",
|
|
1618
|
-
kinds: {
|
|
1619
|
-
donut: "Donut",
|
|
1620
|
-
pie: "Pie",
|
|
1621
|
-
bars: "Bars",
|
|
1622
|
-
stacked: "Stacked",
|
|
1623
|
-
treemap: "Treemap",
|
|
1624
|
-
columns: "Columns",
|
|
1625
|
-
line: "Line",
|
|
1626
|
-
area: "Area",
|
|
1627
|
-
grouped: "Grouped",
|
|
1628
|
-
calendar: "Calendar",
|
|
1629
|
-
bar: "Bar",
|
|
1630
|
-
gauge: "Gauge",
|
|
1631
|
-
ring: "Ring",
|
|
1632
|
-
funnel: "Funnel",
|
|
1633
|
-
number: "Number",
|
|
1634
|
-
numberTrend: "Trend"
|
|
1635
|
-
},
|
|
1636
|
-
chartChoice: "Chart",
|
|
1637
|
-
imageMenu: "Share or save the image",
|
|
1638
|
-
imageDownload: "Download",
|
|
1639
|
-
imageCopy: "Copy",
|
|
1640
|
-
imageShare: "Share",
|
|
1641
|
-
imageCopied: "Copied",
|
|
1642
|
-
imageFailed: "The image could not be made",
|
|
1643
|
-
vsPrevious: "vs the previous period",
|
|
1644
|
-
deltaUp: "up",
|
|
1645
|
-
deltaDown: "down",
|
|
1646
|
-
deltaSame: "no change",
|
|
1647
|
-
deltaNew: "new",
|
|
1648
|
-
ofTotal: (e, t) => `${e} of ${t}`,
|
|
1649
|
-
shareOf: (e, t) => `${e} of ${t}`,
|
|
1650
|
-
moreValues: (e) => `${e} more`,
|
|
1651
|
-
less: "Less",
|
|
1652
|
-
more: "More",
|
|
1653
|
-
busiest: "Busiest day",
|
|
1654
|
-
funnelOfFirst: "Of the first step",
|
|
1655
|
-
funnelDrop: "Drop from the step before"
|
|
1656
|
-
}, En = (e, t = !1) => `chart-root ${e}${t ? " chart-compact" : ""}`;
|
|
1657
|
-
function Dn({ title: e, children: t }) {
|
|
1658
|
-
return e == null || e === "" ? /* @__PURE__ */ _(g, { children: t }) : /* @__PURE__ */ v("figure", {
|
|
1659
|
-
className: En("chart-titled"),
|
|
1660
|
-
children: [/* @__PURE__ */ _("figcaption", {
|
|
1661
|
-
className: "chart-title",
|
|
1662
|
-
children: e
|
|
1663
|
-
}), t]
|
|
1664
|
-
});
|
|
1665
|
-
}
|
|
1666
|
-
function V(e) {
|
|
1667
|
-
return e > 0 && e < .1 ? "<0.1%" : e < 100 && e > 99.9 ? ">99.9%" : `${e.toFixed(1)}%`;
|
|
1668
|
-
}
|
|
1669
|
-
var On = (e) => e === 0 ? V(0) : `${e > 0 ? "−" : "+"}${V(Math.abs(e))}`;
|
|
1670
|
-
function kn({ locale: e = "en-IN", format: t, labels: n }) {
|
|
1671
|
-
return {
|
|
1672
|
-
nf: p(() => {
|
|
1673
|
-
if (t) return t;
|
|
1674
|
-
let n;
|
|
1675
|
-
try {
|
|
1676
|
-
n = new Intl.NumberFormat(e);
|
|
1677
|
-
} catch {
|
|
1678
|
-
n = new Intl.NumberFormat();
|
|
1679
|
-
}
|
|
1680
|
-
return (e) => n.format(e);
|
|
1681
|
-
}, [e, t]),
|
|
1682
|
-
L: p(() => ({
|
|
1683
|
-
...Tn,
|
|
1684
|
-
...n
|
|
1685
|
-
}), [n])
|
|
1686
|
-
};
|
|
1687
|
-
}
|
|
1688
|
-
function An({ ariaLabel: e, text: t, compact: n }) {
|
|
1689
|
-
return /* @__PURE__ */ _("div", {
|
|
1690
|
-
className: En("chart-empty", n),
|
|
1691
|
-
role: "img",
|
|
1692
|
-
"aria-label": `${e}: ${t}`,
|
|
1693
|
-
children: t
|
|
1694
|
-
});
|
|
1695
|
-
}
|
|
1696
|
-
function jn(e, t, n, r = {}) {
|
|
1697
|
-
if (n <= 0) return null;
|
|
1698
|
-
let i = {
|
|
1699
|
-
ArrowLeft: -1,
|
|
1700
|
-
ArrowRight: 1,
|
|
1701
|
-
ArrowUp: -1,
|
|
1702
|
-
ArrowDown: 1,
|
|
1703
|
-
...r
|
|
1704
|
-
};
|
|
1705
|
-
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]));
|
|
1706
|
-
}
|
|
1707
|
-
function Mn({ text: e }) {
|
|
1708
|
-
return /* @__PURE__ */ _("span", {
|
|
1709
|
-
className: "chart-sr-only",
|
|
1710
|
-
"aria-live": "polite",
|
|
1711
|
-
children: e
|
|
1712
|
-
});
|
|
1713
|
-
}
|
|
1714
|
-
//#endregion
|
|
1715
|
-
//#region ../../shared-web-ui/src/Charts/chartData.ts
|
|
1716
|
-
var Nn = (e) => (e?.length ?? 0) > 0;
|
|
1717
|
-
function Pn(e) {
|
|
1718
|
-
switch (e.type) {
|
|
1719
|
-
case "values": return Nn(e.series) ? ["bars"] : [
|
|
1720
|
-
"donut",
|
|
1721
|
-
"pie",
|
|
1722
|
-
"bars",
|
|
1723
|
-
"stacked",
|
|
1724
|
-
"treemap"
|
|
1725
|
-
];
|
|
1726
|
-
case "time": return [...e.period === "day" ? ["calendar"] : [], ...Nn(e.series) ? [
|
|
1727
|
-
"grouped",
|
|
1728
|
-
"stacked",
|
|
1729
|
-
"line",
|
|
1730
|
-
"area"
|
|
1731
|
-
] : [
|
|
1732
|
-
"columns",
|
|
1733
|
-
"line",
|
|
1734
|
-
"area"
|
|
1735
|
-
]];
|
|
1736
|
-
case "part": return [
|
|
1737
|
-
"bar",
|
|
1738
|
-
"gauge",
|
|
1739
|
-
"ring",
|
|
1740
|
-
"donut",
|
|
1741
|
-
"pie"
|
|
1742
|
-
];
|
|
1743
|
-
case "steps": return ["funnel", "bars"];
|
|
1744
|
-
case "number": return e.points?.length ? ["numberTrend", "number"] : ["number"];
|
|
1745
|
-
}
|
|
1746
|
-
}
|
|
1747
|
-
function Fn(e, t, n) {
|
|
1748
|
-
let r = Pn(e).filter((e) => !n || n.includes(e)), i = r.length ? r : Pn(e);
|
|
1749
|
-
return t && i.includes(t) ? t : i[0];
|
|
1750
|
-
}
|
|
1751
|
-
var In = (e) => [{
|
|
1752
|
-
key: "n",
|
|
1753
|
-
label: e,
|
|
1754
|
-
slot: 1
|
|
1755
|
-
}], Ln = (e, t) => ({
|
|
1756
|
-
...e.key === void 0 ? {} : { key: e.key },
|
|
1757
|
-
label: e.label,
|
|
1758
|
-
...e.fullLabel === void 0 ? {} : { fullLabel: e.fullLabel },
|
|
1759
|
-
values: t ? e.counts ?? {} : { n: e.count ?? 0 },
|
|
1760
|
-
...e.selectable === !1 ? { selectable: !1 } : {},
|
|
1761
|
-
...e.href ? { href: e.href } : {},
|
|
1762
|
-
...e.slot === void 0 ? {} : { slot: e.slot }
|
|
1763
|
-
}), Rn = (e, t) => e.slot ?? t + 1;
|
|
1764
|
-
function zn(e, t, n, r) {
|
|
1765
|
-
let i = Fn(e, t, r);
|
|
1766
|
-
switch (e.type) {
|
|
1767
|
-
case "values": {
|
|
1768
|
-
let t = Nn(e.series) ? e.series : In(n.count);
|
|
1769
|
-
if (i === "bars") return {
|
|
1770
|
-
kind: "bars",
|
|
1771
|
-
series: t,
|
|
1772
|
-
data: e.values.map((t) => Ln(t, Nn(e.series)))
|
|
1773
|
-
};
|
|
1774
|
-
if (i === "treemap") return {
|
|
1775
|
-
kind: "treemap",
|
|
1776
|
-
nodes: e.values.map((e, t) => ({
|
|
1777
|
-
key: e.key ?? e.label,
|
|
1778
|
-
label: e.label,
|
|
1779
|
-
value: e.count ?? 0,
|
|
1780
|
-
slot: Rn(e, t),
|
|
1781
|
-
...e.selectable === !1 ? { selectable: !1 } : {},
|
|
1782
|
-
...e.children ? { children: e.children.map((n) => ({
|
|
1783
|
-
key: n.key ?? n.label,
|
|
1784
|
-
label: n.label,
|
|
1785
|
-
value: n.count,
|
|
1786
|
-
slot: Rn(e, t)
|
|
1787
|
-
})) } : {}
|
|
1788
|
-
}))
|
|
1789
|
-
};
|
|
1790
|
-
let r = e.values.map((e, t) => ({
|
|
1791
|
-
key: e.key ?? e.label,
|
|
1792
|
-
label: e.label,
|
|
1793
|
-
value: e.count ?? 0,
|
|
1794
|
-
slot: Rn(e, t),
|
|
1795
|
-
...e.selectable === !1 ? { selectable: !1 } : {}
|
|
1796
|
-
}));
|
|
1797
|
-
return {
|
|
1798
|
-
kind: i === "stacked" ? "stacked" : i === "pie" ? "pie" : "donut",
|
|
1799
|
-
slices: r
|
|
1800
|
-
};
|
|
1801
|
-
}
|
|
1802
|
-
case "time": {
|
|
1803
|
-
if (i === "calendar") return {
|
|
1804
|
-
kind: "calendar",
|
|
1805
|
-
days: e.points.map((e) => ({
|
|
1806
|
-
day: e.key,
|
|
1807
|
-
count: e.count ?? Object.values(e.counts ?? {}).reduce((e, t) => e + t, 0)
|
|
1808
|
-
}))
|
|
1809
|
-
};
|
|
1810
|
-
let t = Nn(e.series), r = t ? e.series : In(n.count), a = e.points.map((e) => Ln(e, t));
|
|
1811
|
-
if (i === "line" || i === "area") return {
|
|
1812
|
-
kind: "line",
|
|
1813
|
-
area: i === "area",
|
|
1814
|
-
series: r,
|
|
1815
|
-
data: a
|
|
1816
|
-
};
|
|
1817
|
-
let o = t ? i === "grouped" ? "grouped" : "stacked" : void 0;
|
|
1818
|
-
return {
|
|
1819
|
-
kind: "columns",
|
|
1820
|
-
series: r,
|
|
1821
|
-
data: a,
|
|
1822
|
-
...o ? { mode: o } : {}
|
|
1823
|
-
};
|
|
1824
|
-
}
|
|
1825
|
-
case "part": {
|
|
1826
|
-
let t = {
|
|
1827
|
-
label: e.label,
|
|
1828
|
-
value: e.value,
|
|
1829
|
-
total: e.total,
|
|
1830
|
-
...e.color === void 0 ? {} : { color: e.color }
|
|
1831
|
-
};
|
|
1832
|
-
if (i === "gauge" || i === "ring") return {
|
|
1833
|
-
kind: "gauge",
|
|
1834
|
-
variant: i === "ring" ? "ring" : "half",
|
|
1835
|
-
rows: [t]
|
|
1836
|
-
};
|
|
1837
|
-
if (i === "donut" || i === "pie") {
|
|
1838
|
-
let t = e.total > 0 ? e.value / e.total * 100 : 0;
|
|
1839
|
-
return {
|
|
1840
|
-
kind: i,
|
|
1841
|
-
slices: [{
|
|
1842
|
-
key: "value",
|
|
1843
|
-
label: e.label,
|
|
1844
|
-
value: e.value,
|
|
1845
|
-
slot: _n(e.color ?? 1, t)
|
|
1846
|
-
}, {
|
|
1847
|
-
key: "rest",
|
|
1848
|
-
label: n.rest,
|
|
1849
|
-
value: Math.max(0, e.total - e.value),
|
|
1850
|
-
slot: "rest",
|
|
1851
|
-
selectable: !1
|
|
1852
|
-
}]
|
|
1853
|
-
};
|
|
1854
|
-
}
|
|
1855
|
-
return {
|
|
1856
|
-
kind: "progress",
|
|
1857
|
-
rows: [t]
|
|
1858
|
-
};
|
|
1859
|
-
}
|
|
1860
|
-
case "steps": return i === "bars" ? {
|
|
1861
|
-
kind: "bars",
|
|
1862
|
-
series: In(n.count),
|
|
1863
|
-
data: e.steps.map((e) => ({
|
|
1864
|
-
key: e.key,
|
|
1865
|
-
label: e.label,
|
|
1866
|
-
values: { n: e.count },
|
|
1867
|
-
...e.slot === void 0 ? {} : { slot: e.slot },
|
|
1868
|
-
...e.selectable === !1 ? { selectable: !1 } : {}
|
|
1869
|
-
}))
|
|
1870
|
-
} : {
|
|
1871
|
-
kind: "funnel",
|
|
1872
|
-
steps: e.steps.map((e) => ({
|
|
1873
|
-
key: e.key,
|
|
1874
|
-
label: e.label,
|
|
1875
|
-
value: e.count,
|
|
1876
|
-
slot: e.slot ?? 1,
|
|
1877
|
-
...e.selectable === !1 ? { selectable: !1 } : {}
|
|
1878
|
-
}))
|
|
1879
|
-
};
|
|
1880
|
-
case "number": return {
|
|
1881
|
-
kind: "number",
|
|
1882
|
-
value: e.value,
|
|
1883
|
-
...i === "numberTrend" && e.points ? {
|
|
1884
|
-
points: e.points,
|
|
1885
|
-
...e.previous === void 0 ? {} : { previous: e.previous },
|
|
1886
|
-
...e.good ? { good: e.good } : {}
|
|
1887
|
-
} : {}
|
|
1888
|
-
};
|
|
1889
|
-
}
|
|
1890
|
-
}
|
|
1891
|
-
//#endregion
|
|
1892
|
-
//#region ../../shared-web-ui/src/Charts/geometry.ts
|
|
1893
|
-
var Bn = (e) => e.key ?? e.label, Vn = (e, t) => t.reduce((t, n) => t + (e.values[n.key] ?? 0), 0), Hn = 2 * Math.PI * 40, Un = 1.2;
|
|
1894
|
-
function Wn(e) {
|
|
1895
|
-
let t = e.reduce((e, t) => e + t.value, 0);
|
|
1896
|
-
if (!t) return [];
|
|
1897
|
-
let n = e.filter((e) => e.value > 0).length > 1 ? Un : 0, r = 0, i = [];
|
|
1898
|
-
for (let a of e) {
|
|
1899
|
-
let e = a.value / t * Hn;
|
|
1900
|
-
a.value > 0 && i.push({
|
|
1901
|
-
slice: a,
|
|
1902
|
-
start: r,
|
|
1903
|
-
length: Math.max(.01, e - n)
|
|
1904
|
-
}), r += e;
|
|
1905
|
-
}
|
|
1906
|
-
return i;
|
|
1907
|
-
}
|
|
1908
|
-
var H = (e, t) => t ? e / t * 100 : 0;
|
|
1909
|
-
function Gn(e) {
|
|
1910
|
-
if (e <= 5) return 5;
|
|
1911
|
-
let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
|
|
1912
|
-
return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * t;
|
|
1913
|
-
}
|
|
1914
|
-
function Kn(e) {
|
|
1915
|
-
let t = Gn(Math.max(1, ...e));
|
|
1916
|
-
return {
|
|
1917
|
-
max: t,
|
|
1918
|
-
ticks: [
|
|
1919
|
-
0,
|
|
1920
|
-
t / 2,
|
|
1921
|
-
t
|
|
1922
|
-
]
|
|
1923
|
-
};
|
|
1924
|
-
}
|
|
1925
|
-
var qn = (e) => Math.max(1, ...e), Jn = (e, t) => t <= 12 || e % Math.ceil(t / 12) === 0, Yn = (e, t, n = "stacked") => n === "grouped" ? e.flatMap((e) => t.map((t) => e.values[t.key] ?? 0)) : e.map((e) => Vn(e, t));
|
|
1926
|
-
function Xn(e, t, n = 2) {
|
|
1927
|
-
if (e <= 0) return [];
|
|
1928
|
-
let r = Math.max(0, (t - n * (e - 1)) / e);
|
|
1929
|
-
return Array.from({ length: e }, (e, t) => ({
|
|
1930
|
-
x: t * (r + n),
|
|
1931
|
-
width: r
|
|
1932
|
-
}));
|
|
1933
|
-
}
|
|
1934
|
-
var Zn = (e, t, n) => t <= 1 ? n / 2 : e / (t - 1) * n;
|
|
1935
|
-
function Qn(e, t, n, r) {
|
|
1936
|
-
return e.map((i, a) => ({
|
|
1937
|
-
x: Zn(a, e.length, t),
|
|
1938
|
-
y: n - Math.max(0, i) / (r || 1) * n
|
|
1939
|
-
}));
|
|
1940
|
-
}
|
|
1941
|
-
var $n = (e) => Math.round(e * 100) / 100, er = (e) => e.map((e, t) => `${t ? "L" : "M"}${$n(e.x)} ${$n(e.y)}`).join(" ");
|
|
1942
|
-
function tr(e, t) {
|
|
1943
|
-
return e.length ? `${er(e)} L${$n(e[e.length - 1].x)} ${$n(t)} L${$n(e[0].x)} ${$n(t)} Z` : "";
|
|
1944
|
-
}
|
|
1945
|
-
function nr(e, t, n) {
|
|
1946
|
-
return n <= 1 || t <= 0 ? 0 : Math.max(0, Math.min(n - 1, Math.round(e / t * (n - 1))));
|
|
1947
|
-
}
|
|
1948
|
-
function rr(e, t = 6) {
|
|
1949
|
-
if (e <= 0) return [];
|
|
1950
|
-
if (e <= t) return Array.from({ length: e }, (e, t) => t);
|
|
1951
|
-
let n = (e - 1) / (t - 1);
|
|
1952
|
-
return Array.from(new Set(Array.from({ length: t }, (e, t) => Math.round(t * n))));
|
|
1953
|
-
}
|
|
1954
|
-
function ir(e, t, n) {
|
|
1955
|
-
if (!e.length) return [];
|
|
1956
|
-
let r = Math.min(...e), i = Math.max(...e);
|
|
1957
|
-
return e.map((a, o) => ({
|
|
1958
|
-
x: Zn(o, e.length, t),
|
|
1959
|
-
y: i === r ? n / 2 : n - (a - r) / (i - r) * n
|
|
1960
|
-
}));
|
|
1961
|
-
}
|
|
1962
|
-
function ar(e, t) {
|
|
1963
|
-
let n = e - t;
|
|
1964
|
-
return {
|
|
1965
|
-
direction: n > 0 ? "up" : n < 0 ? "down" : "same",
|
|
1966
|
-
diff: n,
|
|
1967
|
-
percent: t ? n / t * 100 : n ? null : 0
|
|
1968
|
-
};
|
|
1969
|
-
}
|
|
1970
|
-
function or(e, t) {
|
|
1971
|
-
return e === "same" || t === "none" ? "neutral" : e === t ? "positive" : "negative";
|
|
1972
|
-
}
|
|
1973
|
-
function U(e, t, n, r) {
|
|
1974
|
-
return {
|
|
1975
|
-
x: e + n * Math.sin(r),
|
|
1976
|
-
y: t - n * Math.cos(r)
|
|
1977
|
-
};
|
|
1978
|
-
}
|
|
1979
|
-
var W = (e) => Math.round(e * 1e4) / 1e4;
|
|
1980
|
-
function sr(e, t, n, r, i) {
|
|
1981
|
-
if (i - r >= 2 * Math.PI - 1e-9) {
|
|
1982
|
-
let i = U(e, t, n, r + Math.PI), a = U(e, t, n, r + 2 * Math.PI - 1e-4), o = U(e, t, n, r);
|
|
1983
|
-
return `M${W(o.x)} ${W(o.y)} A${n} ${n} 0 0 1 ${W(i.x)} ${W(i.y)} A${n} ${n} 0 0 1 ${W(a.x)} ${W(a.y)}`;
|
|
1984
|
-
}
|
|
1985
|
-
let a = U(e, t, n, r), o = U(e, t, n, i);
|
|
1986
|
-
return `M${W(a.x)} ${W(a.y)} A${n} ${n} 0 ${+(i - r > Math.PI)} 1 ${W(o.x)} ${W(o.y)}`;
|
|
1987
|
-
}
|
|
1988
|
-
function cr(e, t, n, r, i) {
|
|
1989
|
-
if (i - r >= 2 * Math.PI - 1e-9) return `M${W(e)} ${W(t - n)} A${n} ${n} 0 1 1 ${W(e)} ${W(t + n)} A${n} ${n} 0 1 1 ${W(e)} ${W(t - n)} Z`;
|
|
1990
|
-
let a = U(e, t, n, r), o = U(e, t, n, i);
|
|
1991
|
-
return `M${W(e)} ${W(t)} L${W(a.x)} ${W(a.y)} A${n} ${n} 0 ${+(i - r > Math.PI)} 1 ${W(o.x)} ${W(o.y)} Z`;
|
|
1992
|
-
}
|
|
1993
|
-
var lr = 864e5;
|
|
1994
|
-
function ur(e) {
|
|
1995
|
-
let [t, n, r] = e.split("-").map(Number);
|
|
1996
|
-
return Date.UTC(t, n - 1, r);
|
|
1997
|
-
}
|
|
1998
|
-
var dr = (e) => new Date(e).toISOString().slice(0, 10), fr = (e) => (new Date(ur(e)).getUTCDay() + 6) % 7;
|
|
1999
|
-
function pr(e, t) {
|
|
2000
|
-
let n = ur(e), r = Math.min(371, Math.max(0, Math.round((ur(t) - n) / lr) + 1));
|
|
2001
|
-
return Array.from({ length: r }, (e, t) => dr(n + t * lr));
|
|
2002
|
-
}
|
|
2003
|
-
var mr = 371;
|
|
2004
|
-
function hr(e, t) {
|
|
2005
|
-
return e <= 0 || t <= 0 ? 0 : Math.min(4, Math.max(1, Math.ceil(e / t * 4)));
|
|
2006
|
-
}
|
|
2007
|
-
function gr(e) {
|
|
2008
|
-
if (!e.length) return {
|
|
2009
|
-
cells: [],
|
|
2010
|
-
weeks: 0,
|
|
2011
|
-
months: [],
|
|
2012
|
-
max: 0,
|
|
2013
|
-
total: 0
|
|
2014
|
-
};
|
|
2015
|
-
let t = [...e].sort((e, t) => e.day.localeCompare(t.day)), n = new Map(t.map((e) => [e.day, e.count])), r = pr(t[0].day, t[t.length - 1].day), i = fr(r[0]), a = Math.max(0, ...r.map((e) => n.get(e) ?? 0)), o = r.map((e, t) => {
|
|
2016
|
-
let r = n.get(e) ?? 0;
|
|
2017
|
-
return {
|
|
2018
|
-
day: e,
|
|
2019
|
-
count: r,
|
|
2020
|
-
week: Math.floor((t + i) / 7),
|
|
2021
|
-
weekday: (t + i) % 7,
|
|
2022
|
-
level: hr(r, a)
|
|
2023
|
-
};
|
|
2024
|
-
}), s = o.filter((e) => e.day.endsWith("-01")).map((e) => ({
|
|
2025
|
-
month: e.day.slice(0, 7),
|
|
2026
|
-
week: e.week
|
|
2027
|
-
}));
|
|
2028
|
-
return !r[0].endsWith("-01") && (s[0]?.week ?? Infinity) >= 2 && s.unshift({
|
|
2029
|
-
month: r[0].slice(0, 7),
|
|
2030
|
-
week: 0
|
|
2031
|
-
}), {
|
|
2032
|
-
cells: o,
|
|
2033
|
-
weeks: o[o.length - 1].week + 1,
|
|
2034
|
-
months: s,
|
|
2035
|
-
max: a,
|
|
2036
|
-
total: o.reduce((e, t) => e + t.count, 0)
|
|
2037
|
-
};
|
|
2038
|
-
}
|
|
2039
|
-
var _r = {
|
|
2040
|
-
min: 4,
|
|
2041
|
-
max: 16,
|
|
2042
|
-
compactMax: 12
|
|
2043
|
-
}, vr = 8;
|
|
2044
|
-
function yr(e, t, n = _r.max) {
|
|
2045
|
-
if (!e || t <= 0) return {
|
|
2046
|
-
cell: n,
|
|
2047
|
-
gap: 2,
|
|
2048
|
-
weekdays: !0
|
|
2049
|
-
};
|
|
2050
|
-
let r = (e) => {
|
|
2051
|
-
let n = 2, r = Math.floor((e - n * (t - 1)) / t);
|
|
2052
|
-
return r < vr && (n = 1, r = Math.floor((e - n * (t - 1)) / t)), {
|
|
2053
|
-
cell: r,
|
|
2054
|
-
gap: n
|
|
2055
|
-
};
|
|
2056
|
-
}, i = r(e - 28);
|
|
2057
|
-
if (i.cell >= vr) return {
|
|
2058
|
-
cell: Math.min(n, i.cell),
|
|
2059
|
-
gap: i.gap,
|
|
2060
|
-
weekdays: !0
|
|
2061
|
-
};
|
|
2062
|
-
let a = r(e);
|
|
2063
|
-
return {
|
|
2064
|
-
cell: Math.max(_r.min, Math.min(n, a.cell)),
|
|
2065
|
-
gap: a.gap,
|
|
2066
|
-
weekdays: !1
|
|
2067
|
-
};
|
|
2068
|
-
}
|
|
2069
|
-
function br(e, t) {
|
|
2070
|
-
let n = [];
|
|
2071
|
-
for (let r of e) {
|
|
2072
|
-
let e = n[n.length - 1];
|
|
2073
|
-
(!e || (r.week - e.week) * t >= 26) && n.push(r);
|
|
2074
|
-
}
|
|
2075
|
-
return n;
|
|
2076
|
-
}
|
|
2077
|
-
function xr(e, t) {
|
|
2078
|
-
let n = e.map(() => ({
|
|
2079
|
-
x: t.x,
|
|
2080
|
-
y: t.y,
|
|
2081
|
-
w: 0,
|
|
2082
|
-
h: 0
|
|
2083
|
-
})), r = e.reduce((e, t) => e + Math.max(0, t), 0);
|
|
2084
|
-
if (r <= 0 || t.w <= 0 || t.h <= 0) return n;
|
|
2085
|
-
let i = t.w * t.h / r, a = e.map((e, t) => ({
|
|
2086
|
-
i: t,
|
|
2087
|
-
a: Math.max(0, e) * i
|
|
2088
|
-
})).filter((e) => e.a > 0), o = { ...t }, s = (e, t) => {
|
|
2089
|
-
let n = e.reduce((e, t) => e + t, 0), r = Math.max(...e), i = Math.min(...e);
|
|
2090
|
-
return Math.max(t * t * r / (n * n), n * n / (t * t * i));
|
|
2091
|
-
}, c = (e) => {
|
|
2092
|
-
let t = e.reduce((e, t) => e + t.a, 0);
|
|
2093
|
-
if (o.w >= o.h) {
|
|
2094
|
-
let r = t / o.h, i = o.y;
|
|
2095
|
-
for (let t of e) {
|
|
2096
|
-
let e = t.a / r;
|
|
2097
|
-
n[t.i] = {
|
|
2098
|
-
x: o.x,
|
|
2099
|
-
y: i,
|
|
2100
|
-
w: r,
|
|
2101
|
-
h: e
|
|
2102
|
-
}, i += e;
|
|
2103
|
-
}
|
|
2104
|
-
o = {
|
|
2105
|
-
x: o.x + r,
|
|
2106
|
-
y: o.y,
|
|
2107
|
-
w: o.w - r,
|
|
2108
|
-
h: o.h
|
|
2109
|
-
};
|
|
2110
|
-
} else {
|
|
2111
|
-
let r = t / o.w, i = o.x;
|
|
2112
|
-
for (let t of e) {
|
|
2113
|
-
let e = t.a / r;
|
|
2114
|
-
n[t.i] = {
|
|
2115
|
-
x: i,
|
|
2116
|
-
y: o.y,
|
|
2117
|
-
w: e,
|
|
2118
|
-
h: r
|
|
2119
|
-
}, i += e;
|
|
2120
|
-
}
|
|
2121
|
-
o = {
|
|
2122
|
-
x: o.x,
|
|
2123
|
-
y: o.y + r,
|
|
2124
|
-
w: o.w,
|
|
2125
|
-
h: o.h - r
|
|
2126
|
-
};
|
|
2127
|
-
}
|
|
2128
|
-
}, l = [];
|
|
2129
|
-
for (let e of a) {
|
|
2130
|
-
let t = Math.min(o.w, o.h);
|
|
2131
|
-
!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]);
|
|
2132
|
-
}
|
|
2133
|
-
return l.length && c(l), n;
|
|
2134
|
-
}
|
|
2135
|
-
var Sr = {
|
|
2136
|
-
w: 44,
|
|
2137
|
-
h: 28
|
|
2138
|
-
}, Cr = (e, t = Sr) => e.w >= t.w && e.h >= t.h;
|
|
2139
|
-
function wr(e, t, n) {
|
|
2140
|
-
let r = [], i = xr(e.map((e) => e.value), {
|
|
2141
|
-
x: 0,
|
|
2142
|
-
y: 0,
|
|
2143
|
-
w: t,
|
|
2144
|
-
h: n
|
|
2145
|
-
});
|
|
2146
|
-
return e.forEach((e, t) => {
|
|
2147
|
-
let n = i[t];
|
|
2148
|
-
if (n.w <= 0 || n.h <= 0) return;
|
|
2149
|
-
let a = (e.children ?? []).filter((e) => e.value > 0);
|
|
2150
|
-
if (!a.length) {
|
|
2151
|
-
r.push({
|
|
2152
|
-
node: e,
|
|
2153
|
-
parent: null,
|
|
2154
|
-
rect: n,
|
|
2155
|
-
label: Cr(n)
|
|
2156
|
-
});
|
|
2157
|
-
return;
|
|
2158
|
-
}
|
|
2159
|
-
let o = n.h >= 16 + Sr.h && n.w >= Sr.w ? 16 : 0;
|
|
2160
|
-
r.push({
|
|
2161
|
-
node: e,
|
|
2162
|
-
parent: null,
|
|
2163
|
-
rect: n,
|
|
2164
|
-
label: o > 0
|
|
2165
|
-
});
|
|
2166
|
-
let s = {
|
|
2167
|
-
x: n.x + 2,
|
|
2168
|
-
y: n.y + o + 2,
|
|
2169
|
-
w: Math.max(0, n.w - 4),
|
|
2170
|
-
h: Math.max(0, n.h - o - 4)
|
|
2171
|
-
};
|
|
2172
|
-
xr(a.map((e) => e.value), s).forEach((t, n) => {
|
|
2173
|
-
t.w > 0 && t.h > 0 && r.push({
|
|
2174
|
-
node: a[n],
|
|
2175
|
-
parent: e,
|
|
2176
|
-
rect: t,
|
|
2177
|
-
label: Cr(t)
|
|
2178
|
-
});
|
|
2179
|
-
});
|
|
2180
|
-
}), r;
|
|
2181
|
-
}
|
|
2182
|
-
var Tr = (e) => Math.max(.55, 1 - e * .09);
|
|
2183
|
-
function Er(e) {
|
|
2184
|
-
let t = Math.max(0, ...e.map((e) => e.value)), n = e[0]?.value ?? 0;
|
|
2185
|
-
return e.map((r, i) => {
|
|
2186
|
-
let a = i > 0 ? e[i - 1].value : 0;
|
|
2187
|
-
return {
|
|
2188
|
-
step: r,
|
|
2189
|
-
width: t > 0 ? Math.max(0, r.value) / t : 0,
|
|
2190
|
-
ofFirst: H(r.value, n),
|
|
2191
|
-
drop: i > 0 && a > 0 ? (a - r.value) / a * 100 : null
|
|
2192
|
-
};
|
|
2193
|
-
});
|
|
2194
|
-
}
|
|
2195
|
-
var Dr = {
|
|
2196
|
-
half: {
|
|
2197
|
-
width: 120,
|
|
2198
|
-
height: 68,
|
|
2199
|
-
cx: 60,
|
|
2200
|
-
cy: 62,
|
|
2201
|
-
r: 50,
|
|
2202
|
-
from: -Math.PI / 2,
|
|
2203
|
-
to: Math.PI / 2
|
|
2204
|
-
},
|
|
2205
|
-
ring: {
|
|
2206
|
-
width: 100,
|
|
2207
|
-
height: 100,
|
|
2208
|
-
cx: 50,
|
|
2209
|
-
cy: 50,
|
|
2210
|
-
r: 40,
|
|
2211
|
-
from: 0,
|
|
2212
|
-
to: 2 * Math.PI
|
|
2213
|
-
}
|
|
2214
|
-
};
|
|
2215
|
-
function Or(e, t) {
|
|
2216
|
-
let n = Dr[e], r = Math.max(0, Math.min(100, t)) / 100;
|
|
2217
|
-
return {
|
|
2218
|
-
a0: n.from,
|
|
2219
|
-
a1: n.to,
|
|
2220
|
-
end: n.from + (n.to - n.from) * r
|
|
2221
|
-
};
|
|
2222
|
-
}
|
|
2223
|
-
var kr = .62, Ar = 8;
|
|
2224
|
-
function jr(e, t = 48, n = 50) {
|
|
2225
|
-
let r = e.reduce((e, t) => e + t.value, 0);
|
|
2226
|
-
if (!r) return [];
|
|
2227
|
-
let i = 0, a = [];
|
|
2228
|
-
for (let o of e) {
|
|
2229
|
-
if (o.value <= 0) continue;
|
|
2230
|
-
let e = H(o.value, r), s = i + o.value / r * 2 * Math.PI, c = e < 8 ? null : e >= 100 ? {
|
|
2231
|
-
x: n,
|
|
2232
|
-
y: n
|
|
2233
|
-
} : U(n, n, t * kr, (i + s) / 2);
|
|
2234
|
-
a.push({
|
|
2235
|
-
slice: o,
|
|
2236
|
-
a0: i,
|
|
2237
|
-
a1: s,
|
|
2238
|
-
share: e,
|
|
2239
|
-
label: c
|
|
2240
|
-
}), i = s;
|
|
2241
|
-
}
|
|
2242
|
-
return a;
|
|
2243
|
-
}
|
|
2244
|
-
//#endregion
|
|
2245
|
-
//#region ../../shared-web-ui/src/Charts/menuPlacement.ts
|
|
2246
|
-
function Mr(e, t, n, { align: r = "end", offset: i = 4, margin: a = 8 } = {}) {
|
|
2247
|
-
let o = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), s = e.top + e.height, c = n.height - a - (s + i), l = e.top - i - a, u = t.height <= c || c >= l ? "below" : "above", d = u === "below" ? s + i : e.top - i - t.height;
|
|
2248
|
-
return {
|
|
2249
|
-
left: o(r === "end" ? e.left + e.width - t.width : e.left, a, n.width - t.width - a),
|
|
2250
|
-
top: o(d, a, n.height - t.height - a),
|
|
2251
|
-
side: u
|
|
2252
|
-
};
|
|
2253
|
-
}
|
|
2254
|
-
function Nr(e, t, n) {
|
|
2255
|
-
return {
|
|
2256
|
-
x: e.left - t,
|
|
2257
|
-
y: e.top - n
|
|
2258
|
-
};
|
|
2259
|
-
}
|
|
2260
|
-
//#endregion
|
|
2261
|
-
//#region ../../shared-web-ui/src/Charts/AnchoredMenu.tsx
|
|
2262
|
-
var Pr = () => ({
|
|
2263
|
-
width: document.documentElement.clientWidth || window.innerWidth,
|
|
2264
|
-
height: document.documentElement.clientHeight || window.innerHeight
|
|
2265
|
-
});
|
|
2266
|
-
function Fr({ trigger: e, items: t, onSelect: n, align: r = "end", "aria-label": a }) {
|
|
2267
|
-
let o = be(), s = m(null), l = m(null), d = m([]), [p, ee] = h(!1), [b, x] = h(-1), S = c((e) => {
|
|
2268
|
-
ee(!1), x(-1), e && s.current?.querySelector("button")?.focus({ preventScroll: !0 });
|
|
2269
|
-
}, []), C = c(() => {
|
|
2270
|
-
let e = s.current, t = l.current;
|
|
2271
|
-
if (!e || !t) return;
|
|
2272
|
-
let n = Nr(t.getBoundingClientRect(), parseFloat(t.style.left) || 0, parseFloat(t.style.top) || 0), i = Mr(e.getBoundingClientRect(), {
|
|
2273
|
-
width: t.offsetWidth,
|
|
2274
|
-
height: t.offsetHeight
|
|
2275
|
-
}, Pr(), { align: r });
|
|
2276
|
-
t.style.left = `${Math.round(i.left - n.x)}px`, t.style.top = `${Math.round(i.top - n.y)}px`, t.style.visibility = "visible", t.dataset.side = i.side;
|
|
2277
|
-
}, [r]);
|
|
2278
|
-
f(() => {
|
|
2279
|
-
p && C();
|
|
2280
|
-
}, [
|
|
2281
|
-
p,
|
|
2282
|
-
C,
|
|
2283
|
-
t.length
|
|
2284
|
-
]), u(() => {
|
|
2285
|
-
if (!p) return;
|
|
2286
|
-
let e = 0, t = () => {
|
|
2287
|
-
cancelAnimationFrame(e), e = requestAnimationFrame(C);
|
|
2288
|
-
}, n = (e) => {
|
|
2289
|
-
let t = e.target;
|
|
2290
|
-
!l.current?.contains(t) && !s.current?.contains(t) && S(!1);
|
|
2291
|
-
};
|
|
2292
|
-
return window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), document.addEventListener("pointerdown", n, !0), () => {
|
|
2293
|
-
cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t), document.removeEventListener("pointerdown", n, !0);
|
|
2294
|
-
};
|
|
2295
|
-
}, [
|
|
2296
|
-
p,
|
|
2297
|
-
C,
|
|
2298
|
-
S
|
|
2299
|
-
]), u(() => {
|
|
2300
|
-
p && b >= 0 && d.current[b]?.focus({ preventScroll: !0 });
|
|
2301
|
-
}, [p, b]);
|
|
2302
|
-
let w = (e) => {
|
|
2303
|
-
ee(!0), x(e && t.length ? 0 : -1);
|
|
2304
|
-
}, T = (e) => x((n) => n < 0 ? e > 0 ? 0 : t.length - 1 : (n + e + t.length) % t.length);
|
|
2305
|
-
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
2306
|
-
ref: s,
|
|
2307
|
-
className: "chart-menu-anchor",
|
|
2308
|
-
children: i(e, {
|
|
2309
|
-
"aria-haspopup": "menu",
|
|
2310
|
-
"aria-expanded": p,
|
|
2311
|
-
onClick: (t) => {
|
|
2312
|
-
e.props.onClick?.(t), p ? S(!1) : w(!1);
|
|
2313
|
-
},
|
|
2314
|
-
onKeyDown: (t) => {
|
|
2315
|
-
e.props.onKeyDown?.(t), !p && (t.key === "ArrowDown" || t.key === "Enter" || t.key === " ") && (t.preventDefault(), w(!0));
|
|
2316
|
-
}
|
|
2317
|
-
})
|
|
2318
|
-
}), p && o && y(/* @__PURE__ */ _("div", {
|
|
2319
|
-
ref: l,
|
|
2320
|
-
className: "chart-menu",
|
|
2321
|
-
role: "menu",
|
|
2322
|
-
"aria-label": a,
|
|
2323
|
-
tabIndex: -1,
|
|
2324
|
-
style: {
|
|
2325
|
-
left: 0,
|
|
2326
|
-
top: 0,
|
|
2327
|
-
visibility: "hidden"
|
|
2328
|
-
},
|
|
2329
|
-
onKeyDown: (e) => {
|
|
2330
|
-
switch (e.key) {
|
|
2331
|
-
case "ArrowDown":
|
|
2332
|
-
e.preventDefault(), T(1);
|
|
2333
|
-
break;
|
|
2334
|
-
case "ArrowUp":
|
|
2335
|
-
e.preventDefault(), T(-1);
|
|
2336
|
-
break;
|
|
2337
|
-
case "Home":
|
|
2338
|
-
e.preventDefault(), x(0);
|
|
2339
|
-
break;
|
|
2340
|
-
case "End":
|
|
2341
|
-
e.preventDefault(), x(t.length - 1);
|
|
2342
|
-
break;
|
|
2343
|
-
case "Escape":
|
|
2344
|
-
e.preventDefault(), e.stopPropagation(), S(!0);
|
|
2345
|
-
break;
|
|
2346
|
-
case "Tab":
|
|
2347
|
-
S(!1);
|
|
2348
|
-
break;
|
|
2349
|
-
}
|
|
2350
|
-
},
|
|
2351
|
-
children: t.map((e, t) => /* @__PURE__ */ v("button", {
|
|
2352
|
-
ref: (e) => {
|
|
2353
|
-
d.current[t] = e;
|
|
2354
|
-
},
|
|
2355
|
-
type: "button",
|
|
2356
|
-
role: "menuitem",
|
|
2357
|
-
tabIndex: b === t ? 0 : -1,
|
|
2358
|
-
className: `chart-menu-item${b === t ? " chart-menu-item--cursor" : ""}`,
|
|
2359
|
-
onMouseEnter: () => x(t),
|
|
2360
|
-
onClick: () => {
|
|
2361
|
-
S(!0), n(e.value);
|
|
2362
|
-
},
|
|
2363
|
-
children: [e.icon && /* @__PURE__ */ _("span", {
|
|
2364
|
-
className: "chart-menu-item-icon",
|
|
2365
|
-
"aria-hidden": !0,
|
|
2366
|
-
children: e.icon
|
|
2367
|
-
}), e.label]
|
|
2368
|
-
}, e.value))
|
|
2369
|
-
}), o)] });
|
|
2370
|
-
}
|
|
2371
|
-
//#endregion
|
|
2372
|
-
//#region ../../shared-web-ui/src/Charts/chartImage.ts
|
|
2373
|
-
var G = {
|
|
2374
|
-
background: "#ffffff",
|
|
2375
|
-
text: "#0f0f0f",
|
|
2376
|
-
muted: "#616161",
|
|
2377
|
-
faint: "#737373",
|
|
2378
|
-
line: "#e6e6e6",
|
|
2379
|
-
track: "#ebebeb",
|
|
2380
|
-
slots: tn.light,
|
|
2381
|
-
heat: bn.light
|
|
2382
|
-
}, K = 28, q = 16, Ir = 22, Lr = 14, Rr = 12, J = 20, Y = 28, X = 220, Z = 220, zr = 44, Br = 80, Vr = 300, Hr = 36, Ur = 3, Wr = 10, Gr = 50, Q = 720 - 2 * K, Kr = (e) => ({
|
|
2383
|
-
title: `700 ${Ir}px ${e}`,
|
|
2384
|
-
report: `600 ${Lr}px ${e}`,
|
|
2385
|
-
big: `700 ${zr}px ${e}`,
|
|
2386
|
-
bold: `700 ${Lr}px ${e}`,
|
|
2387
|
-
text: `400 ${Lr}px ${e}`,
|
|
2388
|
-
small: `400 ${Rr}px ${e}`
|
|
2389
|
-
});
|
|
2390
|
-
function qr(e) {
|
|
2391
|
-
if (e.format) return e.format;
|
|
2392
|
-
let t;
|
|
2393
|
-
try {
|
|
2394
|
-
t = new Intl.NumberFormat(e.locale ?? "en-IN");
|
|
2395
|
-
} catch {
|
|
2396
|
-
t = new Intl.NumberFormat();
|
|
2397
|
-
}
|
|
2398
|
-
return (e) => t.format(e);
|
|
2399
|
-
}
|
|
2400
|
-
function Jr(e, t) {
|
|
2401
|
-
try {
|
|
2402
|
-
return new Intl.DateTimeFormat(t ?? "en-IN", {
|
|
2403
|
-
dateStyle: "medium",
|
|
2404
|
-
timeStyle: "short"
|
|
2405
|
-
}).format(e);
|
|
2406
|
-
} catch {
|
|
2407
|
-
return e.toLocaleString();
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
var Yr = (e, t) => {
|
|
2411
|
-
let n = e.reduce((e, t) => e + t.value, 0);
|
|
2412
|
-
return e.map((e) => ({
|
|
2413
|
-
slot: e.slot,
|
|
2414
|
-
label: e.label,
|
|
2415
|
-
value: `${t(e.value)} · ${V(H(e.value, n))}`
|
|
2416
|
-
}));
|
|
2417
|
-
};
|
|
2418
|
-
function Xr(e) {
|
|
2419
|
-
switch (e.kind) {
|
|
2420
|
-
case "donut":
|
|
2421
|
-
case "pie": return Math.max(X, e.slices.length * Y);
|
|
2422
|
-
case "stacked": return 48 + Math.ceil(e.slices.length / 2) * Y;
|
|
2423
|
-
case "bars": return (e.series.length > 1 ? Y : 0) + Math.max(1, e.data.length) * Y;
|
|
2424
|
-
case "columns": return (e.series.length > 1 ? 44 + Math.ceil(e.series.length / 2) * Y : 0) + Z + J + 8;
|
|
2425
|
-
case "line": return 264 + Math.ceil(e.series.length / 2) * Y;
|
|
2426
|
-
case "progress": return Math.max(1, e.rows.length) * Gr;
|
|
2427
|
-
case "number": return zr + ((e.points?.length ?? 0) > 1 ? 116 : 0) + (e.previous === void 0 ? 0 : 24);
|
|
2428
|
-
case "gauge": return ei(e.rows.length, e.variant ?? "half").height + 8 + 2 * J;
|
|
2429
|
-
case "funnel": return Math.max(1, e.steps.length) * Hr;
|
|
2430
|
-
case "treemap": return 316 + Math.ceil(e.nodes.length / 2) * Y;
|
|
2431
|
-
case "calendar": {
|
|
2432
|
-
let { cell: t } = $r(gr(e.days).weeks);
|
|
2433
|
-
return J + 7 * (t + Zr) + q + Y;
|
|
2434
|
-
}
|
|
2435
|
-
}
|
|
2436
|
-
}
|
|
2437
|
-
var Zr = 3, Qr = 56;
|
|
2438
|
-
function $r(e) {
|
|
2439
|
-
return { cell: Math.max(4, Math.min(16, (Q - Qr) / Math.max(1, e) - Zr)) };
|
|
2440
|
-
}
|
|
2441
|
-
function ei(e, t) {
|
|
2442
|
-
let n = Q / Math.max(1, e), r = Dr[t], i = Math.min(t === "half" ? 260 : 200, n - 24);
|
|
2443
|
-
return {
|
|
2444
|
-
cell: n,
|
|
2445
|
-
width: i,
|
|
2446
|
-
height: i * r.height / r.width,
|
|
2447
|
-
k: i / r.width
|
|
2448
|
-
};
|
|
2449
|
-
}
|
|
2450
|
-
function $(e, t, n) {
|
|
2451
|
-
if (e.measureText(t).width <= n) return t;
|
|
2452
|
-
let r = 0, i = t.length;
|
|
2453
|
-
for (; r < i;) {
|
|
2454
|
-
let a = Math.ceil((r + i) / 2);
|
|
2455
|
-
e.measureText(`${t.slice(0, a)}…`).width <= n ? r = a : i = a - 1;
|
|
2456
|
-
}
|
|
2457
|
-
return `${t.slice(0, r)}…`;
|
|
2458
|
-
}
|
|
2459
|
-
function ti(e, t, n, r = Ur) {
|
|
2460
|
-
if (r <= 1 || e.measureText(t).width <= n) return [$(e, t, n)];
|
|
2461
|
-
let i = t.split(" "), a = "", o = 0;
|
|
2462
|
-
for (; o < i.length; o++) {
|
|
2463
|
-
let t = a ? `${a} ${i[o]}` : i[o];
|
|
2464
|
-
if (e.measureText(t).width > n) break;
|
|
2465
|
-
a = t;
|
|
2466
|
-
}
|
|
2467
|
-
return a ? [a, ...ti(e, i.slice(o).join(" "), n, r - 1)] : [$(e, t, n)];
|
|
2468
|
-
}
|
|
2469
|
-
function ni(e, t, n, r) {
|
|
2470
|
-
e.fillStyle = z(r, "light"), e.fillRect(t, n - 6, 12, 12);
|
|
2471
|
-
}
|
|
2472
|
-
function ri(e, t, n, r, i, a, o) {
|
|
2473
|
-
let s = (a - (o - 1) * q) / o;
|
|
2474
|
-
t.forEach((t, a) => {
|
|
2475
|
-
let c = r + a % o * (s + q), l = i + Math.floor(a / o) * Y + Y / 2;
|
|
2476
|
-
ni(e, c, l, t.slot), e.font = n.bold, e.textAlign = "right", e.fillStyle = G.text, e.fillText(t.value, c + s, l);
|
|
2477
|
-
let u = e.measureText(t.value).width;
|
|
2478
|
-
e.font = n.text, e.textAlign = "left", e.fillText($(e, t.label, s - 20 - u - 10), c + 20, l);
|
|
2479
|
-
});
|
|
2480
|
-
}
|
|
2481
|
-
function ii(e, t, n, r, i, a) {
|
|
2482
|
-
let o = X / 100, s = n + X / 2, c = 40 * o;
|
|
2483
|
-
e.lineWidth = 16 * o, e.lineCap = "butt";
|
|
2484
|
-
let l = (e) => -Math.PI / 2 + e / Hn * 2 * Math.PI, u = Wn(t);
|
|
2485
|
-
u.length || (e.globalAlpha = .5, e.strokeStyle = G.slots.rest, e.beginPath(), e.arc(138, s, c, 0, 2 * Math.PI), e.stroke(), e.globalAlpha = 1);
|
|
2486
|
-
for (let t of u) e.strokeStyle = z(t.slice.slot, "light"), e.beginPath(), e.arc(138, s, c, l(t.start), l(t.start + t.length)), e.stroke();
|
|
2487
|
-
let d = t.reduce((e, t) => e + t.value, 0), f = t[0];
|
|
2488
|
-
e.textAlign = "center", d > 0 && f ? (e.font = a.title, e.fillStyle = G.text, e.fillText(V(H(f.value, d)), 138, s - 6), e.font = a.small, e.fillStyle = G.muted, e.fillText($(e, f.label.toLowerCase(), c * 1.3), 138, s + 16)) : (e.font = a.small, e.fillStyle = G.muted, e.fillText(i.empty, 138, s));
|
|
2489
|
-
let p = Yr(t, r);
|
|
2490
|
-
ri(e, p, a, 276, n + Math.max(0, (X - p.length * Y) / 2), 720 - K - 276, 1);
|
|
2491
|
-
}
|
|
2492
|
-
var ai = (e) => e - Math.PI / 2;
|
|
2493
|
-
function oi(e, t, n, r, i, a) {
|
|
2494
|
-
let o = X / 100, s = n + X / 2, c = jr(t);
|
|
2495
|
-
c.length || (e.globalAlpha = .5, e.fillStyle = G.slots.rest, e.beginPath(), e.arc(138, s, 48 * o, 0, 2 * Math.PI), e.fill(), e.globalAlpha = 1, e.font = a.small, e.textAlign = "center", e.fillStyle = G.text, e.fillText(i.empty, 138, s)), e.lineWidth = 2, e.lineJoin = "round";
|
|
2496
|
-
for (let t of c) e.fillStyle = z(t.slice.slot, "light"), e.strokeStyle = G.background, e.beginPath(), c.length > 1 && e.moveTo(138, s), e.arc(138, s, 48 * o, ai(t.a0), ai(t.a1)), e.closePath(), e.fill(), c.length > 1 && e.stroke();
|
|
2497
|
-
e.font = a.bold, e.textAlign = "center";
|
|
2498
|
-
for (let t of c) t.label && (e.fillStyle = B(z(t.slice.slot, "light")), e.fillText(V(t.share), K + t.label.x * o, n + t.label.y * o));
|
|
2499
|
-
let l = Yr(t, r);
|
|
2500
|
-
ri(e, l, a, 276, n + Math.max(0, (X - l.length * Y) / 2), 720 - K - 276, 1);
|
|
2501
|
-
}
|
|
2502
|
-
function si(e, t, n, r, i) {
|
|
2503
|
-
let a = t.reduce((e, t) => e + t.value, 0), o = t.filter((e) => e.value > 0), s = Math.max(0, o.length - 1) * 2, c = K;
|
|
2504
|
-
e.fillStyle = G.track, a || e.fillRect(K, n, Q, 32);
|
|
2505
|
-
for (let t of o) {
|
|
2506
|
-
let r = (Q - s) * t.value / a;
|
|
2507
|
-
e.fillStyle = z(t.slot, "light"), e.fillRect(c, n, r, 32), c += r + 2;
|
|
2508
|
-
}
|
|
2509
|
-
ri(e, Yr(t, r), i, K, n + 32 + q, Q, 2);
|
|
2510
|
-
}
|
|
2511
|
-
function ci(e, t, n, r) {
|
|
2512
|
-
let i = K;
|
|
2513
|
-
e.font = r.text, e.textAlign = "left";
|
|
2514
|
-
for (let r of t) ni(e, i, n, r.slot), e.fillStyle = G.text, e.fillText(r.label, i + 18, n), i += 18 + e.measureText(r.label).width + 24;
|
|
2515
|
-
}
|
|
2516
|
-
function li(e, t, n, r, i, a, o) {
|
|
2517
|
-
let s = r;
|
|
2518
|
-
n.length > 1 && (ci(e, n, s + Y / 2, o), s += Y);
|
|
2519
|
-
let c = t.map((e) => Vn(e, n)), l = c.reduce((e, t) => e + t, 0);
|
|
2520
|
-
if (!l) {
|
|
2521
|
-
e.font = o.text, e.fillStyle = G.muted, e.textAlign = "left", e.fillText(a.empty, K, s + Y / 2);
|
|
2522
|
-
return;
|
|
2523
|
-
}
|
|
2524
|
-
let u = qn(c), d = Math.min(200, Q * .3), f = 239.2, p = Q - d - 12 - 130 - 12;
|
|
2525
|
-
t.forEach((t, r) => {
|
|
2526
|
-
let a = s + r * Y + Y / 2;
|
|
2527
|
-
e.font = o.text, e.textAlign = "left", e.fillStyle = G.text, e.fillText($(e, t.fullLabel ?? t.label, d), K, a), e.fillStyle = G.track, e.fillRect(f, a - 7, p, 14);
|
|
2528
|
-
let m = f;
|
|
2529
|
-
for (let r of n) {
|
|
2530
|
-
let i = t.values[r.key] ?? 0;
|
|
2531
|
-
if (!i) continue;
|
|
2532
|
-
let o = i / u * p;
|
|
2533
|
-
e.fillStyle = z(n.length === 1 && t.slot ? t.slot : r.slot, "light"), e.fillRect(m, a - 7, o, 14), m += o;
|
|
2534
|
-
}
|
|
2535
|
-
e.font = o.bold, e.textAlign = "right", e.fillStyle = G.text, e.fillText(n.length === 1 ? `${i(c[r])} · ${V(H(c[r], l))}` : i(c[r]), 720 - K, a);
|
|
2536
|
-
});
|
|
2537
|
-
}
|
|
2538
|
-
function ui(e, t, n, r, i, a) {
|
|
2539
|
-
let o = Q - 56, s = r + Z;
|
|
2540
|
-
e.font = a.small, e.textAlign = "right", e.lineWidth = 1;
|
|
2541
|
-
for (let r of t) {
|
|
2542
|
-
let t = s - r / n * (Z - 16);
|
|
2543
|
-
e.fillStyle = G.faint, e.fillText(i(r), 76, t), e.strokeStyle = G.line, e.setLineDash(r === 0 ? [] : [4, 4]), e.beginPath(), e.moveTo(84, t), e.lineTo(692, t), e.stroke();
|
|
2544
|
-
}
|
|
2545
|
-
return e.setLineDash([]), {
|
|
2546
|
-
plotX: 84,
|
|
2547
|
-
plotW: o,
|
|
2548
|
-
bottom: s,
|
|
2549
|
-
plotH: Z - 16
|
|
2550
|
-
};
|
|
2551
|
-
}
|
|
2552
|
-
function di(e, t, n, r, i, a, o, s) {
|
|
2553
|
-
let c = t.flatMap((e) => n.map((t) => e.values[t.key] ?? 0)), { max: l, ticks: u } = Kn(c), { plotX: d, plotW: f, bottom: p, plotH: m } = ui(e, u, l, i, a, s);
|
|
2554
|
-
if (!c.some((e) => e > 0)) e.textAlign = "center", e.fillStyle = G.muted, e.fillText(o.empty, d + f / 2, i + Z / 2);
|
|
2555
|
-
else {
|
|
2556
|
-
e.lineWidth = 2, e.lineJoin = "round";
|
|
2557
|
-
for (let i of n) {
|
|
2558
|
-
let n = Qn(t.map((e) => e.values[i.key] ?? 0), f, m, l).map((e) => ({
|
|
2559
|
-
x: d + e.x,
|
|
2560
|
-
y: p - m + e.y
|
|
2561
|
-
})), a = z(i.slot, "light");
|
|
2562
|
-
r && n.length && (e.globalAlpha = .14, e.fillStyle = a, e.beginPath(), n.forEach((t, n) => n ? e.lineTo(t.x, t.y) : e.moveTo(t.x, t.y)), e.lineTo(n[n.length - 1].x, p), e.lineTo(n[0].x, p), e.closePath(), e.fill(), e.globalAlpha = 1), e.strokeStyle = a, e.beginPath(), n.forEach((t, n) => n ? e.lineTo(t.x, t.y) : e.moveTo(t.x, t.y)), e.stroke();
|
|
2563
|
-
}
|
|
2564
|
-
}
|
|
2565
|
-
e.font = s.small, e.fillStyle = G.muted;
|
|
2566
|
-
let h = rr(t.length, 6);
|
|
2567
|
-
for (let n of h) {
|
|
2568
|
-
let r = d + Zn(n, t.length, f);
|
|
2569
|
-
e.textAlign = n === 0 ? "left" : n === t.length - 1 ? "right" : "center", e.fillText($(e, t[n].label, f / h.length), r, p + J / 2 + 4);
|
|
2570
|
-
}
|
|
2571
|
-
let g = n.map((e) => t.reduce((t, n) => t + (n.values[e.key] ?? 0), 0)), _ = g.reduce((e, t) => e + t, 0);
|
|
2572
|
-
ri(e, n.map((e, t) => ({
|
|
2573
|
-
slot: e.slot,
|
|
2574
|
-
label: e.label,
|
|
2575
|
-
value: n.length > 1 ? `${a(g[t])} · ${V(H(g[t], _))}` : `${o.total}: ${a(g[t])}`
|
|
2576
|
-
})), s, K, p + J + 8 + q, Q, 2);
|
|
2577
|
-
}
|
|
2578
|
-
function fi(e, t, n, r, i, a, o, s) {
|
|
2579
|
-
let c = i;
|
|
2580
|
-
n.length > 1 && (ci(e, n, c + Y / 2, s), c += Y);
|
|
2581
|
-
let l = r === "grouped" && n.length > 1, u = t.map((e) => Vn(e, n)), { max: d, ticks: f } = Kn(Yn(t, n, l ? "grouped" : "stacked")), { plotX: p, plotW: m, bottom: h } = ui(e, f, d, c, a, s);
|
|
2582
|
-
if (!u.some((e) => e > 0)) {
|
|
2583
|
-
e.textAlign = "center", e.fillStyle = G.muted, e.fillText(o.empty, p + m / 2, c + Z / 2);
|
|
2584
|
-
return;
|
|
2585
|
-
}
|
|
2586
|
-
if (n.length > 1) {
|
|
2587
|
-
let r = n.map((e) => t.reduce((t, n) => t + (n.values[e.key] ?? 0), 0)), i = r.reduce((e, t) => e + t, 0);
|
|
2588
|
-
ri(e, n.map((e, t) => ({
|
|
2589
|
-
slot: e.slot,
|
|
2590
|
-
label: e.label,
|
|
2591
|
-
value: `${a(r[t])} · ${V(H(r[t], i))}`
|
|
2592
|
-
})), s, K, h + J + 8 + q, Q, 2);
|
|
2593
|
-
}
|
|
2594
|
-
let g = m / Math.max(1, t.length), _ = l ? Math.min(24 * n.length, g * .8) : Math.min(48, g * .6), v = Xn(n.length, _, 2);
|
|
2595
|
-
t.forEach((r, i) => {
|
|
2596
|
-
let o = p + i * g + (g - _) / 2, c = h;
|
|
2597
|
-
n.forEach((t, n) => {
|
|
2598
|
-
let i = r.values[t.key] ?? 0;
|
|
2599
|
-
if (!i) return;
|
|
2600
|
-
let a = i / d * (Z - 16);
|
|
2601
|
-
e.fillStyle = z(t.slot, "light"), l ? (e.fillRect(o + v[n].x, h - a, v[n].width, a), c = Math.min(c, h - a)) : (e.fillRect(o, c - a, _, a), c -= a);
|
|
2602
|
-
}), e.textAlign = "center", u[i] && (e.font = s.small, e.fillStyle = G.text, e.fillText(a(u[i]), o + _ / 2, c - 8)), Jn(i, t.length) && (e.font = s.small, e.fillStyle = G.muted, e.fillText($(e, r.label, g - 4), o + _ / 2, h + J / 2 + 4));
|
|
2603
|
-
});
|
|
2604
|
-
}
|
|
2605
|
-
function pi(e, t, n) {
|
|
2606
|
-
e.beginPath(), t.forEach((t, n) => n ? e.lineTo(t.x, t.y) : e.moveTo(t.x, t.y)), n !== void 0 && t.length && (e.lineTo(t[t.length - 1].x, n), e.lineTo(t[0].x, n), e.closePath());
|
|
2607
|
-
}
|
|
2608
|
-
function mi(e, t, n, r, i, a) {
|
|
2609
|
-
let o = t.points ?? [];
|
|
2610
|
-
e.textAlign = "left", e.font = a.big, e.fillStyle = G.text;
|
|
2611
|
-
let s = r(t.value);
|
|
2612
|
-
e.fillText(s, K, n + zr / 2);
|
|
2613
|
-
let c = e.measureText(s).width, l = n + zr;
|
|
2614
|
-
if (t.previous !== void 0) {
|
|
2615
|
-
let r = ar(t.current ?? o.reduce((e, t) => e + t.value, 0), t.previous), s = or(r.direction, t.good ?? "up"), l = r.direction === "up" ? "▲" : r.direction === "down" ? "▼" : "=";
|
|
2616
|
-
e.font = a.bold, e.fillStyle = z(s, "light"), e.fillText(`${l} ${r.percent === null ? i.deltaNew : V(Math.abs(r.percent))}`, K + c + 16, n + zr / 2 + 6);
|
|
2617
|
-
}
|
|
2618
|
-
if (o.length > 1) {
|
|
2619
|
-
l += q;
|
|
2620
|
-
let n = z(t.slot ?? 1, "light"), r = ir(o.map((e) => e.value), Q, Br).map((e) => ({
|
|
2621
|
-
x: K + e.x,
|
|
2622
|
-
y: l + e.y
|
|
2623
|
-
}));
|
|
2624
|
-
e.globalAlpha = .14, e.fillStyle = n, pi(e, r, l + Br), e.fill(), e.globalAlpha = 1, e.strokeStyle = n, e.lineWidth = 2, e.lineJoin = "round", pi(e, r), e.stroke(), l += Br, e.font = a.small, e.fillStyle = G.muted, e.fillText(o[0].label, K, l + J / 2), e.textAlign = "right", e.fillText(o[o.length - 1].label, 720 - K, l + J / 2), e.textAlign = "left", l += J;
|
|
2625
|
-
}
|
|
2626
|
-
t.previous !== void 0 && (e.font = a.small, e.fillStyle = G.faint, e.fillText(i.vsPrevious, K, l + 4 + J / 2));
|
|
2627
|
-
}
|
|
2628
|
-
function hi(e, t, n, r, i, a) {
|
|
2629
|
-
if (t.reduce((e, t) => e + Math.max(0, t.value), 0) <= 0) {
|
|
2630
|
-
e.font = a.text, e.fillStyle = G.muted, e.textAlign = "left", e.fillText(i.empty, K, n + J / 2);
|
|
2631
|
-
return;
|
|
2632
|
-
}
|
|
2633
|
-
let o = wr(t, Q, Vr);
|
|
2634
|
-
for (let t of o) {
|
|
2635
|
-
let i = z((t.parent ?? t.node).slot, "light"), o = !!t.node.children?.some((e) => e.value > 0);
|
|
2636
|
-
t.parent && (e.globalAlpha = Tr(t.parent.children.filter((e) => e.value > 0).indexOf(t.node))), e.fillStyle = i, e.fillRect(K + t.rect.x + 1, n + t.rect.y + 1, Math.max(0, t.rect.w - 2), Math.max(0, t.rect.h - 2)), e.globalAlpha = 1, t.label && (e.textAlign = "left", e.fillStyle = B(i), e.font = a.bold, e.fillText($(e, t.node.label, t.rect.w - 12), K + t.rect.x + 6, n + t.rect.y + (o ? 9 : 12)), o || (e.font = a.small, e.fillText($(e, r(t.node.value), t.rect.w - 12), K + t.rect.x + 6, n + t.rect.y + 28)));
|
|
2637
|
-
}
|
|
2638
|
-
ri(e, Yr(t, r), a, K, n + Vr + q, Q, 2);
|
|
2639
|
-
}
|
|
2640
|
-
function gi(e, t) {
|
|
2641
|
-
try {
|
|
2642
|
-
return new Intl.DateTimeFormat(e ?? "en-IN", {
|
|
2643
|
-
...t,
|
|
2644
|
-
timeZone: "UTC"
|
|
2645
|
-
});
|
|
2646
|
-
} catch {
|
|
2647
|
-
return new Intl.DateTimeFormat(void 0, {
|
|
2648
|
-
...t,
|
|
2649
|
-
timeZone: "UTC"
|
|
2650
|
-
});
|
|
2651
|
-
}
|
|
2652
|
-
}
|
|
2653
|
-
function _i(e, t, n, r, i, a, o) {
|
|
2654
|
-
let s = gr(t), { cell: c } = $r(s.weeks), l = c + Zr, u = n + J;
|
|
2655
|
-
e.font = a.small, e.textAlign = "left", e.fillStyle = G.muted;
|
|
2656
|
-
let d = gi(o, { month: "short" });
|
|
2657
|
-
for (let t of s.months) e.fillText(d.format(ur(`${t.month}-01`)), 84 + t.week * l, n + J / 2);
|
|
2658
|
-
let f = gi(o, { weekday: "short" });
|
|
2659
|
-
for (let t = 0; t < 7; t += 2) e.fillText($(e, f.format(Date.UTC(2024, 0, 1 + t)), Qr - 6), K, u + t * l + c / 2);
|
|
2660
|
-
for (let t of s.cells) e.fillStyle = G.heat[t.level], e.fillRect(84 + t.week * l, u + t.weekday * l, c, c);
|
|
2661
|
-
let p = u + 7 * l + q + Y / 2;
|
|
2662
|
-
e.fillStyle = G.muted, e.fillText(i.less, K, p);
|
|
2663
|
-
let m = K + e.measureText(i.less).width + 8;
|
|
2664
|
-
for (let t of G.heat) e.fillStyle = t, e.fillRect(m, p - 6, 12, 12), m += 15;
|
|
2665
|
-
e.fillStyle = G.muted, e.fillText(i.more, m + 5, p);
|
|
2666
|
-
let h = s.cells.reduce((e, t) => t.count > (e?.count ?? 0) ? t : e, null);
|
|
2667
|
-
e.textAlign = "right", e.font = a.bold, e.fillStyle = G.text;
|
|
2668
|
-
let g = gi(o, { dateStyle: "medium" });
|
|
2669
|
-
e.fillText(`${i.total}: ${r(s.total)}${h ? ` · ${i.busiest}: ${g.format(ur(h.day))} (${r(h.count)})` : ""}`, 720 - K, p);
|
|
2670
|
-
}
|
|
2671
|
-
function vi(e, t, n, r, i, a) {
|
|
2672
|
-
if (!t.some((e) => e.value > 0)) {
|
|
2673
|
-
e.font = a.text, e.fillStyle = G.muted, e.textAlign = "left", e.fillText(i.empty, K, n + J / 2);
|
|
2674
|
-
return;
|
|
2675
|
-
}
|
|
2676
|
-
let o = Math.min(180, Q * .26), s = Q - o - 12 - 150 - 12;
|
|
2677
|
-
Er(t).forEach(({ step: t, width: i, ofFirst: c, drop: l }, u) => {
|
|
2678
|
-
let d = n + u * Hr + Hr / 2;
|
|
2679
|
-
e.font = a.bold, e.textAlign = "left", e.fillStyle = G.text, e.fillText($(e, t.label, o), K, d);
|
|
2680
|
-
let f = Math.max(2, s * i), p = 212.64000000000001 + (s - f) / 2, m = z(t.slot, "light");
|
|
2681
|
-
e.fillStyle = m, e.fillRect(p, d - 13, f, 26), e.textAlign = "center";
|
|
2682
|
-
let h = r(t.value);
|
|
2683
|
-
e.measureText(h).width + 12 <= f ? (e.fillStyle = B(m), e.fillText(h, p + f / 2, d)) : (e.fillStyle = G.text, e.textAlign = "left", e.fillText(h, p + f + 6, d)), e.textAlign = "right", l !== null && (e.fillStyle = l === 0 ? G.muted : z(l > 0 ? "negative" : "positive", "light"), e.fillText(On(l), 720 - K, d - 7)), e.font = a.small, e.fillStyle = G.muted, e.fillText(V(c), 720 - K, l === null ? d : d + 8);
|
|
2684
|
-
});
|
|
2685
|
-
}
|
|
2686
|
-
function yi(e, t, n, r, i, a, o) {
|
|
2687
|
-
let { cell: s, width: c, height: l, k: u } = ei(t.length, n), d = Dr[n];
|
|
2688
|
-
if (!t.length) {
|
|
2689
|
-
e.font = o.text, e.fillStyle = G.muted, e.textAlign = "left", e.fillText(a.empty, K, r + J / 2);
|
|
2690
|
-
return;
|
|
2691
|
-
}
|
|
2692
|
-
t.forEach((t, f) => {
|
|
2693
|
-
let p = K + f * s + (s - c) / 2 + d.cx * u, m = r + d.cy * u, h = H(t.value, t.total), { a0: g, a1: _, end: v } = Or(n, h);
|
|
2694
|
-
e.lineWidth = 12 * u, e.lineCap = "round", e.strokeStyle = G.track, e.beginPath(), e.arc(p, m, d.r * u, ai(g), ai(_)), e.stroke(), h > 0 && (e.strokeStyle = z(_n(t.color ?? 1, h), "light"), e.beginPath(), e.arc(p, m, d.r * u, ai(g), ai(Math.max(v, g + .01))), e.stroke()), e.lineCap = "butt", e.textAlign = "center", e.font = o.title, e.fillStyle = G.text, e.fillText(V(h), p, n === "half" ? m - Ir / 2 : m);
|
|
2695
|
-
let y = K + f * s + s / 2;
|
|
2696
|
-
e.font = o.bold, e.fillText($(e, t.label, s - 8), y, r + l + 8 + J / 2), e.font = o.text, e.fillStyle = G.muted, e.fillText($(e, `${a.ofTotal(i(t.value), i(t.total))} · ${V(h)}`, s - 8), y, r + l + 8 + J * 1.5);
|
|
2697
|
-
});
|
|
2698
|
-
}
|
|
2699
|
-
function bi(e, t, n, r, i, a) {
|
|
2700
|
-
if (!t.length) {
|
|
2701
|
-
e.font = a.text, e.fillStyle = G.muted, e.textAlign = "left", e.fillText(i.empty, K, n + J / 2);
|
|
2702
|
-
return;
|
|
2703
|
-
}
|
|
2704
|
-
t.forEach((t, o) => {
|
|
2705
|
-
let s = n + o * Gr, c = t.total > 0 ? t.value / t.total * 100 : 0, l = `${i.ofTotal(r(t.value), r(t.total))} · ${V(c)}`;
|
|
2706
|
-
e.font = a.bold, e.textAlign = "right", e.fillStyle = G.text, e.fillText(l, 720 - K, s + J / 2);
|
|
2707
|
-
let u = e.measureText(l).width;
|
|
2708
|
-
e.font = a.text, e.textAlign = "left", e.fillText($(e, t.label, Q - u - 16), K, s + J / 2);
|
|
2709
|
-
let d = s + J + 4;
|
|
2710
|
-
e.fillStyle = G.track, e.fillRect(K, d, Q, Wr), e.fillStyle = z(_n(t.color ?? 1, c), "light"), c > 0 && e.fillRect(K, d, Q * Math.min(100, c) / 100, Wr);
|
|
2711
|
-
});
|
|
2712
|
-
}
|
|
2713
|
-
function xi(e, t, n) {
|
|
2714
|
-
let r = e.getContext("2d");
|
|
2715
|
-
if (!r) throw Error("No 2D canvas");
|
|
2716
|
-
let i = Kr(n.fontFamily), a = {
|
|
2717
|
-
...Tn,
|
|
2718
|
-
...t.labels
|
|
2719
|
-
}, o = qr(t), s = n.pixelRatio ?? 2;
|
|
2720
|
-
r.font = i.text;
|
|
2721
|
-
let c = t.context ? ti(r, t.context, Q) : [], l = K + ((t.report ? 24 : 0) + Ir + 8 + c.length * J) + q + Xr(t.chart) + q + J + K;
|
|
2722
|
-
e.width = 720 * s, e.height = l * s, r.setTransform(s, 0, 0, s, 0, 0), r.textBaseline = "middle", r.fillStyle = G.background, r.fillRect(0, 0, 720, l);
|
|
2723
|
-
let u = K;
|
|
2724
|
-
r.textAlign = "left", t.report && (r.font = i.report, r.fillStyle = G.muted, r.fillText($(r, t.report, Q), K, u + J / 2), u += 24), r.font = i.title, r.fillStyle = G.text, r.fillText($(r, t.title, Q), K, u + Ir / 2), u += 30, r.font = i.text, r.fillStyle = G.muted;
|
|
2725
|
-
for (let e of c) r.fillText(e, K, u + J / 2), u += J;
|
|
2726
|
-
u += q;
|
|
2727
|
-
let d = t.chart;
|
|
2728
|
-
switch (d.kind) {
|
|
2729
|
-
case "donut":
|
|
2730
|
-
ii(r, d.slices, u, o, a, i);
|
|
2731
|
-
break;
|
|
2732
|
-
case "pie":
|
|
2733
|
-
oi(r, d.slices, u, o, a, i);
|
|
2734
|
-
break;
|
|
2735
|
-
case "stacked":
|
|
2736
|
-
si(r, d.slices, u, o, i);
|
|
2737
|
-
break;
|
|
2738
|
-
case "bars":
|
|
2739
|
-
li(r, d.data, d.series, u, o, a, i);
|
|
2740
|
-
break;
|
|
2741
|
-
case "progress":
|
|
2742
|
-
bi(r, d.rows, u, o, a, i);
|
|
2743
|
-
break;
|
|
2744
|
-
case "columns":
|
|
2745
|
-
fi(r, d.data, d.series, d.mode ?? "stacked", u, o, a, i);
|
|
2746
|
-
break;
|
|
2747
|
-
case "line":
|
|
2748
|
-
di(r, d.data, d.series, !!d.area, u, o, a, i);
|
|
2749
|
-
break;
|
|
2750
|
-
case "number":
|
|
2751
|
-
mi(r, d, u, o, a, i);
|
|
2752
|
-
break;
|
|
2753
|
-
case "gauge":
|
|
2754
|
-
yi(r, d.rows, d.variant ?? "half", u, o, a, i);
|
|
2755
|
-
break;
|
|
2756
|
-
case "funnel":
|
|
2757
|
-
vi(r, d.steps, u, o, a, i);
|
|
2758
|
-
break;
|
|
2759
|
-
case "calendar":
|
|
2760
|
-
_i(r, d.days, u, o, a, i, t.locale);
|
|
2761
|
-
break;
|
|
2762
|
-
case "treemap":
|
|
2763
|
-
hi(r, d.nodes, u, o, a, i);
|
|
2764
|
-
break;
|
|
2765
|
-
}
|
|
2766
|
-
u += Xr(d) + q, r.font = i.small, r.fillStyle = G.faint, r.textAlign = "left", r.fillText(Jr(t.at ?? /* @__PURE__ */ new Date(), t.locale), K, u + J / 2), t.branding && (r.textAlign = "right", r.fillText($(r, t.branding, Q / 2), 720 - K, u + J / 2));
|
|
2767
|
-
}
|
|
2768
|
-
function Si(e) {
|
|
2769
|
-
return [
|
|
2770
|
-
e.report ?? "",
|
|
2771
|
-
e.title,
|
|
2772
|
-
e.context ?? "",
|
|
2773
|
-
e.branding ?? "",
|
|
2774
|
-
...Ci(e.chart)
|
|
2775
|
-
].join(" ");
|
|
2776
|
-
}
|
|
2777
|
-
function Ci(e) {
|
|
2778
|
-
switch (e.kind) {
|
|
2779
|
-
case "donut":
|
|
2780
|
-
case "pie":
|
|
2781
|
-
case "stacked": return e.slices.map((e) => e.label);
|
|
2782
|
-
case "funnel": return e.steps.map((e) => e.label);
|
|
2783
|
-
case "calendar": return [];
|
|
2784
|
-
case "treemap": return e.nodes.flatMap((e) => [e.label, ...(e.children ?? []).map((e) => e.label)]);
|
|
2785
|
-
case "progress":
|
|
2786
|
-
case "gauge": return e.rows.map((e) => e.label);
|
|
2787
|
-
case "number": return (e.points ?? []).map((e) => e.label);
|
|
2788
|
-
case "bars":
|
|
2789
|
-
case "columns":
|
|
2790
|
-
case "line": return [...e.data.map((e) => e.fullLabel ?? e.label), ...e.series.map((e) => e.label)];
|
|
2791
|
-
}
|
|
2792
|
-
}
|
|
2793
|
-
async function wi(e, t = {}) {
|
|
2794
|
-
let n = t.fontFamily || (typeof document < "u" ? getComputedStyle(document.body).fontFamily : "") || "sans-serif", r = Kr(n);
|
|
2795
|
-
if (typeof document < "u" && document.fonts) {
|
|
2796
|
-
let t = Si(e);
|
|
2797
|
-
await Promise.all([
|
|
2798
|
-
r.report,
|
|
2799
|
-
r.title,
|
|
2800
|
-
r.bold,
|
|
2801
|
-
r.text
|
|
2802
|
-
].map((e) => document.fonts.load(e, t).catch(() => []))), await document.fonts.ready;
|
|
2803
|
-
}
|
|
2804
|
-
let i = document.createElement("canvas");
|
|
2805
|
-
return xi(i, e, { fontFamily: n }), new Promise((e, t) => i.toBlob((n) => n ? e(n) : t(/* @__PURE__ */ Error("No image")), "image/png"));
|
|
2806
|
-
}
|
|
2807
|
-
function Ti(e, t = /* @__PURE__ */ new Date(), n) {
|
|
2808
|
-
let r = [n, e].filter(Boolean).join(" ").trim().toLowerCase().replace(/[^\p{L}\p{M}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "") || "chart", i = (e) => String(e).padStart(2, "0");
|
|
2809
|
-
return `${r}-${t.getFullYear()}-${i(t.getMonth() + 1)}-${i(t.getDate())}-${i(t.getHours())}${i(t.getMinutes())}.png`;
|
|
2810
|
-
}
|
|
2811
|
-
//#endregion
|
|
2812
|
-
//#region ../../shared-web-ui/src/Charts/ChartImageMenu.tsx
|
|
2813
|
-
var Ei = 2e3;
|
|
2814
|
-
function Di() {
|
|
2815
|
-
if (typeof navigator > "u") return {
|
|
2816
|
-
copy: !1,
|
|
2817
|
-
share: !1
|
|
2818
|
-
};
|
|
2819
|
-
let e = typeof navigator.clipboard?.write == "function" && typeof ClipboardItem < "u", t = !1;
|
|
2820
|
-
try {
|
|
2821
|
-
t = typeof navigator.share == "function" && typeof navigator.canShare == "function" && navigator.canShare({ files: [new File([], "chart.png", { type: "image/png" })] });
|
|
2822
|
-
} catch {
|
|
2823
|
-
t = !1;
|
|
2824
|
-
}
|
|
2825
|
-
return {
|
|
2826
|
-
copy: e,
|
|
2827
|
-
share: t
|
|
2828
|
-
};
|
|
2829
|
-
}
|
|
2830
|
-
var Oi = (e) => /* @__PURE__ */ _("svg", {
|
|
2831
|
-
width: "16",
|
|
2832
|
-
height: "16",
|
|
2833
|
-
viewBox: "0 0 24 24",
|
|
2834
|
-
fill: "none",
|
|
2835
|
-
stroke: "currentColor",
|
|
2836
|
-
strokeWidth: "2",
|
|
2837
|
-
strokeLinecap: "round",
|
|
2838
|
-
strokeLinejoin: "round",
|
|
2839
|
-
"aria-hidden": !0,
|
|
2840
|
-
children: /* @__PURE__ */ _("path", { d: e })
|
|
2841
|
-
}), ki = () => Oi("M12 4v11M7 10l5 5 5-5M5 20h14"), Ai = () => Oi("M9 9h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V10a1 1 0 0 1 1-1zM5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1"), ji = () => /* @__PURE__ */ _("svg", {
|
|
2842
|
-
width: "16",
|
|
2843
|
-
height: "16",
|
|
2844
|
-
viewBox: "0 0 24 24",
|
|
2845
|
-
fill: "none",
|
|
2846
|
-
stroke: "currentColor",
|
|
2847
|
-
strokeWidth: "2",
|
|
2848
|
-
strokeLinecap: "round",
|
|
2849
|
-
strokeLinejoin: "round",
|
|
2850
|
-
"aria-hidden": !0,
|
|
2851
|
-
children: /* @__PURE__ */ _("path", { d: "M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7M16 6l-4-4-4 4M12 2v13" })
|
|
2852
|
-
});
|
|
2853
|
-
function Mi(e) {
|
|
2854
|
-
let t = {
|
|
2855
|
-
...Tn,
|
|
2856
|
-
...e.labels
|
|
2857
|
-
}, n = p(Di, []), r = m(null), [i, a] = h(null);
|
|
2858
|
-
u(() => {
|
|
2859
|
-
if (!i) return;
|
|
2860
|
-
let e = setTimeout(() => a(null), Ei);
|
|
2861
|
-
return () => clearTimeout(e);
|
|
2862
|
-
}, [i]);
|
|
2863
|
-
let o = [
|
|
2864
|
-
{
|
|
2865
|
-
value: "download",
|
|
2866
|
-
label: t.imageDownload,
|
|
2867
|
-
icon: /* @__PURE__ */ _(ki, {})
|
|
2868
|
-
},
|
|
2869
|
-
...n.copy ? [{
|
|
2870
|
-
value: "copy",
|
|
2871
|
-
label: t.imageCopy,
|
|
2872
|
-
icon: /* @__PURE__ */ _(Ai, {})
|
|
2873
|
-
}] : [],
|
|
2874
|
-
...n.share ? [{
|
|
2875
|
-
value: "share",
|
|
2876
|
-
label: t.imageShare,
|
|
2877
|
-
icon: /* @__PURE__ */ _(ji, {})
|
|
2878
|
-
}] : []
|
|
2879
|
-
], s = async (n) => {
|
|
2880
|
-
a(null);
|
|
2881
|
-
let i = /* @__PURE__ */ new Date(), o = Ti(e.title, i, e.report), s = () => wi({
|
|
2882
|
-
...e,
|
|
2883
|
-
at: i
|
|
2884
|
-
}, { fontFamily: r.current ? getComputedStyle(r.current).fontFamily : void 0 });
|
|
2885
|
-
try {
|
|
2886
|
-
if (n === "copy") {
|
|
2887
|
-
await navigator.clipboard.write([new ClipboardItem({ "image/png": s() })]), a({
|
|
2888
|
-
tone: "done",
|
|
2889
|
-
text: t.imageCopied
|
|
2890
|
-
});
|
|
2891
|
-
return;
|
|
2892
|
-
}
|
|
2893
|
-
let r = await s();
|
|
2894
|
-
if (n === "share") {
|
|
2895
|
-
await navigator.share({
|
|
2896
|
-
files: [new File([r], o, { type: "image/png" })],
|
|
2897
|
-
title: e.title
|
|
2898
|
-
});
|
|
2899
|
-
return;
|
|
2900
|
-
}
|
|
2901
|
-
let i = URL.createObjectURL(r), c = document.createElement("a");
|
|
2902
|
-
c.href = i, c.download = o, document.body.appendChild(c), c.click(), c.remove(), setTimeout(() => URL.revokeObjectURL(i), 1e3);
|
|
2903
|
-
} catch (e) {
|
|
2904
|
-
e?.name !== "AbortError" && a({
|
|
2905
|
-
tone: "failed",
|
|
2906
|
-
text: t.imageFailed
|
|
2907
|
-
});
|
|
2908
|
-
}
|
|
2909
|
-
};
|
|
2910
|
-
return /* @__PURE__ */ v("span", {
|
|
2911
|
-
ref: r,
|
|
2912
|
-
className: "chart-root chart-image-menu",
|
|
2913
|
-
children: [/* @__PURE__ */ _(Fr, {
|
|
2914
|
-
"aria-label": t.imageMenu,
|
|
2915
|
-
items: o,
|
|
2916
|
-
onSelect: (e) => void s(e),
|
|
2917
|
-
trigger: /* @__PURE__ */ _(_e, {
|
|
2918
|
-
variant: "text",
|
|
2919
|
-
color: "neutral",
|
|
2920
|
-
size: "xs",
|
|
2921
|
-
startIcon: /* @__PURE__ */ _(ji, {}),
|
|
2922
|
-
"aria-label": `${t.imageMenu}: ${e.title}`,
|
|
2923
|
-
tooltip: t.imageMenu
|
|
2924
|
-
})
|
|
2925
|
-
}), /* @__PURE__ */ _("span", {
|
|
2926
|
-
className: "chart-image-status",
|
|
2927
|
-
role: "status",
|
|
2928
|
-
"aria-live": "polite",
|
|
2929
|
-
"data-tone": i?.tone,
|
|
2930
|
-
children: i && /* @__PURE__ */ v(g, { children: [i.tone === "done" && /* @__PURE__ */ _("span", {
|
|
2931
|
-
"aria-hidden": !0,
|
|
2932
|
-
children: "✓"
|
|
2933
|
-
}), i.text] })
|
|
2934
|
-
})]
|
|
2935
|
-
});
|
|
2936
|
-
}
|
|
2937
|
-
//#endregion
|
|
2938
|
-
export { V as $, Nt as $t, Er as A, Ce as An, L as At, ir as B, de as Bn, Xt as Bt, Yn as C, Ve as Cn, wn as Ct, pr as D, we as Dn, Mt as Dt, ur as E, Se as En, yt as Et, nr as F, j as Fn, Pt as Ft, Fn as G, x as Gn, Jt as Gt, wr as H, k as Hn, It as Ht, jr as I, ye as In, gt as It, zn as J, Dt as Jt, Pn as K, w as Kn, Tt as Kt, Zn as L, be as Ln, Qt as Lt, Xn as M, Oe as Mn, Ut as Mt, er as N, ke as Nn, Rt as Nt, or as O, Ae as On, xt as Ot, Qn as P, Te as Pn, Wt as Pt, En as Q, Ot as Qt, U as R, ve as Rn, kt as Rt, Kn as S, P as Sn, pn as St, Vn as T, xe as Tn, ht as Tt, ar as U, ne as Un, jt as Ut, xr as V, pe as Vn, qt as Vt, cr as W, te as Wn, Yt as Wt, Mn as X, I as Xt, An as Y, _t as Yt, Dn as Z, $t as Zt, qn as _, ze as _n, _n as _t, xi as a, ct as an, bn as at, br as b, Ke as bn, on as bt, Mr as c, $e as cn, tn as ct, Hn as d, ut as dn, yn as dt, zt as en, On as et, Dr as f, Ze as fn, z as ft, rr as g, Be as gn, gn as gt, tr as h, mt as hn, B as ht, Ti as i, ot as in, nn as it, Or as j, De as jn, Lt as jt, Wn as k, Ee as kn, Gt as kt, _r as l, tt as ln, en as lt, sr as m, ft as mn, sn as mt, G as n, Xe as nn, kn as nt, Fr as o, pt as on, Sn as ot, Ar as p, Qe as pn, xn as pt, In as q, S as qn, Zt as qt, wi as r, st as rn, Tn as rt, Nr as s, F as sn, hn as st, Mi as t, At as tn, jn as tt, mr as u, et as un, fn as ut, yr as v, N as vn, Cn as vt, Bn as w, Ye as wn, Ft as wt, Tr as x, He as xn, mn as xt, gr as y, Ge as yn, cn as yt, H as z, _e as zn, Ct as zt };
|