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,25 +1,69 @@
|
|
|
1
|
+
import { type RsLoadingBarAttach, type RsLoadingBarPosition, type RsLoadingBarTone } from './loading-bar-utils';
|
|
1
2
|
type __VLS_Props = {
|
|
2
|
-
/** 受控进度 0
|
|
3
|
+
/** 受控进度 0–100。传入后显隐只跟这个值,命令式 API 不再改这条。 */
|
|
3
4
|
progress?: number;
|
|
5
|
+
/** 条高(px)。默认 2,与 --rs-loading-bar-size 一致;未改默认时不写内联,方便覆盖 token。 */
|
|
4
6
|
height?: number;
|
|
7
|
+
/** 进度色。未传走 tone / --rs-loading-bar-color。 */
|
|
5
8
|
color?: string;
|
|
9
|
+
/** 失败色。未传走 --rs-loading-bar-error。 */
|
|
6
10
|
errorColor?: string;
|
|
11
|
+
/** 色相。color 传入时以 color 为准。 */
|
|
12
|
+
tone?: RsLoadingBarTone;
|
|
13
|
+
/** 贴上沿或下沿。 */
|
|
14
|
+
position?: RsLoadingBarPosition;
|
|
15
|
+
/** viewport 固定在窗口;parent 绝对定位到最近的定位祖先。 */
|
|
16
|
+
attach?: RsLoadingBarAttach;
|
|
17
|
+
/** 是否自动向 maximum 蠕动。 */
|
|
18
|
+
trickle?: boolean;
|
|
19
|
+
/** trickle 间隔(ms)。小于 16 回落 200。 */
|
|
20
|
+
trickleSpeed?: number;
|
|
21
|
+
/** start 的起步进度。 */
|
|
22
|
+
minimum?: number;
|
|
23
|
+
/** trickle 停住的上限,finish 才会到 100。 */
|
|
24
|
+
maximum?: number;
|
|
25
|
+
/** 短请求不闪条。delay 内 finish 则从不显示。0 与历史行为一致。 */
|
|
26
|
+
delay?: number;
|
|
27
|
+
/** finish 后淡出毫秒。 */
|
|
28
|
+
finishDuration?: number;
|
|
29
|
+
/** error 后淡出毫秒。 */
|
|
30
|
+
errorDuration?: number;
|
|
31
|
+
/** 重叠的 start/finish 计数。默认关闭,每次 start 仍会回到 minimum。 */
|
|
32
|
+
nesting?: boolean;
|
|
33
|
+
/** 未知进度:滑动条,不报 aria-valuenow。 */
|
|
34
|
+
indeterminate?: boolean;
|
|
35
|
+
/** 覆盖可访问名称。未传走 loadingBar.label / loadingBar.error。 */
|
|
36
|
+
ariaLabel?: string;
|
|
37
|
+
id?: string;
|
|
7
38
|
};
|
|
8
|
-
declare function start(): void;
|
|
9
|
-
declare function finish(): void;
|
|
10
|
-
declare function error(): void;
|
|
11
39
|
declare var __VLS_1: {};
|
|
12
40
|
type __VLS_Slots = {} & {
|
|
13
41
|
default?: (props: typeof __VLS_1) => any;
|
|
14
42
|
};
|
|
15
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
43
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, import("./loading-bar-utils").RsLoadingBarExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
44
|
+
change: (progress: number) => any;
|
|
45
|
+
error: () => any;
|
|
46
|
+
start: (pending: number) => any;
|
|
47
|
+
finish: (pending: number) => any;
|
|
48
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
49
|
+
onChange?: ((progress: number) => any) | undefined;
|
|
50
|
+
onError?: (() => any) | undefined;
|
|
51
|
+
onStart?: ((pending: number) => any) | undefined;
|
|
52
|
+
onFinish?: ((pending: number) => any) | undefined;
|
|
53
|
+
}>, {
|
|
21
54
|
height: number;
|
|
22
|
-
|
|
55
|
+
tone: RsLoadingBarTone;
|
|
56
|
+
indeterminate: boolean;
|
|
57
|
+
position: RsLoadingBarPosition;
|
|
58
|
+
attach: RsLoadingBarAttach;
|
|
59
|
+
trickle: boolean;
|
|
60
|
+
trickleSpeed: number;
|
|
61
|
+
minimum: number;
|
|
62
|
+
maximum: number;
|
|
63
|
+
delay: number;
|
|
64
|
+
finishDuration: number;
|
|
65
|
+
errorDuration: number;
|
|
66
|
+
nesting: boolean;
|
|
23
67
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
68
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
69
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,109 +1,350 @@
|
|
|
1
|
+
import { useRsI18n } from "../../../composables/useRsI18n.js";
|
|
1
2
|
import { RS_LOADING_BAR_KEY } from "../../../composables/useRsLoadingBar.js";
|
|
3
|
+
import { advanceLoadingBar, clampLoadingBar, loadingBarHasTimerHost, nextLoadingBarInc, resolveLoadingBarAttach, resolveLoadingBarDelay, resolveLoadingBarDuration, resolveLoadingBarHeight, resolveLoadingBarPosition, resolveLoadingBarRange, resolveLoadingBarSpeed, resolveLoadingBarTone } from "./loading-bar-utils.js";
|
|
2
4
|
import { Fragment, computed, createElementBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, provide, ref, renderSlot, shallowRef, watch } from "vue";
|
|
3
5
|
//#region src/components/loading-bar/src/RsLoadingBar.vue?vue&type=script&setup=true&lang.ts
|
|
4
6
|
var _hoisted_1 = [
|
|
7
|
+
"id",
|
|
5
8
|
"role",
|
|
6
9
|
"aria-hidden",
|
|
7
|
-
"aria-
|
|
10
|
+
"aria-label",
|
|
8
11
|
"aria-valuemin",
|
|
9
|
-
"aria-valuemax"
|
|
12
|
+
"aria-valuemax",
|
|
13
|
+
"aria-valuenow",
|
|
14
|
+
"aria-valuetext"
|
|
10
15
|
];
|
|
11
16
|
var RsLoadingBar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
17
|
+
name: "RsLoadingBar",
|
|
12
18
|
__name: "RsLoadingBar",
|
|
13
19
|
props: {
|
|
14
20
|
progress: {},
|
|
15
21
|
height: { default: 2 },
|
|
16
|
-
color: {
|
|
17
|
-
errorColor: {
|
|
22
|
+
color: {},
|
|
23
|
+
errorColor: {},
|
|
24
|
+
tone: { default: "primary" },
|
|
25
|
+
position: { default: "top" },
|
|
26
|
+
attach: { default: "viewport" },
|
|
27
|
+
trickle: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
trickleSpeed: { default: 200 },
|
|
32
|
+
minimum: { default: 8 },
|
|
33
|
+
maximum: { default: 92 },
|
|
34
|
+
delay: { default: 0 },
|
|
35
|
+
finishDuration: { default: 280 },
|
|
36
|
+
errorDuration: { default: 400 },
|
|
37
|
+
nesting: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
indeterminate: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
ariaLabel: {},
|
|
46
|
+
id: {}
|
|
18
47
|
},
|
|
19
|
-
|
|
48
|
+
emits: [
|
|
49
|
+
"start",
|
|
50
|
+
"finish",
|
|
51
|
+
"error",
|
|
52
|
+
"change"
|
|
53
|
+
],
|
|
54
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
20
55
|
const props = __props;
|
|
56
|
+
const emit = __emit;
|
|
57
|
+
const { t } = useRsI18n();
|
|
21
58
|
const internalProgress = ref(0);
|
|
22
59
|
const visible = ref(false);
|
|
23
60
|
const errored = ref(false);
|
|
61
|
+
let pending = 0;
|
|
62
|
+
let waiting = false;
|
|
63
|
+
let lastPublished = -1;
|
|
24
64
|
let trickleTimer = null;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
65
|
+
let hideTimer = null;
|
|
66
|
+
let delayTimer = null;
|
|
67
|
+
const tone = computed(() => resolveLoadingBarTone(props.tone));
|
|
68
|
+
const position = computed(() => resolveLoadingBarPosition(props.position));
|
|
69
|
+
const attach = computed(() => resolveLoadingBarAttach(props.attach));
|
|
70
|
+
const controlled = computed(() => props.progress !== void 0);
|
|
71
|
+
const indeterminateActive = computed(() => props.indeterminate && !controlled.value && !errored.value);
|
|
72
|
+
const displayProgress = computed(() => controlled.value ? clampLoadingBar(props.progress ?? 0) : internalProgress.value);
|
|
73
|
+
const label = computed(() => {
|
|
74
|
+
if (props.ariaLabel) return props.ariaLabel;
|
|
75
|
+
if (errored.value) return t("loadingBar.error");
|
|
76
|
+
if (indeterminateActive.value) return t("loadingBar.indeterminate");
|
|
77
|
+
return t("loadingBar.label");
|
|
78
|
+
});
|
|
79
|
+
const valueNow = computed(() => {
|
|
80
|
+
if (!visible.value || indeterminateActive.value) return void 0;
|
|
81
|
+
return Math.round(displayProgress.value);
|
|
82
|
+
});
|
|
83
|
+
const valueText = computed(() => {
|
|
84
|
+
if (!visible.value) return void 0;
|
|
85
|
+
if (errored.value) return t("loadingBar.error");
|
|
86
|
+
if (indeterminateActive.value) return t("loadingBar.indeterminate");
|
|
87
|
+
});
|
|
88
|
+
const rootStyle = computed(() => {
|
|
89
|
+
const style = {};
|
|
90
|
+
const height = resolveLoadingBarHeight(props.height);
|
|
91
|
+
if (height !== 2) style["--rs-loading-bar-size"] = `${height}px`;
|
|
92
|
+
if (props.color) style["--rs-loading-bar-color"] = props.color;
|
|
93
|
+
if (props.errorColor) style["--rs-loading-bar-error"] = props.errorColor;
|
|
94
|
+
if (!indeterminateActive.value) style["--rs-loading-bar-progress"] = `${displayProgress.value}%`;
|
|
95
|
+
return style;
|
|
96
|
+
});
|
|
97
|
+
function timerHost() {
|
|
98
|
+
if (typeof window === "undefined") return null;
|
|
99
|
+
return loadingBarHasTimerHost(window) ? window : null;
|
|
100
|
+
}
|
|
101
|
+
function publish(value) {
|
|
102
|
+
if (controlled.value || props.indeterminate) return;
|
|
103
|
+
const rounded = Math.round(value);
|
|
104
|
+
if (rounded === lastPublished) return;
|
|
105
|
+
lastPublished = rounded;
|
|
106
|
+
emit("change", rounded);
|
|
107
|
+
}
|
|
32
108
|
function clearTrickle() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
109
|
+
const host = timerHost();
|
|
110
|
+
if (trickleTimer !== null && host) host.clearInterval(trickleTimer);
|
|
111
|
+
trickleTimer = null;
|
|
37
112
|
}
|
|
38
|
-
function
|
|
113
|
+
function clearHide() {
|
|
114
|
+
const host = timerHost();
|
|
115
|
+
if (hideTimer !== null && host) host.clearTimeout(hideTimer);
|
|
116
|
+
hideTimer = null;
|
|
117
|
+
}
|
|
118
|
+
function clearDelay() {
|
|
119
|
+
const host = timerHost();
|
|
120
|
+
if (delayTimer !== null && host) host.clearTimeout(delayTimer);
|
|
121
|
+
delayTimer = null;
|
|
122
|
+
waiting = false;
|
|
123
|
+
}
|
|
124
|
+
function clearTimers() {
|
|
39
125
|
clearTrickle();
|
|
126
|
+
clearHide();
|
|
127
|
+
clearDelay();
|
|
128
|
+
}
|
|
129
|
+
function armHide(ms, done) {
|
|
130
|
+
clearHide();
|
|
131
|
+
const host = timerHost();
|
|
132
|
+
if (!host) {
|
|
133
|
+
done();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
hideTimer = host.setTimeout(() => {
|
|
137
|
+
hideTimer = null;
|
|
138
|
+
done();
|
|
139
|
+
}, ms);
|
|
140
|
+
}
|
|
141
|
+
function hideLater(ms) {
|
|
142
|
+
armHide(ms, () => {
|
|
143
|
+
visible.value = false;
|
|
144
|
+
errored.value = false;
|
|
145
|
+
internalProgress.value = 0;
|
|
146
|
+
lastPublished = -1;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function ensureTrickle() {
|
|
150
|
+
if (controlled.value || !props.trickle || props.indeterminate) {
|
|
151
|
+
clearTrickle();
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const { maximum } = resolveLoadingBarRange(props.minimum, props.maximum);
|
|
155
|
+
if (internalProgress.value >= maximum) {
|
|
156
|
+
clearTrickle();
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (trickleTimer) return;
|
|
160
|
+
const host = timerHost();
|
|
161
|
+
if (!host) return;
|
|
162
|
+
trickleTimer = host.setInterval(() => {
|
|
163
|
+
const cap = resolveLoadingBarRange(props.minimum, props.maximum).maximum;
|
|
164
|
+
if (internalProgress.value >= cap) {
|
|
165
|
+
clearTrickle();
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const next = advanceLoadingBar(internalProgress.value, cap);
|
|
169
|
+
internalProgress.value = next;
|
|
170
|
+
publish(next);
|
|
171
|
+
if (next >= cap) clearTrickle();
|
|
172
|
+
}, resolveLoadingBarSpeed(props.trickleSpeed));
|
|
173
|
+
}
|
|
174
|
+
function reveal(value) {
|
|
40
175
|
errored.value = false;
|
|
41
176
|
visible.value = true;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
177
|
+
if (props.indeterminate) {
|
|
178
|
+
clearTrickle();
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
internalProgress.value = value;
|
|
182
|
+
publish(value);
|
|
183
|
+
ensureTrickle();
|
|
48
184
|
}
|
|
49
|
-
function
|
|
185
|
+
function complete(erroredNext) {
|
|
186
|
+
pending = 0;
|
|
187
|
+
waiting = false;
|
|
50
188
|
clearTrickle();
|
|
51
|
-
|
|
189
|
+
clearDelay();
|
|
190
|
+
errored.value = erroredNext;
|
|
52
191
|
visible.value = true;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
192
|
+
if (!props.indeterminate || erroredNext) {
|
|
193
|
+
internalProgress.value = 100;
|
|
194
|
+
if (!props.indeterminate) publish(100);
|
|
195
|
+
}
|
|
196
|
+
hideLater(resolveLoadingBarDuration(erroredNext ? props.errorDuration : props.finishDuration, erroredNext ? 400 : 280));
|
|
58
197
|
}
|
|
59
|
-
function
|
|
198
|
+
function start() {
|
|
199
|
+
if (controlled.value) return;
|
|
200
|
+
clearHide();
|
|
201
|
+
errored.value = false;
|
|
202
|
+
if (props.nesting && pending > 0) {
|
|
203
|
+
pending += 1;
|
|
204
|
+
emit("start", pending);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
pending = 1;
|
|
60
208
|
clearTrickle();
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
209
|
+
clearDelay();
|
|
210
|
+
const delay = resolveLoadingBarDelay(props.delay);
|
|
211
|
+
const minimum = resolveLoadingBarRange(props.minimum, props.maximum).minimum;
|
|
212
|
+
if (delay > 0) {
|
|
213
|
+
const host = timerHost();
|
|
214
|
+
if (!host) {
|
|
215
|
+
reveal(minimum);
|
|
216
|
+
emit("start", pending);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
waiting = true;
|
|
220
|
+
delayTimer = host.setTimeout(() => {
|
|
221
|
+
delayTimer = null;
|
|
222
|
+
waiting = false;
|
|
223
|
+
if (pending <= 0) return;
|
|
224
|
+
reveal(minimum);
|
|
225
|
+
}, delay);
|
|
226
|
+
emit("start", pending);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
reveal(minimum);
|
|
230
|
+
emit("start", pending);
|
|
231
|
+
}
|
|
232
|
+
function finish() {
|
|
233
|
+
if (controlled.value) return;
|
|
234
|
+
if (props.nesting && pending > 1) {
|
|
235
|
+
pending -= 1;
|
|
236
|
+
emit("finish", pending);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (waiting) {
|
|
240
|
+
clearDelay();
|
|
241
|
+
pending = 0;
|
|
242
|
+
emit("finish", 0);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
complete(false);
|
|
246
|
+
emit("finish", 0);
|
|
247
|
+
}
|
|
248
|
+
function error() {
|
|
249
|
+
if (controlled.value) return;
|
|
250
|
+
complete(true);
|
|
251
|
+
emit("error");
|
|
252
|
+
}
|
|
253
|
+
function set(progress) {
|
|
254
|
+
if (controlled.value || props.indeterminate) return;
|
|
255
|
+
const next = clampLoadingBar(progress);
|
|
256
|
+
clearHide();
|
|
257
|
+
clearDelay();
|
|
258
|
+
errored.value = false;
|
|
259
|
+
if (next >= 100) {
|
|
260
|
+
complete(false);
|
|
261
|
+
emit("finish", 0);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (next <= 0) {
|
|
265
|
+
pending = 0;
|
|
266
|
+
clearTrickle();
|
|
65
267
|
visible.value = false;
|
|
66
|
-
errored.value = false;
|
|
67
268
|
internalProgress.value = 0;
|
|
68
|
-
|
|
269
|
+
publish(0);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (pending === 0) pending = 1;
|
|
273
|
+
visible.value = true;
|
|
274
|
+
internalProgress.value = next;
|
|
275
|
+
publish(next);
|
|
276
|
+
ensureTrickle();
|
|
277
|
+
}
|
|
278
|
+
function inc(amount) {
|
|
279
|
+
if (controlled.value || props.indeterminate) return;
|
|
280
|
+
if (pending <= 0 && !visible.value) {
|
|
281
|
+
start();
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
set(nextLoadingBarInc(internalProgress.value, amount));
|
|
285
|
+
}
|
|
286
|
+
function getProgress() {
|
|
287
|
+
return Math.round(displayProgress.value);
|
|
288
|
+
}
|
|
289
|
+
function isStarted() {
|
|
290
|
+
return pending > 0;
|
|
69
291
|
}
|
|
70
292
|
const api = shallowRef({
|
|
71
293
|
start,
|
|
72
294
|
finish,
|
|
73
|
-
error
|
|
295
|
+
error,
|
|
296
|
+
set,
|
|
297
|
+
inc,
|
|
298
|
+
getProgress,
|
|
299
|
+
isStarted
|
|
74
300
|
});
|
|
75
301
|
provide(RS_LOADING_BAR_KEY, api);
|
|
76
302
|
watch(() => props.progress, (value) => {
|
|
77
303
|
if (value === void 0) return;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
304
|
+
clearHide();
|
|
305
|
+
clearTrickle();
|
|
306
|
+
const next = clampLoadingBar(value);
|
|
307
|
+
if (next <= 0) {
|
|
308
|
+
visible.value = false;
|
|
309
|
+
return;
|
|
84
310
|
}
|
|
85
|
-
|
|
311
|
+
visible.value = true;
|
|
312
|
+
if (next >= 100) hideLater(resolveLoadingBarDuration(props.finishDuration, 280));
|
|
313
|
+
}, { immediate: true });
|
|
86
314
|
onBeforeUnmount(() => {
|
|
87
|
-
|
|
315
|
+
clearTimers();
|
|
316
|
+
pending = 0;
|
|
88
317
|
api.value = null;
|
|
89
318
|
});
|
|
90
319
|
__expose({
|
|
91
320
|
start,
|
|
92
321
|
finish,
|
|
93
|
-
error
|
|
322
|
+
error,
|
|
323
|
+
set,
|
|
324
|
+
inc,
|
|
325
|
+
getProgress,
|
|
326
|
+
isStarted
|
|
94
327
|
});
|
|
95
328
|
return (_ctx, _cache) => {
|
|
96
329
|
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
330
|
+
id: __props.id || void 0,
|
|
331
|
+
class: normalizeClass(["rs-loading-bar", {
|
|
332
|
+
"rs-loading-bar--visible": visible.value,
|
|
333
|
+
"rs-loading-bar--bottom": position.value === "bottom",
|
|
334
|
+
"rs-loading-bar--parent": attach.value === "parent",
|
|
335
|
+
"rs-loading-bar--error": errored.value,
|
|
336
|
+
"rs-loading-bar--indeterminate": indeterminateActive.value,
|
|
337
|
+
[`rs-loading-bar--${tone.value}`]: true
|
|
338
|
+
}]),
|
|
339
|
+
style: normalizeStyle(rootStyle.value),
|
|
340
|
+
role: visible.value ? "progressbar" : void 0,
|
|
341
|
+
"aria-hidden": visible.value ? void 0 : "true",
|
|
342
|
+
"aria-label": visible.value ? label.value : void 0,
|
|
343
|
+
"aria-valuemin": valueNow.value !== void 0 ? 0 : void 0,
|
|
344
|
+
"aria-valuemax": valueNow.value !== void 0 ? 100 : void 0,
|
|
345
|
+
"aria-valuenow": valueNow.value,
|
|
346
|
+
"aria-valuetext": valueText.value
|
|
347
|
+
}, [..._cache[0] || (_cache[0] = [createElementVNode("div", { class: "rs-loading-bar__peg" }, null, -1)])], 14, _hoisted_1), renderSlot(_ctx.$slots, "default", {}, void 0, true)], 64);
|
|
107
348
|
};
|
|
108
349
|
}
|
|
109
350
|
});
|
|
@@ -3,6 +3,6 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
|
|
|
3
3
|
import RsLoadingBar_vue_vue_type_script_setup_true_lang_default from "./RsLoadingBar.impl.js";
|
|
4
4
|
|
|
5
5
|
//#region src/components/loading-bar/src/RsLoadingBar.vue
|
|
6
|
-
var RsLoadingBar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(RsLoadingBar_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
6
|
+
var RsLoadingBar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(RsLoadingBar_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-aff2ed50"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { RsLoadingBar_default as default };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** 色相。未传走 primary,对应 --rs-loading-bar-color。 */
|
|
2
|
+
export type RsLoadingBarTone = 'primary' | 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
3
|
+
/** 贴视口上沿或下沿。 */
|
|
4
|
+
export type RsLoadingBarPosition = 'top' | 'bottom';
|
|
5
|
+
/** viewport 相对窗口 fixed;parent 相对最近定位祖先 absolute。 */
|
|
6
|
+
export type RsLoadingBarAttach = 'viewport' | 'parent';
|
|
7
|
+
/** 命令式 API。useRsLoadingBar 与组件 ref 同一套方法。 */
|
|
8
|
+
export interface RsLoadingBarExpose {
|
|
9
|
+
/** 开始。默认把进度拉到 minimum 并 trickle。nesting 时重复调用只加计数。 */
|
|
10
|
+
start: () => void;
|
|
11
|
+
/** 结束。默认补到 100 后淡出。nesting 时计数归零才淡出。 */
|
|
12
|
+
finish: () => void;
|
|
13
|
+
/** 失败。清计数,用错误色补到 100 后淡出。 */
|
|
14
|
+
error: () => void;
|
|
15
|
+
/** 把未受控进度设到 0–100。100 等同结束,0 立刻隐藏。 */
|
|
16
|
+
set: (progress: number) => void;
|
|
17
|
+
/** 在当前进度上增加。未开始时等同 start,不会加到 100。 */
|
|
18
|
+
inc: (amount?: number) => void;
|
|
19
|
+
/** 当前展示进度(四舍五入)。未开始为 0。 */
|
|
20
|
+
getProgress: () => number;
|
|
21
|
+
/** 是否仍有未结束的 start(含 delay 等待、nesting 计数)。淡出过程中为 false。 */
|
|
22
|
+
isStarted: () => boolean;
|
|
23
|
+
}
|
|
24
|
+
export type RsLoadingBarApi = RsLoadingBarExpose;
|
|
25
|
+
export type RsLoadingBarInstance = RsLoadingBarExpose & {
|
|
26
|
+
$el: HTMLElement;
|
|
27
|
+
};
|
|
28
|
+
export declare const RS_LOADING_BAR_TONES: readonly ["primary", "neutral", "info", "success", "warning", "danger"];
|
|
29
|
+
export declare const RS_LOADING_BAR_POSITIONS: readonly ["top", "bottom"];
|
|
30
|
+
export declare const RS_LOADING_BAR_ATTACHES: readonly ["viewport", "parent"];
|
|
31
|
+
export declare const RS_LOADING_BAR_DEFAULT_HEIGHT = 2;
|
|
32
|
+
export declare const RS_LOADING_BAR_DEFAULT_MINIMUM = 8;
|
|
33
|
+
export declare const RS_LOADING_BAR_DEFAULT_MAXIMUM = 92;
|
|
34
|
+
export declare const RS_LOADING_BAR_DEFAULT_SPEED = 200;
|
|
35
|
+
export declare const RS_LOADING_BAR_DEFAULT_FINISH_MS = 280;
|
|
36
|
+
export declare const RS_LOADING_BAR_DEFAULT_ERROR_MS = 400;
|
|
37
|
+
/** inc 停在 100 以下,避免没调用 finish 就当成完成。 */
|
|
38
|
+
export declare const RS_LOADING_BAR_INC_CAP = 99.4;
|
|
39
|
+
export declare function clampLoadingBar(value: number): number;
|
|
40
|
+
export declare function isRsLoadingBarTone(value: unknown): value is RsLoadingBarTone;
|
|
41
|
+
export declare function isRsLoadingBarPosition(value: unknown): value is RsLoadingBarPosition;
|
|
42
|
+
export declare function isRsLoadingBarAttach(value: unknown): value is RsLoadingBarAttach;
|
|
43
|
+
export declare function resolveLoadingBarTone(tone?: string | null): RsLoadingBarTone;
|
|
44
|
+
export declare function resolveLoadingBarPosition(position?: string | null): RsLoadingBarPosition;
|
|
45
|
+
export declare function resolveLoadingBarAttach(attach?: string | null): RsLoadingBarAttach;
|
|
46
|
+
/** 非正数或非法回落 2,与历史默认高度一致。 */
|
|
47
|
+
export declare function resolveLoadingBarHeight(height?: number | null): number;
|
|
48
|
+
/**
|
|
49
|
+
* trickle 上限与起步值。minimum 大于 maximum 时把起步压到上限,避免一启动就停住。
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveLoadingBarRange(minimum?: number | null, maximum?: number | null): {
|
|
52
|
+
minimum: number;
|
|
53
|
+
maximum: number;
|
|
54
|
+
};
|
|
55
|
+
/** 低于 16ms 视为误传,回落 200,避免 0 间隔打满主线程。 */
|
|
56
|
+
export declare function resolveLoadingBarSpeed(speed?: number | null): number;
|
|
57
|
+
export declare function resolveLoadingBarDelay(delay?: number | null): number;
|
|
58
|
+
export declare function resolveLoadingBarDuration(duration: number | null | undefined, fallback: number): number;
|
|
59
|
+
/**
|
|
60
|
+
* 与历史 trickle 相同:步长为剩余距离的 8%,至少 0.5,不超过 ceiling。
|
|
61
|
+
*/
|
|
62
|
+
export declare function advanceLoadingBar(current: number, ceiling: number): number;
|
|
63
|
+
/**
|
|
64
|
+
* 未知增量时越接近完成步长越小(NProgress 的 0–1 标度换成 0–100)。
|
|
65
|
+
* 结果不超过 INC_CAP,把「到 100」留给 finish / error / set。
|
|
66
|
+
*/
|
|
67
|
+
export declare function nextLoadingBarInc(current: number, amount?: number): number;
|
|
68
|
+
/** SSR / 无 window 时不排定时器。 */
|
|
69
|
+
export declare function loadingBarHasTimerHost(host: unknown): host is Pick<Window, 'setTimeout' | 'setInterval' | 'clearTimeout' | 'clearInterval'>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
//#region src/components/loading-bar/src/loading-bar-utils.ts
|
|
2
|
+
var RS_LOADING_BAR_TONES = [
|
|
3
|
+
"primary",
|
|
4
|
+
"neutral",
|
|
5
|
+
"info",
|
|
6
|
+
"success",
|
|
7
|
+
"warning",
|
|
8
|
+
"danger"
|
|
9
|
+
];
|
|
10
|
+
var RS_LOADING_BAR_POSITIONS = ["top", "bottom"];
|
|
11
|
+
var RS_LOADING_BAR_ATTACHES = ["viewport", "parent"];
|
|
12
|
+
/** inc 停在 100 以下,避免没调用 finish 就当成完成。 */
|
|
13
|
+
var RS_LOADING_BAR_INC_CAP = 99.4;
|
|
14
|
+
function clampLoadingBar(value) {
|
|
15
|
+
if (!Number.isFinite(value)) return 0;
|
|
16
|
+
return Math.min(100, Math.max(0, value));
|
|
17
|
+
}
|
|
18
|
+
function isRsLoadingBarTone(value) {
|
|
19
|
+
return typeof value === "string" && RS_LOADING_BAR_TONES.includes(value);
|
|
20
|
+
}
|
|
21
|
+
function isRsLoadingBarPosition(value) {
|
|
22
|
+
return typeof value === "string" && RS_LOADING_BAR_POSITIONS.includes(value);
|
|
23
|
+
}
|
|
24
|
+
function isRsLoadingBarAttach(value) {
|
|
25
|
+
return typeof value === "string" && RS_LOADING_BAR_ATTACHES.includes(value);
|
|
26
|
+
}
|
|
27
|
+
function resolveLoadingBarTone(tone) {
|
|
28
|
+
return isRsLoadingBarTone(tone) ? tone : "primary";
|
|
29
|
+
}
|
|
30
|
+
function resolveLoadingBarPosition(position) {
|
|
31
|
+
return isRsLoadingBarPosition(position) ? position : "top";
|
|
32
|
+
}
|
|
33
|
+
function resolveLoadingBarAttach(attach) {
|
|
34
|
+
return isRsLoadingBarAttach(attach) ? attach : "viewport";
|
|
35
|
+
}
|
|
36
|
+
/** 非正数或非法回落 2,与历史默认高度一致。 */
|
|
37
|
+
function resolveLoadingBarHeight(height) {
|
|
38
|
+
if (typeof height !== "number" || !Number.isFinite(height) || height <= 0) return 2;
|
|
39
|
+
return height;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* trickle 上限与起步值。minimum 大于 maximum 时把起步压到上限,避免一启动就停住。
|
|
43
|
+
*/
|
|
44
|
+
function resolveLoadingBarRange(minimum, maximum) {
|
|
45
|
+
const min = typeof minimum === "number" && Number.isFinite(minimum) ? clampLoadingBar(minimum) : 8;
|
|
46
|
+
const max = typeof maximum === "number" && Number.isFinite(maximum) ? clampLoadingBar(maximum) : 92;
|
|
47
|
+
return {
|
|
48
|
+
minimum: Math.min(min, max),
|
|
49
|
+
maximum: max
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** 低于 16ms 视为误传,回落 200,避免 0 间隔打满主线程。 */
|
|
53
|
+
function resolveLoadingBarSpeed(speed) {
|
|
54
|
+
if (typeof speed !== "number" || !Number.isFinite(speed) || speed < 16) return 200;
|
|
55
|
+
return speed;
|
|
56
|
+
}
|
|
57
|
+
function resolveLoadingBarDelay(delay) {
|
|
58
|
+
if (typeof delay !== "number" || !Number.isFinite(delay) || delay < 0) return 0;
|
|
59
|
+
return delay;
|
|
60
|
+
}
|
|
61
|
+
function resolveLoadingBarDuration(duration, fallback) {
|
|
62
|
+
if (typeof duration !== "number" || !Number.isFinite(duration) || duration < 0) return fallback;
|
|
63
|
+
return duration;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 与历史 trickle 相同:步长为剩余距离的 8%,至少 0.5,不超过 ceiling。
|
|
67
|
+
*/
|
|
68
|
+
function advanceLoadingBar(current, ceiling) {
|
|
69
|
+
const value = clampLoadingBar(current);
|
|
70
|
+
const cap = clampLoadingBar(ceiling);
|
|
71
|
+
if (value >= cap) return value;
|
|
72
|
+
const step = Math.max(.5, (cap - value) * .08);
|
|
73
|
+
return Math.min(cap, value + step);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 未知增量时越接近完成步长越小(NProgress 的 0–1 标度换成 0–100)。
|
|
77
|
+
* 结果不超过 INC_CAP,把「到 100」留给 finish / error / set。
|
|
78
|
+
*/
|
|
79
|
+
function nextLoadingBarInc(current, amount) {
|
|
80
|
+
const value = clampLoadingBar(current);
|
|
81
|
+
if (value >= 100) return 100;
|
|
82
|
+
let step = amount;
|
|
83
|
+
if (typeof step !== "number" || !Number.isFinite(step)) if (value < 20) step = 10;
|
|
84
|
+
else if (value < 50) step = 4;
|
|
85
|
+
else if (value < 80) step = 2;
|
|
86
|
+
else if (value < 99) step = .5;
|
|
87
|
+
else step = 0;
|
|
88
|
+
return Math.min(RS_LOADING_BAR_INC_CAP, Math.max(0, value + step));
|
|
89
|
+
}
|
|
90
|
+
/** SSR / 无 window 时不排定时器。 */
|
|
91
|
+
function loadingBarHasTimerHost(host) {
|
|
92
|
+
if (!host || typeof host !== "object") return false;
|
|
93
|
+
const candidate = host;
|
|
94
|
+
return typeof candidate.setTimeout === "function" && typeof candidate.setInterval === "function" && typeof candidate.clearTimeout === "function" && typeof candidate.clearInterval === "function";
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { RS_LOADING_BAR_ATTACHES, RS_LOADING_BAR_INC_CAP, RS_LOADING_BAR_POSITIONS, RS_LOADING_BAR_TONES, advanceLoadingBar, clampLoadingBar, isRsLoadingBarAttach, isRsLoadingBarPosition, isRsLoadingBarTone, loadingBarHasTimerHost, nextLoadingBarInc, resolveLoadingBarAttach, resolveLoadingBarDelay, resolveLoadingBarDuration, resolveLoadingBarHeight, resolveLoadingBarPosition, resolveLoadingBarRange, resolveLoadingBarSpeed, resolveLoadingBarTone };
|