@veltra/desktop 1.3.2 → 1.3.4
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/dist/components/action/action-group.vue.d.ts +2 -2
- package/dist/components/action/action.vue.d.ts +3 -1
- package/dist/components/action/index.d.ts +3 -2
- package/dist/components/action/style.d.ts +2 -1
- package/dist/components/auto-complete/auto-complete.vue.d.ts +2 -1
- package/dist/components/auto-complete/index.d.ts +2 -1
- package/dist/components/auto-complete/style.d.ts +4 -1
- package/dist/components/auto-complete/use-keyboard.js +1 -1
- package/dist/components/auto-complete/use-keyboard.js.map +1 -1
- package/dist/components/badge/badge.vue.d.ts +2 -1
- package/dist/components/badge/index.d.ts +2 -1
- package/dist/components/batch-edit/batch-edit.vue.d.ts +3 -1
- package/dist/components/batch-edit/helper.d.ts +1 -0
- package/dist/components/batch-edit/index.d.ts +3 -2
- package/dist/components/batch-edit/style.d.ts +5 -1
- package/dist/components/batch-edit/use-features.js +1 -1
- package/dist/components/batch-edit/use-features.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.vue.d.ts +2 -1
- package/dist/components/breadcrumb/index.d.ts +2 -1
- package/dist/components/button/button-group.vue.d.ts +2 -1
- package/dist/components/button/button.vue.d.ts +2 -1
- package/dist/components/button/index.d.ts +3 -2
- package/dist/components/button/style.d.ts +1 -1
- package/dist/components/calendar/calendar.vue.d.ts +2 -1
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/card/card-action.vue.d.ts +2 -1
- package/dist/components/card/card-content.vue.d.ts +2 -1
- package/dist/components/card/card-cover.vue.d.ts +2 -1
- package/dist/components/card/card-header.vue.d.ts +1 -1
- package/dist/components/card/card.vue.d.ts +2 -1
- package/dist/components/card/index.d.ts +6 -5
- package/dist/components/cascade/cascade.vue.d.ts +3 -2
- package/dist/components/cascade/index.d.ts +2 -1
- package/dist/components/cascade/style.d.ts +3 -1
- package/dist/components/check-tag/check-tag.vue.d.ts +2 -1
- package/dist/components/check-tag/index.d.ts +2 -1
- package/dist/components/checkbox/checkbox-button.vue.d.ts +2 -1
- package/dist/components/checkbox/checkbox.vue.d.ts +2 -1
- package/dist/components/checkbox/index.d.ts +3 -2
- package/dist/components/checkbox/style.d.ts +1 -1
- package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -1
- package/dist/components/checkbox-group/index.d.ts +2 -1
- package/dist/components/checkbox-group/style.d.ts +1 -1
- package/dist/components/code-editor/code-editor.vue.d.ts +2 -1
- package/dist/components/code-editor/index.d.ts +2 -1
- package/dist/components/code-editor/langs/spel/language.js +2 -2
- package/dist/components/code-editor/langs/spel/language.js.map +1 -1
- package/dist/components/code-editor/style.d.ts +1 -1
- package/dist/components/collapse/collapse-item.vue.d.ts +4 -3
- package/dist/components/collapse/collapse.vue.d.ts +2 -1
- package/dist/components/collapse/index.d.ts +3 -2
- package/dist/components/condition-editor/condition-editor.vue.d.ts +3 -1
- package/dist/components/condition-editor/core/evaluator.d.ts +1 -0
- package/dist/components/condition-editor/index.d.ts +3 -2
- package/dist/components/condition-editor/style.d.ts +2 -1
- package/dist/components/contextmenu/api.d.ts +1 -0
- package/dist/components/contextmenu/contextmenu.vue.d.ts +2 -1
- package/dist/components/contextmenu/index.d.ts +3 -2
- package/dist/components/contextmenu/style.d.ts +2 -1
- package/dist/components/date-panel/date-panel.vue.d.ts +2 -1
- package/dist/components/date-panel/index.d.ts +2 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +2 -1
- package/dist/components/date-picker/index.d.ts +2 -1
- package/dist/components/date-picker/style.d.ts +2 -1
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +2 -1
- package/dist/components/date-range-picker/index.d.ts +2 -1
- package/dist/components/date-range-picker/style.d.ts +1 -1
- package/dist/components/dialog/dialog.vue.d.ts +5 -2
- package/dist/components/dialog/index.d.ts +2 -1
- package/dist/components/dialog/style.d.ts +1 -1
- package/dist/components/drawer/drawer.vue.d.ts +3 -1
- package/dist/components/drawer/index.d.ts +2 -1
- package/dist/components/drawer/style.d.ts +1 -1
- package/dist/components/dropdown/dropdown.vue.d.ts +6 -2
- package/dist/components/dropdown/index.d.ts +2 -1
- package/dist/components/dropdown/style.d.ts +1 -1
- package/dist/components/dual-nav/dual-nav.vue.d.ts +2 -1
- package/dist/components/dual-nav/index.d.ts +2 -1
- package/dist/components/dual-nav/style.d.ts +1 -1
- package/dist/components/empty/empty.vue.d.ts +2 -1
- package/dist/components/empty/index.d.ts +2 -1
- package/dist/components/expression-editor/expression-editor.vue.d.ts +3 -1
- package/dist/components/expression-editor/index.d.ts +2 -1
- package/dist/components/file-picker/file-picker.js +6 -3
- package/dist/components/file-picker/file-picker.js.map +1 -1
- package/dist/components/file-picker/file-picker.vue.d.ts +2 -1
- package/dist/components/file-picker/index.d.ts +2 -1
- package/dist/components/file-viewer/file-viewer.js +2 -2
- package/dist/components/file-viewer/file-viewer.js.map +1 -1
- package/dist/components/file-viewer/file-viewer.vue.d.ts +1 -2
- package/dist/components/file-viewer/helper.js +4 -4
- package/dist/components/file-viewer/helper.js.map +1 -1
- package/dist/components/file-viewer/index.d.ts +2 -1
- package/dist/components/float-button/float-button.vue.d.ts +2 -1
- package/dist/components/float-button/index.d.ts +2 -1
- package/dist/components/float-button/style.d.ts +1 -1
- package/dist/components/form/form.vue.d.ts +2 -1
- package/dist/components/form/index.d.ts +2 -1
- package/dist/components/form-item/form-item.vue.d.ts +4 -2
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form-item/index.d.ts +2 -1
- package/dist/components/gantt-chart/gantt-chart.vue.d.ts +2 -1
- package/dist/components/gantt-chart/index.d.ts +2 -1
- package/dist/components/grid/grid-item.vue.d.ts +2 -1
- package/dist/components/grid/grid.vue.d.ts +3 -1
- package/dist/components/grid/index.d.ts +3 -2
- package/dist/components/grid/use-responsive.js +2 -1
- package/dist/components/grid/use-responsive.js.map +1 -1
- package/dist/components/grid-input/grid-input.vue.d.ts +3 -1
- package/dist/components/grid-input/index.d.ts +2 -1
- package/dist/components/group-input/group-input.vue.d.ts +4 -3
- package/dist/components/group-input/index.d.ts +2 -1
- package/dist/components/group-input/style.d.ts +1 -1
- package/dist/components/group-nav/group-nav.vue.d.ts +1 -2
- package/dist/components/group-nav/index.d.ts +2 -1
- package/dist/components/icon/icon.vue.d.ts +2 -1
- package/dist/components/icon/index.d.ts +2 -1
- package/dist/components/index.d.ts +168 -92
- package/dist/components/index.js +5 -5
- package/dist/components/input/index.d.ts +2 -1
- package/dist/components/input/input.vue.d.ts +6 -5
- package/dist/components/input/style.d.ts +1 -1
- package/dist/components/kbd/kbd.vue.d.ts +1 -1
- package/dist/components/layout/index.d.ts +2 -1
- package/dist/components/layout/layout.vue.d.ts +2 -1
- package/dist/components/list/index.d.ts +3 -2
- package/dist/components/list/list-item.vue.d.ts +1 -1
- package/dist/components/list/list.vue.d.ts +2 -1
- package/dist/components/list/style.d.ts +1 -1
- package/dist/components/loading/directive.d.ts +0 -1
- package/dist/components/loading/index.d.ts +3 -2
- package/dist/components/loading/loading.vue.d.ts +3 -1
- package/dist/components/loading/style.d.ts +1 -1
- package/dist/components/message/index.d.ts +3 -2
- package/dist/components/message/message.d.ts +1 -0
- package/dist/components/message/message.vue.d.ts +3 -1
- package/dist/components/message-confirm/index.d.ts +3 -2
- package/dist/components/message-confirm/message-confirm-box.js +39 -0
- package/dist/components/message-confirm/message-confirm-box.js.map +1 -0
- package/dist/components/message-confirm/message-confirm.d.ts +5 -7
- package/dist/components/message-confirm/message-confirm.js +32 -46
- package/dist/components/message-confirm/message-confirm.js.map +1 -1
- package/dist/components/message-confirm/message-confirm.vue.d.ts +8 -4
- package/dist/components/message-confirm/message-confirm2.js +98 -23
- package/dist/components/message-confirm/message-confirm2.js.map +1 -1
- package/dist/components/message-confirm/style2.css +9 -9
- package/dist/components/multi-select/index.d.ts +2 -1
- package/dist/components/multi-select/multi-select.vue.d.ts +8 -7
- package/dist/components/multi-select/style.d.ts +5 -1
- package/dist/components/multi-tree-select/index.d.ts +2 -1
- package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +2 -2
- package/dist/components/multi-tree-select/style.d.ts +6 -1
- package/dist/components/nav/index.d.ts +4 -3
- package/dist/components/nav/nav-item.vue.d.ts +2 -1
- package/dist/components/nav/nav-sub.vue.d.ts +2 -1
- package/dist/components/nav/nav.vue.d.ts +2 -1
- package/dist/components/node-render/index.d.ts +2 -1
- package/dist/components/node-render/node-render.d.ts +1 -2
- package/dist/components/notification/index.d.ts +3 -8
- package/dist/components/notification/notification-box.js +130 -0
- package/dist/components/notification/notification-box.js.map +1 -0
- package/dist/components/notification/notification.d.ts +8 -0
- package/dist/components/notification/notification.js +62 -84
- package/dist/components/notification/notification.js.map +1 -1
- package/dist/components/notification/notification.vue.d.ts +10 -5
- package/dist/components/notification/notification2.js +134 -0
- package/dist/components/notification/notification2.js.map +1 -0
- package/dist/components/notification/style2.css +62 -32
- package/dist/components/number/index.d.ts +2 -1
- package/dist/components/number/number.vue.d.ts +2 -1
- package/dist/components/number-input/index.d.ts +2 -1
- package/dist/components/number-input/number-input.js +2 -1
- package/dist/components/number-input/number-input.js.map +1 -1
- package/dist/components/number-input/number-input.vue.d.ts +4 -2
- package/dist/components/number-input/style.d.ts +2 -1
- package/dist/components/number-range-input/index.d.ts +2 -1
- package/dist/components/number-range-input/number-range-input.js +4 -2
- package/dist/components/number-range-input/number-range-input.js.map +1 -1
- package/dist/components/number-range-input/number-range-input.vue.d.ts +2 -1
- package/dist/components/number-range-input/style.d.ts +1 -1
- package/dist/components/paginator/index.d.ts +2 -1
- package/dist/components/paginator/paginator.vue.d.ts +2 -1
- package/dist/components/paginator/style.d.ts +2 -1
- package/dist/components/palette/index.d.ts +2 -1
- package/dist/components/palette/palette-sv.js +4 -2
- package/dist/components/palette/palette-sv.js.map +1 -1
- package/dist/components/palette/palette.vue.d.ts +2 -1
- package/dist/components/palette/style.d.ts +2 -1
- package/dist/components/password-input/index.d.ts +2 -1
- package/dist/components/password-input/password-input.vue.d.ts +2 -1
- package/dist/components/password-input/style.d.ts +1 -1
- package/dist/components/pop-confirm/index.d.ts +2 -1
- package/dist/components/pop-confirm/pop-confirm.vue.d.ts +4 -2
- package/dist/components/pop-confirm/style.d.ts +1 -1
- package/dist/components/progress/index.d.ts +2 -1
- package/dist/components/progress/progress.vue.d.ts +4 -3
- package/dist/components/progress-nodes/index.d.ts +2 -1
- package/dist/components/progress-nodes/progress-nodes.js +2 -1
- package/dist/components/progress-nodes/progress-nodes.js.map +1 -1
- package/dist/components/progress-nodes/progress-nodes.vue.d.ts +8 -7
- package/dist/components/radio/index.d.ts +2 -1
- package/dist/components/radio/radio.vue.d.ts +2 -1
- package/dist/components/radio/style.d.ts +1 -1
- package/dist/components/radio-group/index.d.ts +2 -1
- package/dist/components/radio-group/radio-group.vue.d.ts +2 -1
- package/dist/components/radio-group/style.d.ts +1 -1
- package/dist/components/rich-text-editor/index.d.ts +2 -1
- package/dist/components/rich-text-editor/rich-text-editor.js +2 -1
- package/dist/components/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +3 -1
- package/dist/components/rich-text-editor/toolbar.js +2 -1
- package/dist/components/rich-text-editor/toolbar.js.map +1 -1
- package/dist/components/scroll/index.d.ts +2 -1
- package/dist/components/scroll/scroll.vue.d.ts +5 -2
- package/dist/components/select/index.d.ts +2 -1
- package/dist/components/select/select.vue.d.ts +5 -2
- package/dist/components/select/style.d.ts +3 -1
- package/dist/components/slider/index.d.ts +2 -1
- package/dist/components/slider/slider.vue.d.ts +4 -3
- package/dist/components/steps/index.d.ts +2 -1
- package/dist/components/steps/steps.vue.d.ts +4 -3
- package/dist/components/switch/index.d.ts +2 -1
- package/dist/components/switch/switch.vue.d.ts +2 -1
- package/dist/components/table/index.d.ts +3 -2
- package/dist/components/table/node/col.d.ts +1 -1
- package/dist/components/table/node/row.d.ts +0 -1
- package/dist/components/table/style.d.ts +3 -1
- package/dist/components/table/table-row.js +2 -1
- package/dist/components/table/table-row.js.map +1 -1
- package/dist/components/table/table.vue.d.ts +3 -1
- package/dist/components/table/use-columns.d.ts +3 -0
- package/dist/components/table/use-columns.js +2 -1
- package/dist/components/table/use-columns.js.map +1 -1
- package/dist/components/table-editor/index.d.ts +2 -1
- package/dist/components/table-editor/style.d.ts +2 -1
- package/dist/components/table-editor/table-editor.vue.d.ts +2 -1
- package/dist/components/tabs/index.d.ts +4 -3
- package/dist/components/tabs/style.d.ts +2 -1
- package/dist/components/tabs/tabs-horizontal.vue.d.ts +3 -2
- package/dist/components/tabs/tabs-vertical.vue.d.ts +3 -2
- package/dist/components/tabs/tabs.vue.d.ts +3 -2
- package/dist/components/tag/index.d.ts +2 -1
- package/dist/components/tag/tag.vue.d.ts +2 -1
- package/dist/components/text/index.d.ts +2 -1
- package/dist/components/text/text.vue.d.ts +2 -1
- package/dist/components/textarea/index.d.ts +2 -1
- package/dist/components/textarea/style.d.ts +1 -1
- package/dist/components/textarea/textarea.js +4 -2
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/components/textarea/textarea.vue.d.ts +2 -1
- package/dist/components/theme/index.d.ts +2 -1
- package/dist/components/theme/style.d.ts +5 -1
- package/dist/components/theme/theme.vue.d.ts +2 -1
- package/dist/components/tip/index.d.ts +2 -1
- package/dist/components/tip/tip.vue.d.ts +4 -2
- package/dist/components/tree/di.d.ts +2 -0
- package/dist/components/tree/index.d.ts +2 -1
- package/dist/components/tree/style.d.ts +1 -1
- package/dist/components/tree/tree.vue.d.ts +3 -1
- package/dist/components/tree-select/index.d.ts +2 -1
- package/dist/components/tree-select/style.d.ts +3 -1
- package/dist/components/tree-select/tree-select.vue.d.ts +5 -3
- package/dist/components/watermark/index.d.ts +2 -1
- package/dist/components/watermark/watermark.vue.d.ts +2 -1
- package/dist/index.d.ts +97 -98
- package/dist/index.js +3 -3
- package/dist/install.d.ts +1 -1
- package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js +13 -4
- package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_commands@6.10.4/node_modules/@codemirror/commands/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js +3 -2
- package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.1/node_modules/@codemirror/lang-markdown/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js +31 -5
- package/dist/node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js +5 -3
- package/dist/node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_search@6.7.1/node_modules/@codemirror/search/dist/index.js +3 -2
- package/dist/node_modules/.bun/@codemirror_search@6.7.1/node_modules/@codemirror/search/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_state@6.7.0/node_modules/@codemirror/state/dist/index.js +3 -2
- package/dist/node_modules/.bun/@codemirror_state@6.7.0/node_modules/@codemirror/state/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js +30 -7
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_view@6.43.4/node_modules/@codemirror/view/dist/index.js +11 -5
- package/dist/node_modules/.bun/@codemirror_view@6.43.4/node_modules/@codemirror/view/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_common@1.5.2/node_modules/@lezer/common/dist/index.js +3 -2
- package/dist/node_modules/.bun/@lezer_common@1.5.2/node_modules/@lezer/common/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_css@1.3.4/node_modules/@lezer/css/dist/index.js +20 -2
- package/dist/node_modules/.bun/@lezer_css@1.3.4/node_modules/@lezer/css/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js +15 -2
- package/dist/node_modules/.bun/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js +42 -3
- package/dist/node_modules/.bun/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js +23 -2
- package/dist/node_modules/.bun/@lezer_javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_lr@1.4.10/node_modules/@lezer/lr/dist/index.js +1 -1
- package/dist/node_modules/.bun/@lezer_markdown@1.7.2/node_modules/@lezer/markdown/dist/index.js +39 -29
- package/dist/node_modules/.bun/@lezer_markdown@1.7.2/node_modules/@lezer/markdown/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@marijn_find-cluster-break@1.0.2/node_modules/@marijn/find-cluster-break/src/index.js +3 -2
- package/dist/node_modules/.bun/@marijn_find-cluster-break@1.0.2/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -1
- package/dist/style.d.ts +39 -1
- package/dist/types/action.d.ts +0 -1
- package/dist/types/animation.d.ts +0 -1
- package/dist/types/auto-complete.d.ts +0 -1
- package/dist/types/badge.d.ts +0 -1
- package/dist/types/batch-edit.d.ts +18 -13
- package/dist/types/breadcrumb.d.ts +0 -1
- package/dist/types/button.d.ts +0 -1
- package/dist/types/calendar.d.ts +0 -1
- package/dist/types/card.d.ts +0 -1
- package/dist/types/cascade.d.ts +0 -1
- package/dist/types/check-tag.d.ts +0 -1
- package/dist/types/checkbox-group.d.ts +0 -1
- package/dist/types/checkbox.d.ts +0 -1
- package/dist/types/code-editor.d.ts +0 -1
- package/dist/types/collapse.d.ts +0 -1
- package/dist/types/condition-editor.d.ts +0 -1
- package/dist/types/contextmenu.d.ts +0 -1
- package/dist/types/css-transition.d.ts +0 -1
- package/dist/types/date-panel.d.ts +0 -1
- package/dist/types/date-picker.d.ts +0 -1
- package/dist/types/date-range-picker.d.ts +0 -1
- package/dist/types/dialog.d.ts +0 -1
- package/dist/types/drawer.d.ts +0 -1
- package/dist/types/dropdown.d.ts +2 -2
- package/dist/types/dual-nav.d.ts +0 -1
- package/dist/types/empty.d.ts +0 -1
- package/dist/types/expression-editor.d.ts +0 -1
- package/dist/types/file-picker.d.ts +0 -1
- package/dist/types/file-viewer.d.ts +0 -1
- package/dist/types/float-button.d.ts +0 -1
- package/dist/types/form-item.d.ts +0 -1
- package/dist/types/form.d.ts +0 -1
- package/dist/types/grid-input.d.ts +0 -1
- package/dist/types/grid.d.ts +1 -2
- package/dist/types/group-input.d.ts +0 -1
- package/dist/types/group-nav.d.ts +0 -1
- package/dist/types/index.d.ts +4 -6
- package/dist/types/input.d.ts +0 -1
- package/dist/types/layout.d.ts +0 -1
- package/dist/types/list.d.ts +0 -1
- package/dist/types/loading.d.ts +0 -1
- package/dist/types/message-confirm.d.ts +48 -5
- package/dist/types/message.d.ts +3 -2
- package/dist/types/multi-auto-complete.d.ts +0 -1
- package/dist/types/multi-select.d.ts +0 -1
- package/dist/types/multi-tree-select.d.ts +0 -1
- package/dist/types/nav.d.ts +0 -1
- package/dist/types/node-render.d.ts +0 -1
- package/dist/types/notification.d.ts +67 -17
- package/dist/types/number-input.d.ts +0 -1
- package/dist/types/number-range-input.d.ts +0 -1
- package/dist/types/paginator.d.ts +0 -1
- package/dist/types/palette.d.ts +0 -1
- package/dist/types/password-input.d.ts +0 -1
- package/dist/types/pop-confirm.d.ts +0 -1
- package/dist/types/pop.d.ts +0 -1
- package/dist/types/progress-nodes.d.ts +0 -1
- package/dist/types/progress.d.ts +0 -1
- package/dist/types/quick-batch-edit.d.ts +0 -1
- package/dist/types/radio-group.d.ts +0 -1
- package/dist/types/radio.d.ts +0 -1
- package/dist/types/rich-text-editor.d.ts +0 -1
- package/dist/types/scroll.d.ts +11 -6
- package/dist/types/select.d.ts +0 -1
- package/dist/types/slider.d.ts +0 -1
- package/dist/types/steps.d.ts +0 -1
- package/dist/types/switch.d.ts +0 -1
- package/dist/types/table-editor.d.ts +0 -1
- package/dist/types/table.d.ts +0 -1
- package/dist/types/tabs.d.ts +2 -2
- package/dist/types/tag.d.ts +0 -1
- package/dist/types/text-editor.d.ts +0 -1
- package/dist/types/textarea.d.ts +0 -1
- package/dist/types/theme.d.ts +0 -1
- package/dist/types/tip.d.ts +0 -1
- package/dist/types/tree-select.d.ts +0 -1
- package/dist/types/tree.d.ts +0 -1
- package/dist/types/watermark.d.ts +0 -1
- package/package.json +19 -19
- package/src/components/message-confirm/index.ts +1 -1
- package/src/components/message-confirm/message-confirm-box.vue +36 -0
- package/src/components/message-confirm/message-confirm.ts +113 -21
- package/src/components/message-confirm/message-confirm.vue +30 -37
- package/src/components/message-confirm/style.scss +10 -12
- package/src/components/notification/index.ts +1 -143
- package/src/components/notification/notification-box.vue +150 -0
- package/src/components/notification/notification.ts +142 -0
- package/src/components/notification/notification.vue +40 -66
- package/src/components/notification/style.scss +65 -38
- package/src/types/message-confirm.ts +52 -3
- package/src/types/notification.ts +71 -15
- package/dist/components/notification/index.js +0 -140
- package/dist/components/notification/index.js.map +0 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { bem, setStyles, zIndex } from '@veltra/utils'
|
|
2
|
+
import { h, render, shallowReactive } from 'vue'
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
Notification,
|
|
6
|
+
NotificationInstance,
|
|
7
|
+
NotificationOptions,
|
|
8
|
+
NotificationPosition
|
|
9
|
+
} from '../../types'
|
|
10
|
+
import UNotificationBox from './notification-box.vue'
|
|
11
|
+
|
|
12
|
+
const cls = bem('notification')
|
|
13
|
+
|
|
14
|
+
/** 通知项数据结构 */
|
|
15
|
+
type NotificationItem = NotificationOptions & { key: string }
|
|
16
|
+
|
|
17
|
+
/** 单个方位的堆叠状态 */
|
|
18
|
+
interface NotificationStack {
|
|
19
|
+
container: HTMLElement | null
|
|
20
|
+
items: NotificationItem[]
|
|
21
|
+
/** 正在显示的通知数 (包含动画执行中) */
|
|
22
|
+
activeCount: number
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** --- 状态管理 --- */
|
|
26
|
+
const stacks: Record<NotificationPosition, NotificationStack> = {
|
|
27
|
+
'top-left': { container: null, items: shallowReactive([]), activeCount: 0 },
|
|
28
|
+
'top-right': { container: null, items: shallowReactive([]), activeCount: 0 },
|
|
29
|
+
'bottom-left': { container: null, items: shallowReactive([]), activeCount: 0 },
|
|
30
|
+
'bottom-right': { container: null, items: shallowReactive([]), activeCount: 0 }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** 通知关闭后回调 */
|
|
34
|
+
const closedCallbacks = new Map<string, () => void>()
|
|
35
|
+
|
|
36
|
+
let uid = 0
|
|
37
|
+
|
|
38
|
+
/** --- 内部辅助函数 --- */
|
|
39
|
+
|
|
40
|
+
/** 彻底销毁容器 */
|
|
41
|
+
const destroy = (stack: NotificationStack) => {
|
|
42
|
+
if (stack.container) {
|
|
43
|
+
render(null, stack.container)
|
|
44
|
+
document.body.removeChild(stack.container)
|
|
45
|
+
stack.container = null
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** 离开动画结束后的清理 */
|
|
50
|
+
const handleClosed = (stack: NotificationStack, key: string) => {
|
|
51
|
+
stack.activeCount--
|
|
52
|
+
|
|
53
|
+
const cb = closedCallbacks.get(key)
|
|
54
|
+
if (cb) {
|
|
55
|
+
cb()
|
|
56
|
+
closedCallbacks.delete(key)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 没有活跃通知时销毁容器,保持页面干净
|
|
60
|
+
if (stack.activeCount === 0) destroy(stack)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** 触发关闭 (仅从数组移除,触发 Transition 离开动画) */
|
|
64
|
+
const handleClose = (stack: NotificationStack, key: string) => {
|
|
65
|
+
const index = stack.items.findIndex((n) => n.key === key)
|
|
66
|
+
if (index !== -1) stack.items.splice(index, 1)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** 挂载并渲染容器 */
|
|
70
|
+
const updateView = (position: NotificationPosition, options: NotificationOptions) => {
|
|
71
|
+
const stack = stacks[position]
|
|
72
|
+
|
|
73
|
+
if (!stack.container) {
|
|
74
|
+
stack.container = document.createElement('div')
|
|
75
|
+
stack.container.className = cls.e('container')
|
|
76
|
+
document.body.appendChild(stack.container)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const offset = options.offset ?? 20
|
|
80
|
+
const [vertical, horizontal] = position.split('-') as ['top' | 'bottom', 'left' | 'right']
|
|
81
|
+
setStyles(stack.container, {
|
|
82
|
+
position: 'fixed',
|
|
83
|
+
zIndex: options.zIndex ?? zIndex(),
|
|
84
|
+
[vertical]: `${offset}px`,
|
|
85
|
+
[horizontal]: `${offset}px`
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
const vnode = h(UNotificationBox, {
|
|
89
|
+
notifications: stack.items,
|
|
90
|
+
position,
|
|
91
|
+
onClosed: (key: string) => handleClosed(stack, key),
|
|
92
|
+
onClose: (key: string) => handleClose(stack, key)
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
vnode.appContext = notification._context
|
|
96
|
+
render(vnode, stack.container)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** 创建通知实例 */
|
|
100
|
+
const createNotification = (options: NotificationOptions): NotificationInstance => {
|
|
101
|
+
const { onClosed: userOnClosed, position = 'bottom-right', ...notificationOptions } = options
|
|
102
|
+
const stack = stacks[position]
|
|
103
|
+
const id = `notification_${uid++}`
|
|
104
|
+
stack.activeCount++
|
|
105
|
+
|
|
106
|
+
// 生命周期 Promise
|
|
107
|
+
let resolveClosed: () => void
|
|
108
|
+
const onClosed = new Promise<void>((r) => (resolveClosed = r))
|
|
109
|
+
|
|
110
|
+
closedCallbacks.set(id, () => {
|
|
111
|
+
userOnClosed?.()
|
|
112
|
+
resolveClosed()
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
stack.items.push({ ...notificationOptions, position, key: id })
|
|
116
|
+
updateView(position, options)
|
|
117
|
+
|
|
118
|
+
return { id, close: () => handleClose(stack, id), onClosed }
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** --- 导出 API --- */
|
|
122
|
+
|
|
123
|
+
export const notification = ((options) => {
|
|
124
|
+
return createNotification(typeof options === 'string' ? { message: options } : options)
|
|
125
|
+
}) as Notification
|
|
126
|
+
|
|
127
|
+
notification._context = null
|
|
128
|
+
|
|
129
|
+
// 挂载快捷方法: notification.success(...)
|
|
130
|
+
const notificationTypes = ['primary', 'success', 'info', 'warning', 'danger'] as const
|
|
131
|
+
notificationTypes.forEach((type) => {
|
|
132
|
+
notification[type] = (msg, config) => notification({ ...config, message: msg, type })
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
/** 关闭所有通知,可指定方位 */
|
|
136
|
+
notification.closeAll = (position?: NotificationPosition) => {
|
|
137
|
+
if (position) {
|
|
138
|
+
stacks[position].items.splice(0)
|
|
139
|
+
return
|
|
140
|
+
}
|
|
141
|
+
;(Object.keys(stacks) as NotificationPosition[]).forEach((p) => stacks[p].items.splice(0))
|
|
142
|
+
}
|
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
:
|
|
4
|
-
@
|
|
5
|
-
@
|
|
2
|
+
<div
|
|
3
|
+
:class="[cls.b, cls.m(size), cls.e(type)]"
|
|
4
|
+
@mouseenter="suspendTimer"
|
|
5
|
+
@mouseleave="startTimer"
|
|
6
6
|
>
|
|
7
|
-
<div
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<div :class="cls.e('content')">
|
|
18
|
-
<div :class="cls.em('content', 'title')">{{ title }}</div>
|
|
19
|
-
<div :class="cls.em('content', 'message')">{{ message }}</div>
|
|
20
|
-
<div :class="cls.em('content', 'button')" v-if="buttonText">
|
|
21
|
-
<UButton :type="type" plain @click="handleClick">{{ buttonText }}</UButton>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
<div :class="cls.e('close')" v-if="closable" @click.stop="close">
|
|
25
|
-
<UIcon><Close /></UIcon>
|
|
7
|
+
<div :class="cls.e('icon')">
|
|
8
|
+
<UIcon>
|
|
9
|
+
<component :is="typeIcon" />
|
|
10
|
+
</UIcon>
|
|
11
|
+
</div>
|
|
12
|
+
<div :class="cls.e('content')">
|
|
13
|
+
<div :class="cls.em('content', 'title')" v-if="title">{{ title }}</div>
|
|
14
|
+
<div :class="cls.em('content', 'message')" v-if="message">{{ message }}</div>
|
|
15
|
+
<div :class="cls.em('content', 'button')" v-if="buttonText">
|
|
16
|
+
<UButton :type="type" plain @click="(e) => emit('action', e)">{{ buttonText }}</UButton>
|
|
26
17
|
</div>
|
|
27
18
|
</div>
|
|
28
|
-
|
|
19
|
+
<div :class="cls.e('close')" v-if="closable || duration === 0" @click.stop="emit('close')">
|
|
20
|
+
<UIcon><Close /></UIcon>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
29
23
|
</template>
|
|
30
24
|
|
|
31
25
|
<script lang="ts" setup>
|
|
@@ -39,9 +33,9 @@ import {
|
|
|
39
33
|
WarningFilled
|
|
40
34
|
} from '@veltra/icons/normal'
|
|
41
35
|
import { bem } from '@veltra/utils'
|
|
42
|
-
import {
|
|
36
|
+
import { computed, onBeforeUnmount, onMounted } from 'vue'
|
|
43
37
|
|
|
44
|
-
import type {
|
|
38
|
+
import type { NotificationEmits, NotificationProps, ColorType } from '../../types'
|
|
45
39
|
import { UButton } from '../button'
|
|
46
40
|
import { UIcon } from '../icon'
|
|
47
41
|
|
|
@@ -50,11 +44,11 @@ defineOptions({ name: 'UNotification' })
|
|
|
50
44
|
const props = withDefaults(defineProps<NotificationProps>(), {
|
|
51
45
|
closable: false,
|
|
52
46
|
duration: 4500,
|
|
53
|
-
|
|
54
|
-
buttonText: '',
|
|
55
|
-
position: 'bottom-right'
|
|
47
|
+
buttonText: ''
|
|
56
48
|
})
|
|
57
49
|
|
|
50
|
+
const emit = defineEmits<NotificationEmits>()
|
|
51
|
+
|
|
58
52
|
const { type, size } = useFallbackProps([props], { type: 'primary' as ColorType, size: 'default' })
|
|
59
53
|
|
|
60
54
|
const typeIcon = computed(() => {
|
|
@@ -72,47 +66,27 @@ const typeIcon = computed(() => {
|
|
|
72
66
|
|
|
73
67
|
const cls = bem('notification')
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
onMounted(() => {
|
|
78
|
-
visible.value = true
|
|
79
|
-
startTimer()
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
const close = () => {
|
|
83
|
-
visible.value = false
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const customStyle = computed<CSSProperties>(() => {
|
|
87
|
-
return props.offset > 0
|
|
88
|
-
? {
|
|
89
|
-
[`${props.position.split('-')[0]}`]: `${props.offset}px`,
|
|
90
|
-
zIndex: props.zIndex,
|
|
91
|
-
transform:
|
|
92
|
-
props.position.split('-')[0] === 'bottom'
|
|
93
|
-
? `translateY(-${props.offset}px)`
|
|
94
|
-
: `translateY(${props.offset}px)`,
|
|
95
|
-
transition: `opacity 0.3s, transform 0.4s, top 0.4s`
|
|
96
|
-
}
|
|
97
|
-
: { [`${props.position.split('-')[0]}`]: `${props.offset}px`, zIndex: props.zIndex }
|
|
98
|
-
})
|
|
99
|
-
|
|
69
|
+
/** 剩余时长制的自动关闭计时器, 悬停暂停 */
|
|
70
|
+
let startTime = 0
|
|
100
71
|
let timer = 0
|
|
72
|
+
let restDuration = 0
|
|
101
73
|
|
|
102
|
-
|
|
103
|
-
if (props.duration)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, props.duration)
|
|
107
|
-
}
|
|
74
|
+
function startTimer() {
|
|
75
|
+
if (!props.duration) return
|
|
76
|
+
startTime = Date.now()
|
|
77
|
+
timer = setTimeout(() => emit('close'), restDuration)
|
|
108
78
|
}
|
|
109
79
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
close()
|
|
80
|
+
function suspendTimer() {
|
|
81
|
+
if (!props.duration) return
|
|
82
|
+
clearTimeout(timer)
|
|
83
|
+
restDuration -= Date.now() - startTime
|
|
115
84
|
}
|
|
116
85
|
|
|
117
|
-
|
|
86
|
+
onMounted(() => {
|
|
87
|
+
restDuration = props.duration
|
|
88
|
+
startTimer()
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
onBeforeUnmount(() => clearTimeout(timer))
|
|
118
92
|
</script>
|
|
@@ -1,48 +1,53 @@
|
|
|
1
1
|
@use 'pkg:@veltra/styles/mixins' as m;
|
|
2
2
|
@use 'pkg:@veltra/styles/functions' as fn;
|
|
3
|
-
@use 'pkg:@veltra/styles/vars';
|
|
4
|
-
@use 'sass:
|
|
3
|
+
@use 'pkg:@veltra/styles/vars' as vars;
|
|
4
|
+
@use 'sass:list';
|
|
5
5
|
|
|
6
6
|
// 方便拼接
|
|
7
7
|
$root-name: notification;
|
|
8
|
-
|
|
8
|
+
// 方位 => (垂直锚边, 水平锚边)
|
|
9
|
+
$stack-positions: (
|
|
10
|
+
'bottom-right': (bottom, right),
|
|
11
|
+
'bottom-left': (bottom, left),
|
|
12
|
+
'top-right': (top, right),
|
|
13
|
+
'top-left': (top, left)
|
|
14
|
+
);
|
|
9
15
|
|
|
10
16
|
@include m.b($root-name) {
|
|
11
17
|
display: flex;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
opacity 0.3s,
|
|
16
|
-
transform 0.4s,
|
|
17
|
-
top 0.4s;
|
|
18
|
+
position: relative;
|
|
19
|
+
width: 380px;
|
|
20
|
+
max-width: calc(100vw - 40px);
|
|
18
21
|
border: fn.use-var(border);
|
|
19
22
|
background-color: fn.use-var(bg-color, top);
|
|
20
23
|
box-shadow: fn.use-var(shadow, lg);
|
|
21
|
-
|
|
24
|
+
color: fn.use-var(text-color, main);
|
|
22
25
|
overflow: hidden;
|
|
26
|
+
transition:
|
|
27
|
+
transform fn.use-var(transition, normal) fn.use-var(transition, ease),
|
|
28
|
+
opacity fn.use-var(transition, normal) fn.use-var(transition, ease);
|
|
23
29
|
|
|
24
30
|
@include m.size using ($size) {
|
|
25
31
|
border-radius: fn.use-var(radius, $size);
|
|
26
32
|
padding: calc(fn.use-var(gap, $size) * 1.2);
|
|
27
33
|
|
|
28
|
-
@include m.bem($root-name, icon) {
|
|
29
|
-
}
|
|
30
|
-
|
|
31
34
|
@include m.bem($root-name, content) {
|
|
32
|
-
max-width: 400px;
|
|
33
35
|
word-wrap: break-word;
|
|
34
36
|
margin-left: fn.use-var(gap, $size);
|
|
35
37
|
text-align: left;
|
|
38
|
+
|
|
36
39
|
&--title {
|
|
37
40
|
font-size: fn.use-var('font-size', title, $size);
|
|
38
41
|
font-weight: bold;
|
|
39
42
|
}
|
|
43
|
+
|
|
40
44
|
&--message {
|
|
41
45
|
font-size: fn.use-var('font-size', main, $size);
|
|
42
46
|
}
|
|
47
|
+
|
|
43
48
|
&--button {
|
|
44
49
|
text-align: right;
|
|
45
|
-
margin-top: fn.use-var(gap, size);
|
|
50
|
+
margin-top: fn.use-var(gap, $size);
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
|
|
@@ -51,45 +56,67 @@ $positions: ('top-left', 'top-right', 'bottom-left', 'bottom-right');
|
|
|
51
56
|
position: absolute;
|
|
52
57
|
right: fn.use-var(gap, $size);
|
|
53
58
|
top: fn.use-var(gap, $size);
|
|
59
|
+
|
|
54
60
|
&:hover {
|
|
55
61
|
color: fn.use-var(color, primary, 'dark-9');
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
|
|
66
|
+
// 类型色仅作用于图标
|
|
60
67
|
@each $type, $_ in vars.$color-types {
|
|
61
68
|
@include m.e($type) {
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
@include m.bem($root-name, icon) {
|
|
70
|
+
color: fn.use-var(color, $type);
|
|
71
|
+
}
|
|
64
72
|
}
|
|
65
73
|
}
|
|
66
74
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
// 堆叠容器
|
|
76
|
+
@include m.e(stack) {
|
|
77
|
+
position: relative;
|
|
78
|
+
width: 380px;
|
|
79
|
+
max-width: calc(100vw - 40px);
|
|
80
|
+
transition: height fn.use-var(transition, normal) fn.use-var(transition, ease);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 卡片定位层
|
|
84
|
+
@include m.e(item) {
|
|
85
|
+
position: absolute;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// 各方位锚定与堆叠缩放原点
|
|
90
|
+
@each $position, $edges in $stack-positions {
|
|
91
|
+
@include m.bem($root-name, stack, $position) {
|
|
92
|
+
@include m.bem($root-name, item) {
|
|
93
|
+
#{list.nth($edges, 1)}: 0;
|
|
94
|
+
#{list.nth($edges, 2)}: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@include m.bem($root-name) {
|
|
98
|
+
transform-origin: center #{list.nth($edges, 1)};
|
|
82
99
|
}
|
|
83
100
|
}
|
|
84
101
|
}
|
|
85
102
|
|
|
86
|
-
.#{$root-name}-
|
|
87
|
-
.#{$root-name}-
|
|
103
|
+
.#{$root-name}-bottom-enter-active,
|
|
104
|
+
.#{$root-name}-bottom-leave-active,
|
|
105
|
+
.#{$root-name}-top-enter-active,
|
|
106
|
+
.#{$root-name}-top-leave-active {
|
|
107
|
+
transition:
|
|
108
|
+
opacity fn.use-var(transition, normal) fn.use-var(transition, ease),
|
|
109
|
+
transform fn.use-var(transition, normal) fn.use-var(transition, ease-out);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.#{$root-name}-bottom-enter-from,
|
|
113
|
+
.#{$root-name}-bottom-leave-to {
|
|
88
114
|
opacity: 0;
|
|
89
|
-
transform:
|
|
115
|
+
transform: translateY(100%);
|
|
90
116
|
}
|
|
91
|
-
|
|
92
|
-
.#{$root-name}-
|
|
117
|
+
|
|
118
|
+
.#{$root-name}-top-enter-from,
|
|
119
|
+
.#{$root-name}-top-leave-to {
|
|
93
120
|
opacity: 0;
|
|
94
|
-
transform:
|
|
121
|
+
transform: translateY(-100%);
|
|
95
122
|
}
|
|
@@ -1,19 +1,68 @@
|
|
|
1
1
|
import type { ColorType, ComponentProps, DeconstructValue } from '@veltra/utils'
|
|
2
|
+
import type { AppContext } from 'vue'
|
|
3
|
+
|
|
4
|
+
/** 消息确认框用户操作 */
|
|
5
|
+
export type MessageConfirmAction = 'confirm' | 'cancel'
|
|
2
6
|
|
|
3
7
|
/** 消息确认框组件属性 */
|
|
4
8
|
export interface MessageConfirmProps extends ComponentProps {
|
|
5
|
-
|
|
9
|
+
/** 标题 */
|
|
6
10
|
title?: string
|
|
11
|
+
/** 内容 */
|
|
7
12
|
message: string
|
|
13
|
+
/** 确认按钮文字 */
|
|
8
14
|
confirmButtonText?: string
|
|
15
|
+
/** 取消按钮文字,为空则不显示 */
|
|
9
16
|
cancelButtonText?: string
|
|
17
|
+
/** 确认按钮类型 */
|
|
10
18
|
confirmButtonType?: ColorType
|
|
11
|
-
|
|
19
|
+
/** 层级,默认由 API 创建时自增分配 */
|
|
20
|
+
zIndex?: number
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** 消息确认框调用选项 */
|
|
24
|
+
export interface MessageConfirmOptions extends MessageConfirmProps {
|
|
25
|
+
/** 点击按钮触发关闭时回调 */
|
|
26
|
+
onClose?: (action: MessageConfirmAction) => void
|
|
27
|
+
/** 关闭动画结束后回调 */
|
|
28
|
+
onClosed?: (action: MessageConfirmAction) => void
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 消息确认框实例 */
|
|
32
|
+
export interface MessageConfirmInstance {
|
|
33
|
+
/** 唯一标识 */
|
|
34
|
+
id: string
|
|
35
|
+
/** 手动关闭,未指定操作时视为 cancel */
|
|
36
|
+
close(action?: MessageConfirmAction): void
|
|
37
|
+
/** 彻底关闭(含动画结束)后的 Promise,值为用户操作 */
|
|
38
|
+
onClosed: Promise<MessageConfirmAction>
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type MessageConfirmShortcutConfig = Omit<MessageConfirmOptions, 'message' | 'confirmButtonType'>
|
|
42
|
+
|
|
43
|
+
/** 消息确认框函数式 API */
|
|
44
|
+
export interface MessageConfirm {
|
|
45
|
+
/** 创建确认框 */
|
|
46
|
+
(options: MessageConfirmOptions | string): MessageConfirmInstance
|
|
47
|
+
/** 主要确认框 */
|
|
48
|
+
primary(message: string, config?: MessageConfirmShortcutConfig): MessageConfirmInstance
|
|
49
|
+
/** 成功确认框 */
|
|
50
|
+
success(message: string, config?: MessageConfirmShortcutConfig): MessageConfirmInstance
|
|
51
|
+
/** 信息确认框 */
|
|
52
|
+
info(message: string, config?: MessageConfirmShortcutConfig): MessageConfirmInstance
|
|
53
|
+
/** 警告确认框 */
|
|
54
|
+
warning(message: string, config?: MessageConfirmShortcutConfig): MessageConfirmInstance
|
|
55
|
+
/** 危险确认框 */
|
|
56
|
+
danger(message: string, config?: MessageConfirmShortcutConfig): MessageConfirmInstance
|
|
57
|
+
/** 关闭所有确认框 */
|
|
58
|
+
closeAll(): void
|
|
59
|
+
/** 设置全局渲染上下文 */
|
|
60
|
+
_context: AppContext | null
|
|
12
61
|
}
|
|
13
62
|
|
|
14
63
|
/** 消息确认框组件定义的事件 */
|
|
15
64
|
export interface MessageConfirmEmits {
|
|
16
|
-
(e: '
|
|
65
|
+
(e: 'close', action: MessageConfirmAction): void
|
|
17
66
|
}
|
|
18
67
|
|
|
19
68
|
/** 消息确认框组件暴露的属性和方法(组件内部使用) */
|
|
@@ -1,32 +1,88 @@
|
|
|
1
|
-
import type { ColorType, DeconstructValue } from '@veltra/utils'
|
|
2
|
-
import type {
|
|
1
|
+
import type { ColorType, ComponentSize, DeconstructValue } from '@veltra/utils'
|
|
2
|
+
import type { AppContext, DefineComponent } from 'vue'
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/** 通知弹出位置 */
|
|
5
|
+
export type NotificationPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
6
|
+
|
|
7
|
+
/** 通知组件属性 */
|
|
5
8
|
export interface NotificationProps {
|
|
6
|
-
|
|
9
|
+
/** 标题 */
|
|
7
10
|
title?: string
|
|
11
|
+
/** 内容 */
|
|
8
12
|
message?: string
|
|
13
|
+
/** 类型 */
|
|
9
14
|
type?: ColorType
|
|
15
|
+
/** 是否显示关闭按钮 */
|
|
10
16
|
closable?: boolean
|
|
17
|
+
/**
|
|
18
|
+
* 自动关闭时长, 单位ms, 0 表示常驻
|
|
19
|
+
* @default 4500
|
|
20
|
+
*/
|
|
11
21
|
duration?: number
|
|
12
|
-
|
|
13
|
-
onClose?: (vm: RendererElement) => void
|
|
14
|
-
onClick?: (e: MouseEvent) => void
|
|
15
|
-
id?: string
|
|
22
|
+
/** 图标 */
|
|
16
23
|
icon?: DefineComponent
|
|
17
|
-
|
|
24
|
+
/** 操作按钮文字,为空则不显示 */
|
|
18
25
|
buttonText?: string
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
/** 尺寸 */
|
|
27
|
+
size?: ComponentSize
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** 通知调用选项 */
|
|
31
|
+
export interface NotificationOptions extends NotificationProps {
|
|
32
|
+
/** 弹出位置 */
|
|
33
|
+
position?: NotificationPosition
|
|
34
|
+
/** 距离屏幕边缘的偏移, 单位px */
|
|
35
|
+
offset?: number
|
|
36
|
+
/** 层级,默认由 API 创建时自增分配 */
|
|
37
|
+
zIndex?: number
|
|
38
|
+
/** 点击操作按钮时回调 */
|
|
39
|
+
onClick?: (e: MouseEvent) => void
|
|
40
|
+
/** 触发关闭时回调 */
|
|
41
|
+
onClose?: () => void
|
|
42
|
+
/** 关闭动画结束后回调 */
|
|
43
|
+
onClosed?: () => void
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** 通知实例 */
|
|
47
|
+
export interface NotificationInstance {
|
|
48
|
+
/** 唯一标识 */
|
|
49
|
+
id: string
|
|
50
|
+
/** 手动关闭 */
|
|
51
|
+
close(): void
|
|
52
|
+
/** 彻底关闭(含动画结束)后的 Promise */
|
|
53
|
+
onClosed: Promise<void>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type NotificationShortcutConfig = Omit<NotificationOptions, 'type' | 'message'>
|
|
57
|
+
|
|
58
|
+
/** 通知函数式 API */
|
|
59
|
+
export interface Notification {
|
|
60
|
+
/** 创建通知 */
|
|
61
|
+
(options: NotificationOptions | string): NotificationInstance
|
|
62
|
+
/** 主要通知 */
|
|
63
|
+
primary(message: string, config?: NotificationShortcutConfig): NotificationInstance
|
|
64
|
+
/** 成功通知 */
|
|
65
|
+
success(message: string, config?: NotificationShortcutConfig): NotificationInstance
|
|
66
|
+
/** 信息通知 */
|
|
67
|
+
info(message: string, config?: NotificationShortcutConfig): NotificationInstance
|
|
68
|
+
/** 警告通知 */
|
|
69
|
+
warning(message: string, config?: NotificationShortcutConfig): NotificationInstance
|
|
70
|
+
/** 危险通知 */
|
|
71
|
+
danger(message: string, config?: NotificationShortcutConfig): NotificationInstance
|
|
72
|
+
/** 关闭所有通知,可指定位置 */
|
|
73
|
+
closeAll(position?: NotificationPosition): void
|
|
74
|
+
/** 设置全局渲染上下文 */
|
|
75
|
+
_context: AppContext | null
|
|
21
76
|
}
|
|
22
77
|
|
|
23
|
-
/**
|
|
78
|
+
/** 通知组件定义的事件 */
|
|
24
79
|
export interface NotificationEmits {
|
|
25
|
-
(e: '
|
|
80
|
+
(e: 'close'): void
|
|
81
|
+
(e: 'action', evt: MouseEvent): void
|
|
26
82
|
}
|
|
27
83
|
|
|
28
|
-
/**
|
|
84
|
+
/** 通知组件暴露的属性和方法(组件内部使用) */
|
|
29
85
|
export interface _NotificationExposed {}
|
|
30
86
|
|
|
31
|
-
/**
|
|
87
|
+
/** 通知组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
|
|
32
88
|
export type NotificationExposed = DeconstructValue<_NotificationExposed>
|