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,18 +1,29 @@
|
|
|
1
|
-
import { TooltipContent, TooltipPortal, TooltipRoot, TooltipTrigger } from "../../_shared/src/reka.js";
|
|
2
1
|
import { useRsI18n } from "../../../composables/useRsI18n.js";
|
|
3
2
|
import RsIcon_default from "../../icon/src/RsIcon.js";
|
|
4
|
-
import {
|
|
3
|
+
import { placeAlignedPopup, toContainerPoint } from "../../_shared/src/overlay-utils.js";
|
|
4
|
+
import { clampTooltipDelay, isKeyboardFocusVisible, rsTooltipGroupKey, tooltipCssLength } from "./tooltip-utils.js";
|
|
5
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, inject, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, toDisplayString, useId, useSlots, watch } from "vue";
|
|
5
6
|
//#region src/components/tooltip/src/RsTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
6
7
|
var _hoisted_1 = {
|
|
7
8
|
key: 0,
|
|
8
|
-
class: "rs-
|
|
9
|
+
class: "rs-tooltip__label"
|
|
9
10
|
};
|
|
10
|
-
var _hoisted_2 =
|
|
11
|
+
var _hoisted_2 = ["aria-label"];
|
|
12
|
+
var _hoisted_3 = [
|
|
13
|
+
"id",
|
|
14
|
+
"data-side",
|
|
15
|
+
"data-align",
|
|
16
|
+
"data-ready",
|
|
17
|
+
"data-rs-theme",
|
|
18
|
+
"dir"
|
|
19
|
+
];
|
|
20
|
+
var _hoisted_4 = {
|
|
11
21
|
key: 0,
|
|
12
|
-
class: "rs-
|
|
22
|
+
class: "rs-tooltip__arrow",
|
|
23
|
+
"aria-hidden": "true"
|
|
13
24
|
};
|
|
14
|
-
var _hoisted_3 = ["aria-label"];
|
|
15
25
|
var RsTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
26
|
+
name: "RsTooltip",
|
|
16
27
|
__name: "RsTooltip",
|
|
17
28
|
props: {
|
|
18
29
|
content: {},
|
|
@@ -23,10 +34,7 @@ var RsTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
23
34
|
type: Boolean,
|
|
24
35
|
default: false
|
|
25
36
|
},
|
|
26
|
-
ignoreNonKeyboardFocus: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: true
|
|
29
|
-
},
|
|
37
|
+
ignoreNonKeyboardFocus: { type: Boolean },
|
|
30
38
|
nowrap: {
|
|
31
39
|
type: Boolean,
|
|
32
40
|
default: false
|
|
@@ -36,54 +44,415 @@ var RsTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
36
44
|
default: false
|
|
37
45
|
},
|
|
38
46
|
iconName: { default: "info" },
|
|
39
|
-
ariaLabel: {}
|
|
47
|
+
ariaLabel: {},
|
|
48
|
+
open: { type: Boolean },
|
|
49
|
+
delayDuration: {},
|
|
50
|
+
interactive: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
54
|
+
arrow: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
maxWidth: {},
|
|
59
|
+
getContainer: {},
|
|
60
|
+
id: {}
|
|
40
61
|
},
|
|
41
|
-
|
|
62
|
+
emits: ["update:open", "openChange"],
|
|
63
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
42
64
|
const props = __props;
|
|
65
|
+
const emit = __emit;
|
|
66
|
+
const instance = getCurrentInstance();
|
|
43
67
|
const slots = useSlots();
|
|
44
68
|
const { t } = useRsI18n();
|
|
69
|
+
const group = inject(rsTooltipGroupKey, null);
|
|
70
|
+
const autoId = useId();
|
|
71
|
+
const rootRef = ref(null);
|
|
72
|
+
const triggerRef = ref(null);
|
|
73
|
+
const contentRef = ref(null);
|
|
74
|
+
const innerOpen = ref(false);
|
|
75
|
+
const positioned = ref(false);
|
|
76
|
+
const placedSide = ref(props.side);
|
|
77
|
+
const popupStyle = ref({});
|
|
78
|
+
const popupTheme = ref("");
|
|
79
|
+
const popupDir = ref("ltr");
|
|
80
|
+
/** 布尔 prop 未传时运行时是 false,不能用 undefined 判断受控。看 vnode 上有没有这次传入。 */
|
|
81
|
+
function passedProp(name) {
|
|
82
|
+
const raw = instance?.vnode.props;
|
|
83
|
+
if (!raw) return false;
|
|
84
|
+
if (Object.prototype.hasOwnProperty.call(raw, name)) return true;
|
|
85
|
+
const kebab = name.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
|
|
86
|
+
return Object.prototype.hasOwnProperty.call(raw, kebab);
|
|
87
|
+
}
|
|
88
|
+
const isControlled = computed(() => {
|
|
89
|
+
props.open;
|
|
90
|
+
return passedProp("open") || passedProp("onUpdate:open");
|
|
91
|
+
});
|
|
92
|
+
const visible = computed(() => isControlled.value ? Boolean(props.open) : innerOpen.value);
|
|
45
93
|
const hasLabelSlot = computed(() => Boolean(slots.default));
|
|
94
|
+
const hasBody = computed(() => Boolean(props.content?.trim()) || Boolean(slots.content));
|
|
95
|
+
const tipDomId = computed(() => props.id?.trim() || `rs-tooltip-${autoId}`);
|
|
46
96
|
const iconAriaLabel = computed(() => props.ariaLabel?.trim() || props.content?.trim() || t("tooltip.help", "Help"));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
97
|
+
const ignoreFocus = computed(() => {
|
|
98
|
+
props.ignoreNonKeyboardFocus;
|
|
99
|
+
if (passedProp("ignoreNonKeyboardFocus")) return Boolean(props.ignoreNonKeyboardFocus);
|
|
100
|
+
return group?.ignoreNonKeyboardFocus ?? true;
|
|
101
|
+
});
|
|
102
|
+
const openDelay = computed(() => clampTooltipDelay(props.delayDuration ?? group?.delayDuration, 300));
|
|
103
|
+
const contentStyle = computed(() => {
|
|
104
|
+
const style = { ...popupStyle.value };
|
|
105
|
+
if (props.maxWidth != null && props.maxWidth !== "") style.maxWidth = tooltipCssLength(props.maxWidth);
|
|
106
|
+
return style;
|
|
107
|
+
});
|
|
108
|
+
const portalTarget = computed(() => resolvePortal() ?? "body");
|
|
109
|
+
let applied = false;
|
|
110
|
+
let followBound = false;
|
|
111
|
+
let hovering = false;
|
|
112
|
+
let boundEl = null;
|
|
113
|
+
let openTimer = null;
|
|
114
|
+
let closeTimer = null;
|
|
115
|
+
let posRaf = 0;
|
|
116
|
+
let resizeObserver = null;
|
|
117
|
+
function currentTrigger() {
|
|
118
|
+
if (props.icon) return triggerRef.value;
|
|
119
|
+
const child = rootRef.value?.firstElementChild;
|
|
120
|
+
return child instanceof HTMLElement ? child : null;
|
|
121
|
+
}
|
|
122
|
+
function clearOpenTimer() {
|
|
123
|
+
if (openTimer == null) return;
|
|
124
|
+
clearTimeout(openTimer);
|
|
125
|
+
openTimer = null;
|
|
126
|
+
}
|
|
127
|
+
function clearCloseTimer() {
|
|
128
|
+
if (closeTimer == null) return;
|
|
129
|
+
clearTimeout(closeTimer);
|
|
130
|
+
closeTimer = null;
|
|
131
|
+
}
|
|
132
|
+
function clearTimers() {
|
|
133
|
+
clearOpenTimer();
|
|
134
|
+
clearCloseTimer();
|
|
135
|
+
}
|
|
136
|
+
function cancelRaf() {
|
|
137
|
+
if (typeof window === "undefined" || !posRaf) return;
|
|
138
|
+
window.cancelAnimationFrame(posRaf);
|
|
139
|
+
posRaf = 0;
|
|
140
|
+
}
|
|
141
|
+
function readDir(el) {
|
|
142
|
+
if (typeof document === "undefined") return "ltr";
|
|
143
|
+
if (el?.closest("[dir=\"rtl\"], [data-rs-dir=\"rtl\"]")) return "rtl";
|
|
144
|
+
const root = document.documentElement;
|
|
145
|
+
if (root.dir === "rtl" || root.getAttribute("data-rs-dir") === "rtl") return "rtl";
|
|
146
|
+
return "ltr";
|
|
147
|
+
}
|
|
148
|
+
function shouldDescribe() {
|
|
149
|
+
if (!props.icon) return true;
|
|
150
|
+
const name = iconAriaLabel.value.trim();
|
|
151
|
+
const body = props.content?.trim() || "";
|
|
152
|
+
if (!body) return true;
|
|
153
|
+
return name !== body;
|
|
154
|
+
}
|
|
155
|
+
function syncDescribedBy(on) {
|
|
156
|
+
const el = currentTrigger();
|
|
157
|
+
if (!el) return;
|
|
158
|
+
const id = tipDomId.value;
|
|
159
|
+
const parts = (el.getAttribute("aria-describedby") || "").split(/\s+/).filter((part) => part && part !== id);
|
|
160
|
+
if (on && shouldDescribe()) parts.push(id);
|
|
161
|
+
if (parts.length) el.setAttribute("aria-describedby", parts.join(" "));
|
|
162
|
+
else el.removeAttribute("aria-describedby");
|
|
163
|
+
}
|
|
164
|
+
function resolvePortal() {
|
|
165
|
+
if (typeof document === "undefined") return null;
|
|
166
|
+
try {
|
|
167
|
+
return props.getContainer?.() ?? null;
|
|
168
|
+
} catch {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function updatePosition() {
|
|
173
|
+
if (typeof window === "undefined" || !applied) return;
|
|
174
|
+
const trigger = currentTrigger();
|
|
175
|
+
const popup = contentRef.value;
|
|
176
|
+
if (!trigger || !popup) return;
|
|
177
|
+
const anchor = trigger.getBoundingClientRect();
|
|
178
|
+
const size = popup.getBoundingClientRect();
|
|
179
|
+
const rtl = readDir(trigger) === "rtl";
|
|
180
|
+
const box = placeAlignedPopup({
|
|
181
|
+
top: anchor.top,
|
|
182
|
+
left: anchor.left,
|
|
183
|
+
width: anchor.width,
|
|
184
|
+
height: anchor.height
|
|
51
185
|
}, {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
186
|
+
width: size.width,
|
|
187
|
+
height: size.height
|
|
188
|
+
}, {
|
|
189
|
+
width: window.innerWidth,
|
|
190
|
+
height: window.innerHeight
|
|
191
|
+
}, {
|
|
192
|
+
side: props.side,
|
|
193
|
+
align: props.align,
|
|
194
|
+
sideOffset: props.sideOffset,
|
|
195
|
+
padding: 8,
|
|
196
|
+
rtl
|
|
197
|
+
});
|
|
198
|
+
const container = popup.parentElement;
|
|
199
|
+
const origin = container && container !== document.body && container !== document.documentElement ? {
|
|
200
|
+
top: container.getBoundingClientRect().top,
|
|
201
|
+
left: container.getBoundingClientRect().left
|
|
202
|
+
} : null;
|
|
203
|
+
const point = toContainerPoint(Math.round(box.top), Math.round(box.left), origin);
|
|
204
|
+
popupTheme.value = trigger.closest("[data-rs-theme]")?.getAttribute("data-rs-theme") || "";
|
|
205
|
+
popupDir.value = rtl ? "rtl" : "ltr";
|
|
206
|
+
const top = `${point.top}px`;
|
|
207
|
+
const left = `${point.left}px`;
|
|
208
|
+
if (positioned.value && popupStyle.value.top === top && popupStyle.value.left === left && placedSide.value === box.side) return;
|
|
209
|
+
placedSide.value = box.side;
|
|
210
|
+
popupStyle.value = {
|
|
211
|
+
top,
|
|
212
|
+
left
|
|
213
|
+
};
|
|
214
|
+
positioned.value = true;
|
|
215
|
+
}
|
|
216
|
+
function schedulePosition() {
|
|
217
|
+
if (typeof window === "undefined" || posRaf || !applied) return;
|
|
218
|
+
posRaf = window.requestAnimationFrame(() => {
|
|
219
|
+
posRaf = 0;
|
|
220
|
+
if (applied) updatePosition();
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
function observeContent() {
|
|
224
|
+
resizeObserver?.disconnect();
|
|
225
|
+
resizeObserver = null;
|
|
226
|
+
const el = contentRef.value;
|
|
227
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
228
|
+
resizeObserver = new ResizeObserver(() => schedulePosition());
|
|
229
|
+
resizeObserver.observe(el);
|
|
230
|
+
}
|
|
231
|
+
function bindFollow(on) {
|
|
232
|
+
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
233
|
+
if (on === followBound) return;
|
|
234
|
+
followBound = on;
|
|
235
|
+
const passiveCapture = {
|
|
236
|
+
capture: true,
|
|
237
|
+
passive: true
|
|
238
|
+
};
|
|
239
|
+
if (on) {
|
|
240
|
+
window.addEventListener("scroll", schedulePosition, passiveCapture);
|
|
241
|
+
window.addEventListener("resize", schedulePosition, passiveCapture);
|
|
242
|
+
window.addEventListener("keydown", onDocKeydown, true);
|
|
243
|
+
document.addEventListener("pointerdown", onDocPointerDown, true);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
window.removeEventListener("scroll", schedulePosition, passiveCapture);
|
|
247
|
+
window.removeEventListener("resize", schedulePosition, passiveCapture);
|
|
248
|
+
window.removeEventListener("keydown", onDocKeydown, true);
|
|
249
|
+
document.removeEventListener("pointerdown", onDocPointerDown, true);
|
|
250
|
+
cancelRaf();
|
|
251
|
+
resizeObserver?.disconnect();
|
|
252
|
+
resizeObserver = null;
|
|
253
|
+
}
|
|
254
|
+
function syncSideEffects(next) {
|
|
255
|
+
if (applied === next) return;
|
|
256
|
+
applied = next;
|
|
257
|
+
if (next) {
|
|
258
|
+
placedSide.value = props.side;
|
|
259
|
+
group?.notifyOpen();
|
|
260
|
+
bindFollow(true);
|
|
261
|
+
nextTick(() => {
|
|
262
|
+
if (!applied) return;
|
|
263
|
+
syncDescribedBy(true);
|
|
264
|
+
updatePosition();
|
|
265
|
+
observeContent();
|
|
266
|
+
});
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
group?.notifyClose();
|
|
270
|
+
syncDescribedBy(false);
|
|
271
|
+
positioned.value = false;
|
|
272
|
+
bindFollow(false);
|
|
273
|
+
}
|
|
274
|
+
function requestOpen(next) {
|
|
275
|
+
if (next && (props.disabled || !hasBody.value)) return;
|
|
276
|
+
if (visible.value === next) return;
|
|
277
|
+
if (!isControlled.value) innerOpen.value = next;
|
|
278
|
+
emit("update:open", next);
|
|
279
|
+
emit("openChange", next);
|
|
280
|
+
}
|
|
281
|
+
function scheduleOpen() {
|
|
282
|
+
clearCloseTimer();
|
|
283
|
+
if (props.disabled || !hasBody.value || visible.value) return;
|
|
284
|
+
clearOpenTimer();
|
|
285
|
+
const delay = group?.shouldSkipDelay() ? 0 : openDelay.value;
|
|
286
|
+
openTimer = setTimeout(() => {
|
|
287
|
+
openTimer = null;
|
|
288
|
+
requestOpen(true);
|
|
289
|
+
}, delay);
|
|
290
|
+
}
|
|
291
|
+
function scheduleClose() {
|
|
292
|
+
clearOpenTimer();
|
|
293
|
+
if (!visible.value) return;
|
|
294
|
+
clearCloseTimer();
|
|
295
|
+
const grace = props.interactive ? 120 : 0;
|
|
296
|
+
if (grace <= 0) {
|
|
297
|
+
requestOpen(false);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
closeTimer = setTimeout(() => {
|
|
301
|
+
closeTimer = null;
|
|
302
|
+
requestOpen(false);
|
|
303
|
+
}, grace);
|
|
304
|
+
}
|
|
305
|
+
function closeNow() {
|
|
306
|
+
clearTimers();
|
|
307
|
+
hovering = false;
|
|
308
|
+
requestOpen(false);
|
|
309
|
+
}
|
|
310
|
+
function onPointerEnter(event) {
|
|
311
|
+
if (event.pointerType === "touch") return;
|
|
312
|
+
hovering = true;
|
|
313
|
+
scheduleOpen();
|
|
314
|
+
}
|
|
315
|
+
function onPointerMove(event) {
|
|
316
|
+
if (event.pointerType === "touch") return;
|
|
317
|
+
if (hovering) return;
|
|
318
|
+
hovering = true;
|
|
319
|
+
scheduleOpen();
|
|
320
|
+
}
|
|
321
|
+
function onPointerLeave(event) {
|
|
322
|
+
if (event.pointerType === "touch") return;
|
|
323
|
+
hovering = false;
|
|
324
|
+
scheduleClose();
|
|
325
|
+
}
|
|
326
|
+
function onPointerDown(event) {
|
|
327
|
+
if (event.pointerType !== "touch") return;
|
|
328
|
+
if (visible.value) closeNow();
|
|
329
|
+
else scheduleOpen();
|
|
330
|
+
}
|
|
331
|
+
function onFocus(event) {
|
|
332
|
+
if (!isKeyboardFocusVisible(event.target instanceof Element ? event.target : event.currentTarget, ignoreFocus.value)) return;
|
|
333
|
+
scheduleOpen();
|
|
334
|
+
}
|
|
335
|
+
function onBlur() {
|
|
336
|
+
hovering = false;
|
|
337
|
+
scheduleClose();
|
|
338
|
+
}
|
|
339
|
+
function onContentEnter() {
|
|
340
|
+
if (!props.interactive) return;
|
|
341
|
+
clearCloseTimer();
|
|
342
|
+
}
|
|
343
|
+
function onContentLeave() {
|
|
344
|
+
if (!props.interactive) return;
|
|
345
|
+
scheduleClose();
|
|
346
|
+
}
|
|
347
|
+
function onDocKeydown(event) {
|
|
348
|
+
if (event.key !== "Escape" || !applied) return;
|
|
349
|
+
event.preventDefault();
|
|
350
|
+
event.stopPropagation();
|
|
351
|
+
closeNow();
|
|
352
|
+
}
|
|
353
|
+
function onDocPointerDown(event) {
|
|
354
|
+
const target = event.target;
|
|
355
|
+
if (!(target instanceof Node)) return;
|
|
356
|
+
if (currentTrigger()?.contains(target)) return;
|
|
357
|
+
if (contentRef.value?.contains(target)) return;
|
|
358
|
+
closeNow();
|
|
359
|
+
}
|
|
360
|
+
function unbindTrigger() {
|
|
361
|
+
if (!boundEl) return;
|
|
362
|
+
boundEl.removeEventListener("pointerenter", onPointerEnter);
|
|
363
|
+
boundEl.removeEventListener("pointermove", onPointerMove);
|
|
364
|
+
boundEl.removeEventListener("pointerleave", onPointerLeave);
|
|
365
|
+
boundEl.removeEventListener("pointerdown", onPointerDown);
|
|
366
|
+
boundEl.removeEventListener("focus", onFocus);
|
|
367
|
+
boundEl.removeEventListener("blur", onBlur);
|
|
368
|
+
boundEl = null;
|
|
369
|
+
}
|
|
370
|
+
function bindTrigger(el) {
|
|
371
|
+
if (boundEl === el) return;
|
|
372
|
+
unbindTrigger();
|
|
373
|
+
if (!el) return;
|
|
374
|
+
boundEl = el;
|
|
375
|
+
el.addEventListener("pointerenter", onPointerEnter);
|
|
376
|
+
el.addEventListener("pointermove", onPointerMove);
|
|
377
|
+
el.addEventListener("pointerleave", onPointerLeave);
|
|
378
|
+
el.addEventListener("pointerdown", onPointerDown);
|
|
379
|
+
el.addEventListener("focus", onFocus);
|
|
380
|
+
el.addEventListener("blur", onBlur);
|
|
381
|
+
}
|
|
382
|
+
function syncTriggerBinding() {
|
|
383
|
+
bindTrigger(currentTrigger());
|
|
384
|
+
}
|
|
385
|
+
watch(visible, (next) => syncSideEffects(next), { immediate: true });
|
|
386
|
+
watch(() => props.disabled || !hasBody.value, (blocked) => {
|
|
387
|
+
if (!blocked) return;
|
|
388
|
+
clearTimers();
|
|
389
|
+
requestOpen(false);
|
|
390
|
+
});
|
|
391
|
+
watch(() => [
|
|
392
|
+
props.side,
|
|
393
|
+
props.align,
|
|
394
|
+
props.sideOffset
|
|
395
|
+
], () => {
|
|
396
|
+
if (applied) schedulePosition();
|
|
397
|
+
});
|
|
398
|
+
onMounted(syncTriggerBinding);
|
|
399
|
+
onUpdated(syncTriggerBinding);
|
|
400
|
+
onBeforeUnmount(() => {
|
|
401
|
+
clearTimers();
|
|
402
|
+
unbindTrigger();
|
|
403
|
+
if (applied) {
|
|
404
|
+
applied = false;
|
|
405
|
+
group?.notifyClose();
|
|
406
|
+
syncDescribedBy(false);
|
|
407
|
+
bindFollow(false);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
__expose({
|
|
411
|
+
open: () => {
|
|
412
|
+
clearTimers();
|
|
413
|
+
requestOpen(true);
|
|
414
|
+
},
|
|
415
|
+
close: () => closeNow()
|
|
416
|
+
});
|
|
417
|
+
return (_ctx, _cache) => {
|
|
418
|
+
return openBlock(), createElementBlock("span", {
|
|
419
|
+
ref_key: "rootRef",
|
|
420
|
+
ref: rootRef,
|
|
421
|
+
class: normalizeClass(["rs-tooltip", {
|
|
422
|
+
"rs-tooltip--icon": __props.icon,
|
|
423
|
+
"rs-tooltip__with-icon": __props.icon
|
|
424
|
+
}])
|
|
425
|
+
}, [__props.icon ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [hasLabelSlot.value ? (openBlock(), createElementBlock("span", _hoisted_1, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])) : createCommentVNode("", true), createElementVNode("button", {
|
|
426
|
+
ref_key: "triggerRef",
|
|
427
|
+
ref: triggerRef,
|
|
428
|
+
type: "button",
|
|
429
|
+
class: "rs-tooltip__icon-trigger",
|
|
430
|
+
"aria-label": iconAriaLabel.value
|
|
431
|
+
}, [createVNode(RsIcon_default, {
|
|
432
|
+
name: __props.iconName,
|
|
433
|
+
size: 12
|
|
434
|
+
}, null, 8, ["name"])], 8, _hoisted_2)], 64)) : renderSlot(_ctx.$slots, "default", {}, void 0, true, 1), visible.value ? (openBlock(), createBlock(Teleport, {
|
|
435
|
+
key: 2,
|
|
436
|
+
to: portalTarget.value
|
|
437
|
+
}, [createElementVNode("div", {
|
|
438
|
+
id: tipDomId.value,
|
|
439
|
+
ref_key: "contentRef",
|
|
440
|
+
ref: contentRef,
|
|
441
|
+
role: "tooltip",
|
|
442
|
+
class: normalizeClass(["rs-tooltip__content", {
|
|
443
|
+
"rs-tooltip__content--nowrap": __props.nowrap,
|
|
444
|
+
"rs-tooltip__content--arrow": __props.arrow,
|
|
445
|
+
"rs-tooltip__content--interactive": __props.interactive
|
|
446
|
+
}]),
|
|
447
|
+
"data-side": placedSide.value,
|
|
448
|
+
"data-align": __props.align,
|
|
449
|
+
"data-ready": positioned.value ? "true" : "false",
|
|
450
|
+
"data-rs-theme": popupTheme.value || void 0,
|
|
451
|
+
dir: popupDir.value,
|
|
452
|
+
style: normalizeStyle(contentStyle.value),
|
|
453
|
+
onPointerenter: onContentEnter,
|
|
454
|
+
onPointerleave: onContentLeave
|
|
455
|
+
}, [renderSlot(_ctx.$slots, "content", {}, () => [createTextVNode(toDisplayString(__props.content), 1)], true), __props.arrow ? (openBlock(), createElementBlock("span", _hoisted_4)) : createCommentVNode("", true)], 46, _hoisted_3)], 8, ["to"])) : createCommentVNode("", true)], 2);
|
|
87
456
|
};
|
|
88
457
|
}
|
|
89
458
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import './RsTooltip.css'
|
|
2
|
+
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
2
3
|
import RsTooltip_vue_vue_type_script_setup_true_lang_default from "./RsTooltip.impl.js";
|
|
3
4
|
|
|
4
5
|
//#region src/components/tooltip/src/RsTooltip.vue
|
|
5
|
-
var RsTooltip_default = RsTooltip_vue_vue_type_script_setup_true_lang_default;
|
|
6
|
+
var RsTooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(RsTooltip_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-3bb6995e"]]);
|
|
6
7
|
//#endregion
|
|
7
8
|
export { RsTooltip_default as default };
|
|
@@ -2,14 +2,14 @@ type __VLS_Props = {
|
|
|
2
2
|
delayDuration?: number;
|
|
3
3
|
skipDelayDuration?: number;
|
|
4
4
|
/**
|
|
5
|
-
* 仅键盘 focus-visible
|
|
6
|
-
*
|
|
5
|
+
* 仅键盘 :focus-visible 时因焦点打开。
|
|
6
|
+
* 单条 RsTooltip 传了同名 prop 时以单条为准。
|
|
7
7
|
*/
|
|
8
8
|
ignoreNonKeyboardFocus?: boolean;
|
|
9
9
|
};
|
|
10
|
-
declare var
|
|
10
|
+
declare var __VLS_1: {};
|
|
11
11
|
type __VLS_Slots = {} & {
|
|
12
|
-
default?: (props: typeof
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
13
|
};
|
|
14
14
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
15
15
|
ignoreNonKeyboardFocus: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { clampTooltipDelay, rsTooltipGroupKey } from "./tooltip-utils.js";
|
|
2
|
+
import { defineComponent, onUnmounted, provide, ref, renderSlot } from "vue";
|
|
3
3
|
//#region src/components/tooltip/src/RsTooltipProvider.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var RsTooltipProvider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
|
+
name: "RsTooltipProvider",
|
|
5
6
|
__name: "RsTooltipProvider",
|
|
6
7
|
props: {
|
|
7
8
|
delayDuration: { default: 300 },
|
|
@@ -12,19 +13,55 @@ var RsTooltipProvider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const warm = ref(false);
|
|
18
|
+
let openCount = 0;
|
|
19
|
+
let graceTimer = null;
|
|
20
|
+
function clearGrace() {
|
|
21
|
+
if (graceTimer == null) return;
|
|
22
|
+
clearTimeout(graceTimer);
|
|
23
|
+
graceTimer = null;
|
|
24
|
+
}
|
|
25
|
+
function notifyOpen() {
|
|
26
|
+
openCount += 1;
|
|
27
|
+
clearGrace();
|
|
28
|
+
warm.value = true;
|
|
29
|
+
}
|
|
30
|
+
function notifyClose() {
|
|
31
|
+
openCount = Math.max(0, openCount - 1);
|
|
32
|
+
if (openCount > 0) return;
|
|
33
|
+
clearGrace();
|
|
34
|
+
const wait = clampTooltipDelay(props.skipDelayDuration, 0);
|
|
35
|
+
if (wait <= 0) {
|
|
36
|
+
warm.value = false;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
graceTimer = setTimeout(() => {
|
|
40
|
+
graceTimer = null;
|
|
41
|
+
if (openCount === 0) warm.value = false;
|
|
42
|
+
}, wait);
|
|
43
|
+
}
|
|
44
|
+
provide(rsTooltipGroupKey, {
|
|
45
|
+
get delayDuration() {
|
|
46
|
+
return clampTooltipDelay(props.delayDuration, 300);
|
|
47
|
+
},
|
|
48
|
+
get skipDelayDuration() {
|
|
49
|
+
return clampTooltipDelay(props.skipDelayDuration, 0);
|
|
50
|
+
},
|
|
51
|
+
get ignoreNonKeyboardFocus() {
|
|
52
|
+
return props.ignoreNonKeyboardFocus;
|
|
53
|
+
},
|
|
54
|
+
shouldSkipDelay: () => warm.value,
|
|
55
|
+
notifyOpen,
|
|
56
|
+
notifyClose
|
|
57
|
+
});
|
|
58
|
+
onUnmounted(() => {
|
|
59
|
+
clearGrace();
|
|
60
|
+
openCount = 0;
|
|
61
|
+
warm.value = false;
|
|
62
|
+
});
|
|
15
63
|
return (_ctx, _cache) => {
|
|
16
|
-
return
|
|
17
|
-
"delay-duration": __props.delayDuration,
|
|
18
|
-
"skip-delay-duration": __props.skipDelayDuration,
|
|
19
|
-
"ignore-non-keyboard-focus": __props.ignoreNonKeyboardFocus
|
|
20
|
-
}, {
|
|
21
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
22
|
-
_: 3
|
|
23
|
-
}, 8, [
|
|
24
|
-
"delay-duration",
|
|
25
|
-
"skip-delay-duration",
|
|
26
|
-
"ignore-non-keyboard-focus"
|
|
27
|
-
]);
|
|
64
|
+
return renderSlot(_ctx.$slots, "default");
|
|
28
65
|
};
|
|
29
66
|
}
|
|
30
67
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
export declare const RS_TOOLTIP_SIDES: readonly ["top", "right", "bottom", "left"];
|
|
3
|
+
export declare const RS_TOOLTIP_ALIGNS: readonly ["start", "center", "end"];
|
|
4
|
+
export type RsTooltipSide = (typeof RS_TOOLTIP_SIDES)[number];
|
|
5
|
+
export type RsTooltipAlign = (typeof RS_TOOLTIP_ALIGNS)[number];
|
|
6
|
+
export declare const RS_TOOLTIP_DEFAULT_DELAY = 300;
|
|
7
|
+
export declare const RS_TOOLTIP_DEFAULT_SKIP_DELAY = 0;
|
|
8
|
+
export declare const RS_TOOLTIP_MAX_DELAY_MS = 60000;
|
|
9
|
+
/** 指针从触发器移到气泡的空隙。关掉 interactive 时为 0。 */
|
|
10
|
+
export declare const RS_TOOLTIP_POINTER_GRACE_MS = 120;
|
|
11
|
+
export type RsTooltipGetContainer = () => HTMLElement | null | undefined;
|
|
12
|
+
export interface RsTooltipExpose {
|
|
13
|
+
open: () => void;
|
|
14
|
+
close: () => void;
|
|
15
|
+
}
|
|
16
|
+
/** 模板 ref:expose。根在非图标模式下是 display:contents,不把 $el 当布局盒。 */
|
|
17
|
+
export type RsTooltipInstance = RsTooltipExpose;
|
|
18
|
+
export interface RsTooltipGroup {
|
|
19
|
+
readonly delayDuration: number;
|
|
20
|
+
readonly skipDelayDuration: number;
|
|
21
|
+
readonly ignoreNonKeyboardFocus: boolean;
|
|
22
|
+
shouldSkipDelay: () => boolean;
|
|
23
|
+
notifyOpen: () => void;
|
|
24
|
+
notifyClose: () => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const rsTooltipGroupKey: InjectionKey<RsTooltipGroup>;
|
|
27
|
+
export declare function clampTooltipDelay(value: number | undefined, fallback: number): number;
|
|
28
|
+
export declare function tooltipCssLength(value: number | string): string;
|
|
29
|
+
/** ignore 为 true 时只认 :focus-visible,避免对话框回焦误开。 */
|
|
30
|
+
export declare function isKeyboardFocusVisible(el: EventTarget | null, ignoreNonKeyboardFocus: boolean): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/components/tooltip/src/tooltip-utils.ts
|
|
2
|
+
var RS_TOOLTIP_MAX_DELAY_MS = 6e4;
|
|
3
|
+
var rsTooltipGroupKey = Symbol("rs-tooltip-group");
|
|
4
|
+
function clampTooltipDelay(value, fallback) {
|
|
5
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
|
|
6
|
+
return Math.min(RS_TOOLTIP_MAX_DELAY_MS, Math.max(0, value));
|
|
7
|
+
}
|
|
8
|
+
function tooltipCssLength(value) {
|
|
9
|
+
if (typeof value === "number" && Number.isFinite(value)) return `${value}px`;
|
|
10
|
+
return String(value).trim() || "0px";
|
|
11
|
+
}
|
|
12
|
+
/** ignore 为 true 时只认 :focus-visible,避免对话框回焦误开。 */
|
|
13
|
+
function isKeyboardFocusVisible(el, ignoreNonKeyboardFocus) {
|
|
14
|
+
if (!(el instanceof Element)) return false;
|
|
15
|
+
if (!ignoreNonKeyboardFocus) return true;
|
|
16
|
+
try {
|
|
17
|
+
return el.matches(":focus-visible");
|
|
18
|
+
} catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { RS_TOOLTIP_MAX_DELAY_MS, clampTooltipDelay, isKeyboardFocusVisible, rsTooltipGroupKey, tooltipCssLength };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as RsTree } from './src/RsTree.js';
|
|
2
|
-
export type { RsTreeCheckState, RsTreeDragTrigger, RsTreeDropPosition, RsTreeFieldNames, RsTreeFlatNode, RsTreeFocusMove, RsTreeNode, RsTreeNodeIndex, RsTreeSize, } from './src/tree-utils';
|
|
3
|
-
export { buildTreeNodeIndex, collectDescendantKeys, collectExpandableKeys, collectHalfCheckedKeys, defaultTreeFilterNode, filterTreeNodes, flattenTreeNodeIds, flattenVisibleTreeNodes, getTreeChildren, getTreeKey, getTreeLabel, hasTreeChildren, isTreeAncestorKey, resolveAccordionExpandedKeys, resolveTreeCheckState, resolveTreeFieldNames, resolveTreeFocusKey, resolveTreeIndent, resolveTreeRowHeight, resolveTreeVirtualEnabled, sliceVirtualTreeNodes, splitTreeLabelHighlight, shouldShowTreeCheckbox, toggleTreeCheck, } from './src/tree-utils';
|
|
2
|
+
export type { RsTreeCheckState, RsTreeDragTrigger, RsTreeDropPosition, RsTreeExpose, RsTreeFieldNames, RsTreeFlatNode, RsTreeFocusMove, RsTreeInstance, RsTreeNode, RsTreeNodeIndex, RsTreeSize, } from './src/tree-utils';
|
|
3
|
+
export { buildTreeNodeIndex, collectDescendantKeys, collectExpandableKeys, collectHalfCheckedKeys, defaultTreeFilterNode, filterTreeNodes, flattenTreeNodeIds, flattenVisibleTreeNodes, getTreeChildren, getTreeKey, getTreeLabel, hasTreeChildren, isTreeAncestorKey, resolveAccordionExpandedKeys, resolveTreeCheckState, resolveTreeFieldNames, resolveTreeFocusKey, resolveTreeIndent, resolveTreeTypeaheadKey, resolveTreeRowHeight, resolveTreeVirtualEnabled, sliceVirtualTreeNodes, splitTreeLabelHighlight, shouldShowTreeCheckbox, toggleTreeCheck, } from './src/tree-utils';
|