niuma-ui 2.0.3 → 2.0.9
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/CHANGELOG.md +96 -0
- package/dist/components/_shared/index.d.ts +2 -2
- package/dist/components/_shared/src/overlay-utils.d.ts +44 -1
- package/dist/components/_shared/src/overlay-utils.js +87 -2
- package/dist/components/_shared/src/reka.d.ts +1 -1
- package/dist/components/_shared/src/reka.js +2 -2
- package/dist/components/alert/index.d.ts +1 -0
- package/dist/components/alert/src/RsAlert.css +120 -65
- package/dist/components/alert/src/RsAlert.d.ts +24 -5
- package/dist/components/alert/src/RsAlert.impl.js +108 -36
- package/dist/components/alert/src/RsAlert.js +1 -1
- package/dist/components/alert/src/alert-utils.d.ts +37 -0
- package/dist/components/alert/src/alert-utils.js +71 -0
- package/dist/components/anchor/index.d.ts +1 -1
- package/dist/components/anchor/src/RsAnchor.css +63 -32
- package/dist/components/anchor/src/RsAnchor.d.ts +29 -2
- package/dist/components/anchor/src/RsAnchor.impl.js +199 -81
- package/dist/components/anchor/src/RsAnchor.js +1 -1
- package/dist/components/anchor/src/anchor-utils.d.ts +36 -4
- package/dist/components/anchor/src/anchor-utils.js +81 -19
- package/dist/components/auto-complete/index.d.ts +2 -0
- package/dist/components/auto-complete/src/RsAutoComplete.css +122 -0
- package/dist/components/auto-complete/src/RsAutoComplete.d.ts +47 -7
- package/dist/components/auto-complete/src/RsAutoComplete.impl.js +180 -72
- package/dist/components/auto-complete/src/RsAutoComplete.js +4 -1
- package/dist/components/auto-complete/src/auto-complete-utils.d.ts +7 -0
- package/dist/components/auto-complete/src/auto-complete-utils.js +17 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/avatar/src/RsAvatar.css +36 -19
- package/dist/components/avatar/src/RsAvatar.d.ts +9 -3
- package/dist/components/avatar/src/RsAvatar.impl.js +57 -33
- package/dist/components/avatar/src/RsAvatar.js +2 -1
- package/dist/components/avatar/src/avatar-utils.d.ts +16 -7
- package/dist/components/avatar/src/avatar-utils.js +41 -3
- package/dist/components/breadcrumb/index.d.ts +1 -1
- package/dist/components/breadcrumb/src/RsBreadcrumb.css +50 -17
- package/dist/components/breadcrumb/src/RsBreadcrumb.d.ts +45 -6
- package/dist/components/breadcrumb/src/RsBreadcrumb.impl.js +111 -12
- package/dist/components/breadcrumb/src/RsBreadcrumb.js +2 -1
- package/dist/components/breadcrumb/src/breadcrumb-utils.d.ts +37 -5
- package/dist/components/breadcrumb/src/breadcrumb-utils.js +70 -9
- package/dist/components/button/src/RsButton.impl.js +1 -1
- package/dist/components/calendar-grid/index.d.ts +2 -0
- package/dist/components/calendar-grid/src/RsCalendarGrid.css +105 -45
- package/dist/components/calendar-grid/src/RsCalendarGrid.d.ts +62 -2
- package/dist/components/calendar-grid/src/RsCalendarGrid.impl.js +265 -94
- package/dist/components/calendar-grid/src/RsCalendarGrid.js +1 -1
- package/dist/components/calendar-grid/src/calendar-grid-utils.d.ts +72 -0
- package/dist/components/calendar-grid/src/calendar-grid-utils.js +122 -0
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/src/RsCard.css +108 -98
- package/dist/components/card/src/RsCard.d.ts +4 -13
- package/dist/components/card/src/RsCard.impl.js +29 -25
- package/dist/components/card/src/RsCard.js +2 -1
- package/dist/components/card/src/card-utils.d.ts +25 -0
- package/dist/components/card/src/card-utils.js +10 -0
- package/dist/components/cascader/index.d.ts +1 -0
- package/dist/components/cascader/src/RsCascader.css +175 -30
- package/dist/components/cascader/src/RsCascader.d.ts +15 -3
- package/dist/components/cascader/src/RsCascader.impl.js +277 -48
- package/dist/components/cascader/src/RsCascader.js +1 -1
- package/dist/components/cascader/src/cascader-utils.d.ts +2 -0
- package/dist/components/cascader/src/cascader-utils.js +8 -1
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/src/RsCheckbox.css +46 -23
- package/dist/components/checkbox/src/RsCheckbox.d.ts +11 -1
- package/dist/components/checkbox/src/RsCheckbox.impl.js +37 -9
- package/dist/components/checkbox/src/RsCheckbox.js +2 -1
- package/dist/components/checkbox/src/checkbox-utils.d.ts +4 -0
- package/dist/components/checkbox/src/checkbox-utils.js +12 -0
- package/dist/components/code-block/index.d.ts +1 -0
- package/dist/components/code-block/src/RsCodeBlock.css +93 -52
- package/dist/components/code-block/src/RsCodeBlock.d.ts +36 -9
- package/dist/components/code-block/src/RsCodeBlock.impl.js +203 -84
- package/dist/components/code-block/src/RsCodeBlock.js +1 -1
- package/dist/components/code-block/src/code-block-highlight.d.ts +4 -0
- package/dist/components/code-block/src/code-block-highlight.js +34 -0
- package/dist/components/code-block/src/code-block-utils.d.ts +23 -0
- package/dist/components/code-block/src/code-block-utils.js +71 -0
- package/dist/components/code-editor/index.d.ts +1 -1
- package/dist/components/code-editor/src/RsCodeEditor.css +118 -92
- package/dist/components/code-editor/src/RsCodeEditor.d.ts +14 -3
- package/dist/components/code-editor/src/RsCodeEditor.impl.js +261 -94
- package/dist/components/code-editor/src/RsCodeEditor.js +1 -1
- package/dist/components/code-editor/src/code-editor-utils.d.ts +15 -0
- package/dist/components/code-editor/src/code-editor-utils.js +36 -1
- package/dist/components/code-editor/src/code-mirror-completion.d.ts +1 -1
- package/dist/components/code-editor/src/code-mirror-completion.js +8 -5
- package/dist/components/code-editor/src/code-mirror-diagnostics.d.ts +2 -3
- package/dist/components/code-editor/src/code-mirror-diagnostics.js +3 -4
- package/dist/components/code-editor/src/code-mirror-ghost.d.ts +1 -1
- package/dist/components/code-editor/src/code-mirror-ghost.js +12 -3
- package/dist/components/code-editor/src/code-mirror-inline-edit.js +8 -3
- package/dist/components/code-editor/src/code-mirror-intel.d.ts +2 -2
- package/dist/components/code-editor/src/code-mirror-intel.js +50 -39
- package/dist/components/code-editor/src/code-mirror-lang.js +4 -0
- package/dist/components/code-editor/src/code-mirror-session.d.ts +13 -0
- package/dist/components/code-editor/src/code-mirror-session.js +30 -0
- package/dist/components/container/index.d.ts +1 -1
- package/dist/components/container/src/RsContainer.css +11 -11
- package/dist/components/container/src/RsContainer.d.ts +2 -12
- package/dist/components/container/src/RsContainer.impl.js +10 -57
- package/dist/components/container/src/RsContainer.js +1 -1
- package/dist/components/container/src/container-utils.d.ts +23 -0
- package/dist/components/container/src/container-utils.js +51 -0
- package/dist/components/context-menu/index.d.ts +1 -1
- package/dist/components/context-menu/src/RsContextMenu.css +115 -89
- package/dist/components/context-menu/src/RsContextMenu.d.ts +32 -11
- package/dist/components/context-menu/src/RsContextMenu.impl.js +795 -48
- package/dist/components/context-menu/src/RsContextMenuItems.d.ts +25 -1
- package/dist/components/context-menu/src/RsContextMenuItems.impl.js +110 -61
- package/dist/components/context-menu/src/context-menu-utils.d.ts +89 -3
- package/dist/components/context-menu/src/context-menu-utils.js +168 -3
- package/dist/components/date-picker/index.d.ts +4 -2
- package/dist/components/date-picker/src/RsDatePicker.css +42 -22
- package/dist/components/date-picker/src/RsDatePicker.d.ts +44 -20
- package/dist/components/date-picker/src/RsDatePicker.impl.js +484 -222
- package/dist/components/date-picker/src/RsDatePicker.js +1 -3
- package/dist/components/date-picker/src/RsDateTimePicker.d.ts +33 -6
- package/dist/components/date-picker/src/RsDateTimePicker.impl.js +47 -6
- package/dist/components/date-picker/src/date-picker-utils.d.ts +19 -0
- package/dist/components/date-picker/src/date-picker-utils.js +33 -10
- package/dist/components/descriptions/index.d.ts +1 -1
- package/dist/components/descriptions/src/RsDescriptions.css +38 -11
- package/dist/components/descriptions/src/RsDescriptions.d.ts +20 -4
- package/dist/components/descriptions/src/RsDescriptions.impl.js +89 -19
- package/dist/components/descriptions/src/RsDescriptionsItem.impl.js +13 -6
- package/dist/components/descriptions/src/descriptions-utils.d.ts +19 -0
- package/dist/components/descriptions/src/descriptions-utils.js +39 -1
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dialog/src/RsConfirmDialog.css +47 -21
- package/dist/components/dialog/src/RsConfirmDialog.d.ts +19 -7
- package/dist/components/dialog/src/RsConfirmDialog.impl.js +349 -119
- package/dist/components/dialog/src/RsConfirmDialog.js +2 -1
- package/dist/components/dialog/src/RsDialog.css +102 -109
- package/dist/components/dialog/src/RsDialog.d.ts +34 -24
- package/dist/components/dialog/src/RsDialog.impl.js +410 -177
- package/dist/components/dialog/src/RsDialog.js +2 -1
- package/dist/components/dialog/src/dialog-utils.d.ts +40 -1
- package/dist/components/dialog/src/dialog-utils.js +152 -1
- package/dist/components/dialog/src/dialog-window.js +29 -8
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/src/RsDrawer.css +61 -29
- package/dist/components/drawer/src/RsDrawer.d.ts +37 -21
- package/dist/components/drawer/src/RsDrawer.impl.js +441 -223
- package/dist/components/drawer/src/drawer-utils.d.ts +35 -0
- package/dist/components/drawer/src/drawer-utils.js +131 -1
- package/dist/components/dropdown/index.d.ts +1 -1
- package/dist/components/dropdown/src/RsDropdown.css +140 -61
- package/dist/components/dropdown/src/RsDropdown.d.ts +39 -6
- package/dist/components/dropdown/src/RsDropdown.impl.js +693 -63
- package/dist/components/dropdown/src/RsDropdownItemView.impl.js +17 -7
- package/dist/components/dropdown/src/RsDropdownItems.d.ts +32 -3
- package/dist/components/dropdown/src/RsDropdownItems.impl.js +171 -59
- package/dist/components/dropdown/src/dropdown-utils.d.ts +50 -0
- package/dist/components/dropdown/src/dropdown-utils.js +103 -3
- package/dist/components/dynamic-tags/index.d.ts +1 -1
- package/dist/components/dynamic-tags/src/RsDynamicTags.css +115 -38
- package/dist/components/dynamic-tags/src/RsDynamicTags.d.ts +58 -17
- package/dist/components/dynamic-tags/src/RsDynamicTags.impl.js +269 -106
- package/dist/components/dynamic-tags/src/RsDynamicTags.js +1 -1
- package/dist/components/dynamic-tags/src/dynamic-tags-utils.d.ts +19 -0
- package/dist/components/dynamic-tags/src/dynamic-tags-utils.js +60 -0
- package/dist/components/empty/index.d.ts +1 -0
- package/dist/components/empty/src/RsEmpty.css +105 -23
- package/dist/components/empty/src/RsEmpty.d.ts +27 -4
- package/dist/components/empty/src/RsEmpty.impl.js +154 -11
- package/dist/components/empty/src/RsEmpty.js +2 -1
- package/dist/components/empty/src/empty-utils.d.ts +28 -0
- package/dist/components/empty/src/empty-utils.js +55 -0
- package/dist/components/fieldset/src/RsFieldset.css +71 -41
- package/dist/components/fieldset/src/RsFieldset.d.ts +21 -2
- package/dist/components/fieldset/src/RsFieldset.impl.js +93 -26
- package/dist/components/fieldset/src/RsFieldset.js +1 -1
- package/dist/components/fieldset/src/fieldset-utils.d.ts +4 -0
- package/dist/components/fieldset/src/fieldset-utils.js +9 -1
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/src/RsForm.css +15 -12
- package/dist/components/form/src/RsForm.d.ts +21 -23
- package/dist/components/form/src/RsForm.impl.js +33 -20
- package/dist/components/form/src/RsForm.js +1 -1
- package/dist/components/form/src/form-utils.d.ts +7 -0
- package/dist/components/form/src/form-utils.js +28 -1
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/src/RsInput.css +78 -260
- package/dist/components/input/src/RsInput.d.ts +5 -3
- package/dist/components/input/src/RsInput.impl.js +8 -16
- package/dist/components/input/src/RsInput.js +1 -1
- package/dist/components/input/src/input-utils.d.ts +11 -0
- package/dist/components/input/src/input-utils.js +22 -0
- package/dist/components/input-number/index.d.ts +1 -0
- package/dist/components/input-number/src/RsInputNumber.css +31 -31
- package/dist/components/input-number/src/RsInputNumber.d.ts +16 -14
- package/dist/components/input-number/src/RsInputNumber.impl.js +17 -4
- package/dist/components/input-number/src/RsInputNumber.js +1 -1
- package/dist/components/label/src/RsLabel.css +30 -11
- package/dist/components/label/src/RsLabel.d.ts +18 -1
- package/dist/components/label/src/RsLabel.impl.js +63 -10
- package/dist/components/label/src/RsLabel.js +1 -1
- package/dist/components/label/src/label-utils.d.ts +6 -0
- package/dist/components/label/src/label-utils.js +16 -0
- package/dist/components/link/src/RsLink.d.ts +2 -2
- package/dist/components/loading/index.d.ts +1 -0
- package/dist/components/loading/src/RsLoading.css +13 -97
- package/dist/components/loading/src/RsLoading.d.ts +53 -3
- package/dist/components/loading/src/RsLoading.impl.js +216 -33
- package/dist/components/loading/src/RsLoading.js +2 -1
- package/dist/components/loading/src/loading-status.css +210 -0
- package/dist/components/loading/src/loading-status.d.ts +34 -0
- package/dist/components/loading/src/loading-status.impl.js +84 -0
- package/dist/components/loading/src/loading-status.js +8 -0
- package/dist/components/loading/src/loading-utils.d.ts +51 -4
- package/dist/components/loading/src/loading-utils.js +122 -0
- package/dist/components/loading-bar/index.d.ts +1 -0
- package/dist/components/loading-bar/src/RsLoadingBar.css +72 -8
- package/dist/components/loading-bar/src/RsLoadingBar.d.ts +55 -11
- package/dist/components/loading-bar/src/RsLoadingBar.impl.js +298 -57
- package/dist/components/loading-bar/src/RsLoadingBar.js +1 -1
- package/dist/components/loading-bar/src/loading-bar-utils.d.ts +69 -0
- package/dist/components/loading-bar/src/loading-bar-utils.js +97 -0
- package/dist/components/log/src/RsLog.css +52 -144
- package/dist/components/log/src/RsLog.d.ts +12 -11
- package/dist/components/log/src/RsLog.impl.js +181 -148
- package/dist/components/log/src/RsLog.js +1 -1
- package/dist/components/log/src/RsLogRow.css +152 -0
- package/dist/components/log/src/RsLogRow.d.ts +35 -0
- package/dist/components/log/src/RsLogRow.impl.js +91 -0
- package/dist/components/log/src/RsLogRow.js +8 -0
- package/dist/components/log/src/log-utils.d.ts +8 -0
- package/dist/components/log/src/log-utils.js +71 -10
- package/dist/components/markdown/index.d.ts +1 -1
- package/dist/components/markdown/src/RsMarkdown.css +75 -32
- package/dist/components/markdown/src/RsMarkdown.d.ts +6 -2
- package/dist/components/markdown/src/RsMarkdown.impl.js +185 -17
- package/dist/components/markdown/src/markdown-utils.d.ts +26 -0
- package/dist/components/markdown/src/markdown-utils.js +114 -12
- package/dist/components/mentions/index.d.ts +2 -1
- package/dist/components/mentions/src/RsMentions.css +119 -3
- package/dist/components/mentions/src/RsMentions.d.ts +57 -5
- package/dist/components/mentions/src/RsMentions.impl.js +298 -79
- package/dist/components/mentions/src/RsMentions.js +1 -3
- package/dist/components/mentions/src/mentions-utils.d.ts +5 -1
- package/dist/components/mentions/src/mentions-utils.js +28 -9
- package/dist/components/menu/index.d.ts +1 -1
- package/dist/components/menu/src/RsMenu.css +70 -29
- package/dist/components/menu/src/RsMenu.d.ts +58 -4
- package/dist/components/menu/src/RsMenu.impl.js +93 -46
- package/dist/components/menu/src/RsMenuItems.d.ts +22 -5
- package/dist/components/menu/src/RsMenuItems.impl.js +506 -154
- package/dist/components/menu/src/menu-utils.d.ts +56 -0
- package/dist/components/menu/src/menu-utils.js +139 -6
- package/dist/components/monaco-editor/index.d.ts +1 -1
- package/dist/components/monaco-editor/src/RsMonacoEditor.css +28 -16
- package/dist/components/monaco-editor/src/RsMonacoEditor.d.ts +39 -41
- package/dist/components/monaco-editor/src/RsMonacoEditor.impl.js +212 -133
- package/dist/components/monaco-editor/src/RsMonacoEditor.js +1 -1
- package/dist/components/monaco-editor/src/monaco-editor-utils.d.ts +126 -0
- package/dist/components/monaco-editor/src/monaco-editor-utils.js +302 -0
- package/dist/components/pagination/index.d.ts +2 -2
- package/dist/components/pagination/src/RsPagination.css +93 -46
- package/dist/components/pagination/src/RsPagination.d.ts +68 -8
- package/dist/components/pagination/src/RsPagination.impl.js +229 -86
- package/dist/components/pagination/src/RsPagination.js +1 -1
- package/dist/components/pagination/src/pagination-utils.d.ts +59 -0
- package/dist/components/pagination/src/pagination-utils.js +105 -1
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/src/RsPopover.css +124 -14
- package/dist/components/popover/src/RsPopover.d.ts +38 -7
- package/dist/components/popover/src/RsPopover.impl.js +546 -35
- package/dist/components/popover/src/RsPopover.js +2 -1
- package/dist/components/popover/src/popover-utils.d.ts +24 -2
- package/dist/components/popover/src/popover-utils.js +55 -0
- package/dist/components/radio/index.d.ts +1 -1
- package/dist/components/radio/src/RsRadio.css +7 -6
- package/dist/components/radio/src/RsRadio.d.ts +8 -5
- package/dist/components/radio/src/RsRadio.impl.js +34 -24
- package/dist/components/radio/src/RsRadio.js +2 -1
- package/dist/components/radio/src/RsRadioItem.css +61 -44
- package/dist/components/radio/src/RsRadioItem.d.ts +2 -2
- package/dist/components/radio/src/RsRadioItem.impl.js +53 -20
- package/dist/components/radio/src/RsRadioItem.js +2 -1
- package/dist/components/radio/src/radio-utils.d.ts +12 -1
- package/dist/components/radio/src/radio-utils.js +15 -1
- package/dist/components/scrollbar/src/RsScrollbar.css +71 -24
- package/dist/components/scrollbar/src/RsScrollbar.d.ts +9 -5
- package/dist/components/scrollbar/src/RsScrollbar.impl.js +372 -47
- package/dist/components/scrollbar/src/RsScrollbar.js +2 -1
- package/dist/components/scrollbar/src/scrollbar-utils.d.ts +34 -2
- package/dist/components/scrollbar/src/scrollbar-utils.js +64 -1
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/src/RsSelect.css +54 -42
- package/dist/components/select/src/RsSelect.d.ts +19 -2
- package/dist/components/select/src/RsSelect.impl.js +727 -312
- package/dist/components/select/src/RsSelect.js +1 -1
- package/dist/components/select/src/select-utils.d.ts +4 -2
- package/dist/components/select/src/select-utils.js +8 -3
- package/dist/components/select/src/use-rs-select.d.ts +1 -0
- package/dist/components/select/src/use-rs-select.js +23 -17
- package/dist/components/sidebar/index.d.ts +1 -0
- package/dist/components/sidebar/src/RsSidebar.css +91 -33
- package/dist/components/sidebar/src/RsSidebar.d.ts +17 -9
- package/dist/components/sidebar/src/RsSidebar.impl.js +124 -22
- package/dist/components/sidebar/src/RsSidebar.js +1 -1
- package/dist/components/sidebar/src/RsSidebarGroup.css +23 -6
- package/dist/components/sidebar/src/RsSidebarGroup.d.ts +6 -2
- package/dist/components/sidebar/src/RsSidebarGroup.impl.js +17 -4
- package/dist/components/sidebar/src/RsSidebarGroup.js +1 -1
- package/dist/components/sidebar/src/RsSidebarItem.css +50 -20
- package/dist/components/sidebar/src/RsSidebarItem.d.ts +21 -3
- package/dist/components/sidebar/src/RsSidebarItem.impl.js +71 -20
- package/dist/components/sidebar/src/RsSidebarItem.js +1 -1
- package/dist/components/sidebar/src/sidebar-utils.d.ts +47 -0
- package/dist/components/sidebar/src/sidebar-utils.js +72 -0
- package/dist/components/split-pane/index.d.ts +2 -2
- package/dist/components/split-pane/src/RsSplitPane.css +41 -30
- package/dist/components/split-pane/src/RsSplitPane.d.ts +6 -2
- package/dist/components/split-pane/src/RsSplitPane.impl.js +153 -45
- package/dist/components/split-pane/src/split-pane-utils.d.ts +23 -0
- package/dist/components/split-pane/src/split-pane-utils.js +18 -1
- package/dist/components/stat-card/index.d.ts +1 -0
- package/dist/components/stat-card/src/RsStatCard.css +129 -25
- package/dist/components/stat-card/src/RsStatCard.d.ts +40 -4
- package/dist/components/stat-card/src/RsStatCard.impl.js +106 -12
- package/dist/components/stat-card/src/RsStatCard.js +1 -1
- package/dist/components/stat-card/src/stat-card-utils.d.ts +39 -0
- package/dist/components/stat-card/src/stat-card-utils.js +113 -0
- package/dist/components/steps/index.d.ts +1 -1
- package/dist/components/steps/src/RsSteps.css +158 -37
- package/dist/components/steps/src/RsSteps.d.ts +69 -5
- package/dist/components/steps/src/RsSteps.impl.js +168 -28
- package/dist/components/steps/src/RsSteps.js +1 -1
- package/dist/components/steps/src/steps-utils.d.ts +51 -1
- package/dist/components/steps/src/steps-utils.js +67 -1
- package/dist/components/switch/index.d.ts +2 -1
- package/dist/components/switch/src/RsSwitch.css +36 -18
- package/dist/components/switch/src/RsSwitch.d.ts +18 -5
- package/dist/components/switch/src/RsSwitch.impl.js +61 -29
- package/dist/components/switch/src/RsSwitch.js +2 -1
- package/dist/components/switch/src/switch-utils.d.ts +4 -0
- package/dist/components/switch/src/switch-utils.js +9 -0
- package/dist/components/table/src/RsTable.impl.js +4 -2
- package/dist/components/table/src/composables/useRsTableContextMenu.d.ts +16 -0
- package/dist/components/table/src/composables/useRsTableContextMenu.js +1 -1
- package/dist/components/table/src/composables/useRsTableEngine.js +6 -2
- package/dist/components/table/src/composables/useRsTableScrollLayout.js +2 -0
- package/dist/components/table/src/composables/useRsTableShell.d.ts +16 -0
- package/dist/components/table/src/rs-table-props.d.ts +1 -1
- package/dist/components/table/src/rs-table-props.js +0 -1
- package/dist/components/table/src/table-body/RsTableBody.impl.js +1 -0
- package/dist/components/table/src/table-body/RsTableCellEditor.impl.js +10 -2
- package/dist/components/table/src/table-body/RsTableColGroup.impl.js +1 -0
- package/dist/components/table/src/table-footer/RsTableSummaryRow.impl.js +1 -0
- package/dist/components/table/src/table-header/RsTableHeader.impl.js +1 -0
- package/dist/components/table/src/utils/table-utils.d.ts +10 -6
- package/dist/components/table/src/utils/table-utils.js +27 -25
- package/dist/components/table/style/rs-table.css +34 -20
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/src/RsTabs.css +225 -101
- package/dist/components/tabs/src/RsTabs.d.ts +37 -8
- package/dist/components/tabs/src/RsTabs.impl.js +400 -270
- package/dist/components/tabs/src/tabs-utils.d.ts +41 -2
- package/dist/components/tabs/src/tabs-utils.js +55 -1
- package/dist/components/terminal/index.d.ts +1 -1
- package/dist/components/terminal/src/RsTerminal.css +60 -37
- package/dist/components/terminal/src/RsTerminal.d.ts +36 -4
- package/dist/components/terminal/src/RsTerminal.impl.js +288 -68
- package/dist/components/terminal/src/RsTerminal.js +1 -1
- package/dist/components/terminal/src/terminal-utils.d.ts +42 -4
- package/dist/components/terminal/src/terminal-utils.js +113 -10
- package/dist/components/textarea/src/RsTextarea.css +23 -23
- package/dist/components/textarea/src/RsTextarea.d.ts +7 -13
- package/dist/components/textarea/src/RsTextarea.impl.js +37 -46
- package/dist/components/textarea/src/RsTextarea.js +1 -1
- package/dist/components/textarea/src/textarea-utils.d.ts +27 -0
- package/dist/components/textarea/src/textarea-utils.js +61 -0
- package/dist/components/time-picker/index.d.ts +3 -2
- package/dist/components/time-picker/src/RsTimePicker.css +41 -24
- package/dist/components/time-picker/src/RsTimePicker.d.ts +52 -7
- package/dist/components/time-picker/src/RsTimePicker.impl.js +520 -156
- package/dist/components/time-picker/src/RsTimePicker.js +1 -3
- package/dist/components/time-picker/src/RsTimePickerColumns.css +26 -18
- package/dist/components/time-picker/src/RsTimePickerColumns.d.ts +3 -1
- package/dist/components/time-picker/src/RsTimePickerColumns.impl.js +62 -9
- package/dist/components/time-picker/src/RsTimePickerColumns.js +1 -1
- package/dist/components/time-picker/src/time-picker-utils.d.ts +38 -0
- package/dist/components/time-picker/src/time-picker-utils.js +97 -5
- package/dist/components/toaster/src/RsToaster.css +156 -203
- package/dist/components/toaster/src/RsToaster.d.ts +33 -3
- package/dist/components/toaster/src/RsToaster.impl.js +309 -34
- package/dist/components/toaster/src/toast-store.d.ts +95 -0
- package/dist/components/toaster/src/toast-store.js +177 -0
- package/dist/components/toaster/src/toast-utils.d.ts +60 -0
- package/dist/components/toaster/src/toast-utils.js +86 -0
- package/dist/components/toolbar/index.d.ts +1 -1
- package/dist/components/toolbar/src/RsToolbar.css +206 -32
- package/dist/components/toolbar/src/RsToolbar.d.ts +41 -16
- package/dist/components/toolbar/src/RsToolbar.impl.js +146 -18
- package/dist/components/toolbar/src/RsToolbar.js +2 -1
- package/dist/components/toolbar/src/toolbar-utils.d.ts +20 -0
- package/dist/components/toolbar/src/toolbar-utils.js +105 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/src/RsTooltip.css +104 -26
- package/dist/components/tooltip/src/RsTooltip.d.ts +39 -17
- package/dist/components/tooltip/src/RsTooltip.impl.js +420 -51
- package/dist/components/tooltip/src/RsTooltip.js +2 -1
- package/dist/components/tooltip/src/RsTooltipProvider.d.ts +4 -4
- package/dist/components/tooltip/src/RsTooltipProvider.impl.js +51 -14
- package/dist/components/tooltip/src/tooltip-utils.d.ts +30 -0
- package/dist/components/tooltip/src/tooltip-utils.js +23 -0
- package/dist/components/tree/index.d.ts +2 -2
- package/dist/components/tree/src/RsTree.css +84 -75
- package/dist/components/tree/src/RsTree.d.ts +23 -23
- package/dist/components/tree/src/RsTree.impl.js +292 -66
- package/dist/components/tree/src/RsTree.js +1 -1
- package/dist/components/tree/src/tree-utils.d.ts +22 -0
- package/dist/components/tree/src/tree-utils.js +18 -4
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/src/RsTreeSelect.css +100 -25
- package/dist/components/tree-select/src/RsTreeSelect.d.ts +91 -7
- package/dist/components/tree-select/src/RsTreeSelect.impl.js +464 -79
- package/dist/components/tree-select/src/RsTreeSelect.js +1 -1
- package/dist/components/tree-select/src/tree-select-utils.d.ts +20 -0
- package/dist/components/tree-select/src/tree-select-utils.js +60 -0
- package/dist/components/upload/index.d.ts +2 -1
- package/dist/components/upload/src/RsUpload.css +223 -75
- package/dist/components/upload/src/RsUpload.d.ts +77 -1
- package/dist/components/upload/src/RsUpload.impl.js +404 -90
- package/dist/components/upload/src/RsUpload.js +1 -1
- package/dist/components/upload/src/upload-utils.d.ts +21 -2
- package/dist/components/upload/src/upload-utils.js +139 -9
- package/dist/components/virtual-list/index.d.ts +1 -1
- package/dist/components/virtual-list/src/RsVirtualList.css +64 -9
- package/dist/components/virtual-list/src/RsVirtualList.d.ts +31 -5
- package/dist/components/virtual-list/src/RsVirtualList.impl.js +425 -76
- package/dist/components/virtual-list/src/RsVirtualList.js +1 -1
- package/dist/components/virtual-list/src/virtual-list-utils.d.ts +64 -1
- package/dist/components/virtual-list/src/virtual-list-utils.js +215 -1
- package/dist/composables/useRsLoadingBar.d.ts +2 -5
- package/dist/composables/useRsLoadingBar.js +21 -5
- package/dist/composables/useRsTabsNav.d.ts +3 -1
- package/dist/composables/useRsTabsNav.js +96 -28
- package/dist/composables/useRsToast.d.ts +11 -13
- package/dist/composables/useRsToast.js +66 -17
- package/dist/index.d.ts +51 -32
- package/dist/index.js +20 -0
- package/dist/locale/apply.js +6 -1
- package/dist/locale/messages.js +174 -4
- package/dist/styles.css +1007 -980
- package/dist/theme/brand.example.css +3 -2
- package/dist/vite-plugins/niuma-ui-host.js +1 -1
- package/package.json +2 -3
- package/dist/components/breadcrumb/src/RsBreadcrumbItems.d.ts +0 -8
- package/dist/components/breadcrumb/src/RsBreadcrumbItems.impl.js +0 -40
- package/dist/components/breadcrumb/src/RsBreadcrumbItems.js +0 -5
- package/dist/components/date-picker/src/RsDatePicker-1.css +0 -157
- package/dist/components/mentions/src/RsMentions-1.css +0 -29
- package/dist/components/time-picker/src/RsTimePicker-1.css +0 -98
|
@@ -1,74 +1,173 @@
|
|
|
1
1
|
import { RS_COMPONENT_SIZE_ICON_PX } from "../../../theme/types.js";
|
|
2
|
-
import { ComboboxAnchor, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxItemIndicator, ComboboxLabel, ComboboxPortal, ComboboxRoot, ComboboxTrigger, ComboboxViewport, ComboboxVirtualizer } from "../../_shared/src/reka.js";
|
|
3
2
|
import { useRsI18n } from "../../../composables/useRsI18n.js";
|
|
4
3
|
import RsIcon_default from "../../icon/src/RsIcon.js";
|
|
5
4
|
import { buildLocalInputRules, runFormFieldRules } from "../../form/src/form-rules.js";
|
|
6
5
|
import { isRsFormItemBoundControl, useRsFormContext, useRsFormField, useRsFormItemContext } from "../../form/src/form-utils.js";
|
|
7
6
|
import { useResolvedRsComponentSize } from "../../_shared/src/resolve-size.js";
|
|
8
7
|
import { rsRadiusCss, useResolvedRsRadius } from "../../_shared/src/resolve-radius.js";
|
|
8
|
+
import { placeAnchoredPopup, stepEnabledIndex } from "../../_shared/src/overlay-utils.js";
|
|
9
9
|
import { isSelectOptionGroup, splitSelectLabelHighlight, toComboboxValue } from "./select-utils.js";
|
|
10
10
|
import { useRsSelect } from "./use-rs-select.js";
|
|
11
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent,
|
|
11
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useAttrs, useId, useModel, useTemplateRef, vModelText, watch, withDirectives, withModifiers } from "vue";
|
|
12
12
|
//#region src/components/select/src/RsSelect.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var _hoisted_1 =
|
|
13
|
+
var _hoisted_1 = ["name", "value"];
|
|
14
|
+
var _hoisted_2 = ["name", "value"];
|
|
15
|
+
var _hoisted_3 = [
|
|
16
|
+
"id",
|
|
17
|
+
"aria-expanded",
|
|
18
|
+
"aria-controls",
|
|
19
|
+
"aria-activedescendant",
|
|
20
|
+
"aria-invalid",
|
|
21
|
+
"aria-disabled",
|
|
22
|
+
"disabled",
|
|
23
|
+
"data-disabled",
|
|
24
|
+
"data-state"
|
|
25
|
+
];
|
|
26
|
+
var _hoisted_4 = {
|
|
14
27
|
key: 0,
|
|
15
28
|
class: "rs-select__prefix"
|
|
16
29
|
};
|
|
17
|
-
var
|
|
30
|
+
var _hoisted_5 = {
|
|
18
31
|
key: 1,
|
|
19
32
|
class: "rs-select__value rs-select__value--multiple"
|
|
20
33
|
};
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
34
|
+
var _hoisted_6 = { class: "rs-select__tag-label" };
|
|
35
|
+
var _hoisted_7 = ["aria-label", "onClick"];
|
|
36
|
+
var _hoisted_8 = ["title"];
|
|
37
|
+
var _hoisted_9 = {
|
|
25
38
|
key: 1,
|
|
26
39
|
class: "rs-select__placeholder"
|
|
27
40
|
};
|
|
28
|
-
var
|
|
41
|
+
var _hoisted_10 = {
|
|
29
42
|
key: 2,
|
|
30
43
|
class: "rs-select__value"
|
|
31
44
|
};
|
|
32
|
-
var
|
|
45
|
+
var _hoisted_11 = {
|
|
33
46
|
key: 0,
|
|
34
47
|
class: "rs-select__single-label"
|
|
35
48
|
};
|
|
36
|
-
var
|
|
49
|
+
var _hoisted_12 = {
|
|
37
50
|
key: 1,
|
|
38
51
|
class: "rs-select__placeholder"
|
|
39
52
|
};
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
53
|
+
var _hoisted_13 = { class: "rs-select__actions" };
|
|
54
|
+
var _hoisted_14 = ["aria-label"];
|
|
55
|
+
var _hoisted_15 = {
|
|
43
56
|
key: 1,
|
|
44
57
|
class: "rs-select__suffix"
|
|
45
58
|
};
|
|
46
|
-
var
|
|
59
|
+
var _hoisted_16 = [
|
|
60
|
+
"id",
|
|
61
|
+
"data-placement",
|
|
62
|
+
"data-rs-theme"
|
|
63
|
+
];
|
|
64
|
+
var _hoisted_17 = {
|
|
65
|
+
key: 0,
|
|
66
|
+
class: "rs-select__panel-header"
|
|
67
|
+
};
|
|
68
|
+
var _hoisted_18 = {
|
|
47
69
|
key: 1,
|
|
48
70
|
class: "rs-select__search-bar"
|
|
49
71
|
};
|
|
50
|
-
var
|
|
51
|
-
var
|
|
72
|
+
var _hoisted_19 = { class: "rs-select__search-wrap" };
|
|
73
|
+
var _hoisted_20 = [
|
|
74
|
+
"placeholder",
|
|
75
|
+
"aria-label",
|
|
76
|
+
"aria-controls",
|
|
77
|
+
"aria-activedescendant"
|
|
78
|
+
];
|
|
79
|
+
var _hoisted_21 = {
|
|
52
80
|
key: 2,
|
|
53
81
|
class: "rs-select__status"
|
|
54
82
|
};
|
|
55
|
-
var
|
|
56
|
-
|
|
83
|
+
var _hoisted_22 = {
|
|
84
|
+
key: 3,
|
|
85
|
+
class: "rs-select__empty",
|
|
86
|
+
role: "status"
|
|
87
|
+
};
|
|
88
|
+
var _hoisted_23 = ["aria-multiselectable", "aria-label"];
|
|
89
|
+
var _hoisted_24 = [
|
|
90
|
+
"id",
|
|
91
|
+
"data-value",
|
|
92
|
+
"data-highlighted",
|
|
93
|
+
"data-state",
|
|
94
|
+
"data-disabled",
|
|
95
|
+
"aria-selected",
|
|
96
|
+
"aria-disabled",
|
|
97
|
+
"title",
|
|
98
|
+
"onClick"
|
|
99
|
+
];
|
|
100
|
+
var _hoisted_25 = { class: "rs-select__item-label" };
|
|
101
|
+
var _hoisted_26 = {
|
|
57
102
|
key: 0,
|
|
58
103
|
class: "rs-select__mark"
|
|
59
104
|
};
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
105
|
+
var _hoisted_27 = {
|
|
106
|
+
key: 0,
|
|
107
|
+
class: "rs-select__item-check"
|
|
108
|
+
};
|
|
109
|
+
var _hoisted_28 = [
|
|
110
|
+
"id",
|
|
111
|
+
"data-value",
|
|
112
|
+
"data-highlighted",
|
|
113
|
+
"data-state",
|
|
114
|
+
"aria-selected"
|
|
115
|
+
];
|
|
116
|
+
var _hoisted_29 = { class: "rs-select__item-label" };
|
|
117
|
+
var _hoisted_30 = {
|
|
118
|
+
key: 0,
|
|
119
|
+
class: "rs-select__item-check"
|
|
120
|
+
};
|
|
121
|
+
var _hoisted_31 = ["aria-label"];
|
|
122
|
+
var _hoisted_32 = { class: "rs-select__group-label" };
|
|
123
|
+
var _hoisted_33 = [
|
|
124
|
+
"id",
|
|
125
|
+
"data-value",
|
|
126
|
+
"data-highlighted",
|
|
127
|
+
"data-state",
|
|
128
|
+
"data-disabled",
|
|
129
|
+
"aria-selected",
|
|
130
|
+
"aria-disabled",
|
|
131
|
+
"title",
|
|
132
|
+
"onClick"
|
|
133
|
+
];
|
|
134
|
+
var _hoisted_34 = { class: "rs-select__item-label" };
|
|
135
|
+
var _hoisted_35 = {
|
|
63
136
|
key: 0,
|
|
64
137
|
class: "rs-select__mark"
|
|
65
138
|
};
|
|
66
|
-
var
|
|
67
|
-
|
|
139
|
+
var _hoisted_36 = {
|
|
140
|
+
key: 0,
|
|
141
|
+
class: "rs-select__item-check"
|
|
142
|
+
};
|
|
143
|
+
var _hoisted_37 = [
|
|
144
|
+
"id",
|
|
145
|
+
"data-value",
|
|
146
|
+
"data-highlighted",
|
|
147
|
+
"data-state",
|
|
148
|
+
"data-disabled",
|
|
149
|
+
"aria-selected",
|
|
150
|
+
"aria-disabled",
|
|
151
|
+
"title",
|
|
152
|
+
"onClick"
|
|
153
|
+
];
|
|
154
|
+
var _hoisted_38 = { class: "rs-select__item-label" };
|
|
155
|
+
var _hoisted_39 = {
|
|
68
156
|
key: 0,
|
|
69
157
|
class: "rs-select__mark"
|
|
70
158
|
};
|
|
159
|
+
var _hoisted_40 = {
|
|
160
|
+
key: 0,
|
|
161
|
+
class: "rs-select__item-check"
|
|
162
|
+
};
|
|
163
|
+
var _hoisted_41 = {
|
|
164
|
+
key: 5,
|
|
165
|
+
class: "rs-select__panel-footer"
|
|
166
|
+
};
|
|
167
|
+
var ITEM_ESTIMATE = 36;
|
|
168
|
+
var VIRTUAL_OVERSCAN = 6;
|
|
71
169
|
var RsSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
170
|
+
name: "RsSelect",
|
|
72
171
|
inheritAttrs: false,
|
|
73
172
|
__name: "RsSelect",
|
|
74
173
|
props: /*@__PURE__*/ mergeModels({
|
|
@@ -211,14 +310,19 @@ var RsSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
211
310
|
const emit = __emit;
|
|
212
311
|
const { t } = useRsI18n();
|
|
213
312
|
const attrs = useAttrs();
|
|
313
|
+
const listId = useId();
|
|
214
314
|
const formContext = useRsFormContext();
|
|
215
315
|
const formItem = useRsFormItemContext();
|
|
216
316
|
const boundToItem = computed(() => isRsFormItemBoundControl(formItem, {
|
|
217
317
|
id: props.id,
|
|
218
318
|
name: props.name
|
|
219
319
|
}));
|
|
220
|
-
const
|
|
221
|
-
const
|
|
320
|
+
const rootRef = useTemplateRef("rootRef");
|
|
321
|
+
const triggerRef = useTemplateRef("triggerRef");
|
|
322
|
+
const contentRef = useTemplateRef("contentRef");
|
|
323
|
+
const searchInputRef = useTemplateRef("searchInputRef");
|
|
324
|
+
const viewportRef = useTemplateRef("viewportRef");
|
|
325
|
+
const { resolvedPlaceholder, resolvedSearchPlaceholder, resolvedEmptyText, resolvedLoadingText, isMultiple, isSearchable, labelMap, useVirtual, displayOptions, createValue, canCreate, createOptionLabel, virtualValues, selectedValues, hasValue, visibleTagTokens, omittedTagCount, omittedTagLabel, omittedTagTitle, singleDisplayLabel, pickToken, tokenLabel, truncateTagLabel, optionFromToken, optionOrCreate, isOptionLimited, isTokenDisabled, restoreTokenValue, onSearchKeydown, onClear, removeTag, setValue, resetSearch } = useRsSelect(props, model, open, searchQuery, emit, t);
|
|
222
326
|
const resolvedDisabled = computed(() => props.disabled || formContext?.disabled.value || false);
|
|
223
327
|
const resolvedSize = useResolvedRsComponentSize(() => props.size);
|
|
224
328
|
const resolvedRadius = useResolvedRsRadius(() => props.radius, "sm");
|
|
@@ -228,10 +332,9 @@ var RsSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
228
332
|
"--rs-select-list-height": `${props.listHeight}px`
|
|
229
333
|
}));
|
|
230
334
|
const portalTo = computed(() => {
|
|
231
|
-
if (!props.getPopupContainer) return
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
return props.getPopupContainer(el instanceof HTMLElement ? el : void 0);
|
|
335
|
+
if (!props.getPopupContainer) return "body";
|
|
336
|
+
const el = triggerRef.value ?? void 0;
|
|
337
|
+
return props.getPopupContainer(el) ?? "body";
|
|
235
338
|
});
|
|
236
339
|
const autoMessage = ref("");
|
|
237
340
|
const isInvalid = computed(() => Boolean(props.invalid || props.status === "error" || boundToItem.value && formItem?.invalid.value || autoMessage.value));
|
|
@@ -271,19 +374,360 @@ var RsSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
271
374
|
autoMessage.value = message;
|
|
272
375
|
}
|
|
273
376
|
}));
|
|
377
|
+
function focus() {
|
|
378
|
+
triggerRef.value?.focus();
|
|
379
|
+
}
|
|
380
|
+
function blur() {
|
|
381
|
+
triggerRef.value?.blur();
|
|
382
|
+
searchInputRef.value?.blur();
|
|
383
|
+
}
|
|
274
384
|
__expose({
|
|
275
385
|
setValue,
|
|
276
386
|
clearValidation,
|
|
277
|
-
validate: runValidate
|
|
387
|
+
validate: runValidate,
|
|
388
|
+
focus,
|
|
389
|
+
blur
|
|
278
390
|
});
|
|
391
|
+
const listRows = computed(() => {
|
|
392
|
+
const rows = [];
|
|
393
|
+
if (canCreate.value) rows.push({
|
|
394
|
+
token: createValue.value,
|
|
395
|
+
label: createOptionLabel.value,
|
|
396
|
+
disabled: false,
|
|
397
|
+
isCreate: true
|
|
398
|
+
});
|
|
399
|
+
for (const entry of displayOptions.value) if (isSelectOptionGroup(entry)) for (const opt of entry.options) rows.push({
|
|
400
|
+
token: toComboboxValue(opt.value),
|
|
401
|
+
label: opt.label,
|
|
402
|
+
disabled: Boolean(opt.disabled || isOptionLimited(opt)),
|
|
403
|
+
isCreate: false,
|
|
404
|
+
option: opt,
|
|
405
|
+
title: opt.title
|
|
406
|
+
});
|
|
407
|
+
else rows.push({
|
|
408
|
+
token: toComboboxValue(entry.value),
|
|
409
|
+
label: entry.label,
|
|
410
|
+
disabled: Boolean(entry.disabled || isOptionLimited(entry)),
|
|
411
|
+
isCreate: false,
|
|
412
|
+
option: entry,
|
|
413
|
+
title: entry.title
|
|
414
|
+
});
|
|
415
|
+
return rows;
|
|
416
|
+
});
|
|
417
|
+
const highlight = ref(0);
|
|
418
|
+
const virtualStart = ref(0);
|
|
419
|
+
const popup = ref({
|
|
420
|
+
top: 0,
|
|
421
|
+
left: 0,
|
|
422
|
+
width: 0,
|
|
423
|
+
minWidth: 0,
|
|
424
|
+
placement: "bottom"
|
|
425
|
+
});
|
|
426
|
+
/** 面板挂到 body 后仍跟触发器最近的 data-rs-theme(深色岛 / 混主题页)。 */
|
|
427
|
+
const panelTheme = ref();
|
|
428
|
+
function syncPanelTheme() {
|
|
429
|
+
const el = triggerRef.value ?? rootRef.value;
|
|
430
|
+
if (!el) {
|
|
431
|
+
panelTheme.value = void 0;
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
panelTheme.value = el.closest("[data-rs-theme]")?.getAttribute("data-rs-theme") ?? void 0;
|
|
435
|
+
}
|
|
436
|
+
const highlightedToken = computed(() => listRows.value[highlight.value]?.token);
|
|
437
|
+
const activeOptionId = computed(() => open.value && highlightedToken.value ? `${listId}-${highlightedToken.value}` : void 0);
|
|
438
|
+
const virtualSlice = computed(() => {
|
|
439
|
+
const all = virtualValues.value;
|
|
440
|
+
if (!useVirtual.value) return {
|
|
441
|
+
items: all,
|
|
442
|
+
padTop: 0,
|
|
443
|
+
padBottom: 0,
|
|
444
|
+
totalH: all.length * ITEM_ESTIMATE
|
|
445
|
+
};
|
|
446
|
+
const start = Math.max(0, virtualStart.value - VIRTUAL_OVERSCAN);
|
|
447
|
+
const viewCount = Math.ceil(props.listHeight / ITEM_ESTIMATE) + VIRTUAL_OVERSCAN * 2;
|
|
448
|
+
const items = all.slice(start, start + viewCount);
|
|
449
|
+
return {
|
|
450
|
+
items,
|
|
451
|
+
padTop: start * ITEM_ESTIMATE,
|
|
452
|
+
padBottom: Math.max(0, (all.length - start - items.length) * ITEM_ESTIMATE),
|
|
453
|
+
totalH: all.length * ITEM_ESTIMATE
|
|
454
|
+
};
|
|
455
|
+
});
|
|
456
|
+
const emptyVisible = computed(() => !props.loading && !canCreate.value && displayOptions.value.length === 0);
|
|
457
|
+
function placePopup() {
|
|
458
|
+
const trigger = triggerRef.value;
|
|
459
|
+
const content = contentRef.value;
|
|
460
|
+
if (!trigger || !open.value) return;
|
|
461
|
+
const anchor = trigger.getBoundingClientRect();
|
|
462
|
+
const measured = content?.getBoundingClientRect();
|
|
463
|
+
const height = measured?.height || Math.min(props.listHeight, 320);
|
|
464
|
+
const prefWidth = props.matchTriggerWidth ? anchor.width : Math.max(anchor.width, measured?.width || anchor.width);
|
|
465
|
+
const gap = 4;
|
|
466
|
+
const vw = window.innerWidth;
|
|
467
|
+
const vh = window.innerHeight;
|
|
468
|
+
if (props.placement === "left" || props.placement === "right") {
|
|
469
|
+
const width = Math.min(prefWidth, Math.max(0, vw - gap * 2));
|
|
470
|
+
const leftPos = anchor.left - width - gap;
|
|
471
|
+
const rightPos = anchor.right + gap;
|
|
472
|
+
let side = props.placement;
|
|
473
|
+
let left = side === "left" ? leftPos : rightPos;
|
|
474
|
+
if (side === "left" && leftPos < gap && rightPos + width <= vw - gap) {
|
|
475
|
+
side = "right";
|
|
476
|
+
left = rightPos;
|
|
477
|
+
} else if (side === "right" && rightPos + width > vw - gap && leftPos >= gap) {
|
|
478
|
+
side = "left";
|
|
479
|
+
left = leftPos;
|
|
480
|
+
}
|
|
481
|
+
left = Math.min(Math.max(gap, left), Math.max(gap, vw - width - gap));
|
|
482
|
+
const top = Math.min(Math.max(gap, anchor.top), Math.max(gap, vh - height - gap));
|
|
483
|
+
popup.value = {
|
|
484
|
+
top,
|
|
485
|
+
left,
|
|
486
|
+
width,
|
|
487
|
+
minWidth: anchor.width,
|
|
488
|
+
placement: side
|
|
489
|
+
};
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
const box = placeAnchoredPopup({
|
|
493
|
+
top: anchor.top,
|
|
494
|
+
left: anchor.left,
|
|
495
|
+
height: anchor.height,
|
|
496
|
+
width: anchor.width
|
|
497
|
+
}, {
|
|
498
|
+
width: prefWidth,
|
|
499
|
+
height
|
|
500
|
+
}, {
|
|
501
|
+
width: vw,
|
|
502
|
+
height: vh
|
|
503
|
+
}, gap);
|
|
504
|
+
if (props.placement === "top") {
|
|
505
|
+
const above = anchor.top - height - gap;
|
|
506
|
+
if (above >= gap) {
|
|
507
|
+
popup.value = {
|
|
508
|
+
...box,
|
|
509
|
+
top: above,
|
|
510
|
+
minWidth: anchor.width,
|
|
511
|
+
placement: "top"
|
|
512
|
+
};
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
popup.value = {
|
|
517
|
+
...box,
|
|
518
|
+
minWidth: anchor.width
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
let frame = 0;
|
|
522
|
+
let overlayBound = false;
|
|
523
|
+
function requestPlace() {
|
|
524
|
+
if (typeof window === "undefined") return;
|
|
525
|
+
if (frame) return;
|
|
526
|
+
frame = window.requestAnimationFrame(() => {
|
|
527
|
+
frame = 0;
|
|
528
|
+
placePopup();
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
function syncHighlight() {
|
|
532
|
+
const rows = listRows.value;
|
|
533
|
+
const selected = rows.findIndex((row) => selectedValues.value.includes(row.token) && !row.disabled);
|
|
534
|
+
highlight.value = selected >= 0 ? selected : stepEnabledIndex(rows, -1, 1);
|
|
535
|
+
}
|
|
536
|
+
function escapeToken(token) {
|
|
537
|
+
if (typeof CSS !== "undefined" && typeof CSS.escape === "function") return CSS.escape(token);
|
|
538
|
+
return token.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
539
|
+
}
|
|
540
|
+
function scrollHighlightIntoView() {
|
|
541
|
+
const token = highlightedToken.value;
|
|
542
|
+
if (!token) return;
|
|
543
|
+
const el = contentRef.value?.querySelector(`[data-value="${escapeToken(token)}"]`);
|
|
544
|
+
if (el && "scrollIntoView" in el) el.scrollIntoView({ block: "nearest" });
|
|
545
|
+
}
|
|
546
|
+
function toggleOpen() {
|
|
547
|
+
if (resolvedDisabled.value) return;
|
|
548
|
+
open.value = !open.value;
|
|
549
|
+
}
|
|
550
|
+
function onDocPointerDown(event) {
|
|
551
|
+
const target = event.target;
|
|
552
|
+
if (!target) return;
|
|
553
|
+
if (rootRef.value?.contains(target)) return;
|
|
554
|
+
if (contentRef.value?.contains(target)) return;
|
|
555
|
+
open.value = false;
|
|
556
|
+
}
|
|
557
|
+
function onWindowChange() {
|
|
558
|
+
if (open.value) requestPlace();
|
|
559
|
+
}
|
|
560
|
+
function attachOverlay() {
|
|
561
|
+
if (overlayBound || typeof window === "undefined") return;
|
|
562
|
+
overlayBound = true;
|
|
563
|
+
if (typeof document !== "undefined") document.addEventListener("pointerdown", onDocPointerDown);
|
|
564
|
+
window.addEventListener("resize", onWindowChange);
|
|
565
|
+
window.addEventListener("scroll", onWindowChange, true);
|
|
566
|
+
}
|
|
567
|
+
function detachOverlay() {
|
|
568
|
+
if (frame && typeof window !== "undefined") {
|
|
569
|
+
window.cancelAnimationFrame(frame);
|
|
570
|
+
frame = 0;
|
|
571
|
+
}
|
|
572
|
+
if (!overlayBound) return;
|
|
573
|
+
overlayBound = false;
|
|
574
|
+
if (typeof document !== "undefined") document.removeEventListener("pointerdown", onDocPointerDown);
|
|
575
|
+
if (typeof window !== "undefined") {
|
|
576
|
+
window.removeEventListener("resize", onWindowChange);
|
|
577
|
+
window.removeEventListener("scroll", onWindowChange, true);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
function moveHighlight(delta) {
|
|
581
|
+
highlight.value = stepEnabledIndex(listRows.value, highlight.value, delta);
|
|
582
|
+
scrollHighlightIntoView();
|
|
583
|
+
}
|
|
584
|
+
function commitHighlight() {
|
|
585
|
+
const row = listRows.value[highlight.value];
|
|
586
|
+
if (!row || row.disabled) return;
|
|
587
|
+
pickToken(row.token);
|
|
588
|
+
}
|
|
589
|
+
function onTriggerKeydown(event) {
|
|
590
|
+
if (resolvedDisabled.value || event.isComposing) return;
|
|
591
|
+
if (event.key === "Escape") {
|
|
592
|
+
if (!open.value) return;
|
|
593
|
+
event.preventDefault();
|
|
594
|
+
open.value = false;
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
if (event.key === "ArrowDown") {
|
|
598
|
+
event.preventDefault();
|
|
599
|
+
if (!open.value) {
|
|
600
|
+
open.value = true;
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
moveHighlight(1);
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (event.key === "ArrowUp") {
|
|
607
|
+
event.preventDefault();
|
|
608
|
+
if (!open.value) {
|
|
609
|
+
open.value = true;
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
moveHighlight(-1);
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
if (event.key === "Home" && open.value) {
|
|
616
|
+
event.preventDefault();
|
|
617
|
+
highlight.value = stepEnabledIndex(listRows.value, -1, 1);
|
|
618
|
+
scrollHighlightIntoView();
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
if (event.key === "End" && open.value) {
|
|
622
|
+
event.preventDefault();
|
|
623
|
+
highlight.value = stepEnabledIndex(listRows.value, listRows.value.length, -1);
|
|
624
|
+
scrollHighlightIntoView();
|
|
625
|
+
return;
|
|
626
|
+
}
|
|
627
|
+
if (event.key === "Enter" && open.value) {
|
|
628
|
+
event.preventDefault();
|
|
629
|
+
commitHighlight();
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
if (isSearchable.value) return;
|
|
633
|
+
if (event.key.length !== 1 || event.ctrlKey || event.metaKey || event.altKey) return;
|
|
634
|
+
onTypeahead(event.key);
|
|
635
|
+
}
|
|
636
|
+
function onPanelSearchKeydown(event) {
|
|
637
|
+
if (event.isComposing) return;
|
|
638
|
+
if (event.key === "Escape") {
|
|
639
|
+
event.preventDefault();
|
|
640
|
+
open.value = false;
|
|
641
|
+
triggerRef.value?.focus();
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
if (event.key === "ArrowDown") {
|
|
645
|
+
event.preventDefault();
|
|
646
|
+
moveHighlight(1);
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
if (event.key === "ArrowUp") {
|
|
650
|
+
event.preventDefault();
|
|
651
|
+
moveHighlight(-1);
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
if (event.key === "Home") {
|
|
655
|
+
event.preventDefault();
|
|
656
|
+
highlight.value = stepEnabledIndex(listRows.value, -1, 1);
|
|
657
|
+
scrollHighlightIntoView();
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
if (event.key === "End") {
|
|
661
|
+
event.preventDefault();
|
|
662
|
+
highlight.value = stepEnabledIndex(listRows.value, listRows.value.length, -1);
|
|
663
|
+
scrollHighlightIntoView();
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
if (event.key === "Enter") {
|
|
667
|
+
event.preventDefault();
|
|
668
|
+
if (canCreate.value) {
|
|
669
|
+
onSearchKeydown(event);
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
commitHighlight();
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
let typeahead = "";
|
|
676
|
+
let typeaheadTimer;
|
|
677
|
+
function onTypeahead(key) {
|
|
678
|
+
typeahead += key.toLowerCase();
|
|
679
|
+
if (typeaheadTimer) clearTimeout(typeaheadTimer);
|
|
680
|
+
typeaheadTimer = setTimeout(() => {
|
|
681
|
+
typeahead = "";
|
|
682
|
+
typeaheadTimer = void 0;
|
|
683
|
+
}, 500);
|
|
684
|
+
if (!open.value) open.value = true;
|
|
685
|
+
const idx = listRows.value.findIndex((row) => !row.disabled && row.label.toLowerCase().startsWith(typeahead));
|
|
686
|
+
if (idx >= 0) highlight.value = idx;
|
|
687
|
+
}
|
|
688
|
+
function onViewportScroll(event) {
|
|
689
|
+
emit("popupScroll", event);
|
|
690
|
+
if (!useVirtual.value) return;
|
|
691
|
+
const el = event.target;
|
|
692
|
+
virtualStart.value = Math.floor(el.scrollTop / ITEM_ESTIMATE);
|
|
693
|
+
}
|
|
694
|
+
function onViewportPointerOver(event) {
|
|
695
|
+
const raw = event.target;
|
|
696
|
+
if (!(raw instanceof Element)) return;
|
|
697
|
+
const item = raw.closest(".rs-select__item");
|
|
698
|
+
if (!item || !viewportRef.value?.contains(item)) return;
|
|
699
|
+
if (item.hasAttribute("data-disabled")) return;
|
|
700
|
+
const token = item.getAttribute("data-value");
|
|
701
|
+
if (!token) return;
|
|
702
|
+
const idx = listRows.value.findIndex((row) => row.token === token);
|
|
703
|
+
if (idx >= 0) highlight.value = idx;
|
|
704
|
+
}
|
|
705
|
+
function itemState(token) {
|
|
706
|
+
return selectedValues.value.includes(token) ? "checked" : void 0;
|
|
707
|
+
}
|
|
279
708
|
watch(open, (isOpen) => {
|
|
280
709
|
emit("dropdownVisibleChange", isOpen);
|
|
710
|
+
if (isOpen) {
|
|
711
|
+
virtualStart.value = 0;
|
|
712
|
+
syncPanelTheme();
|
|
713
|
+
syncHighlight();
|
|
714
|
+
attachOverlay();
|
|
715
|
+
nextTick(() => {
|
|
716
|
+
requestPlace();
|
|
717
|
+
if (isSearchable.value) searchInputRef.value?.focus();
|
|
718
|
+
else scrollHighlightIntoView();
|
|
719
|
+
});
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
detachOverlay();
|
|
723
|
+
});
|
|
724
|
+
watch(listRows, () => {
|
|
725
|
+
if (!open.value) return;
|
|
726
|
+
syncHighlight();
|
|
727
|
+
requestPlace();
|
|
281
728
|
});
|
|
282
729
|
onMounted(() => {
|
|
283
|
-
if (
|
|
284
|
-
const el = anchorRef.value;
|
|
285
|
-
const node = el instanceof HTMLElement ? el : el?.$el;
|
|
286
|
-
((node instanceof HTMLElement ? node : void 0)?.querySelector?.(".rs-select__trigger"))?.focus();
|
|
730
|
+
if (props.autoFocus) triggerRef.value?.focus();
|
|
287
731
|
});
|
|
288
732
|
const responsiveTagCap = ref(null);
|
|
289
733
|
let tagResize;
|
|
@@ -292,13 +736,11 @@ var RsSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
292
736
|
responsiveTagCap.value = null;
|
|
293
737
|
return;
|
|
294
738
|
}
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
if (!trigger) return;
|
|
299
|
-
const budget = trigger.clientWidth - 48;
|
|
739
|
+
const row = triggerRef.value?.querySelector(".rs-select__value--multiple");
|
|
740
|
+
if (!row) return;
|
|
741
|
+
const budget = row.clientWidth - 48;
|
|
300
742
|
if (budget <= 0) return;
|
|
301
|
-
const tags = Array.from(
|
|
743
|
+
const tags = Array.from(row.querySelectorAll(".rs-select__tag"));
|
|
302
744
|
if (!tags.length) {
|
|
303
745
|
responsiveTagCap.value = selectedValues.value.length;
|
|
304
746
|
return;
|
|
@@ -318,13 +760,15 @@ var RsSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
318
760
|
if (typeof ResizeObserver === "undefined") return;
|
|
319
761
|
tagResize = new ResizeObserver(() => measureResponsiveTags());
|
|
320
762
|
nextTick(() => {
|
|
321
|
-
|
|
322
|
-
const node = el instanceof HTMLElement ? el : el?.$el;
|
|
323
|
-
if (node instanceof HTMLElement) tagResize?.observe(node);
|
|
763
|
+
if (triggerRef.value) tagResize?.observe(triggerRef.value);
|
|
324
764
|
measureResponsiveTags();
|
|
325
765
|
});
|
|
326
766
|
});
|
|
327
|
-
onUnmounted(() =>
|
|
767
|
+
onUnmounted(() => {
|
|
768
|
+
tagResize?.disconnect();
|
|
769
|
+
if (typeaheadTimer) clearTimeout(typeaheadTimer);
|
|
770
|
+
detachOverlay();
|
|
771
|
+
});
|
|
328
772
|
watch(() => [
|
|
329
773
|
selectedValues.value.join("\0"),
|
|
330
774
|
props.maxTagCount,
|
|
@@ -338,12 +782,19 @@ var RsSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
338
782
|
function highlightParts(label) {
|
|
339
783
|
return splitSelectLabelHighlight(label, isSearchable.value ? searchQuery.value : "");
|
|
340
784
|
}
|
|
785
|
+
const contentStyle = computed(() => ({
|
|
786
|
+
position: "fixed",
|
|
787
|
+
top: `${popup.value.top}px`,
|
|
788
|
+
left: `${popup.value.left}px`,
|
|
789
|
+
"--rs-select-list-height": `${props.listHeight}px`,
|
|
790
|
+
"--rs-select-trigger-width": `${popup.value.minWidth || popup.value.width}px`,
|
|
791
|
+
...props.matchTriggerWidth ? { width: `${popup.value.width}px` } : {},
|
|
792
|
+
...props.dropdownStyle
|
|
793
|
+
}));
|
|
341
794
|
return (_ctx, _cache) => {
|
|
342
|
-
return openBlock(),
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
open: open.value,
|
|
346
|
-
"onUpdate:open": _cache[10] || (_cache[10] = ($event) => open.value = $event),
|
|
795
|
+
return openBlock(), createElementBlock("div", {
|
|
796
|
+
ref_key: "rootRef",
|
|
797
|
+
ref: rootRef,
|
|
347
798
|
class: normalizeClass(["rs-select", {
|
|
348
799
|
"rs-select--multiple": unref(isMultiple),
|
|
349
800
|
"rs-select--searchable": unref(isSearchable),
|
|
@@ -352,269 +803,233 @@ var RsSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
352
803
|
[`rs-select--${unref(resolvedSize)}`]: true,
|
|
353
804
|
[`rs-select--${__props.variant}`]: true
|
|
354
805
|
}]),
|
|
355
|
-
style: normalizeStyle(rootStyle.value)
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
806
|
+
style: normalizeStyle(rootStyle.value)
|
|
807
|
+
}, [
|
|
808
|
+
__props.name ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [unref(isMultiple) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(selectedValues), (token) => {
|
|
809
|
+
return openBlock(), createElementBlock("input", {
|
|
810
|
+
key: token,
|
|
811
|
+
type: "hidden",
|
|
812
|
+
name: __props.name,
|
|
813
|
+
value: String(unref(restoreTokenValue)(token))
|
|
814
|
+
}, null, 8, _hoisted_1);
|
|
815
|
+
}), 128)) : (openBlock(), createElementBlock("input", {
|
|
816
|
+
key: 1,
|
|
817
|
+
type: "hidden",
|
|
818
|
+
name: __props.name,
|
|
819
|
+
value: unref(hasValue) ? String(unref(restoreTokenValue)(unref(selectedValues)[0])) : ""
|
|
820
|
+
}, null, 8, _hoisted_2))], 64)) : createCommentVNode("", true),
|
|
821
|
+
createElementVNode("button", mergeProps({
|
|
822
|
+
ref_key: "triggerRef",
|
|
823
|
+
ref: triggerRef
|
|
824
|
+
}, unref(attrs), {
|
|
825
|
+
id: __props.id,
|
|
826
|
+
type: "button",
|
|
827
|
+
class: ["rs-select__trigger", [__props.classNames?.trigger, {
|
|
828
|
+
"rs-select__trigger--invalid": isInvalid.value,
|
|
829
|
+
"rs-select__trigger--warning": isWarning.value
|
|
830
|
+
}]],
|
|
831
|
+
role: "combobox",
|
|
832
|
+
"aria-haspopup": "listbox",
|
|
833
|
+
"aria-expanded": open.value ? "true" : "false",
|
|
834
|
+
"aria-controls": open.value ? unref(listId) : void 0,
|
|
835
|
+
"aria-activedescendant": activeOptionId.value,
|
|
836
|
+
"aria-invalid": isInvalid.value || void 0,
|
|
837
|
+
"aria-disabled": resolvedDisabled.value ? "true" : void 0,
|
|
838
|
+
disabled: resolvedDisabled.value,
|
|
839
|
+
"data-disabled": resolvedDisabled.value ? "" : void 0,
|
|
840
|
+
"data-state": open.value ? "open" : "closed",
|
|
841
|
+
onClick: toggleOpen,
|
|
842
|
+
onKeydown: onTriggerKeydown,
|
|
843
|
+
onFocus: _cache[3] || (_cache[3] = ($event) => emit("focus", $event)),
|
|
844
|
+
onBlur: _cache[4] || (_cache[4] = ($event) => emit("blur", $event))
|
|
845
|
+
}), [
|
|
846
|
+
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_4, [renderSlot(_ctx.$slots, "prefix", {}, void 0, true)])) : createCommentVNode("", true),
|
|
847
|
+
unref(isMultiple) ? (openBlock(), createElementBlock("span", _hoisted_5, [unref(hasValue) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [(openBlock(true), createElementBlock(Fragment, null, renderList(shownTagTokens.value, (value) => {
|
|
848
|
+
return openBlock(), createElementBlock("span", {
|
|
849
|
+
key: value,
|
|
850
|
+
class: "rs-select__tag"
|
|
851
|
+
}, [renderSlot(_ctx.$slots, "tag", {
|
|
852
|
+
value: unref(restoreTokenValue)(value),
|
|
853
|
+
label: unref(tokenLabel)(value),
|
|
854
|
+
closable: true
|
|
855
|
+
}, () => [createElementVNode("span", _hoisted_6, toDisplayString(unref(truncateTagLabel)(unref(tokenLabel)(value))), 1), createElementVNode("button", {
|
|
856
|
+
type: "button",
|
|
857
|
+
class: "rs-select__tag-remove",
|
|
858
|
+
"aria-label": unref(t)("select.clear"),
|
|
859
|
+
onPointerdown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])),
|
|
860
|
+
onClick: ($event) => unref(removeTag)(value, $event)
|
|
861
|
+
}, [createVNode(RsIcon_default, {
|
|
862
|
+
name: "x",
|
|
863
|
+
size: 12
|
|
864
|
+
})], 40, _hoisted_7)], true)]);
|
|
865
|
+
}), 128)), shownOmittedCount.value > 0 ? (openBlock(), createElementBlock("span", {
|
|
866
|
+
key: 0,
|
|
867
|
+
class: "rs-select__tag rs-select__tag--rest",
|
|
868
|
+
title: unref(omittedTagTitle)
|
|
869
|
+
}, [renderSlot(_ctx.$slots, "maxTagPlaceholder", { omitted: shownOmittedCount.value }, () => [createTextVNode(toDisplayString(typeof __props.maxTagPlaceholder === "function" ? __props.maxTagPlaceholder(shownOmittedCount.value) : unref(omittedTagLabel)), 1)], true)], 8, _hoisted_8)) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(unref(resolvedPlaceholder)), 1))])) : (openBlock(), createElementBlock("span", _hoisted_10, [unref(hasValue) ? (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(unref(singleDisplayLabel)), 1)) : (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(unref(resolvedPlaceholder)), 1))])),
|
|
870
|
+
createElementVNode("span", _hoisted_13, [__props.clearable && unref(hasValue) && !resolvedDisabled.value ? (openBlock(), createElementBlock("button", {
|
|
871
|
+
key: 0,
|
|
872
|
+
type: "button",
|
|
873
|
+
class: "rs-select__clear",
|
|
874
|
+
"aria-label": unref(t)("select.clear"),
|
|
875
|
+
onPointerdown: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
|
|
876
|
+
onClick: _cache[2] || (_cache[2] = (...args) => unref(onClear) && unref(onClear)(...args))
|
|
877
|
+
}, [renderSlot(_ctx.$slots, "clearIcon", {}, () => [createVNode(RsIcon_default, {
|
|
878
|
+
name: "x",
|
|
879
|
+
size: 14
|
|
880
|
+
})], true)], 40, _hoisted_14)) : createCommentVNode("", true), __props.showArrow ? (openBlock(), createElementBlock("span", _hoisted_15, [renderSlot(_ctx.$slots, "suffixIcon", {}, () => [createVNode(RsIcon_default, {
|
|
881
|
+
name: "chevron-down",
|
|
882
|
+
size: triggerIconSize.value,
|
|
883
|
+
class: "rs-select__icon"
|
|
884
|
+
}, null, 8, ["size"])], true)])) : createCommentVNode("", true)])
|
|
885
|
+
], 16, _hoisted_3),
|
|
886
|
+
(openBlock(), createBlock(Teleport, {
|
|
887
|
+
to: portalTo.value,
|
|
888
|
+
disabled: !open.value
|
|
889
|
+
}, [open.value ? (openBlock(), createElementBlock("div", {
|
|
890
|
+
key: 0,
|
|
891
|
+
id: unref(listId),
|
|
892
|
+
ref_key: "contentRef",
|
|
893
|
+
ref: contentRef,
|
|
894
|
+
class: normalizeClass(["rs-select__content", [
|
|
895
|
+
`rs-select__content--${unref(resolvedSize)}`,
|
|
896
|
+
__props.popupClassName,
|
|
897
|
+
__props.classNames?.popup,
|
|
898
|
+
{ "rs-select__content--match-trigger": __props.matchTriggerWidth }
|
|
899
|
+
]]),
|
|
900
|
+
"data-placement": popup.value.placement,
|
|
901
|
+
"data-rs-theme": panelTheme.value,
|
|
902
|
+
style: normalizeStyle(contentStyle.value)
|
|
903
|
+
}, [renderSlot(_ctx.$slots, "dropdownRender", {}, () => [
|
|
904
|
+
_ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_17, [renderSlot(_ctx.$slots, "header", {}, void 0, true)])) : createCommentVNode("", true),
|
|
905
|
+
unref(isSearchable) ? (openBlock(), createElementBlock("div", _hoisted_18, [createElementVNode("div", _hoisted_19, [createVNode(RsIcon_default, {
|
|
906
|
+
name: "search",
|
|
907
|
+
size: 14,
|
|
908
|
+
class: "rs-select__search-icon",
|
|
909
|
+
"aria-hidden": "true"
|
|
910
|
+
}), withDirectives(createElementVNode("input", {
|
|
911
|
+
ref_key: "searchInputRef",
|
|
912
|
+
ref: searchInputRef,
|
|
913
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => searchQuery.value = $event),
|
|
914
|
+
type: "text",
|
|
915
|
+
class: "rs-select__search",
|
|
916
|
+
placeholder: unref(resolvedSearchPlaceholder),
|
|
917
|
+
"aria-label": unref(resolvedSearchPlaceholder),
|
|
918
|
+
autocomplete: "off",
|
|
919
|
+
role: "searchbox",
|
|
920
|
+
"aria-controls": unref(listId),
|
|
921
|
+
"aria-activedescendant": activeOptionId.value,
|
|
922
|
+
onKeydown: onPanelSearchKeydown
|
|
923
|
+
}, null, 40, _hoisted_20), [[vModelText, searchQuery.value]])])])) : createCommentVNode("", true),
|
|
924
|
+
__props.loading ? (openBlock(), createElementBlock("div", _hoisted_21, [renderSlot(_ctx.$slots, "loading", {}, () => [createTextVNode(toDisplayString(unref(resolvedLoadingText)), 1)], true)])) : emptyVisible.value ? (openBlock(), createElementBlock("div", _hoisted_22, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref(resolvedEmptyText)), 1)], true)])) : createCommentVNode("", true),
|
|
925
|
+
!__props.loading ? (openBlock(), createElementBlock("div", {
|
|
926
|
+
key: 4,
|
|
927
|
+
ref_key: "viewportRef",
|
|
928
|
+
ref: viewportRef,
|
|
929
|
+
class: "rs-select__viewport",
|
|
930
|
+
role: "listbox",
|
|
931
|
+
"aria-multiselectable": unref(isMultiple) ? "true" : void 0,
|
|
932
|
+
"aria-label": unref(t)("select.listbox"),
|
|
933
|
+
onScroll: onViewportScroll,
|
|
934
|
+
onPointerover: onViewportPointerOver
|
|
935
|
+
}, [unref(useVirtual) ? (openBlock(), createElementBlock("div", {
|
|
936
|
+
key: 0,
|
|
937
|
+
class: "rs-select__virtual",
|
|
938
|
+
style: normalizeStyle({ height: `${virtualSlice.value.totalH}px` })
|
|
939
|
+
}, [createElementVNode("div", { style: normalizeStyle({
|
|
940
|
+
transform: `translateY(${virtualSlice.value.padTop}px)`,
|
|
941
|
+
paddingBottom: `${virtualSlice.value.padBottom}px`
|
|
942
|
+
}) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(virtualSlice.value.items, (token) => {
|
|
943
|
+
return openBlock(), createElementBlock("div", {
|
|
944
|
+
id: `${unref(listId)}-${token}`,
|
|
945
|
+
key: token,
|
|
946
|
+
role: "option",
|
|
947
|
+
class: normalizeClass(["rs-select__item", { "rs-select__item--create": unref(canCreate) && token === unref(createValue) }]),
|
|
948
|
+
"data-value": token,
|
|
949
|
+
"data-highlighted": highlightedToken.value === token ? "" : void 0,
|
|
950
|
+
"data-state": itemState(token),
|
|
951
|
+
"data-disabled": unref(isTokenDisabled)(token) ? "" : void 0,
|
|
952
|
+
"aria-selected": unref(selectedValues).includes(token) ? "true" : "false",
|
|
953
|
+
"aria-disabled": unref(isTokenDisabled)(token) ? "true" : void 0,
|
|
954
|
+
title: unref(optionFromToken)(token)?.title,
|
|
955
|
+
onClick: ($event) => unref(pickToken)(token)
|
|
956
|
+
}, [createElementVNode("span", _hoisted_25, [renderSlot(_ctx.$slots, "option", {
|
|
957
|
+
option: unref(optionOrCreate)(token),
|
|
958
|
+
selected: unref(selectedValues).includes(token)
|
|
959
|
+
}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(highlightParts(unref(canCreate) && token === unref(createValue) ? unref(createOptionLabel) : unref(labelMap).get(token) ?? String(token)), (part, i) => {
|
|
960
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [part.highlight ? (openBlock(), createElementBlock("mark", _hoisted_26, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
961
|
+
}), 128))], true)]), unref(selectedValues).includes(token) ? (openBlock(), createElementBlock("span", _hoisted_27, [createVNode(RsIcon_default, {
|
|
962
|
+
name: "check",
|
|
963
|
+
size: 14
|
|
964
|
+
})])) : createCommentVNode("", true)], 10, _hoisted_24);
|
|
965
|
+
}), 128))], 4)], 4)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [unref(canCreate) ? (openBlock(), createElementBlock("div", {
|
|
966
|
+
key: 0,
|
|
967
|
+
id: `${unref(listId)}-${unref(createValue)}`,
|
|
968
|
+
role: "option",
|
|
969
|
+
class: "rs-select__item rs-select__item--create",
|
|
970
|
+
"data-value": unref(createValue),
|
|
971
|
+
"data-highlighted": highlightedToken.value === unref(createValue) ? "" : void 0,
|
|
972
|
+
"data-state": itemState(unref(createValue)),
|
|
973
|
+
"aria-selected": unref(selectedValues).includes(unref(createValue)) ? "true" : "false",
|
|
974
|
+
onClick: _cache[6] || (_cache[6] = ($event) => unref(pickToken)(unref(createValue)))
|
|
975
|
+
}, [createElementVNode("span", _hoisted_29, toDisplayString(unref(createOptionLabel)), 1), unref(selectedValues).includes(unref(createValue)) ? (openBlock(), createElementBlock("span", _hoisted_30, [createVNode(RsIcon_default, {
|
|
976
|
+
name: "check",
|
|
977
|
+
size: 14
|
|
978
|
+
})])) : createCommentVNode("", true)], 8, _hoisted_28)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(displayOptions), (entry, index) => {
|
|
979
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [unref(isSelectOptionGroup)(entry) ? (openBlock(), createElementBlock("div", {
|
|
980
|
+
key: 0,
|
|
981
|
+
class: "rs-select__group",
|
|
982
|
+
role: "group",
|
|
983
|
+
"aria-label": entry.label
|
|
984
|
+
}, [createElementVNode("div", _hoisted_32, toDisplayString(entry.label), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(entry.options, (opt) => {
|
|
985
|
+
return openBlock(), createElementBlock("div", {
|
|
986
|
+
id: `${unref(listId)}-${unref(toComboboxValue)(opt.value)}`,
|
|
987
|
+
key: unref(toComboboxValue)(opt.value),
|
|
988
|
+
role: "option",
|
|
989
|
+
class: "rs-select__item",
|
|
990
|
+
"data-value": unref(toComboboxValue)(opt.value),
|
|
991
|
+
"data-highlighted": highlightedToken.value === unref(toComboboxValue)(opt.value) ? "" : void 0,
|
|
992
|
+
"data-state": itemState(unref(toComboboxValue)(opt.value)),
|
|
993
|
+
"data-disabled": opt.disabled || unref(isOptionLimited)(opt) ? "" : void 0,
|
|
994
|
+
"aria-selected": unref(selectedValues).includes(unref(toComboboxValue)(opt.value)) ? "true" : "false",
|
|
995
|
+
"aria-disabled": opt.disabled || unref(isOptionLimited)(opt) ? "true" : void 0,
|
|
996
|
+
title: opt.title,
|
|
997
|
+
onClick: ($event) => unref(pickToken)(unref(toComboboxValue)(opt.value))
|
|
998
|
+
}, [createElementVNode("span", _hoisted_34, [renderSlot(_ctx.$slots, "option", {
|
|
999
|
+
option: opt,
|
|
1000
|
+
selected: unref(selectedValues).includes(unref(toComboboxValue)(opt.value))
|
|
1001
|
+
}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(highlightParts(opt.label), (part, i) => {
|
|
1002
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [part.highlight ? (openBlock(), createElementBlock("mark", _hoisted_35, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
1003
|
+
}), 128))], true)]), unref(selectedValues).includes(unref(toComboboxValue)(opt.value)) ? (openBlock(), createElementBlock("span", _hoisted_36, [createVNode(RsIcon_default, {
|
|
1004
|
+
name: "check",
|
|
411
1005
|
size: 14
|
|
412
|
-
})]
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
"side-offset": 4,
|
|
440
|
-
position: "popper"
|
|
441
|
-
}, {
|
|
442
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "dropdownRender", {}, () => [
|
|
443
|
-
_ctx.$slots.header ? (openBlock(), createElementBlock("div", {
|
|
444
|
-
key: 0,
|
|
445
|
-
class: "rs-select__panel-header",
|
|
446
|
-
onMousedown: _cache[5] || (_cache[5] = withModifiers(() => {}, ["prevent"]))
|
|
447
|
-
}, [renderSlot(_ctx.$slots, "header", {}, void 0, true)], 32)) : createCommentVNode("", true),
|
|
448
|
-
unref(isSearchable) ? (openBlock(), createElementBlock("div", _hoisted_13, [createElementVNode("div", _hoisted_14, [createVNode(RsIcon_default, {
|
|
449
|
-
name: "search",
|
|
450
|
-
size: 14,
|
|
451
|
-
class: "rs-select__search-icon",
|
|
452
|
-
"aria-hidden": "true"
|
|
453
|
-
}), createVNode(unref(ComboboxInput), {
|
|
454
|
-
modelValue: searchQuery.value,
|
|
455
|
-
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => searchQuery.value = $event),
|
|
456
|
-
class: "rs-select__search",
|
|
457
|
-
placeholder: unref(resolvedSearchPlaceholder),
|
|
458
|
-
"auto-focus": "",
|
|
459
|
-
onKeydown: unref(onSearchKeydown)
|
|
460
|
-
}, null, 8, [
|
|
461
|
-
"modelValue",
|
|
462
|
-
"placeholder",
|
|
463
|
-
"onKeydown"
|
|
464
|
-
])])])) : createCommentVNode("", true),
|
|
465
|
-
__props.loading ? (openBlock(), createElementBlock("div", _hoisted_15, [renderSlot(_ctx.$slots, "loading", {}, () => [createTextVNode(toDisplayString(unref(resolvedLoadingText)), 1)], true)])) : createCommentVNode("", true),
|
|
466
|
-
!__props.loading && !unref(canCreate) ? (openBlock(), createBlock(unref(ComboboxEmpty), {
|
|
467
|
-
key: 3,
|
|
468
|
-
class: "rs-select__empty"
|
|
469
|
-
}, {
|
|
470
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref(resolvedEmptyText)), 1)], true)]),
|
|
471
|
-
_: 3
|
|
472
|
-
})) : createCommentVNode("", true),
|
|
473
|
-
createVNode(unref(ComboboxViewport), {
|
|
474
|
-
class: "rs-select__viewport",
|
|
475
|
-
onScroll: _cache[7] || (_cache[7] = ($event) => emit("popupScroll", $event))
|
|
476
|
-
}, {
|
|
477
|
-
default: withCtx(() => [unref(useVirtual) ? (openBlock(), createBlock(unref(ComboboxVirtualizer), {
|
|
478
|
-
key: 0,
|
|
479
|
-
options: unref(virtualValues),
|
|
480
|
-
"text-content": (value) => unref(labelMap).get(String(value)) ?? String(value),
|
|
481
|
-
"estimate-size": 36
|
|
482
|
-
}, {
|
|
483
|
-
default: withCtx(({ option }) => [createVNode(unref(ComboboxItem), {
|
|
484
|
-
value: option,
|
|
485
|
-
disabled: unref(isTokenDisabled)(String(option)),
|
|
486
|
-
"text-value": unref(labelMap).get(String(option)) ?? String(option),
|
|
487
|
-
class: normalizeClass(["rs-select__item", { "rs-select__item--create": unref(canCreate) && String(option) === unref(createValue) }]),
|
|
488
|
-
title: unref(optionFromToken)(String(option))?.title
|
|
489
|
-
}, {
|
|
490
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_16, [renderSlot(_ctx.$slots, "option", {
|
|
491
|
-
option: unref(optionOrCreate)(String(option)),
|
|
492
|
-
selected: unref(selectedValues).includes(String(option))
|
|
493
|
-
}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(highlightParts(unref(canCreate) && String(option) === unref(createValue) ? unref(createOptionLabel) : unref(labelMap).get(String(option)) ?? String(option)), (part, i) => {
|
|
494
|
-
return openBlock(), createElementBlock(Fragment, { key: i }, [part.highlight ? (openBlock(), createElementBlock("mark", _hoisted_17, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
495
|
-
}), 128))], true)]), createVNode(unref(ComboboxItemIndicator), { class: "rs-select__item-check" }, {
|
|
496
|
-
default: withCtx(() => [createVNode(RsIcon_default, {
|
|
497
|
-
name: "check",
|
|
498
|
-
size: 14
|
|
499
|
-
})]),
|
|
500
|
-
_: 1
|
|
501
|
-
})]),
|
|
502
|
-
_: 2
|
|
503
|
-
}, 1032, [
|
|
504
|
-
"value",
|
|
505
|
-
"disabled",
|
|
506
|
-
"text-value",
|
|
507
|
-
"class",
|
|
508
|
-
"title"
|
|
509
|
-
])]),
|
|
510
|
-
_: 3
|
|
511
|
-
}, 8, ["options", "text-content"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [unref(canCreate) ? (openBlock(), createBlock(unref(ComboboxItem), {
|
|
512
|
-
key: 0,
|
|
513
|
-
value: unref(createValue),
|
|
514
|
-
"text-value": unref(createValue),
|
|
515
|
-
class: "rs-select__item rs-select__item--create"
|
|
516
|
-
}, {
|
|
517
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_18, toDisplayString(unref(createOptionLabel)), 1), createVNode(unref(ComboboxItemIndicator), { class: "rs-select__item-check" }, {
|
|
518
|
-
default: withCtx(() => [createVNode(RsIcon_default, {
|
|
519
|
-
name: "check",
|
|
520
|
-
size: 14
|
|
521
|
-
})]),
|
|
522
|
-
_: 1
|
|
523
|
-
})]),
|
|
524
|
-
_: 1
|
|
525
|
-
}, 8, ["value", "text-value"])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(displayOptions), (entry, index) => {
|
|
526
|
-
return openBlock(), createElementBlock(Fragment, { key: index }, [unref(isSelectOptionGroup)(entry) ? (openBlock(), createBlock(unref(ComboboxGroup), {
|
|
527
|
-
key: 0,
|
|
528
|
-
class: "rs-select__group"
|
|
529
|
-
}, {
|
|
530
|
-
default: withCtx(() => [createVNode(unref(ComboboxLabel), { class: "rs-select__group-label" }, {
|
|
531
|
-
default: withCtx(() => [createTextVNode(toDisplayString(entry.label), 1)]),
|
|
532
|
-
_: 2
|
|
533
|
-
}, 1024), (openBlock(true), createElementBlock(Fragment, null, renderList(entry.options, (opt) => {
|
|
534
|
-
return openBlock(), createBlock(unref(ComboboxItem), {
|
|
535
|
-
key: unref(toComboboxValue)(opt.value),
|
|
536
|
-
value: unref(toComboboxValue)(opt.value),
|
|
537
|
-
disabled: opt.disabled || unref(isOptionLimited)(opt),
|
|
538
|
-
"text-value": opt.label,
|
|
539
|
-
class: "rs-select__item",
|
|
540
|
-
title: opt.title
|
|
541
|
-
}, {
|
|
542
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_19, [renderSlot(_ctx.$slots, "option", {
|
|
543
|
-
option: opt,
|
|
544
|
-
selected: unref(selectedValues).includes(unref(toComboboxValue)(opt.value))
|
|
545
|
-
}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(highlightParts(opt.label), (part, i) => {
|
|
546
|
-
return openBlock(), createElementBlock(Fragment, { key: i }, [part.highlight ? (openBlock(), createElementBlock("mark", _hoisted_20, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
547
|
-
}), 128))], true)]), createVNode(unref(ComboboxItemIndicator), { class: "rs-select__item-check" }, {
|
|
548
|
-
default: withCtx(() => [createVNode(RsIcon_default, {
|
|
549
|
-
name: "check",
|
|
550
|
-
size: 14
|
|
551
|
-
})]),
|
|
552
|
-
_: 1
|
|
553
|
-
})]),
|
|
554
|
-
_: 2
|
|
555
|
-
}, 1032, [
|
|
556
|
-
"value",
|
|
557
|
-
"disabled",
|
|
558
|
-
"text-value",
|
|
559
|
-
"title"
|
|
560
|
-
]);
|
|
561
|
-
}), 128))]),
|
|
562
|
-
_: 2
|
|
563
|
-
}, 1024)) : (openBlock(), createBlock(unref(ComboboxItem), {
|
|
564
|
-
key: unref(toComboboxValue)(entry.value),
|
|
565
|
-
value: unref(toComboboxValue)(entry.value),
|
|
566
|
-
disabled: entry.disabled || unref(isOptionLimited)(entry),
|
|
567
|
-
"text-value": entry.label,
|
|
568
|
-
class: "rs-select__item",
|
|
569
|
-
title: entry.title
|
|
570
|
-
}, {
|
|
571
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_21, [renderSlot(_ctx.$slots, "option", {
|
|
572
|
-
option: entry,
|
|
573
|
-
selected: unref(selectedValues).includes(unref(toComboboxValue)(entry.value))
|
|
574
|
-
}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(highlightParts(entry.label), (part, i) => {
|
|
575
|
-
return openBlock(), createElementBlock(Fragment, { key: i }, [part.highlight ? (openBlock(), createElementBlock("mark", _hoisted_22, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
576
|
-
}), 128))], true)]), createVNode(unref(ComboboxItemIndicator), { class: "rs-select__item-check" }, {
|
|
577
|
-
default: withCtx(() => [createVNode(RsIcon_default, {
|
|
578
|
-
name: "check",
|
|
579
|
-
size: 14
|
|
580
|
-
})]),
|
|
581
|
-
_: 1
|
|
582
|
-
})]),
|
|
583
|
-
_: 2
|
|
584
|
-
}, 1032, [
|
|
585
|
-
"value",
|
|
586
|
-
"disabled",
|
|
587
|
-
"text-value",
|
|
588
|
-
"title"
|
|
589
|
-
]))], 64);
|
|
590
|
-
}), 128))], 64))]),
|
|
591
|
-
_: 3
|
|
592
|
-
}),
|
|
593
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
594
|
-
key: 4,
|
|
595
|
-
class: "rs-select__panel-footer",
|
|
596
|
-
onMousedown: _cache[8] || (_cache[8] = withModifiers(() => {}, ["prevent"]))
|
|
597
|
-
}, [renderSlot(_ctx.$slots, "footer", {}, void 0, true)], 32)) : createCommentVNode("", true)
|
|
598
|
-
], true)]),
|
|
599
|
-
_: 3
|
|
600
|
-
}, 8, [
|
|
601
|
-
"class",
|
|
602
|
-
"style",
|
|
603
|
-
"side"
|
|
604
|
-
])]),
|
|
605
|
-
_: 3
|
|
606
|
-
}, 8, ["to"])]),
|
|
607
|
-
_: 3
|
|
608
|
-
}, 8, [
|
|
609
|
-
"modelValue",
|
|
610
|
-
"open",
|
|
611
|
-
"class",
|
|
612
|
-
"style",
|
|
613
|
-
"multiple",
|
|
614
|
-
"disabled",
|
|
615
|
-
"ignore-filter",
|
|
616
|
-
"reset-search-term-on-select"
|
|
617
|
-
]);
|
|
1006
|
+
})])) : createCommentVNode("", true)], 8, _hoisted_33);
|
|
1007
|
+
}), 128))], 8, _hoisted_31)) : (openBlock(), createElementBlock("div", {
|
|
1008
|
+
id: `${unref(listId)}-${unref(toComboboxValue)(entry.value)}`,
|
|
1009
|
+
key: unref(toComboboxValue)(entry.value),
|
|
1010
|
+
role: "option",
|
|
1011
|
+
class: "rs-select__item",
|
|
1012
|
+
"data-value": unref(toComboboxValue)(entry.value),
|
|
1013
|
+
"data-highlighted": highlightedToken.value === unref(toComboboxValue)(entry.value) ? "" : void 0,
|
|
1014
|
+
"data-state": itemState(unref(toComboboxValue)(entry.value)),
|
|
1015
|
+
"data-disabled": entry.disabled || unref(isOptionLimited)(entry) ? "" : void 0,
|
|
1016
|
+
"aria-selected": unref(selectedValues).includes(unref(toComboboxValue)(entry.value)) ? "true" : "false",
|
|
1017
|
+
"aria-disabled": entry.disabled || unref(isOptionLimited)(entry) ? "true" : void 0,
|
|
1018
|
+
title: entry.title,
|
|
1019
|
+
onClick: ($event) => unref(pickToken)(unref(toComboboxValue)(entry.value))
|
|
1020
|
+
}, [createElementVNode("span", _hoisted_38, [renderSlot(_ctx.$slots, "option", {
|
|
1021
|
+
option: entry,
|
|
1022
|
+
selected: unref(selectedValues).includes(unref(toComboboxValue)(entry.value))
|
|
1023
|
+
}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(highlightParts(entry.label), (part, i) => {
|
|
1024
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [part.highlight ? (openBlock(), createElementBlock("mark", _hoisted_39, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
1025
|
+
}), 128))], true)]), unref(selectedValues).includes(unref(toComboboxValue)(entry.value)) ? (openBlock(), createElementBlock("span", _hoisted_40, [createVNode(RsIcon_default, {
|
|
1026
|
+
name: "check",
|
|
1027
|
+
size: 14
|
|
1028
|
+
})])) : createCommentVNode("", true)], 8, _hoisted_37))], 64);
|
|
1029
|
+
}), 128))], 64))], 40, _hoisted_23)) : createCommentVNode("", true),
|
|
1030
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_41, [renderSlot(_ctx.$slots, "footer", {}, void 0, true)])) : createCommentVNode("", true)
|
|
1031
|
+
], true)], 14, _hoisted_16)) : createCommentVNode("", true)], 8, ["to", "disabled"]))
|
|
1032
|
+
], 6);
|
|
618
1033
|
};
|
|
619
1034
|
}
|
|
620
1035
|
});
|