@dcs-tech/ui 0.2.0 → 0.3.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 +31 -0
- package/dist/ChartImageMenu-gvNAYVkY.js +2938 -0
- package/dist/Charts-COljjy0x.js +1759 -0
- package/dist/SummaryChart-D4jcOv-K.js +31 -0
- package/dist/SummaryImage-BSbatHym.js +19 -0
- package/dist/SummarySeeAll-vnaL3pdy.js +97 -0
- package/dist/defaults-BbLB8QmD.js +709 -0
- package/dist/exportContext-CAX8VPrP.js +243 -0
- package/dist/exportEngine-C4n1MiOw.js +891 -0
- package/dist/fuseSearch-vLQR3O5a.js +37 -0
- package/dist/index.js +19289 -9411
- package/dist/style.css +1 -1
- package/dist/summaryChartData-CU_W5ocv.js +82 -0
- package/dist/types/published/dcs-ui/src/index.d.ts +0 -28
- package/dist/types/published/dcs-ui/src/publicLogic.d.ts +0 -33
- package/dist/types/published/dcs-ui/src/publicTypes.d.ts +0 -12
- package/dist/types/shared-logic/src/report/aggregate.d.ts +0 -21
- package/dist/types/shared-logic/src/report/canvas.d.ts +0 -55
- package/dist/types/shared-logic/src/report/conditions.d.ts +0 -14
- package/dist/types/shared-logic/src/report/constants.d.ts +0 -39
- package/dist/types/shared-logic/src/report/dataset.d.ts +0 -26
- package/dist/types/shared-logic/src/report/edit.d.ts +0 -62
- package/dist/types/shared-logic/src/report/fields.d.ts +0 -51
- package/dist/types/shared-logic/src/report/format.d.ts +0 -22
- package/dist/types/shared-logic/src/report/fromColumns.d.ts +0 -30
- package/dist/types/shared-logic/src/report/layout.d.ts +1 -55
- package/dist/types/shared-logic/src/report/metrics.d.ts +0 -45
- package/dist/types/shared-logic/src/report/migrate.d.ts +0 -60
- package/dist/types/shared-logic/src/report/paginate.d.ts +0 -32
- package/dist/types/shared-logic/src/report/renderers/html.d.ts +0 -21
- package/dist/types/shared-logic/src/report/renderers/pdfmake.d.ts +0 -27
- package/dist/types/shared-logic/src/report/resolve.d.ts +0 -29
- package/dist/types/shared-logic/src/report/scope.d.ts +0 -28
- package/dist/types/shared-logic/src/report/storage.d.ts +0 -76
- package/dist/types/shared-logic/src/report/validate.d.ts +0 -18
- package/dist/types/shared-logic/src/ui/cellRules.logic.d.ts +0 -35
- package/dist/types/shared-logic/src/ui/chipinput.logic.d.ts +0 -12
- package/dist/types/shared-logic/src/ui/collapsible.logic.d.ts +0 -7
- package/dist/types/shared-logic/src/ui/colorScheme.d.ts +0 -14
- package/dist/types/shared-logic/src/ui/columnOrder.logic.d.ts +0 -11
- package/dist/types/shared-logic/src/ui/datePicker.logic.d.ts +136 -0
- package/dist/types/shared-logic/src/ui/editableTable.logic.d.ts +0 -27
- package/dist/types/shared-logic/src/ui/fieldControl.logic.d.ts +2 -14
- package/dist/types/shared-logic/src/ui/form.logic.d.ts +0 -8
- package/dist/types/shared-logic/src/ui/index.d.ts +3 -29
- package/dist/types/shared-logic/src/ui/keyboard.logic.d.ts +0 -60
- package/dist/types/shared-logic/src/ui/navigation.logic.d.ts +0 -24
- package/dist/types/shared-logic/src/ui/popover.logic.d.ts +22 -20
- package/dist/types/shared-logic/src/ui/popupList.logic.d.ts +0 -35
- package/dist/types/shared-logic/src/ui/quickAddGrid.logic.d.ts +183 -0
- package/dist/types/shared-logic/src/ui/select.logic.d.ts +0 -14
- package/dist/types/shared-logic/src/ui/tableLayout.logic.d.ts +0 -34
- package/dist/types/shared-logic/src/ui/tableSummary.logic.d.ts +0 -19
- package/dist/types/shared-logic/src/ui/timeField.logic.d.ts +26 -0
- package/dist/types/shared-logic/src/ui/tooltip.logic.d.ts +0 -24
- package/dist/types/shared-logic/src/ui/useMergeRefs.d.ts +0 -8
- package/dist/types/shared-types/src/report/bands.d.ts +0 -20
- package/dist/types/shared-types/src/report/blocks.d.ts +0 -59
- package/dist/types/shared-types/src/report/conditions.d.ts +0 -13
- package/dist/types/shared-types/src/report/dataset.d.ts +0 -53
- package/dist/types/shared-types/src/report/document.d.ts +0 -80
- package/dist/types/shared-types/src/report/primitives.d.ts +0 -40
- package/dist/types/shared-types/src/report/registry.d.ts +0 -46
- package/dist/types/shared-types/src/report/storage.d.ts +0 -31
- package/dist/types/shared-types/src/report/template.d.ts +0 -60
- package/dist/types/shared-types/src/ui/button.types.d.ts +0 -11
- package/dist/types/shared-types/src/ui/checkbox.types.d.ts +0 -4
- package/dist/types/shared-types/src/ui/chipinput.types.d.ts +0 -10
- package/dist/types/shared-types/src/ui/collapsible.types.d.ts +0 -18
- package/dist/types/shared-types/src/ui/common.types.d.ts +0 -11
- package/dist/types/shared-types/src/ui/control.types.d.ts +0 -97
- package/dist/types/shared-types/src/ui/datePicker.types.d.ts +46 -0
- package/dist/types/shared-types/src/ui/editableTable.types.d.ts +0 -79
- package/dist/types/shared-types/src/ui/field.types.d.ts +4 -124
- package/dist/types/shared-types/src/ui/fieldWrapper.types.d.ts +0 -10
- package/dist/types/shared-types/src/ui/fields.types.d.ts +0 -45
- package/dist/types/shared-types/src/ui/form.types.d.ts +0 -30
- package/dist/types/shared-types/src/ui/index.d.ts +1 -16
- package/dist/types/shared-types/src/ui/input.types.d.ts +0 -4
- package/dist/types/shared-types/src/ui/keyboard.types.d.ts +2 -109
- package/dist/types/shared-types/src/ui/navigation.types.d.ts +0 -22
- package/dist/types/shared-types/src/ui/radio.types.d.ts +0 -6
- package/dist/types/shared-types/src/ui/select.types.d.ts +0 -41
- package/dist/types/shared-types/src/ui/suggest.types.d.ts +0 -10
- package/dist/types/shared-types/src/ui/switch.types.d.ts +0 -4
- package/dist/types/shared-types/src/ui/table.types.d.ts +0 -59
- package/dist/types/shared-types/src/ui/tooltip.types.d.ts +0 -25
- package/dist/types/shared-types/src/ui/typography.types.d.ts +0 -4
- package/dist/types/shared-web-ui/src/AppBar/AppBar.d.ts +0 -9
- package/dist/types/shared-web-ui/src/ArrowKeyFocus/useArrowKeyFocus.d.ts +0 -19
- package/dist/types/shared-web-ui/src/Avatar/Avatar.d.ts +0 -14
- package/dist/types/shared-web-ui/src/Badge/Badge.d.ts +0 -11
- package/dist/types/shared-web-ui/src/Breadcrumbs/Breadcrumbs.d.ts +0 -52
- package/dist/types/shared-web-ui/src/Card/Card.d.ts +0 -16
- package/dist/types/shared-web-ui/src/Charts/AnchoredMenu.d.ts +17 -0
- package/dist/types/shared-web-ui/src/Charts/BarList.d.ts +12 -0
- package/dist/types/shared-web-ui/src/Charts/CalendarHeatmap.d.ts +17 -0
- package/dist/types/shared-web-ui/src/Charts/Chart.d.ts +20 -0
- package/dist/types/shared-web-ui/src/Charts/ChartIcon.d.ts +5 -0
- package/dist/types/shared-web-ui/src/Charts/ChartImageMenu.d.ts +4 -0
- package/dist/types/shared-web-ui/src/Charts/ChartTable.d.ts +8 -0
- package/dist/types/shared-web-ui/src/Charts/ChartTooltip.d.ts +44 -0
- package/dist/types/shared-web-ui/src/Charts/ChartView.d.ts +15 -0
- package/dist/types/shared-web-ui/src/Charts/ColumnChart.d.ts +15 -0
- package/dist/types/shared-web-ui/src/Charts/Donut.d.ts +14 -0
- package/dist/types/shared-web-ui/src/Charts/Funnel.d.ts +10 -0
- package/dist/types/shared-web-ui/src/Charts/Gauge.d.ts +15 -0
- package/dist/types/shared-web-ui/src/Charts/Legend.d.ts +6 -0
- package/dist/types/shared-web-ui/src/Charts/LineChart.d.ts +13 -0
- package/dist/types/shared-web-ui/src/Charts/NumberTrend.d.ts +21 -0
- package/dist/types/shared-web-ui/src/Charts/Progress.d.ts +12 -0
- package/dist/types/shared-web-ui/src/Charts/StackedBar.d.ts +11 -0
- package/dist/types/shared-web-ui/src/Charts/Treemap.d.ts +12 -0
- package/dist/types/shared-web-ui/src/Charts/chartData.d.ts +69 -0
- package/dist/types/shared-web-ui/src/Charts/chartImage.d.ts +121 -0
- package/dist/types/shared-web-ui/src/Charts/geometry.d.ts +178 -0
- package/dist/types/shared-web-ui/src/Charts/index.d.ts +32 -0
- package/dist/types/shared-web-ui/src/Charts/labels.d.ts +46 -0
- package/dist/types/shared-web-ui/src/Charts/menuPlacement.d.ts +25 -0
- package/dist/types/shared-web-ui/src/Charts/palette.d.ts +81 -0
- package/dist/types/shared-web-ui/src/Charts/parts.d.ts +24 -0
- package/dist/types/shared-web-ui/src/Charts/pointer.d.ts +41 -0
- package/dist/types/shared-web-ui/src/Charts/types.d.ts +51 -0
- package/dist/types/shared-web-ui/src/Charts/ui.d.ts +3 -0
- package/dist/types/shared-web-ui/src/Charts/useBoxSize.d.ts +6 -0
- package/dist/types/shared-web-ui/src/Charts/useLegendFit.d.ts +1 -0
- package/dist/types/shared-web-ui/src/Collapsible/CollapsibleItem.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ColorSchemeSelect/ColorSchemeSelect.d.ts +0 -15
- package/dist/types/shared-web-ui/src/CommandPalette/CommandPalette.d.ts +0 -27
- package/dist/types/shared-web-ui/src/DataTable/DataTable.d.ts +16 -0
- package/dist/types/shared-web-ui/src/DataTable/DisplayPopover.d.ts +22 -0
- package/dist/types/shared-web-ui/src/DataTable/HeaderMenu.d.ts +31 -0
- package/dist/types/shared-web-ui/src/DataTable/ManageModal.d.ts +31 -0
- package/dist/types/shared-web-ui/src/DataTable/SingleRowView.d.ts +9 -0
- package/dist/types/shared-web-ui/src/DataTable/SortModal.d.ts +16 -0
- package/dist/types/shared-web-ui/src/DataTable/StatusRow.d.ts +49 -0
- package/dist/types/shared-web-ui/src/DataTable/TableColumnModal.d.ts +18 -0
- package/dist/types/shared-web-ui/src/DataTable/TableControls.d.ts +48 -0
- package/dist/types/shared-web-ui/src/DataTable/TablePagination.d.ts +38 -0
- package/dist/types/shared-web-ui/src/DataTable/TableScrollStrip.d.ts +2 -0
- package/dist/types/shared-web-ui/src/DataTable/TableToolbar.d.ts +69 -0
- package/dist/types/shared-web-ui/src/DataTable/TableView.d.ts +61 -0
- package/dist/types/shared-web-ui/src/DataTable/bulk/BulkConfirmDialog.d.ts +13 -0
- package/dist/types/shared-web-ui/src/DataTable/bulk/TableToast.d.ts +13 -0
- package/dist/types/shared-web-ui/src/DataTable/bulk/bulkActions.d.ts +23 -0
- package/dist/types/shared-web-ui/src/DataTable/cards/CardFieldsEditor.d.ts +16 -0
- package/dist/types/shared-web-ui/src/DataTable/cards/CardView.d.ts +50 -0
- package/dist/types/shared-web-ui/src/DataTable/cards/cardFields.d.ts +32 -0
- package/dist/types/shared-web-ui/src/DataTable/cards/rowParts.d.ts +38 -0
- package/dist/types/shared-web-ui/src/DataTable/data/useServerData.d.ts +28 -0
- package/dist/types/shared-web-ui/src/DataTable/defaults.d.ts +18 -0
- package/dist/types/shared-web-ui/src/DataTable/detail/BuiltInDetail.d.ts +10 -0
- package/dist/types/shared-web-ui/src/DataTable/detail/DetailHost.d.ts +13 -0
- package/dist/types/shared-web-ui/src/DataTable/export/ExportPopover.d.ts +18 -0
- package/dist/types/shared-web-ui/src/DataTable/export/ExportPreviewModal.d.ts +11 -0
- package/dist/types/shared-web-ui/src/DataTable/export/ExportSettingsModal.d.ts +31 -0
- package/dist/types/shared-web-ui/src/DataTable/export/ExportTemplateCards.d.ts +19 -0
- package/dist/types/shared-web-ui/src/DataTable/export/exportContext.d.ts +10 -0
- package/dist/types/shared-web-ui/src/DataTable/export/exportEngine.d.ts +77 -0
- package/dist/types/shared-web-ui/src/DataTable/export/exportRows.d.ts +10 -0
- package/dist/types/shared-web-ui/src/DataTable/export/templateDisplay.d.ts +7 -0
- package/dist/types/shared-web-ui/src/DataTable/export/templateOptions.d.ts +6 -0
- package/dist/types/shared-web-ui/src/DataTable/export/useTableExport.d.ts +53 -0
- package/dist/types/shared-web-ui/src/DataTable/filters/ColumnFilterPopover.d.ts +14 -0
- package/dist/types/shared-web-ui/src/DataTable/filters/FilterConditionRow.d.ts +11 -0
- package/dist/types/shared-web-ui/src/DataTable/filters/FilterGroup.d.ts +12 -0
- package/dist/types/shared-web-ui/src/DataTable/filters/FilterModal.d.ts +14 -0
- package/dist/types/shared-web-ui/src/DataTable/filters/FilterRow.d.ts +20 -0
- package/dist/types/shared-web-ui/src/DataTable/filters/columnFilterModel.d.ts +29 -0
- package/dist/types/shared-web-ui/src/DataTable/filters/filterEngine.d.ts +16 -0
- package/dist/types/shared-web-ui/src/DataTable/filters/filterRowModel.d.ts +28 -0
- package/dist/types/shared-web-ui/src/DataTable/filters/quickFilterMatch.d.ts +3 -0
- package/dist/types/shared-web-ui/src/DataTable/grouping/GroupUi.d.ts +36 -0
- package/dist/types/shared-web-ui/src/DataTable/grouping/groupModel.d.ts +82 -0
- package/dist/types/shared-web-ui/src/DataTable/grouping/useGrouping.d.ts +39 -0
- package/dist/types/shared-web-ui/src/DataTable/host.d.ts +14 -0
- package/dist/types/shared-web-ui/src/DataTable/index.d.ts +18 -0
- package/dist/types/shared-web-ui/src/DataTable/keyboard/ShortcutsDialog.d.ts +14 -0
- package/dist/types/shared-web-ui/src/DataTable/keyboard/shortcuts.d.ts +22 -0
- package/dist/types/shared-web-ui/src/DataTable/keyboard/useGridKeyboard.d.ts +48 -0
- package/dist/types/shared-web-ui/src/DataTable/labels.d.ts +618 -0
- package/dist/types/shared-web-ui/src/DataTable/layout/LayoutSwitcher.d.ts +9 -0
- package/dist/types/shared-web-ui/src/DataTable/layout/layouts.d.ts +20 -0
- package/dist/types/shared-web-ui/src/DataTable/layout/scrollArea.d.ts +2 -0
- package/dist/types/shared-web-ui/src/DataTable/layout/useFillHeight.d.ts +11 -0
- package/dist/types/shared-web-ui/src/DataTable/menu/RowMenu.d.ts +56 -0
- package/dist/types/shared-web-ui/src/DataTable/menu/buildRowMenu.d.ts +35 -0
- package/dist/types/shared-web-ui/src/DataTable/menu/clipboard.d.ts +4 -0
- package/dist/types/shared-web-ui/src/DataTable/menu/valueFilter.d.ts +15 -0
- package/dist/types/shared-web-ui/src/DataTable/motion/useRowMotion.d.ts +32 -0
- package/dist/types/shared-web-ui/src/DataTable/persistence/adapters.d.ts +6 -0
- package/dist/types/shared-web-ui/src/DataTable/persistence/reconcile.d.ts +64 -0
- package/dist/types/shared-web-ui/src/DataTable/persistence/useColumnPersistence.d.ts +51 -0
- package/dist/types/shared-web-ui/src/DataTable/persistence/useManagePrefs.d.ts +23 -0
- package/dist/types/shared-web-ui/src/DataTable/persistence/useOrphanPrefs.d.ts +3 -0
- package/dist/types/shared-web-ui/src/DataTable/pinning.d.ts +10 -0
- package/dist/types/shared-web-ui/src/DataTable/rows/RowActions.d.ts +15 -0
- package/dist/types/shared-web-ui/src/DataTable/rows/rowPress.d.ts +35 -0
- package/dist/types/shared-web-ui/src/DataTable/sharing/Sharing.d.ts +21 -0
- package/dist/types/shared-web-ui/src/DataTable/split/SplitView.d.ts +29 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/ManageSummaryCards.d.ts +18 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/SummaryChart.d.ts +11 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/SummaryControls.d.ts +33 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/SummaryImage.d.ts +12 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/SummarySeeAll.d.ts +17 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/TableSummary.d.ts +34 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/summaryCatalogue.d.ts +64 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/summaryChartData.d.ts +9 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/summaryModel.d.ts +152 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/summaryWidth.d.ts +22 -0
- package/dist/types/shared-web-ui/src/DataTable/summary/useTableSummary.d.ts +18 -0
- package/dist/types/shared-web-ui/src/DataTable/types.d.ts +1145 -0
- package/dist/types/shared-web-ui/src/DataTable/ui-local/AutoHeight.d.ts +9 -0
- package/dist/types/shared-web-ui/src/DataTable/ui-local/DateRangePicker.d.ts +16 -0
- package/dist/types/shared-web-ui/src/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +4 -0
- package/dist/types/shared-web-ui/src/DataTable/ui-local/DragAndDropList/index.d.ts +3 -0
- package/dist/types/shared-web-ui/src/DataTable/ui-local/DragAndDropList/types.d.ts +70 -0
- package/dist/types/shared-web-ui/src/DataTable/ui-local/ReactModal.d.ts +20 -0
- package/dist/types/shared-web-ui/src/DataTable/ui.d.ts +13 -0
- package/dist/types/shared-web-ui/src/DataTable/useDataChangeTracker.d.ts +11 -0
- package/dist/types/shared-web-ui/src/DataTable/useTable.d.ts +12 -0
- package/dist/types/shared-web-ui/src/DataTable/vendor/columnOrder.d.ts +1 -0
- package/dist/types/shared-web-ui/src/DataTable/vendor/diff.d.ts +5 -0
- package/dist/types/shared-web-ui/src/DataTable/vendor/fileActions.d.ts +19 -0
- package/dist/types/shared-web-ui/src/DataTable/vendor/index.d.ts +3 -0
- package/dist/types/shared-web-ui/src/DataTable/virtual/useVirtualLines.d.ts +27 -0
- package/dist/types/shared-web-ui/src/DatePicker/Calendar.d.ts +14 -0
- package/dist/types/shared-web-ui/src/DatePicker/DatePicker.d.ts +5 -0
- package/dist/types/shared-web-ui/src/DatePicker/TimeField.d.ts +16 -0
- package/dist/types/shared-web-ui/src/DatePicker/index.d.ts +4 -0
- package/dist/types/shared-web-ui/src/DatePicker/useOneMonthPane.d.ts +2 -0
- package/dist/types/shared-web-ui/src/Dialog/Dialog.d.ts +0 -45
- package/dist/types/shared-web-ui/src/Dialog/DialogHost.d.ts +0 -36
- package/dist/types/shared-web-ui/src/DropdownMenu/DropdownMenu.d.ts +24 -24
- package/dist/types/shared-web-ui/src/EditableTable/EditableTable.d.ts +0 -5
- package/dist/types/shared-web-ui/src/EditableTable/EditableTableCell.d.ts +0 -18
- package/dist/types/shared-web-ui/src/EditableTable/EditableTableRow.d.ts +0 -11
- package/dist/types/shared-web-ui/src/EditableTable/EditableTableSummary.d.ts +0 -11
- package/dist/types/shared-web-ui/src/EditableTable/useRowAnimation.d.ts +0 -32
- package/dist/types/shared-web-ui/src/FieldContext/FieldContext.d.ts +0 -15
- package/dist/types/shared-web-ui/src/FieldContext/FieldProvider.d.ts +0 -9
- package/dist/types/shared-web-ui/src/FieldContext/useField.d.ts +0 -27
- package/dist/types/shared-web-ui/src/FieldContext/useFieldSurface.d.ts +0 -23
- package/dist/types/shared-web-ui/src/FieldContext/useFormKeyboard.d.ts +0 -3
- package/dist/types/shared-web-ui/src/Fields/FieldButton.d.ts +0 -15
- package/dist/types/shared-web-ui/src/Floating/index.d.ts +3 -0
- package/dist/types/shared-web-ui/src/Floating/layers.d.ts +4 -0
- package/dist/types/shared-web-ui/src/Floating/scrollLock.d.ts +2 -0
- package/dist/types/shared-web-ui/src/Floating/useFloatingLayer.d.ts +20 -0
- package/dist/types/shared-web-ui/src/Popover/Popover.d.ts +6 -25
- package/dist/types/shared-web-ui/src/Popover/floatingPosition.d.ts +17 -0
- package/dist/types/shared-web-ui/src/ReportDesigner/BandList.d.ts +0 -8
- package/dist/types/shared-web-ui/src/ReportDesigner/BlockEditor.d.ts +0 -11
- package/dist/types/shared-web-ui/src/ReportDesigner/ConditionEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/FieldPicker.d.ts +0 -13
- package/dist/types/shared-web-ui/src/ReportDesigner/Inspector.d.ts +0 -7
- package/dist/types/shared-web-ui/src/ReportDesigner/ReportDesigner.d.ts +0 -22
- package/dist/types/shared-web-ui/src/ReportDesigner/TableEditor.d.ts +0 -8
- package/dist/types/shared-web-ui/src/ReportDesigner/chipSources.d.ts +0 -1
- package/dist/types/shared-web-ui/src/ReportDesigner/labels.d.ts +0 -12
- package/dist/types/shared-web-ui/src/ReportDesigner/parts.d.ts +0 -30
- package/dist/types/shared-web-ui/src/ReportDesigner/types.d.ts +0 -39
- package/dist/types/shared-web-ui/src/ReportPreview/ReportPreview.d.ts +0 -24
- package/dist/types/shared-web-ui/src/Scroll/ScrollRule.d.ts +2 -0
- package/dist/types/shared-web-ui/src/Scroll/ScrollStrip.d.ts +9 -0
- package/dist/types/shared-web-ui/src/Scroll/index.d.ts +4 -0
- package/dist/types/shared-web-ui/src/Scroll/labels.d.ts +5 -0
- package/dist/types/shared-web-ui/src/Scroll/scrollActivity.d.ts +14 -0
- package/dist/types/shared-web-ui/src/Scroll/ui.d.ts +1 -0
- package/dist/types/shared-web-ui/src/Sidebar/Sidebar.d.ts +0 -31
- package/dist/types/shared-web-ui/src/Skeleton/Skeleton.d.ts +0 -15
- package/dist/types/shared-web-ui/src/Tabs/Tabs.d.ts +0 -43
- package/dist/types/shared-web-ui/src/Toast/ToastHost.d.ts +0 -14
- package/dist/types/shared-web-ui/src/Toast/ToastItem.d.ts +0 -9
- package/dist/types/shared-web-ui/src/Toast/toast.types.d.ts +0 -13
- package/dist/types/shared-web-ui/src/Tooltip/Tooltip.d.ts +0 -16
- package/dist/types/shared-web-ui/src/Tooltip/useTooltip.d.ts +0 -9
- package/dist/types/shared-web-ui/src/UIProvider/UIPortalContext.d.ts +0 -14
- package/dist/types/shared-web-ui/src/UIProvider/UIProvider.d.ts +0 -41
- package/dist/types/shared-web-ui/src/UIProvider/UIThemeContext.d.ts +0 -8
- package/dist/types/shared-web-ui/src/index.d.ts +5 -0
- package/dist/ui-DJFwpPdX.js +4997 -0
- package/package.json +9 -7
|
@@ -0,0 +1,4997 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Hn as e, In as t, Ln as n, Un as r, Vn as i } from "./ChartImageMenu-gvNAYVkY.js";
|
|
3
|
+
import { l as a, u as o } from "./defaults-BbLB8QmD.js";
|
|
4
|
+
import s, { createContext as c, forwardRef as l, useCallback as u, useContext as d, useEffect as f, useId as p, useImperativeHandle as m, useLayoutEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
5
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
6
|
+
import S, { createPortal as C } from "react-dom";
|
|
7
|
+
import { MdClose as w, MdDragIndicator as T } from "react-icons/md";
|
|
8
|
+
//#region ../../shared-logic/src/ui/checkbox.logic.ts
|
|
9
|
+
function E(e) {
|
|
10
|
+
let t = [
|
|
11
|
+
"root",
|
|
12
|
+
`label_${e.labelPosition}`,
|
|
13
|
+
`size_${e.size}`
|
|
14
|
+
];
|
|
15
|
+
return e.disabled && t.push("disabled"), e.readOnly && t.push("readonly"), e.error && t.push("error"), e.fullWidth && t.push("fullWidth"), t;
|
|
16
|
+
}
|
|
17
|
+
function D(e) {
|
|
18
|
+
let t = [
|
|
19
|
+
"wrapper",
|
|
20
|
+
`variant_${e.variant}`,
|
|
21
|
+
`size_${e.size}`,
|
|
22
|
+
`color_${e.color}`
|
|
23
|
+
];
|
|
24
|
+
return e.pressed && t.push("pressed"), e.showFocusRing && t.push("showFocusRing"), t;
|
|
25
|
+
}
|
|
26
|
+
function O(e) {
|
|
27
|
+
let t = ["group", `orientation_${e.orientation}`];
|
|
28
|
+
return e.disabled && t.push("groupDisabled"), t;
|
|
29
|
+
}
|
|
30
|
+
var k = (e) => String(e).padStart(2, "0"), A = (e, t) => new Date(e, t, 0).getDate();
|
|
31
|
+
function j({ y: e, m: t, d: n }) {
|
|
32
|
+
return !Number.isInteger(e) || !Number.isInteger(t) || !Number.isInteger(n) || e < 1900 || e > 9999 || t < 1 || t > 12 ? !1 : n >= 1 && n <= A(e, t);
|
|
33
|
+
}
|
|
34
|
+
var M = ({ y: e, m: t, d: n }) => `${String(e).padStart(4, "0")}-${k(t)}-${k(n)}`;
|
|
35
|
+
function N(e) {
|
|
36
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})(?:[T ].*)?$/.exec(String(e ?? "").trim());
|
|
37
|
+
if (!t) return null;
|
|
38
|
+
let n = {
|
|
39
|
+
y: Number(t[1]),
|
|
40
|
+
m: Number(t[2]),
|
|
41
|
+
d: Number(t[3])
|
|
42
|
+
};
|
|
43
|
+
return j(n) ? n : null;
|
|
44
|
+
}
|
|
45
|
+
var P = (e = /* @__PURE__ */ new Date()) => M({
|
|
46
|
+
y: e.getFullYear(),
|
|
47
|
+
m: e.getMonth() + 1,
|
|
48
|
+
d: e.getDate()
|
|
49
|
+
}), F = (e) => {
|
|
50
|
+
let t = N(e);
|
|
51
|
+
return t ? M(t) : "";
|
|
52
|
+
}, I = (e, t) => e < t ? -1 : +(e > t);
|
|
53
|
+
function L(e, t) {
|
|
54
|
+
let n = N(e);
|
|
55
|
+
if (!n) return "";
|
|
56
|
+
let r = new Date(n.y, n.m - 1, n.d + t);
|
|
57
|
+
return M({
|
|
58
|
+
y: r.getFullYear(),
|
|
59
|
+
m: r.getMonth() + 1,
|
|
60
|
+
d: r.getDate()
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function R(e, t) {
|
|
64
|
+
let n = N(e);
|
|
65
|
+
if (!n) return "";
|
|
66
|
+
let r = n.y * 12 + (n.m - 1) + t, i = Math.floor(r / 12), a = (r % 12 + 12) % 12 + 1;
|
|
67
|
+
return M({
|
|
68
|
+
y: i,
|
|
69
|
+
m: a,
|
|
70
|
+
d: Math.min(n.d, A(i, a))
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
var ee = (e, t) => R(e, t * 12);
|
|
74
|
+
function z(e) {
|
|
75
|
+
let t = N(e);
|
|
76
|
+
return t ? M({
|
|
77
|
+
...t,
|
|
78
|
+
d: 1
|
|
79
|
+
}) : "";
|
|
80
|
+
}
|
|
81
|
+
function B(e) {
|
|
82
|
+
let t = N(e);
|
|
83
|
+
return t ? M({
|
|
84
|
+
...t,
|
|
85
|
+
d: A(t.y, t.m)
|
|
86
|
+
}) : "";
|
|
87
|
+
}
|
|
88
|
+
function V(e) {
|
|
89
|
+
let t = N(e);
|
|
90
|
+
return t ? new Date(t.y, t.m - 1, t.d).getDay() : -1;
|
|
91
|
+
}
|
|
92
|
+
var H = (e, t, n) => {
|
|
93
|
+
let r = F(t), i = F(n);
|
|
94
|
+
return !(r && I(e, r) < 0 || i && I(e, i) > 0);
|
|
95
|
+
};
|
|
96
|
+
function te(e, t, n) {
|
|
97
|
+
let r = F(t), i = F(n);
|
|
98
|
+
return r && I(e, r) < 0 ? r : i && I(e, i) > 0 ? i : e;
|
|
99
|
+
}
|
|
100
|
+
function U(e) {
|
|
101
|
+
let t = /^(\d{1,2}):(\d{2})(?::\d{2})?$/.exec(String(e ?? "").trim());
|
|
102
|
+
if (!t) return "";
|
|
103
|
+
let n = Number(t[1]), r = Number(t[2]);
|
|
104
|
+
return n > 23 || r > 59 ? "" : `${k(n)}:${k(r)}`;
|
|
105
|
+
}
|
|
106
|
+
function W(e) {
|
|
107
|
+
let [t = "", n = ""] = String(e ?? "").trim().replace(" ", "T").split("T");
|
|
108
|
+
return {
|
|
109
|
+
day: F(t),
|
|
110
|
+
time: U(n)
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function G(e, t) {
|
|
114
|
+
let n = F(e);
|
|
115
|
+
if (!n) return "";
|
|
116
|
+
let r = U(t);
|
|
117
|
+
return r ? `${n}T${r}` : n;
|
|
118
|
+
}
|
|
119
|
+
function ne(e, t) {
|
|
120
|
+
if (e > 99) return e;
|
|
121
|
+
let n = (t + 19) % 100, r = Math.floor((t + 19) / 100) * 100;
|
|
122
|
+
return e <= n ? r + e : r - 100 + e;
|
|
123
|
+
}
|
|
124
|
+
var re = /^(\d{2}|\d{4})$/, K = /^\d{1,2}$/;
|
|
125
|
+
function ie(e, t, n) {
|
|
126
|
+
if (e.length === 1) {
|
|
127
|
+
let t = e[0];
|
|
128
|
+
if (t.length !== 8) return null;
|
|
129
|
+
let n = {
|
|
130
|
+
y: Number(t.slice(0, 4)),
|
|
131
|
+
m: Number(t.slice(4, 6)),
|
|
132
|
+
d: Number(t.slice(6, 8))
|
|
133
|
+
};
|
|
134
|
+
return j(n) ? M(n) : null;
|
|
135
|
+
}
|
|
136
|
+
if (!re.test(e[0]) || !K.test(e[1]) || e.length === 3 && !K.test(e[2])) return null;
|
|
137
|
+
let r = {
|
|
138
|
+
y: ne(Number(e[0]), n),
|
|
139
|
+
m: Number(e[1]),
|
|
140
|
+
d: e.length === 3 ? Number(e[2]) : t.d
|
|
141
|
+
};
|
|
142
|
+
return j(r) ? M(r) : null;
|
|
143
|
+
}
|
|
144
|
+
function ae(e, t = {}) {
|
|
145
|
+
let n = String(e ?? "").trim();
|
|
146
|
+
if (!n) return null;
|
|
147
|
+
let r = N(t.today) ?? N(P()), i = N(t.within) ?? r, a = t.order ?? "dmy", o = n.split(/[^0-9]+/).filter(Boolean);
|
|
148
|
+
if (!o.length || o.length > 3) return null;
|
|
149
|
+
if (a === "ymd") return ie(o, i, r.y);
|
|
150
|
+
let s = "", c = "", l = "";
|
|
151
|
+
if (o.length === 1) {
|
|
152
|
+
let e = o[0];
|
|
153
|
+
if (e.length <= 2) s = e;
|
|
154
|
+
else if (e.length <= 4) s = e.slice(0, 2), c = e.slice(2);
|
|
155
|
+
else if (e.length === 6) s = e.slice(0, 2), c = e.slice(2, 4), l = e.slice(4, 6);
|
|
156
|
+
else if (e.length === 8) s = e.slice(0, 2), c = e.slice(2, 4), l = e.slice(4, 8);
|
|
157
|
+
else return null;
|
|
158
|
+
} else {
|
|
159
|
+
if (!K.test(o[0]) || !K.test(o[1])) return null;
|
|
160
|
+
if (s = o[0], c = o[1], o.length === 3) {
|
|
161
|
+
if (!re.test(o[2])) return null;
|
|
162
|
+
l = o[2];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (a === "mdy" && c) {
|
|
166
|
+
let e = s;
|
|
167
|
+
s = c, c = e;
|
|
168
|
+
}
|
|
169
|
+
let u = {
|
|
170
|
+
d: Number(s),
|
|
171
|
+
m: c ? Number(c) : i.m,
|
|
172
|
+
y: l ? ne(Number(l), r.y) : c ? r.y : i.y
|
|
173
|
+
};
|
|
174
|
+
return j(u) ? M(u) : null;
|
|
175
|
+
}
|
|
176
|
+
function oe(e, t = {}) {
|
|
177
|
+
let n = String(e ?? "").trim(), r = n.indexOf("+");
|
|
178
|
+
if (r <= 0 || r >= n.length - 1) return null;
|
|
179
|
+
let i = ae(n.slice(0, r), t);
|
|
180
|
+
if (!i) return null;
|
|
181
|
+
let a = ae(n.slice(r + 1), {
|
|
182
|
+
...t,
|
|
183
|
+
within: i
|
|
184
|
+
});
|
|
185
|
+
return a ? {
|
|
186
|
+
from: i,
|
|
187
|
+
to: I(a, i) < 0 ? ee(a, 1) : a
|
|
188
|
+
} : null;
|
|
189
|
+
}
|
|
190
|
+
function se(e, t = "dd-mm-yyyy") {
|
|
191
|
+
let n = N(e);
|
|
192
|
+
if (!n) return "";
|
|
193
|
+
let r = k(n.d), i = k(n.m), a = String(n.y).padStart(4, "0");
|
|
194
|
+
return t === "yyyy-mm-dd" ? `${a}-${i}-${r}` : t === "dd/mm/yyyy" ? `${r}/${i}/${a}` : `${r}-${i}-${a}`;
|
|
195
|
+
}
|
|
196
|
+
var ce = (e = "dd-mm-yyyy", t = !1) => t ? `${e} hh:mm` : e;
|
|
197
|
+
function le(e, t = "dd-mm-yyyy", n = !1) {
|
|
198
|
+
let { day: r, time: i } = W(e);
|
|
199
|
+
if (!r) return "";
|
|
200
|
+
let a = se(r, t);
|
|
201
|
+
return n && i ? `${a} ${i}` : a;
|
|
202
|
+
}
|
|
203
|
+
function ue(e, t = {}) {
|
|
204
|
+
let n = String(e ?? "").trim(), r = "";
|
|
205
|
+
if (t.withTime) {
|
|
206
|
+
let e = /[\s,]*(\d{1,2}:\d{2})$/.exec(n);
|
|
207
|
+
if (e) {
|
|
208
|
+
if (r = U(e[1]), !r) return null;
|
|
209
|
+
n = n.slice(0, e.index);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
let i = ae(n, t);
|
|
213
|
+
return i ? {
|
|
214
|
+
day: i,
|
|
215
|
+
time: r
|
|
216
|
+
} : null;
|
|
217
|
+
}
|
|
218
|
+
function de(e) {
|
|
219
|
+
let t = N(e.month) ?? N(P()), n = M({
|
|
220
|
+
...t,
|
|
221
|
+
d: 1
|
|
222
|
+
}), r = (Math.trunc(e.weekStart ?? 0) % 7 + 7) % 7, i = F(e.today ?? P()), a = F(e.selected), o = F(e.highlighted), s = F(e.rangeFrom), c = F(e.rangeTo), l = s && c ? I(s, c) <= 0 ? s : c : s || c, u = s && c ? I(s, c) <= 0 ? c : s : s || c, d = (V(n) - r + 7) % 7, f = A(t.y, t.m), p = e.fixedWeeks === !1 ? Math.ceil((d + f) / 7) : 6, m = L(n, -d), h = [];
|
|
223
|
+
for (let n = 0; n < p; n++) {
|
|
224
|
+
let r = [];
|
|
225
|
+
for (let s = 0; s < 7; s++) {
|
|
226
|
+
let c = L(m, n * 7 + s), d = N(c);
|
|
227
|
+
r.push({
|
|
228
|
+
day: c,
|
|
229
|
+
date: d.d,
|
|
230
|
+
inMonth: d.y === t.y && d.m === t.m,
|
|
231
|
+
isToday: !!i && c === i,
|
|
232
|
+
isSelected: !!a && c === a,
|
|
233
|
+
isHighlighted: !!o && c === o,
|
|
234
|
+
inRange: !!l && !!u && I(c, l) > 0 && I(c, u) < 0,
|
|
235
|
+
isRangeStart: !!l && c === l,
|
|
236
|
+
isRangeEnd: !!u && c === u,
|
|
237
|
+
disabled: !H(c, e.min, e.max)
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
h.push(r);
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
month: n,
|
|
244
|
+
year: t.y,
|
|
245
|
+
monthIndex: t.m,
|
|
246
|
+
weeks: h,
|
|
247
|
+
weekdays: Array.from({ length: 7 }, (e, t) => (r + t) % 7),
|
|
248
|
+
canPagePrev: H(L(n, -1), e.min, e.max),
|
|
249
|
+
canPageNext: H(L(B(n), 1), e.min, e.max)
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
var q = [
|
|
253
|
+
"highlightLeft",
|
|
254
|
+
"highlightRight",
|
|
255
|
+
"highlightPrev",
|
|
256
|
+
"highlightNext",
|
|
257
|
+
"highlightFirst",
|
|
258
|
+
"highlightLast",
|
|
259
|
+
"highlightPrevPage",
|
|
260
|
+
"highlightNextPage"
|
|
261
|
+
];
|
|
262
|
+
function fe(e, t, n = {}) {
|
|
263
|
+
let r = F(e) || P();
|
|
264
|
+
return te(t === "highlightLeft" ? L(r, -1) : t === "highlightRight" ? L(r, 1) : t === "highlightPrev" ? L(r, -7) : t === "highlightNext" ? L(r, 7) : t === "highlightFirst" ? z(r) : t === "highlightLast" ? B(r) : t === "highlightPrevPage" ? R(r, -1) : R(r, 1), n.min, n.max);
|
|
265
|
+
}
|
|
266
|
+
function pe(e, t = {}) {
|
|
267
|
+
let { day: n } = W(e);
|
|
268
|
+
return n || te(F(t.today ?? P()) || P(), t.min, t.max);
|
|
269
|
+
}
|
|
270
|
+
function me(e, t = 4) {
|
|
271
|
+
let n = N(e) ?? N(P()), r = Math.min(12, Math.max(1, Math.trunc(t) || 1)), i = M({
|
|
272
|
+
y: n.m >= r ? n.y : n.y - 1,
|
|
273
|
+
m: r,
|
|
274
|
+
d: 1
|
|
275
|
+
});
|
|
276
|
+
return {
|
|
277
|
+
from: i,
|
|
278
|
+
to: L(ee(i, 1), -1)
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function he(e, t = 0) {
|
|
282
|
+
let n = F(e) || P(), r = (Math.trunc(t) % 7 + 7) % 7;
|
|
283
|
+
return L(n, -(((V(n) - r) % 7 + 7) % 7));
|
|
284
|
+
}
|
|
285
|
+
function ge(e, t = 4) {
|
|
286
|
+
let n = me(e, t), r = N(e).y * 12 + N(e).m - (N(n.from).y * 12 + N(n.from).m), i = R(n.from, Math.floor(r / 3) * 3);
|
|
287
|
+
return {
|
|
288
|
+
from: i,
|
|
289
|
+
to: B(R(i, 2))
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
function _e(e = {}) {
|
|
293
|
+
let t = F(e.today ?? P()) || P(), n = e.fyStartMonth ?? 4, r = e.weekStart ?? 0, i = me(t, n), a = me(L(i.from, -1), n), o = he(t, r), s = L(o, -7), c = R(t, -1), l = ge(t, n), u = ge(L(l.from, -1), n), d = [
|
|
294
|
+
{
|
|
295
|
+
key: "today",
|
|
296
|
+
label: "Today",
|
|
297
|
+
single: !0,
|
|
298
|
+
from: t,
|
|
299
|
+
to: t
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
key: "yesterday",
|
|
303
|
+
label: "Yesterday",
|
|
304
|
+
single: !0,
|
|
305
|
+
from: L(t, -1),
|
|
306
|
+
to: L(t, -1)
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
key: "last7",
|
|
310
|
+
label: "Last 7 days",
|
|
311
|
+
from: L(t, -6),
|
|
312
|
+
to: t
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
key: "last30",
|
|
316
|
+
label: "Last 30 days",
|
|
317
|
+
from: L(t, -29),
|
|
318
|
+
to: t
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
key: "thisWeek",
|
|
322
|
+
label: "This Week",
|
|
323
|
+
from: o,
|
|
324
|
+
to: L(o, 6)
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
key: "lastWeek",
|
|
328
|
+
label: "Last Week",
|
|
329
|
+
from: s,
|
|
330
|
+
to: L(s, 6)
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
key: "thisMonth",
|
|
334
|
+
label: "This Month",
|
|
335
|
+
from: z(t),
|
|
336
|
+
to: B(t)
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
key: "lastMonth",
|
|
340
|
+
label: "Last Month",
|
|
341
|
+
from: z(c),
|
|
342
|
+
to: B(c)
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
key: "thisQuarter",
|
|
346
|
+
label: "This Quarter",
|
|
347
|
+
from: l.from,
|
|
348
|
+
to: l.to
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
key: "lastQuarter",
|
|
352
|
+
label: "Last Quarter",
|
|
353
|
+
from: u.from,
|
|
354
|
+
to: u.to
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
key: "thisFY",
|
|
358
|
+
label: "This FY",
|
|
359
|
+
from: i.from,
|
|
360
|
+
to: i.to
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
key: "lastFY",
|
|
364
|
+
label: "Last FY",
|
|
365
|
+
from: a.from,
|
|
366
|
+
to: a.to
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
key: "ytd",
|
|
370
|
+
label: "Year to date",
|
|
371
|
+
from: i.from,
|
|
372
|
+
to: t
|
|
373
|
+
}
|
|
374
|
+
];
|
|
375
|
+
return e.only ? e.only.map((e) => d.find((t) => t.key === e)).filter((e) => !!e) : d;
|
|
376
|
+
}
|
|
377
|
+
function ve(e, t) {
|
|
378
|
+
let n = String(t ?? "").trim().toLowerCase();
|
|
379
|
+
return n ? e.filter((e) => e.label.toLowerCase().includes(n)) : e;
|
|
380
|
+
}
|
|
381
|
+
function ye(e, t, n = {}) {
|
|
382
|
+
let r = F(e);
|
|
383
|
+
if (!r) return z(P());
|
|
384
|
+
let i = Math.max(1, Math.trunc(n.months ?? 1)), a = n.currentMonthSide ?? "right", o = z(r), s = z(F(t) || r), c = N(o), l = N(s), u = (l.y - c.y) * 12 + (l.m - c.m) + 1;
|
|
385
|
+
return a === "right" ? R(u <= i ? s : o, -(i - 1)) : o;
|
|
386
|
+
}
|
|
387
|
+
function be(e, t) {
|
|
388
|
+
let n = F(t);
|
|
389
|
+
if (!n) return {
|
|
390
|
+
from: F(e?.from),
|
|
391
|
+
to: F(e?.to)
|
|
392
|
+
};
|
|
393
|
+
let r = F(e?.from), i = F(e?.to);
|
|
394
|
+
return r ? n === r && n === i ? {
|
|
395
|
+
from: "",
|
|
396
|
+
to: ""
|
|
397
|
+
} : n === r || n === i ? {
|
|
398
|
+
from: n,
|
|
399
|
+
to: n
|
|
400
|
+
} : I(n, r) < 0 ? {
|
|
401
|
+
from: n,
|
|
402
|
+
to: i || r
|
|
403
|
+
} : {
|
|
404
|
+
from: r,
|
|
405
|
+
to: n
|
|
406
|
+
} : {
|
|
407
|
+
from: n,
|
|
408
|
+
to: n
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region ../../shared-logic/src/ui/timeField.logic.ts
|
|
413
|
+
var xe = (e) => e < 10 ? `0${e}` : String(e), Se = 1440;
|
|
414
|
+
function Ce(e) {
|
|
415
|
+
let t = /^(\d{1,2}):(\d{2})$/.exec(String(e ?? "").trim());
|
|
416
|
+
if (!t) return -1;
|
|
417
|
+
let n = Number(t[1]), r = Number(t[2]);
|
|
418
|
+
return n > 23 || r > 59 ? -1 : n * 60 + r;
|
|
419
|
+
}
|
|
420
|
+
function we(e) {
|
|
421
|
+
if (!Number.isFinite(e)) return "";
|
|
422
|
+
let t = (Math.round(e) % Se + Se) % Se;
|
|
423
|
+
return `${xe(Math.floor(t / 60))}:${xe(t % 60)}`;
|
|
424
|
+
}
|
|
425
|
+
function Te(e) {
|
|
426
|
+
let t = (e % 24 + 24) % 24, n = t < 12 ? "AM" : "PM";
|
|
427
|
+
return {
|
|
428
|
+
h12: t % 12 == 0 ? 12 : t % 12,
|
|
429
|
+
meridiem: n
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
function Ee(e, t) {
|
|
433
|
+
let n = e % 12;
|
|
434
|
+
return t === "PM" ? n + 12 : n;
|
|
435
|
+
}
|
|
436
|
+
function De(e, t = !0) {
|
|
437
|
+
let n = Ce(e);
|
|
438
|
+
if (n < 0) return "";
|
|
439
|
+
let r = Math.floor(n / 60), i = n % 60;
|
|
440
|
+
if (!t) return `${xe(r)}:${xe(i)}`;
|
|
441
|
+
let { h12: a, meridiem: o } = Te(r);
|
|
442
|
+
return `${xe(a)}:${xe(i)} ${o}`;
|
|
443
|
+
}
|
|
444
|
+
var Oe = (e = !0) => e ? "hh:mm am" : "hh:mm", ke = /([ap])\.?\s*m?\.?\s*$/i;
|
|
445
|
+
function Ae(e, t = {}) {
|
|
446
|
+
let n = String(e ?? "").trim().toLowerCase();
|
|
447
|
+
if (!n) return null;
|
|
448
|
+
if (n === "noon" || n === "midday") return "12:00";
|
|
449
|
+
if (n === "midnight") return "00:00";
|
|
450
|
+
let r = Ce(t.within || ""), i = r >= 0 ? r % 60 : 0, a = ke.exec(n), o = a ? a[1] === "a" ? "AM" : "PM" : "", s = (a ? n.slice(0, a.index) : n).trim();
|
|
451
|
+
if (/[^0-9]$/.test(s)) return null;
|
|
452
|
+
let c = s.split(/[^0-9]+/).filter(Boolean);
|
|
453
|
+
if (!c.length || c.length > 2) return null;
|
|
454
|
+
let l = "", u = "";
|
|
455
|
+
if (c.length === 2) {
|
|
456
|
+
if (c[0].length > 2 || c[1].length > 2) return null;
|
|
457
|
+
l = c[0], u = c[1];
|
|
458
|
+
} else {
|
|
459
|
+
let e = c[0];
|
|
460
|
+
if (e.length <= 2) l = e;
|
|
461
|
+
else if (e.length === 3) l = e.slice(0, 1), u = e.slice(1);
|
|
462
|
+
else if (e.length === 4) l = e.slice(0, 2), u = e.slice(2);
|
|
463
|
+
else return null;
|
|
464
|
+
}
|
|
465
|
+
let d = Number(l), f = u ? Number(u) : i;
|
|
466
|
+
if (f > 59) return null;
|
|
467
|
+
if (o) {
|
|
468
|
+
if (d < 1 || d > 12) return null;
|
|
469
|
+
d = Ee(d, o);
|
|
470
|
+
} else if (d > 23) return null;
|
|
471
|
+
return `${xe(d)}:${xe(f)}`;
|
|
472
|
+
}
|
|
473
|
+
function J(e, t = {}) {
|
|
474
|
+
let n = t.hour12 ?? !0, r = Math.min(30, Math.max(1, Math.round(t.minuteStep ?? 5))), i = n ? [
|
|
475
|
+
12,
|
|
476
|
+
1,
|
|
477
|
+
2,
|
|
478
|
+
3,
|
|
479
|
+
4,
|
|
480
|
+
5,
|
|
481
|
+
6,
|
|
482
|
+
7,
|
|
483
|
+
8,
|
|
484
|
+
9,
|
|
485
|
+
10,
|
|
486
|
+
11
|
|
487
|
+
] : Array.from({ length: 24 }, (e, t) => t), a = [];
|
|
488
|
+
for (let e = 0; e < 60; e += r) a.push(e);
|
|
489
|
+
let o = Ce(e);
|
|
490
|
+
if (o >= 0) {
|
|
491
|
+
let e = o % 60;
|
|
492
|
+
a.includes(e) || a.push(e), a.sort((e, t) => e - t);
|
|
493
|
+
}
|
|
494
|
+
return {
|
|
495
|
+
hours: i,
|
|
496
|
+
minutes: a,
|
|
497
|
+
meridiems: n ? ["AM", "PM"] : []
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
function je(e, t, n, r = !0) {
|
|
501
|
+
let i = Math.max(0, Ce(e)), a = Math.floor(i / 60), o = i % 60;
|
|
502
|
+
return t === "minute" ? o = Math.min(59, Math.max(0, Number(n))) : a = t === "meridiem" ? Ee(Te(a).h12, n) : r ? Ee(Number(n), Te(a).meridiem) : Math.min(23, Math.max(0, Number(n))), `${xe(a)}:${xe(o)}`;
|
|
503
|
+
}
|
|
504
|
+
function Me(e, t, n, r = !0) {
|
|
505
|
+
let i = Ce(e);
|
|
506
|
+
if (i < 0) return !1;
|
|
507
|
+
let a = Math.floor(i / 60);
|
|
508
|
+
return t === "minute" ? i % 60 === Number(n) : t === "meridiem" ? Te(a).meridiem === n : r ? Te(a).h12 === Number(n) : a === Number(n);
|
|
509
|
+
}
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region ../../shared-logic/src/ui/popupList.logic.ts
|
|
512
|
+
var Ne = (e) => e === "outlined" || e === "filled";
|
|
513
|
+
function Pe(e) {
|
|
514
|
+
return [
|
|
515
|
+
"popup",
|
|
516
|
+
`size_${e.size}`,
|
|
517
|
+
Ne(e.variant) ? "joined" : "floating"
|
|
518
|
+
];
|
|
519
|
+
}
|
|
520
|
+
function Fe(e) {
|
|
521
|
+
let t = ["row"];
|
|
522
|
+
return e.isCursor && t.push("rowCursor"), e.isSelected && t.push("rowSelected"), e.isDisabled && t.push("rowDisabled"), e.isMulti && t.push("rowMulti"), t;
|
|
523
|
+
}
|
|
524
|
+
var Ie = "";
|
|
525
|
+
function Le(e, t) {
|
|
526
|
+
if (!t?.enabled) return [{
|
|
527
|
+
name: Ie,
|
|
528
|
+
options: e
|
|
529
|
+
}];
|
|
530
|
+
let n = (e) => {
|
|
531
|
+
let n = t.groupBy;
|
|
532
|
+
if (typeof n == "function") return n(e) || Ie;
|
|
533
|
+
if (typeof n == "string") {
|
|
534
|
+
let t = e[n] ?? (e.metadata || {})[n];
|
|
535
|
+
return t == null ? Ie : String(t);
|
|
536
|
+
}
|
|
537
|
+
return e.group || Ie;
|
|
538
|
+
}, r = /* @__PURE__ */ new Map();
|
|
539
|
+
e.forEach((e) => {
|
|
540
|
+
let t = n(e), i = r.get(t);
|
|
541
|
+
i ? i.push(e) : r.set(t, [e]);
|
|
542
|
+
});
|
|
543
|
+
let i = Array.from(r.keys()), a = t.groupOrder;
|
|
544
|
+
if (Array.isArray(a)) {
|
|
545
|
+
let e = a.filter((e) => r.has(e));
|
|
546
|
+
i = [...e, ...i.filter((t) => !e.includes(t))];
|
|
547
|
+
} else typeof a == "function" && (i = [...i].sort(a));
|
|
548
|
+
return i = i.sort((e, t) => e === Ie ? -1 : +(t === Ie)), i.map((e) => ({
|
|
549
|
+
name: e,
|
|
550
|
+
options: r.get(e) || []
|
|
551
|
+
}));
|
|
552
|
+
}
|
|
553
|
+
//#endregion
|
|
554
|
+
//#region ../../shared-logic/src/ui/fieldControl.logic.ts
|
|
555
|
+
var Re = ({ size: e = "medium", variant: t = "outlined", error: n = !1, disabled: r = !1, readOnly: i = !1, hasAffix: a = !1, popupOpen: o = !1 }) => {
|
|
556
|
+
let s = [
|
|
557
|
+
"control",
|
|
558
|
+
`size_${e}`,
|
|
559
|
+
`variant_${t}`
|
|
560
|
+
];
|
|
561
|
+
return a && s.push("hasAffix"), o && Ne(t) && s.push("hasJoinedPopup"), n && s.push("isError"), r && s.push("isDisabled"), i && s.push("isReadOnly"), s;
|
|
562
|
+
};
|
|
563
|
+
function ze(e) {
|
|
564
|
+
let t = [
|
|
565
|
+
"xxs",
|
|
566
|
+
"xs",
|
|
567
|
+
"small",
|
|
568
|
+
"medium",
|
|
569
|
+
"large",
|
|
570
|
+
"xl"
|
|
571
|
+
], n = t.indexOf(e);
|
|
572
|
+
return n > 0 ? t[n - 1] : "xxs";
|
|
573
|
+
}
|
|
574
|
+
//#endregion
|
|
575
|
+
//#region ../../shared-logic/src/ui/fieldWrapper.logic.ts
|
|
576
|
+
function Be(e) {
|
|
577
|
+
let t = ["root"];
|
|
578
|
+
return e.layout !== "default" && t.push(`layout_${e.layout}`), e.size && e.size !== "medium" && t.push(`size_${e.size}`), e.disabled && t.push("disabled"), e.hasError && t.push("error"), t;
|
|
579
|
+
}
|
|
580
|
+
//#endregion
|
|
581
|
+
//#region ../../shared-logic/src/ui/input.logic.ts
|
|
582
|
+
function Ve(e) {
|
|
583
|
+
let t = [
|
|
584
|
+
"root",
|
|
585
|
+
`variant_${e.variant}`,
|
|
586
|
+
`size_${e.size}`
|
|
587
|
+
];
|
|
588
|
+
return e.disabled && t.push("disabled"), e.readOnly && t.push("readonly"), e.error && t.push("error"), e.multiline && t.push("multiline"), e.fullWidth && t.push("fullWidth"), t;
|
|
589
|
+
}
|
|
590
|
+
//#endregion
|
|
591
|
+
//#region ../../shared-logic/src/ui/keyboard.logic.ts
|
|
592
|
+
function He(e) {
|
|
593
|
+
let t = e.toLowerCase().split("+").map((e) => e.trim()).filter(Boolean);
|
|
594
|
+
e.trim().endsWith("+") && !t.includes("+") && t.push("+");
|
|
595
|
+
let n = [
|
|
596
|
+
"alt",
|
|
597
|
+
"ctrl",
|
|
598
|
+
"meta",
|
|
599
|
+
"shift"
|
|
600
|
+
], r = t.filter((e) => n.includes(e)), i = t.filter((e) => !n.includes(e)).join("+") || t[t.length - 1];
|
|
601
|
+
return [...r.sort(), Ue(i)].join("+");
|
|
602
|
+
}
|
|
603
|
+
function Ue(e) {
|
|
604
|
+
let t = e.toLowerCase();
|
|
605
|
+
return t === " " || t === "spacebar" ? "space" : t === "esc" ? "escape" : t === "del" ? "delete" : t === "up" ? "arrowup" : t === "down" ? "arrowdown" : t === "left" ? "arrowleft" : t === "right" ? "arrowright" : t;
|
|
606
|
+
}
|
|
607
|
+
function We(e) {
|
|
608
|
+
let t = [];
|
|
609
|
+
return e.altKey && t.push("alt"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.shiftKey && t.push("shift"), [...t.sort(), Ue(e.key)].join("+");
|
|
610
|
+
}
|
|
611
|
+
function Ge(e, t) {
|
|
612
|
+
return We(e) === He(t);
|
|
613
|
+
}
|
|
614
|
+
var Ke = {
|
|
615
|
+
"ctrl+enter": "newRow",
|
|
616
|
+
"ctrl+shift+enter": "copyRow",
|
|
617
|
+
"ctrl+delete": "deleteRow",
|
|
618
|
+
"ctrl+backspace": "deleteRow",
|
|
619
|
+
"alt+delete": "deleteRow",
|
|
620
|
+
"alt+backspace": "deleteRow",
|
|
621
|
+
"ctrl+home": "firstCellOfTable",
|
|
622
|
+
"ctrl+end": "lastCellOfTable",
|
|
623
|
+
"ctrl+arrowup": "up",
|
|
624
|
+
"ctrl+arrowdown": "down",
|
|
625
|
+
"ctrl+arrowleft": "left",
|
|
626
|
+
"ctrl+arrowright": "right",
|
|
627
|
+
"alt+arrowleft": "left",
|
|
628
|
+
"alt+arrowright": "right"
|
|
629
|
+
}, qe = { "ctrl+enter": "submit" }, Je = {
|
|
630
|
+
mode: "field",
|
|
631
|
+
enter: "submit",
|
|
632
|
+
arrows: "container",
|
|
633
|
+
arrowsInEdit: "cell",
|
|
634
|
+
typeBehaviour: "replace",
|
|
635
|
+
editKey: "Insert",
|
|
636
|
+
openOn: "focus",
|
|
637
|
+
advanceOnSelect: !1,
|
|
638
|
+
stepKeys: "none"
|
|
639
|
+
}, Ye = {
|
|
640
|
+
mode: "grid",
|
|
641
|
+
enter: "next",
|
|
642
|
+
openOn: "type"
|
|
643
|
+
}, Y = (e, t = !0) => ({
|
|
644
|
+
owner: "field",
|
|
645
|
+
action: e,
|
|
646
|
+
preventDefault: t
|
|
647
|
+
}), X = (e, t = !0) => ({
|
|
648
|
+
owner: "container",
|
|
649
|
+
action: e,
|
|
650
|
+
preventDefault: t
|
|
651
|
+
});
|
|
652
|
+
function Xe(e) {
|
|
653
|
+
return e.metaKey || e.ctrlKey && !e.altKey ? !1 : e.key.length === 1;
|
|
654
|
+
}
|
|
655
|
+
var Ze = (e) => e === "select" || e === "suggest" || e === "date", Qe = (e) => e === "date", $e = (e) => e === "text" || e === "number" || e === "textarea" || e === "suggest", et = (e) => e === "select" || e === "date";
|
|
656
|
+
function tt(e, t) {
|
|
657
|
+
let { widget: n, state: r } = t, i = {
|
|
658
|
+
...Je,
|
|
659
|
+
...t.config
|
|
660
|
+
}, a = i.mode === "grid", o = We(e), s = i.bindings?.[o] ?? (a ? Ke[o] : qe[o]);
|
|
661
|
+
if (s) return X(s);
|
|
662
|
+
if (n === "textarea" && Ge(e, "alt+enter")) return Y("insertNewline", !0);
|
|
663
|
+
if (r.isOpen && Ze(n)) switch (Ue(e.key)) {
|
|
664
|
+
case "arrowdown": return Y("highlightNext");
|
|
665
|
+
case "arrowup": return Y("highlightPrev");
|
|
666
|
+
case "home": return Y("highlightFirst");
|
|
667
|
+
case "end": return Y("highlightLast");
|
|
668
|
+
case "+":
|
|
669
|
+
if (!Qe(n)) break;
|
|
670
|
+
return Y("pick");
|
|
671
|
+
case "pageup":
|
|
672
|
+
case "pagedown":
|
|
673
|
+
if (!Qe(n)) break;
|
|
674
|
+
return Y(Ue(e.key) === "pageup" ? "highlightPrevPage" : "highlightNextPage");
|
|
675
|
+
case "enter":
|
|
676
|
+
if (r.hasOptions === !1) break;
|
|
677
|
+
return Y(r.multi ? "toggleOption" : "pick");
|
|
678
|
+
case "space": return n === "select" && !r.multi ? Y("pick") : n === "select" ? Y("toggleOption") : Y("native", !1);
|
|
679
|
+
case "arrowleft":
|
|
680
|
+
case "arrowright": {
|
|
681
|
+
let t = Ue(e.key) === "arrowleft";
|
|
682
|
+
return Qe(n) ? Y(t ? "highlightLeft" : "highlightRight") : i.arrows === "container" ? X(t ? "left" : "right") : Y("native", !1);
|
|
683
|
+
}
|
|
684
|
+
case "backspace":
|
|
685
|
+
case "delete": return Y("native", !1);
|
|
686
|
+
case "escape": return Y("close");
|
|
687
|
+
case "tab": return X(e.shiftKey ? "prev" : "next", !1);
|
|
688
|
+
default:
|
|
689
|
+
if (Xe(e)) return Y("native", !1);
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
if (!a) {
|
|
693
|
+
let t = Ue(e.key), a = i.enter !== "next";
|
|
694
|
+
return Ze(n) && !r.isOpen && (t === "enter" && a || t === "space" || Ge(e, "alt+arrowdown")) ? Y("open") : Ge(e, "alt+arrowdown") && Ze(n) ? Y(r.isOpen ? "close" : "open") : Ze(n) && !r.isOpen && (t === "arrowdown" || t === "arrowup") || Xe(e) && et(n) && !r.isOpen ? Y("open") : t === "enter" ? i.enter === "next" ? X(e.shiftKey ? "prev" : "next") : i.enter === "submit" ? X("submit", !1) : i.enter === "none" ? Y("native", !0) : Y("native", !1) : Y("native", !1);
|
|
695
|
+
}
|
|
696
|
+
if (r.mode === "edit") switch (Ue(e.key)) {
|
|
697
|
+
case "arrowleft":
|
|
698
|
+
case "arrowright": return Y("native", !1);
|
|
699
|
+
case "arrowup":
|
|
700
|
+
case "arrowdown": {
|
|
701
|
+
let t = Ue(e.key) === "arrowup";
|
|
702
|
+
return n === "number" && i.stepKeys === "arrows" ? Y(t ? "stepUp" : "stepDown") : n === "number" && i.stepKeys === "none" ? i.arrowsInEdit === "caret" ? Y("native", !0) : X(t ? "up" : "down") : n === "textarea" || i.arrowsInEdit === "caret" ? Y("native", !1) : X(t ? "up" : "down");
|
|
703
|
+
}
|
|
704
|
+
case "enter": return X(e.shiftKey ? "prev" : "next");
|
|
705
|
+
case "escape": return X("revert");
|
|
706
|
+
case "tab": return X(e.shiftKey ? "prev" : "next", !1);
|
|
707
|
+
case "home":
|
|
708
|
+
case "end": return Y("native", !1);
|
|
709
|
+
default: return Y("native", !1);
|
|
710
|
+
}
|
|
711
|
+
if (Ge(e, i.editKey)) return X("edit");
|
|
712
|
+
switch (Ue(e.key)) {
|
|
713
|
+
case "arrowleft": return i.arrows === "container" ? X("left") : Y("native", !1);
|
|
714
|
+
case "arrowright": return i.arrows === "container" ? X("right") : Y("native", !1);
|
|
715
|
+
case "arrowup":
|
|
716
|
+
case "arrowdown": {
|
|
717
|
+
let t = Ue(e.key) === "arrowup";
|
|
718
|
+
return n === "number" && i.stepKeys === "arrows" ? Y(t ? "stepUp" : "stepDown") : n === "number" && i.stepKeys === "none" && i.arrows !== "container" ? Y("native", !0) : Ze(n) && i.openOn !== "manual" && e.altKey ? Y("open") : i.arrows === "container" ? X(t ? "up" : "down") : Y("native", !1);
|
|
719
|
+
}
|
|
720
|
+
case "enter": return i.enter === "submit" ? X("submit", !1) : X(e.shiftKey ? "prev" : "next");
|
|
721
|
+
case "tab": return X(e.shiftKey ? "prev" : "next", !1);
|
|
722
|
+
case "space":
|
|
723
|
+
if (n === "toggle" || n === "button") return Y("native", !1);
|
|
724
|
+
if (Ze(n)) return Y("open");
|
|
725
|
+
break;
|
|
726
|
+
case "escape": return X("exitGrid");
|
|
727
|
+
case "home": return X("firstCell");
|
|
728
|
+
case "end": return X("lastCell");
|
|
729
|
+
case "pageup": return X("pageUp");
|
|
730
|
+
case "pagedown": return X("pageDown");
|
|
731
|
+
case "delete": return X("clear");
|
|
732
|
+
case "backspace": return Ze(n) ? X("clear") : X("edit");
|
|
733
|
+
default: break;
|
|
734
|
+
}
|
|
735
|
+
return Xe(e) && $e(n) ? Y("beginEdit", !1) : Xe(e) && et(n) ? Y("open") : Y("native", !1);
|
|
736
|
+
}
|
|
737
|
+
function nt(e, t, n, r = () => !1, i = !1) {
|
|
738
|
+
if (e <= 0) return -1;
|
|
739
|
+
let a = n === "forward" ? 1 : -1, o = t + a;
|
|
740
|
+
for (let t = 0; t < e; t++) {
|
|
741
|
+
if (o < 0 || o >= e) {
|
|
742
|
+
if (!i) return -1;
|
|
743
|
+
o = o < 0 ? e - 1 : 0;
|
|
744
|
+
}
|
|
745
|
+
if (!r(o)) return o;
|
|
746
|
+
o += a;
|
|
747
|
+
}
|
|
748
|
+
return -1;
|
|
749
|
+
}
|
|
750
|
+
function rt(e, t) {
|
|
751
|
+
return !e && !t ? {} : {
|
|
752
|
+
...t,
|
|
753
|
+
...e,
|
|
754
|
+
bindings: {
|
|
755
|
+
...t?.bindings,
|
|
756
|
+
...e?.bindings
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
//#endregion
|
|
761
|
+
//#region ../../shared-logic/src/ui/popover.logic.ts
|
|
762
|
+
var it = (e) => {
|
|
763
|
+
let [t, n] = e.split("-");
|
|
764
|
+
return [t, n ?? "center"];
|
|
765
|
+
}, at = {
|
|
766
|
+
top: "bottom",
|
|
767
|
+
bottom: "top",
|
|
768
|
+
left: "right",
|
|
769
|
+
right: "left"
|
|
770
|
+
}, ot = (e, t, n) => n < t ? t : Math.min(Math.max(e, t), n), st = (e, t, n, r, i, a) => {
|
|
771
|
+
switch (e) {
|
|
772
|
+
case "top": return t.top - i - n.height >= a;
|
|
773
|
+
case "bottom": return t.top + t.height + i + n.height <= r.height - a;
|
|
774
|
+
case "left": return t.left - i - n.width >= a;
|
|
775
|
+
case "right": return t.left + t.width + i + n.width <= r.width - a;
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
function ct(e) {
|
|
779
|
+
let { anchor: t, content: n, viewport: r, scroll: i, origin: a, placement: o = "bottom-start", offset: s = 4, matchAnchorWidth: c = !1, flip: l = !0, shift: u = !0, padding: d = 8 } = e, f = {
|
|
780
|
+
width: c ? t.width : n.width,
|
|
781
|
+
height: n.height
|
|
782
|
+
}, [p, m] = it(o), h = !1;
|
|
783
|
+
if (l && !st(p, t, f, r, s, d)) {
|
|
784
|
+
let e = at[p];
|
|
785
|
+
st(e, t, f, r, s, d) && (p = e, h = !0);
|
|
786
|
+
}
|
|
787
|
+
let g = p === "top" || p === "bottom", _, v;
|
|
788
|
+
g ? (_ = p === "bottom" ? t.top + t.height + s : t.top - f.height - s, v = m === "start" ? t.left : m === "end" ? t.left + t.width - f.width : t.left + (t.width - f.width) / 2) : (v = p === "right" ? t.left + t.width + s : t.left - f.width - s, _ = m === "start" ? t.top : m === "end" ? t.top + t.height - f.height : t.top + (t.height - f.height) / 2), u && (f.width > 0 || f.height > 0) && (g ? v = ot(v, d, r.width - f.width - d) : _ = ot(_, d, r.height - f.height - d));
|
|
789
|
+
let y = a ?? {
|
|
790
|
+
x: -(i?.x ?? 0),
|
|
791
|
+
y: -(i?.y ?? 0)
|
|
792
|
+
};
|
|
793
|
+
return {
|
|
794
|
+
top: _ - y.y,
|
|
795
|
+
left: v - y.x,
|
|
796
|
+
...c ? { width: t.width } : {},
|
|
797
|
+
placement: m === "center" ? p : `${p}-${m}`,
|
|
798
|
+
flipped: h
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
function lt(e, t) {
|
|
802
|
+
return e ? {
|
|
803
|
+
x: e.rect.left + e.clientLeft - e.scrollLeft,
|
|
804
|
+
y: e.rect.top + e.clientTop - e.scrollTop
|
|
805
|
+
} : {
|
|
806
|
+
x: -t.x,
|
|
807
|
+
y: -t.y
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
//#endregion
|
|
811
|
+
//#region ../../shared-logic/src/ui/select.logic.ts
|
|
812
|
+
function ut(e) {
|
|
813
|
+
let t = ["root", `size_${e.size}`];
|
|
814
|
+
return e.isOpen && t.push("open"), e.disabled && t.push("disabled"), e.error && t.push("error"), e.isInModal && t.push("inModal"), t;
|
|
815
|
+
}
|
|
816
|
+
function dt(e) {
|
|
817
|
+
return e.map((e) => typeof e == "string" ? {
|
|
818
|
+
name: e,
|
|
819
|
+
value: e
|
|
820
|
+
} : typeof e == "number" ? {
|
|
821
|
+
name: String(e),
|
|
822
|
+
value: e
|
|
823
|
+
} : {
|
|
824
|
+
...e,
|
|
825
|
+
name: e.name == null ? String(e.value ?? "") : String(e.name),
|
|
826
|
+
value: e.value ?? e.name
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
function ft(e, t) {
|
|
830
|
+
if (!t) return e;
|
|
831
|
+
let n = typeof t == "boolean" ? {
|
|
832
|
+
enabled: !0,
|
|
833
|
+
direction: "asc",
|
|
834
|
+
caseInsensitive: !0
|
|
835
|
+
} : t;
|
|
836
|
+
if (!n.enabled) return e;
|
|
837
|
+
let r = [...e];
|
|
838
|
+
return n.customSort ? r.sort(n.customSort) : r.sort((e, t) => {
|
|
839
|
+
let r = String(e.name), i = String(t.name), a = n.caseInsensitive ? r.toLowerCase() : r, o = n.caseInsensitive ? i.toLowerCase() : i, s = a.localeCompare(o);
|
|
840
|
+
return n.direction === "desc" ? -s : s;
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
function pt(e, t, n) {
|
|
844
|
+
if (!t) return e;
|
|
845
|
+
let r = typeof n == "boolean" ? { enabled: !0 } : n || { enabled: !0 };
|
|
846
|
+
if (!r.enabled) return e;
|
|
847
|
+
let i = r.caseSensitive ? t : t.toLowerCase();
|
|
848
|
+
return e.filter((e) => (r.caseSensitive ? e.name : e.name.toLowerCase()).includes(i) ? !0 : r.searchKeys && e.metadata ? r.searchKeys.some((t) => {
|
|
849
|
+
let n = e.metadata?.[t];
|
|
850
|
+
return n != null && (r.caseSensitive ? String(n) : String(n).toLowerCase()).includes(i);
|
|
851
|
+
}) : !1);
|
|
852
|
+
}
|
|
853
|
+
function mt(e, t, n) {
|
|
854
|
+
let r = String(t ?? "").trim().toLowerCase(), i = e.length;
|
|
855
|
+
if (!r || i === 0) return -1;
|
|
856
|
+
for (let t = 1; t <= i; t++) {
|
|
857
|
+
let a = ((n + t) % i + i) % i, o = e[a];
|
|
858
|
+
if (!o.disabled && String(o.name).toLowerCase().startsWith(r)) return a;
|
|
859
|
+
}
|
|
860
|
+
return -1;
|
|
861
|
+
}
|
|
862
|
+
//#endregion
|
|
863
|
+
//#region ../../shared-logic/src/ui/switch.logic.ts
|
|
864
|
+
function ht(e) {
|
|
865
|
+
let t = [
|
|
866
|
+
"root",
|
|
867
|
+
`label_${e.labelPosition}`,
|
|
868
|
+
`size_${e.size}`
|
|
869
|
+
];
|
|
870
|
+
return e.disabled && t.push("disabled"), e.readOnly && t.push("readonly"), e.loading && t.push("loading"), e.error && t.push("error"), e.fullWidth && t.push("fullWidth"), t;
|
|
871
|
+
}
|
|
872
|
+
function gt(e) {
|
|
873
|
+
let t = [
|
|
874
|
+
"wrapper",
|
|
875
|
+
`size_${e.size}`,
|
|
876
|
+
`color_${e.color}`
|
|
877
|
+
];
|
|
878
|
+
return e.pressed && t.push("pressed"), e.showFocusRing && t.push("showFocusRing"), e.animated && t.push("animated"), e.choiceMode && t.push("choiceMode"), t;
|
|
879
|
+
}
|
|
880
|
+
//#endregion
|
|
881
|
+
//#region ../../shared-web-ui/src/FieldContext/FieldContext.ts
|
|
882
|
+
var _t = c({});
|
|
883
|
+
_t.displayName = "FieldContext";
|
|
884
|
+
var vt = () => d(_t), yt = ({ size: e, variant: t, layout: n, disabled: r, readOnly: i, keyboard: a, children: o }) => {
|
|
885
|
+
let s = vt(), c = g(() => ({
|
|
886
|
+
size: e ?? s.size,
|
|
887
|
+
variant: t ?? s.variant,
|
|
888
|
+
layout: n ?? s.layout,
|
|
889
|
+
disabled: r ?? s.disabled,
|
|
890
|
+
readOnly: i ?? s.readOnly,
|
|
891
|
+
keyboard: a || s.keyboard ? {
|
|
892
|
+
...s.keyboard,
|
|
893
|
+
...a,
|
|
894
|
+
bindings: {
|
|
895
|
+
...s.keyboard?.bindings,
|
|
896
|
+
...a?.bindings
|
|
897
|
+
}
|
|
898
|
+
} : void 0
|
|
899
|
+
}), [
|
|
900
|
+
e,
|
|
901
|
+
t,
|
|
902
|
+
n,
|
|
903
|
+
r,
|
|
904
|
+
i,
|
|
905
|
+
a,
|
|
906
|
+
s.size,
|
|
907
|
+
s.variant,
|
|
908
|
+
s.layout,
|
|
909
|
+
s.disabled,
|
|
910
|
+
s.readOnly,
|
|
911
|
+
s.keyboard
|
|
912
|
+
]);
|
|
913
|
+
return /* @__PURE__ */ b(_t.Provider, {
|
|
914
|
+
value: c,
|
|
915
|
+
children: o
|
|
916
|
+
});
|
|
917
|
+
};
|
|
918
|
+
yt.displayName = "FieldProvider";
|
|
919
|
+
//#endregion
|
|
920
|
+
//#region ../../shared-types/src/ui/control.types.ts
|
|
921
|
+
var bt = "small";
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region ../../shared-web-ui/src/FieldContext/useFieldSurface.ts
|
|
924
|
+
function xt(e, t = {}) {
|
|
925
|
+
let n = vt(), { size: r, variant: i, layout: a, disabled: o, readOnly: s } = e, { variant: c = "outlined", layout: l = "horizontal" } = t;
|
|
926
|
+
return g(() => ({
|
|
927
|
+
size: r ?? n.size ?? "small",
|
|
928
|
+
variant: i ?? n.variant ?? c,
|
|
929
|
+
layout: a ?? n.layout ?? l,
|
|
930
|
+
disabled: o ?? n.disabled ?? !1,
|
|
931
|
+
readOnly: s ?? n.readOnly ?? !1
|
|
932
|
+
}), [
|
|
933
|
+
r,
|
|
934
|
+
i,
|
|
935
|
+
a,
|
|
936
|
+
o,
|
|
937
|
+
s,
|
|
938
|
+
n.size,
|
|
939
|
+
n.variant,
|
|
940
|
+
n.layout,
|
|
941
|
+
n.disabled,
|
|
942
|
+
n.readOnly,
|
|
943
|
+
c,
|
|
944
|
+
l
|
|
945
|
+
]);
|
|
946
|
+
}
|
|
947
|
+
function St(e, t = {}) {
|
|
948
|
+
let n = vt(), { size: r, variant: i, disabled: a, readOnly: o } = e, { variant: s = "filled" } = t, c = n.variant === "underlined" ? void 0 : n.variant;
|
|
949
|
+
return g(() => ({
|
|
950
|
+
size: r ?? n.size ?? "small",
|
|
951
|
+
variant: i ?? c ?? s,
|
|
952
|
+
disabled: a ?? n.disabled ?? !1,
|
|
953
|
+
readOnly: o ?? n.readOnly ?? !1
|
|
954
|
+
}), [
|
|
955
|
+
r,
|
|
956
|
+
i,
|
|
957
|
+
a,
|
|
958
|
+
o,
|
|
959
|
+
n.size,
|
|
960
|
+
c,
|
|
961
|
+
n.disabled,
|
|
962
|
+
n.readOnly,
|
|
963
|
+
s
|
|
964
|
+
]);
|
|
965
|
+
}
|
|
966
|
+
//#endregion
|
|
967
|
+
//#region ../../shared-web-ui/src/FieldContext/useField.ts
|
|
968
|
+
function Ct(e) {
|
|
969
|
+
let { widget: t, elementRef: n, keyboard: r, onFocus: i, onBlur: a, onKeyDown: o, open: s, defaultOpen: c = !1, onOpenChange: l, hasOptions: d, multi: m, rowIndex: h, cellindex: y, onCellFocus: b, registerCellRef: x, id: S, onFieldAction: C, onRevert: w, onClear: T, surfaceDefaults: E, surfaceKind: D = "control", ...O } = e, k = vt(), A = xt(O, E), j = St({
|
|
970
|
+
size: O.size,
|
|
971
|
+
variant: O.variant,
|
|
972
|
+
disabled: O.disabled,
|
|
973
|
+
readOnly: O.readOnly
|
|
974
|
+
}), M = D === "toggle" ? j : A, N = g(() => rt(r, k.keyboard), [r, k.keyboard]), P = N.mode === "grid", F = p(), I = S || F, L = g(() => ({
|
|
975
|
+
field: I,
|
|
976
|
+
label: `${I}-label`,
|
|
977
|
+
message: `${I}-message`
|
|
978
|
+
}), [I]), [R, ee] = v(P ? "navigate" : "edit");
|
|
979
|
+
f(() => {
|
|
980
|
+
P || ee("edit");
|
|
981
|
+
}, [P]);
|
|
982
|
+
let [z, B] = v(c), V = s ?? z, H = u((e, t = "programmatic") => {
|
|
983
|
+
s === void 0 && B(e), l?.(e, t);
|
|
984
|
+
}, [s, l]), te = u(() => {
|
|
985
|
+
let e = n.current;
|
|
986
|
+
e && typeof e.select == "function" && e.select();
|
|
987
|
+
}, [n]), U = u((e) => {
|
|
988
|
+
ee("edit");
|
|
989
|
+
let r = n.current;
|
|
990
|
+
if (r) {
|
|
991
|
+
if (e === void 0 && typeof r.setSelectionRange == "function") {
|
|
992
|
+
let e = r.value?.length ?? 0;
|
|
993
|
+
try {
|
|
994
|
+
r.setSelectionRange(e, e);
|
|
995
|
+
} catch {}
|
|
996
|
+
}
|
|
997
|
+
N.openOn === "type" && (t === "select" || t === "suggest" && e === void 0) && H(!0, "type");
|
|
998
|
+
}
|
|
999
|
+
}, [
|
|
1000
|
+
n,
|
|
1001
|
+
N.openOn,
|
|
1002
|
+
t,
|
|
1003
|
+
H
|
|
1004
|
+
]), W = u((e) => {
|
|
1005
|
+
e || w?.(), V && H(!1, e ? "select" : "escape"), ee("navigate"), te();
|
|
1006
|
+
}, [
|
|
1007
|
+
V,
|
|
1008
|
+
H,
|
|
1009
|
+
w,
|
|
1010
|
+
te
|
|
1011
|
+
]), G = _(null), ne = g(() => ({
|
|
1012
|
+
focus(e) {
|
|
1013
|
+
let t = n.current;
|
|
1014
|
+
if (t?.focus(), e?.select) te();
|
|
1015
|
+
else if (e?.caret) {
|
|
1016
|
+
let n = t;
|
|
1017
|
+
if (n && typeof n.setSelectionRange == "function") {
|
|
1018
|
+
let t = e.caret === "start" ? 0 : n.value?.length ?? 0;
|
|
1019
|
+
try {
|
|
1020
|
+
n.setSelectionRange(t, t);
|
|
1021
|
+
} catch {}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
},
|
|
1025
|
+
blur() {
|
|
1026
|
+
n.current?.blur();
|
|
1027
|
+
},
|
|
1028
|
+
beginEdit: U,
|
|
1029
|
+
endEdit: W,
|
|
1030
|
+
openPopup(e = "programmatic") {
|
|
1031
|
+
H(!0, e);
|
|
1032
|
+
},
|
|
1033
|
+
closePopup(e = "programmatic") {
|
|
1034
|
+
H(!1, e);
|
|
1035
|
+
},
|
|
1036
|
+
get isOpen() {
|
|
1037
|
+
return V;
|
|
1038
|
+
},
|
|
1039
|
+
get element() {
|
|
1040
|
+
return n.current;
|
|
1041
|
+
}
|
|
1042
|
+
}), [
|
|
1043
|
+
n,
|
|
1044
|
+
te,
|
|
1045
|
+
U,
|
|
1046
|
+
W,
|
|
1047
|
+
H,
|
|
1048
|
+
V
|
|
1049
|
+
]);
|
|
1050
|
+
G.current = ne, f(() => {
|
|
1051
|
+
if (!(!x || typeof h != "number" || typeof y != "number")) return x(h, y, G.current), () => x(h, y, null);
|
|
1052
|
+
}, [
|
|
1053
|
+
x,
|
|
1054
|
+
h,
|
|
1055
|
+
y
|
|
1056
|
+
]);
|
|
1057
|
+
let re = u((e) => {
|
|
1058
|
+
b && typeof h == "number" && typeof y == "number" && b(h, y), P && (ee("navigate"), te()), N.openOn === "focus" && !P && (t === "select" || t === "suggest") && H(!0, "focus"), i?.(e);
|
|
1059
|
+
}, [
|
|
1060
|
+
b,
|
|
1061
|
+
h,
|
|
1062
|
+
y,
|
|
1063
|
+
P,
|
|
1064
|
+
te,
|
|
1065
|
+
N.openOn,
|
|
1066
|
+
t,
|
|
1067
|
+
H,
|
|
1068
|
+
i
|
|
1069
|
+
]), K = u((e) => {
|
|
1070
|
+
V && H(!1, "blur"), P && ee("navigate"), a?.(e);
|
|
1071
|
+
}, [
|
|
1072
|
+
V,
|
|
1073
|
+
H,
|
|
1074
|
+
P,
|
|
1075
|
+
a
|
|
1076
|
+
]), ie = u((e) => {
|
|
1077
|
+
if (e.button !== 0) return;
|
|
1078
|
+
let t = n.current, r = e.target;
|
|
1079
|
+
!t || !r || r === t || r.closest("button, a, input, textarea, select, [role=\"button\"], [contenteditable=\"true\"]") || (e.preventDefault(), t.focus());
|
|
1080
|
+
}, [n]);
|
|
1081
|
+
return {
|
|
1082
|
+
surface: M,
|
|
1083
|
+
keyboard: N,
|
|
1084
|
+
mode: R,
|
|
1085
|
+
isOpen: V,
|
|
1086
|
+
setOpen: H,
|
|
1087
|
+
ids: L,
|
|
1088
|
+
handlers: {
|
|
1089
|
+
onFocus: re,
|
|
1090
|
+
onBlur: K,
|
|
1091
|
+
onKeyDown: u((e) => {
|
|
1092
|
+
let n = tt(e, {
|
|
1093
|
+
widget: t,
|
|
1094
|
+
state: {
|
|
1095
|
+
mode: R,
|
|
1096
|
+
isOpen: V,
|
|
1097
|
+
hasOptions: d,
|
|
1098
|
+
multi: m
|
|
1099
|
+
},
|
|
1100
|
+
config: N
|
|
1101
|
+
});
|
|
1102
|
+
if (n.preventDefault && e.preventDefault(), n.owner === "container") {
|
|
1103
|
+
switch (V && n.action !== "edit" && H(!1, "blur"), n.action) {
|
|
1104
|
+
case "edit":
|
|
1105
|
+
U();
|
|
1106
|
+
break;
|
|
1107
|
+
case "revert":
|
|
1108
|
+
W(!1);
|
|
1109
|
+
break;
|
|
1110
|
+
case "clear":
|
|
1111
|
+
T?.();
|
|
1112
|
+
break;
|
|
1113
|
+
default: break;
|
|
1114
|
+
}
|
|
1115
|
+
N.onNavigate?.(n.action, e);
|
|
1116
|
+
} else switch (n.action) {
|
|
1117
|
+
case "beginEdit":
|
|
1118
|
+
U(e.key);
|
|
1119
|
+
break;
|
|
1120
|
+
case "open":
|
|
1121
|
+
H(!0, "key"), C?.("open", e);
|
|
1122
|
+
break;
|
|
1123
|
+
case "close":
|
|
1124
|
+
H(!1, "escape");
|
|
1125
|
+
break;
|
|
1126
|
+
default:
|
|
1127
|
+
C?.(n.action, e);
|
|
1128
|
+
break;
|
|
1129
|
+
}
|
|
1130
|
+
o?.(e);
|
|
1131
|
+
}, [
|
|
1132
|
+
R,
|
|
1133
|
+
V,
|
|
1134
|
+
d,
|
|
1135
|
+
m,
|
|
1136
|
+
t,
|
|
1137
|
+
N,
|
|
1138
|
+
U,
|
|
1139
|
+
W,
|
|
1140
|
+
T,
|
|
1141
|
+
H,
|
|
1142
|
+
C,
|
|
1143
|
+
o
|
|
1144
|
+
]),
|
|
1145
|
+
onMouseDown: ie
|
|
1146
|
+
},
|
|
1147
|
+
handle: ne,
|
|
1148
|
+
beginEdit: U,
|
|
1149
|
+
endEdit: W
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
//#endregion
|
|
1153
|
+
//#region ../../shared-web-ui/src/FieldContext/useFormKeyboard.ts
|
|
1154
|
+
var wt = [
|
|
1155
|
+
"input:not([type=\"hidden\"])",
|
|
1156
|
+
"textarea",
|
|
1157
|
+
"select",
|
|
1158
|
+
"[contenteditable=\"true\"]",
|
|
1159
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
1160
|
+
].join(",");
|
|
1161
|
+
function Tt(e) {
|
|
1162
|
+
if (e.hidden || e.closest("[hidden]")) return !1;
|
|
1163
|
+
let t = e.ownerDocument?.defaultView;
|
|
1164
|
+
if (!t?.getComputedStyle) return !0;
|
|
1165
|
+
let n = t.getComputedStyle(e);
|
|
1166
|
+
return n.display !== "none" && n.visibility !== "hidden";
|
|
1167
|
+
}
|
|
1168
|
+
function Et(e) {
|
|
1169
|
+
return e ? Array.from(e.querySelectorAll(wt)).filter((e) => e.hasAttribute("disabled") || e.getAttribute("aria-hidden") === "true" ? !1 : Tt(e)) : [];
|
|
1170
|
+
}
|
|
1171
|
+
function Dt({ formRef: e, enter: t = "submit", onSubmit: n, keyboard: r }) {
|
|
1172
|
+
let i = u((t) => {
|
|
1173
|
+
let n = Et(e.current), r = n.indexOf(document.activeElement);
|
|
1174
|
+
if (r === -1) return !1;
|
|
1175
|
+
let i = nt(n.length, r, t);
|
|
1176
|
+
if (i === -1) return !1;
|
|
1177
|
+
let a = n[i];
|
|
1178
|
+
return a.focus(), typeof a.select == "function" && a.select(), !0;
|
|
1179
|
+
}, [e]), a = u((e) => {
|
|
1180
|
+
switch (e) {
|
|
1181
|
+
case "next":
|
|
1182
|
+
i("forward") || n?.();
|
|
1183
|
+
break;
|
|
1184
|
+
case "prev":
|
|
1185
|
+
i("backward");
|
|
1186
|
+
break;
|
|
1187
|
+
case "submit":
|
|
1188
|
+
n?.();
|
|
1189
|
+
break;
|
|
1190
|
+
default: break;
|
|
1191
|
+
}
|
|
1192
|
+
}, [i, n]);
|
|
1193
|
+
return g(() => ({
|
|
1194
|
+
enter: t,
|
|
1195
|
+
...r,
|
|
1196
|
+
onNavigate: a
|
|
1197
|
+
}), [
|
|
1198
|
+
t,
|
|
1199
|
+
r,
|
|
1200
|
+
a
|
|
1201
|
+
]);
|
|
1202
|
+
}
|
|
1203
|
+
var Ot = {
|
|
1204
|
+
content: "_content_12m0f_6",
|
|
1205
|
+
contentWithHelp: "_contentWithHelp_12m0f_19",
|
|
1206
|
+
labelRow: "_labelRow_12m0f_30",
|
|
1207
|
+
label: "_label_12m0f_30",
|
|
1208
|
+
required: "_required_12m0f_44",
|
|
1209
|
+
root: "_root_12m0f_50",
|
|
1210
|
+
error: "_error_12m0f_55",
|
|
1211
|
+
disabled: "_disabled_12m0f_61",
|
|
1212
|
+
size_xxs: "_size_xxs_12m0f_68",
|
|
1213
|
+
size_xs: "_size_xs_12m0f_69",
|
|
1214
|
+
size_small: "_size_small_12m0f_70",
|
|
1215
|
+
size_medium: "_size_medium_12m0f_71",
|
|
1216
|
+
size_large: "_size_large_12m0f_72",
|
|
1217
|
+
size_xl: "_size_xl_12m0f_73",
|
|
1218
|
+
messages: "_messages_12m0f_77",
|
|
1219
|
+
message: "_message_12m0f_77",
|
|
1220
|
+
errorMsg: "_errorMsg_12m0f_91",
|
|
1221
|
+
hintMsg: "_hintMsg_12m0f_103",
|
|
1222
|
+
layout_horizontal: "_layout_horizontal_12m0f_109",
|
|
1223
|
+
layout_cell: "_layout_cell_12m0f_197"
|
|
1224
|
+
}, kt = l(({ label: t, error: n, hint: r, required: a = !1, size: o, layout: s, className: c = "", labelClassName: l = "", style: u, disabled: d, children: f, extraMessages: p, labelId: m, labelFor: h, messageId: _, tooltip: v, tooltipTrigger: y = "icon" }, S) => {
|
|
1225
|
+
let { size: C, layout: w, disabled: T } = xt({
|
|
1226
|
+
size: o,
|
|
1227
|
+
layout: s,
|
|
1228
|
+
disabled: d
|
|
1229
|
+
}, { layout: "horizontal" }), E = w === "cell", D = e(E ? n ? {
|
|
1230
|
+
content: n,
|
|
1231
|
+
placement: "bottom",
|
|
1232
|
+
delay: 0
|
|
1233
|
+
} : v : y === "control" ? v : void 0), O = !E && y === "icon" && v ? /* @__PURE__ */ b(i, { tooltip: v }) : null, k = g(() => {
|
|
1234
|
+
let e = Be({
|
|
1235
|
+
layout: w,
|
|
1236
|
+
size: C,
|
|
1237
|
+
disabled: T,
|
|
1238
|
+
hasError: !!n
|
|
1239
|
+
}).map((e) => Ot[e]).filter(Boolean);
|
|
1240
|
+
return c && e.push(c), e.join(" ");
|
|
1241
|
+
}, [
|
|
1242
|
+
w,
|
|
1243
|
+
C,
|
|
1244
|
+
T,
|
|
1245
|
+
n,
|
|
1246
|
+
c
|
|
1247
|
+
]), A = g(() => {
|
|
1248
|
+
let e = [Ot.label];
|
|
1249
|
+
return l && e.push(l), e.join(" ");
|
|
1250
|
+
}, [l]);
|
|
1251
|
+
return /* @__PURE__ */ x("div", {
|
|
1252
|
+
ref: S,
|
|
1253
|
+
className: k,
|
|
1254
|
+
style: u,
|
|
1255
|
+
children: [
|
|
1256
|
+
t && !E && /* @__PURE__ */ x("div", {
|
|
1257
|
+
className: Ot.labelRow,
|
|
1258
|
+
children: [/* @__PURE__ */ x("label", {
|
|
1259
|
+
id: m,
|
|
1260
|
+
htmlFor: h,
|
|
1261
|
+
className: A,
|
|
1262
|
+
children: [t, a && /* @__PURE__ */ b("span", {
|
|
1263
|
+
className: Ot.required,
|
|
1264
|
+
children: "*"
|
|
1265
|
+
})]
|
|
1266
|
+
}), O]
|
|
1267
|
+
}),
|
|
1268
|
+
/* @__PURE__ */ x("div", {
|
|
1269
|
+
className: O && !t ? `${Ot.content} ${Ot.contentWithHelp}` : Ot.content,
|
|
1270
|
+
...D.triggerProps,
|
|
1271
|
+
children: [
|
|
1272
|
+
f,
|
|
1273
|
+
!t && O,
|
|
1274
|
+
D.tooltipNode
|
|
1275
|
+
]
|
|
1276
|
+
}),
|
|
1277
|
+
!E && (n || r || p) && /* @__PURE__ */ x("div", {
|
|
1278
|
+
className: Ot.messages,
|
|
1279
|
+
id: _,
|
|
1280
|
+
children: [n ? /* @__PURE__ */ b("div", {
|
|
1281
|
+
className: `${Ot.message} ${Ot.errorMsg}`,
|
|
1282
|
+
children: n
|
|
1283
|
+
}) : r ? /* @__PURE__ */ b("div", {
|
|
1284
|
+
className: `${Ot.message} ${Ot.hintMsg}`,
|
|
1285
|
+
children: r
|
|
1286
|
+
}) : null, p]
|
|
1287
|
+
})
|
|
1288
|
+
]
|
|
1289
|
+
});
|
|
1290
|
+
});
|
|
1291
|
+
kt.displayName = "FieldWrapper";
|
|
1292
|
+
//#endregion
|
|
1293
|
+
//#region ../../shared-web-ui/src/Checkbox/CheckboxGroupContext.ts
|
|
1294
|
+
var At = c(null);
|
|
1295
|
+
function jt() {
|
|
1296
|
+
return d(At);
|
|
1297
|
+
}
|
|
1298
|
+
var Mt = {
|
|
1299
|
+
root: "_root_x3ba2_5",
|
|
1300
|
+
fullWidth: "_fullWidth_x3ba2_14",
|
|
1301
|
+
disabled: "_disabled_x3ba2_19",
|
|
1302
|
+
readonly: "_readonly_x3ba2_24",
|
|
1303
|
+
label_end: "_label_end_x3ba2_30",
|
|
1304
|
+
label_start: "_label_start_x3ba2_31",
|
|
1305
|
+
label_top: "_label_top_x3ba2_32",
|
|
1306
|
+
label_bottom: "_label_bottom_x3ba2_33",
|
|
1307
|
+
wrapper: "_wrapper_x3ba2_37",
|
|
1308
|
+
input: "_input_x3ba2_53",
|
|
1309
|
+
box: "_box_x3ba2_67",
|
|
1310
|
+
size_xxs: "_size_xxs_x3ba2_86",
|
|
1311
|
+
size_xs: "_size_xs_x3ba2_87",
|
|
1312
|
+
size_small: "_size_small_x3ba2_88",
|
|
1313
|
+
size_medium: "_size_medium_x3ba2_89",
|
|
1314
|
+
size_large: "_size_large_x3ba2_90",
|
|
1315
|
+
size_xl: "_size_xl_x3ba2_91",
|
|
1316
|
+
showFocusRing: "_showFocusRing_x3ba2_141",
|
|
1317
|
+
checkboxHaloPulse: "_checkboxHaloPulse_x3ba2_1",
|
|
1318
|
+
variant_filled: "_variant_filled_x3ba2_174",
|
|
1319
|
+
variant_outlined: "_variant_outlined_x3ba2_191",
|
|
1320
|
+
variant_cell: "_variant_cell_x3ba2_192",
|
|
1321
|
+
icon: "_icon_x3ba2_209",
|
|
1322
|
+
variant_standard: "_variant_standard_x3ba2_216",
|
|
1323
|
+
color_primary: "_color_primary_x3ba2_237",
|
|
1324
|
+
color_secondary: "_color_secondary_x3ba2_238",
|
|
1325
|
+
color_success: "_color_success_x3ba2_239",
|
|
1326
|
+
color_error: "_color_error_x3ba2_240",
|
|
1327
|
+
color_warning: "_color_warning_x3ba2_241",
|
|
1328
|
+
color_info: "_color_info_x3ba2_242",
|
|
1329
|
+
pressed: "_pressed_x3ba2_278",
|
|
1330
|
+
ripple: "_ripple_x3ba2_304",
|
|
1331
|
+
checkboxRipple: "_checkboxRipple_x3ba2_1",
|
|
1332
|
+
label: "_label_x3ba2_30",
|
|
1333
|
+
required: "_required_x3ba2_345",
|
|
1334
|
+
error: "_error_x3ba2_356",
|
|
1335
|
+
group: "_group_x3ba2_361",
|
|
1336
|
+
orientation_horizontal: "_orientation_horizontal_x3ba2_367",
|
|
1337
|
+
groupLabel: "_groupLabel_x3ba2_373",
|
|
1338
|
+
groupDisabled: "_groupDisabled_x3ba2_380",
|
|
1339
|
+
groupItems: "_groupItems_x3ba2_382",
|
|
1340
|
+
groupHelper: "_groupHelper_x3ba2_394",
|
|
1341
|
+
groupError: "_groupError_x3ba2_400"
|
|
1342
|
+
}, Nt = () => /* @__PURE__ */ b("svg", {
|
|
1343
|
+
viewBox: "0 0 24 24",
|
|
1344
|
+
fill: "none",
|
|
1345
|
+
stroke: "currentColor",
|
|
1346
|
+
strokeWidth: "3",
|
|
1347
|
+
strokeLinecap: "round",
|
|
1348
|
+
strokeLinejoin: "round",
|
|
1349
|
+
children: /* @__PURE__ */ b("polyline", { points: "20 6 9 17 4 12" })
|
|
1350
|
+
}), Pt = () => /* @__PURE__ */ b("svg", {
|
|
1351
|
+
viewBox: "0 0 24 24",
|
|
1352
|
+
fill: "none",
|
|
1353
|
+
stroke: "currentColor",
|
|
1354
|
+
strokeWidth: "3",
|
|
1355
|
+
strokeLinecap: "round",
|
|
1356
|
+
children: /* @__PURE__ */ b("line", {
|
|
1357
|
+
x1: "5",
|
|
1358
|
+
y1: "12",
|
|
1359
|
+
x2: "19",
|
|
1360
|
+
y2: "12"
|
|
1361
|
+
})
|
|
1362
|
+
}), Ft = 0, It = l(({ name: e, checked: t, indeterminate: n = !1, defaultChecked: i, value: a, onChange: o, onFocus: s, onBlur: c, onKeyDown: l, keyboard: d, rowIndex: p, cellindex: h, onCellFocus: y, registerCellRef: S, label: C, hint: w, helperText: T, error: O, labelPosition: k = "end", disabled: A, readOnly: j, required: M = !1, autoFocus: N = !1, tabIndex: P, variant: F, size: I, color: L = "primary", className: R = "", tooltip: ee, tooltipTrigger: z = "icon", labelClassName: B = "", checkboxClassName: V = "", style: H, fullWidth: te = !1, checkedIcon: U, uncheckedIcon: W, indeterminateIcon: G, id: ne, checkboxRef: re, ripple: K = !0, showFocusRing: ie = !0, "aria-label": ae, "aria-labelledby": oe, "aria-describedby": se, "aria-required": ce, "aria-invalid": le, ...ue }, de) => {
|
|
1363
|
+
let q = jt(), fe = _(null), pe = Ct({
|
|
1364
|
+
widget: "toggle",
|
|
1365
|
+
surfaceKind: "toggle",
|
|
1366
|
+
elementRef: fe,
|
|
1367
|
+
id: ne,
|
|
1368
|
+
keyboard: d,
|
|
1369
|
+
size: I ?? q?.size,
|
|
1370
|
+
variant: F ?? q?.variant,
|
|
1371
|
+
disabled: A ?? q?.disabled,
|
|
1372
|
+
readOnly: j ?? q?.readOnly,
|
|
1373
|
+
onFocus: s,
|
|
1374
|
+
onBlur: c,
|
|
1375
|
+
onKeyDown: l,
|
|
1376
|
+
rowIndex: p,
|
|
1377
|
+
cellindex: h,
|
|
1378
|
+
onCellFocus: y,
|
|
1379
|
+
registerCellRef: S
|
|
1380
|
+
}), { size: me, variant: he, disabled: ge, readOnly: _e } = pe.surface, ve = w ?? T, ye = e ?? q?.name, be = L ?? q?.color ?? "primary", xe = q ? q.value.includes(a) : t, Se = q?.onChange ?? o, Ce = pe.ids.field, we = vt().layout === "cell";
|
|
1381
|
+
m(de, () => pe.handle, [pe.handle]);
|
|
1382
|
+
let Te = r(re, fe), [Ee, De] = v(!1), [Oe, ke] = v([]);
|
|
1383
|
+
f(() => {
|
|
1384
|
+
let e = fe.current;
|
|
1385
|
+
e && (e.indeterminate = n);
|
|
1386
|
+
}, [n]), f(() => {
|
|
1387
|
+
N && fe.current && fe.current.focus();
|
|
1388
|
+
}, [N]);
|
|
1389
|
+
let Ae = u((e) => {
|
|
1390
|
+
ge || _e || Se?.(e);
|
|
1391
|
+
}, [
|
|
1392
|
+
ge,
|
|
1393
|
+
_e,
|
|
1394
|
+
Se
|
|
1395
|
+
]), J = u(() => {
|
|
1396
|
+
!K || ge || _e || ke((e) => [...e, { key: ++Ft }]);
|
|
1397
|
+
}, [
|
|
1398
|
+
K,
|
|
1399
|
+
ge,
|
|
1400
|
+
_e
|
|
1401
|
+
]), je = u((e) => {
|
|
1402
|
+
ke((t) => t.filter((t) => t.key !== e));
|
|
1403
|
+
}, []), Me = g(() => {
|
|
1404
|
+
let e = E({
|
|
1405
|
+
variant: he,
|
|
1406
|
+
size: me,
|
|
1407
|
+
color: be,
|
|
1408
|
+
labelPosition: k,
|
|
1409
|
+
disabled: ge,
|
|
1410
|
+
readOnly: _e,
|
|
1411
|
+
error: !!O,
|
|
1412
|
+
fullWidth: te
|
|
1413
|
+
}).map((e) => Mt[e]).filter(Boolean);
|
|
1414
|
+
return R && e.push(R), e.join(" ");
|
|
1415
|
+
}, [
|
|
1416
|
+
he,
|
|
1417
|
+
me,
|
|
1418
|
+
be,
|
|
1419
|
+
k,
|
|
1420
|
+
ge,
|
|
1421
|
+
_e,
|
|
1422
|
+
O,
|
|
1423
|
+
te,
|
|
1424
|
+
R
|
|
1425
|
+
]), Ne = g(() => {
|
|
1426
|
+
let e = D({
|
|
1427
|
+
variant: he,
|
|
1428
|
+
size: me,
|
|
1429
|
+
color: be,
|
|
1430
|
+
pressed: Ee,
|
|
1431
|
+
showFocusRing: ie
|
|
1432
|
+
}).map((e) => Mt[e]).filter(Boolean);
|
|
1433
|
+
return V && e.push(V), e.join(" ");
|
|
1434
|
+
}, [
|
|
1435
|
+
he,
|
|
1436
|
+
me,
|
|
1437
|
+
be,
|
|
1438
|
+
Ee,
|
|
1439
|
+
ie,
|
|
1440
|
+
V
|
|
1441
|
+
]), Pe = g(() => {
|
|
1442
|
+
let e = [Mt.label];
|
|
1443
|
+
return B && e.push(B), e.filter(Boolean).join(" ");
|
|
1444
|
+
}, [B]), Fe = () => n ? G || /* @__PURE__ */ b(Pt, {}) : xe || i && xe === void 0 ? U || /* @__PURE__ */ b(Nt, {}) : W || null;
|
|
1445
|
+
return /* @__PURE__ */ b(kt, {
|
|
1446
|
+
tooltip: ee,
|
|
1447
|
+
tooltipTrigger: z,
|
|
1448
|
+
layout: we ? "cell" : "inline",
|
|
1449
|
+
size: me,
|
|
1450
|
+
error: O,
|
|
1451
|
+
hint: ve,
|
|
1452
|
+
disabled: ge,
|
|
1453
|
+
style: H,
|
|
1454
|
+
messageId: ve || O ? `${Ce}-helper` : void 0,
|
|
1455
|
+
children: /* @__PURE__ */ x("label", {
|
|
1456
|
+
className: Me,
|
|
1457
|
+
onMouseDown: () => De(!0),
|
|
1458
|
+
onMouseUp: () => De(!1),
|
|
1459
|
+
onClick: J,
|
|
1460
|
+
children: [/* @__PURE__ */ x("div", {
|
|
1461
|
+
className: Ne,
|
|
1462
|
+
children: [
|
|
1463
|
+
/* @__PURE__ */ b("input", {
|
|
1464
|
+
...ue,
|
|
1465
|
+
ref: Te,
|
|
1466
|
+
type: "checkbox",
|
|
1467
|
+
id: Ce,
|
|
1468
|
+
name: ye,
|
|
1469
|
+
value: a,
|
|
1470
|
+
checked: xe,
|
|
1471
|
+
defaultChecked: i,
|
|
1472
|
+
disabled: ge,
|
|
1473
|
+
readOnly: _e,
|
|
1474
|
+
required: M,
|
|
1475
|
+
tabIndex: P,
|
|
1476
|
+
className: Mt.input,
|
|
1477
|
+
onChange: Ae,
|
|
1478
|
+
onFocus: pe.handlers.onFocus,
|
|
1479
|
+
onBlur: pe.handlers.onBlur,
|
|
1480
|
+
onKeyDown: pe.handlers.onKeyDown,
|
|
1481
|
+
"aria-label": ae,
|
|
1482
|
+
"aria-labelledby": oe || (C && typeof C == "string" ? `${Ce}-label` : void 0),
|
|
1483
|
+
"aria-describedby": se || (ve || O ? `${Ce}-helper` : void 0),
|
|
1484
|
+
"aria-required": ce ?? M,
|
|
1485
|
+
"aria-invalid": le ?? !!O
|
|
1486
|
+
}),
|
|
1487
|
+
/* @__PURE__ */ b("span", {
|
|
1488
|
+
className: Mt.box,
|
|
1489
|
+
children: /* @__PURE__ */ b("span", {
|
|
1490
|
+
className: Mt.icon,
|
|
1491
|
+
children: Fe()
|
|
1492
|
+
})
|
|
1493
|
+
}),
|
|
1494
|
+
Oe.map((e) => /* @__PURE__ */ b("span", {
|
|
1495
|
+
className: Mt.ripple,
|
|
1496
|
+
onAnimationEnd: () => je(e.key)
|
|
1497
|
+
}, e.key))
|
|
1498
|
+
]
|
|
1499
|
+
}), C && /* @__PURE__ */ x("span", {
|
|
1500
|
+
id: typeof C == "string" ? `${Ce}-label` : void 0,
|
|
1501
|
+
className: Pe,
|
|
1502
|
+
children: [C, M && /* @__PURE__ */ b("span", {
|
|
1503
|
+
className: Mt.required,
|
|
1504
|
+
children: "*"
|
|
1505
|
+
})]
|
|
1506
|
+
})]
|
|
1507
|
+
})
|
|
1508
|
+
});
|
|
1509
|
+
});
|
|
1510
|
+
It.displayName = "Checkbox";
|
|
1511
|
+
//#endregion
|
|
1512
|
+
//#region ../../shared-web-ui/src/Checkbox/CheckboxGroup.tsx
|
|
1513
|
+
var Lt = ({ name: e, value: t = [], onChange: n, label: r, helperText: i, error: a, disabled: o = !1, readOnly: s = !1, required: c = !1, orientation: l = "vertical", size: d, variant: f, color: m, className: h = "", style: _, children: v, "aria-label": y, "aria-labelledby": S, "aria-describedby": C }) => {
|
|
1514
|
+
let w = `checkbox-group-${p()}`, T = u((e) => {
|
|
1515
|
+
if (o || s || !n) return;
|
|
1516
|
+
let r = e.target.value;
|
|
1517
|
+
n(e.target.checked ? [...t, r] : t.filter((e) => String(e) !== r));
|
|
1518
|
+
}, [
|
|
1519
|
+
t,
|
|
1520
|
+
n,
|
|
1521
|
+
o,
|
|
1522
|
+
s
|
|
1523
|
+
]), E = g(() => ({
|
|
1524
|
+
name: e,
|
|
1525
|
+
value: t,
|
|
1526
|
+
onChange: T,
|
|
1527
|
+
disabled: o,
|
|
1528
|
+
readOnly: s,
|
|
1529
|
+
size: d,
|
|
1530
|
+
variant: f,
|
|
1531
|
+
color: m
|
|
1532
|
+
}), [
|
|
1533
|
+
e,
|
|
1534
|
+
t,
|
|
1535
|
+
T,
|
|
1536
|
+
o,
|
|
1537
|
+
s,
|
|
1538
|
+
d,
|
|
1539
|
+
f,
|
|
1540
|
+
m
|
|
1541
|
+
]), D = g(() => {
|
|
1542
|
+
let e = O({
|
|
1543
|
+
orientation: l,
|
|
1544
|
+
disabled: o
|
|
1545
|
+
}).map((e) => Mt[e]).filter(Boolean);
|
|
1546
|
+
return h && e.push(h), e.join(" ");
|
|
1547
|
+
}, [
|
|
1548
|
+
l,
|
|
1549
|
+
o,
|
|
1550
|
+
h
|
|
1551
|
+
]);
|
|
1552
|
+
return /* @__PURE__ */ b(At.Provider, {
|
|
1553
|
+
value: E,
|
|
1554
|
+
children: /* @__PURE__ */ x("div", {
|
|
1555
|
+
className: D,
|
|
1556
|
+
style: _,
|
|
1557
|
+
role: "group",
|
|
1558
|
+
"aria-label": y,
|
|
1559
|
+
"aria-labelledby": S || (r ? `${w}-label` : void 0),
|
|
1560
|
+
"aria-describedby": C || (i || a ? `${w}-helper` : void 0),
|
|
1561
|
+
"aria-required": c,
|
|
1562
|
+
"aria-invalid": !!a,
|
|
1563
|
+
children: [
|
|
1564
|
+
r && /* @__PURE__ */ x("div", {
|
|
1565
|
+
id: `${w}-label`,
|
|
1566
|
+
className: Mt.groupLabel,
|
|
1567
|
+
children: [r, c && /* @__PURE__ */ b("span", {
|
|
1568
|
+
className: Mt.required,
|
|
1569
|
+
children: "*"
|
|
1570
|
+
})]
|
|
1571
|
+
}),
|
|
1572
|
+
/* @__PURE__ */ b("div", {
|
|
1573
|
+
className: Mt.groupItems,
|
|
1574
|
+
children: v
|
|
1575
|
+
}),
|
|
1576
|
+
(i || a) && /* @__PURE__ */ b("div", {
|
|
1577
|
+
id: `${w}-helper`,
|
|
1578
|
+
className: a ? Mt.groupError : Mt.groupHelper,
|
|
1579
|
+
children: a || i
|
|
1580
|
+
})
|
|
1581
|
+
]
|
|
1582
|
+
})
|
|
1583
|
+
});
|
|
1584
|
+
}, Z = {
|
|
1585
|
+
root: "_root_jdkbj_24",
|
|
1586
|
+
fullWidth: "_fullWidth_jdkbj_45",
|
|
1587
|
+
disabled: "_disabled_jdkbj_50",
|
|
1588
|
+
readonly: "_readonly_jdkbj_55",
|
|
1589
|
+
loading: "_loading_jdkbj_59",
|
|
1590
|
+
label_end: "_label_end_jdkbj_65",
|
|
1591
|
+
label_start: "_label_start_jdkbj_66",
|
|
1592
|
+
label_top: "_label_top_jdkbj_67",
|
|
1593
|
+
label_bottom: "_label_bottom_jdkbj_68",
|
|
1594
|
+
wrapper: "_wrapper_jdkbj_72",
|
|
1595
|
+
input: "_input_jdkbj_84",
|
|
1596
|
+
track: "_track_jdkbj_98",
|
|
1597
|
+
animated: "_animated_jdkbj_108",
|
|
1598
|
+
size_xxs: "_size_xxs_jdkbj_122",
|
|
1599
|
+
size_xs: "_size_xs_jdkbj_123",
|
|
1600
|
+
size_small: "_size_small_jdkbj_124",
|
|
1601
|
+
size_medium: "_size_medium_jdkbj_125",
|
|
1602
|
+
size_large: "_size_large_jdkbj_126",
|
|
1603
|
+
size_xl: "_size_xl_jdkbj_127",
|
|
1604
|
+
thumb: "_thumb_jdkbj_137",
|
|
1605
|
+
showFocusRing: "_showFocusRing_jdkbj_223",
|
|
1606
|
+
switchHaloPulse: "_switchHaloPulse_jdkbj_1",
|
|
1607
|
+
color_primary: "_color_primary_jdkbj_252",
|
|
1608
|
+
color_secondary: "_color_secondary_jdkbj_253",
|
|
1609
|
+
color_success: "_color_success_jdkbj_254",
|
|
1610
|
+
color_error: "_color_error_jdkbj_255",
|
|
1611
|
+
color_warning: "_color_warning_jdkbj_256",
|
|
1612
|
+
color_info: "_color_info_jdkbj_257",
|
|
1613
|
+
pressed: "_pressed_jdkbj_301",
|
|
1614
|
+
content: "_content_jdkbj_250",
|
|
1615
|
+
contentOn: "_contentOn_jdkbj_329",
|
|
1616
|
+
contentOff: "_contentOff_jdkbj_330",
|
|
1617
|
+
thumbIcon: "_thumbIcon_jdkbj_339",
|
|
1618
|
+
loadingWrap: "_loadingWrap_jdkbj_356",
|
|
1619
|
+
spinner: "_spinner_jdkbj_364",
|
|
1620
|
+
switchSpin: "_switchSpin_jdkbj_1",
|
|
1621
|
+
label: "_label_jdkbj_65",
|
|
1622
|
+
required: "_required_jdkbj_414",
|
|
1623
|
+
error: "_error_jdkbj_425",
|
|
1624
|
+
stateLabel: "_stateLabel_jdkbj_436",
|
|
1625
|
+
active: "_active_jdkbj_450",
|
|
1626
|
+
choiceMode: "_choiceMode_jdkbj_470",
|
|
1627
|
+
srOnly: "_srOnly_jdkbj_513"
|
|
1628
|
+
}, Rt = ({ className: e = "" }) => /* @__PURE__ */ b("span", {
|
|
1629
|
+
className: `${Z.spinner} ${e}`,
|
|
1630
|
+
role: "status",
|
|
1631
|
+
"aria-label": "Loading",
|
|
1632
|
+
children: /* @__PURE__ */ b("span", {
|
|
1633
|
+
className: Z.srOnly,
|
|
1634
|
+
children: "Loading..."
|
|
1635
|
+
})
|
|
1636
|
+
}), zt = l(({ name: e, checked: t, defaultChecked: n, value: i, onChange: a, onFocus: o, onBlur: s, onKeyDown: c, keyboard: l, rowIndex: d, cellindex: p, onCellFocus: h, registerCellRef: y, label: S, hint: C, helperText: w, error: T, labelPosition: E = "end", onText: D, offText: O, onIcon: k, offIcon: A, labelOn: j, labelOff: M, stateLabelMode: N = "replace", justSwitch: P = !1, disabled: F, readOnly: I, required: L = !1, autoFocus: R = !1, tabIndex: ee, size: z, color: B = "primary", className: V = "", tooltip: H, tooltipTrigger: te = "icon", labelClassName: U = "", trackClassName: W = "", thumbClassName: G = "", style: ne, fullWidth: re = !1, loading: K = !1, loadingIndicator: ie, id: ae, switchRef: oe, showFocusRing: se = !0, animated: ce = !0, "aria-label": le, "aria-labelledby": ue, "aria-describedby": de, "aria-required": q, "aria-invalid": fe, ...pe }, me) => {
|
|
1637
|
+
let he = _(null), ge = Ct({
|
|
1638
|
+
widget: "toggle",
|
|
1639
|
+
surfaceKind: "toggle",
|
|
1640
|
+
elementRef: he,
|
|
1641
|
+
id: ae,
|
|
1642
|
+
keyboard: l,
|
|
1643
|
+
size: z,
|
|
1644
|
+
disabled: F,
|
|
1645
|
+
readOnly: I,
|
|
1646
|
+
onFocus: o,
|
|
1647
|
+
onBlur: s,
|
|
1648
|
+
onKeyDown: c,
|
|
1649
|
+
rowIndex: d,
|
|
1650
|
+
cellindex: p,
|
|
1651
|
+
onCellFocus: h,
|
|
1652
|
+
registerCellRef: y
|
|
1653
|
+
}), { size: _e, disabled: ve, readOnly: ye } = ge.surface, be = C ?? w, xe = ge.ids.field, Se = vt().layout === "cell";
|
|
1654
|
+
m(me, () => ge.handle, [ge.handle]);
|
|
1655
|
+
let Ce = r(oe, he), [we, Te] = v(!1), Ee = g(() => P && (j || M), [
|
|
1656
|
+
P,
|
|
1657
|
+
j,
|
|
1658
|
+
M
|
|
1659
|
+
]), De = g(() => N === "replace" && (j || M) ? t ? j : M : S, [
|
|
1660
|
+
S,
|
|
1661
|
+
j,
|
|
1662
|
+
M,
|
|
1663
|
+
t,
|
|
1664
|
+
N
|
|
1665
|
+
]);
|
|
1666
|
+
f(() => {
|
|
1667
|
+
R && he.current && he.current.focus();
|
|
1668
|
+
}, [R]);
|
|
1669
|
+
let Oe = u((e) => {
|
|
1670
|
+
ve || ye || K || a?.(e);
|
|
1671
|
+
}, [
|
|
1672
|
+
ve,
|
|
1673
|
+
ye,
|
|
1674
|
+
K,
|
|
1675
|
+
a
|
|
1676
|
+
]), ke = g(() => {
|
|
1677
|
+
let e = ht({
|
|
1678
|
+
labelPosition: E,
|
|
1679
|
+
size: _e,
|
|
1680
|
+
disabled: ve,
|
|
1681
|
+
readOnly: ye,
|
|
1682
|
+
loading: K,
|
|
1683
|
+
error: !!T,
|
|
1684
|
+
fullWidth: re
|
|
1685
|
+
}).map((e) => Z[e]).filter(Boolean);
|
|
1686
|
+
return V && e.push(V), e.join(" ");
|
|
1687
|
+
}, [
|
|
1688
|
+
E,
|
|
1689
|
+
_e,
|
|
1690
|
+
ve,
|
|
1691
|
+
ye,
|
|
1692
|
+
K,
|
|
1693
|
+
T,
|
|
1694
|
+
re,
|
|
1695
|
+
V
|
|
1696
|
+
]), Ae = g(() => gt({
|
|
1697
|
+
size: _e,
|
|
1698
|
+
color: B,
|
|
1699
|
+
pressed: we,
|
|
1700
|
+
showFocusRing: se,
|
|
1701
|
+
animated: ce,
|
|
1702
|
+
choiceMode: !!Ee
|
|
1703
|
+
}).map((e) => Z[e]).filter(Boolean).join(" "), [
|
|
1704
|
+
_e,
|
|
1705
|
+
B,
|
|
1706
|
+
we,
|
|
1707
|
+
se,
|
|
1708
|
+
ce,
|
|
1709
|
+
Ee
|
|
1710
|
+
]), J = g(() => {
|
|
1711
|
+
let e = [Z.track];
|
|
1712
|
+
return W && e.push(W), e.filter(Boolean).join(" ");
|
|
1713
|
+
}, [W]), je = g(() => {
|
|
1714
|
+
let e = [Z.thumb];
|
|
1715
|
+
return G && e.push(G), e.filter(Boolean).join(" ");
|
|
1716
|
+
}, [G]), Me = g(() => {
|
|
1717
|
+
let e = [Z.label];
|
|
1718
|
+
return U && e.push(U), e.filter(Boolean).join(" ");
|
|
1719
|
+
}, [U]), Ne = () => K ? /* @__PURE__ */ b("span", {
|
|
1720
|
+
className: Z.loadingWrap,
|
|
1721
|
+
children: ie || /* @__PURE__ */ b(Rt, {})
|
|
1722
|
+
}) : t && k ? /* @__PURE__ */ b("span", {
|
|
1723
|
+
className: Z.thumbIcon,
|
|
1724
|
+
children: k
|
|
1725
|
+
}) : !t && A ? /* @__PURE__ */ b("span", {
|
|
1726
|
+
className: Z.thumbIcon,
|
|
1727
|
+
children: A
|
|
1728
|
+
}) : null, Pe = () => N !== "sides" || !M ? null : /* @__PURE__ */ b("span", {
|
|
1729
|
+
className: `${Z.stateLabel} ${Z.stateLabelLeft} ${t ? "" : Z.active}`,
|
|
1730
|
+
onClick: (e) => {
|
|
1731
|
+
e.preventDefault(), !ve && !ye && !K && t && he.current?.click();
|
|
1732
|
+
},
|
|
1733
|
+
children: M
|
|
1734
|
+
}), Fe = () => N !== "sides" || !j ? null : /* @__PURE__ */ b("span", {
|
|
1735
|
+
className: `${Z.stateLabel} ${Z.stateLabelRight} ${t ? Z.active : ""}`,
|
|
1736
|
+
onClick: (e) => {
|
|
1737
|
+
e.preventDefault(), !ve && !ye && !K && !t && he.current?.click();
|
|
1738
|
+
},
|
|
1739
|
+
children: j
|
|
1740
|
+
});
|
|
1741
|
+
return /* @__PURE__ */ b(kt, {
|
|
1742
|
+
tooltip: H,
|
|
1743
|
+
tooltipTrigger: te,
|
|
1744
|
+
layout: Se ? "cell" : "inline",
|
|
1745
|
+
size: _e,
|
|
1746
|
+
error: T,
|
|
1747
|
+
hint: be,
|
|
1748
|
+
disabled: ve,
|
|
1749
|
+
style: ne,
|
|
1750
|
+
messageId: be || T ? `${xe}-helper` : void 0,
|
|
1751
|
+
children: /* @__PURE__ */ x("label", {
|
|
1752
|
+
className: ke,
|
|
1753
|
+
onMouseDown: () => Te(!0),
|
|
1754
|
+
onMouseUp: () => Te(!1),
|
|
1755
|
+
onMouseLeave: () => Te(!1),
|
|
1756
|
+
children: [
|
|
1757
|
+
Pe(),
|
|
1758
|
+
/* @__PURE__ */ x("div", {
|
|
1759
|
+
className: Ae,
|
|
1760
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1761
|
+
...pe,
|
|
1762
|
+
ref: Ce,
|
|
1763
|
+
type: "checkbox",
|
|
1764
|
+
id: xe,
|
|
1765
|
+
name: e,
|
|
1766
|
+
value: i,
|
|
1767
|
+
checked: t,
|
|
1768
|
+
defaultChecked: n,
|
|
1769
|
+
disabled: ve || K,
|
|
1770
|
+
readOnly: ye,
|
|
1771
|
+
required: L,
|
|
1772
|
+
tabIndex: ee,
|
|
1773
|
+
className: Z.input,
|
|
1774
|
+
onChange: Oe,
|
|
1775
|
+
onFocus: ge.handlers.onFocus,
|
|
1776
|
+
onBlur: ge.handlers.onBlur,
|
|
1777
|
+
onKeyDown: ge.handlers.onKeyDown,
|
|
1778
|
+
role: "switch",
|
|
1779
|
+
"aria-label": le,
|
|
1780
|
+
"aria-labelledby": ue || (De && typeof De == "string" ? `${xe}-label` : void 0),
|
|
1781
|
+
"aria-describedby": de || (be || T ? `${xe}-helper` : void 0),
|
|
1782
|
+
"aria-required": q ?? L,
|
|
1783
|
+
"aria-invalid": fe ?? !!T,
|
|
1784
|
+
"aria-checked": t
|
|
1785
|
+
}), /* @__PURE__ */ x("span", {
|
|
1786
|
+
className: J,
|
|
1787
|
+
children: [
|
|
1788
|
+
!P && D && /* @__PURE__ */ b("span", {
|
|
1789
|
+
className: `${Z.content} ${Z.contentOn}`,
|
|
1790
|
+
children: D
|
|
1791
|
+
}),
|
|
1792
|
+
!P && O && /* @__PURE__ */ b("span", {
|
|
1793
|
+
className: `${Z.content} ${Z.contentOff}`,
|
|
1794
|
+
children: O
|
|
1795
|
+
}),
|
|
1796
|
+
/* @__PURE__ */ b("span", {
|
|
1797
|
+
className: je,
|
|
1798
|
+
children: Ne()
|
|
1799
|
+
})
|
|
1800
|
+
]
|
|
1801
|
+
})]
|
|
1802
|
+
}),
|
|
1803
|
+
Fe(),
|
|
1804
|
+
De && N !== "sides" && /* @__PURE__ */ x("span", {
|
|
1805
|
+
id: typeof De == "string" ? `${xe}-label` : void 0,
|
|
1806
|
+
className: Me,
|
|
1807
|
+
children: [De, L && /* @__PURE__ */ b("span", {
|
|
1808
|
+
className: Z.required,
|
|
1809
|
+
children: "*"
|
|
1810
|
+
})]
|
|
1811
|
+
})
|
|
1812
|
+
]
|
|
1813
|
+
})
|
|
1814
|
+
});
|
|
1815
|
+
});
|
|
1816
|
+
zt.displayName = "Switch";
|
|
1817
|
+
var Bt = {
|
|
1818
|
+
control: "_control_e355x_48",
|
|
1819
|
+
isDisabled: "_isDisabled_e355x_58",
|
|
1820
|
+
isReadOnly: "_isReadOnly_e355x_89",
|
|
1821
|
+
isError: "_isError_e355x_108",
|
|
1822
|
+
size_xxs: "_size_xxs_e355x_137",
|
|
1823
|
+
size_xs: "_size_xs_e355x_143",
|
|
1824
|
+
size_small: "_size_small_e355x_149",
|
|
1825
|
+
size_medium: "_size_medium_e355x_155",
|
|
1826
|
+
size_large: "_size_large_e355x_161",
|
|
1827
|
+
size_xl: "_size_xl_e355x_167",
|
|
1828
|
+
hasAffix: "_hasAffix_e355x_176",
|
|
1829
|
+
variant_outlined: "_variant_outlined_e355x_186",
|
|
1830
|
+
variant_filled: "_variant_filled_e355x_192",
|
|
1831
|
+
variant_standard: "_variant_standard_e355x_219",
|
|
1832
|
+
variant_underlined: "_variant_underlined_e355x_220",
|
|
1833
|
+
variant_cell: "_variant_cell_e355x_274",
|
|
1834
|
+
controlText: "_controlText_e355x_302",
|
|
1835
|
+
hasJoinedPopup: "_hasJoinedPopup_e355x_359"
|
|
1836
|
+
}, Vt = {
|
|
1837
|
+
root: "_root_oc9bg_7",
|
|
1838
|
+
fullWidth: "_fullWidth_oc9bg_17",
|
|
1839
|
+
fieldWrapper: "_fieldWrapper_oc9bg_24",
|
|
1840
|
+
input: "_input_oc9bg_31",
|
|
1841
|
+
icon: "_icon_oc9bg_62",
|
|
1842
|
+
prefix: "_prefix_oc9bg_78",
|
|
1843
|
+
suffix: "_suffix_oc9bg_79",
|
|
1844
|
+
actions: "_actions_oc9bg_119",
|
|
1845
|
+
actionBtn: "_actionBtn_oc9bg_126",
|
|
1846
|
+
passwordToggle: "_passwordToggle_oc9bg_152",
|
|
1847
|
+
multiline: "_multiline_oc9bg_165",
|
|
1848
|
+
charCount: "_charCount_oc9bg_178",
|
|
1849
|
+
error: "_error_oc9bg_185"
|
|
1850
|
+
}, Ht = l(({ type: e = "text", name: t, value: n, onChange: i, onBlur: a, onFocus: o, onKeyDown: s, label: c = "", placeholder: l = "", hint: d = "", error: f = "", disabled: p, readOnly: h, required: y = !1, autoFocus: S = !1, autoComplete: C = "off", tabIndex: w, min: T, max: E, minLength: D, maxLength: O, step: k, pattern: A, variant: j, size: M, layout: N, className: P = "", tooltip: F, tooltipTrigger: I = "icon", labelClassName: L = "", inputClassName: R = "", containerClassName: ee = "", style: z, fullWidth: B = !0, icon: V, prefix: H, suffix: te, showCharCount: U = !1, clearable: W = !1, multiline: G = !1, rows: ne, resize: re = "vertical", inputRef: K, id: ie, formData: ae, minkey: oe, keyboard: se, rowIndex: ce, cellindex: le, onCellFocus: ue, registerCellRef: de, "aria-label": q, "aria-labelledby": fe, "aria-describedby": pe, "aria-required": me, "aria-invalid": he, ...ge }, _e) => {
|
|
1851
|
+
let ve = _(null), ye = G ? "textarea" : e === "number" ? "number" : "text", be = u(() => {
|
|
1852
|
+
let e = ve.current;
|
|
1853
|
+
if (!e || !G || e.readOnly || e.disabled) return;
|
|
1854
|
+
let t = e.selectionStart ?? e.value.length, n = e.selectionEnd ?? t, r = `${e.value.slice(0, t)}\n${e.value.slice(n)}`, i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
|
|
1855
|
+
i ? i.call(e, r) : e.value = r, e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
1856
|
+
let a = t + 1;
|
|
1857
|
+
requestAnimationFrame(() => {
|
|
1858
|
+
ve.current === e && e.setSelectionRange(a, a);
|
|
1859
|
+
});
|
|
1860
|
+
}, [G]), xe = Ct({
|
|
1861
|
+
widget: ye,
|
|
1862
|
+
elementRef: ve,
|
|
1863
|
+
id: ie,
|
|
1864
|
+
keyboard: se,
|
|
1865
|
+
onFieldAction: u((e) => {
|
|
1866
|
+
e === "insertNewline" && be();
|
|
1867
|
+
}, [be]),
|
|
1868
|
+
size: M,
|
|
1869
|
+
variant: j,
|
|
1870
|
+
layout: N,
|
|
1871
|
+
disabled: p,
|
|
1872
|
+
readOnly: h,
|
|
1873
|
+
onFocus: o,
|
|
1874
|
+
onBlur: a,
|
|
1875
|
+
onKeyDown: s,
|
|
1876
|
+
rowIndex: ce,
|
|
1877
|
+
cellindex: le,
|
|
1878
|
+
onCellFocus: ue,
|
|
1879
|
+
registerCellRef: de
|
|
1880
|
+
}), { size: Se, variant: Ce, layout: we, disabled: Te, readOnly: Ee } = xe.surface, De = xe.ids.field;
|
|
1881
|
+
m(_e, () => xe.handle, [xe.handle]);
|
|
1882
|
+
let Oe = r(K, ve), [ke, Ae] = v(!1), J = g(() => n === void 0 ? ae && t && ae[t] || "" : n, [
|
|
1883
|
+
n,
|
|
1884
|
+
ae,
|
|
1885
|
+
t
|
|
1886
|
+
]), je = String(J || "").length > 0, Me = String(J || "").length, Ne = u(() => {
|
|
1887
|
+
if (Te || Ee) return;
|
|
1888
|
+
let e = ve.current;
|
|
1889
|
+
if (!e) return;
|
|
1890
|
+
let t = e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype;
|
|
1891
|
+
(Object.getOwnPropertyDescriptor(t, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus();
|
|
1892
|
+
}, [Te, Ee]), Pe = e === "password" && ke ? "text" : e, Fe = oe && ae ? ae[oe] : T, Ie = W && je && !Te && !Ee, Le = e === "password" && !Te, ze = g(() => Re({
|
|
1893
|
+
size: Se,
|
|
1894
|
+
variant: Ce,
|
|
1895
|
+
error: !!f,
|
|
1896
|
+
disabled: Te,
|
|
1897
|
+
readOnly: Ee
|
|
1898
|
+
}).map((e) => Bt[e]).filter(Boolean).join(" "), [
|
|
1899
|
+
Se,
|
|
1900
|
+
Ce,
|
|
1901
|
+
f,
|
|
1902
|
+
Te,
|
|
1903
|
+
Ee
|
|
1904
|
+
]), Be = g(() => {
|
|
1905
|
+
let e = Ve({
|
|
1906
|
+
variant: Ce,
|
|
1907
|
+
size: Se,
|
|
1908
|
+
disabled: Te,
|
|
1909
|
+
readOnly: Ee,
|
|
1910
|
+
error: !!f,
|
|
1911
|
+
multiline: G,
|
|
1912
|
+
fullWidth: B
|
|
1913
|
+
}).map((e) => Vt[e]).filter(Boolean);
|
|
1914
|
+
return P && e.push(P), ee && e.push(ee), e.join(" ");
|
|
1915
|
+
}, [
|
|
1916
|
+
Ce,
|
|
1917
|
+
Se,
|
|
1918
|
+
Te,
|
|
1919
|
+
Ee,
|
|
1920
|
+
f,
|
|
1921
|
+
G,
|
|
1922
|
+
B,
|
|
1923
|
+
P,
|
|
1924
|
+
ee
|
|
1925
|
+
]), He = {
|
|
1926
|
+
...ge,
|
|
1927
|
+
ref: Oe,
|
|
1928
|
+
id: De,
|
|
1929
|
+
name: t,
|
|
1930
|
+
value: J,
|
|
1931
|
+
placeholder: c && Ce === "underlined" ? "" : l,
|
|
1932
|
+
disabled: Te,
|
|
1933
|
+
readOnly: Ee,
|
|
1934
|
+
required: y || me,
|
|
1935
|
+
autoFocus: S,
|
|
1936
|
+
autoComplete: C,
|
|
1937
|
+
tabIndex: w,
|
|
1938
|
+
min: Fe,
|
|
1939
|
+
max: E,
|
|
1940
|
+
minLength: D,
|
|
1941
|
+
maxLength: O,
|
|
1942
|
+
step: k,
|
|
1943
|
+
pattern: A,
|
|
1944
|
+
className: [
|
|
1945
|
+
Bt.controlText,
|
|
1946
|
+
Vt.input,
|
|
1947
|
+
R
|
|
1948
|
+
].filter(Boolean).join(" "),
|
|
1949
|
+
onChange: i,
|
|
1950
|
+
...xe.handlers,
|
|
1951
|
+
"aria-label": q,
|
|
1952
|
+
"aria-labelledby": fe || (c ? `${De}-label` : void 0),
|
|
1953
|
+
"aria-describedby": pe || (d || f ? `${De}-hint` : void 0),
|
|
1954
|
+
"aria-required": me ?? y,
|
|
1955
|
+
"aria-invalid": he ?? !!f,
|
|
1956
|
+
...le !== void 0 && { "data-cellindex": le }
|
|
1957
|
+
}, Ue = u((t) => {
|
|
1958
|
+
e === "number" && document.activeElement === t.currentTarget && t.currentTarget.blur();
|
|
1959
|
+
}, [e]);
|
|
1960
|
+
return /* @__PURE__ */ b(kt, {
|
|
1961
|
+
tooltip: F,
|
|
1962
|
+
tooltipTrigger: I,
|
|
1963
|
+
className: Be,
|
|
1964
|
+
layout: we,
|
|
1965
|
+
size: Se,
|
|
1966
|
+
label: c,
|
|
1967
|
+
labelClassName: L,
|
|
1968
|
+
labelId: `${De}-label`,
|
|
1969
|
+
labelFor: De,
|
|
1970
|
+
error: f,
|
|
1971
|
+
hint: d,
|
|
1972
|
+
required: y,
|
|
1973
|
+
disabled: Te,
|
|
1974
|
+
style: z,
|
|
1975
|
+
messageId: d || f ? `${De}-hint` : void 0,
|
|
1976
|
+
extraMessages: U && O ? /* @__PURE__ */ x("div", {
|
|
1977
|
+
className: Vt.charCount,
|
|
1978
|
+
children: [
|
|
1979
|
+
Me,
|
|
1980
|
+
"/",
|
|
1981
|
+
O
|
|
1982
|
+
]
|
|
1983
|
+
}) : null,
|
|
1984
|
+
children: /* @__PURE__ */ x("div", {
|
|
1985
|
+
className: `${ze} ${Vt.fieldWrapper}`,
|
|
1986
|
+
onMouseDown: xe.handlers.onMouseDown,
|
|
1987
|
+
children: [
|
|
1988
|
+
V?.start && /* @__PURE__ */ b("span", {
|
|
1989
|
+
className: `${Vt.icon} ${Vt.iconStart}`,
|
|
1990
|
+
onClick: () => V.onClick?.("start"),
|
|
1991
|
+
children: V.start
|
|
1992
|
+
}),
|
|
1993
|
+
H && /* @__PURE__ */ b("span", {
|
|
1994
|
+
className: Vt.prefix,
|
|
1995
|
+
children: H
|
|
1996
|
+
}),
|
|
1997
|
+
G ? /* @__PURE__ */ b("textarea", {
|
|
1998
|
+
...He,
|
|
1999
|
+
rows: ne,
|
|
2000
|
+
style: { resize: re }
|
|
2001
|
+
}) : /* @__PURE__ */ b("input", {
|
|
2002
|
+
...He,
|
|
2003
|
+
type: Pe,
|
|
2004
|
+
onWheel: Ue
|
|
2005
|
+
}),
|
|
2006
|
+
te && /* @__PURE__ */ b("span", {
|
|
2007
|
+
className: Vt.suffix,
|
|
2008
|
+
children: te
|
|
2009
|
+
}),
|
|
2010
|
+
(Ie || Le || V?.end) && /* @__PURE__ */ x("div", {
|
|
2011
|
+
className: Vt.actions,
|
|
2012
|
+
children: [
|
|
2013
|
+
Ie && /* @__PURE__ */ b("button", {
|
|
2014
|
+
type: "button",
|
|
2015
|
+
className: `${Vt.actionBtn} ${Vt.clearBtn}`,
|
|
2016
|
+
onClick: Ne,
|
|
2017
|
+
"aria-label": "Clear",
|
|
2018
|
+
children: "×"
|
|
2019
|
+
}),
|
|
2020
|
+
Le && /* @__PURE__ */ b("button", {
|
|
2021
|
+
type: "button",
|
|
2022
|
+
className: `${Vt.actionBtn} ${Vt.passwordToggle}`,
|
|
2023
|
+
onClick: () => Ae((e) => !e),
|
|
2024
|
+
"aria-label": ke ? "Hide password" : "Show password",
|
|
2025
|
+
children: ke ? "👁️" : "👁️🗨️"
|
|
2026
|
+
}),
|
|
2027
|
+
V?.end && /* @__PURE__ */ b("span", {
|
|
2028
|
+
className: `${Vt.icon} ${Vt.iconEnd}`,
|
|
2029
|
+
onClick: () => V.onClick?.("end"),
|
|
2030
|
+
children: V.end
|
|
2031
|
+
})
|
|
2032
|
+
]
|
|
2033
|
+
})
|
|
2034
|
+
]
|
|
2035
|
+
})
|
|
2036
|
+
});
|
|
2037
|
+
});
|
|
2038
|
+
Ht.displayName = "Input";
|
|
2039
|
+
//#endregion
|
|
2040
|
+
//#region ../../shared-web-ui/src/Select/useSelect.ts
|
|
2041
|
+
var Ut = (e) => {
|
|
2042
|
+
let { options: t, value: n, multiSelect: r = !1, search: i = !0, sort: a = !0, reorder: o = !1, group: s = !1, keyboard: c = {}, disabled: l = !1, autoFocusSearch: d = !0, onChange: p, onBlur: m, name: h, defaultText: y = "--Select--" } = e, b = g(() => typeof r == "boolean" ? { enabled: r } : r, [r]), x = g(() => typeof i == "boolean" ? { enabled: i } : i, [i]), S = g(() => typeof a == "boolean" ? {
|
|
2043
|
+
enabled: a,
|
|
2044
|
+
caseInsensitive: !0
|
|
2045
|
+
} : a, [a]), C = g(() => typeof o == "boolean" ? { enabled: o } : o, [o]);
|
|
2046
|
+
g(() => typeof s == "boolean" ? { enabled: s } : s, [s]);
|
|
2047
|
+
let w = _(null), T = _(null), E = _(null), D = _(null), O = _(null), [k, A] = v(!1), [j, M] = v(-1), [N, P] = v(""), [F, I] = v(-1), [L, R] = v(null), [ee, z] = v(null), [B, V] = v(/* @__PURE__ */ new Set()), [H, te] = v(!1), [U, W] = v({
|
|
2048
|
+
isScrolling: !1,
|
|
2049
|
+
direction: 0,
|
|
2050
|
+
speed: 0,
|
|
2051
|
+
timeoutId: null
|
|
2052
|
+
});
|
|
2053
|
+
f(() => {
|
|
2054
|
+
if (!O.current) return;
|
|
2055
|
+
let e = O.current.closest("[role=\"dialog\"], .modal, .modal-content, .MuiDialog-container, .ant-modal, .chakra-modal__content, .bp3-dialog");
|
|
2056
|
+
te(!!e);
|
|
2057
|
+
}, []);
|
|
2058
|
+
let G = g(() => {
|
|
2059
|
+
let e = dt(t);
|
|
2060
|
+
return S.enabled && !C.enabled && (e = ft(e, S)), e;
|
|
2061
|
+
}, [
|
|
2062
|
+
t,
|
|
2063
|
+
S.enabled,
|
|
2064
|
+
C.enabled,
|
|
2065
|
+
a
|
|
2066
|
+
]), ne = g(() => {
|
|
2067
|
+
if (!b.enabled || !C.enabled || !n || !Array.isArray(n) || n.length === 0) return G;
|
|
2068
|
+
let e = [], t = [];
|
|
2069
|
+
return n.forEach((t) => {
|
|
2070
|
+
let n = G.find((e) => e.value === t);
|
|
2071
|
+
n && e.push(n);
|
|
2072
|
+
}), G.forEach((e) => {
|
|
2073
|
+
n.includes(e.value) || t.push(e);
|
|
2074
|
+
}), [...e, ...t];
|
|
2075
|
+
}, [
|
|
2076
|
+
G,
|
|
2077
|
+
b.enabled,
|
|
2078
|
+
C.enabled,
|
|
2079
|
+
n
|
|
2080
|
+
]), re = b.enabled && C.enabled ? ne : G, K = g(() => pt(re, N, x), [
|
|
2081
|
+
re,
|
|
2082
|
+
N,
|
|
2083
|
+
i
|
|
2084
|
+
]), ie = g(() => {
|
|
2085
|
+
if (b.enabled && Array.isArray(n)) return G.filter((e) => n.includes(e.value));
|
|
2086
|
+
let e = G.find((e) => e.value === n);
|
|
2087
|
+
return e ? [e] : [];
|
|
2088
|
+
}, [
|
|
2089
|
+
G,
|
|
2090
|
+
n,
|
|
2091
|
+
b.enabled
|
|
2092
|
+
]), ae = g(() => {
|
|
2093
|
+
if (!b.enabled || !b.showSelectAll) return !1;
|
|
2094
|
+
let e = K.filter((e) => !(b.alwaysDisabled || []).includes(e.value));
|
|
2095
|
+
return e.length > 0 && e.every((e) => Array.isArray(n) && n.includes(e.value));
|
|
2096
|
+
}, [
|
|
2097
|
+
b.enabled,
|
|
2098
|
+
b.showSelectAll,
|
|
2099
|
+
b.alwaysDisabled,
|
|
2100
|
+
K,
|
|
2101
|
+
n
|
|
2102
|
+
]), oe = g(() => {
|
|
2103
|
+
if (b.enabled && Array.isArray(n)) {
|
|
2104
|
+
let e = n.length;
|
|
2105
|
+
return e === 0 ? y : e > (b.maxDisplayItems || 2) ? `${e} items selected` : n.map((e) => {
|
|
2106
|
+
let t = G.find((t) => t.value === e);
|
|
2107
|
+
return t ? t.name : e;
|
|
2108
|
+
}).join(", ");
|
|
2109
|
+
}
|
|
2110
|
+
if (n) {
|
|
2111
|
+
let e = G.find((e) => e.value === n);
|
|
2112
|
+
return e ? e.name : y;
|
|
2113
|
+
}
|
|
2114
|
+
return y;
|
|
2115
|
+
}, [
|
|
2116
|
+
n,
|
|
2117
|
+
G,
|
|
2118
|
+
b.enabled,
|
|
2119
|
+
b.maxDisplayItems,
|
|
2120
|
+
y
|
|
2121
|
+
]), se = g(() => b.enabled ? !Array.isArray(n) || n.length === 0 : n == null || n === "", [n, b.enabled]), ce = u((e, t) => {
|
|
2122
|
+
if (!D.current) return;
|
|
2123
|
+
let n = D.current, r = Math.max(1, Math.min(3, t));
|
|
2124
|
+
if (e === -1 && n.scrollTop > 0 ? n.scrollTop -= r : e === 1 && n.scrollTop < n.scrollHeight - n.clientHeight && (n.scrollTop += r), U.isScrolling && U.direction === e) {
|
|
2125
|
+
let n = window.setTimeout(() => ce(e, t), 100);
|
|
2126
|
+
W((e) => ({
|
|
2127
|
+
...e,
|
|
2128
|
+
timeoutId: n
|
|
2129
|
+
}));
|
|
2130
|
+
}
|
|
2131
|
+
}, [U.isScrolling, U.direction]), le = u((e, t) => {
|
|
2132
|
+
U.timeoutId && clearTimeout(U.timeoutId), W({
|
|
2133
|
+
isScrolling: !0,
|
|
2134
|
+
direction: e,
|
|
2135
|
+
speed: t,
|
|
2136
|
+
timeoutId: null
|
|
2137
|
+
});
|
|
2138
|
+
let n = window.setTimeout(() => ce(e, t), 100);
|
|
2139
|
+
W((e) => ({
|
|
2140
|
+
...e,
|
|
2141
|
+
timeoutId: n
|
|
2142
|
+
}));
|
|
2143
|
+
}, [ce, U.timeoutId]), ue = u(() => {
|
|
2144
|
+
U.timeoutId && clearTimeout(U.timeoutId), W({
|
|
2145
|
+
isScrolling: !1,
|
|
2146
|
+
direction: 0,
|
|
2147
|
+
speed: 0,
|
|
2148
|
+
timeoutId: null
|
|
2149
|
+
});
|
|
2150
|
+
}, [U.timeoutId]), de = u(() => {
|
|
2151
|
+
l || (A(!0), I(b.enabled ? -1 : re.findIndex((e) => e.value === n)));
|
|
2152
|
+
}, [
|
|
2153
|
+
l,
|
|
2154
|
+
b.enabled,
|
|
2155
|
+
re,
|
|
2156
|
+
n
|
|
2157
|
+
]), q = u(() => {
|
|
2158
|
+
A(!1), P(""), I(-1), ue();
|
|
2159
|
+
}, [ue]), fe = u(() => {
|
|
2160
|
+
k ? q() : de();
|
|
2161
|
+
}, [
|
|
2162
|
+
k,
|
|
2163
|
+
de,
|
|
2164
|
+
q
|
|
2165
|
+
]), pe = u((e) => {
|
|
2166
|
+
p({ target: {
|
|
2167
|
+
name: h,
|
|
2168
|
+
value: e,
|
|
2169
|
+
type: "select"
|
|
2170
|
+
} });
|
|
2171
|
+
}, [p, h]), me = u((e) => {
|
|
2172
|
+
if ((b.alwaysDisabled || []).includes(e.value)) return;
|
|
2173
|
+
let t = (b.defaultSelected || []).includes(e.value), r = Array.isArray(n) ? [...n] : [], i = r.findIndex((t) => t === e.value);
|
|
2174
|
+
if (i < 0) {
|
|
2175
|
+
if (b.maxSelection && r.length >= b.maxSelection) return;
|
|
2176
|
+
if (C.enabled) {
|
|
2177
|
+
let t = Math.max(C.fixedItems || 0, (b.defaultSelected || []).length, r.length);
|
|
2178
|
+
r.splice(t, 0, e.value);
|
|
2179
|
+
} else r.push(e.value);
|
|
2180
|
+
} else {
|
|
2181
|
+
if (t) return;
|
|
2182
|
+
let e = b.minSelection || 0;
|
|
2183
|
+
if (e > 0 && r.length <= e) return;
|
|
2184
|
+
r.splice(i, 1);
|
|
2185
|
+
}
|
|
2186
|
+
pe(r);
|
|
2187
|
+
}, [
|
|
2188
|
+
b.alwaysDisabled,
|
|
2189
|
+
b.defaultSelected,
|
|
2190
|
+
b.maxSelection,
|
|
2191
|
+
b.minSelection,
|
|
2192
|
+
C.enabled,
|
|
2193
|
+
C.fixedItems,
|
|
2194
|
+
n,
|
|
2195
|
+
pe
|
|
2196
|
+
]), he = u((e) => {
|
|
2197
|
+
e.disabled || (b.enabled ? me(e) : (pe(e.value), q()));
|
|
2198
|
+
}, [
|
|
2199
|
+
b.enabled,
|
|
2200
|
+
me,
|
|
2201
|
+
pe,
|
|
2202
|
+
q
|
|
2203
|
+
]), ge = u(() => {
|
|
2204
|
+
if (!b.enabled) return;
|
|
2205
|
+
let e = K.filter((e) => !(b.alwaysDisabled || []).includes(e.value)), t = e.every((e) => Array.isArray(n) && n.includes(e.value)), r = Array.isArray(n) ? n : [], i = r.length, a = (b.defaultSelected || []).length, o = b.maxSelection && i >= b.maxSelection;
|
|
2206
|
+
if (t || o && i > a) {
|
|
2207
|
+
let e = b.minSelection || 0, t = r.filter((e) => (b.defaultSelected || []).includes(e) || (b.alwaysDisabled || []).includes(e)), n = Math.max(e, t.length), i = [...t];
|
|
2208
|
+
n > i.length && r.forEach((e) => {
|
|
2209
|
+
i.length >= n || i.includes(e) || i.push(e);
|
|
2210
|
+
}), pe(i);
|
|
2211
|
+
} else {
|
|
2212
|
+
let t = [...r];
|
|
2213
|
+
e.forEach((e) => {
|
|
2214
|
+
t.includes(e.value) || (!b.maxSelection || t.length < b.maxSelection) && t.push(e.value);
|
|
2215
|
+
}), pe(t);
|
|
2216
|
+
}
|
|
2217
|
+
}, [
|
|
2218
|
+
b.enabled,
|
|
2219
|
+
b.alwaysDisabled,
|
|
2220
|
+
b.defaultSelected,
|
|
2221
|
+
b.maxSelection,
|
|
2222
|
+
b.minSelection,
|
|
2223
|
+
K,
|
|
2224
|
+
n,
|
|
2225
|
+
pe
|
|
2226
|
+
]), _e = u(() => {
|
|
2227
|
+
if (b.enabled) {
|
|
2228
|
+
let e = b.minSelection || 0, t = b.defaultSelected || [], r = Math.max(e, t.length), i = [...t];
|
|
2229
|
+
r > i.length && (Array.isArray(n) ? n : []).forEach((e) => {
|
|
2230
|
+
i.length >= r || i.includes(e) || i.push(e);
|
|
2231
|
+
}), pe(i);
|
|
2232
|
+
} else pe("");
|
|
2233
|
+
q();
|
|
2234
|
+
}, [
|
|
2235
|
+
b.enabled,
|
|
2236
|
+
b.defaultSelected,
|
|
2237
|
+
b.minSelection,
|
|
2238
|
+
n,
|
|
2239
|
+
pe,
|
|
2240
|
+
q
|
|
2241
|
+
]), ve = u(() => {
|
|
2242
|
+
I((e) => e >= K.length - 1 ? 0 : e + 1);
|
|
2243
|
+
}, [K.length]), ye = u(() => {
|
|
2244
|
+
I((e) => e <= 0 ? K.length - 1 : e - 1);
|
|
2245
|
+
}, [K.length]), be = u(() => I(0), []), xe = u(() => {
|
|
2246
|
+
I(K.length - 1);
|
|
2247
|
+
}, [K.length]), Se = u(() => {
|
|
2248
|
+
let e = F >= 0 ? F : N ? 0 : -1;
|
|
2249
|
+
if (e < 0 || e >= K.length) return b.enabled || (w.current?.focus(), q()), !1;
|
|
2250
|
+
let t = K[e];
|
|
2251
|
+
return he(t), b.enabled ? !0 : (w.current?.focus(), q(), !0);
|
|
2252
|
+
}, [
|
|
2253
|
+
K,
|
|
2254
|
+
F,
|
|
2255
|
+
N,
|
|
2256
|
+
he,
|
|
2257
|
+
b.enabled,
|
|
2258
|
+
q
|
|
2259
|
+
]), Ce = u((e) => {
|
|
2260
|
+
let t = e.target.value;
|
|
2261
|
+
if (P(t), !t) {
|
|
2262
|
+
I(-1);
|
|
2263
|
+
return;
|
|
2264
|
+
}
|
|
2265
|
+
let n = pt(re, t, x);
|
|
2266
|
+
I((e) => {
|
|
2267
|
+
let r = mt(n, t, -1);
|
|
2268
|
+
if (r >= 0) return r;
|
|
2269
|
+
if (t.length > 1 && [...t].every((e) => e === t[0])) {
|
|
2270
|
+
let r = mt(n, t[0], e);
|
|
2271
|
+
if (r >= 0) return r;
|
|
2272
|
+
}
|
|
2273
|
+
return x.enabled ? n.length ? 0 : -1 : e;
|
|
2274
|
+
});
|
|
2275
|
+
}, [re, i]), we = u((e) => {
|
|
2276
|
+
let t = e.target;
|
|
2277
|
+
if (!T.current || w.current && w.current.contains(t) || T.current.contains(t)) return;
|
|
2278
|
+
let n = t.closest("[data-select-dropdown]");
|
|
2279
|
+
n && n === T.current || q();
|
|
2280
|
+
}, [q]), Te = u((e, t) => {
|
|
2281
|
+
!C.enabled || !b.enabled || (R(t), e.dataTransfer.effectAllowed = "move");
|
|
2282
|
+
}, [C.enabled, b.enabled]), Ee = u((e, t) => {
|
|
2283
|
+
if (!(!C.enabled || !b.enabled || !L) && (e.preventDefault(), e.dataTransfer.dropEffect = "move", z(t), C.autoScroll !== !1 && D.current)) {
|
|
2284
|
+
let t = D.current, n = t.getBoundingClientRect(), r = e.clientY - n.top, i = n.bottom - e.clientY;
|
|
2285
|
+
if (r < 40 && t.scrollTop > 0) {
|
|
2286
|
+
let e = Math.max(1, Math.floor((40 - r) / 10));
|
|
2287
|
+
le(-1, e);
|
|
2288
|
+
} else if (i < 40 && t.scrollTop < t.scrollHeight - t.clientHeight) {
|
|
2289
|
+
let e = Math.max(1, Math.floor((40 - i) / 10));
|
|
2290
|
+
le(1, e);
|
|
2291
|
+
} else ue();
|
|
2292
|
+
}
|
|
2293
|
+
}, [
|
|
2294
|
+
C,
|
|
2295
|
+
b.enabled,
|
|
2296
|
+
L,
|
|
2297
|
+
le,
|
|
2298
|
+
ue
|
|
2299
|
+
]), De = u((e, t) => {
|
|
2300
|
+
if (!C.enabled || !b.enabled || !L) return;
|
|
2301
|
+
e.preventDefault();
|
|
2302
|
+
let r = Array.isArray(n) ? [...n] : [], i = r.includes(t.value), a = r.includes(L.value);
|
|
2303
|
+
if (!i || !a) {
|
|
2304
|
+
R(null), z(null);
|
|
2305
|
+
return;
|
|
2306
|
+
}
|
|
2307
|
+
let o = (b.defaultSelected || []).slice(0, Math.min(C.fixedItems || 0, (b.defaultSelected || []).length)), s = o.includes(L.value), c = o.includes(t.value);
|
|
2308
|
+
if (s || c) {
|
|
2309
|
+
R(null), z(null);
|
|
2310
|
+
return;
|
|
2311
|
+
}
|
|
2312
|
+
if (r.indexOf(t.value) < (C.fixedItems || 0)) {
|
|
2313
|
+
R(null), z(null);
|
|
2314
|
+
return;
|
|
2315
|
+
}
|
|
2316
|
+
let l = r.indexOf(L.value), u = r.indexOf(t.value);
|
|
2317
|
+
l !== u && l >= (C.fixedItems || 0) && (r.splice(l, 1), r.splice(u, 0, L.value), pe(r), C.onReorder && C.onReorder(r)), R(null), z(null);
|
|
2318
|
+
}, [
|
|
2319
|
+
C.enabled,
|
|
2320
|
+
C.fixedItems,
|
|
2321
|
+
C.onReorder,
|
|
2322
|
+
b.enabled,
|
|
2323
|
+
b.defaultSelected,
|
|
2324
|
+
L,
|
|
2325
|
+
n,
|
|
2326
|
+
pe
|
|
2327
|
+
]), Oe = u(() => {
|
|
2328
|
+
R(null), z(null), ue();
|
|
2329
|
+
}, [ue]), ke = u((e) => {}, []), Ae = u((e) => {}, []);
|
|
2330
|
+
return f(() => {
|
|
2331
|
+
if (F >= 0 && D.current && k) {
|
|
2332
|
+
let e = D.current, t = b.enabled && b.showSelectAll && K.length > 0 ? F + 1 : F, n = e.children[t];
|
|
2333
|
+
n && n.scrollIntoView({
|
|
2334
|
+
behavior: "smooth",
|
|
2335
|
+
block: "nearest",
|
|
2336
|
+
inline: "nearest"
|
|
2337
|
+
});
|
|
2338
|
+
}
|
|
2339
|
+
}, [F, k]), f(() => {
|
|
2340
|
+
k && x.enabled && d && E.current && setTimeout(() => {
|
|
2341
|
+
E.current?.focus();
|
|
2342
|
+
}, 10);
|
|
2343
|
+
}, [
|
|
2344
|
+
k,
|
|
2345
|
+
x.enabled,
|
|
2346
|
+
d
|
|
2347
|
+
]), f(() => {
|
|
2348
|
+
if (k) return document.addEventListener("mousedown", we), () => {
|
|
2349
|
+
document.removeEventListener("mousedown", we);
|
|
2350
|
+
};
|
|
2351
|
+
}, [k, we]), f(() => () => {
|
|
2352
|
+
U.timeoutId && clearTimeout(U.timeoutId);
|
|
2353
|
+
}, []), {
|
|
2354
|
+
state: {
|
|
2355
|
+
isOpen: k,
|
|
2356
|
+
selectedIndex: j,
|
|
2357
|
+
searchTerm: N,
|
|
2358
|
+
filteredOptions: K,
|
|
2359
|
+
highlightedIndex: F,
|
|
2360
|
+
draggedItem: L,
|
|
2361
|
+
draggedOver: ee,
|
|
2362
|
+
collapsedGroups: B,
|
|
2363
|
+
isInModal: H
|
|
2364
|
+
},
|
|
2365
|
+
refs: {
|
|
2366
|
+
triggerRef: w,
|
|
2367
|
+
dropdownRef: T,
|
|
2368
|
+
searchInputRef: E,
|
|
2369
|
+
optionsListRef: D,
|
|
2370
|
+
selectRef: O
|
|
2371
|
+
},
|
|
2372
|
+
handlers: {
|
|
2373
|
+
handleOpen: de,
|
|
2374
|
+
handleClose: q,
|
|
2375
|
+
handleToggle: fe,
|
|
2376
|
+
handleSelect: he,
|
|
2377
|
+
handleMultiSelect: me,
|
|
2378
|
+
highlightNext: ve,
|
|
2379
|
+
highlightPrev: ye,
|
|
2380
|
+
highlightFirst: be,
|
|
2381
|
+
highlightLast: xe,
|
|
2382
|
+
pickHighlighted: Se,
|
|
2383
|
+
handleSearchChange: Ce,
|
|
2384
|
+
handleClickOutside: we,
|
|
2385
|
+
handleDragStart: Te,
|
|
2386
|
+
handleDragOver: Ee,
|
|
2387
|
+
handleDragEnd: Oe,
|
|
2388
|
+
handleDrop: De,
|
|
2389
|
+
handleSelectAll: ge,
|
|
2390
|
+
handleClear: _e,
|
|
2391
|
+
handleBlur: ke,
|
|
2392
|
+
handleFocus: Ae
|
|
2393
|
+
},
|
|
2394
|
+
computed: {
|
|
2395
|
+
normalizedOptions: G,
|
|
2396
|
+
selectedOptions: ie,
|
|
2397
|
+
isAllSelected: ae,
|
|
2398
|
+
displayValue: oe,
|
|
2399
|
+
isEmpty: se,
|
|
2400
|
+
hasError: !1
|
|
2401
|
+
}
|
|
2402
|
+
};
|
|
2403
|
+
}, Wt = (e) => {
|
|
2404
|
+
let t = getComputedStyle(e);
|
|
2405
|
+
return !!(t.position !== "static" || t.transform !== "none" || t.perspective !== "none" || t.filter && t.filter !== "none" || /paint|layout|strict|content/.test(t.contain || "") || /transform|perspective|filter/.test(t.willChange || ""));
|
|
2406
|
+
}, Gt = (e) => {
|
|
2407
|
+
for (let t = e; t && t !== document.documentElement; t = t.parentElement) if (Wt(t)) return t;
|
|
2408
|
+
return null;
|
|
2409
|
+
}, Kt = (e) => {
|
|
2410
|
+
let t = e.getBoundingClientRect();
|
|
2411
|
+
return {
|
|
2412
|
+
rect: {
|
|
2413
|
+
top: t.top,
|
|
2414
|
+
left: t.left
|
|
2415
|
+
},
|
|
2416
|
+
clientTop: e.clientTop,
|
|
2417
|
+
clientLeft: e.clientLeft,
|
|
2418
|
+
scrollTop: e.scrollTop,
|
|
2419
|
+
scrollLeft: e.scrollLeft
|
|
2420
|
+
};
|
|
2421
|
+
}, qt = (e) => {
|
|
2422
|
+
let t = Gt(e);
|
|
2423
|
+
return lt(t ? Kt(t) : null, {
|
|
2424
|
+
x: window.scrollX || document.documentElement.scrollLeft,
|
|
2425
|
+
y: window.scrollY || document.documentElement.scrollTop
|
|
2426
|
+
});
|
|
2427
|
+
}, Jt = (e) => typeof e.getBoundingClientRect == "function", Yt = (e) => {
|
|
2428
|
+
if (Jt(e)) {
|
|
2429
|
+
let t = e.getBoundingClientRect();
|
|
2430
|
+
return {
|
|
2431
|
+
top: t.top,
|
|
2432
|
+
left: t.left,
|
|
2433
|
+
width: t.width,
|
|
2434
|
+
height: t.height
|
|
2435
|
+
};
|
|
2436
|
+
}
|
|
2437
|
+
return {
|
|
2438
|
+
top: e.top,
|
|
2439
|
+
left: e.left,
|
|
2440
|
+
width: e.width ?? 0,
|
|
2441
|
+
height: e.height ?? 0
|
|
2442
|
+
};
|
|
2443
|
+
}, Xt = ({ anchor: e, container: t, contentEl: n, ...r }) => {
|
|
2444
|
+
let i = Yt(e);
|
|
2445
|
+
return ct({
|
|
2446
|
+
...r,
|
|
2447
|
+
anchor: {
|
|
2448
|
+
top: i.top,
|
|
2449
|
+
left: i.left,
|
|
2450
|
+
width: i.width,
|
|
2451
|
+
height: i.height
|
|
2452
|
+
},
|
|
2453
|
+
content: {
|
|
2454
|
+
width: n?.offsetWidth ?? 0,
|
|
2455
|
+
height: n?.offsetHeight ?? 0
|
|
2456
|
+
},
|
|
2457
|
+
viewport: {
|
|
2458
|
+
width: document.documentElement.clientWidth || window.innerWidth,
|
|
2459
|
+
height: document.documentElement.clientHeight || window.innerHeight
|
|
2460
|
+
},
|
|
2461
|
+
origin: qt(t)
|
|
2462
|
+
});
|
|
2463
|
+
}, Zt = "data-ui-layer", Qt = { [Zt]: "" };
|
|
2464
|
+
function $t(e) {
|
|
2465
|
+
if (typeof document > "u") return !0;
|
|
2466
|
+
let t = document.querySelectorAll(`[${Zt}]`), n = t[t.length - 1];
|
|
2467
|
+
return !n || n === e || n.contains(e);
|
|
2468
|
+
}
|
|
2469
|
+
function en(e) {
|
|
2470
|
+
if (typeof document > "u") return !0;
|
|
2471
|
+
let t = document.activeElement;
|
|
2472
|
+
return !t || t === document.body || e.contains(t);
|
|
2473
|
+
}
|
|
2474
|
+
//#endregion
|
|
2475
|
+
//#region ../../shared-web-ui/src/Floating/scrollLock.ts
|
|
2476
|
+
var tn = 0, nn = null;
|
|
2477
|
+
function rn() {
|
|
2478
|
+
if (typeof document > "u") return () => void 0;
|
|
2479
|
+
if (tn === 0) {
|
|
2480
|
+
let e = document.body;
|
|
2481
|
+
nn = {
|
|
2482
|
+
overflow: e.style.overflow,
|
|
2483
|
+
paddingRight: e.style.paddingRight
|
|
2484
|
+
};
|
|
2485
|
+
let t = window.innerWidth - document.documentElement.clientWidth;
|
|
2486
|
+
if (t > 0) {
|
|
2487
|
+
let n = parseFloat(window.getComputedStyle(e).paddingRight) || 0;
|
|
2488
|
+
e.style.paddingRight = `${n + t}px`;
|
|
2489
|
+
}
|
|
2490
|
+
e.style.overflow = "hidden";
|
|
2491
|
+
}
|
|
2492
|
+
tn++;
|
|
2493
|
+
let e = !1;
|
|
2494
|
+
return () => {
|
|
2495
|
+
e || (e = !0, tn = Math.max(0, tn - 1), tn === 0 && nn && (document.body.style.overflow = nn.overflow, document.body.style.paddingRight = nn.paddingRight, nn = null));
|
|
2496
|
+
};
|
|
2497
|
+
}
|
|
2498
|
+
function an(e) {
|
|
2499
|
+
f(() => e ? rn() : void 0, [e]);
|
|
2500
|
+
}
|
|
2501
|
+
//#endregion
|
|
2502
|
+
//#region ../../shared-web-ui/src/Floating/useFloatingLayer.ts
|
|
2503
|
+
var on = "[aria-checked=\"true\"], [autofocus], a[href], button:not([disabled]):not([aria-hidden=\"true\"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
2504
|
+
function sn({ ref: e, onClose: t, onEscape: n, open: r = !0, anchorRef: i, closeOnEscape: a = !0, escapeNeedsFocus: o = !1, closeOnOutside: s = !0, closeOnScroll: c = !1, closeOnResize: l = !1, autoFocus: u = !1, restoreFocus: d = !0, lockScroll: p = !1 }) {
|
|
2505
|
+
return an(r && p), f(() => {
|
|
2506
|
+
if (!r) return;
|
|
2507
|
+
let t = document.activeElement, n = 0;
|
|
2508
|
+
return u && (n = window.setTimeout(() => {
|
|
2509
|
+
let t = e.current;
|
|
2510
|
+
if (!t || t.contains(document.activeElement)) return;
|
|
2511
|
+
if (u === "self") {
|
|
2512
|
+
t.focus({ preventScroll: !0 });
|
|
2513
|
+
return;
|
|
2514
|
+
}
|
|
2515
|
+
let n = typeof u == "string" ? u : on;
|
|
2516
|
+
(t.querySelector(n) ?? t).focus({ preventScroll: !0 });
|
|
2517
|
+
}, 0)), () => {
|
|
2518
|
+
if (n && window.clearTimeout(n), !d || !t || !document.contains(t)) return;
|
|
2519
|
+
let e = document.activeElement;
|
|
2520
|
+
(!e || e === document.body) && t.focus({ preventScroll: !0 });
|
|
2521
|
+
};
|
|
2522
|
+
}, [
|
|
2523
|
+
r,
|
|
2524
|
+
u,
|
|
2525
|
+
d,
|
|
2526
|
+
e
|
|
2527
|
+
]), f(() => {
|
|
2528
|
+
if (!r) return;
|
|
2529
|
+
let u = () => {
|
|
2530
|
+
let t = e.current;
|
|
2531
|
+
return t && $t(t) ? t : null;
|
|
2532
|
+
}, d = (r) => {
|
|
2533
|
+
!a || r.key !== "Escape" || !u() || o && !en(e.current) || (r.stopPropagation(), (n ?? t)());
|
|
2534
|
+
}, f = (n) => {
|
|
2535
|
+
if (!s) return;
|
|
2536
|
+
let r = n.target;
|
|
2537
|
+
e.current?.contains(r) || i?.current?.contains(r) || u() && t();
|
|
2538
|
+
}, p = (n) => {
|
|
2539
|
+
e.current && !e.current.contains(n.target) && u() && t();
|
|
2540
|
+
}, m = () => {
|
|
2541
|
+
u() && t();
|
|
2542
|
+
};
|
|
2543
|
+
return a && document.addEventListener("keydown", d, !0), s && document.addEventListener("pointerdown", f, !0), c && window.addEventListener("scroll", p, !0), l && window.addEventListener("resize", m), () => {
|
|
2544
|
+
document.removeEventListener("keydown", d, !0), document.removeEventListener("pointerdown", f, !0), window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", m);
|
|
2545
|
+
};
|
|
2546
|
+
}, [
|
|
2547
|
+
r,
|
|
2548
|
+
t,
|
|
2549
|
+
n,
|
|
2550
|
+
i,
|
|
2551
|
+
e,
|
|
2552
|
+
a,
|
|
2553
|
+
o,
|
|
2554
|
+
s,
|
|
2555
|
+
c,
|
|
2556
|
+
l
|
|
2557
|
+
]), g(() => ({ layerProps: { [Zt]: "" } }), []);
|
|
2558
|
+
}
|
|
2559
|
+
var cn = {
|
|
2560
|
+
size_xxs: "_size_xxs_11b03_28",
|
|
2561
|
+
size_xs: "_size_xs_11b03_36",
|
|
2562
|
+
size_small: "_size_small_11b03_44",
|
|
2563
|
+
size_medium: "_size_medium_11b03_52",
|
|
2564
|
+
size_large: "_size_large_11b03_60",
|
|
2565
|
+
size_xl: "_size_xl_11b03_68",
|
|
2566
|
+
popup: "_popup_11b03_80",
|
|
2567
|
+
joined: "_joined_11b03_89",
|
|
2568
|
+
floating: "_floating_11b03_107",
|
|
2569
|
+
scroller: "_scroller_11b03_112",
|
|
2570
|
+
list: "_list_11b03_121",
|
|
2571
|
+
row: "_row_11b03_128",
|
|
2572
|
+
rowDisabled: "_rowDisabled_11b03_140",
|
|
2573
|
+
rowSelected: "_rowSelected_11b03_140",
|
|
2574
|
+
rowCursor: "_rowCursor_11b03_145",
|
|
2575
|
+
rowMulti: "_rowMulti_11b03_162",
|
|
2576
|
+
rowContent: "_rowContent_11b03_178",
|
|
2577
|
+
linePrimary: "_linePrimary_11b03_186",
|
|
2578
|
+
lineSecondary: "_lineSecondary_11b03_194",
|
|
2579
|
+
lineTertiary: "_lineTertiary_11b03_199",
|
|
2580
|
+
mark: "_mark_11b03_217",
|
|
2581
|
+
groupHeader: "_groupHeader_11b03_234",
|
|
2582
|
+
empty: "_empty_11b03_249",
|
|
2583
|
+
loadingState: "_loadingState_11b03_250"
|
|
2584
|
+
}, Q = {
|
|
2585
|
+
root: "_root_x4oc4_5",
|
|
2586
|
+
inModal: "_inModal_x4oc4_17",
|
|
2587
|
+
wrapper: "_wrapper_x4oc4_21",
|
|
2588
|
+
trigger: "_trigger_x4oc4_36",
|
|
2589
|
+
triggerOpen: "_triggerOpen_x4oc4_44",
|
|
2590
|
+
triggerDisabled: "_triggerDisabled_x4oc4_44",
|
|
2591
|
+
triggerText: "_triggerText_x4oc4_57",
|
|
2592
|
+
arrow: "_arrow_x4oc4_70",
|
|
2593
|
+
arrowOpen: "_arrowOpen_x4oc4_81",
|
|
2594
|
+
clearBtn: "_clearBtn_x4oc4_86",
|
|
2595
|
+
dropdown: "_dropdown_x4oc4_122",
|
|
2596
|
+
dropdownAppear: "_dropdownAppear_x4oc4_1",
|
|
2597
|
+
dropdownInModal: "_dropdownInModal_x4oc4_128",
|
|
2598
|
+
dropdownAppearUp: "_dropdownAppearUp_x4oc4_1",
|
|
2599
|
+
searchWrapper: "_searchWrapper_x4oc4_175",
|
|
2600
|
+
searchIcon: "_searchIcon_x4oc4_214",
|
|
2601
|
+
searchInput: "_searchInput_x4oc4_226",
|
|
2602
|
+
selectAll: "_selectAll_x4oc4_254",
|
|
2603
|
+
optionText: "_optionText_x4oc4_265",
|
|
2604
|
+
size_xxs: "_size_xxs_x4oc4_278",
|
|
2605
|
+
size_xs: "_size_xs_x4oc4_279",
|
|
2606
|
+
size_small: "_size_small_x4oc4_280",
|
|
2607
|
+
size_medium: "_size_medium_x4oc4_281",
|
|
2608
|
+
size_large: "_size_large_x4oc4_282",
|
|
2609
|
+
size_xl: "_size_xl_x4oc4_283",
|
|
2610
|
+
chips: "_chips_x4oc4_308",
|
|
2611
|
+
chip: "_chip_x4oc4_308",
|
|
2612
|
+
chipRemove: "_chipRemove_x4oc4_325",
|
|
2613
|
+
loading: "_loading_x4oc4_350",
|
|
2614
|
+
spinner: "_spinner_x4oc4_356",
|
|
2615
|
+
spin: "_spin_x4oc4_356",
|
|
2616
|
+
optionsWrapper: "_optionsWrapper_x4oc4_390",
|
|
2617
|
+
selected: "_selected_x4oc4_416",
|
|
2618
|
+
option: "_option_x4oc4_265"
|
|
2619
|
+
}, ln = (e, t) => {
|
|
2620
|
+
if (!t) return e;
|
|
2621
|
+
let n = RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
|
|
2622
|
+
return e.split(n).map((e, t) => t % 2 == 1 ? /* @__PURE__ */ b("mark", {
|
|
2623
|
+
className: cn.mark,
|
|
2624
|
+
children: e
|
|
2625
|
+
}, t) : /* @__PURE__ */ b("span", { children: e }, t));
|
|
2626
|
+
}, un = l(({ options: e = [], value: t, onChange: r, onBlur: i, name: a, label: o = "", placeholder: c, defaultText: l = "--Select--", hint: d = "", error: y = "", disabled: C, readOnly: w, required: T = !1, autoFocus: E = !1, autoFocusSearch: D = !1, tabIndex: O, clearable: k = !1, multiSelect: A = !1, search: j = !0, sort: M = !0, reorder: N = !1, group: P = !1, virtualScroll: F = !1, keyboard: I = {}, position: L, emptyState: R = {}, loading: ee, className: z = "", tooltip: B, tooltipTrigger: V = "icon", labelClassName: H = "", triggerClassName: te = "", dropdownClassName: U = "", optionClassName: W = "", selectedClassName: G = "", disabledClassName: ne = "", style: re = {}, parentDivStyle: K = {}, size: ie, variant: ae, layout: oe, renderTrigger: se, renderOption: ce, renderSelectedValue: le, renderChip: ue, onOpen: de, onClose: q, onSearch: fe, onSelect: pe, onDeselect: me, onClear: he, onKeyDown: ge, onFocus: _e, rowIndex: ve, cellindex: ye, onCellFocus: be, registerCellRef: xe, "aria-label": Se, "aria-labelledby": Ce, "aria-describedby": we, "aria-required": Te, "aria-invalid": Ee, ...De }, Oe) => {
|
|
2627
|
+
let ke = xt({
|
|
2628
|
+
size: ie,
|
|
2629
|
+
variant: ae,
|
|
2630
|
+
layout: oe,
|
|
2631
|
+
disabled: C,
|
|
2632
|
+
readOnly: w
|
|
2633
|
+
}), Ae = p(), J = g(() => typeof A == "boolean" ? { enabled: A } : A, [A]), je = n(), Me = g(() => {
|
|
2634
|
+
let e = typeof L == "object" ? L : { position: L }, t = e.position ?? "auto";
|
|
2635
|
+
return {
|
|
2636
|
+
placement: t === "auto" || t === "bottom" ? "bottom-start" : t === "top" ? "top-start" : t,
|
|
2637
|
+
flip: e.flip ?? !0,
|
|
2638
|
+
offset: e.offset ?? 0,
|
|
2639
|
+
matchWidth: e.matchWidth ?? !0,
|
|
2640
|
+
portalContainer: e.portalContainer ?? null
|
|
2641
|
+
};
|
|
2642
|
+
}, [L]), Ne = Me.portalContainer ?? je, Ie = g(() => typeof j == "boolean" ? { enabled: j } : j, [j]), ze = g(() => typeof M == "boolean" ? {
|
|
2643
|
+
enabled: M,
|
|
2644
|
+
caseInsensitive: !0
|
|
2645
|
+
} : M, [M]), Be = g(() => typeof P == "boolean" ? { enabled: P } : P, [P]), { state: Ve, refs: He, handlers: Ue, computed: We } = Ut({
|
|
2646
|
+
options: e,
|
|
2647
|
+
value: t,
|
|
2648
|
+
multiSelect: J,
|
|
2649
|
+
search: Ie,
|
|
2650
|
+
sort: ze,
|
|
2651
|
+
reorder: N,
|
|
2652
|
+
group: P,
|
|
2653
|
+
disabled: ke.disabled || ke.readOnly,
|
|
2654
|
+
autoFocusSearch: D,
|
|
2655
|
+
onChange: r,
|
|
2656
|
+
onBlur: i,
|
|
2657
|
+
name: a,
|
|
2658
|
+
defaultText: l
|
|
2659
|
+
}), { isOpen: Ge, searchTerm: Ke, filteredOptions: qe, highlightedIndex: Je, draggedItem: Ye, draggedOver: Y, isInModal: X } = Ve, Xe = g(() => new Map(qe.map((e, t) => [e.value, t])), [qe]), { triggerRef: Ze, dropdownRef: Qe, searchInputRef: $e, optionsListRef: et, selectRef: tt } = He, { handleToggle: nt, handleSelect: rt, highlightNext: it, highlightPrev: at, highlightFirst: ot, highlightLast: st, pickHighlighted: ct, handleSearchChange: lt, handleDragStart: dt, handleDragOver: ft, handleDragEnd: pt, handleDrop: mt, handleSelectAll: ht, handleClear: gt, handleBlur: _t, handleFocus: vt, handleClose: yt } = Ue, { normalizedOptions: bt, selectedOptions: St, isAllSelected: wt, displayValue: Tt, isEmpty: Et } = We, Dt = Ze, [Ot, At] = v(null), jt = _(null), Mt = u(() => {
|
|
2660
|
+
if (!Ge || !Ze.current) {
|
|
2661
|
+
At(null);
|
|
2662
|
+
return;
|
|
2663
|
+
}
|
|
2664
|
+
let e = Xt({
|
|
2665
|
+
anchor: Ze.current,
|
|
2666
|
+
container: Ne,
|
|
2667
|
+
contentEl: Qe.current,
|
|
2668
|
+
placement: Me.placement,
|
|
2669
|
+
offset: Me.offset,
|
|
2670
|
+
matchAnchorWidth: Me.matchWidth,
|
|
2671
|
+
flip: Me.flip,
|
|
2672
|
+
shift: !0
|
|
2673
|
+
}), t = e.width ?? Ze.current.getBoundingClientRect().width;
|
|
2674
|
+
At((n) => n && n.top === e.top && n.left === e.left && n.width === t && n.placement === e.placement ? n : {
|
|
2675
|
+
top: e.top,
|
|
2676
|
+
left: e.left,
|
|
2677
|
+
width: t,
|
|
2678
|
+
placement: e.placement
|
|
2679
|
+
});
|
|
2680
|
+
}, [
|
|
2681
|
+
Ge,
|
|
2682
|
+
Ne,
|
|
2683
|
+
Me,
|
|
2684
|
+
Qe
|
|
2685
|
+
]);
|
|
2686
|
+
h(() => {
|
|
2687
|
+
Ge && Mt();
|
|
2688
|
+
}), f(() => {
|
|
2689
|
+
if (!Ge) {
|
|
2690
|
+
At(null);
|
|
2691
|
+
return;
|
|
2692
|
+
}
|
|
2693
|
+
Mt();
|
|
2694
|
+
let e = () => {
|
|
2695
|
+
jt.current && cancelAnimationFrame(jt.current), jt.current = requestAnimationFrame(Mt);
|
|
2696
|
+
}, t = () => {
|
|
2697
|
+
Mt();
|
|
2698
|
+
};
|
|
2699
|
+
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", t), () => {
|
|
2700
|
+
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", t), jt.current && cancelAnimationFrame(jt.current);
|
|
2701
|
+
};
|
|
2702
|
+
}, [Ge, Mt]);
|
|
2703
|
+
let Nt = _(!1);
|
|
2704
|
+
f(() => {
|
|
2705
|
+
if (!Nt.current) {
|
|
2706
|
+
Nt.current = !0;
|
|
2707
|
+
return;
|
|
2708
|
+
}
|
|
2709
|
+
Ge ? de?.() : q?.();
|
|
2710
|
+
}, [
|
|
2711
|
+
Ge,
|
|
2712
|
+
de,
|
|
2713
|
+
q
|
|
2714
|
+
]);
|
|
2715
|
+
let Pt = _(!1);
|
|
2716
|
+
f(() => {
|
|
2717
|
+
if (!Pt.current) {
|
|
2718
|
+
Pt.current = !0;
|
|
2719
|
+
return;
|
|
2720
|
+
}
|
|
2721
|
+
Ie.enabled && fe?.(Ke);
|
|
2722
|
+
}, [
|
|
2723
|
+
Ke,
|
|
2724
|
+
fe,
|
|
2725
|
+
Ie.enabled
|
|
2726
|
+
]);
|
|
2727
|
+
let Ft = _(0), Lt = (e, t) => {
|
|
2728
|
+
if (!e || e.target !== Ze.current || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
2729
|
+
let n = Date.now(), r = t || !Ie.enabled && n - Ft.current > 800 ? "" : Ke;
|
|
2730
|
+
if (e.key === "Backspace") {
|
|
2731
|
+
!t && r && lt({ target: { value: r.slice(0, -1) } });
|
|
2732
|
+
return;
|
|
2733
|
+
}
|
|
2734
|
+
e.key.length !== 1 || e.key === " " && !r || (Ft.current = n, lt({ target: { value: r + e.key } }));
|
|
2735
|
+
}, Z = Ct({
|
|
2736
|
+
widget: "select",
|
|
2737
|
+
elementRef: Ze,
|
|
2738
|
+
id: Ae,
|
|
2739
|
+
keyboard: I,
|
|
2740
|
+
size: ie,
|
|
2741
|
+
variant: ae,
|
|
2742
|
+
layout: oe,
|
|
2743
|
+
disabled: C,
|
|
2744
|
+
readOnly: w,
|
|
2745
|
+
onFocus: _e,
|
|
2746
|
+
onKeyDown: ge,
|
|
2747
|
+
open: Ge,
|
|
2748
|
+
onOpenChange: u((e, t) => {
|
|
2749
|
+
e !== Ge && nt();
|
|
2750
|
+
}, [Ge, nt]),
|
|
2751
|
+
hasOptions: qe.length > 0,
|
|
2752
|
+
multi: J.enabled,
|
|
2753
|
+
rowIndex: ve,
|
|
2754
|
+
cellindex: ye,
|
|
2755
|
+
onCellFocus: be,
|
|
2756
|
+
registerCellRef: xe,
|
|
2757
|
+
onFieldAction: (e, t) => {
|
|
2758
|
+
switch (e) {
|
|
2759
|
+
case "open":
|
|
2760
|
+
Lt(t, !Ge);
|
|
2761
|
+
break;
|
|
2762
|
+
case "native":
|
|
2763
|
+
Ge && Lt(t, !1);
|
|
2764
|
+
break;
|
|
2765
|
+
case "highlightNext":
|
|
2766
|
+
it();
|
|
2767
|
+
break;
|
|
2768
|
+
case "highlightPrev":
|
|
2769
|
+
at();
|
|
2770
|
+
break;
|
|
2771
|
+
case "highlightFirst":
|
|
2772
|
+
ot();
|
|
2773
|
+
break;
|
|
2774
|
+
case "highlightLast":
|
|
2775
|
+
st();
|
|
2776
|
+
break;
|
|
2777
|
+
case "pick":
|
|
2778
|
+
case "toggleOption":
|
|
2779
|
+
ct();
|
|
2780
|
+
break;
|
|
2781
|
+
default: break;
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
});
|
|
2785
|
+
m(Oe, () => Z.handle, [Z.handle]);
|
|
2786
|
+
let { size: Rt, variant: zt, layout: Vt, disabled: Ht, readOnly: Wt } = Z.surface;
|
|
2787
|
+
Z.ids.field;
|
|
2788
|
+
let Gt = Z.handlers.onKeyDown, Kt = (e) => {
|
|
2789
|
+
let t = e.relatedTarget;
|
|
2790
|
+
if (t && Qe.current?.contains(t)) {
|
|
2791
|
+
_t(e);
|
|
2792
|
+
return;
|
|
2793
|
+
}
|
|
2794
|
+
Z.handlers.onBlur(e), _t(e);
|
|
2795
|
+
}, qt = (e) => {
|
|
2796
|
+
Z.handlers.onFocus(e), vt(e);
|
|
2797
|
+
}, Jt = (e, n) => {
|
|
2798
|
+
let r = J.enabled ? Array.isArray(t) && t.includes(e.value) : t === e.value, i = J.enabled && (J.defaultSelected || []).includes(e.value), a = (J.alwaysDisabled || []).includes(e.value), o = J.enabled && J.maxSelection && Array.isArray(t) && t.length >= J.maxSelection && !r, s = e.disabled || a || o, c = (J.defaultSelected || []).slice(0, Math.min(typeof N == "boolean" ? 0 : N.fixedItems || 0, (J.defaultSelected || []).length)), l = J.enabled && typeof N == "object" && N.enabled && c.includes(e.value), u = typeof N == "object" && N.enabled && J.enabled && r && !l && !a, d = Ye && Ye.value === e.value, f = Y && Y.value === e.value, p = n === Je, m = [
|
|
2799
|
+
...Fe({
|
|
2800
|
+
isCursor: p,
|
|
2801
|
+
isSelected: r,
|
|
2802
|
+
isDisabled: !!s,
|
|
2803
|
+
isMulti: J.enabled
|
|
2804
|
+
}).map((e) => cn[e] || ""),
|
|
2805
|
+
d ? Q.dragging : "",
|
|
2806
|
+
f ? Q.dragOver : "",
|
|
2807
|
+
i ? Q.defaultSelected : "",
|
|
2808
|
+
l ? Q.fixedItem : "",
|
|
2809
|
+
W
|
|
2810
|
+
].filter(Boolean).join(" ");
|
|
2811
|
+
return ce ? /* @__PURE__ */ b("li", {
|
|
2812
|
+
className: m,
|
|
2813
|
+
onClick: () => !s && rt(e),
|
|
2814
|
+
draggable: u || void 0,
|
|
2815
|
+
onDragStart: (t) => dt(t, e),
|
|
2816
|
+
onDragOver: (t) => ft(t, e),
|
|
2817
|
+
onDrop: (t) => mt(t, e),
|
|
2818
|
+
onDragEnd: pt,
|
|
2819
|
+
children: ce(e, r, p)
|
|
2820
|
+
}, e.value) : /* @__PURE__ */ x("li", {
|
|
2821
|
+
className: m,
|
|
2822
|
+
onClick: () => !s && rt(e),
|
|
2823
|
+
draggable: u || void 0,
|
|
2824
|
+
onDragStart: (t) => dt(t, e),
|
|
2825
|
+
onDragOver: (t) => ft(t, e),
|
|
2826
|
+
onDrop: (t) => mt(t, e),
|
|
2827
|
+
onDragEnd: pt,
|
|
2828
|
+
children: [
|
|
2829
|
+
J.enabled && /* @__PURE__ */ b("span", {
|
|
2830
|
+
className: Q.checkbox,
|
|
2831
|
+
children: /* @__PURE__ */ b(It, {
|
|
2832
|
+
onChange: () => {},
|
|
2833
|
+
name: String(e.value),
|
|
2834
|
+
checked: r,
|
|
2835
|
+
disabled: i || a || !!o,
|
|
2836
|
+
size: "small"
|
|
2837
|
+
})
|
|
2838
|
+
}),
|
|
2839
|
+
typeof N == "object" && N.enabled && J.enabled && r && /* @__PURE__ */ b("span", {
|
|
2840
|
+
className: l ? Q.fixedHandle : Q.dragHandle,
|
|
2841
|
+
title: l ? "Fixed position (cannot be moved)" : "Drag to reorder",
|
|
2842
|
+
children: l ? "🔒" : "⋮⋮"
|
|
2843
|
+
}),
|
|
2844
|
+
/* @__PURE__ */ x("span", {
|
|
2845
|
+
className: Q.optionText,
|
|
2846
|
+
children: [
|
|
2847
|
+
Ie.enabled && Ie.highlightMatches !== !1 ? ln(e.name, Ke) : e.name,
|
|
2848
|
+
i && /* @__PURE__ */ x("span", {
|
|
2849
|
+
className: Q.defaultIndicator,
|
|
2850
|
+
title: "Cannot be unchecked",
|
|
2851
|
+
children: [" ", "*"]
|
|
2852
|
+
}),
|
|
2853
|
+
a && /* @__PURE__ */ b("span", {
|
|
2854
|
+
className: Q.alwaysDisabledIndicator,
|
|
2855
|
+
title: "Always disabled",
|
|
2856
|
+
children: " ⊘"
|
|
2857
|
+
}),
|
|
2858
|
+
o && /* @__PURE__ */ b("span", {
|
|
2859
|
+
className: Q.maxSelectionIndicator,
|
|
2860
|
+
title: "Maximum selection reached",
|
|
2861
|
+
children: " ⚠"
|
|
2862
|
+
})
|
|
2863
|
+
]
|
|
2864
|
+
})
|
|
2865
|
+
]
|
|
2866
|
+
}, e.value);
|
|
2867
|
+
}, Yt = () => le ? le(t, bt) : /* @__PURE__ */ b("span", {
|
|
2868
|
+
className: Q.triggerText,
|
|
2869
|
+
children: Tt
|
|
2870
|
+
}), Zt = g(() => Re({
|
|
2871
|
+
size: Rt,
|
|
2872
|
+
variant: zt,
|
|
2873
|
+
error: !!y,
|
|
2874
|
+
disabled: Ht,
|
|
2875
|
+
readOnly: Wt,
|
|
2876
|
+
hasAffix: !0,
|
|
2877
|
+
popupOpen: Ge
|
|
2878
|
+
}).map((e) => Bt[e]).filter(Boolean).join(" "), [
|
|
2879
|
+
Rt,
|
|
2880
|
+
zt,
|
|
2881
|
+
y,
|
|
2882
|
+
Ht,
|
|
2883
|
+
Wt,
|
|
2884
|
+
Ge
|
|
2885
|
+
]);
|
|
2886
|
+
return /* @__PURE__ */ x(kt, {
|
|
2887
|
+
tooltip: B,
|
|
2888
|
+
tooltipTrigger: V,
|
|
2889
|
+
ref: tt,
|
|
2890
|
+
className: g(() => {
|
|
2891
|
+
let e = ut({
|
|
2892
|
+
size: Rt,
|
|
2893
|
+
isOpen: Ge,
|
|
2894
|
+
disabled: Ht,
|
|
2895
|
+
error: !!y,
|
|
2896
|
+
isInModal: X
|
|
2897
|
+
}).map((e) => Q[e]).filter(Boolean);
|
|
2898
|
+
return z && e.push(z), e.join(" ");
|
|
2899
|
+
}, [
|
|
2900
|
+
Rt,
|
|
2901
|
+
Ge,
|
|
2902
|
+
Ht,
|
|
2903
|
+
y,
|
|
2904
|
+
X,
|
|
2905
|
+
z
|
|
2906
|
+
]),
|
|
2907
|
+
layout: Vt,
|
|
2908
|
+
size: Rt,
|
|
2909
|
+
label: o,
|
|
2910
|
+
labelClassName: `${Ht ? Q.triggerDisabled : ""} ${H}`,
|
|
2911
|
+
labelFor: Ae,
|
|
2912
|
+
error: y,
|
|
2913
|
+
hint: d,
|
|
2914
|
+
required: T,
|
|
2915
|
+
disabled: Ht,
|
|
2916
|
+
style: {
|
|
2917
|
+
...re,
|
|
2918
|
+
...K
|
|
2919
|
+
},
|
|
2920
|
+
children: [/* @__PURE__ */ b("div", {
|
|
2921
|
+
className: Q.wrapper,
|
|
2922
|
+
children: se ? se({
|
|
2923
|
+
value: t,
|
|
2924
|
+
isOpen: Ge,
|
|
2925
|
+
disabled: Ht,
|
|
2926
|
+
onClick: nt,
|
|
2927
|
+
ref: Ze
|
|
2928
|
+
}) : /* @__PURE__ */ x("div", {
|
|
2929
|
+
...De,
|
|
2930
|
+
ref: Dt,
|
|
2931
|
+
className: [
|
|
2932
|
+
Zt,
|
|
2933
|
+
Q.trigger,
|
|
2934
|
+
Ge ? Q.triggerOpen : "",
|
|
2935
|
+
Ht ? Q.triggerDisabled : "",
|
|
2936
|
+
te
|
|
2937
|
+
].filter(Boolean).join(" "),
|
|
2938
|
+
onClick: nt,
|
|
2939
|
+
onKeyDown: Gt,
|
|
2940
|
+
onBlur: Kt,
|
|
2941
|
+
onFocus: qt,
|
|
2942
|
+
tabIndex: Ht ? -1 : O || 0,
|
|
2943
|
+
"data-popup-placement": Ge ? Ot?.placement : void 0,
|
|
2944
|
+
role: "combobox",
|
|
2945
|
+
"aria-expanded": Ge,
|
|
2946
|
+
"aria-haspopup": "listbox",
|
|
2947
|
+
"aria-controls": `${Ae}-listbox`,
|
|
2948
|
+
"aria-label": Se,
|
|
2949
|
+
"aria-labelledby": Ce,
|
|
2950
|
+
"aria-describedby": we,
|
|
2951
|
+
"aria-required": Te ?? T,
|
|
2952
|
+
"aria-invalid": Ee ?? !!y,
|
|
2953
|
+
"aria-disabled": Ht,
|
|
2954
|
+
id: Ae,
|
|
2955
|
+
...typeof ye == "number" ? { "data-cellindex": ye } : {},
|
|
2956
|
+
children: [
|
|
2957
|
+
Yt(),
|
|
2958
|
+
k && !Et && !Ht && /* @__PURE__ */ b("button", {
|
|
2959
|
+
type: "button",
|
|
2960
|
+
className: Q.clearBtn,
|
|
2961
|
+
onClick: (e) => {
|
|
2962
|
+
e.stopPropagation(), gt(), he && he();
|
|
2963
|
+
},
|
|
2964
|
+
"aria-label": "Clear selection",
|
|
2965
|
+
children: "×"
|
|
2966
|
+
}),
|
|
2967
|
+
/* @__PURE__ */ b("span", {
|
|
2968
|
+
className: `${Q.arrow} ${Ge ? Q.arrowOpen : ""}`,
|
|
2969
|
+
"aria-hidden": "true",
|
|
2970
|
+
children: "▼"
|
|
2971
|
+
})
|
|
2972
|
+
]
|
|
2973
|
+
})
|
|
2974
|
+
}), Ge && !Ht && Ot && Ne && S.createPortal(/* @__PURE__ */ x("div", {
|
|
2975
|
+
ref: Qe,
|
|
2976
|
+
className: [
|
|
2977
|
+
...Pe({
|
|
2978
|
+
size: Rt,
|
|
2979
|
+
variant: zt
|
|
2980
|
+
}).map((e) => cn[e] || ""),
|
|
2981
|
+
Q.dropdown,
|
|
2982
|
+
Q[`size_${Rt}`] || "",
|
|
2983
|
+
X ? Q.dropdownInModal : "",
|
|
2984
|
+
U
|
|
2985
|
+
].filter(Boolean).join(" "),
|
|
2986
|
+
"data-select-dropdown": !0,
|
|
2987
|
+
...Qt,
|
|
2988
|
+
"data-placement": Ot.placement,
|
|
2989
|
+
style: {
|
|
2990
|
+
position: "absolute",
|
|
2991
|
+
top: `${Ot.top}px`,
|
|
2992
|
+
left: `${Ot.left}px`,
|
|
2993
|
+
...Me.matchWidth ? { width: `${Ot.width}px` } : { minWidth: `${Ot.width}px` },
|
|
2994
|
+
zIndex: X ? 1e4 : 1e3
|
|
2995
|
+
},
|
|
2996
|
+
role: "listbox",
|
|
2997
|
+
id: `${Ae}-listbox`,
|
|
2998
|
+
"aria-label": "Select options",
|
|
2999
|
+
children: [Ie.enabled && /* @__PURE__ */ x("div", {
|
|
3000
|
+
className: Q.searchWrapper,
|
|
3001
|
+
onMouseDown: (e) => {
|
|
3002
|
+
e.button === 0 && (e.target.closest("input, button, a, [role=\"button\"]") || (e.preventDefault(), $e.current?.focus()));
|
|
3003
|
+
},
|
|
3004
|
+
children: [/* @__PURE__ */ x("svg", {
|
|
3005
|
+
className: Q.searchIcon,
|
|
3006
|
+
viewBox: "0 0 24 24",
|
|
3007
|
+
fill: "none",
|
|
3008
|
+
stroke: "currentColor",
|
|
3009
|
+
strokeWidth: "2",
|
|
3010
|
+
strokeLinecap: "round",
|
|
3011
|
+
"aria-hidden": "true",
|
|
3012
|
+
children: [/* @__PURE__ */ b("circle", {
|
|
3013
|
+
cx: "11",
|
|
3014
|
+
cy: "11",
|
|
3015
|
+
r: "7"
|
|
3016
|
+
}), /* @__PURE__ */ b("line", {
|
|
3017
|
+
x1: "16.5",
|
|
3018
|
+
y1: "16.5",
|
|
3019
|
+
x2: "21",
|
|
3020
|
+
y2: "21"
|
|
3021
|
+
})]
|
|
3022
|
+
}), /* @__PURE__ */ b("input", {
|
|
3023
|
+
ref: $e,
|
|
3024
|
+
type: "text",
|
|
3025
|
+
className: Q.searchInput,
|
|
3026
|
+
placeholder: Ie.placeholder || c || "Search...",
|
|
3027
|
+
value: Ke,
|
|
3028
|
+
onChange: lt,
|
|
3029
|
+
onClick: (e) => e.stopPropagation(),
|
|
3030
|
+
onKeyDown: (e) => {
|
|
3031
|
+
let t = e.key.length === 1 && !e.ctrlKey && !e.metaKey, n = e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End";
|
|
3032
|
+
t || n && e.currentTarget.value.length > 0 || Z.handlers.onKeyDown(e);
|
|
3033
|
+
}
|
|
3034
|
+
})]
|
|
3035
|
+
}), /* @__PURE__ */ b("div", {
|
|
3036
|
+
className: cn.scroller,
|
|
3037
|
+
children: /* @__PURE__ */ x("ul", {
|
|
3038
|
+
ref: et,
|
|
3039
|
+
className: cn.list,
|
|
3040
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
3041
|
+
onDragOver: (e) => {
|
|
3042
|
+
typeof N == "object" && N.enabled && J.enabled && Ye && e.preventDefault();
|
|
3043
|
+
},
|
|
3044
|
+
children: [J.enabled && J.showSelectAll && qe.length > 0 && (() => {
|
|
3045
|
+
let e = Array.isArray(t) ? t.length : 0, n = (J.defaultSelected || []).length, r = qe.filter((e) => !(J.alwaysDisabled || []).includes(e.value)).length, i = J.maxSelection && e >= J.maxSelection, a = wt || !!(i && e > n), o = !wt && e > 0 && !a, s = "Select All";
|
|
3046
|
+
return i && e > n ? s = `Deselect All (Max ${J.maxSelection})` : wt ? s = "Deselect All" : e > 0 && (s = `Select All (${e}/${r})`), /* @__PURE__ */ x("li", {
|
|
3047
|
+
className: `${cn.row} ${Q.selectAll}`,
|
|
3048
|
+
onClick: ht,
|
|
3049
|
+
children: [/* @__PURE__ */ b("span", {
|
|
3050
|
+
className: Q.checkbox,
|
|
3051
|
+
children: /* @__PURE__ */ b(It, {
|
|
3052
|
+
onChange: () => {},
|
|
3053
|
+
name: "select-all",
|
|
3054
|
+
checked: a,
|
|
3055
|
+
indeterminate: o,
|
|
3056
|
+
disabled: !1,
|
|
3057
|
+
size: "small"
|
|
3058
|
+
})
|
|
3059
|
+
}), /* @__PURE__ */ b("span", {
|
|
3060
|
+
className: Q.optionText,
|
|
3061
|
+
children: s
|
|
3062
|
+
})]
|
|
3063
|
+
});
|
|
3064
|
+
})(), qe.length > 0 ? Le(qe, Be).map((e, t) => /* @__PURE__ */ x(s.Fragment, { children: [e.name && /* @__PURE__ */ b("li", {
|
|
3065
|
+
className: cn.groupHeader,
|
|
3066
|
+
role: "presentation",
|
|
3067
|
+
children: Be.renderGroupHeader ? Be.renderGroupHeader(e.name, e.options.length) : e.name
|
|
3068
|
+
}), e.options.map((e) => Jt(e, Xe.get(e.value) ?? -1))] }, e.name || `group-${t}`)) : /* @__PURE__ */ b("li", {
|
|
3069
|
+
className: cn.empty,
|
|
3070
|
+
children: R.renderEmptyState ? R.renderEmptyState(Ke) : Ke ? R.noResultsText || "No results found" : R.noOptionsText || "No options available"
|
|
3071
|
+
})]
|
|
3072
|
+
})
|
|
3073
|
+
})]
|
|
3074
|
+
}), Ne)]
|
|
3075
|
+
});
|
|
3076
|
+
});
|
|
3077
|
+
un.displayName = "Select";
|
|
3078
|
+
var dn = {
|
|
3079
|
+
root: "_root_1u72j_2",
|
|
3080
|
+
padded: "_padded_1u72j_17",
|
|
3081
|
+
measuring: "_measuring_1u72j_23",
|
|
3082
|
+
popIn: "_popIn_1u72j_1"
|
|
3083
|
+
}, fn = ({ open: e, anchorEl: t, onClose: r, children: i, placement: a = "bottom-start", offset: o = 4, matchAnchorWidth: s = !1, padded: c = !0, closeOnOutsideClick: l = !0, onEscape: d, closeOnEscape: p = !0, autoFocus: m = !0, returnFocus: g = !0, className: y = "", style: x, role: S = "dialog", "aria-label": w, "aria-busy": T }) => {
|
|
3084
|
+
let E = n(), D = _(null), O = _(null), k = _(null);
|
|
3085
|
+
k.current = t && "contains" in t ? t : null;
|
|
3086
|
+
let [A, j] = v(null), M = u(() => {
|
|
3087
|
+
if (!t) return;
|
|
3088
|
+
let e = Xt({
|
|
3089
|
+
anchor: t,
|
|
3090
|
+
container: E,
|
|
3091
|
+
contentEl: D.current,
|
|
3092
|
+
placement: a,
|
|
3093
|
+
offset: o,
|
|
3094
|
+
matchAnchorWidth: s
|
|
3095
|
+
});
|
|
3096
|
+
j((t) => t && t.top === e.top && t.left === e.left && t.width === e.width && t.placement === e.placement ? t : e);
|
|
3097
|
+
}, [
|
|
3098
|
+
t,
|
|
3099
|
+
E,
|
|
3100
|
+
a,
|
|
3101
|
+
o,
|
|
3102
|
+
s
|
|
3103
|
+
]);
|
|
3104
|
+
h(() => {
|
|
3105
|
+
if (!e) {
|
|
3106
|
+
j(null);
|
|
3107
|
+
return;
|
|
3108
|
+
}
|
|
3109
|
+
M();
|
|
3110
|
+
}, [
|
|
3111
|
+
e,
|
|
3112
|
+
M,
|
|
3113
|
+
i
|
|
3114
|
+
]), f(() => {
|
|
3115
|
+
if (!e) return;
|
|
3116
|
+
let t = () => {
|
|
3117
|
+
O.current && cancelAnimationFrame(O.current), O.current = requestAnimationFrame(M);
|
|
3118
|
+
};
|
|
3119
|
+
return window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), () => {
|
|
3120
|
+
window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t), O.current && cancelAnimationFrame(O.current);
|
|
3121
|
+
};
|
|
3122
|
+
}, [e, M]);
|
|
3123
|
+
let { layerProps: N } = sn({
|
|
3124
|
+
ref: D,
|
|
3125
|
+
open: e,
|
|
3126
|
+
onClose: r ?? (() => void 0),
|
|
3127
|
+
onEscape: d,
|
|
3128
|
+
anchorRef: k,
|
|
3129
|
+
closeOnEscape: p,
|
|
3130
|
+
closeOnOutside: l,
|
|
3131
|
+
autoFocus: m,
|
|
3132
|
+
restoreFocus: g
|
|
3133
|
+
});
|
|
3134
|
+
if (!e || !E) return null;
|
|
3135
|
+
let P = A === null;
|
|
3136
|
+
return C(/* @__PURE__ */ b("div", {
|
|
3137
|
+
ref: D,
|
|
3138
|
+
...N,
|
|
3139
|
+
className: [
|
|
3140
|
+
dn.root,
|
|
3141
|
+
c ? dn.padded : "",
|
|
3142
|
+
P ? dn.measuring : "",
|
|
3143
|
+
y
|
|
3144
|
+
].filter(Boolean).join(" "),
|
|
3145
|
+
style: {
|
|
3146
|
+
top: A?.top ?? 0,
|
|
3147
|
+
left: A?.left ?? 0,
|
|
3148
|
+
...A?.width === void 0 ? {} : { width: A.width },
|
|
3149
|
+
...x
|
|
3150
|
+
},
|
|
3151
|
+
...S === "none" ? {} : { role: S },
|
|
3152
|
+
"aria-label": w,
|
|
3153
|
+
"aria-busy": T || void 0,
|
|
3154
|
+
tabIndex: -1,
|
|
3155
|
+
children: i
|
|
3156
|
+
}), E);
|
|
3157
|
+
};
|
|
3158
|
+
fn.displayName = "Popover";
|
|
3159
|
+
var $ = {
|
|
3160
|
+
root: "_root_1nbs0_17",
|
|
3161
|
+
fullWidth: "_fullWidth_1nbs0_24",
|
|
3162
|
+
trigger: "_trigger_1nbs0_30",
|
|
3163
|
+
triggerText: "_triggerText_1nbs0_36",
|
|
3164
|
+
triggerEmpty: "_triggerEmpty_1nbs0_45",
|
|
3165
|
+
triggerIcons: "_triggerIcons_1nbs0_47",
|
|
3166
|
+
calIcon: "_calIcon_1nbs0_54",
|
|
3167
|
+
clearBtn: "_clearBtn_1nbs0_58",
|
|
3168
|
+
pop: "_pop_1nbs0_80",
|
|
3169
|
+
panel: "_panel_1nbs0_94",
|
|
3170
|
+
sz_xxs: "_sz_xxs_1nbs0_114",
|
|
3171
|
+
sz_xs: "_sz_xs_1nbs0_115",
|
|
3172
|
+
sz_small: "_sz_small_1nbs0_116",
|
|
3173
|
+
sz_medium: "_sz_medium_1nbs0_117",
|
|
3174
|
+
sz_large: "_sz_large_1nbs0_118",
|
|
3175
|
+
sz_xl: "_sz_xl_1nbs0_119",
|
|
3176
|
+
entries: "_entries_1nbs0_136",
|
|
3177
|
+
entry: "_entry_1nbs0_148",
|
|
3178
|
+
entryLabel: "_entryLabel_1nbs0_153",
|
|
3179
|
+
timeCols: "_timeCols_1nbs0_171",
|
|
3180
|
+
timeCol: "_timeCol_1nbs0_171",
|
|
3181
|
+
timeOpt: "_timeOpt_1nbs0_201",
|
|
3182
|
+
timeOptOn: "_timeOptOn_1nbs0_216",
|
|
3183
|
+
body: "_body_1nbs0_229",
|
|
3184
|
+
rail: "_rail_1nbs0_235",
|
|
3185
|
+
preset: "_preset_1nbs0_251",
|
|
3186
|
+
railEmpty: "_railEmpty_1nbs0_275",
|
|
3187
|
+
calendars: "_calendars_1nbs0_284",
|
|
3188
|
+
noRail: "_noRail_1nbs0_296",
|
|
3189
|
+
calHead: "_calHead_1nbs0_298",
|
|
3190
|
+
jumps: "_jumps_1nbs0_300",
|
|
3191
|
+
jump: "_jump_1nbs0_300",
|
|
3192
|
+
jumpSelect: "_jumpSelect_1nbs0_306",
|
|
3193
|
+
nav: "_nav_1nbs0_321",
|
|
3194
|
+
navOn: "_navOn_1nbs0_343",
|
|
3195
|
+
grids: "_grids_1nbs0_347",
|
|
3196
|
+
grid: "_grid_1nbs0_347",
|
|
3197
|
+
week: "_week_1nbs0_358",
|
|
3198
|
+
weekday: "_weekday_1nbs0_360",
|
|
3199
|
+
day: "_day_1nbs0_377",
|
|
3200
|
+
dayNum: "_dayNum_1nbs0_398",
|
|
3201
|
+
disabled: "_disabled_1nbs0_410",
|
|
3202
|
+
start: "_start_1nbs0_414",
|
|
3203
|
+
end: "_end_1nbs0_415",
|
|
3204
|
+
picked: "_picked_1nbs0_416",
|
|
3205
|
+
outside: "_outside_1nbs0_418",
|
|
3206
|
+
today: "_today_1nbs0_424",
|
|
3207
|
+
band: "_band_1nbs0_462",
|
|
3208
|
+
cursor: "_cursor_1nbs0_497",
|
|
3209
|
+
blank: "_blank_1nbs0_374",
|
|
3210
|
+
foot: "_foot_1nbs0_511",
|
|
3211
|
+
footRead: "_footRead_1nbs0_522",
|
|
3212
|
+
footAct: "_footAct_1nbs0_531",
|
|
3213
|
+
footBtn: "_footBtn_1nbs0_533",
|
|
3214
|
+
apply: "_apply_1nbs0_547",
|
|
3215
|
+
sideRight: "_sideRight_1nbs0_631"
|
|
3216
|
+
}, pn = ({ view: e, dayId: t, dayLabel: n, weekdayNames: r, label: i, outside: a = "all", onPick: o }) => {
|
|
3217
|
+
let s = (t) => {
|
|
3218
|
+
if (t.inMonth || a === "all") return !0;
|
|
3219
|
+
if (a === "none") return !1;
|
|
3220
|
+
let n = t.day < e.month;
|
|
3221
|
+
return a === "leading" ? n : !n;
|
|
3222
|
+
};
|
|
3223
|
+
return /* @__PURE__ */ x("div", {
|
|
3224
|
+
className: $.grid,
|
|
3225
|
+
role: "grid",
|
|
3226
|
+
"aria-label": i,
|
|
3227
|
+
children: [/* @__PURE__ */ b("div", {
|
|
3228
|
+
className: $.week,
|
|
3229
|
+
role: "row",
|
|
3230
|
+
children: e.weekdays.map((e) => /* @__PURE__ */ b("span", {
|
|
3231
|
+
className: $.weekday,
|
|
3232
|
+
role: "columnheader",
|
|
3233
|
+
children: r[e]
|
|
3234
|
+
}, e))
|
|
3235
|
+
}), e.weeks.map((e, r) => /* @__PURE__ */ b("div", {
|
|
3236
|
+
className: $.week,
|
|
3237
|
+
role: "row",
|
|
3238
|
+
children: e.map((e) => s(e) ? /* @__PURE__ */ b("span", {
|
|
3239
|
+
id: t(e.day),
|
|
3240
|
+
role: "gridcell",
|
|
3241
|
+
"aria-label": n(e.day),
|
|
3242
|
+
"aria-selected": e.isRangeStart || e.isRangeEnd || e.isSelected,
|
|
3243
|
+
"aria-disabled": e.disabled || void 0,
|
|
3244
|
+
"aria-current": e.isToday ? "date" : void 0,
|
|
3245
|
+
className: [
|
|
3246
|
+
$.day,
|
|
3247
|
+
e.inMonth ? "" : $.outside,
|
|
3248
|
+
e.isToday ? $.today : "",
|
|
3249
|
+
e.inRange ? $.band : "",
|
|
3250
|
+
e.isRangeStart ? $.start : "",
|
|
3251
|
+
e.isRangeEnd ? $.end : "",
|
|
3252
|
+
e.isSelected && !e.isRangeStart && !e.isRangeEnd ? $.picked : "",
|
|
3253
|
+
e.isHighlighted ? $.cursor : "",
|
|
3254
|
+
e.disabled ? $.disabled : ""
|
|
3255
|
+
].filter(Boolean).join(" "),
|
|
3256
|
+
onClick: () => {
|
|
3257
|
+
e.disabled || o(e.day);
|
|
3258
|
+
},
|
|
3259
|
+
children: /* @__PURE__ */ b("span", {
|
|
3260
|
+
className: $.dayNum,
|
|
3261
|
+
children: e.date
|
|
3262
|
+
})
|
|
3263
|
+
}, e.day) : /* @__PURE__ */ b("span", {
|
|
3264
|
+
className: $.blank,
|
|
3265
|
+
role: "gridcell",
|
|
3266
|
+
"aria-hidden": "true"
|
|
3267
|
+
}, e.day))
|
|
3268
|
+
}, r))]
|
|
3269
|
+
});
|
|
3270
|
+
}, mn = 60, hn = ({ id: e, label: t, value: n, onChange: r, hour12: i = !0, minuteStep: a = 5, disabled: o, fallback: s = "00:00", size: c, variant: l }) => {
|
|
3271
|
+
let [d, p] = v(() => De(n, i)), [m, y] = v(!1), S = _(null), C = _("");
|
|
3272
|
+
f(() => {
|
|
3273
|
+
n !== C.current && p(De(n, i));
|
|
3274
|
+
}, [n, i]);
|
|
3275
|
+
let w = u((e, t = !0) => {
|
|
3276
|
+
C.current = e, t && p(De(e, i)), r(e);
|
|
3277
|
+
}, [r, i]), T = n || s, E = g(() => J(T, {
|
|
3278
|
+
hour12: i,
|
|
3279
|
+
minuteStep: a
|
|
3280
|
+
}), [
|
|
3281
|
+
T,
|
|
3282
|
+
i,
|
|
3283
|
+
a
|
|
3284
|
+
]);
|
|
3285
|
+
h(() => {
|
|
3286
|
+
if (!(!m || !S.current)) {
|
|
3287
|
+
for (let e of S.current.querySelectorAll("[aria-selected=\"true\"]")) {
|
|
3288
|
+
let t = e.parentElement;
|
|
3289
|
+
t && (t.scrollTop = e.offsetTop - t.clientHeight / 2 + e.clientHeight / 2);
|
|
3290
|
+
}
|
|
3291
|
+
S.current.scrollIntoView({ block: "nearest" });
|
|
3292
|
+
}
|
|
3293
|
+
}, [m, T]);
|
|
3294
|
+
let D = (e) => {
|
|
3295
|
+
p(e);
|
|
3296
|
+
let t = Ae(e, { within: T });
|
|
3297
|
+
t && w(t, !1);
|
|
3298
|
+
}, O = (e, t) => {
|
|
3299
|
+
let n = Ce(T);
|
|
3300
|
+
w(we((n < 0 ? 0 : n) + e * (t ? mn : a)));
|
|
3301
|
+
}, k = (e) => {
|
|
3302
|
+
(e.key === "ArrowUp" || e.key === "ArrowDown") && (e.preventDefault(), e.stopPropagation(), O(e.key === "ArrowUp" ? 1 : -1, e.shiftKey));
|
|
3303
|
+
}, A = (e, t) => {
|
|
3304
|
+
w(je(T, e, t, i));
|
|
3305
|
+
}, j = (e, t, n, r) => /* @__PURE__ */ b("div", {
|
|
3306
|
+
className: $.timeCol,
|
|
3307
|
+
role: "listbox",
|
|
3308
|
+
"aria-label": e,
|
|
3309
|
+
tabIndex: -1,
|
|
3310
|
+
children: t.map((e) => {
|
|
3311
|
+
let t = Me(T, n, e, i);
|
|
3312
|
+
return /* @__PURE__ */ b("button", {
|
|
3313
|
+
type: "button",
|
|
3314
|
+
role: "option",
|
|
3315
|
+
"aria-selected": t,
|
|
3316
|
+
className: `${$.timeOpt} ${t ? $.timeOptOn : ""}`,
|
|
3317
|
+
onClick: () => A(n, e),
|
|
3318
|
+
children: r(e)
|
|
3319
|
+
}, String(e));
|
|
3320
|
+
})
|
|
3321
|
+
}), M = (e) => String(e).padStart(2, "0");
|
|
3322
|
+
return /* @__PURE__ */ x("div", {
|
|
3323
|
+
className: $.entry,
|
|
3324
|
+
children: [/* @__PURE__ */ b(Ht, {
|
|
3325
|
+
id: e,
|
|
3326
|
+
size: c,
|
|
3327
|
+
variant: l,
|
|
3328
|
+
layout: "default",
|
|
3329
|
+
label: t,
|
|
3330
|
+
labelClassName: $.entryLabel,
|
|
3331
|
+
inputMode: "numeric",
|
|
3332
|
+
autoComplete: "off",
|
|
3333
|
+
spellCheck: !1,
|
|
3334
|
+
value: d,
|
|
3335
|
+
placeholder: Oe(i),
|
|
3336
|
+
disabled: o,
|
|
3337
|
+
"aria-label": t,
|
|
3338
|
+
onChange: (e) => D(e.target.value),
|
|
3339
|
+
onKeyDown: k,
|
|
3340
|
+
onFocus: () => y(!0),
|
|
3341
|
+
onBlur: () => {
|
|
3342
|
+
y(!1), p(De(n, i));
|
|
3343
|
+
}
|
|
3344
|
+
}), m && !o && /* @__PURE__ */ x("div", {
|
|
3345
|
+
className: $.timeCols,
|
|
3346
|
+
ref: S,
|
|
3347
|
+
children: [
|
|
3348
|
+
j("Hour", E.hours, "hour", M),
|
|
3349
|
+
j("Minute", E.minutes, "minute", M),
|
|
3350
|
+
E.meridiems.length > 0 && j("AM or PM", E.meridiems, "meridiem", String)
|
|
3351
|
+
]
|
|
3352
|
+
})]
|
|
3353
|
+
});
|
|
3354
|
+
};
|
|
3355
|
+
//#endregion
|
|
3356
|
+
//#region ../../shared-hooks/src/useDebounced.ts
|
|
3357
|
+
function gn(e, t) {
|
|
3358
|
+
let [n, r] = v(e);
|
|
3359
|
+
return f(() => {
|
|
3360
|
+
if (!t) {
|
|
3361
|
+
r(e);
|
|
3362
|
+
return;
|
|
3363
|
+
}
|
|
3364
|
+
let n = setTimeout(() => r(e), t);
|
|
3365
|
+
return () => clearTimeout(n);
|
|
3366
|
+
}, [e, t]), t ? n : e;
|
|
3367
|
+
}
|
|
3368
|
+
function _n(e, t) {
|
|
3369
|
+
let n = _(null), r = _(null), i = _(e);
|
|
3370
|
+
i.current = e;
|
|
3371
|
+
let a = u(() => {
|
|
3372
|
+
n.current && clearTimeout(n.current), n.current = null;
|
|
3373
|
+
}, []), o = u(() => {
|
|
3374
|
+
a(), r.current = null;
|
|
3375
|
+
}, [a]), s = u(() => {
|
|
3376
|
+
let e = r.current;
|
|
3377
|
+
o(), e && i.current(...e);
|
|
3378
|
+
}, [o]);
|
|
3379
|
+
f(() => a, [a]);
|
|
3380
|
+
let c = u((...e) => {
|
|
3381
|
+
if (r.current = e, a(), !t) {
|
|
3382
|
+
s();
|
|
3383
|
+
return;
|
|
3384
|
+
}
|
|
3385
|
+
n.current = setTimeout(s, t);
|
|
3386
|
+
}, [
|
|
3387
|
+
t,
|
|
3388
|
+
a,
|
|
3389
|
+
s
|
|
3390
|
+
]);
|
|
3391
|
+
return c.now = s, c.cancel = o, c;
|
|
3392
|
+
}
|
|
3393
|
+
//#endregion
|
|
3394
|
+
//#region ../../shared-web-ui/src/DatePicker/useOneMonthPane.ts
|
|
3395
|
+
var vn = "(max-width: 768px)";
|
|
3396
|
+
function yn() {
|
|
3397
|
+
let [e, t] = v(() => typeof window < "u" && !!window.matchMedia?.("(max-width: 768px)").matches);
|
|
3398
|
+
return f(() => {
|
|
3399
|
+
if (typeof window > "u" || !window.matchMedia) return;
|
|
3400
|
+
let e = window.matchMedia(vn), n = () => t(e.matches);
|
|
3401
|
+
return n(), e.addEventListener("change", n), () => e.removeEventListener("change", n);
|
|
3402
|
+
}, []), e;
|
|
3403
|
+
}
|
|
3404
|
+
//#endregion
|
|
3405
|
+
//#region ../../shared-web-ui/src/DatePicker/DatePicker.tsx
|
|
3406
|
+
var bn = [
|
|
3407
|
+
"January",
|
|
3408
|
+
"February",
|
|
3409
|
+
"March",
|
|
3410
|
+
"April",
|
|
3411
|
+
"May",
|
|
3412
|
+
"June",
|
|
3413
|
+
"July",
|
|
3414
|
+
"August",
|
|
3415
|
+
"September",
|
|
3416
|
+
"October",
|
|
3417
|
+
"November",
|
|
3418
|
+
"December"
|
|
3419
|
+
], xn = [
|
|
3420
|
+
"Su",
|
|
3421
|
+
"Mo",
|
|
3422
|
+
"Tu",
|
|
3423
|
+
"We",
|
|
3424
|
+
"Th",
|
|
3425
|
+
"Fr",
|
|
3426
|
+
"Sa"
|
|
3427
|
+
], Sn = (e) => q.includes(e), Cn = () => {
|
|
3428
|
+
let e = /* @__PURE__ */ new Date();
|
|
3429
|
+
return `${String(e.getHours()).padStart(2, "0")}:${String(e.getMinutes()).padStart(2, "0")}`;
|
|
3430
|
+
}, wn = (e) => e && typeof e == "object" ? e : {
|
|
3431
|
+
from: String(e ?? ""),
|
|
3432
|
+
to: ""
|
|
3433
|
+
}, Tn = l((e, t) => {
|
|
3434
|
+
let { name: n, value: r, onChange: i, onBlur: a, onFocus: o, onKeyDown: c, label: l = "", placeholder: d, hint: p = "", error: h = "", disabled: S, readOnly: C, required: w = !1, autoFocus: T = !1, tabIndex: E, clearable: D = !1, range: O = !1, withTime: k = !1, timeToggle: A = !1, min: j, max: M, displayFormat: F = "dd-mm-yyyy", textOrder: L, weekStart: ee = 0, months: B, currentMonthSide: V = "right", showOutsideDays: te, presets: U = !0, fyStartMonth: ne = 4, monthNames: re = bn, weekdayNames: K = xn, clearLabel: ie = "Clear", applyLabel: ae = "Search", onApply: q, placement: me = "bottom-start", showCalendarIcon: he = !0, open: ge, defaultOpen: xe, onOpenChange: Se, variant: Ce, size: we, layout: Te, className: Ee = "", tooltip: De, tooltipTrigger: Oe = "icon", labelClassName: ke = "", style: Ae, fullWidth: J = !0, id: je, keyboard: Me, rowIndex: Ne, cellindex: Pe, onCellFocus: Fe, registerCellRef: Ie, "aria-label": Le, "aria-labelledby": Be, "aria-describedby": Ve, "aria-required": He, "aria-invalid": Ue, ...We } = e, Ge = _(null), Ke = _(null), qe = {
|
|
3435
|
+
from: _(null),
|
|
3436
|
+
to: _(null)
|
|
3437
|
+
}, Je = _(""), Ye = Math.max(1, B ?? (O ? 2 : 1)), Y = yn(), X = u((e) => te === !1 ? "none" : te === !0 || Ye === 1 ? "all" : e === 0 ? "leading" : e === Ye - 1 ? "trailing" : "none", [te, Ye]), Xe = L ?? (F === "yyyy-mm-dd" ? "ymd" : "dmy"), Ze = P(), Qe = wn(r), $e = Qe.from || "", et = O && Qe.to || "", tt = W($e).day, nt = W(et).day, rt = W($e).time, it = W(et).time, [at, ot] = v(() => le($e, F, !1)), [st, ct] = v(() => le(et, F, !1)), [lt, ut] = v("from"), [dt, ft] = v(() => pe($e, {
|
|
3438
|
+
today: Ze,
|
|
3439
|
+
min: j,
|
|
3440
|
+
max: M
|
|
3441
|
+
})), [pt, mt] = v(() => {
|
|
3442
|
+
let e = z(pe($e, {
|
|
3443
|
+
today: Ze,
|
|
3444
|
+
min: j,
|
|
3445
|
+
max: M
|
|
3446
|
+
})), t = Math.max(1, B ?? (O ? 2 : 1));
|
|
3447
|
+
return t > 1 && V === "right" ? R(e, -(t - 1)) : e;
|
|
3448
|
+
}), [ht, gt] = v(""), [_t, vt] = v(""), [yt, bt] = v(k && !A), xt = k && (!A || yt), St = _(JSON.stringify(r ?? ""));
|
|
3449
|
+
f(() => {
|
|
3450
|
+
let e = JSON.stringify(r ?? "");
|
|
3451
|
+
if (e === St.current) return;
|
|
3452
|
+
St.current = e;
|
|
3453
|
+
let t = wn(r);
|
|
3454
|
+
ot(le(t.from || "", F, !1)), ct(le(O && t.to || "", F, !1));
|
|
3455
|
+
}, [
|
|
3456
|
+
r,
|
|
3457
|
+
O,
|
|
3458
|
+
F
|
|
3459
|
+
]);
|
|
3460
|
+
let wt = u((e, t) => {
|
|
3461
|
+
let r = O ? {
|
|
3462
|
+
from: e,
|
|
3463
|
+
to: t
|
|
3464
|
+
} : e;
|
|
3465
|
+
St.current = JSON.stringify(r), i?.({ target: {
|
|
3466
|
+
name: n,
|
|
3467
|
+
value: r,
|
|
3468
|
+
type: "date"
|
|
3469
|
+
} });
|
|
3470
|
+
}, [
|
|
3471
|
+
O,
|
|
3472
|
+
n,
|
|
3473
|
+
i
|
|
3474
|
+
]), Tt = u((e) => xt ? (e === "from" ? rt : it) || (O ? e === "from" ? "00:00" : "23:59" : Cn()) : "", [
|
|
3475
|
+
xt,
|
|
3476
|
+
O,
|
|
3477
|
+
rt,
|
|
3478
|
+
it
|
|
3479
|
+
]), Et = u((e, t, n) => {
|
|
3480
|
+
let r = e ? G(e, Tt("from")) : "", i = O && t ? G(t, Tt("to")) : "";
|
|
3481
|
+
wt(r, i), n !== "from" && ot(le(r, F, !1)), n !== "to" && ct(le(i, F, !1));
|
|
3482
|
+
}, [
|
|
3483
|
+
O,
|
|
3484
|
+
Tt,
|
|
3485
|
+
wt,
|
|
3486
|
+
F
|
|
3487
|
+
]), Dt = u((e) => {
|
|
3488
|
+
let t = e === "from" ? tt : nt;
|
|
3489
|
+
if (!t) return;
|
|
3490
|
+
let n = z(t), r = R(n, -(Ye - 1));
|
|
3491
|
+
if (Y) {
|
|
3492
|
+
mt(V === "right" ? r : n);
|
|
3493
|
+
return;
|
|
3494
|
+
}
|
|
3495
|
+
mt(e === "from" ? n : r);
|
|
3496
|
+
}, [
|
|
3497
|
+
tt,
|
|
3498
|
+
nt,
|
|
3499
|
+
Ye,
|
|
3500
|
+
V,
|
|
3501
|
+
Y
|
|
3502
|
+
]), Ot = u((e) => {
|
|
3503
|
+
mt((t) => {
|
|
3504
|
+
let n = R(t, Ye - 1);
|
|
3505
|
+
if (I(e, t) >= 0 && I(e, z(R(n, 1))) < 0) return t;
|
|
3506
|
+
let r = z(e);
|
|
3507
|
+
return Ye > 1 && V === "right" ? R(r, -(Ye - 1)) : r;
|
|
3508
|
+
});
|
|
3509
|
+
}, [Ye, V]), At = u((e) => {
|
|
3510
|
+
if (vt(""), gt(""), ft(e), !O) {
|
|
3511
|
+
Et(e === tt ? "" : e, "");
|
|
3512
|
+
return;
|
|
3513
|
+
}
|
|
3514
|
+
let t = be({
|
|
3515
|
+
from: tt,
|
|
3516
|
+
to: nt
|
|
3517
|
+
}, e);
|
|
3518
|
+
Et(t.from, t.to), ut(t.to === e && t.from !== e ? "to" : "from");
|
|
3519
|
+
}, [
|
|
3520
|
+
O,
|
|
3521
|
+
tt,
|
|
3522
|
+
nt,
|
|
3523
|
+
Et
|
|
3524
|
+
]), jt = u((e) => {
|
|
3525
|
+
if (vt(""), ft(e), Ot(e), !O) {
|
|
3526
|
+
Et(e, "");
|
|
3527
|
+
return;
|
|
3528
|
+
}
|
|
3529
|
+
let t = lt === "from" ? e : tt, n = lt === "to" ? e : nt;
|
|
3530
|
+
Et(t && n && I(n, t) < 0 ? lt === "from" ? e : n : t, t && n && I(n, t) < 0 ? e : n);
|
|
3531
|
+
}, [
|
|
3532
|
+
O,
|
|
3533
|
+
lt,
|
|
3534
|
+
tt,
|
|
3535
|
+
nt,
|
|
3536
|
+
Et,
|
|
3537
|
+
Ot
|
|
3538
|
+
]), Mt = g(() => {
|
|
3539
|
+
if (U === !1) return [];
|
|
3540
|
+
let e = _e({
|
|
3541
|
+
today: Ze,
|
|
3542
|
+
fyStartMonth: ne,
|
|
3543
|
+
weekStart: ee,
|
|
3544
|
+
only: Array.isArray(U) ? U : void 0
|
|
3545
|
+
});
|
|
3546
|
+
return O ? e : e.filter((e) => e.single);
|
|
3547
|
+
}, [
|
|
3548
|
+
U,
|
|
3549
|
+
Ze,
|
|
3550
|
+
ne,
|
|
3551
|
+
ee,
|
|
3552
|
+
O
|
|
3553
|
+
]), Nt = g(() => ve(Mt, ht), [Mt, ht]), Pt = u((e) => {
|
|
3554
|
+
Et(e.from, O ? e.to : ""), vt(e.key), ft(e.from), gt(""), ut("from"), mt(ye(e.from, O ? e.to : e.from, {
|
|
3555
|
+
months: Ye,
|
|
3556
|
+
currentMonthSide: V
|
|
3557
|
+
}));
|
|
3558
|
+
}, [
|
|
3559
|
+
Et,
|
|
3560
|
+
O,
|
|
3561
|
+
Ye,
|
|
3562
|
+
V
|
|
3563
|
+
]), Ft = _(() => void 0), [It, Lt] = v(!!xe), Z = ge ?? It, Rt = () => {
|
|
3564
|
+
let e = document.activeElement;
|
|
3565
|
+
return !!(Ge.current?.contains(e) || Ke.current?.contains(e));
|
|
3566
|
+
}, zt = Ct({
|
|
3567
|
+
widget: "date",
|
|
3568
|
+
elementRef: Ge,
|
|
3569
|
+
id: je,
|
|
3570
|
+
keyboard: Me,
|
|
3571
|
+
open: Z,
|
|
3572
|
+
onOpenChange: u((e, t) => {
|
|
3573
|
+
if (!e && t === "blur") {
|
|
3574
|
+
requestAnimationFrame(() => {
|
|
3575
|
+
Rt() || (ge === void 0 && Lt(!1), Se?.(!1, "blur"));
|
|
3576
|
+
});
|
|
3577
|
+
return;
|
|
3578
|
+
}
|
|
3579
|
+
ge === void 0 && Lt(e), Se?.(e, t);
|
|
3580
|
+
}, [ge, Se]),
|
|
3581
|
+
hasOptions: H(dt, j, M),
|
|
3582
|
+
onFieldAction: (e, t) => Ft.current(e, t),
|
|
3583
|
+
onClear: () => {
|
|
3584
|
+
Et("", ""), vt("");
|
|
3585
|
+
},
|
|
3586
|
+
size: we,
|
|
3587
|
+
variant: Ce,
|
|
3588
|
+
layout: Te,
|
|
3589
|
+
disabled: S,
|
|
3590
|
+
readOnly: C,
|
|
3591
|
+
onFocus: o,
|
|
3592
|
+
onBlur: (e) => {
|
|
3593
|
+
requestAnimationFrame(() => {
|
|
3594
|
+
Rt() || (ot(le($e, F, !1)), ct(le(et, F, !1)), gt(""));
|
|
3595
|
+
}), a?.(e);
|
|
3596
|
+
},
|
|
3597
|
+
onKeyDown: c,
|
|
3598
|
+
rowIndex: Ne,
|
|
3599
|
+
cellindex: Pe,
|
|
3600
|
+
onCellFocus: Fe,
|
|
3601
|
+
registerCellRef: Ie
|
|
3602
|
+
}), { size: Vt, variant: Ut, layout: Wt, disabled: Gt, readOnly: Kt } = zt.surface, { isOpen: qt, setOpen: Jt } = zt, Yt = zt.ids.field;
|
|
3603
|
+
m(t, () => zt.handle, [zt.handle]);
|
|
3604
|
+
let Xt = u((e, t = !1) => {
|
|
3605
|
+
let n = qe[e].current;
|
|
3606
|
+
if (n) {
|
|
3607
|
+
n.focus();
|
|
3608
|
+
try {
|
|
3609
|
+
t ? n.setSelectionRange(n.value.length, n.value.length) : n.select();
|
|
3610
|
+
} catch {}
|
|
3611
|
+
}
|
|
3612
|
+
}, []);
|
|
3613
|
+
Ft.current = (e, t) => {
|
|
3614
|
+
if (e === "open") {
|
|
3615
|
+
let e = t?.key;
|
|
3616
|
+
e && e.length === 1 && (ot(e), ut("from"), Je.current = e);
|
|
3617
|
+
return;
|
|
3618
|
+
}
|
|
3619
|
+
if (Sn(e)) {
|
|
3620
|
+
jt(fe(dt, e, {
|
|
3621
|
+
min: j,
|
|
3622
|
+
max: M
|
|
3623
|
+
}));
|
|
3624
|
+
return;
|
|
3625
|
+
}
|
|
3626
|
+
if (e === "pick") {
|
|
3627
|
+
if (ht) {
|
|
3628
|
+
Nt.length && Pt(Nt[0]);
|
|
3629
|
+
return;
|
|
3630
|
+
}
|
|
3631
|
+
if (en(lt), O && lt === "from") {
|
|
3632
|
+
ut("to"), Xt("to");
|
|
3633
|
+
return;
|
|
3634
|
+
}
|
|
3635
|
+
O && lt === "to" && !nt && tt && Et(tt, tt), Jt(!1, "select");
|
|
3636
|
+
}
|
|
3637
|
+
}, f(() => {
|
|
3638
|
+
if (!qt) return;
|
|
3639
|
+
let e = pe($e, {
|
|
3640
|
+
today: Ze,
|
|
3641
|
+
min: j,
|
|
3642
|
+
max: M
|
|
3643
|
+
});
|
|
3644
|
+
ft(e), Ot(e);
|
|
3645
|
+
let t = Je.current;
|
|
3646
|
+
Je.current = "", requestAnimationFrame(() => Xt("from", !!t));
|
|
3647
|
+
}, [qt]);
|
|
3648
|
+
let Zt = (e) => (t) => {
|
|
3649
|
+
let n = t.target.value;
|
|
3650
|
+
if (e === "from" ? ot(n) : ct(n), vt(""), /[a-z]/i.test(n)) {
|
|
3651
|
+
gt(n.trim());
|
|
3652
|
+
return;
|
|
3653
|
+
}
|
|
3654
|
+
if (gt(""), !n.trim()) {
|
|
3655
|
+
Et(e === "from" ? "" : tt, e === "to" ? "" : nt, e);
|
|
3656
|
+
return;
|
|
3657
|
+
}
|
|
3658
|
+
if (O) {
|
|
3659
|
+
let t = oe(n, {
|
|
3660
|
+
within: Ze,
|
|
3661
|
+
today: Ze,
|
|
3662
|
+
order: Xe
|
|
3663
|
+
});
|
|
3664
|
+
if (t) {
|
|
3665
|
+
Et(t.from, t.to, e), ft(t.from), Ot(t.from), ut("to");
|
|
3666
|
+
return;
|
|
3667
|
+
}
|
|
3668
|
+
}
|
|
3669
|
+
let r = ue(n, {
|
|
3670
|
+
within: Ze,
|
|
3671
|
+
today: Ze,
|
|
3672
|
+
order: Xe,
|
|
3673
|
+
withTime: !1
|
|
3674
|
+
});
|
|
3675
|
+
r && Qt(e, r.day);
|
|
3676
|
+
}, Qt = _n((e, t) => $t(e, t, !1), 250), $t = (e, t, n) => {
|
|
3677
|
+
let r = e === "from" ? t : tt, i = e === "to" ? t : nt, a = O && r && i && I(i, r) < 0;
|
|
3678
|
+
if (a && !n) {
|
|
3679
|
+
ft(t), Ot(t);
|
|
3680
|
+
return;
|
|
3681
|
+
}
|
|
3682
|
+
let o = a ? e === "from" ? {
|
|
3683
|
+
f: r,
|
|
3684
|
+
t: r
|
|
3685
|
+
} : {
|
|
3686
|
+
f: i,
|
|
3687
|
+
t: i
|
|
3688
|
+
} : {
|
|
3689
|
+
f: r,
|
|
3690
|
+
t: i
|
|
3691
|
+
};
|
|
3692
|
+
Et(o.f, o.t, n ? void 0 : e), ft(t), Ot(t);
|
|
3693
|
+
}, en = (e) => {
|
|
3694
|
+
Qt.cancel();
|
|
3695
|
+
let t = e === "from" ? at : st;
|
|
3696
|
+
if (!t.trim()) return;
|
|
3697
|
+
let n = ue(t, {
|
|
3698
|
+
within: Ze,
|
|
3699
|
+
today: Ze,
|
|
3700
|
+
order: Xe,
|
|
3701
|
+
withTime: !1
|
|
3702
|
+
});
|
|
3703
|
+
if (!n) {
|
|
3704
|
+
let t = e === "from" ? $e : et;
|
|
3705
|
+
e === "from" ? ot(le(t, F, !1)) : ct(le(t, F, !1));
|
|
3706
|
+
return;
|
|
3707
|
+
}
|
|
3708
|
+
$t(e, n.day, !0);
|
|
3709
|
+
}, tn = (e) => (t) => {
|
|
3710
|
+
let n = e === "from" ? G(tt, t) : $e, r = e === "to" ? G(nt, t) : et;
|
|
3711
|
+
wt(n, O ? r : "");
|
|
3712
|
+
}, nn = !!tt && !H(tt, j, M) || !!nt && !H(nt, j, M), rn = Ue ?? (!!h || nn), an = g(() => Re({
|
|
3713
|
+
size: Vt,
|
|
3714
|
+
variant: Ut,
|
|
3715
|
+
error: !!h || nn,
|
|
3716
|
+
disabled: Gt,
|
|
3717
|
+
readOnly: Kt,
|
|
3718
|
+
popupOpen: qt
|
|
3719
|
+
}).map((e) => Bt[e]).filter(Boolean).join(" "), [
|
|
3720
|
+
Vt,
|
|
3721
|
+
Ut,
|
|
3722
|
+
h,
|
|
3723
|
+
nn,
|
|
3724
|
+
Gt,
|
|
3725
|
+
Kt,
|
|
3726
|
+
qt
|
|
3727
|
+
]), on = g(() => O ? {
|
|
3728
|
+
from: tt,
|
|
3729
|
+
to: nt
|
|
3730
|
+
} : {
|
|
3731
|
+
from: tt,
|
|
3732
|
+
to: tt
|
|
3733
|
+
}, [
|
|
3734
|
+
O,
|
|
3735
|
+
tt,
|
|
3736
|
+
nt
|
|
3737
|
+
]), sn = g(() => Array.from({ length: Ye }, (e, t) => de({
|
|
3738
|
+
month: R(pt, t),
|
|
3739
|
+
today: Ze,
|
|
3740
|
+
selected: O ? "" : tt,
|
|
3741
|
+
rangeFrom: O ? on.from : "",
|
|
3742
|
+
rangeTo: O ? on.to : "",
|
|
3743
|
+
highlighted: dt,
|
|
3744
|
+
min: j,
|
|
3745
|
+
max: M,
|
|
3746
|
+
weekStart: ee
|
|
3747
|
+
})), [
|
|
3748
|
+
Ye,
|
|
3749
|
+
pt,
|
|
3750
|
+
Ze,
|
|
3751
|
+
tt,
|
|
3752
|
+
O,
|
|
3753
|
+
on,
|
|
3754
|
+
dt,
|
|
3755
|
+
j,
|
|
3756
|
+
M,
|
|
3757
|
+
ee
|
|
3758
|
+
]), cn = u((e) => `${Yt}-d-${e}`, [Yt]), Q = u((e) => {
|
|
3759
|
+
let t = N(e);
|
|
3760
|
+
return t ? `${t.d} ${re[t.m - 1] ?? ""} ${t.y}` : e;
|
|
3761
|
+
}, [re]), ln = !Gt && !Kt, un = d ?? ce(F, !1), dn = (() => {
|
|
3762
|
+
if (_t) {
|
|
3763
|
+
let e = Mt.find((e) => e.key === _t);
|
|
3764
|
+
if (e) return e.label;
|
|
3765
|
+
}
|
|
3766
|
+
if (!tt) return O ? `${un} → ${un}` : un;
|
|
3767
|
+
let e = se(tt, F);
|
|
3768
|
+
return O ? nt ? `${e} → ${se(nt, F)}` : `${e} → …` : xt && rt ? `${e} ${rt}` : e;
|
|
3769
|
+
})(), mn = (() => {
|
|
3770
|
+
let e = tt && `${se(tt, F)}${xt ? ` ${rt || "00:00"}` : ""}`, t = O && nt && `${se(nt, F)}${xt ? ` ${it || "23:59"}` : ""}`;
|
|
3771
|
+
return e && t ? `${e} to ${t}` : e || t || "";
|
|
3772
|
+
})(), gn = (e) => {
|
|
3773
|
+
let t = sn[e], n = (t, n) => {
|
|
3774
|
+
let r = `${String(t).padStart(4, "0")}-${String(n).padStart(2, "0")}-01`;
|
|
3775
|
+
mt(R(r, -e));
|
|
3776
|
+
}, r = [], i = Number(Ze.slice(0, 4));
|
|
3777
|
+
for (let e = i - 12; e <= i + 5; e++) r.push(e);
|
|
3778
|
+
return /* @__PURE__ */ x("div", {
|
|
3779
|
+
className: $.jump,
|
|
3780
|
+
children: [/* @__PURE__ */ b("select", {
|
|
3781
|
+
className: $.jumpSelect,
|
|
3782
|
+
"aria-label": `Month of ${re[t.monthIndex - 1]} ${t.year}`,
|
|
3783
|
+
value: t.monthIndex,
|
|
3784
|
+
onChange: (e) => n(t.year, Number(e.target.value)),
|
|
3785
|
+
children: re.map((e, t) => /* @__PURE__ */ b("option", {
|
|
3786
|
+
value: t + 1,
|
|
3787
|
+
children: e
|
|
3788
|
+
}, e))
|
|
3789
|
+
}), /* @__PURE__ */ b("select", {
|
|
3790
|
+
className: $.jumpSelect,
|
|
3791
|
+
"aria-label": `Year of ${re[t.monthIndex - 1]} ${t.year}`,
|
|
3792
|
+
value: t.year,
|
|
3793
|
+
onChange: (e) => n(Number(e.target.value), t.monthIndex),
|
|
3794
|
+
children: r.map((e) => /* @__PURE__ */ b("option", {
|
|
3795
|
+
value: e,
|
|
3796
|
+
children: e
|
|
3797
|
+
}, e))
|
|
3798
|
+
})]
|
|
3799
|
+
});
|
|
3800
|
+
}, vn = (e) => /* @__PURE__ */ b("div", {
|
|
3801
|
+
className: $.entry,
|
|
3802
|
+
children: /* @__PURE__ */ b(Ht, {
|
|
3803
|
+
size: ze(ze(Vt)),
|
|
3804
|
+
variant: Ut,
|
|
3805
|
+
layout: "default",
|
|
3806
|
+
clearable: D && !Gt && !Kt,
|
|
3807
|
+
label: e === "from" ? O ? "From" : "Date" : "To",
|
|
3808
|
+
labelClassName: $.entryLabel,
|
|
3809
|
+
inputRef: qe[e],
|
|
3810
|
+
id: e === "from" ? `${Yt}-in` : `${Yt}-to`,
|
|
3811
|
+
inputMode: "decimal",
|
|
3812
|
+
autoComplete: "off",
|
|
3813
|
+
spellCheck: !1,
|
|
3814
|
+
value: e === "from" ? at : st,
|
|
3815
|
+
placeholder: un,
|
|
3816
|
+
onChange: Zt(e),
|
|
3817
|
+
onFocus: () => {
|
|
3818
|
+
ut(e), Dt(e);
|
|
3819
|
+
},
|
|
3820
|
+
onBlur: () => en(e),
|
|
3821
|
+
onKeyDown: zt.handlers.onKeyDown,
|
|
3822
|
+
"aria-label": e === "from" ? O ? "From" : "Date" : "To",
|
|
3823
|
+
"aria-activedescendant": lt === e ? cn(dt) : void 0,
|
|
3824
|
+
"aria-controls": `${Yt}-cal`,
|
|
3825
|
+
"aria-invalid": rn
|
|
3826
|
+
})
|
|
3827
|
+
}, e);
|
|
3828
|
+
return /* @__PURE__ */ x(kt, {
|
|
3829
|
+
tooltip: De,
|
|
3830
|
+
tooltipTrigger: Oe,
|
|
3831
|
+
className: [
|
|
3832
|
+
$.root,
|
|
3833
|
+
J ? $.fullWidth : "",
|
|
3834
|
+
Ee
|
|
3835
|
+
].filter(Boolean).join(" "),
|
|
3836
|
+
layout: Wt,
|
|
3837
|
+
size: Vt,
|
|
3838
|
+
label: l,
|
|
3839
|
+
labelClassName: ke,
|
|
3840
|
+
labelId: `${Yt}-label`,
|
|
3841
|
+
labelFor: Yt,
|
|
3842
|
+
error: h,
|
|
3843
|
+
hint: p,
|
|
3844
|
+
required: w,
|
|
3845
|
+
disabled: Gt,
|
|
3846
|
+
style: Ae,
|
|
3847
|
+
messageId: p || h ? `${Yt}-hint` : void 0,
|
|
3848
|
+
children: [/* @__PURE__ */ x("div", {
|
|
3849
|
+
...We,
|
|
3850
|
+
ref: Ge,
|
|
3851
|
+
id: Yt,
|
|
3852
|
+
className: `${an} ${$.trigger}`,
|
|
3853
|
+
role: "combobox",
|
|
3854
|
+
"aria-expanded": qt,
|
|
3855
|
+
"aria-haspopup": "dialog",
|
|
3856
|
+
"aria-controls": qt ? `${Yt}-cal` : void 0,
|
|
3857
|
+
"aria-label": Le,
|
|
3858
|
+
"aria-labelledby": Be || (l ? `${Yt}-label` : void 0),
|
|
3859
|
+
"aria-describedby": Ve || (p || h ? `${Yt}-hint` : void 0),
|
|
3860
|
+
"aria-required": He ?? w,
|
|
3861
|
+
"aria-invalid": rn,
|
|
3862
|
+
"aria-disabled": Gt,
|
|
3863
|
+
tabIndex: Gt ? -1 : E ?? 0,
|
|
3864
|
+
autoFocus: T,
|
|
3865
|
+
onClick: () => {
|
|
3866
|
+
ln && Jt(!qt, "click");
|
|
3867
|
+
},
|
|
3868
|
+
...zt.handlers,
|
|
3869
|
+
...Pe !== void 0 && { "data-cellindex": Pe },
|
|
3870
|
+
children: [/* @__PURE__ */ b("span", {
|
|
3871
|
+
className: `${$.triggerText} ${!tt && !_t ? $.triggerEmpty : ""}`,
|
|
3872
|
+
children: dn
|
|
3873
|
+
}), /* @__PURE__ */ x("span", {
|
|
3874
|
+
className: $.triggerIcons,
|
|
3875
|
+
children: [D && tt && ln && /* @__PURE__ */ b("button", {
|
|
3876
|
+
type: "button",
|
|
3877
|
+
className: $.clearBtn,
|
|
3878
|
+
"aria-label": ie || "Clear",
|
|
3879
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
3880
|
+
onClick: (e) => {
|
|
3881
|
+
e.stopPropagation(), Et("", ""), vt("");
|
|
3882
|
+
},
|
|
3883
|
+
children: "×"
|
|
3884
|
+
}), he && /* @__PURE__ */ b("svg", {
|
|
3885
|
+
className: $.calIcon,
|
|
3886
|
+
viewBox: "0 0 24 24",
|
|
3887
|
+
width: "1em",
|
|
3888
|
+
height: "1em",
|
|
3889
|
+
"aria-hidden": !0,
|
|
3890
|
+
focusable: "false",
|
|
3891
|
+
children: /* @__PURE__ */ b("path", {
|
|
3892
|
+
fill: "currentColor",
|
|
3893
|
+
d: "M7 2v2H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2V2h-2v2H9V2H7Zm12 7v10H5V9h14Z"
|
|
3894
|
+
})
|
|
3895
|
+
})]
|
|
3896
|
+
})]
|
|
3897
|
+
}), qt && /* @__PURE__ */ b(fn, {
|
|
3898
|
+
open: !0,
|
|
3899
|
+
anchorEl: Ge.current,
|
|
3900
|
+
onClose: () => Jt(!1, "escape"),
|
|
3901
|
+
placement: me,
|
|
3902
|
+
offset: 4,
|
|
3903
|
+
padded: !1,
|
|
3904
|
+
autoFocus: !1,
|
|
3905
|
+
returnFocus: !1,
|
|
3906
|
+
role: "dialog",
|
|
3907
|
+
"aria-label": typeof l == "string" && l ? l : "Choose dates",
|
|
3908
|
+
className: $.pop,
|
|
3909
|
+
children: /* @__PURE__ */ x("div", {
|
|
3910
|
+
id: `${Yt}-cal`,
|
|
3911
|
+
ref: Ke,
|
|
3912
|
+
className: `${$.panel} ${$[`sz_${Vt}`] ?? ""}`,
|
|
3913
|
+
onMouseDown: (e) => {
|
|
3914
|
+
let t = e.target.tagName;
|
|
3915
|
+
t !== "INPUT" && t !== "SELECT" && t !== "OPTION" && e.preventDefault();
|
|
3916
|
+
},
|
|
3917
|
+
children: [/* @__PURE__ */ x("div", {
|
|
3918
|
+
className: $.body,
|
|
3919
|
+
children: [Mt.length > 0 && /* @__PURE__ */ x("div", {
|
|
3920
|
+
className: $.rail,
|
|
3921
|
+
role: "group",
|
|
3922
|
+
"aria-label": "Preset ranges",
|
|
3923
|
+
children: [Nt.length === 0 && /* @__PURE__ */ b("span", {
|
|
3924
|
+
className: $.railEmpty,
|
|
3925
|
+
children: "no preset matches"
|
|
3926
|
+
}), Nt.map((e) => /* @__PURE__ */ b("button", {
|
|
3927
|
+
type: "button",
|
|
3928
|
+
className: $.preset,
|
|
3929
|
+
"aria-pressed": _t === e.key,
|
|
3930
|
+
onClick: () => Pt(e),
|
|
3931
|
+
children: e.label
|
|
3932
|
+
}, e.key))]
|
|
3933
|
+
}), /* @__PURE__ */ x("div", {
|
|
3934
|
+
className: `${$.calendars} ${Mt.length ? "" : $.noRail}`,
|
|
3935
|
+
children: [
|
|
3936
|
+
/* @__PURE__ */ x("div", {
|
|
3937
|
+
className: $.entries,
|
|
3938
|
+
children: [
|
|
3939
|
+
vn("from"),
|
|
3940
|
+
O && vn("to"),
|
|
3941
|
+
xt && /* @__PURE__ */ b(hn, {
|
|
3942
|
+
size: ze(ze(Vt)),
|
|
3943
|
+
variant: Ut,
|
|
3944
|
+
id: `${Yt}-t1`,
|
|
3945
|
+
label: O ? "Start time" : "Time",
|
|
3946
|
+
value: rt || (O ? "00:00" : Cn()),
|
|
3947
|
+
onChange: tn("from"),
|
|
3948
|
+
disabled: !tt
|
|
3949
|
+
}),
|
|
3950
|
+
xt && O && /* @__PURE__ */ b(hn, {
|
|
3951
|
+
size: ze(ze(Vt)),
|
|
3952
|
+
variant: Ut,
|
|
3953
|
+
id: `${Yt}-t2`,
|
|
3954
|
+
label: "End time",
|
|
3955
|
+
value: it || "23:59",
|
|
3956
|
+
onChange: tn("to"),
|
|
3957
|
+
fallback: "23:59",
|
|
3958
|
+
disabled: !nt
|
|
3959
|
+
})
|
|
3960
|
+
]
|
|
3961
|
+
}),
|
|
3962
|
+
/* @__PURE__ */ x("div", {
|
|
3963
|
+
className: $.calHead,
|
|
3964
|
+
children: [
|
|
3965
|
+
/* @__PURE__ */ b("button", {
|
|
3966
|
+
type: "button",
|
|
3967
|
+
className: $.nav,
|
|
3968
|
+
"aria-label": "Previous month",
|
|
3969
|
+
disabled: !sn[0].canPagePrev,
|
|
3970
|
+
onClick: () => mt(R(pt, -1)),
|
|
3971
|
+
children: "‹"
|
|
3972
|
+
}),
|
|
3973
|
+
/* @__PURE__ */ b("div", {
|
|
3974
|
+
className: `${$.jumps} ${Ye > 1 && V === "right" ? $.sideRight : ""}`,
|
|
3975
|
+
children: sn.map((e, t) => /* @__PURE__ */ b(s.Fragment, { children: gn(t) }, e.month))
|
|
3976
|
+
}),
|
|
3977
|
+
k && A && /* @__PURE__ */ b("button", {
|
|
3978
|
+
type: "button",
|
|
3979
|
+
className: `${$.nav} ${yt ? $.navOn : ""}`,
|
|
3980
|
+
"aria-label": yt ? "Hide time" : "Choose a time",
|
|
3981
|
+
"aria-pressed": yt,
|
|
3982
|
+
onClick: () => bt((e) => !e),
|
|
3983
|
+
children: /* @__PURE__ */ b("svg", {
|
|
3984
|
+
viewBox: "0 0 24 24",
|
|
3985
|
+
width: "1em",
|
|
3986
|
+
height: "1em",
|
|
3987
|
+
"aria-hidden": !0,
|
|
3988
|
+
focusable: "false",
|
|
3989
|
+
children: /* @__PURE__ */ b("path", {
|
|
3990
|
+
fill: "currentColor",
|
|
3991
|
+
d: "M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm1-13h-2v6l5 3 1-1.6-4-2.4V7Z"
|
|
3992
|
+
})
|
|
3993
|
+
})
|
|
3994
|
+
}),
|
|
3995
|
+
/* @__PURE__ */ b("button", {
|
|
3996
|
+
type: "button",
|
|
3997
|
+
className: $.nav,
|
|
3998
|
+
"aria-label": "Next month",
|
|
3999
|
+
disabled: !sn[sn.length - 1].canPageNext,
|
|
4000
|
+
onClick: () => mt(R(pt, 1)),
|
|
4001
|
+
children: "›"
|
|
4002
|
+
})
|
|
4003
|
+
]
|
|
4004
|
+
}),
|
|
4005
|
+
/* @__PURE__ */ b("div", {
|
|
4006
|
+
className: `${$.grids} ${Ye > 1 && V === "right" ? $.sideRight : ""}`,
|
|
4007
|
+
children: sn.map((e, t) => /* @__PURE__ */ b(pn, {
|
|
4008
|
+
view: e,
|
|
4009
|
+
dayId: cn,
|
|
4010
|
+
dayLabel: Q,
|
|
4011
|
+
weekdayNames: K,
|
|
4012
|
+
outside: X(t),
|
|
4013
|
+
label: `${re[e.monthIndex - 1]} ${e.year}`,
|
|
4014
|
+
onPick: At
|
|
4015
|
+
}, e.month))
|
|
4016
|
+
})
|
|
4017
|
+
]
|
|
4018
|
+
})]
|
|
4019
|
+
}), /* @__PURE__ */ x("div", {
|
|
4020
|
+
className: $.foot,
|
|
4021
|
+
children: [/* @__PURE__ */ b("span", {
|
|
4022
|
+
className: $.footRead,
|
|
4023
|
+
children: mn ? /* @__PURE__ */ x(y, { children: ["Selected: ", /* @__PURE__ */ b("b", { children: mn })] }) : "Pick a date."
|
|
4024
|
+
}), /* @__PURE__ */ x("span", {
|
|
4025
|
+
className: $.footAct,
|
|
4026
|
+
children: [ie && /* @__PURE__ */ b("button", {
|
|
4027
|
+
type: "button",
|
|
4028
|
+
className: $.footBtn,
|
|
4029
|
+
onClick: () => {
|
|
4030
|
+
Et("", ""), vt(""), ut("from"), Xt("from");
|
|
4031
|
+
},
|
|
4032
|
+
children: ie
|
|
4033
|
+
}), ae && /* @__PURE__ */ b("button", {
|
|
4034
|
+
type: "button",
|
|
4035
|
+
className: $.apply,
|
|
4036
|
+
onClick: () => {
|
|
4037
|
+
Jt(!1, "select"), q?.(O ? {
|
|
4038
|
+
from: $e,
|
|
4039
|
+
to: et
|
|
4040
|
+
} : $e);
|
|
4041
|
+
},
|
|
4042
|
+
children: ae
|
|
4043
|
+
})]
|
|
4044
|
+
})]
|
|
4045
|
+
})]
|
|
4046
|
+
})
|
|
4047
|
+
})]
|
|
4048
|
+
});
|
|
4049
|
+
});
|
|
4050
|
+
Tn.displayName = "DatePicker";
|
|
4051
|
+
var En = {
|
|
4052
|
+
root: "_root_uu4bq_3",
|
|
4053
|
+
fullWidth: "_fullWidth_uu4bq_16",
|
|
4054
|
+
tab: "_tab_uu4bq_16",
|
|
4055
|
+
small: "_small_uu4bq_50",
|
|
4056
|
+
medium: "_medium_uu4bq_51",
|
|
4057
|
+
line: "_line_uu4bq_54",
|
|
4058
|
+
active: "_active_uu4bq_67",
|
|
4059
|
+
pill: "_pill_uu4bq_71",
|
|
4060
|
+
enclosed: "_enclosed_uu4bq_78",
|
|
4061
|
+
icon: "_icon_uu4bq_94",
|
|
4062
|
+
badge: "_badge_uu4bq_96",
|
|
4063
|
+
panel: "_panel_uu4bq_115"
|
|
4064
|
+
}, Dn = ({ items: e, value: t, onChange: n, as: r, variant: i = "line", size: a = "medium", fullWidth: o = !1, activateOnFocus: s = !0, idPrefix: c, className: l = "", style: d, "aria-label": m }) => {
|
|
4065
|
+
let h = p(), g = c ?? `tabs${h.replace(/[:]/g, "")}`, v = _(null), S = _([]), C = !!r || e.some((e) => e.href !== void 0), w = e.findIndex((e) => e.value === t);
|
|
4066
|
+
f(() => {
|
|
4067
|
+
let e = S.current[w];
|
|
4068
|
+
e && v.current && e.scrollIntoView({
|
|
4069
|
+
block: "nearest",
|
|
4070
|
+
inline: "nearest"
|
|
4071
|
+
});
|
|
4072
|
+
}, [w]);
|
|
4073
|
+
let T = e.map((e, t) => ({
|
|
4074
|
+
it: e,
|
|
4075
|
+
i: t
|
|
4076
|
+
})).filter(({ it: e }) => !e.disabled), E = u((t) => {
|
|
4077
|
+
if (S.current[t]?.focus(), s) {
|
|
4078
|
+
let r = e[t];
|
|
4079
|
+
r && !r.disabled && n?.(r.value, r);
|
|
4080
|
+
}
|
|
4081
|
+
}, [
|
|
4082
|
+
e,
|
|
4083
|
+
n,
|
|
4084
|
+
s
|
|
4085
|
+
]), D = (e) => {
|
|
4086
|
+
if (C || !T.length) return;
|
|
4087
|
+
let t = T.findIndex((e) => e.i === w), n = (n) => {
|
|
4088
|
+
e.preventDefault();
|
|
4089
|
+
let r = ((t === -1 ? 0 : t) + n + T.length) % T.length;
|
|
4090
|
+
E(T[r].i);
|
|
4091
|
+
};
|
|
4092
|
+
switch (e.key) {
|
|
4093
|
+
case "ArrowRight":
|
|
4094
|
+
n(1);
|
|
4095
|
+
break;
|
|
4096
|
+
case "ArrowLeft":
|
|
4097
|
+
n(-1);
|
|
4098
|
+
break;
|
|
4099
|
+
case "Home":
|
|
4100
|
+
e.preventDefault(), E(T[0].i);
|
|
4101
|
+
break;
|
|
4102
|
+
case "End":
|
|
4103
|
+
e.preventDefault(), E(T[T.length - 1].i);
|
|
4104
|
+
break;
|
|
4105
|
+
default: break;
|
|
4106
|
+
}
|
|
4107
|
+
}, O = r ?? (C ? "a" : "button");
|
|
4108
|
+
return /* @__PURE__ */ b(C ? "nav" : "div", {
|
|
4109
|
+
ref: v,
|
|
4110
|
+
className: [
|
|
4111
|
+
En.root,
|
|
4112
|
+
En[i],
|
|
4113
|
+
En[a],
|
|
4114
|
+
o ? En.fullWidth : "",
|
|
4115
|
+
l
|
|
4116
|
+
].filter(Boolean).join(" "),
|
|
4117
|
+
style: d,
|
|
4118
|
+
role: C ? void 0 : "tablist",
|
|
4119
|
+
"aria-label": m,
|
|
4120
|
+
onKeyDown: D,
|
|
4121
|
+
children: e.map((e, r) => {
|
|
4122
|
+
let i = e.value === t, a = {
|
|
4123
|
+
ref: (e) => {
|
|
4124
|
+
S.current[r] = e;
|
|
4125
|
+
},
|
|
4126
|
+
className: [En.tab, i ? En.active : ""].filter(Boolean).join(" "),
|
|
4127
|
+
key: e.value,
|
|
4128
|
+
children: /* @__PURE__ */ x(y, { children: [
|
|
4129
|
+
e.icon && /* @__PURE__ */ b("span", {
|
|
4130
|
+
className: En.icon,
|
|
4131
|
+
children: e.icon
|
|
4132
|
+
}),
|
|
4133
|
+
/* @__PURE__ */ b("span", { children: e.label }),
|
|
4134
|
+
e.badge !== void 0 && /* @__PURE__ */ b("span", {
|
|
4135
|
+
className: En.badge,
|
|
4136
|
+
children: e.badge
|
|
4137
|
+
})
|
|
4138
|
+
] })
|
|
4139
|
+
};
|
|
4140
|
+
return C ? /* @__PURE__ */ b(O, {
|
|
4141
|
+
...a,
|
|
4142
|
+
href: e.href,
|
|
4143
|
+
"aria-current": i ? "page" : void 0,
|
|
4144
|
+
"aria-disabled": e.disabled || void 0,
|
|
4145
|
+
onClick: (t) => {
|
|
4146
|
+
if (e.disabled) {
|
|
4147
|
+
t.preventDefault();
|
|
4148
|
+
return;
|
|
4149
|
+
}
|
|
4150
|
+
n?.(e.value, e);
|
|
4151
|
+
},
|
|
4152
|
+
...e.props
|
|
4153
|
+
}) : /* @__PURE__ */ b(O, {
|
|
4154
|
+
...a,
|
|
4155
|
+
type: "button",
|
|
4156
|
+
role: "tab",
|
|
4157
|
+
id: `${g}-tab-${e.value}`,
|
|
4158
|
+
"aria-selected": i,
|
|
4159
|
+
"aria-controls": `${g}-panel-${e.value}`,
|
|
4160
|
+
tabIndex: i ? 0 : -1,
|
|
4161
|
+
disabled: e.disabled,
|
|
4162
|
+
onClick: () => !e.disabled && n?.(e.value, e),
|
|
4163
|
+
...e.props
|
|
4164
|
+
});
|
|
4165
|
+
})
|
|
4166
|
+
});
|
|
4167
|
+
};
|
|
4168
|
+
Dn.displayName = "Tabs";
|
|
4169
|
+
var On = ({ value: e, idPrefix: t, active: n, children: r, className: i = "" }) => n ? /* @__PURE__ */ b("div", {
|
|
4170
|
+
role: "tabpanel",
|
|
4171
|
+
id: `${t}-panel-${e}`,
|
|
4172
|
+
"aria-labelledby": `${t}-tab-${e}`,
|
|
4173
|
+
tabIndex: 0,
|
|
4174
|
+
className: [En.panel, i].filter(Boolean).join(" "),
|
|
4175
|
+
children: r
|
|
4176
|
+
}) : null;
|
|
4177
|
+
On.displayName = "TabPanel";
|
|
4178
|
+
var kn = {
|
|
4179
|
+
root: "_root_7md37_7",
|
|
4180
|
+
nonModal: "_nonModal_7md37_30",
|
|
4181
|
+
panel: "_panel_7md37_3",
|
|
4182
|
+
center: "_center_7md37_41",
|
|
4183
|
+
right: "_right_7md37_42",
|
|
4184
|
+
left: "_left_7md37_43",
|
|
4185
|
+
top: "_top_7md37_44",
|
|
4186
|
+
bottom: "_bottom_7md37_45",
|
|
4187
|
+
sm: "_sm_7md37_86",
|
|
4188
|
+
md: "_md_7md37_87",
|
|
4189
|
+
lg: "_lg_7md37_88",
|
|
4190
|
+
xl: "_xl_7md37_89",
|
|
4191
|
+
full: "_full_7md37_90",
|
|
4192
|
+
header: "_header_7md37_96",
|
|
4193
|
+
headText: "_headText_7md37_106",
|
|
4194
|
+
title: "_title_7md37_108",
|
|
4195
|
+
subtitle: "_subtitle_7md37_114",
|
|
4196
|
+
body: "_body_7md37_120",
|
|
4197
|
+
flush: "_flush_7md37_128",
|
|
4198
|
+
footer: "_footer_7md37_130",
|
|
4199
|
+
close: "_close_7md37_141",
|
|
4200
|
+
dialogPop: "_dialogPop_7md37_1",
|
|
4201
|
+
slideFromRight: "_slideFromRight_7md37_1",
|
|
4202
|
+
slideFromLeft: "_slideFromLeft_7md37_1",
|
|
4203
|
+
slideFromTop: "_slideFromTop_7md37_1",
|
|
4204
|
+
slideFromBottom: "_slideFromBottom_7md37_1",
|
|
4205
|
+
backdropIn: "_backdropIn_7md37_1",
|
|
4206
|
+
closing: "_closing_7md37_168"
|
|
4207
|
+
}, An = 0, jn = null, Mn = (e) => {
|
|
4208
|
+
if (!(typeof document > "u")) {
|
|
4209
|
+
if (An === 0) {
|
|
4210
|
+
let t = document.body;
|
|
4211
|
+
jn = {
|
|
4212
|
+
overflow: t.style.overflow,
|
|
4213
|
+
paddingRight: t.style.paddingRight
|
|
4214
|
+
};
|
|
4215
|
+
let n = window.innerWidth - document.documentElement.clientWidth;
|
|
4216
|
+
if (e && n > 0) {
|
|
4217
|
+
let e = parseFloat(window.getComputedStyle(t).paddingRight) || 0;
|
|
4218
|
+
t.style.paddingRight = `${e + n}px`;
|
|
4219
|
+
}
|
|
4220
|
+
t.style.overflow = "hidden";
|
|
4221
|
+
}
|
|
4222
|
+
An += 1;
|
|
4223
|
+
}
|
|
4224
|
+
}, Nn = () => {
|
|
4225
|
+
typeof document > "u" || (An = Math.max(0, An - 1), An === 0 && jn && (document.body.style.overflow = jn.overflow, document.body.style.paddingRight = jn.paddingRight, jn = null));
|
|
4226
|
+
}, Pn = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, Fn = /* @__PURE__ */ x("svg", {
|
|
4227
|
+
width: "16",
|
|
4228
|
+
height: "16",
|
|
4229
|
+
viewBox: "0 0 24 24",
|
|
4230
|
+
fill: "none",
|
|
4231
|
+
stroke: "currentColor",
|
|
4232
|
+
strokeWidth: "2",
|
|
4233
|
+
strokeLinecap: "round",
|
|
4234
|
+
"aria-hidden": "true",
|
|
4235
|
+
children: [/* @__PURE__ */ b("line", {
|
|
4236
|
+
x1: "18",
|
|
4237
|
+
y1: "6",
|
|
4238
|
+
x2: "6",
|
|
4239
|
+
y2: "18"
|
|
4240
|
+
}), /* @__PURE__ */ b("line", {
|
|
4241
|
+
x1: "6",
|
|
4242
|
+
y1: "6",
|
|
4243
|
+
x2: "18",
|
|
4244
|
+
y2: "18"
|
|
4245
|
+
})]
|
|
4246
|
+
}), In = ({ open: e, onClose: n, onBeforeClose: r, onEscKeyDown: i, onOverlayClick: a, onAnimationEnd: o, children: s, title: c, subtitle: l, footer: d, modal: m = !0, placement: h = "center", size: g = "md", closeOnBackdrop: y = !0, closeOnEscape: S = !0, showCloseButton: w = !0, closeIcon: T, closeIconId: E, blockScroll: D = !0, reserveScrollBarGap: O = !0, initialFocusRef: k, container: A, animationDuration: j = 200, padded: M = !0, classNames: N = {}, styleSlots: P = {}, className: F = "", style: I, role: L = "dialog", id: R, "aria-label": ee, "aria-labelledby": z, "aria-describedby": B }) => {
|
|
4247
|
+
let V = _(null), [H, te] = v(null), U = p(), [W, G] = v(e), [ne, re] = v(!1), K = _(null), ie = Pn() ? 0 : j;
|
|
4248
|
+
f(() => {
|
|
4249
|
+
e ? (K.current &&= (clearTimeout(K.current), null), re(!1), G(!0)) : W && (re(!0), K.current = setTimeout(() => {
|
|
4250
|
+
V.current?.close(), G(!1), re(!1), o?.();
|
|
4251
|
+
}, ie));
|
|
4252
|
+
}, [e]), f(() => () => {
|
|
4253
|
+
K.current && clearTimeout(K.current);
|
|
4254
|
+
}, []);
|
|
4255
|
+
let ae = u(() => {
|
|
4256
|
+
r && r() === !1 || n?.();
|
|
4257
|
+
}, [r, n]);
|
|
4258
|
+
f(() => {
|
|
4259
|
+
let e = V.current;
|
|
4260
|
+
if (!(!e || !W) && (e.open || (m ? e.showModal() : e.show(), k?.current && k.current.focus({ focusVisible: !0 })), !(!D || !m))) return Mn(O), () => Nn();
|
|
4261
|
+
}, [
|
|
4262
|
+
W,
|
|
4263
|
+
m,
|
|
4264
|
+
D,
|
|
4265
|
+
O,
|
|
4266
|
+
k
|
|
4267
|
+
]), f(() => {
|
|
4268
|
+
let e = V.current;
|
|
4269
|
+
if (!e || !W) return;
|
|
4270
|
+
let t = (e) => {
|
|
4271
|
+
e.preventDefault(), i?.(e), S && ae();
|
|
4272
|
+
};
|
|
4273
|
+
return e.addEventListener("cancel", t), () => e.removeEventListener("cancel", t);
|
|
4274
|
+
}, [
|
|
4275
|
+
W,
|
|
4276
|
+
S,
|
|
4277
|
+
ae,
|
|
4278
|
+
i
|
|
4279
|
+
]);
|
|
4280
|
+
let oe = _(!1), se = (e) => {
|
|
4281
|
+
oe.current = e.target === V.current;
|
|
4282
|
+
}, ce = (e) => {
|
|
4283
|
+
let t = oe.current && e.target === V.current;
|
|
4284
|
+
oe.current = !1, t && (a?.(e), y && ae());
|
|
4285
|
+
};
|
|
4286
|
+
if (!W) return null;
|
|
4287
|
+
let le = c !== void 0 || l !== void 0 || w, ue = z ?? (c !== void 0 && !ee ? U : void 0), de = /* @__PURE__ */ b("dialog", {
|
|
4288
|
+
ref: (e) => {
|
|
4289
|
+
V.current = e, te(e);
|
|
4290
|
+
},
|
|
4291
|
+
id: R,
|
|
4292
|
+
className: [
|
|
4293
|
+
kn.root,
|
|
4294
|
+
kn[h],
|
|
4295
|
+
kn[g],
|
|
4296
|
+
m ? "" : kn.nonModal,
|
|
4297
|
+
ne ? kn.closing : "",
|
|
4298
|
+
N.root,
|
|
4299
|
+
F
|
|
4300
|
+
].filter(Boolean).join(" "),
|
|
4301
|
+
style: {
|
|
4302
|
+
"--dialog-anim": `${ie}ms`,
|
|
4303
|
+
...P.root,
|
|
4304
|
+
...I
|
|
4305
|
+
},
|
|
4306
|
+
role: L,
|
|
4307
|
+
"aria-label": ee,
|
|
4308
|
+
"aria-labelledby": ue,
|
|
4309
|
+
"aria-describedby": B,
|
|
4310
|
+
"aria-modal": m || void 0,
|
|
4311
|
+
onPointerDown: se,
|
|
4312
|
+
onPointerUp: ce,
|
|
4313
|
+
children: /* @__PURE__ */ b(t.Provider, {
|
|
4314
|
+
value: H,
|
|
4315
|
+
children: /* @__PURE__ */ x("div", {
|
|
4316
|
+
className: [kn.panel, N.panel].filter(Boolean).join(" "),
|
|
4317
|
+
style: P.panel,
|
|
4318
|
+
children: [
|
|
4319
|
+
le && /* @__PURE__ */ x("div", {
|
|
4320
|
+
className: [kn.header, N.header].filter(Boolean).join(" "),
|
|
4321
|
+
style: P.header,
|
|
4322
|
+
children: [/* @__PURE__ */ x("span", {
|
|
4323
|
+
className: kn.headText,
|
|
4324
|
+
children: [c !== void 0 && /* @__PURE__ */ b("span", {
|
|
4325
|
+
className: kn.title,
|
|
4326
|
+
id: U,
|
|
4327
|
+
children: c
|
|
4328
|
+
}), l !== void 0 && /* @__PURE__ */ b("span", {
|
|
4329
|
+
className: kn.subtitle,
|
|
4330
|
+
children: l
|
|
4331
|
+
})]
|
|
4332
|
+
}), w && /* @__PURE__ */ b("button", {
|
|
4333
|
+
type: "button",
|
|
4334
|
+
id: E,
|
|
4335
|
+
className: [kn.close, N.closeButton].filter(Boolean).join(" "),
|
|
4336
|
+
style: P.closeButton,
|
|
4337
|
+
onClick: ae,
|
|
4338
|
+
"aria-label": "Close",
|
|
4339
|
+
children: T ?? Fn
|
|
4340
|
+
})]
|
|
4341
|
+
}),
|
|
4342
|
+
s !== void 0 && /* @__PURE__ */ b("div", {
|
|
4343
|
+
className: [
|
|
4344
|
+
kn.body,
|
|
4345
|
+
M ? "" : kn.flush,
|
|
4346
|
+
N.body
|
|
4347
|
+
].filter(Boolean).join(" "),
|
|
4348
|
+
style: P.body,
|
|
4349
|
+
children: s
|
|
4350
|
+
}),
|
|
4351
|
+
d !== void 0 && /* @__PURE__ */ b("div", {
|
|
4352
|
+
className: [kn.footer, N.footer].filter(Boolean).join(" "),
|
|
4353
|
+
style: P.footer,
|
|
4354
|
+
children: d
|
|
4355
|
+
})
|
|
4356
|
+
]
|
|
4357
|
+
})
|
|
4358
|
+
})
|
|
4359
|
+
}), q = A ?? (typeof document > "u" ? null : document.body);
|
|
4360
|
+
return q ? C(de, q) : null;
|
|
4361
|
+
};
|
|
4362
|
+
In.displayName = "Dialog";
|
|
4363
|
+
var Ln = {
|
|
4364
|
+
surface: "_surface_1dllk_2",
|
|
4365
|
+
item: "_item_1dllk_9",
|
|
4366
|
+
icon: "_icon_1dllk_27",
|
|
4367
|
+
hint: "_hint_1dllk_36",
|
|
4368
|
+
danger: "_danger_1dllk_45",
|
|
4369
|
+
divider: "_divider_1dllk_48",
|
|
4370
|
+
groupLabel: "_groupLabel_1dllk_54",
|
|
4371
|
+
header: "_header_1dllk_65",
|
|
4372
|
+
rail: "_rail_1dllk_80",
|
|
4373
|
+
railItem: "_railItem_1dllk_88",
|
|
4374
|
+
railGlyph: "_railGlyph_1dllk_114",
|
|
4375
|
+
railLabel: "_railLabel_1dllk_120",
|
|
4376
|
+
railTip: "_railTip_1dllk_127",
|
|
4377
|
+
back: "_back_1dllk_156",
|
|
4378
|
+
backArrow: "_backArrow_1dllk_178",
|
|
4379
|
+
pane: "_pane_1dllk_183",
|
|
4380
|
+
sheet: "_sheet_1dllk_189",
|
|
4381
|
+
sheetMenu: "_sheetMenu_1dllk_204"
|
|
4382
|
+
}, Rn = (e) => e.map((e, t) => ({
|
|
4383
|
+
it: e,
|
|
4384
|
+
i: t
|
|
4385
|
+
})).filter(({ it: e }) => !e.disabled), zn = ({ trigger: e, open: t, anchor: n, onClose: r, header: i, icons: a, panes: o, present: c = "popover", items: l, onSelect: d, placement: p = "bottom-start", matchTriggerWidth: m = !1, size: h = "small", closeOnSelect: S = !0, "aria-label": C, className: w = "" }) => {
|
|
4386
|
+
let T = e === void 0, [E, D] = v(!1), O = T ? !!t : E, [k, A] = v(-1), [j, M] = v(null), N = _(null), P = _([]), F = g(() => Rn(l), [l]), I = j ? o?.find((e) => e.id === j) : void 0, L = u(() => {
|
|
4387
|
+
D(!1), A(-1), M(null), r?.();
|
|
4388
|
+
}, [r]), R = u((e) => {
|
|
4389
|
+
if (!e.disabled) {
|
|
4390
|
+
if (e.pane) {
|
|
4391
|
+
M(e.pane), A(-1);
|
|
4392
|
+
return;
|
|
4393
|
+
}
|
|
4394
|
+
d?.(e.value, e), S && L();
|
|
4395
|
+
}
|
|
4396
|
+
}, [
|
|
4397
|
+
d,
|
|
4398
|
+
S,
|
|
4399
|
+
L
|
|
4400
|
+
]), ee = u((e) => {
|
|
4401
|
+
D(!0), A(e && F.length ? F[0].i : -1);
|
|
4402
|
+
}, [F]);
|
|
4403
|
+
f(() => {
|
|
4404
|
+
O && k >= 0 && P.current[k]?.focus();
|
|
4405
|
+
}, [O, k]);
|
|
4406
|
+
let z = u((e) => {
|
|
4407
|
+
if (!F.length) return;
|
|
4408
|
+
let t = F.findIndex((e) => e.i === k), n = t === -1 ? e === 1 ? 0 : F.length - 1 : (t + e + F.length) % F.length;
|
|
4409
|
+
A(F[n].i);
|
|
4410
|
+
}, [F, k]), B = (e) => {
|
|
4411
|
+
switch (e.key) {
|
|
4412
|
+
case "ArrowDown":
|
|
4413
|
+
e.preventDefault(), z(1);
|
|
4414
|
+
break;
|
|
4415
|
+
case "ArrowUp":
|
|
4416
|
+
e.preventDefault(), z(-1);
|
|
4417
|
+
break;
|
|
4418
|
+
case "Home":
|
|
4419
|
+
e.preventDefault(), F.length && A(F[0].i);
|
|
4420
|
+
break;
|
|
4421
|
+
case "End":
|
|
4422
|
+
e.preventDefault(), F.length && A(F[F.length - 1].i);
|
|
4423
|
+
break;
|
|
4424
|
+
case "Tab":
|
|
4425
|
+
L();
|
|
4426
|
+
break;
|
|
4427
|
+
default: break;
|
|
4428
|
+
}
|
|
4429
|
+
}, V = T ? null : s.cloneElement(e, {
|
|
4430
|
+
ref: (t) => {
|
|
4431
|
+
N.current = t;
|
|
4432
|
+
let n = e.ref;
|
|
4433
|
+
typeof n == "function" ? n(t) : n && typeof n == "object" && (n.current = t);
|
|
4434
|
+
},
|
|
4435
|
+
onClick: (t) => {
|
|
4436
|
+
e.props.onClick?.(t), !t.defaultPrevented && (O ? L() : ee(!1));
|
|
4437
|
+
},
|
|
4438
|
+
onKeyDown: (t) => {
|
|
4439
|
+
e.props.onKeyDown?.(t), !t.defaultPrevented && (t.key === "ArrowDown" || t.key === "Enter" || t.key === " ") && (t.preventDefault(), ee(!0));
|
|
4440
|
+
},
|
|
4441
|
+
"aria-haspopup": "menu",
|
|
4442
|
+
"aria-expanded": O
|
|
4443
|
+
}), H = /* @__PURE__ */ x(y, { children: [i !== void 0 && I === void 0 && /* @__PURE__ */ b("div", {
|
|
4444
|
+
className: Ln.header,
|
|
4445
|
+
"data-part": "header",
|
|
4446
|
+
children: i
|
|
4447
|
+
}), I === void 0 ? /* @__PURE__ */ x(y, { children: [a && a.length > 0 && /* @__PURE__ */ b("div", {
|
|
4448
|
+
className: Ln.rail,
|
|
4449
|
+
"data-part": "rail",
|
|
4450
|
+
role: "group",
|
|
4451
|
+
"aria-label": C,
|
|
4452
|
+
children: a.map((e) => /* @__PURE__ */ x("button", {
|
|
4453
|
+
type: "button",
|
|
4454
|
+
role: "menuitem",
|
|
4455
|
+
className: Ln.railItem,
|
|
4456
|
+
disabled: e.disabled,
|
|
4457
|
+
"aria-label": e.shortcut ? `${e.label} (${e.shortcut})` : e.label,
|
|
4458
|
+
onClick: () => {
|
|
4459
|
+
if (!e.disabled) {
|
|
4460
|
+
if (e.pane) {
|
|
4461
|
+
M(e.pane), A(-1);
|
|
4462
|
+
return;
|
|
4463
|
+
}
|
|
4464
|
+
d?.(e.value, e), S && L();
|
|
4465
|
+
}
|
|
4466
|
+
},
|
|
4467
|
+
children: [/* @__PURE__ */ b("span", {
|
|
4468
|
+
className: Ln.railGlyph,
|
|
4469
|
+
"aria-hidden": !0,
|
|
4470
|
+
children: e.icon
|
|
4471
|
+
}), c === "sheet" ? e.shortLabel ? /* @__PURE__ */ b("span", {
|
|
4472
|
+
className: Ln.railLabel,
|
|
4473
|
+
children: e.shortLabel
|
|
4474
|
+
}) : null : /* @__PURE__ */ x("span", {
|
|
4475
|
+
className: Ln.railTip,
|
|
4476
|
+
role: "tooltip",
|
|
4477
|
+
children: [e.label, e.shortcut ? /* @__PURE__ */ b("kbd", { children: e.shortcut }) : null]
|
|
4478
|
+
})]
|
|
4479
|
+
}, e.value))
|
|
4480
|
+
}), /* @__PURE__ */ b("div", {
|
|
4481
|
+
className: cn.list,
|
|
4482
|
+
"data-part": "list",
|
|
4483
|
+
onKeyDown: B,
|
|
4484
|
+
role: "none",
|
|
4485
|
+
children: l.map((e, t) => /* @__PURE__ */ x(s.Fragment, { children: [
|
|
4486
|
+
e.divider && /* @__PURE__ */ b("div", {
|
|
4487
|
+
className: Ln.divider,
|
|
4488
|
+
role: "separator"
|
|
4489
|
+
}),
|
|
4490
|
+
e.groupLabel && /* @__PURE__ */ b("div", {
|
|
4491
|
+
className: Ln.groupLabel,
|
|
4492
|
+
children: e.groupLabel
|
|
4493
|
+
}),
|
|
4494
|
+
/* @__PURE__ */ x("button", {
|
|
4495
|
+
ref: (e) => {
|
|
4496
|
+
P.current[t] = e;
|
|
4497
|
+
},
|
|
4498
|
+
type: "button",
|
|
4499
|
+
role: "menuitem",
|
|
4500
|
+
disabled: e.disabled,
|
|
4501
|
+
tabIndex: k === t ? 0 : -1,
|
|
4502
|
+
className: [
|
|
4503
|
+
cn.row,
|
|
4504
|
+
Ln.item,
|
|
4505
|
+
e.disabled ? cn.rowDisabled : "",
|
|
4506
|
+
e.danger ? Ln.danger : "",
|
|
4507
|
+
k === t ? cn.rowCursor : ""
|
|
4508
|
+
].filter(Boolean).join(" "),
|
|
4509
|
+
onClick: () => R(e),
|
|
4510
|
+
onMouseEnter: () => !e.disabled && A(t),
|
|
4511
|
+
children: [
|
|
4512
|
+
e.icon && /* @__PURE__ */ b("span", {
|
|
4513
|
+
className: Ln.icon,
|
|
4514
|
+
children: e.icon
|
|
4515
|
+
}),
|
|
4516
|
+
/* @__PURE__ */ x("span", {
|
|
4517
|
+
className: cn.rowContent,
|
|
4518
|
+
children: [/* @__PURE__ */ b("span", {
|
|
4519
|
+
className: cn.linePrimary,
|
|
4520
|
+
children: e.label
|
|
4521
|
+
}), e.description && /* @__PURE__ */ b("span", {
|
|
4522
|
+
className: cn.lineSecondary,
|
|
4523
|
+
children: e.description
|
|
4524
|
+
})]
|
|
4525
|
+
}),
|
|
4526
|
+
e.hint && /* @__PURE__ */ b("span", {
|
|
4527
|
+
className: Ln.hint,
|
|
4528
|
+
children: e.hint
|
|
4529
|
+
})
|
|
4530
|
+
]
|
|
4531
|
+
})
|
|
4532
|
+
] }, e.value))
|
|
4533
|
+
})] }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("button", {
|
|
4534
|
+
type: "button",
|
|
4535
|
+
className: Ln.back,
|
|
4536
|
+
"data-part": "back",
|
|
4537
|
+
onClick: () => {
|
|
4538
|
+
M(null), A(-1);
|
|
4539
|
+
},
|
|
4540
|
+
children: [/* @__PURE__ */ b("span", {
|
|
4541
|
+
className: Ln.backArrow,
|
|
4542
|
+
"aria-hidden": !0,
|
|
4543
|
+
children: "‹"
|
|
4544
|
+
}), I.title]
|
|
4545
|
+
}), /* @__PURE__ */ b("div", {
|
|
4546
|
+
className: Ln.pane,
|
|
4547
|
+
"data-part": "pane",
|
|
4548
|
+
children: I.content
|
|
4549
|
+
})] })] });
|
|
4550
|
+
return /* @__PURE__ */ x(y, { children: [V, c === "sheet" ? /* @__PURE__ */ b(In, {
|
|
4551
|
+
open: O,
|
|
4552
|
+
onClose: L,
|
|
4553
|
+
placement: "bottom",
|
|
4554
|
+
size: "md",
|
|
4555
|
+
"aria-label": C,
|
|
4556
|
+
className: [cn[`size_${h}`], Ln.sheet].filter(Boolean).join(" "),
|
|
4557
|
+
children: /* @__PURE__ */ b("div", {
|
|
4558
|
+
role: "menu",
|
|
4559
|
+
"aria-label": C,
|
|
4560
|
+
className: [Ln.sheetMenu, w].filter(Boolean).join(" "),
|
|
4561
|
+
children: H
|
|
4562
|
+
})
|
|
4563
|
+
}) : /* @__PURE__ */ b(fn, {
|
|
4564
|
+
open: O,
|
|
4565
|
+
anchorEl: T ? n ?? null : N.current,
|
|
4566
|
+
onClose: L,
|
|
4567
|
+
onEscape: I ? () => {
|
|
4568
|
+
M(null), A(-1);
|
|
4569
|
+
} : L,
|
|
4570
|
+
placement: p,
|
|
4571
|
+
matchAnchorWidth: m,
|
|
4572
|
+
padded: !1,
|
|
4573
|
+
role: "menu",
|
|
4574
|
+
"aria-label": C,
|
|
4575
|
+
autoFocus: !1,
|
|
4576
|
+
className: [
|
|
4577
|
+
cn[`size_${h}`],
|
|
4578
|
+
Ln.surface,
|
|
4579
|
+
w
|
|
4580
|
+
].filter(Boolean).join(" "),
|
|
4581
|
+
children: H
|
|
4582
|
+
})] });
|
|
4583
|
+
};
|
|
4584
|
+
zn.displayName = "DropdownMenu";
|
|
4585
|
+
var Bn = {
|
|
4586
|
+
root: "_root_vyeco_3",
|
|
4587
|
+
pill: "_pill_vyeco_16",
|
|
4588
|
+
xs: "_xs_vyeco_19",
|
|
4589
|
+
small: "_small_vyeco_20",
|
|
4590
|
+
medium: "_medium_vyeco_21",
|
|
4591
|
+
tonal: "_tonal_vyeco_24",
|
|
4592
|
+
primary: "_primary_vyeco_24",
|
|
4593
|
+
success: "_success_vyeco_25",
|
|
4594
|
+
warning: "_warning_vyeco_26",
|
|
4595
|
+
error: "_error_vyeco_27",
|
|
4596
|
+
info: "_info_vyeco_28",
|
|
4597
|
+
neutral: "_neutral_vyeco_29",
|
|
4598
|
+
filled: "_filled_vyeco_33",
|
|
4599
|
+
outlined: "_outlined_vyeco_42",
|
|
4600
|
+
dot: "_dot_vyeco_51"
|
|
4601
|
+
}, Vn = ({ children: e, color: t = "neutral", variant: n = "tonal", size: r = "small", pill: i = !1, dot: a = !1, className: o = "", style: s, title: c }) => /* @__PURE__ */ x("span", {
|
|
4602
|
+
className: [
|
|
4603
|
+
Bn.root,
|
|
4604
|
+
Bn[n],
|
|
4605
|
+
Bn[t],
|
|
4606
|
+
Bn[r],
|
|
4607
|
+
i ? Bn.pill : "",
|
|
4608
|
+
o
|
|
4609
|
+
].filter(Boolean).join(" "),
|
|
4610
|
+
style: s,
|
|
4611
|
+
title: c,
|
|
4612
|
+
children: [a && /* @__PURE__ */ b("span", {
|
|
4613
|
+
className: Bn.dot,
|
|
4614
|
+
"aria-hidden": "true"
|
|
4615
|
+
}), e]
|
|
4616
|
+
});
|
|
4617
|
+
Vn.displayName = "Badge";
|
|
4618
|
+
var Hn = c({
|
|
4619
|
+
authorize: () => !0,
|
|
4620
|
+
exportOptions: {},
|
|
4621
|
+
serverMode: !1,
|
|
4622
|
+
labels: a,
|
|
4623
|
+
format: o()
|
|
4624
|
+
});
|
|
4625
|
+
function Un() {
|
|
4626
|
+
return d(Hn);
|
|
4627
|
+
}
|
|
4628
|
+
function Wn() {
|
|
4629
|
+
return d(Hn).labels;
|
|
4630
|
+
}
|
|
4631
|
+
function Gn(e, t, n) {
|
|
4632
|
+
return !e || e(t, n) !== !1;
|
|
4633
|
+
}
|
|
4634
|
+
//#endregion
|
|
4635
|
+
//#region ../../shared-web-ui/src/DataTable/ui-local/ReactModal.tsx
|
|
4636
|
+
function Kn({ isopen: e = !1, onClose: t, showCloseIcon: r, closeOnOverlayClick: i, closeOnEsc: a, modelstyleclass: o = "customModal", modelclass: s = "", size: c, bodyPadding: l = !0, header: d, subheader: f, footer: p, children: m, "aria-label": h }) {
|
|
4637
|
+
let g = Wn(), v = _(null), S = n(), T = u(() => t?.(), [t]), { layerProps: E } = sn({
|
|
4638
|
+
ref: v,
|
|
4639
|
+
open: !!e,
|
|
4640
|
+
onClose: T,
|
|
4641
|
+
closeOnEscape: a !== !1,
|
|
4642
|
+
closeOnOutside: !1,
|
|
4643
|
+
lockScroll: !0,
|
|
4644
|
+
autoFocus: "input:not([type=hidden]):not([disabled]), select, textarea, button:not(.customModal3__close):not([disabled]), [tabindex]:not([tabindex=\"-1\"])"
|
|
4645
|
+
});
|
|
4646
|
+
if (!e || !S) return null;
|
|
4647
|
+
let D = o === "customModal3", O = c && D ? ` customModal3--${c}` : "";
|
|
4648
|
+
return C(/* @__PURE__ */ b("div", {
|
|
4649
|
+
className: "dt-modal-overlay",
|
|
4650
|
+
onMouseDown: (e) => {
|
|
4651
|
+
e.target === e.currentTarget && i && T();
|
|
4652
|
+
},
|
|
4653
|
+
children: /* @__PURE__ */ b("div", {
|
|
4654
|
+
ref: v,
|
|
4655
|
+
...E,
|
|
4656
|
+
role: "dialog",
|
|
4657
|
+
"aria-modal": "true",
|
|
4658
|
+
"aria-label": h ?? (typeof d == "string" ? d : void 0),
|
|
4659
|
+
tabIndex: -1,
|
|
4660
|
+
className: `dt-modal ${o} ${s}${O}`,
|
|
4661
|
+
children: D ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("button", {
|
|
4662
|
+
type: "button",
|
|
4663
|
+
className: "customModal3__close",
|
|
4664
|
+
onClick: T,
|
|
4665
|
+
"aria-label": g.close,
|
|
4666
|
+
children: /* @__PURE__ */ b(w, {})
|
|
4667
|
+
}), /* @__PURE__ */ x("div", {
|
|
4668
|
+
className: "customModal3__scroll",
|
|
4669
|
+
children: [
|
|
4670
|
+
d && /* @__PURE__ */ x("div", {
|
|
4671
|
+
className: "customModal3__header customModal3__header--sticky",
|
|
4672
|
+
children: [/* @__PURE__ */ b("div", {
|
|
4673
|
+
className: "customModal3__header-content",
|
|
4674
|
+
children: d
|
|
4675
|
+
}), f && /* @__PURE__ */ b("div", {
|
|
4676
|
+
className: "customModal3__subheader",
|
|
4677
|
+
children: f
|
|
4678
|
+
})]
|
|
4679
|
+
}),
|
|
4680
|
+
/* @__PURE__ */ b("div", {
|
|
4681
|
+
className: `customModal3__body${l ? "" : " customModal3__body--flush"}`,
|
|
4682
|
+
children: m
|
|
4683
|
+
}),
|
|
4684
|
+
p && /* @__PURE__ */ b("div", {
|
|
4685
|
+
className: "customModal3__footer customModal3__footer--sticky",
|
|
4686
|
+
children: p
|
|
4687
|
+
})
|
|
4688
|
+
]
|
|
4689
|
+
})] }) : /* @__PURE__ */ x(y, { children: [r && o !== "customModal2" && /* @__PURE__ */ b("button", {
|
|
4690
|
+
type: "button",
|
|
4691
|
+
className: "dt-modal-close",
|
|
4692
|
+
onClick: T,
|
|
4693
|
+
"aria-label": g.close,
|
|
4694
|
+
children: /* @__PURE__ */ b(w, {})
|
|
4695
|
+
}), m] })
|
|
4696
|
+
})
|
|
4697
|
+
}), S);
|
|
4698
|
+
}
|
|
4699
|
+
//#endregion
|
|
4700
|
+
//#region ../../shared-web-ui/src/DataTable/layout/scrollArea.ts
|
|
4701
|
+
var qn = "dt-scroll-area scroll-fade-y scroll-gutter", Jn = "dt-scroll-area scroll-fade-x scroll-fade-y scroll-gutter";
|
|
4702
|
+
//#endregion
|
|
4703
|
+
//#region ../../shared-web-ui/src/DataTable/ui-local/DragAndDropList/DragAndDropList.tsx
|
|
4704
|
+
function Yn({ state: e = [], setState: t, renderKeys: n, onReorder: r, renderItem: i, getItemKey: a, className: o = "", showDragHandle: s = !0, isItemDraggable: c = () => !0, dragHandleProps: l = {}, emptyMessage: d, showManualButtons: p = !1, showSerialNumber: m = !0, maxHeight: h = "80vh", enableScrolling: g = !0 }) {
|
|
4705
|
+
let y = Wn(), [S, C] = v(null), [w, E] = v(null), [D, O] = v(!1), k = _(0), A = _(null), [j, M] = v(null), [N, P] = v(null), [F, I] = v(null), [L, R] = v(!1), [ee, z] = v(null), B = _(null), V = _(null), H = u(() => {
|
|
4706
|
+
if (!e.length) return ["name"];
|
|
4707
|
+
let t = e[0];
|
|
4708
|
+
if (typeof t == "string" || typeof t == "number") return null;
|
|
4709
|
+
if (typeof t == "object" && t) {
|
|
4710
|
+
for (let e of [
|
|
4711
|
+
"name",
|
|
4712
|
+
"title",
|
|
4713
|
+
"label",
|
|
4714
|
+
"text"
|
|
4715
|
+
]) if (t.hasOwnProperty(e)) return [e];
|
|
4716
|
+
let e = Object.keys(t);
|
|
4717
|
+
return e.length > 0 ? [e[0]] : ["name"];
|
|
4718
|
+
}
|
|
4719
|
+
return ["name"];
|
|
4720
|
+
}, [e]), te = n ? Array.isArray(n) ? n : [n] : H(), U = u((e) => {
|
|
4721
|
+
if (!g || !A.current || !D) return;
|
|
4722
|
+
V.current && cancelAnimationFrame(V.current);
|
|
4723
|
+
let t = A.current, n = () => {
|
|
4724
|
+
if (!D) {
|
|
4725
|
+
W();
|
|
4726
|
+
return;
|
|
4727
|
+
}
|
|
4728
|
+
if (e === "up") {
|
|
4729
|
+
let e = Math.max(0, t.scrollTop - 3);
|
|
4730
|
+
if (t.scrollTop = e, e === 0) {
|
|
4731
|
+
W();
|
|
4732
|
+
return;
|
|
4733
|
+
}
|
|
4734
|
+
} else if (e === "down") {
|
|
4735
|
+
let e = t.scrollHeight - t.clientHeight, n = Math.min(e, t.scrollTop + 3);
|
|
4736
|
+
if (t.scrollTop = n, n === e) {
|
|
4737
|
+
W();
|
|
4738
|
+
return;
|
|
4739
|
+
}
|
|
4740
|
+
}
|
|
4741
|
+
V.current = requestAnimationFrame(n);
|
|
4742
|
+
};
|
|
4743
|
+
V.current = requestAnimationFrame(n);
|
|
4744
|
+
}, [g, D]), W = u(() => {
|
|
4745
|
+
V.current &&= (cancelAnimationFrame(V.current), null);
|
|
4746
|
+
}, []), G = u((e) => {
|
|
4747
|
+
if (!g || !A.current || !D) return;
|
|
4748
|
+
let t = A.current, n = t.getBoundingClientRect();
|
|
4749
|
+
e < n.top + 40 && t.scrollTop > 0 ? U("up") : e > n.bottom - 40 && t.scrollTop < t.scrollHeight - t.clientHeight ? U("down") : W();
|
|
4750
|
+
}, [
|
|
4751
|
+
g,
|
|
4752
|
+
U,
|
|
4753
|
+
W,
|
|
4754
|
+
D
|
|
4755
|
+
]), ne = u((n, i) => {
|
|
4756
|
+
if (n === i || n < 0 || i < 0 || n >= e.length || i >= e.length) return;
|
|
4757
|
+
let a = [...e], [o] = a.splice(n, 1);
|
|
4758
|
+
a.splice(i, 0, o), t && t?.(a), r && r(a);
|
|
4759
|
+
}, [
|
|
4760
|
+
e,
|
|
4761
|
+
t,
|
|
4762
|
+
r
|
|
4763
|
+
]), re = u((t, n) => {
|
|
4764
|
+
if (!c(e[n], n)) {
|
|
4765
|
+
t.preventDefault();
|
|
4766
|
+
return;
|
|
4767
|
+
}
|
|
4768
|
+
C(n), O(!0), k.current = 0, t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", ""));
|
|
4769
|
+
}, [e, c]), K = u(() => {
|
|
4770
|
+
C(null), E(null), O(!1), k.current = 0, W();
|
|
4771
|
+
}, [W]), ie = u((e) => {
|
|
4772
|
+
e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), G(e.clientY);
|
|
4773
|
+
}, [G]), ae = u((e, t) => {
|
|
4774
|
+
e.preventDefault(), k.current++, E(t);
|
|
4775
|
+
}, []), oe = u((e) => {
|
|
4776
|
+
k.current--, k.current === 0 && E(null);
|
|
4777
|
+
}, []), se = u((e, t) => {
|
|
4778
|
+
e.preventDefault(), S !== null && t !== S && ne(S, t), K();
|
|
4779
|
+
}, [
|
|
4780
|
+
S,
|
|
4781
|
+
ne,
|
|
4782
|
+
K
|
|
4783
|
+
]);
|
|
4784
|
+
u((t, n) => {
|
|
4785
|
+
if (!c(e[n], n)) return;
|
|
4786
|
+
let r = t.touches[0];
|
|
4787
|
+
M(r.clientY), I(r.clientX), P(r.clientY), z(Date.now()), R(!1), B.current && clearTimeout(B.current), B.current = setTimeout(() => {
|
|
4788
|
+
R(!0), C(n), O(!0);
|
|
4789
|
+
}, 200);
|
|
4790
|
+
}, [e, c]), u((e) => {
|
|
4791
|
+
if (j === null || F === null || ee === null) return;
|
|
4792
|
+
let t = e.touches[0], n = Math.abs(t.clientY - j), r = Math.abs(t.clientX - F);
|
|
4793
|
+
if (!L && n > r && n > 10) {
|
|
4794
|
+
B.current &&= (clearTimeout(B.current), null), M(null), I(null), z(null);
|
|
4795
|
+
return;
|
|
4796
|
+
}
|
|
4797
|
+
if (L && S !== null) {
|
|
4798
|
+
e.preventDefault(), P(t.clientY), G(t.clientY);
|
|
4799
|
+
let n = document.elementFromPoint(t.clientX, t.clientY)?.closest("[data-drag-index]");
|
|
4800
|
+
if (n) {
|
|
4801
|
+
let e = parseInt(n.dataset.dragIndex || "");
|
|
4802
|
+
!isNaN(e) && e !== S && E(e);
|
|
4803
|
+
}
|
|
4804
|
+
}
|
|
4805
|
+
}, [
|
|
4806
|
+
j,
|
|
4807
|
+
F,
|
|
4808
|
+
ee,
|
|
4809
|
+
L,
|
|
4810
|
+
S,
|
|
4811
|
+
G
|
|
4812
|
+
]);
|
|
4813
|
+
let ce = u(() => {
|
|
4814
|
+
B.current &&= (clearTimeout(B.current), null), S !== null && w !== null && S !== w && ne(S, w), C(null), E(null), O(!1), M(null), P(null), I(null), z(null), R(!1), W();
|
|
4815
|
+
}, [
|
|
4816
|
+
S,
|
|
4817
|
+
w,
|
|
4818
|
+
ne,
|
|
4819
|
+
W
|
|
4820
|
+
]);
|
|
4821
|
+
f(() => {
|
|
4822
|
+
let t = A.current;
|
|
4823
|
+
if (!t) return;
|
|
4824
|
+
let n = (t) => {
|
|
4825
|
+
let n = t.target.closest("[data-drag-index]");
|
|
4826
|
+
if (n) {
|
|
4827
|
+
let r = parseInt(n.dataset.dragIndex || "");
|
|
4828
|
+
if (!isNaN(r) && c(e[r], r)) if (t.target.closest(".drag-and-drop-handle")) {
|
|
4829
|
+
t.preventDefault(), R(!0), C(r), O(!0);
|
|
4830
|
+
let e = t.touches[0];
|
|
4831
|
+
M(e.clientY), I(e.clientX), P(e.clientY), z(Date.now());
|
|
4832
|
+
} else {
|
|
4833
|
+
let e = t.touches[0];
|
|
4834
|
+
M(e.clientY), I(e.clientX), P(e.clientY), z(Date.now()), R(!1), B.current && clearTimeout(B.current), B.current = setTimeout(() => {
|
|
4835
|
+
R(!0), C(r), O(!0);
|
|
4836
|
+
}, 200);
|
|
4837
|
+
}
|
|
4838
|
+
}
|
|
4839
|
+
}, r = (e) => {
|
|
4840
|
+
if (j === null || F === null || ee === null) return;
|
|
4841
|
+
let t = e.touches[0], n = Math.abs(t.clientY - j), r = Math.abs(t.clientX - F);
|
|
4842
|
+
if (!L && n > r && n > 10) {
|
|
4843
|
+
B.current &&= (clearTimeout(B.current), null), M(null), I(null), z(null);
|
|
4844
|
+
return;
|
|
4845
|
+
}
|
|
4846
|
+
if (L && S !== null) {
|
|
4847
|
+
e.preventDefault(), P(t.clientY), G(t.clientY);
|
|
4848
|
+
let n = document.elementFromPoint(t.clientX, t.clientY)?.closest("[data-drag-index]");
|
|
4849
|
+
if (n) {
|
|
4850
|
+
let e = parseInt(n.dataset.dragIndex || "");
|
|
4851
|
+
!isNaN(e) && e !== S && E(e);
|
|
4852
|
+
}
|
|
4853
|
+
}
|
|
4854
|
+
};
|
|
4855
|
+
return t.addEventListener("touchstart", n, { passive: !1 }), t.addEventListener("touchmove", r, { passive: !1 }), () => {
|
|
4856
|
+
t.removeEventListener("touchstart", n), t.removeEventListener("touchmove", r);
|
|
4857
|
+
};
|
|
4858
|
+
}, [
|
|
4859
|
+
L,
|
|
4860
|
+
S,
|
|
4861
|
+
j,
|
|
4862
|
+
F,
|
|
4863
|
+
ee,
|
|
4864
|
+
G,
|
|
4865
|
+
e,
|
|
4866
|
+
c
|
|
4867
|
+
]), f(() => {
|
|
4868
|
+
D || W();
|
|
4869
|
+
}, [D, W]), f(() => () => {
|
|
4870
|
+
W(), B.current && clearTimeout(B.current);
|
|
4871
|
+
}, [W]);
|
|
4872
|
+
let le = u((e, t) => s ? /* @__PURE__ */ b("span", {
|
|
4873
|
+
className: "drag-and-drop-handle",
|
|
4874
|
+
...l,
|
|
4875
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
4876
|
+
style: {
|
|
4877
|
+
touchAction: "none",
|
|
4878
|
+
userSelect: "none",
|
|
4879
|
+
...l.style
|
|
4880
|
+
},
|
|
4881
|
+
children: /* @__PURE__ */ b(T, {})
|
|
4882
|
+
}) : null, [s, l]), ue = u((e) => typeof e == "string" || typeof e == "number" ? e.toString() : typeof e == "object" && e && te ? te.map((t) => e[t]).filter(Boolean).join(" - ") : JSON.stringify(e), [te]), de = u((t, n, r, i, a) => /* @__PURE__ */ x("div", {
|
|
4883
|
+
className: "drag-and-drop-default-item",
|
|
4884
|
+
children: [
|
|
4885
|
+
m && /* @__PURE__ */ x("span", {
|
|
4886
|
+
className: "drag-and-drop-serial-number",
|
|
4887
|
+
children: [n + 1, "."]
|
|
4888
|
+
}),
|
|
4889
|
+
a,
|
|
4890
|
+
/* @__PURE__ */ b("span", {
|
|
4891
|
+
className: "drag-and-drop-item-content",
|
|
4892
|
+
children: ue(t)
|
|
4893
|
+
}),
|
|
4894
|
+
p && /* @__PURE__ */ x("div", {
|
|
4895
|
+
className: "drag-and-drop-manual-buttons",
|
|
4896
|
+
children: [/* @__PURE__ */ b("button", {
|
|
4897
|
+
className: "drag-and-drop-btn up",
|
|
4898
|
+
onClick: () => ne(n, n - 1),
|
|
4899
|
+
disabled: n === 0,
|
|
4900
|
+
title: y.moveUp,
|
|
4901
|
+
"aria-label": y.moveUp,
|
|
4902
|
+
children: "↑"
|
|
4903
|
+
}), /* @__PURE__ */ b("button", {
|
|
4904
|
+
className: "drag-and-drop-btn down",
|
|
4905
|
+
onClick: () => ne(n, n + 1),
|
|
4906
|
+
disabled: n === e.length - 1,
|
|
4907
|
+
title: y.moveDown,
|
|
4908
|
+
"aria-label": y.moveDown,
|
|
4909
|
+
children: "↓"
|
|
4910
|
+
})]
|
|
4911
|
+
})
|
|
4912
|
+
]
|
|
4913
|
+
}), [
|
|
4914
|
+
ue,
|
|
4915
|
+
p,
|
|
4916
|
+
ne,
|
|
4917
|
+
e.length,
|
|
4918
|
+
m
|
|
4919
|
+
]);
|
|
4920
|
+
if (!e.length) return /* @__PURE__ */ b("div", {
|
|
4921
|
+
className: `drag-and-drop-list empty ${o}`,
|
|
4922
|
+
style: { maxHeight: g ? h : "auto" },
|
|
4923
|
+
children: /* @__PURE__ */ b("div", {
|
|
4924
|
+
className: "drag-and-drop-empty-message",
|
|
4925
|
+
children: d ?? y.listEmpty
|
|
4926
|
+
})
|
|
4927
|
+
});
|
|
4928
|
+
let q = g ? {
|
|
4929
|
+
maxHeight: h,
|
|
4930
|
+
overflowY: "auto",
|
|
4931
|
+
overflowX: "hidden"
|
|
4932
|
+
} : {};
|
|
4933
|
+
return /* @__PURE__ */ b("div", {
|
|
4934
|
+
className: `drag-and-drop-list${g ? ` ${qn}` : ""} ${o}`,
|
|
4935
|
+
ref: A,
|
|
4936
|
+
style: q,
|
|
4937
|
+
children: e.map((e, t) => {
|
|
4938
|
+
let n = a ? a(e, t) : t, r = S === t, o = w === t, s = c(e, t);
|
|
4939
|
+
return /* @__PURE__ */ b("div", {
|
|
4940
|
+
className: `drag-and-drop-item ${r ? "dragging" : ""} ${o ? "drag-over" : ""} ${s ? "" : "not-draggable"}`,
|
|
4941
|
+
"data-drag-index": t,
|
|
4942
|
+
draggable: s,
|
|
4943
|
+
onDragStart: (e) => re(e, t),
|
|
4944
|
+
onDragEnd: K,
|
|
4945
|
+
onDragOver: ie,
|
|
4946
|
+
onDragEnter: (e) => ae(e, t),
|
|
4947
|
+
onDragLeave: oe,
|
|
4948
|
+
onDrop: (e) => se(e, t),
|
|
4949
|
+
onTouchEnd: ce,
|
|
4950
|
+
children: i ? i(e, t, r, o, le(e, t), ne) : de(e, t, r, o, le(e, t))
|
|
4951
|
+
}, n);
|
|
4952
|
+
})
|
|
4953
|
+
});
|
|
4954
|
+
}
|
|
4955
|
+
//#endregion
|
|
4956
|
+
//#region ../../shared-web-ui/src/DataTable/ui-local/DateRangePicker.tsx
|
|
4957
|
+
function Xn({ range: e = !0, state: t, setState: n, fromLabel: r, toLabel: i }) {
|
|
4958
|
+
let a = Wn(), o = {
|
|
4959
|
+
size: "small",
|
|
4960
|
+
variant: "outlined",
|
|
4961
|
+
withTime: !!t.withtime,
|
|
4962
|
+
timeToggle: !0,
|
|
4963
|
+
applyLabel: ""
|
|
4964
|
+
};
|
|
4965
|
+
return /* @__PURE__ */ x("div", {
|
|
4966
|
+
className: "dt-daterange",
|
|
4967
|
+
children: [e ? /* @__PURE__ */ b(Tn, {
|
|
4968
|
+
...o,
|
|
4969
|
+
range: !0,
|
|
4970
|
+
value: {
|
|
4971
|
+
from: t.from,
|
|
4972
|
+
to: t.to
|
|
4973
|
+
},
|
|
4974
|
+
"aria-label": r ?? a.dateFrom,
|
|
4975
|
+
onChange: (e) => n({
|
|
4976
|
+
...t,
|
|
4977
|
+
from: e.target.value.from,
|
|
4978
|
+
to: e.target.value.to
|
|
4979
|
+
})
|
|
4980
|
+
}) : /* @__PURE__ */ b(Tn, {
|
|
4981
|
+
...o,
|
|
4982
|
+
value: t.from,
|
|
4983
|
+
"aria-label": a.date,
|
|
4984
|
+
onChange: (e) => n({
|
|
4985
|
+
...t,
|
|
4986
|
+
from: e.target.value,
|
|
4987
|
+
to: ""
|
|
4988
|
+
})
|
|
4989
|
+
}), /* @__PURE__ */ b("span", {
|
|
4990
|
+
className: "dt-daterange-sep",
|
|
4991
|
+
hidden: !0,
|
|
4992
|
+
children: i ?? a.dateTo
|
|
4993
|
+
})]
|
|
4994
|
+
});
|
|
4995
|
+
}
|
|
4996
|
+
//#endregion
|
|
4997
|
+
export { It as A, Ye as B, Qt as C, Bt as D, Ht as E, St as F, Pe as H, bt as I, yt as L, Dt as M, Ct as N, zt as O, xt as P, _t as R, sn as S, Ut as T, Fe as U, Re as V, _n as _, Kn as a, un as b, Wn as c, zn as d, In as f, gn as g, Tn as h, qn as i, kt as j, Lt as k, Un as l, Dn as m, Yn as n, Hn as o, On as p, Jn as r, Gn as s, Xn as t, Vn as u, pn as v, Xt as w, cn as x, fn as y, vt as z };
|