@vaebe/ccui 2.0.1-beta.2 → 2.0.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/affix/index.d.ts +10 -0
- package/affix/src/affix-types.d.ts +20 -0
- package/affix/src/affix.d.ts +20 -0
- package/alert/index.d.ts +10 -0
- package/alert/src/alert-types.d.ts +48 -0
- package/alert/src/alert.d.ts +36 -0
- package/anchor/index.d.ts +10 -0
- package/anchor/src/anchor-types.d.ts +37 -0
- package/anchor/src/anchor.d.ts +31 -0
- package/auto-complete/index.d.ts +10 -0
- package/auto-complete/index.es.js +1986 -0
- package/auto-complete/index.umd.js +1 -0
- package/auto-complete/src/auto-complete-types.d.ts +134 -0
- package/auto-complete/src/auto-complete.d.ts +94 -0
- package/auto-complete/style.css +2 -0
- package/avatar/index.d.ts +10 -0
- package/avatar/src/avatar-types.d.ts +53 -0
- package/avatar/src/avatar.d.ts +36 -0
- package/avatar/src/components/icon-body.d.ts +4 -0
- package/avatar/src/components/icon-img-error.d.ts +4 -0
- package/avatar/src/components/icon-nobody.d.ts +4 -0
- package/avatar/src/composables/use-get-background-color.d.ts +1 -0
- package/avatar/src/composables/use-get-display-name.d.ts +1 -0
- package/avatar-group/index.d.ts +12 -0
- package/avatar-group/index.es.js +119 -0
- package/avatar-group/index.umd.js +1 -0
- package/avatar-group/src/avatar-group-types.d.ts +56 -0
- package/avatar-group/src/avatar-group.d.ts +27 -0
- package/avatar-group/style.css +2 -0
- package/badge/index.d.ts +10 -0
- package/badge/src/badge-types.d.ts +52 -0
- package/badge/src/badge.d.ts +36 -0
- package/badge-ribbon/index.d.ts +12 -0
- package/badge-ribbon/index.es.js +84 -0
- package/badge-ribbon/index.umd.js +1 -0
- package/badge-ribbon/src/badge-ribbon-types.d.ts +30 -0
- package/badge-ribbon/src/badge-ribbon.d.ts +17 -0
- package/badge-ribbon/style.css +2 -0
- package/breadcrumb/index.d.ts +10 -0
- package/breadcrumb/src/breadcrumb-types.d.ts +29 -0
- package/breadcrumb/src/breadcrumb.d.ts +21 -0
- package/button/index.d.ts +12 -0
- package/button/src/button-group.d.ts +12 -0
- package/button/src/button-types.d.ts +168 -0
- package/button/src/button.d.ts +75 -0
- package/button-3d/index.d.ts +10 -0
- package/button-3d/src/button-3d-types.d.ts +27 -0
- package/button-3d/src/button-3d.d.ts +23 -0
- package/calendar/index.d.ts +10 -0
- package/calendar/src/calendar-types.d.ts +56 -0
- package/calendar/src/calendar.d.ts +27 -0
- package/card/index.d.ts +10 -0
- package/card/src/card-types.d.ts +34 -0
- package/card/src/card.d.ts +21 -0
- package/card-meta/index.d.ts +11 -0
- package/card-meta/index.es.js +53 -0
- package/card-meta/index.umd.js +1 -0
- package/card-meta/src/card-meta-types.d.ts +19 -0
- package/card-meta/src/card-meta.d.ts +14 -0
- package/card-meta/style.css +2 -0
- package/carousel/index.d.ts +10 -0
- package/carousel/index.es.js +306 -0
- package/carousel/index.umd.js +1 -0
- package/carousel/src/carousel-types.d.ts +72 -0
- package/carousel/src/carousel.d.ts +58 -0
- package/carousel/style.css +2 -0
- package/cascader/index.d.ts +12 -0
- package/cascader/index.es.js +2267 -0
- package/cascader/index.umd.js +1 -0
- package/cascader/src/cascader-types.d.ts +214 -0
- package/cascader/src/cascader.d.ts +133 -0
- package/cascader/style.css +2 -0
- package/check-box/index.d.ts +10 -0
- package/check-box/src/check-box-group.d.ts +31 -0
- package/check-box/src/check-box-types.d.ts +74 -0
- package/check-box/src/check-box.d.ts +28 -0
- package/check-box/src/components/icon-active.d.ts +2 -0
- package/check-box/src/components/icon-default.d.ts +2 -0
- package/checkable-tag/index.d.ts +13 -0
- package/checkable-tag/index.es.js +141 -0
- package/checkable-tag/index.umd.js +1 -0
- package/checkable-tag/src/checkable-tag-group.d.ts +26 -0
- package/checkable-tag/src/checkable-tag-types.d.ts +83 -0
- package/checkable-tag/src/checkable-tag.d.ts +20 -0
- package/checkable-tag/style.css +2 -0
- package/collapse/index.d.ts +11 -0
- package/collapse/src/collapse-item.d.ts +16 -0
- package/collapse/src/collapse-types.d.ts +52 -0
- package/collapse/src/collapse.d.ts +24 -0
- package/color-picker/index.d.ts +10 -0
- package/color-picker/index.es.js +1881 -0
- package/color-picker/index.umd.js +1 -0
- package/color-picker/src/color-picker-types.d.ts +121 -0
- package/color-picker/src/color-picker.d.ts +75 -0
- package/color-picker/style.css +2 -0
- package/config-provider/index.d.ts +10 -0
- package/config-provider/src/config-provider-types.d.ts +131 -0
- package/config-provider/src/config-provider.d.ts +24 -0
- package/date-picker/index.d.ts +10 -0
- package/date-picker/src/date-picker-types.d.ts +179 -0
- package/date-picker/src/date-picker.d.ts +113 -0
- package/descriptions/index.d.ts +11 -0
- package/descriptions/src/descriptions-item.d.ts +19 -0
- package/descriptions/src/descriptions-types.d.ts +64 -0
- package/descriptions/src/descriptions.d.ts +31 -0
- package/divider/index.d.ts +10 -0
- package/divider/src/divider-types.d.ts +31 -0
- package/divider/src/divider.d.ts +24 -0
- package/drawer/index.d.ts +10 -0
- package/drawer/src/drawer-types.d.ts +155 -0
- package/drawer/src/drawer.d.ts +79 -0
- package/dropdown/index.d.ts +10 -0
- package/dropdown/index.es.js +2 -2
- package/dropdown/index.umd.js +1 -1
- package/dropdown/src/dropdown-types.d.ts +41 -0
- package/dropdown/src/dropdown.d.ts +32 -0
- package/empty/index.d.ts +10 -0
- package/empty/src/empty-types.d.ts +16 -0
- package/empty/src/empty.d.ts +15 -0
- package/flex/index.d.ts +10 -0
- package/flex/src/flex-types.d.ts +36 -0
- package/flex/src/flex.d.ts +29 -0
- package/float-button/index.d.ts +11 -0
- package/float-button/src/back-top.d.ts +26 -0
- package/float-button/src/float-button-types.d.ts +65 -0
- package/float-button/src/float-button.d.ts +32 -0
- package/form/index.d.ts +14 -0
- package/form/src/form-item.d.ts +72 -0
- package/form/src/form-list.d.ts +12 -0
- package/form/src/form-provider.d.ts +7 -0
- package/form/src/form-types.d.ts +360 -0
- package/form/src/form.d.ts +64 -0
- package/form/src/utils.d.ts +10 -0
- package/grid/index.d.ts +10 -0
- package/grid/src/grid-types.d.ts +90 -0
- package/grid/src/grid.d.ts +58 -0
- package/icon/index.d.ts +12 -0
- package/icon/src/icon-registry.d.ts +5 -0
- package/icon/src/icon-types.d.ts +95 -0
- package/icon/src/icon.d.ts +63 -0
- package/image/index.d.ts +10 -0
- package/image/src/image-types.d.ts +56 -0
- package/image/src/image.d.ts +42 -0
- package/image-preview-group/index.d.ts +11 -0
- package/image-preview-group/index.es.js +162 -0
- package/image-preview-group/index.umd.js +1 -0
- package/image-preview-group/src/image-preview-group-types.d.ts +51 -0
- package/image-preview-group/src/image-preview-group.d.ts +25 -0
- package/image-preview-group/style.css +2 -0
- package/index.d.ts +93 -7
- package/input/index.d.ts +10 -0
- package/input/src/input-types.d.ts +164 -0
- package/input/src/input.d.ts +74 -0
- package/input-number/index.d.ts +10 -0
- package/input-number/src/input-number-types.d.ts +165 -0
- package/input-number/src/input-number.d.ts +66 -0
- package/input-otp/index.d.ts +11 -0
- package/input-otp/index.es.js +186 -0
- package/input-otp/index.umd.js +1 -0
- package/input-otp/src/input-otp-types.d.ts +68 -0
- package/input-otp/src/input-otp.d.ts +40 -0
- package/input-otp/style.css +2 -0
- package/input-search/index.d.ts +11 -0
- package/input-search/index.es.js +1228 -0
- package/input-search/index.umd.js +1 -0
- package/input-search/src/input-search-types.d.ts +106 -0
- package/input-search/src/input-search.d.ts +84 -0
- package/input-search/style.css +2 -0
- package/layout/index.d.ts +10 -0
- package/layout/src/layout-types.d.ts +70 -0
- package/layout/src/layout.d.ts +56 -0
- package/masonry/index.d.ts +10 -0
- package/masonry/src/masonry-types.d.ts +19 -0
- package/masonry/src/masonry.d.ts +16 -0
- package/mentions/index.d.ts +10 -0
- package/mentions/index.es.js +711 -0
- package/mentions/index.umd.js +1 -0
- package/mentions/src/mentions-types.d.ts +124 -0
- package/mentions/src/mentions.d.ts +79 -0
- package/mentions/style.css +2 -0
- package/menu/index.d.ts +10 -0
- package/menu/src/menu-types.d.ts +109 -0
- package/menu/src/menu.d.ts +63 -0
- package/message/index.d.ts +22 -0
- package/message/src/message-item.d.ts +46 -0
- package/message/src/message-types.d.ts +86 -0
- package/message/src/message.d.ts +21 -0
- package/message/src/use-message.d.ts +35 -0
- package/modal/index.d.ts +24 -0
- package/modal/src/confirm-types.d.ts +30 -0
- package/modal/src/confirm.d.ts +17 -0
- package/modal/src/modal-types.d.ts +175 -0
- package/modal/src/modal.d.ts +99 -0
- package/modal/src/use-modal.d.ts +34 -0
- package/notification/index.d.ts +21 -0
- package/notification/src/notification-item.d.ts +49 -0
- package/notification/src/notification-types.d.ts +91 -0
- package/notification/src/notification.d.ts +20 -0
- package/notification/src/use-notification.d.ts +34 -0
- package/package.json +611 -12
- package/pagination/index.d.ts +10 -0
- package/pagination/index.es.js +4 -2
- package/pagination/index.umd.js +1 -1
- package/pagination/src/pagination-types.d.ts +49 -0
- package/pagination/src/pagination.d.ts +43 -0
- package/popconfirm/index.d.ts +10 -0
- package/popconfirm/src/popconfirm-types.d.ts +82 -0
- package/popconfirm/src/popconfirm.d.ts +55 -0
- package/popover/index.d.ts +10 -0
- package/popover/src/popover-types.d.ts +235 -0
- package/popover/src/popover.d.ts +130 -0
- package/progress/index.d.ts +10 -0
- package/progress/src/progress-types.d.ts +48 -0
- package/progress/src/progress.d.ts +37 -0
- package/radio/index.d.ts +11 -0
- package/radio/src/components/icon-active.d.ts +2 -0
- package/radio/src/components/icon-circle.d.ts +2 -0
- package/radio/src/radio-group.d.ts +21 -0
- package/radio/src/radio-types.d.ts +55 -0
- package/radio/src/radio.d.ts +24 -0
- package/range-picker/index.d.ts +10 -0
- package/range-picker/index.es.js +2415 -0
- package/range-picker/index.umd.js +1 -0
- package/range-picker/src/range-picker-types.d.ts +169 -0
- package/range-picker/src/range-picker.d.ts +112 -0
- package/range-picker/style.css +2 -0
- package/rate/index.d.ts +10 -0
- package/rate/src/components/icon-default.d.ts +2 -0
- package/rate/src/rate-types.d.ts +34 -0
- package/rate/src/rate.d.ts +30 -0
- package/result/index.d.ts +10 -0
- package/result/src/result-types.d.ts +21 -0
- package/result/src/result.d.ts +18 -0
- package/segmented/index.d.ts +10 -0
- package/segmented/src/segmented-types.d.ts +32 -0
- package/segmented/src/segmented.d.ts +25 -0
- package/select/index.d.ts +10 -0
- package/select/src/composables/use-select.d.ts +29 -0
- package/select/src/select-types.d.ts +215 -0
- package/select/src/select.d.ts +149 -0
- package/skeleton/index.d.ts +10 -0
- package/skeleton/src/skeleton-types.d.ts +39 -0
- package/skeleton/src/skeleton.d.ts +27 -0
- package/skeleton-node/index.d.ts +11 -0
- package/skeleton-node/index.es.js +71 -0
- package/skeleton-node/index.umd.js +1 -0
- package/skeleton-node/src/skeleton-node-types.d.ts +23 -0
- package/skeleton-node/src/skeleton-node.d.ts +17 -0
- package/skeleton-node/style.css +2 -0
- package/slider/index.d.ts +10 -0
- package/slider/index.es.js +3 -3
- package/slider/index.umd.js +1 -1
- package/slider/src/composables/use-slider-tooltip.d.ts +18 -0
- package/slider/src/composables/use-slider.d.ts +68 -0
- package/slider/src/slider-types.d.ts +112 -0
- package/slider/src/slider.d.ts +149 -0
- package/space/index.d.ts +10 -0
- package/space/src/space-types.d.ts +28 -0
- package/space/src/space.d.ts +21 -0
- package/space-compact/index.d.ts +11 -0
- package/space-compact/index.es.js +59 -0
- package/space-compact/index.umd.js +1 -0
- package/space-compact/src/space-compact-types.d.ts +27 -0
- package/space-compact/src/space-compact.d.ts +15 -0
- package/space-compact/style.css +2 -0
- package/spin/index.d.ts +10 -0
- package/spin/src/spin-types.d.ts +29 -0
- package/spin/src/spin.d.ts +24 -0
- package/splitter/index.d.ts +10 -0
- package/splitter/src/splitter-types.d.ts +70 -0
- package/splitter/src/splitter.d.ts +62 -0
- package/status/index.d.ts +10 -0
- package/status/src/status-types.d.ts +10 -0
- package/status/src/status.d.ts +9 -0
- package/steps/index.d.ts +10 -0
- package/steps/src/steps-types.d.ts +48 -0
- package/steps/src/steps.d.ts +34 -0
- package/style.css +2 -0
- package/switch/index.d.ts +10 -0
- package/switch/src/switch-types.d.ts +45 -0
- package/switch/src/switch.d.ts +37 -0
- package/table/index.d.ts +11 -0
- package/table/src/table-types.d.ts +172 -0
- package/table/src/table.d.ts +67 -0
- package/table-column/index.d.ts +11 -0
- package/table-column/index.es.js +155 -0
- package/table-column/index.umd.js +1 -0
- package/table-column/src/table-column-types.d.ts +75 -0
- package/table-column/src/table-column.d.ts +63 -0
- package/table-column-group/index.d.ts +11 -0
- package/table-column-group/index.es.js +80 -0
- package/table-column-group/index.umd.js +1 -0
- package/table-column-group/src/table-column-group-types.d.ts +36 -0
- package/table-column-group/src/table-column-group.d.ts +20 -0
- package/table-summary/index.d.ts +11 -0
- package/table-summary/index.es.js +30 -0
- package/table-summary/index.umd.js +1 -0
- package/table-summary/src/table-summary-types.d.ts +29 -0
- package/table-summary/src/table-summary.d.ts +8 -0
- package/tabs/index.d.ts +11 -0
- package/tabs/src/components/tab/tab-types.d.ts +18 -0
- package/tabs/src/components/tab/tab.d.ts +15 -0
- package/tabs/src/components/tabs-nav/index.d.ts +26 -0
- package/tabs/src/tabs-types.d.ts +49 -0
- package/tabs/src/tabs.d.ts +27 -0
- package/tag/index.d.ts +10 -0
- package/tag/src/tag-types.d.ts +41 -0
- package/tag/src/tag.d.ts +24 -0
- package/textarea/index.d.ts +11 -0
- package/textarea/index.es.js +1241 -0
- package/textarea/index.umd.js +1 -0
- package/textarea/src/textarea-types.d.ts +150 -0
- package/textarea/src/textarea.d.ts +63 -0
- package/textarea/style.css +2 -0
- package/time-picker/index.d.ts +10 -0
- package/time-picker/index.es.js +2325 -0
- package/time-picker/index.umd.js +1 -0
- package/time-picker/src/time-picker-types.d.ts +168 -0
- package/time-picker/src/time-picker.d.ts +127 -0
- package/time-picker/style.css +2 -0
- package/time-range-picker/index.d.ts +10 -0
- package/time-range-picker/index.es.js +2568 -0
- package/time-range-picker/index.umd.js +1 -0
- package/time-range-picker/src/time-range-picker-types.d.ts +147 -0
- package/time-range-picker/src/time-range-picker.d.ts +124 -0
- package/time-range-picker/style.css +2 -0
- package/timeline/index.d.ts +11 -0
- package/timeline/src/timeline-item.d.ts +31 -0
- package/timeline/src/timeline-types.d.ts +72 -0
- package/timeline/src/timeline.d.ts +3 -0
- package/tooltip/index.d.ts +10 -0
- package/tooltip/src/tooltip-types.d.ts +201 -0
- package/tooltip/src/tooltip.d.ts +87 -0
- package/transfer/index.d.ts +10 -0
- package/transfer/index.es.js +1407 -0
- package/transfer/index.umd.js +1 -0
- package/transfer/src/transfer-types.d.ts +76 -0
- package/transfer/src/transfer.d.ts +59 -0
- package/transfer/style.css +2 -0
- package/tree/index.d.ts +10 -0
- package/tree/src/composables/use-tree-check.d.ts +9 -0
- package/tree/src/composables/use-tree-flatten.d.ts +11 -0
- package/tree/src/composables/use-tree-state.d.ts +17 -0
- package/tree/src/tree-types.d.ts +202 -0
- package/tree/src/tree.d.ts +122 -0
- package/tree-select/index.d.ts +12 -0
- package/tree-select/index.es.js +3009 -0
- package/tree-select/index.umd.js +1 -0
- package/tree-select/src/tree-select-types.d.ts +188 -0
- package/tree-select/src/tree-select.d.ts +128 -0
- package/tree-select/style.css +2 -0
- package/typography/index.d.ts +10 -0
- package/typography/src/typography-types.d.ts +316 -0
- package/typography/src/typography.d.ts +33 -0
- package/upload/index.d.ts +10 -0
- package/upload/index.es.js +1450 -0
- package/upload/index.umd.js +1 -0
- package/upload/src/upload-types.d.ts +99 -0
- package/upload/src/upload.d.ts +66 -0
- package/upload/style.css +2 -0
- package/upload-dragger/index.d.ts +10 -0
- package/upload-dragger/index.es.js +1472 -0
- package/upload-dragger/index.umd.js +1 -0
- package/upload-dragger/src/upload-dragger.d.ts +167 -0
- package/upload-dragger/style.css +2 -0
- package/util/index.d.ts +12 -0
- package/util/src/dom.d.ts +8 -0
- package/util/src/func.d.ts +7 -0
- package/util/src/type.d.ts +3 -0
- package/vue-ccui.es.js +11 -9
- package/vue-ccui.umd.js +1 -1
- package/watermark/index.d.ts +10 -0
- package/watermark/src/watermark-types.d.ts +47 -0
- package/watermark/src/watermark.d.ts +34 -0
- package/ccui-cli.css +0 -2
- package/nuxt/components/category.js +0 -2
- package/nuxt/components/install.js +0 -2
- package/nuxt/components/status.js +0 -2
- package/nuxt/components/title.js +0 -2
- package/nuxt/index.js +0 -13
- /package/affix/{ccui-cli.css → style.css} +0 -0
- /package/alert/{ccui-cli.css → style.css} +0 -0
- /package/anchor/{ccui-cli.css → style.css} +0 -0
- /package/avatar/{ccui-cli.css → style.css} +0 -0
- /package/badge/{ccui-cli.css → style.css} +0 -0
- /package/breadcrumb/{ccui-cli.css → style.css} +0 -0
- /package/button/{ccui-cli.css → style.css} +0 -0
- /package/button-3d/{ccui-cli.css → style.css} +0 -0
- /package/calendar/{ccui-cli.css → style.css} +0 -0
- /package/card/{ccui-cli.css → style.css} +0 -0
- /package/check-box/{ccui-cli.css → style.css} +0 -0
- /package/collapse/{ccui-cli.css → style.css} +0 -0
- /package/date-picker/{ccui-cli.css → style.css} +0 -0
- /package/descriptions/{ccui-cli.css → style.css} +0 -0
- /package/divider/{ccui-cli.css → style.css} +0 -0
- /package/drawer/{ccui-cli.css → style.css} +0 -0
- /package/dropdown/{ccui-cli.css → style.css} +0 -0
- /package/empty/{ccui-cli.css → style.css} +0 -0
- /package/flex/{ccui-cli.css → style.css} +0 -0
- /package/float-button/{ccui-cli.css → style.css} +0 -0
- /package/form/{ccui-cli.css → style.css} +0 -0
- /package/grid/{ccui-cli.css → style.css} +0 -0
- /package/icon/{ccui-cli.css → style.css} +0 -0
- /package/image/{ccui-cli.css → style.css} +0 -0
- /package/input/{ccui-cli.css → style.css} +0 -0
- /package/input-number/{ccui-cli.css → style.css} +0 -0
- /package/layout/{ccui-cli.css → style.css} +0 -0
- /package/masonry/{ccui-cli.css → style.css} +0 -0
- /package/menu/{ccui-cli.css → style.css} +0 -0
- /package/message/{ccui-cli.css → style.css} +0 -0
- /package/modal/{ccui-cli.css → style.css} +0 -0
- /package/notification/{ccui-cli.css → style.css} +0 -0
- /package/pagination/{ccui-cli.css → style.css} +0 -0
- /package/popconfirm/{ccui-cli.css → style.css} +0 -0
- /package/popover/{ccui-cli.css → style.css} +0 -0
- /package/progress/{ccui-cli.css → style.css} +0 -0
- /package/radio/{ccui-cli.css → style.css} +0 -0
- /package/rate/{ccui-cli.css → style.css} +0 -0
- /package/result/{ccui-cli.css → style.css} +0 -0
- /package/segmented/{ccui-cli.css → style.css} +0 -0
- /package/select/{ccui-cli.css → style.css} +0 -0
- /package/skeleton/{ccui-cli.css → style.css} +0 -0
- /package/slider/{ccui-cli.css → style.css} +0 -0
- /package/space/{ccui-cli.css → style.css} +0 -0
- /package/spin/{ccui-cli.css → style.css} +0 -0
- /package/splitter/{ccui-cli.css → style.css} +0 -0
- /package/status/{ccui-cli.css → style.css} +0 -0
- /package/steps/{ccui-cli.css → style.css} +0 -0
- /package/switch/{ccui-cli.css → style.css} +0 -0
- /package/table/{ccui-cli.css → style.css} +0 -0
- /package/tabs/{ccui-cli.css → style.css} +0 -0
- /package/tag/{ccui-cli.css → style.css} +0 -0
- /package/timeline/{ccui-cli.css → style.css} +0 -0
- /package/tooltip/{ccui-cli.css → style.css} +0 -0
- /package/tree/{ccui-cli.css → style.css} +0 -0
- /package/typography/{ccui-cli.css → style.css} +0 -0
- /package/watermark/{ccui-cli.css → style.css} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { MessageGlobalConfig, MessageHandle, MessageOptions } from './message-types';
|
|
3
|
+
|
|
4
|
+
export interface UseMessageReturn {
|
|
5
|
+
message: {
|
|
6
|
+
open(options: MessageOptions): MessageHandle;
|
|
7
|
+
info(content: string | MessageOptions, duration?: number): MessageHandle;
|
|
8
|
+
success(content: string | MessageOptions, duration?: number): MessageHandle;
|
|
9
|
+
warning(content: string | MessageOptions, duration?: number): MessageHandle;
|
|
10
|
+
error(content: string | MessageOptions, duration?: number): MessageHandle;
|
|
11
|
+
loading(content: string | MessageOptions, duration?: number): MessageHandle;
|
|
12
|
+
config(cfg: MessageGlobalConfig): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
};
|
|
15
|
+
holder: Component;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `useMessage()`:返回 `{ message, holder }` 对象(**不是 React 风格元组**)。
|
|
19
|
+
*
|
|
20
|
+
* - `holder` 是 Vue 组件,必须挂到模板中:`<component :is="holder" />`
|
|
21
|
+
* - 容器渲染在当前 Vue 子树里,自动继承父组件 provide 的 ConfigProvider / 主题等上下文
|
|
22
|
+
* - 与模块级 `message` 不同:模块级用独立 `createApp`,**无法**拿到调用方应用的 inject
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```vue
|
|
26
|
+
* <script setup>
|
|
27
|
+
* const { message, holder } = useMessage()
|
|
28
|
+
* message.success('hi', 2)
|
|
29
|
+
* </script>
|
|
30
|
+
* <template>
|
|
31
|
+
* <component :is="holder" />
|
|
32
|
+
* </template>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function useMessage(): UseMessageReturn;
|
package/modal/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import type { ModalFuncOptions, ModalFuncReturn } from './src/confirm-types';
|
|
3
|
+
import ModalComp from './src/modal';
|
|
4
|
+
import { useModal } from './src/use-modal';
|
|
5
|
+
interface ModalNamespace extends Record<string, unknown> {
|
|
6
|
+
install?: (app: App) => void;
|
|
7
|
+
confirm: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
8
|
+
info: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
9
|
+
success: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
10
|
+
error: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
11
|
+
warning: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
12
|
+
destroyAll: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const Modal: typeof ModalComp & ModalNamespace;
|
|
15
|
+
export { Modal, useModal };
|
|
16
|
+
export type { ModalFuncOptions, ModalFuncReturn } from './src/confirm-types';
|
|
17
|
+
export type { UseModalReturn } from './src/use-modal';
|
|
18
|
+
declare const _default: {
|
|
19
|
+
title: string;
|
|
20
|
+
category: string;
|
|
21
|
+
status: string;
|
|
22
|
+
install(app: App): void;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
export type ModalFuncType = 'confirm' | 'info' | 'success' | 'error' | 'warning';
|
|
3
|
+
export interface ModalFuncOptions {
|
|
4
|
+
title?: string | VNode;
|
|
5
|
+
content?: string | VNode;
|
|
6
|
+
type?: ModalFuncType;
|
|
7
|
+
icon?: string | VNode;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
centered?: boolean;
|
|
10
|
+
mask?: boolean;
|
|
11
|
+
maskClosable?: boolean;
|
|
12
|
+
closeOnEsc?: boolean;
|
|
13
|
+
closable?: boolean;
|
|
14
|
+
okText?: string;
|
|
15
|
+
cancelText?: string;
|
|
16
|
+
okType?: 'primary' | 'danger' | 'default';
|
|
17
|
+
okButtonProps?: Record<string, unknown>;
|
|
18
|
+
cancelButtonProps?: Record<string, unknown>;
|
|
19
|
+
onOk?: () => void | Promise<unknown>;
|
|
20
|
+
onCancel?: () => void | Promise<unknown>;
|
|
21
|
+
afterClose?: () => void;
|
|
22
|
+
zIndex?: number;
|
|
23
|
+
wrapClassName?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ModalFuncReturn {
|
|
26
|
+
/** 强制销毁此 modal */
|
|
27
|
+
destroy: () => void;
|
|
28
|
+
/** 更新 modal 的 options,可传部分字段做合并;或传函数返回新对象 */
|
|
29
|
+
update: (updater: Partial<ModalFuncOptions> | ((prev: ModalFuncOptions) => Partial<ModalFuncOptions>)) => void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AppContext } from 'vue';
|
|
2
|
+
import type { ModalFuncOptions, ModalFuncReturn, ModalFuncType } from './confirm-types';
|
|
3
|
+
interface ParentContext {
|
|
4
|
+
provides?: Record<string | symbol, unknown>;
|
|
5
|
+
appContext?: AppContext;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 渲染单个命令式 Modal。返回 destroy / update 句柄。
|
|
9
|
+
*
|
|
10
|
+
* - 默认 `type='confirm'` 显示 OK + Cancel;其他 type 单 OK 按钮
|
|
11
|
+
* - `onOk` 返回 Promise 时按钮进入 loading,resolve 后关闭;reject 不关闭(错误传递给调用方)
|
|
12
|
+
*/
|
|
13
|
+
export declare function modalFunc(options?: ModalFuncOptions, parentCtx?: ParentContext): ModalFuncReturn;
|
|
14
|
+
/** 销毁所有当前活跃的命令式 modal */
|
|
15
|
+
export declare function modalDestroyAll(): void;
|
|
16
|
+
export declare function createTypedFunc(type: ModalFuncType): (options?: ModalFuncOptions, parentCtx?: ParentContext) => ModalFuncReturn;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType, VNode } from 'vue';
|
|
2
|
+
import type { CcSemanticClasses, CcSemanticStyles } from '../../shared/hooks/use-semantic';
|
|
3
|
+
export type ModalType = 'info' | 'success' | 'warning' | 'error' | 'confirm';
|
|
4
|
+
/**
|
|
5
|
+
* `closable` 复合配置:
|
|
6
|
+
*
|
|
7
|
+
* - `boolean`:显示/隐藏关闭按钮
|
|
8
|
+
* - `{ closeIcon, disabled, ariaLabel }`:自定义关闭按钮
|
|
9
|
+
* - `closeIcon`:接 string(Iconify name)/ VNode;同时支持 `close-icon` slot 高优先级
|
|
10
|
+
* - `disabled`:禁用关闭按钮(仍渲染,但点击无效)
|
|
11
|
+
* - `ariaLabel`:自定义 aria-label
|
|
12
|
+
*/
|
|
13
|
+
export interface ModalClosableObject {
|
|
14
|
+
closeIcon?: VNode | string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
}
|
|
18
|
+
export type ModalClosable = boolean | ModalClosableObject;
|
|
19
|
+
export declare const modalProps: {
|
|
20
|
+
/**
|
|
21
|
+
* 显示对话框。支持 `v-model:visible`。
|
|
22
|
+
*/
|
|
23
|
+
readonly visible: {
|
|
24
|
+
readonly type: BooleanConstructor;
|
|
25
|
+
readonly default: false;
|
|
26
|
+
};
|
|
27
|
+
readonly title: {
|
|
28
|
+
readonly type: StringConstructor;
|
|
29
|
+
readonly default: "";
|
|
30
|
+
};
|
|
31
|
+
readonly width: {
|
|
32
|
+
readonly type: PropType<number | string>;
|
|
33
|
+
readonly default: 520;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* 关闭按钮配置。`boolean` 或 `{ closeIcon, disabled, ariaLabel }` 复合对象。
|
|
37
|
+
*/
|
|
38
|
+
readonly closable: {
|
|
39
|
+
readonly type: PropType<ModalClosable>;
|
|
40
|
+
readonly default: true;
|
|
41
|
+
};
|
|
42
|
+
readonly maskClosable: {
|
|
43
|
+
readonly type: BooleanConstructor;
|
|
44
|
+
readonly default: true;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* 是否支持键盘 Esc 关闭。
|
|
48
|
+
*/
|
|
49
|
+
readonly closeOnEsc: {
|
|
50
|
+
readonly type: BooleanConstructor;
|
|
51
|
+
readonly default: true;
|
|
52
|
+
};
|
|
53
|
+
readonly centered: {
|
|
54
|
+
readonly type: BooleanConstructor;
|
|
55
|
+
readonly default: false;
|
|
56
|
+
};
|
|
57
|
+
readonly mask: {
|
|
58
|
+
readonly type: BooleanConstructor;
|
|
59
|
+
readonly default: true;
|
|
60
|
+
};
|
|
61
|
+
readonly okText: {
|
|
62
|
+
readonly type: StringConstructor;
|
|
63
|
+
readonly default: "";
|
|
64
|
+
};
|
|
65
|
+
readonly cancelText: {
|
|
66
|
+
readonly type: StringConstructor;
|
|
67
|
+
readonly default: "";
|
|
68
|
+
};
|
|
69
|
+
readonly okType: {
|
|
70
|
+
readonly type: PropType<"primary" | "danger" | "default">;
|
|
71
|
+
readonly default: "primary";
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated 请改用 `confirmLoading`。
|
|
75
|
+
*/
|
|
76
|
+
readonly okLoading: {
|
|
77
|
+
readonly type: BooleanConstructor;
|
|
78
|
+
readonly default: false;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* 确认按钮 loading 状态。显式优先于 `okLoading`。
|
|
82
|
+
*/
|
|
83
|
+
readonly confirmLoading: {
|
|
84
|
+
readonly type: BooleanConstructor;
|
|
85
|
+
readonly default: undefined;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated 请改用 `footer` slot 或 `footer={null}`。
|
|
89
|
+
*/
|
|
90
|
+
readonly hideFooter: {
|
|
91
|
+
readonly type: BooleanConstructor;
|
|
92
|
+
readonly default: false;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* footer 内容。
|
|
96
|
+
*
|
|
97
|
+
* - `null`:隐藏 footer
|
|
98
|
+
* - `string`:纯文本 footer
|
|
99
|
+
* - `VNode`:自定义内容
|
|
100
|
+
* - 默认(`undefined`):渲染内置 OK/Cancel 按钮
|
|
101
|
+
*
|
|
102
|
+
* `footer` slot 优先级高于此 prop。
|
|
103
|
+
*/
|
|
104
|
+
readonly footer: {
|
|
105
|
+
readonly type: PropType<string | VNode | null>;
|
|
106
|
+
readonly default: undefined;
|
|
107
|
+
};
|
|
108
|
+
readonly destroyOnClose: {
|
|
109
|
+
readonly type: BooleanConstructor;
|
|
110
|
+
readonly default: false;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* 默认 false 时由 destroyOnClose 控制;设为 true 时初次挂载即渲染内容(即使未打开),关闭后保留 DOM。
|
|
114
|
+
* 与 `<KeepAlive>` 语义对齐。
|
|
115
|
+
*/
|
|
116
|
+
readonly keepAlive: {
|
|
117
|
+
readonly type: BooleanConstructor;
|
|
118
|
+
readonly default: false;
|
|
119
|
+
};
|
|
120
|
+
readonly zIndex: {
|
|
121
|
+
readonly type: NumberConstructor;
|
|
122
|
+
readonly default: 1000;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* 是否把浮层 Teleport 到 `document.body`。
|
|
126
|
+
*/
|
|
127
|
+
readonly appendToBody: {
|
|
128
|
+
readonly type: BooleanConstructor;
|
|
129
|
+
readonly default: true;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* 对话框外层 wrap 节点的 className。
|
|
133
|
+
*/
|
|
134
|
+
readonly wrapClassName: {
|
|
135
|
+
readonly type: StringConstructor;
|
|
136
|
+
readonly default: "";
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* 对话框 zoom transition 名。
|
|
140
|
+
*/
|
|
141
|
+
readonly transitionName: {
|
|
142
|
+
readonly type: StringConstructor;
|
|
143
|
+
readonly default: "";
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* 遮罩 fade transition 名。
|
|
147
|
+
*/
|
|
148
|
+
readonly maskTransitionName: {
|
|
149
|
+
readonly type: StringConstructor;
|
|
150
|
+
readonly default: "";
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* 关闭后是否把焦点还给触发节点。默认 true。
|
|
154
|
+
* 触发节点通过 `data-ccui-modal-trigger` 自动捕获;外部也可通过 `expose.restoreFocus(el)` 显式指定。
|
|
155
|
+
*/
|
|
156
|
+
readonly focusTriggerAfterClose: {
|
|
157
|
+
readonly type: BooleanConstructor;
|
|
158
|
+
readonly default: true;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* 语义化 DOM className 注入。可用 key:`root` / `wrap` / `mask` / `header` / `body` / `footer`。
|
|
162
|
+
*/
|
|
163
|
+
readonly classNames: {
|
|
164
|
+
readonly type: PropType<CcSemanticClasses>;
|
|
165
|
+
readonly default: undefined;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* 语义化 DOM style 注入。可用 key 与 classNames 一致。
|
|
169
|
+
*/
|
|
170
|
+
readonly styles: {
|
|
171
|
+
readonly type: PropType<CcSemanticStyles>;
|
|
172
|
+
readonly default: undefined;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
export type ModalProps = ExtractPropTypes<typeof modalProps>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
readonly zIndex: number;
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly mask: boolean;
|
|
7
|
+
readonly width: string | number;
|
|
8
|
+
readonly visible: boolean;
|
|
9
|
+
readonly closable: import("./modal-types").ModalClosable;
|
|
10
|
+
readonly transitionName: string;
|
|
11
|
+
readonly okText: string;
|
|
12
|
+
readonly cancelText: string;
|
|
13
|
+
readonly maskClosable: boolean;
|
|
14
|
+
readonly closeOnEsc: boolean;
|
|
15
|
+
readonly destroyOnClose: boolean;
|
|
16
|
+
readonly keepAlive: boolean;
|
|
17
|
+
readonly appendToBody: boolean;
|
|
18
|
+
readonly focusTriggerAfterClose: boolean;
|
|
19
|
+
readonly centered: boolean;
|
|
20
|
+
readonly okType: "default" | "primary" | "danger";
|
|
21
|
+
readonly okLoading: boolean;
|
|
22
|
+
readonly hideFooter: boolean;
|
|
23
|
+
readonly wrapClassName: string;
|
|
24
|
+
readonly maskTransitionName: string;
|
|
25
|
+
readonly footer?: string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}> | null | undefined;
|
|
28
|
+
readonly classNames?: import("../../shared/hooks/use-semantic").CcSemanticClasses | undefined;
|
|
29
|
+
readonly styles?: import("../../shared/hooks/use-semantic").CcSemanticStyles | undefined;
|
|
30
|
+
readonly confirmLoading?: boolean | undefined;
|
|
31
|
+
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("open" | "cancel" | "close" | "ok" | "update:visible" | "opened" | "closed" | "after-open-change")[], "open" | "cancel" | "close" | "ok" | "update:visible" | "opened" | "closed" | "after-open-change", import("vue").PublicProps, Readonly<{
|
|
34
|
+
readonly zIndex: number;
|
|
35
|
+
readonly title: string;
|
|
36
|
+
readonly mask: boolean;
|
|
37
|
+
readonly width: string | number;
|
|
38
|
+
readonly visible: boolean;
|
|
39
|
+
readonly closable: import("./modal-types").ModalClosable;
|
|
40
|
+
readonly transitionName: string;
|
|
41
|
+
readonly okText: string;
|
|
42
|
+
readonly cancelText: string;
|
|
43
|
+
readonly maskClosable: boolean;
|
|
44
|
+
readonly closeOnEsc: boolean;
|
|
45
|
+
readonly destroyOnClose: boolean;
|
|
46
|
+
readonly keepAlive: boolean;
|
|
47
|
+
readonly appendToBody: boolean;
|
|
48
|
+
readonly focusTriggerAfterClose: boolean;
|
|
49
|
+
readonly centered: boolean;
|
|
50
|
+
readonly okType: "default" | "primary" | "danger";
|
|
51
|
+
readonly okLoading: boolean;
|
|
52
|
+
readonly hideFooter: boolean;
|
|
53
|
+
readonly wrapClassName: string;
|
|
54
|
+
readonly maskTransitionName: string;
|
|
55
|
+
readonly footer?: string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
}> | null | undefined;
|
|
58
|
+
readonly classNames?: import("../../shared/hooks/use-semantic").CcSemanticClasses | undefined;
|
|
59
|
+
readonly styles?: import("../../shared/hooks/use-semantic").CcSemanticStyles | undefined;
|
|
60
|
+
readonly confirmLoading?: boolean | undefined;
|
|
61
|
+
}> & Readonly<{
|
|
62
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
63
|
+
onCancel?: ((...args: any[]) => any) | undefined;
|
|
64
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
65
|
+
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
66
|
+
onOpened?: ((...args: any[]) => any) | undefined;
|
|
67
|
+
onClosed?: ((...args: any[]) => any) | undefined;
|
|
68
|
+
"onAfter-open-change"?: ((...args: any[]) => any) | undefined;
|
|
69
|
+
onOk?: ((...args: any[]) => any) | undefined;
|
|
70
|
+
}>, {
|
|
71
|
+
readonly zIndex: number;
|
|
72
|
+
readonly footer: string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}> | null;
|
|
75
|
+
readonly title: string;
|
|
76
|
+
readonly mask: boolean;
|
|
77
|
+
readonly width: string | number;
|
|
78
|
+
readonly visible: boolean;
|
|
79
|
+
readonly closable: import("./modal-types").ModalClosable;
|
|
80
|
+
readonly classNames: import("../../shared/hooks/use-semantic").CcSemanticClasses;
|
|
81
|
+
readonly styles: import("../../shared/hooks/use-semantic").CcSemanticStyles;
|
|
82
|
+
readonly transitionName: string;
|
|
83
|
+
readonly okText: string;
|
|
84
|
+
readonly cancelText: string;
|
|
85
|
+
readonly maskClosable: boolean;
|
|
86
|
+
readonly closeOnEsc: boolean;
|
|
87
|
+
readonly destroyOnClose: boolean;
|
|
88
|
+
readonly keepAlive: boolean;
|
|
89
|
+
readonly appendToBody: boolean;
|
|
90
|
+
readonly focusTriggerAfterClose: boolean;
|
|
91
|
+
readonly centered: boolean;
|
|
92
|
+
readonly okType: "default" | "primary" | "danger";
|
|
93
|
+
readonly okLoading: boolean;
|
|
94
|
+
readonly confirmLoading: boolean;
|
|
95
|
+
readonly hideFooter: boolean;
|
|
96
|
+
readonly wrapClassName: string;
|
|
97
|
+
readonly maskTransitionName: string;
|
|
98
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
99
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { ModalFuncOptions, ModalFuncReturn } from './confirm-types';
|
|
3
|
+
export interface UseModalReturn {
|
|
4
|
+
modal: {
|
|
5
|
+
confirm: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
6
|
+
info: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
7
|
+
success: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
8
|
+
error: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
9
|
+
warning: (options?: ModalFuncOptions) => ModalFuncReturn;
|
|
10
|
+
};
|
|
11
|
+
holder: Component;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* `useModal()`:返回 `{ modal, holder }` 对象(**不是** React `[modal, contextHolder]` 元组)。
|
|
15
|
+
*
|
|
16
|
+
* - `holder` 是 Vue 组件,必须挂到模板中:`<component :is="holder" />`
|
|
17
|
+
* - `modal.confirm({...})` 等命令式调用会继承调用组件树的 provide / ConfigProvider / 主题 / locale 等 inject
|
|
18
|
+
* - 与全局 `Modal.confirm` 的最大差异:全局版走独立 `createApp`,拿不到调用方 app 的 inject 链
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```vue
|
|
22
|
+
* <script setup>
|
|
23
|
+
* const { modal, holder } = useModal()
|
|
24
|
+
* function ask() {
|
|
25
|
+
* modal.confirm({ title: '?', content: '确定要这么做?', onOk: () => fetch('/delete') })
|
|
26
|
+
* }
|
|
27
|
+
* </script>
|
|
28
|
+
* <template>
|
|
29
|
+
* <component :is="holder" />
|
|
30
|
+
* <button @click="ask">删除</button>
|
|
31
|
+
* </template>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function useModal(): UseModalReturn;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import notification from './src/notification';
|
|
3
|
+
import { useNotification } from './src/use-notification';
|
|
4
|
+
export { notification, useNotification };
|
|
5
|
+
export type { UseNotificationReturn } from './src/use-notification';
|
|
6
|
+
export declare const Notification: {
|
|
7
|
+
open: (options: import("./src/notification-types").NotificationOptions) => import("./src/notification-types").NotificationHandle;
|
|
8
|
+
info: (options: import("./src/notification-types").NotificationOptions) => import("./src/notification-types").NotificationHandle;
|
|
9
|
+
success: (options: import("./src/notification-types").NotificationOptions) => import("./src/notification-types").NotificationHandle;
|
|
10
|
+
warning: (options: import("./src/notification-types").NotificationOptions) => import("./src/notification-types").NotificationHandle;
|
|
11
|
+
error: (options: import("./src/notification-types").NotificationOptions) => import("./src/notification-types").NotificationHandle;
|
|
12
|
+
config(cfg: import("./src/notification-types").NotificationGlobalConfig): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: {
|
|
16
|
+
title: string;
|
|
17
|
+
category: string;
|
|
18
|
+
status: string;
|
|
19
|
+
install(app: App): void;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
readonly type: import("./notification-types").NotificationType;
|
|
3
|
+
readonly title: string;
|
|
4
|
+
readonly icon: string;
|
|
5
|
+
readonly description: string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}>;
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly role: import("./notification-types").NotificationAriaRole;
|
|
10
|
+
readonly pauseOnHover: boolean;
|
|
11
|
+
readonly duration: number;
|
|
12
|
+
readonly showClose: boolean;
|
|
13
|
+
readonly customClass: string;
|
|
14
|
+
readonly classNames?: import("../../shared/hooks/use-semantic").CcSemanticClasses | undefined;
|
|
15
|
+
readonly styles?: import("../../shared/hooks/use-semantic").CcSemanticStyles | undefined;
|
|
16
|
+
}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "destroy")[], "close" | "destroy", import("vue").PublicProps, Readonly<{
|
|
17
|
+
readonly type: import("./notification-types").NotificationType;
|
|
18
|
+
readonly title: string;
|
|
19
|
+
readonly icon: string;
|
|
20
|
+
readonly description: string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}>;
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly role: import("./notification-types").NotificationAriaRole;
|
|
25
|
+
readonly pauseOnHover: boolean;
|
|
26
|
+
readonly duration: number;
|
|
27
|
+
readonly showClose: boolean;
|
|
28
|
+
readonly customClass: string;
|
|
29
|
+
readonly classNames?: import("../../shared/hooks/use-semantic").CcSemanticClasses | undefined;
|
|
30
|
+
readonly styles?: import("../../shared/hooks/use-semantic").CcSemanticStyles | undefined;
|
|
31
|
+
}> & Readonly<{
|
|
32
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
onDestroy?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
readonly type: import("./notification-types").NotificationType;
|
|
36
|
+
readonly title: string;
|
|
37
|
+
readonly icon: string;
|
|
38
|
+
readonly description: string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}>;
|
|
41
|
+
readonly classNames: import("../../shared/hooks/use-semantic").CcSemanticClasses;
|
|
42
|
+
readonly styles: import("../../shared/hooks/use-semantic").CcSemanticStyles;
|
|
43
|
+
readonly role: import("./notification-types").NotificationAriaRole;
|
|
44
|
+
readonly pauseOnHover: boolean;
|
|
45
|
+
readonly duration: number;
|
|
46
|
+
readonly showClose: boolean;
|
|
47
|
+
readonly customClass: string;
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType, VNode } from 'vue';
|
|
2
|
+
import type { CcSemanticClasses, CcSemanticStyles } from '../../shared/hooks/use-semantic';
|
|
3
|
+
export type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
export type NotificationPlacement = 'top' | 'topRight' | 'topLeft' | 'bottom' | 'bottomRight' | 'bottomLeft';
|
|
5
|
+
export type NotificationAriaRole = 'alert' | 'status';
|
|
6
|
+
export interface NotificationOptions {
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string | VNode;
|
|
9
|
+
type?: NotificationType;
|
|
10
|
+
duration?: number;
|
|
11
|
+
placement?: NotificationPlacement;
|
|
12
|
+
showClose?: boolean;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
icon?: string;
|
|
15
|
+
customClass?: string;
|
|
16
|
+
role?: NotificationAriaRole;
|
|
17
|
+
pauseOnHover?: boolean;
|
|
18
|
+
classNames?: CcSemanticClasses;
|
|
19
|
+
styles?: CcSemanticStyles;
|
|
20
|
+
}
|
|
21
|
+
export interface NotificationGlobalConfig {
|
|
22
|
+
top?: number | string;
|
|
23
|
+
bottom?: number | string;
|
|
24
|
+
duration?: number;
|
|
25
|
+
maxCount?: number;
|
|
26
|
+
stack?: boolean;
|
|
27
|
+
pauseOnHover?: boolean;
|
|
28
|
+
role?: NotificationAriaRole;
|
|
29
|
+
placement?: NotificationPlacement;
|
|
30
|
+
getContainer?: () => HTMLElement;
|
|
31
|
+
}
|
|
32
|
+
export declare const notificationItemProps: {
|
|
33
|
+
readonly id: {
|
|
34
|
+
readonly type: StringConstructor;
|
|
35
|
+
readonly required: true;
|
|
36
|
+
};
|
|
37
|
+
readonly title: {
|
|
38
|
+
readonly type: StringConstructor;
|
|
39
|
+
readonly default: "";
|
|
40
|
+
};
|
|
41
|
+
readonly description: {
|
|
42
|
+
readonly type: PropType<string | VNode>;
|
|
43
|
+
readonly default: "";
|
|
44
|
+
};
|
|
45
|
+
readonly type: {
|
|
46
|
+
readonly type: PropType<NotificationType>;
|
|
47
|
+
readonly default: NotificationType;
|
|
48
|
+
};
|
|
49
|
+
readonly duration: {
|
|
50
|
+
readonly type: NumberConstructor;
|
|
51
|
+
readonly default: 4500;
|
|
52
|
+
};
|
|
53
|
+
readonly showClose: {
|
|
54
|
+
readonly type: BooleanConstructor;
|
|
55
|
+
readonly default: true;
|
|
56
|
+
};
|
|
57
|
+
readonly icon: {
|
|
58
|
+
readonly type: StringConstructor;
|
|
59
|
+
readonly default: "";
|
|
60
|
+
};
|
|
61
|
+
readonly customClass: {
|
|
62
|
+
readonly type: StringConstructor;
|
|
63
|
+
readonly default: "";
|
|
64
|
+
};
|
|
65
|
+
readonly role: {
|
|
66
|
+
readonly type: PropType<NotificationAriaRole>;
|
|
67
|
+
readonly default: NotificationAriaRole;
|
|
68
|
+
};
|
|
69
|
+
readonly pauseOnHover: {
|
|
70
|
+
readonly type: BooleanConstructor;
|
|
71
|
+
readonly default: true;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* 语义化 DOM className 注入。可用 key:`root` / `icon` / `content` / `close`。
|
|
75
|
+
*/
|
|
76
|
+
readonly classNames: {
|
|
77
|
+
readonly type: PropType<CcSemanticClasses>;
|
|
78
|
+
readonly default: undefined;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* 语义化 DOM style 注入。可用 key 与 classNames 一致。
|
|
82
|
+
*/
|
|
83
|
+
readonly styles: {
|
|
84
|
+
readonly type: PropType<CcSemanticStyles>;
|
|
85
|
+
readonly default: undefined;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export type NotificationItemProps = ExtractPropTypes<typeof notificationItemProps>;
|
|
89
|
+
export interface NotificationHandle {
|
|
90
|
+
close: () => void;
|
|
91
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { NotificationAriaRole, NotificationGlobalConfig, NotificationHandle, NotificationOptions, NotificationPlacement } from './notification-types';
|
|
2
|
+
|
|
3
|
+
declare function normalizeDuration(input: number | undefined, defaultSeconds: number): number;
|
|
4
|
+
declare function open(options: NotificationOptions): NotificationHandle;
|
|
5
|
+
declare const notification: {
|
|
6
|
+
open: typeof open;
|
|
7
|
+
info: (options: NotificationOptions) => NotificationHandle;
|
|
8
|
+
success: (options: NotificationOptions) => NotificationHandle;
|
|
9
|
+
warning: (options: NotificationOptions) => NotificationHandle;
|
|
10
|
+
error: (options: NotificationOptions) => NotificationHandle;
|
|
11
|
+
config(cfg: NotificationGlobalConfig): void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
};
|
|
14
|
+
export declare const _notificationInternal: {
|
|
15
|
+
normalizeDuration: typeof normalizeDuration;
|
|
16
|
+
globalConfig: NotificationGlobalConfig;
|
|
17
|
+
PLACEMENTS: NotificationPlacement[];
|
|
18
|
+
};
|
|
19
|
+
export default notification;
|
|
20
|
+
export type { NotificationAriaRole };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { NotificationGlobalConfig, NotificationHandle, NotificationOptions } from './notification-types';
|
|
3
|
+
|
|
4
|
+
export interface UseNotificationReturn {
|
|
5
|
+
notification: {
|
|
6
|
+
open(options: NotificationOptions): NotificationHandle;
|
|
7
|
+
info(options: NotificationOptions): NotificationHandle;
|
|
8
|
+
success(options: NotificationOptions): NotificationHandle;
|
|
9
|
+
warning(options: NotificationOptions): NotificationHandle;
|
|
10
|
+
error(options: NotificationOptions): NotificationHandle;
|
|
11
|
+
config(cfg: NotificationGlobalConfig): void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
};
|
|
14
|
+
holder: Component;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* `useNotification()`:返回 `{ notification, holder }` 对象(**不是 React 风格元组**)。
|
|
18
|
+
*
|
|
19
|
+
* - `holder` 是 Vue 组件,必须挂到模板中:`<component :is="holder" />`
|
|
20
|
+
* - 容器渲染在当前 Vue 子树里,自动继承父组件 provide 的 ConfigProvider / 主题等上下文
|
|
21
|
+
* - 与模块级 `notification` 不同:模块级用独立 `createApp`,**无法**拿到调用方应用的 inject
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```vue
|
|
25
|
+
* <script setup>
|
|
26
|
+
* const { notification, holder } = useNotification()
|
|
27
|
+
* notification.success({ title: 'hi', duration: 2 })
|
|
28
|
+
* </script>
|
|
29
|
+
* <template>
|
|
30
|
+
* <component :is="holder" />
|
|
31
|
+
* </template>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function useNotification(): UseNotificationReturn;
|