@routa/ui-vue 0.1.0
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/LICENSE +21 -0
- package/README.md +52 -0
- package/base.css +1 -0
- package/dist/autocomplete/AutoComplete.vue.d.ts +336 -0
- package/dist/autocomplete/index.d.ts +298 -0
- package/dist/autocomplete/index.js +4 -0
- package/dist/autocomplete/index.mjs +321 -0
- package/dist/autocomplete/types.d.ts +58 -0
- package/dist/avatar/Avatar.vue.d.ts +36 -0
- package/dist/avatar/AvatarGroup.vue.d.ts +7 -0
- package/dist/avatar/index.d.ts +7 -0
- package/dist/avatar/index.js +3 -0
- package/dist/avatar/index.mjs +192 -0
- package/dist/avatar/types.d.ts +111 -0
- package/dist/badge/Badge.vue.d.ts +25 -0
- package/dist/badge/index.d.ts +5 -0
- package/dist/badge/index.js +2 -0
- package/dist/badge/index.mjs +72 -0
- package/dist/badge/types.d.ts +86 -0
- package/dist/breadcrumb/Breadcrumb.vue.d.ts +38 -0
- package/dist/breadcrumb/BreadcrumbItem.vue.d.ts +48 -0
- package/dist/breadcrumb/index.d.ts +7 -0
- package/dist/breadcrumb/index.js +2 -0
- package/dist/breadcrumb/index.mjs +87 -0
- package/dist/breadcrumb/types.d.ts +28 -0
- package/dist/button/Button.vue.d.ts +27 -0
- package/dist/button/index.d.ts +5 -0
- package/dist/button/index.js +2 -0
- package/dist/button/index.mjs +10 -0
- package/dist/button/types.d.ts +14 -0
- package/dist/card/Card.vue.d.ts +49 -0
- package/dist/card/index.d.ts +72 -0
- package/dist/card/index.js +2 -0
- package/dist/card/index.mjs +60 -0
- package/dist/card/types.d.ts +16 -0
- package/dist/carousel/Carousel.vue.d.ts +134 -0
- package/dist/carousel/CarouselItem.vue.d.ts +23 -0
- package/dist/carousel/index.d.ts +250 -0
- package/dist/carousel/index.js +2 -0
- package/dist/carousel/index.mjs +354 -0
- package/dist/carousel/types.d.ts +97 -0
- package/dist/cascader/Cascader.vue.d.ts +109 -0
- package/dist/cascader/CascaderPanel.vue.d.ts +55 -0
- package/dist/cascader/index.d.ts +110 -0
- package/dist/cascader/index.js +5 -0
- package/dist/cascader/index.mjs +370 -0
- package/dist/cascader/types.d.ts +54 -0
- package/dist/checkbox/Checkbox.vue.d.ts +99 -0
- package/dist/checkbox/CheckboxGroup.vue.d.ts +59 -0
- package/dist/checkbox/constants.d.ts +2 -0
- package/dist/checkbox/index.d.ts +9 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.mjs +70 -0
- package/dist/checkbox/types.d.ts +64 -0
- package/dist/chunks/Button.vue_vue_type_script_setup_true_lang-BthtEkGw.mjs +170 -0
- package/dist/chunks/Button.vue_vue_type_script_setup_true_lang-Do1NtIFC.js +1 -0
- package/dist/chunks/Checkbox.vue_vue_type_script_setup_true_lang-DxecbRJE.js +1 -0
- package/dist/chunks/Checkbox.vue_vue_type_script_setup_true_lang-fOXXjwnz.mjs +289 -0
- package/dist/chunks/Icon.vue_vue_type_script_setup_true_lang-LQ-KuJ6a.mjs +57 -0
- package/dist/chunks/Icon.vue_vue_type_script_setup_true_lang-YDWguTmi.js +1 -0
- package/dist/chunks/Input.vue_vue_type_script_setup_true_lang-8x2HE2Cj.js +1 -0
- package/dist/chunks/Input.vue_vue_type_script_setup_true_lang-PeDZ7smO.mjs +391 -0
- package/dist/chunks/Popover.vue_vue_type_script_setup_true_lang-CVWbekIQ.mjs +176 -0
- package/dist/chunks/Popover.vue_vue_type_script_setup_true_lang-TF9OnqB0.js +1 -0
- package/dist/chunks/Scrollbar.vue_vue_type_script_setup_true_lang-CtBz7Ha9.js +1 -0
- package/dist/chunks/Scrollbar.vue_vue_type_script_setup_true_lang-kKvR0Hz3.mjs +124 -0
- package/dist/chunks/TimePanel.vue_vue_type_script_setup_true_lang-BNTM3OeU.js +1 -0
- package/dist/chunks/TimePanel.vue_vue_type_script_setup_true_lang-BxuIhLsF.mjs +170 -0
- package/dist/chunks/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/chunks/auto-update-6n8Xn1EH.js +1 -0
- package/dist/chunks/auto-update-Dw-2qIsQ.mjs +59 -0
- package/dist/chunks/color-BBpRjg5d.mjs +32 -0
- package/dist/chunks/color-m1q_rZ68.js +1 -0
- package/dist/chunks/context-BEsW77hb.js +1 -0
- package/dist/chunks/context-BlK-PJ3n.mjs +5 -0
- package/dist/chunks/controller-37WpkEdZ.js +1 -0
- package/dist/chunks/controller-3cWaJJMW.mjs +318 -0
- package/dist/chunks/controller-BQhkT8pi.mjs +95 -0
- package/dist/chunks/controller-BnNZOOMj.js +1 -0
- package/dist/chunks/controller-CV-a983I.js +1 -0
- package/dist/chunks/controller-D1BTHmfO.js +1 -0
- package/dist/chunks/controller-DZp6lWY1.mjs +96 -0
- package/dist/chunks/controller-DdEBnv9V.mjs +82 -0
- package/dist/chunks/id-CfLxBW9l.js +1 -0
- package/dist/chunks/id-VS2potoV.mjs +7 -0
- package/dist/chunks/index-B0yEC3RG.mjs +136 -0
- package/dist/chunks/index-B4GP5rXr.mjs +170 -0
- package/dist/chunks/index-DWAWrVaT.js +1 -0
- package/dist/chunks/index-RYR-1S7A.js +1 -0
- package/dist/chunks/install-DJNxamQ0.mjs +10 -0
- package/dist/chunks/install-gnn2dOg9.js +1 -0
- package/dist/chunks/manager-BUdQK4AD.mjs +156 -0
- package/dist/chunks/manager-C-VTKQvg.mjs +85 -0
- package/dist/chunks/manager-C0AUxQ1I.js +2 -0
- package/dist/chunks/manager-d-AJMlyO.js +1 -0
- package/dist/chunks/modal-BiivqQQz.mjs +86 -0
- package/dist/chunks/modal-CRbFkVcm.js +1 -0
- package/dist/chunks/responsive-BYScjISa.js +1 -0
- package/dist/chunks/responsive-jCVnPx1a.mjs +49 -0
- package/dist/chunks/style-C-58-Hx4.mjs +7 -0
- package/dist/chunks/style-CjCLKeeU.js +1 -0
- package/dist/chunks/types-CXAGM03M.mjs +92 -0
- package/dist/chunks/types-DS78vyi2.js +1 -0
- package/dist/chunks/use-form-item-CloIcyon.js +1 -0
- package/dist/chunks/use-form-item-CqDbWCiU.mjs +16 -0
- package/dist/chunks/use-id-BycaM3-h.js +1 -0
- package/dist/chunks/use-id-D3casveg.mjs +9 -0
- package/dist/chunks/use-signals-Bz1smiXh.js +1 -0
- package/dist/chunks/use-signals-CE1T2jXK.mjs +50 -0
- package/dist/chunks/useCanvasRenderer-BPTNzGy0.mjs +87 -0
- package/dist/chunks/useCanvasRenderer-D77k3JCQ.js +1 -0
- package/dist/chunks/useResizeObserver-Cki4q_CI.mjs +60 -0
- package/dist/chunks/useResizeObserver-DMkB1OF3.js +1 -0
- package/dist/chunks/z-index-CNZLw1v7.js +1 -0
- package/dist/chunks/z-index-D9ecXoNe.mjs +14 -0
- package/dist/collapse/Collapse.vue.d.ts +30 -0
- package/dist/collapse/CollapseItem.vue.d.ts +20 -0
- package/dist/collapse/index.d.ts +8 -0
- package/dist/collapse/index.js +3 -0
- package/dist/collapse/index.mjs +144 -0
- package/dist/collapse/types.d.ts +54 -0
- package/dist/color-picker/AlphaSlider.vue.d.ts +38 -0
- package/dist/color-picker/ColorPicker.vue.d.ts +57 -0
- package/dist/color-picker/HueSlider.vue.d.ts +28 -0
- package/dist/color-picker/SaturationPanel.vue.d.ts +46 -0
- package/dist/color-picker/index.d.ts +56 -0
- package/dist/color-picker/index.js +6 -0
- package/dist/color-picker/index.mjs +481 -0
- package/dist/config-provider/ConfigProvider.vue.d.ts +64 -0
- package/dist/config-provider/context.d.ts +888 -0
- package/dist/config-provider/index.d.ts +97 -0
- package/dist/config-provider/index.js +1 -0
- package/dist/config-provider/index.mjs +396 -0
- package/dist/config-provider/resolver.d.ts +2 -0
- package/dist/config-provider/runtime.d.ts +5 -0
- package/dist/config-provider/teleport.d.ts +6 -0
- package/dist/config-provider/types.d.ts +131 -0
- package/dist/context-menu/ContextMenu.vue.d.ts +87 -0
- package/dist/context-menu/index.d.ts +5 -0
- package/dist/context-menu/index.js +3 -0
- package/dist/context-menu/index.mjs +215 -0
- package/dist/context-menu/types.d.ts +34 -0
- package/dist/date-picker/Calendar.vue.d.ts +22 -0
- package/dist/date-picker/DatePicker.vue.d.ts +31 -0
- package/dist/date-picker/DateRangePicker.vue.d.ts +26 -0
- package/dist/date-picker/DateTimePicker.vue.d.ts +27 -0
- package/dist/date-picker/DateTimeRangePicker.vue.d.ts +27 -0
- package/dist/date-picker/index.d.ts +13 -0
- package/dist/date-picker/index.js +6 -0
- package/dist/date-picker/index.mjs +1229 -0
- package/dist/date-picker/utils.d.ts +3 -0
- package/dist/dialog/Dialog.vue.d.ts +97 -0
- package/dist/dialog/index.d.ts +5 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.mjs +161 -0
- package/dist/dialog/types.d.ts +38 -0
- package/dist/divider/Divider.vue.d.ts +74 -0
- package/dist/divider/index.d.ts +5 -0
- package/dist/divider/index.js +2 -0
- package/dist/divider/index.mjs +96 -0
- package/dist/divider/types.d.ts +57 -0
- package/dist/drawer/Drawer.vue.d.ts +106 -0
- package/dist/drawer/index.d.ts +5 -0
- package/dist/drawer/index.js +2 -0
- package/dist/drawer/index.mjs +168 -0
- package/dist/drawer/types.d.ts +42 -0
- package/dist/dropdown/Dropdown.vue.d.ts +109 -0
- package/dist/dropdown/DropdownItem.vue.d.ts +60 -0
- package/dist/dropdown/index.d.ts +7 -0
- package/dist/dropdown/index.js +3 -0
- package/dist/dropdown/index.mjs +310 -0
- package/dist/dropdown/types.d.ts +87 -0
- package/dist/empty/Empty.vue.d.ts +47 -0
- package/dist/empty/index.d.ts +70 -0
- package/dist/empty/index.js +2 -0
- package/dist/empty/index.mjs +50 -0
- package/dist/empty/types.d.ts +16 -0
- package/dist/feedback-runtime/manager.d.ts +109 -0
- package/dist/feedback-runtime/mount.d.ts +5 -0
- package/dist/feedback-runtime/types.d.ts +27 -0
- package/dist/form/Form.vue.d.ts +37 -0
- package/dist/form/FormItem.vue.d.ts +32 -0
- package/dist/form/FormSchemaFields.vue.d.ts +7 -0
- package/dist/form/context.d.ts +33 -0
- package/dist/form/index.d.ts +6 -0
- package/dist/form/index.js +2 -0
- package/dist/form/index.mjs +389 -0
- package/dist/grid/Col.vue.d.ts +101 -0
- package/dist/grid/Row.vue.d.ts +56 -0
- package/dist/grid/index.d.ts +7 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.mjs +182 -0
- package/dist/grid/responsive.d.ts +9 -0
- package/dist/grid/types.d.ts +85 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.mjs +9 -0
- package/dist/hooks/use-form-item.d.ts +13 -0
- package/dist/hooks/use-id.d.ts +5 -0
- package/dist/hooks/useCanvasRenderer.d.ts +10 -0
- package/dist/hooks/useImageLoader.d.ts +20 -0
- package/dist/hooks/useResizeObserver.d.ts +17 -0
- package/dist/icon/Icon.vue.d.ts +20 -0
- package/dist/icon/index.d.ts +5 -0
- package/dist/icon/index.js +2 -0
- package/dist/icon/index.mjs +10 -0
- package/dist/icon/types.d.ts +45 -0
- package/dist/image/Image.vue.d.ts +38 -0
- package/dist/image/index.d.ts +5 -0
- package/dist/image/index.js +2 -0
- package/dist/image/index.mjs +128 -0
- package/dist/image/types.d.ts +10 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +362 -0
- package/dist/input/Input.vue.d.ts +47 -0
- package/dist/input/index.d.ts +5 -0
- package/dist/input/index.js +2 -0
- package/dist/input/index.mjs +10 -0
- package/dist/input/types.d.ts +51 -0
- package/dist/input-number/InputNumber.vue.d.ts +119 -0
- package/dist/input-number/index.d.ts +5 -0
- package/dist/input-number/index.js +2 -0
- package/dist/input-number/index.mjs +312 -0
- package/dist/input-number/types.d.ts +58 -0
- package/dist/layout/Content.vue.d.ts +29 -0
- package/dist/layout/Footer.vue.d.ts +29 -0
- package/dist/layout/Header.vue.d.ts +29 -0
- package/dist/layout/Layout.vue.d.ts +32 -0
- package/dist/layout/Sider.vue.d.ts +59 -0
- package/dist/layout/index.d.ts +13 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout/index.mjs +154 -0
- package/dist/layout/types.d.ts +51 -0
- package/dist/layout-system/responsive.d.ts +4 -0
- package/dist/layout-system/types.d.ts +3 -0
- package/dist/loading/Loading.vue.d.ts +57 -0
- package/dist/loading/LoadingMask.vue.d.ts +8 -0
- package/dist/loading/directive.d.ts +5 -0
- package/dist/loading/index.d.ts +7 -0
- package/dist/loading/index.js +2 -0
- package/dist/loading/index.mjs +275 -0
- package/dist/loading/types.d.ts +23 -0
- package/dist/mentions/Mentions.vue.d.ts +337 -0
- package/dist/mentions/index.d.ts +296 -0
- package/dist/mentions/index.js +5 -0
- package/dist/mentions/index.mjs +357 -0
- package/dist/mentions/types.d.ts +55 -0
- package/dist/menu/Menu.vue.d.ts +120 -0
- package/dist/menu/MenuDivider.vue.d.ts +2 -0
- package/dist/menu/MenuGroup.vue.d.ts +29 -0
- package/dist/menu/MenuItem.vue.d.ts +48 -0
- package/dist/menu/MenuNodeRenderer.vue.d.ts +6 -0
- package/dist/menu/SubMenu.vue.d.ts +57 -0
- package/dist/menu/index.d.ts +13 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.mjs +772 -0
- package/dist/menu/types.d.ts +126 -0
- package/dist/message/MessageHost.vue.d.ts +15 -0
- package/dist/message/MessageItem.vue.d.ts +15 -0
- package/dist/message/index.d.ts +10 -0
- package/dist/message/index.js +2 -0
- package/dist/message/index.mjs +199 -0
- package/dist/message/runtime.d.ts +149 -0
- package/dist/message/types.d.ts +12 -0
- package/dist/notification/NotificationHost.vue.d.ts +15 -0
- package/dist/notification/NotificationItem.vue.d.ts +15 -0
- package/dist/notification/index.d.ts +10 -0
- package/dist/notification/index.js +2 -0
- package/dist/notification/index.mjs +207 -0
- package/dist/notification/runtime.d.ts +155 -0
- package/dist/notification/types.d.ts +12 -0
- package/dist/otp-input/OTPInput.vue.d.ts +84 -0
- package/dist/otp-input/index.d.ts +5 -0
- package/dist/otp-input/index.js +2 -0
- package/dist/otp-input/index.mjs +216 -0
- package/dist/otp-input/types.d.ts +41 -0
- package/dist/pagination/Pagination.vue.d.ts +101 -0
- package/dist/pagination/index.d.ts +102 -0
- package/dist/pagination/index.js +2 -0
- package/dist/pagination/index.mjs +260 -0
- package/dist/pagination/types.d.ts +48 -0
- package/dist/popover/Popover.vue.d.ts +136 -0
- package/dist/popover/index.d.ts +5 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.mjs +13 -0
- package/dist/popover/types.d.ts +49 -0
- package/dist/radio/Radio.vue.d.ts +30 -0
- package/dist/radio/RadioGroup.vue.d.ts +26 -0
- package/dist/radio/constants.d.ts +3 -0
- package/dist/radio/index.d.ts +7 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.mjs +273 -0
- package/dist/radio/types.d.ts +45 -0
- package/dist/rate/Rate.vue.d.ts +139 -0
- package/dist/rate/index.d.ts +140 -0
- package/dist/rate/index.js +3 -0
- package/dist/rate/index.mjs +276 -0
- package/dist/rate/types.d.ts +66 -0
- package/dist/rich-text/RichText.vue.d.ts +25 -0
- package/dist/rich-text/index.d.ts +17 -0
- package/dist/rich-text/index.js +2 -0
- package/dist/rich-text/index.mjs +312 -0
- package/dist/scrollbar/Scrollbar.vue.d.ts +37 -0
- package/dist/scrollbar/index.d.ts +5 -0
- package/dist/scrollbar/index.js +2 -0
- package/dist/scrollbar/index.mjs +10 -0
- package/dist/scrollbar/types.d.ts +17 -0
- package/dist/select/Option.vue.d.ts +45 -0
- package/dist/select/Select.vue.d.ts +136 -0
- package/dist/select/index.d.ts +9 -0
- package/dist/select/index.js +3 -0
- package/dist/select/index.mjs +656 -0
- package/dist/select/types.d.ts +92 -0
- package/dist/slider/Slider.vue.d.ts +123 -0
- package/dist/slider/index.d.ts +5 -0
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.mjs +326 -0
- package/dist/slider/types.d.ts +57 -0
- package/dist/space/Space.vue.d.ts +75 -0
- package/dist/space/index.d.ts +5 -0
- package/dist/space/index.js +2 -0
- package/dist/space/index.mjs +104 -0
- package/dist/space/types.d.ts +34 -0
- package/dist/splitter/Splitter.vue.d.ts +52 -0
- package/dist/splitter/SplitterPane.vue.d.ts +38 -0
- package/dist/splitter/index.d.ts +7 -0
- package/dist/splitter/index.js +2 -0
- package/dist/splitter/index.mjs +252 -0
- package/dist/splitter/types.d.ts +41 -0
- package/dist/splitter/utils.d.ts +6 -0
- package/dist/style/Button.css +1 -0
- package/dist/style/Checkbox.css +1 -0
- package/dist/style/Icon.css +1 -0
- package/dist/style/Input.css +1 -0
- package/dist/style/Popover.css +1 -0
- package/dist/style/Scrollbar.css +1 -0
- package/dist/style/TimePanel.css +1 -0
- package/dist/style/autocomplete.css +1 -0
- package/dist/style/avatar.css +1 -0
- package/dist/style/badge.css +1 -0
- package/dist/style/base.css +1 -0
- package/dist/style/breadcrumb.css +1 -0
- package/dist/style/card.css +1 -0
- package/dist/style/carousel.css +1 -0
- package/dist/style/cascader.css +1 -0
- package/dist/style/collapse.css +1 -0
- package/dist/style/color-picker.css +1 -0
- package/dist/style/context-menu.css +1 -0
- package/dist/style/date-picker.css +1 -0
- package/dist/style/dialog.css +1 -0
- package/dist/style/divider.css +1 -0
- package/dist/style/drawer.css +1 -0
- package/dist/style/empty.css +1 -0
- package/dist/style/form.css +1 -0
- package/dist/style/grid.css +1 -0
- package/dist/style/image.css +1 -0
- package/dist/style/index.css +1 -0
- package/dist/style/input-number.css +1 -0
- package/dist/style/layout.css +1 -0
- package/dist/style/loading.css +1 -0
- package/dist/style/mentions.css +1 -0
- package/dist/style/menu.css +1 -0
- package/dist/style/message.css +1 -0
- package/dist/style/notification.css +1 -0
- package/dist/style/otp-input.css +1 -0
- package/dist/style/pagination.css +1 -0
- package/dist/style/radio.css +1 -0
- package/dist/style/rate.css +1 -0
- package/dist/style/rich-text.css +1 -0
- package/dist/style/select.css +1 -0
- package/dist/style/slider.css +1 -0
- package/dist/style/space.css +1 -0
- package/dist/style/splitter.css +1 -0
- package/dist/style/switch.css +1 -0
- package/dist/style/table.css +1 -0
- package/dist/style/tabs.css +1 -0
- package/dist/style/tag.css +1 -0
- package/dist/style/tooltip.css +1 -0
- package/dist/style/transfer.css +1 -0
- package/dist/style/tree-select.css +1 -0
- package/dist/style/tree.css +1 -0
- package/dist/style/upload.css +1 -0
- package/dist/style/watermark.css +1 -0
- package/dist/switch/Switch.vue.d.ts +95 -0
- package/dist/switch/index.d.ts +5 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.mjs +285 -0
- package/dist/switch/types.d.ts +81 -0
- package/dist/table/Table.vue.d.ts +102 -0
- package/dist/table/index.d.ts +5 -0
- package/dist/table/index.js +2 -0
- package/dist/table/index.mjs +263 -0
- package/dist/table/types.d.ts +64 -0
- package/dist/tabs/TabPane.vue.d.ts +55 -0
- package/dist/tabs/Tabs.vue.d.ts +92 -0
- package/dist/tabs/index.d.ts +7 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.mjs +266 -0
- package/dist/tabs/types.d.ts +78 -0
- package/dist/tag/Tag.vue.d.ts +38 -0
- package/dist/tag/index.d.ts +5 -0
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.mjs +123 -0
- package/dist/tag/types.d.ts +83 -0
- package/dist/time-picker/TimePanel.vue.d.ts +19 -0
- package/dist/time-picker/TimePicker.vue.d.ts +15 -0
- package/dist/time-picker/index.d.ts +6 -0
- package/dist/time-picker/index.js +4 -0
- package/dist/time-picker/index.mjs +91 -0
- package/dist/tooltip/Tooltip.vue.d.ts +99 -0
- package/dist/tooltip/index.d.ts +5 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.mjs +186 -0
- package/dist/tooltip/types.d.ts +37 -0
- package/dist/transfer/Transfer.vue.d.ts +104 -0
- package/dist/transfer/TransferPanel.vue.d.ts +90 -0
- package/dist/transfer/index.d.ts +167 -0
- package/dist/transfer/index.js +7 -0
- package/dist/transfer/index.mjs +343 -0
- package/dist/tree/Tree.vue.d.ts +237 -0
- package/dist/tree/TreeRow.vue.d.ts +24 -0
- package/dist/tree/TreeView.vue.d.ts +24 -0
- package/dist/tree/context.d.ts +3 -0
- package/dist/tree/index.d.ts +431 -0
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.mjs +548 -0
- package/dist/tree/types.d.ts +127 -0
- package/dist/tree/use-tree-foundation.d.ts +37 -0
- package/dist/tree-select/TreeNode.vue.d.ts +7 -0
- package/dist/tree-select/TreeSelect.vue.d.ts +210 -0
- package/dist/tree-select/index.d.ts +7 -0
- package/dist/tree-select/index.js +3 -0
- package/dist/tree-select/index.mjs +799 -0
- package/dist/tree-select/types.d.ts +111 -0
- package/dist/upload/Upload.vue.d.ts +50 -0
- package/dist/upload/index.d.ts +67 -0
- package/dist/upload/index.js +3 -0
- package/dist/upload/index.mjs +271 -0
- package/dist/utils/install.d.ts +3 -0
- package/dist/utils/style.d.ts +1 -0
- package/dist/watermark/Watermark.vue.d.ts +98 -0
- package/dist/watermark/index.d.ts +5 -0
- package/dist/watermark/index.js +2 -0
- package/dist/watermark/index.mjs +183 -0
- package/dist/watermark/types.d.ts +85 -0
- package/package.json +69 -0
- package/src/autocomplete/style/index.css +80 -0
- package/src/avatar/style/index.css +105 -0
- package/src/badge/style/index.css +232 -0
- package/src/base.css +4 -0
- package/src/breadcrumb/style/index.css +75 -0
- package/src/button/style/index.css +242 -0
- package/src/card/style/index.css +60 -0
- package/src/carousel/style/index.css +195 -0
- package/src/cascader/style/index.css +153 -0
- package/src/checkbox/style/index.css +165 -0
- package/src/collapse/style/index.css +166 -0
- package/src/color-picker/style/index.css +132 -0
- package/src/context-menu/style/index.css +21 -0
- package/src/date-picker/style/index.css +372 -0
- package/src/dialog/style/index.css +141 -0
- package/src/divider/style/index.css +112 -0
- package/src/drawer/style/index.css +211 -0
- package/src/dropdown/style/index.css +118 -0
- package/src/empty/style/index.css +87 -0
- package/src/form/style/index.css +148 -0
- package/src/grid/style/index.css +16 -0
- package/src/icon/style/index.css +28 -0
- package/src/image/style/index.css +114 -0
- package/src/input/style/index.css +217 -0
- package/src/input-number/style/index.css +166 -0
- package/src/layout/style/index.css +37 -0
- package/src/loading/style/index.css +58 -0
- package/src/mentions/style/index.css +83 -0
- package/src/menu/style/index.css +300 -0
- package/src/message/style/index.css +109 -0
- package/src/notification/style/index.css +116 -0
- package/src/otp-input/style/index.css +96 -0
- package/src/pagination/style/index.css +96 -0
- package/src/popover/style/index.css +47 -0
- package/src/radio/style/index.css +185 -0
- package/src/rate/style/index.css +89 -0
- package/src/rich-text/style/index.css +154 -0
- package/src/scrollbar/style/index.css +57 -0
- package/src/select/style/index.css +262 -0
- package/src/slider/style/index.css +181 -0
- package/src/space/style/index.css +31 -0
- package/src/splitter/style/index.css +76 -0
- package/src/style.css +1 -0
- package/src/styles/reset.css +29 -0
- package/src/switch/style/index.css +164 -0
- package/src/table/style/index.css +108 -0
- package/src/tabs/style/index.css +270 -0
- package/src/tag/style/index.css +207 -0
- package/src/time-picker/style/index.css +135 -0
- package/src/tooltip/style/index.css +50 -0
- package/src/transfer/style/index.css +181 -0
- package/src/tree/style/index.css +246 -0
- package/src/tree-select/style/index.css +346 -0
- package/src/upload/style/index.css +166 -0
- package/src/watermark/style/index.css +15 -0
- package/style.css +1 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType, InjectionKey, Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { TreeNode, TreeFieldNames, TreeVisibleRow } from '../../../headless/src/index.ts';
|
|
3
|
+
export declare const treeSelectProps: {
|
|
4
|
+
readonly modelValue: {
|
|
5
|
+
readonly type: PropType<any | any[]>;
|
|
6
|
+
readonly default: null;
|
|
7
|
+
};
|
|
8
|
+
readonly nodes: {
|
|
9
|
+
readonly type: PropType<TreeNode[]>;
|
|
10
|
+
readonly default: undefined;
|
|
11
|
+
};
|
|
12
|
+
readonly data: {
|
|
13
|
+
readonly type: PropType<TreeNode[]>;
|
|
14
|
+
readonly default: () => never[];
|
|
15
|
+
};
|
|
16
|
+
readonly defaultExpandedKeys: {
|
|
17
|
+
readonly type: PropType<any[]>;
|
|
18
|
+
readonly default: () => never[];
|
|
19
|
+
};
|
|
20
|
+
readonly nodeKey: {
|
|
21
|
+
readonly type: StringConstructor;
|
|
22
|
+
readonly default: "id";
|
|
23
|
+
};
|
|
24
|
+
readonly labelKey: {
|
|
25
|
+
readonly type: StringConstructor;
|
|
26
|
+
readonly default: "label";
|
|
27
|
+
};
|
|
28
|
+
readonly childrenKey: {
|
|
29
|
+
readonly type: StringConstructor;
|
|
30
|
+
readonly default: "children";
|
|
31
|
+
};
|
|
32
|
+
readonly fieldNames: {
|
|
33
|
+
readonly type: PropType<TreeFieldNames>;
|
|
34
|
+
readonly default: undefined;
|
|
35
|
+
};
|
|
36
|
+
readonly multiple: {
|
|
37
|
+
readonly type: BooleanConstructor;
|
|
38
|
+
readonly default: false;
|
|
39
|
+
};
|
|
40
|
+
readonly disabled: {
|
|
41
|
+
readonly type: BooleanConstructor;
|
|
42
|
+
readonly default: false;
|
|
43
|
+
};
|
|
44
|
+
readonly clearable: {
|
|
45
|
+
readonly type: BooleanConstructor;
|
|
46
|
+
readonly default: false;
|
|
47
|
+
};
|
|
48
|
+
readonly filterable: {
|
|
49
|
+
readonly type: BooleanConstructor;
|
|
50
|
+
readonly default: false;
|
|
51
|
+
};
|
|
52
|
+
readonly placeholder: {
|
|
53
|
+
readonly type: StringConstructor;
|
|
54
|
+
readonly default: "请选择";
|
|
55
|
+
};
|
|
56
|
+
readonly size: {
|
|
57
|
+
readonly type: PropType<"sm" | "md" | "lg">;
|
|
58
|
+
};
|
|
59
|
+
readonly checkStrictly: {
|
|
60
|
+
readonly type: BooleanConstructor;
|
|
61
|
+
readonly default: false;
|
|
62
|
+
};
|
|
63
|
+
readonly loading: {
|
|
64
|
+
readonly type: BooleanConstructor;
|
|
65
|
+
readonly default: false;
|
|
66
|
+
};
|
|
67
|
+
readonly noDataText: {
|
|
68
|
+
readonly type: StringConstructor;
|
|
69
|
+
readonly default: "无数据";
|
|
70
|
+
};
|
|
71
|
+
readonly showIcon: {
|
|
72
|
+
readonly type: BooleanConstructor;
|
|
73
|
+
readonly default: true;
|
|
74
|
+
};
|
|
75
|
+
readonly autoExpandParent: {
|
|
76
|
+
readonly type: BooleanConstructor;
|
|
77
|
+
readonly default: true;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export type TreeSelectProps = ExtractPropTypes<typeof treeSelectProps>;
|
|
81
|
+
export declare const treeSelectEmits: {
|
|
82
|
+
'update:modelValue': (_val: any | any[]) => boolean;
|
|
83
|
+
change: (_val: any | any[]) => boolean;
|
|
84
|
+
check: (_data: {
|
|
85
|
+
checkedKeys: any[];
|
|
86
|
+
halfCheckedKeys: any[];
|
|
87
|
+
checkedNodes: TreeNode[];
|
|
88
|
+
halfCheckedNodes: TreeNode[];
|
|
89
|
+
}) => boolean;
|
|
90
|
+
clear: () => boolean;
|
|
91
|
+
'visible-change': (_visible: boolean) => boolean;
|
|
92
|
+
'node-click': (_node: TreeNode) => boolean;
|
|
93
|
+
};
|
|
94
|
+
export type TreeSelectEmits = typeof treeSelectEmits;
|
|
95
|
+
export interface TreeSelectContext {
|
|
96
|
+
props: TreeSelectProps;
|
|
97
|
+
selectedKeys: Ref<any[]>;
|
|
98
|
+
indeterminateKeys: Ref<any[]>;
|
|
99
|
+
expandedKeys: Ref<any[]>;
|
|
100
|
+
filterText: Ref<string>;
|
|
101
|
+
visibleRows: Ref<TreeVisibleRow[]>;
|
|
102
|
+
focusedKey: Ref<any>;
|
|
103
|
+
fieldNames: TreeFieldNames;
|
|
104
|
+
activeDescendantId: ComputedRef<string | undefined>;
|
|
105
|
+
getRowId: (key: any) => string;
|
|
106
|
+
handleTreeFocus: () => void;
|
|
107
|
+
handleTreeKeydown: (event: KeyboardEvent) => void;
|
|
108
|
+
select: (key: any) => void;
|
|
109
|
+
toggleExpand: (key: any) => void;
|
|
110
|
+
}
|
|
111
|
+
export declare const TreeSelectKey: InjectionKey<TreeSelectContext>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { UploadFile } from '../../../headless/src/index.ts';
|
|
2
|
+
export interface UploadProps {
|
|
3
|
+
modelValue?: UploadFile[];
|
|
4
|
+
action?: string;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
data?: Record<string, any>;
|
|
7
|
+
name?: string;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
limit?: number;
|
|
10
|
+
accept?: string;
|
|
11
|
+
drag?: boolean;
|
|
12
|
+
listType?: 'text' | 'picture' | 'picture-card';
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
autoUpload?: boolean;
|
|
15
|
+
beforeUpload?: (file: File) => boolean | Promise<boolean>;
|
|
16
|
+
onSuccess?: (response: any, file: UploadFile) => void;
|
|
17
|
+
onError?: (error: any, file: UploadFile) => void;
|
|
18
|
+
onProgress?: (event: ProgressEvent, file: UploadFile) => void;
|
|
19
|
+
onRemove?: (file: UploadFile) => void;
|
|
20
|
+
size?: 'sm' | 'md' | 'lg';
|
|
21
|
+
}
|
|
22
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<UploadProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
23
|
+
error: (args_0: any, args_1: UploadFile) => any;
|
|
24
|
+
success: (args_0: any, args_1: UploadFile) => any;
|
|
25
|
+
change: (args_0: UploadFile[]) => any;
|
|
26
|
+
progress: (args_0: ProgressEvent<EventTarget>, args_1: UploadFile) => any;
|
|
27
|
+
"update:modelValue": (args_0: UploadFile[]) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<UploadProps> & Readonly<{
|
|
29
|
+
onError?: ((args_0: any, args_1: UploadFile) => any) | undefined;
|
|
30
|
+
onSuccess?: ((args_0: any, args_1: UploadFile) => any) | undefined;
|
|
31
|
+
onChange?: ((args_0: UploadFile[]) => any) | undefined;
|
|
32
|
+
onProgress?: ((args_0: ProgressEvent<EventTarget>, args_1: UploadFile) => any) | undefined;
|
|
33
|
+
"onUpdate:modelValue"?: ((args_0: UploadFile[]) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
multiple: boolean;
|
|
36
|
+
name: string;
|
|
37
|
+
listType: "text" | "picture" | "picture-card";
|
|
38
|
+
autoUpload: boolean;
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
40
|
+
fileInputRef: HTMLInputElement;
|
|
41
|
+
}, HTMLDivElement>, {
|
|
42
|
+
default?(_: {}): any;
|
|
43
|
+
tip?(_: {}): any;
|
|
44
|
+
}>;
|
|
45
|
+
export default _default;
|
|
46
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
47
|
+
new (): {
|
|
48
|
+
$slots: S;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare const LUpload: import('../utils/install').SFCWithInstall<{
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./Upload.vue').UploadProps> & Readonly<{
|
|
3
|
+
onError?: ((args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any) | undefined;
|
|
4
|
+
onSuccess?: ((args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any) | undefined;
|
|
5
|
+
onChange?: ((args_0: import('../../../headless/src/index.ts').UploadFile[]) => any) | undefined;
|
|
6
|
+
onProgress?: ((args_0: ProgressEvent<EventTarget>, args_1: import('../../../headless/src/index.ts').UploadFile) => any) | undefined;
|
|
7
|
+
"onUpdate:modelValue"?: ((args_0: import('../../../headless/src/index.ts').UploadFile[]) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
error: (args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any;
|
|
10
|
+
success: (args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any;
|
|
11
|
+
change: (args_0: import('../../../headless/src/index.ts').UploadFile[]) => any;
|
|
12
|
+
progress: (args_0: ProgressEvent<EventTarget>, args_1: import('../../../headless/src/index.ts').UploadFile) => any;
|
|
13
|
+
"update:modelValue": (args_0: import('../../../headless/src/index.ts').UploadFile[]) => any;
|
|
14
|
+
}, import('vue').PublicProps, {
|
|
15
|
+
multiple: boolean;
|
|
16
|
+
name: string;
|
|
17
|
+
listType: "text" | "picture" | "picture-card";
|
|
18
|
+
autoUpload: boolean;
|
|
19
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
20
|
+
fileInputRef: HTMLInputElement;
|
|
21
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
22
|
+
P: {};
|
|
23
|
+
B: {};
|
|
24
|
+
D: {};
|
|
25
|
+
C: {};
|
|
26
|
+
M: {};
|
|
27
|
+
Defaults: {};
|
|
28
|
+
}, Readonly<import('./Upload.vue').UploadProps> & Readonly<{
|
|
29
|
+
onError?: ((args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any) | undefined;
|
|
30
|
+
onSuccess?: ((args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any) | undefined;
|
|
31
|
+
onChange?: ((args_0: import('../../../headless/src/index.ts').UploadFile[]) => any) | undefined;
|
|
32
|
+
onProgress?: ((args_0: ProgressEvent<EventTarget>, args_1: import('../../../headless/src/index.ts').UploadFile) => any) | undefined;
|
|
33
|
+
"onUpdate:modelValue"?: ((args_0: import('../../../headless/src/index.ts').UploadFile[]) => any) | undefined;
|
|
34
|
+
}>, {}, {}, {}, {}, {
|
|
35
|
+
multiple: boolean;
|
|
36
|
+
name: string;
|
|
37
|
+
listType: "text" | "picture" | "picture-card";
|
|
38
|
+
autoUpload: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
__isFragment?: never;
|
|
41
|
+
__isTeleport?: never;
|
|
42
|
+
__isSuspense?: never;
|
|
43
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('./Upload.vue').UploadProps> & Readonly<{
|
|
44
|
+
onError?: ((args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any) | undefined;
|
|
45
|
+
onSuccess?: ((args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any) | undefined;
|
|
46
|
+
onChange?: ((args_0: import('../../../headless/src/index.ts').UploadFile[]) => any) | undefined;
|
|
47
|
+
onProgress?: ((args_0: ProgressEvent<EventTarget>, args_1: import('../../../headless/src/index.ts').UploadFile) => any) | undefined;
|
|
48
|
+
"onUpdate:modelValue"?: ((args_0: import('../../../headless/src/index.ts').UploadFile[]) => any) | undefined;
|
|
49
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
50
|
+
error: (args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any;
|
|
51
|
+
success: (args_0: any, args_1: import('../../../headless/src/index.ts').UploadFile) => any;
|
|
52
|
+
change: (args_0: import('../../../headless/src/index.ts').UploadFile[]) => any;
|
|
53
|
+
progress: (args_0: ProgressEvent<EventTarget>, args_1: import('../../../headless/src/index.ts').UploadFile) => any;
|
|
54
|
+
"update:modelValue": (args_0: import('../../../headless/src/index.ts').UploadFile[]) => any;
|
|
55
|
+
}, string, {
|
|
56
|
+
multiple: boolean;
|
|
57
|
+
name: string;
|
|
58
|
+
listType: "text" | "picture" | "picture-card";
|
|
59
|
+
autoUpload: boolean;
|
|
60
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
61
|
+
$slots: {
|
|
62
|
+
default?(_: {}): any;
|
|
63
|
+
tip?(_: {}): any;
|
|
64
|
+
};
|
|
65
|
+
})>;
|
|
66
|
+
export default LUpload;
|
|
67
|
+
export * from './Upload.vue';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
require('../style/upload.css');
|
|
2
|
+
require('../style/Button.css');
|
|
3
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const F=require("../chunks/install-gnn2dOg9.js"),e=require("vue");require("../chunks/manager-C0AUxQ1I.js");const N=require("../chunks/index-DWAWrVaT.js"),b=require("../chunks/use-id-BycaM3-h.js"),z=require("../chunks/use-signals-Bz1smiXh.js"),M=require("../chunks/use-form-item-CloIcyon.js"),L=require("../button/index.js");function $(t={}){const o=N.signal(t.files||[]);let s=0;return{state:{get files(){return o.value},set files(r){o.value=r}},actions:{addFiles:r=>{var u;let d=r.map(i=>({id:`upload-file-${++s}`,name:i.name,size:i.size,type:i.type,status:"ready",progress:0,raw:i}));if(!t.multiple)o.value=d.slice(0,1);else{if(t.limit&&o.value.length+d.length>t.limit){const i=t.limit-o.value.length;if(i<=0)return;d=d.slice(0,i)}o.value=[...o.value,...d]}(u=t.onFilesChange)==null||u.call(t,o.value)},removeFile:r=>{var d;o.value=o.value.filter(u=>u.id!==r),(d=t.onFilesChange)==null||d.call(t,o.value)},updateFile:(r,d)=>{var u;o.value=o.value.map(i=>i.id===r?{...i,...d}:i),(u=t.onFilesChange)==null||u.call(t,o.value)},clear:()=>{var r;o.value=[],(r=t.onFilesChange)==null||r.call(t,o.value)}}}}const x=["tabindex","onKeydown"],U=["id","multiple","accept"],I={key:0,class:"l-upload__dragger-content"},S={key:0,class:"l-upload__tip"},q={key:1,class:"l-upload__list"},T={class:"l-upload__item-info"},D={class:"l-upload__item-name"},H={class:"l-upload__item-status"},R={key:0,viewBox:"0 0 24 24",width:"14",height:"14",class:"icon-success"},K={key:1,viewBox:"0 0 24 24",width:"14",height:"14",class:"icon-error"},A=["aria-label","onClick"],P={key:0,class:"l-upload__progress"},j={name:"LUpload"},O=e.defineComponent({...j,props:{modelValue:{},action:{},headers:{},data:{},name:{default:"file"},multiple:{type:Boolean,default:!1},limit:{},accept:{},drag:{type:Boolean},listType:{default:"text"},disabled:{type:Boolean},autoUpload:{type:Boolean,default:!0},beforeUpload:{},onSuccess:{},onError:{},onProgress:{},onRemove:{},size:{}},emits:["update:modelValue","change","success","error","progress"],setup(t,{emit:o}){const s=t,v=o,{formItem:p,size:k,disabled:c,inputId:r}=M.useFormItem(s),d=b.useId("upload"),u=(r==null?void 0:r.value)||d,i=e.ref(null),g=e.ref(!1),m=$({files:s.modelValue,multiple:s.multiple,limit:s.limit,onFilesChange:a=>{v("update:modelValue",a),v("change",a),p==null||p.validate("change").catch(()=>{})}}),{files:f}=z.useController(m,{files:()=>s.modelValue||[]}),h=()=>{var a;c.value||(a=i.value)==null||a.click()},B=a=>{const l=a.target;l.files&&_(Array.from(l.files)),l.value=""},_=async a=>{for(const l of a){if(s.beforeUpload&&await s.beforeUpload(l)===!1)continue;m.actions.addFiles([l]);const n=f.value[f.value.length-1];s.autoUpload&&s.action&&V(n)}},V=a=>{m.actions.updateFile(a.id,{status:"uploading",progress:0});let l=0;const n=setInterval(()=>{l+=10,m.actions.updateFile(a.id,{progress:l}),l>=100&&(clearInterval(n),m.actions.updateFile(a.id,{status:"success",progress:100}),v("success",{status:"ok"},a))},200)},C=a=>{var l;m.actions.removeFile(a.id),(l=s.onRemove)==null||l.call(s,a)},E=a=>{var l;c.value||!s.drag||(g.value=!1,(l=a.dataTransfer)!=null&&l.files&&_(Array.from(a.dataTransfer.files)))};return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["l-upload",[`l-upload--${t.listType}`,{"is-disabled":e.unref(c)}]])},[e.createElementVNode("div",{class:e.normalizeClass(["l-upload__trigger",{"is-drag":t.drag,"is-dragging":g.value}]),role:"button",tabindex:e.unref(c)?-1:0,"aria-label":"上传文件",onClick:h,onKeydown:[e.withKeys(e.withModifiers(h,["prevent"]),["enter"]),e.withKeys(e.withModifiers(h,["prevent"]),["space"])],onDragover:l[0]||(l[0]=e.withModifiers(n=>g.value=!0,["prevent"])),onDragleave:l[1]||(l[1]=e.withModifiers(n=>g.value=!1,["prevent"])),onDrop:e.withModifiers(E,["prevent"])},[e.createElementVNode("input",{id:e.unref(u),ref_key:"fileInputRef",ref:i,type:"file",class:"l-upload__input",multiple:t.multiple,accept:t.accept,onChange:B},null,40,U),a.$slots.default?e.renderSlot(a.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.drag?(e.openBlock(),e.createElementBlock("div",I,[...l[2]||(l[2]=[e.createElementVNode("svg",{class:"l-upload__icon",viewBox:"0 0 24 24",width:"40",height:"40"},[e.createElementVNode("path",{fill:"currentColor",d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"})],-1),e.createElementVNode("div",{class:"l-upload__text"},[e.createTextVNode("将文件拖到此处,或"),e.createElementVNode("em",null,"点击上传")],-1)])])):(e.openBlock(),e.createBlock(e.unref(L.LButton),{key:1,size:e.unref(k),disabled:e.unref(c)},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode("点击上传",-1)])]),_:1},8,["size","disabled"]))],64))],42,x),a.$slots.tip?(e.openBlock(),e.createElementBlock("div",S,[e.renderSlot(a.$slots,"tip")])):e.createCommentVNode("",!0),t.listType!=="picture-card"?(e.openBlock(),e.createElementBlock("div",q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:e.normalizeClass(["l-upload__item",[`is-${n.status}`]])},[e.createElementVNode("div",T,[l[7]||(l[7]=e.createElementVNode("svg",{class:"l-upload__item-icon",viewBox:"0 0 24 24",width:"16",height:"16"},[e.createElementVNode("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})],-1)),e.createElementVNode("span",D,e.toDisplayString(n.name),1),e.createElementVNode("span",H,[n.status==="success"?(e.openBlock(),e.createElementBlock("svg",R,[...l[4]||(l[4]=[e.createElementVNode("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"},null,-1)])])):e.createCommentVNode("",!0),n.status==="error"?(e.openBlock(),e.createElementBlock("svg",K,[...l[5]||(l[5]=[e.createElementVNode("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},null,-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"l-upload__item-remove","aria-label":`删除文件 ${n.name}`,onClick:w=>C(n)},[...l[6]||(l[6]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},[e.createElementVNode("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)])],8,A)]),n.status==="uploading"?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("div",{class:"l-upload__progress-inner",style:e.normalizeStyle({width:n.progress+"%"})},null,4)])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)],2))}}),y=F.withInstall(O);exports.LUpload=y;exports.default=y;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import '../style/upload.css';
|
|
2
|
+
import '../style/Button.css';
|
|
3
|
+
import { w as T } from "../chunks/install-DJNxamQ0.mjs";
|
|
4
|
+
import { defineComponent as R, ref as B, openBlock as u, createElementBlock as c, normalizeClass as w, unref as v, createElementVNode as s, withModifiers as f, withKeys as $, renderSlot as L, Fragment as V, createTextVNode as x, createBlock as S, withCtx as A, createCommentVNode as h, renderList as E, toDisplayString as K, normalizeStyle as N } from "vue";
|
|
5
|
+
import "../chunks/manager-BUdQK4AD.mjs";
|
|
6
|
+
import { s as P } from "../chunks/index-B0yEC3RG.mjs";
|
|
7
|
+
import { u as j } from "../chunks/use-id-D3casveg.mjs";
|
|
8
|
+
import { u as q } from "../chunks/use-signals-CE1T2jXK.mjs";
|
|
9
|
+
import { u as G } from "../chunks/use-form-item-CqDbWCiU.mjs";
|
|
10
|
+
import { LButton as J } from "../button/index.mjs";
|
|
11
|
+
function O(l = {}) {
|
|
12
|
+
const a = P(l.files || []);
|
|
13
|
+
let i = 0;
|
|
14
|
+
return {
|
|
15
|
+
state: {
|
|
16
|
+
get files() {
|
|
17
|
+
return a.value;
|
|
18
|
+
},
|
|
19
|
+
set files(r) {
|
|
20
|
+
a.value = r;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
actions: {
|
|
24
|
+
addFiles: (r) => {
|
|
25
|
+
var m;
|
|
26
|
+
let d = r.map((n) => ({
|
|
27
|
+
id: `upload-file-${++i}`,
|
|
28
|
+
name: n.name,
|
|
29
|
+
size: n.size,
|
|
30
|
+
type: n.type,
|
|
31
|
+
status: "ready",
|
|
32
|
+
progress: 0,
|
|
33
|
+
raw: n
|
|
34
|
+
}));
|
|
35
|
+
if (!l.multiple)
|
|
36
|
+
a.value = d.slice(0, 1);
|
|
37
|
+
else {
|
|
38
|
+
if (l.limit && a.value.length + d.length > l.limit) {
|
|
39
|
+
const n = l.limit - a.value.length;
|
|
40
|
+
if (n <= 0) return;
|
|
41
|
+
d = d.slice(0, n);
|
|
42
|
+
}
|
|
43
|
+
a.value = [...a.value, ...d];
|
|
44
|
+
}
|
|
45
|
+
(m = l.onFilesChange) == null || m.call(l, a.value);
|
|
46
|
+
},
|
|
47
|
+
removeFile: (r) => {
|
|
48
|
+
var d;
|
|
49
|
+
a.value = a.value.filter((m) => m.id !== r), (d = l.onFilesChange) == null || d.call(l, a.value);
|
|
50
|
+
},
|
|
51
|
+
updateFile: (r, d) => {
|
|
52
|
+
var m;
|
|
53
|
+
a.value = a.value.map((n) => n.id === r ? { ...n, ...d } : n), (m = l.onFilesChange) == null || m.call(l, a.value);
|
|
54
|
+
},
|
|
55
|
+
clear: () => {
|
|
56
|
+
var r;
|
|
57
|
+
a.value = [], (r = l.onFilesChange) == null || r.call(l, a.value);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const Q = ["tabindex", "onKeydown"], W = ["id", "multiple", "accept"], X = {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: "l-upload__dragger-content"
|
|
65
|
+
}, Y = {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "l-upload__tip"
|
|
68
|
+
}, Z = {
|
|
69
|
+
key: 1,
|
|
70
|
+
class: "l-upload__list"
|
|
71
|
+
}, ee = { class: "l-upload__item-info" }, le = { class: "l-upload__item-name" }, te = { class: "l-upload__item-status" }, ae = {
|
|
72
|
+
key: 0,
|
|
73
|
+
viewBox: "0 0 24 24",
|
|
74
|
+
width: "14",
|
|
75
|
+
height: "14",
|
|
76
|
+
class: "icon-success"
|
|
77
|
+
}, se = {
|
|
78
|
+
key: 1,
|
|
79
|
+
viewBox: "0 0 24 24",
|
|
80
|
+
width: "14",
|
|
81
|
+
height: "14",
|
|
82
|
+
class: "icon-error"
|
|
83
|
+
}, ie = ["aria-label", "onClick"], oe = {
|
|
84
|
+
key: 0,
|
|
85
|
+
class: "l-upload__progress"
|
|
86
|
+
}, re = {
|
|
87
|
+
name: "LUpload"
|
|
88
|
+
}, ne = /* @__PURE__ */ R({
|
|
89
|
+
...re,
|
|
90
|
+
props: {
|
|
91
|
+
modelValue: {},
|
|
92
|
+
action: {},
|
|
93
|
+
headers: {},
|
|
94
|
+
data: {},
|
|
95
|
+
name: { default: "file" },
|
|
96
|
+
multiple: { type: Boolean, default: !1 },
|
|
97
|
+
limit: {},
|
|
98
|
+
accept: {},
|
|
99
|
+
drag: { type: Boolean },
|
|
100
|
+
listType: { default: "text" },
|
|
101
|
+
disabled: { type: Boolean },
|
|
102
|
+
autoUpload: { type: Boolean, default: !0 },
|
|
103
|
+
beforeUpload: {},
|
|
104
|
+
onSuccess: {},
|
|
105
|
+
onError: {},
|
|
106
|
+
onProgress: {},
|
|
107
|
+
onRemove: {},
|
|
108
|
+
size: {}
|
|
109
|
+
},
|
|
110
|
+
emits: ["update:modelValue", "change", "success", "error", "progress"],
|
|
111
|
+
setup(l, { emit: a }) {
|
|
112
|
+
const i = l, _ = a, { formItem: y, size: z, disabled: p, inputId: r } = G(i), d = j("upload"), m = (r == null ? void 0 : r.value) || d, n = B(null), C = B(!1), g = O({
|
|
113
|
+
files: i.modelValue,
|
|
114
|
+
multiple: i.multiple,
|
|
115
|
+
limit: i.limit,
|
|
116
|
+
onFilesChange: (t) => {
|
|
117
|
+
_("update:modelValue", t), _("change", t), y == null || y.validate("change").catch(() => {
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}), { files: F } = q(g, {
|
|
121
|
+
files: () => i.modelValue || []
|
|
122
|
+
}), k = () => {
|
|
123
|
+
var t;
|
|
124
|
+
p.value || (t = n.value) == null || t.click();
|
|
125
|
+
}, U = (t) => {
|
|
126
|
+
const e = t.target;
|
|
127
|
+
e.files && b(Array.from(e.files)), e.value = "";
|
|
128
|
+
}, b = async (t) => {
|
|
129
|
+
for (const e of t) {
|
|
130
|
+
if (i.beforeUpload && await i.beforeUpload(e) === !1)
|
|
131
|
+
continue;
|
|
132
|
+
g.actions.addFiles([e]);
|
|
133
|
+
const o = F.value[F.value.length - 1];
|
|
134
|
+
i.autoUpload && i.action && D(o);
|
|
135
|
+
}
|
|
136
|
+
}, D = (t) => {
|
|
137
|
+
g.actions.updateFile(t.id, { status: "uploading", progress: 0 });
|
|
138
|
+
let e = 0;
|
|
139
|
+
const o = setInterval(() => {
|
|
140
|
+
e += 10, g.actions.updateFile(t.id, { progress: e }), e >= 100 && (clearInterval(o), g.actions.updateFile(t.id, { status: "success", progress: 100 }), _("success", { status: "ok" }, t));
|
|
141
|
+
}, 200);
|
|
142
|
+
}, I = (t) => {
|
|
143
|
+
var e;
|
|
144
|
+
g.actions.removeFile(t.id), (e = i.onRemove) == null || e.call(i, t);
|
|
145
|
+
}, M = (t) => {
|
|
146
|
+
var e;
|
|
147
|
+
p.value || !i.drag || (C.value = !1, (e = t.dataTransfer) != null && e.files && b(Array.from(t.dataTransfer.files)));
|
|
148
|
+
};
|
|
149
|
+
return (t, e) => (u(), c("div", {
|
|
150
|
+
class: w(["l-upload", [`l-upload--${l.listType}`, { "is-disabled": v(p) }]])
|
|
151
|
+
}, [
|
|
152
|
+
s("div", {
|
|
153
|
+
class: w(["l-upload__trigger", { "is-drag": l.drag, "is-dragging": C.value }]),
|
|
154
|
+
role: "button",
|
|
155
|
+
tabindex: v(p) ? -1 : 0,
|
|
156
|
+
"aria-label": "上传文件",
|
|
157
|
+
onClick: k,
|
|
158
|
+
onKeydown: [
|
|
159
|
+
$(f(k, ["prevent"]), ["enter"]),
|
|
160
|
+
$(f(k, ["prevent"]), ["space"])
|
|
161
|
+
],
|
|
162
|
+
onDragover: e[0] || (e[0] = f((o) => C.value = !0, ["prevent"])),
|
|
163
|
+
onDragleave: e[1] || (e[1] = f((o) => C.value = !1, ["prevent"])),
|
|
164
|
+
onDrop: f(M, ["prevent"])
|
|
165
|
+
}, [
|
|
166
|
+
s("input", {
|
|
167
|
+
id: v(m),
|
|
168
|
+
ref_key: "fileInputRef",
|
|
169
|
+
ref: n,
|
|
170
|
+
type: "file",
|
|
171
|
+
class: "l-upload__input",
|
|
172
|
+
multiple: l.multiple,
|
|
173
|
+
accept: l.accept,
|
|
174
|
+
onChange: U
|
|
175
|
+
}, null, 40, W),
|
|
176
|
+
t.$slots.default ? L(t.$slots, "default", { key: 0 }) : (u(), c(V, { key: 1 }, [
|
|
177
|
+
l.drag ? (u(), c("div", X, [...e[2] || (e[2] = [
|
|
178
|
+
s("svg", {
|
|
179
|
+
class: "l-upload__icon",
|
|
180
|
+
viewBox: "0 0 24 24",
|
|
181
|
+
width: "40",
|
|
182
|
+
height: "40"
|
|
183
|
+
}, [
|
|
184
|
+
s("path", {
|
|
185
|
+
fill: "currentColor",
|
|
186
|
+
d: "M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"
|
|
187
|
+
})
|
|
188
|
+
], -1),
|
|
189
|
+
s("div", { class: "l-upload__text" }, [
|
|
190
|
+
x("将文件拖到此处,或"),
|
|
191
|
+
s("em", null, "点击上传")
|
|
192
|
+
], -1)
|
|
193
|
+
])])) : (u(), S(v(J), {
|
|
194
|
+
key: 1,
|
|
195
|
+
size: v(z),
|
|
196
|
+
disabled: v(p)
|
|
197
|
+
}, {
|
|
198
|
+
default: A(() => [...e[3] || (e[3] = [
|
|
199
|
+
x("点击上传", -1)
|
|
200
|
+
])]),
|
|
201
|
+
_: 1
|
|
202
|
+
}, 8, ["size", "disabled"]))
|
|
203
|
+
], 64))
|
|
204
|
+
], 42, Q),
|
|
205
|
+
t.$slots.tip ? (u(), c("div", Y, [
|
|
206
|
+
L(t.$slots, "tip")
|
|
207
|
+
])) : h("", !0),
|
|
208
|
+
l.listType !== "picture-card" ? (u(), c("div", Z, [
|
|
209
|
+
(u(!0), c(V, null, E(v(F), (o) => (u(), c("div", {
|
|
210
|
+
key: o.id,
|
|
211
|
+
class: w(["l-upload__item", [`is-${o.status}`]])
|
|
212
|
+
}, [
|
|
213
|
+
s("div", ee, [
|
|
214
|
+
e[7] || (e[7] = s("svg", {
|
|
215
|
+
class: "l-upload__item-icon",
|
|
216
|
+
viewBox: "0 0 24 24",
|
|
217
|
+
width: "16",
|
|
218
|
+
height: "16"
|
|
219
|
+
}, [
|
|
220
|
+
s("path", {
|
|
221
|
+
fill: "currentColor",
|
|
222
|
+
d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"
|
|
223
|
+
})
|
|
224
|
+
], -1)),
|
|
225
|
+
s("span", le, K(o.name), 1),
|
|
226
|
+
s("span", te, [
|
|
227
|
+
o.status === "success" ? (u(), c("svg", ae, [...e[4] || (e[4] = [
|
|
228
|
+
s("path", {
|
|
229
|
+
fill: "currentColor",
|
|
230
|
+
d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
|
|
231
|
+
}, null, -1)
|
|
232
|
+
])])) : h("", !0),
|
|
233
|
+
o.status === "error" ? (u(), c("svg", se, [...e[5] || (e[5] = [
|
|
234
|
+
s("path", {
|
|
235
|
+
fill: "currentColor",
|
|
236
|
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
237
|
+
}, null, -1)
|
|
238
|
+
])])) : h("", !0)
|
|
239
|
+
]),
|
|
240
|
+
s("button", {
|
|
241
|
+
class: "l-upload__item-remove",
|
|
242
|
+
"aria-label": `删除文件 ${o.name}`,
|
|
243
|
+
onClick: (H) => I(o)
|
|
244
|
+
}, [...e[6] || (e[6] = [
|
|
245
|
+
s("svg", {
|
|
246
|
+
viewBox: "0 0 24 24",
|
|
247
|
+
width: "14",
|
|
248
|
+
height: "14"
|
|
249
|
+
}, [
|
|
250
|
+
s("path", {
|
|
251
|
+
fill: "currentColor",
|
|
252
|
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
253
|
+
})
|
|
254
|
+
], -1)
|
|
255
|
+
])], 8, ie)
|
|
256
|
+
]),
|
|
257
|
+
o.status === "uploading" ? (u(), c("div", oe, [
|
|
258
|
+
s("div", {
|
|
259
|
+
class: "l-upload__progress-inner",
|
|
260
|
+
style: N({ width: o.progress + "%" })
|
|
261
|
+
}, null, 4)
|
|
262
|
+
])) : h("", !0)
|
|
263
|
+
], 2))), 128))
|
|
264
|
+
])) : h("", !0)
|
|
265
|
+
], 2));
|
|
266
|
+
}
|
|
267
|
+
}), he = T(ne);
|
|
268
|
+
export {
|
|
269
|
+
he as LUpload,
|
|
270
|
+
he as default
|
|
271
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addUnit(value: string | number | undefined | null, defaultUnit?: string): string | undefined;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {
|
|
7
|
+
containerRef: HTMLDivElement;
|
|
8
|
+
watermarkRef: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
rootEl: HTMLDivElement;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
14
|
+
readonly width: {
|
|
15
|
+
readonly type: NumberConstructor;
|
|
16
|
+
};
|
|
17
|
+
readonly height: {
|
|
18
|
+
readonly type: NumberConstructor;
|
|
19
|
+
};
|
|
20
|
+
readonly rotate: {
|
|
21
|
+
readonly type: NumberConstructor;
|
|
22
|
+
readonly default: -22;
|
|
23
|
+
};
|
|
24
|
+
readonly zIndex: {
|
|
25
|
+
readonly type: NumberConstructor;
|
|
26
|
+
readonly default: 2000;
|
|
27
|
+
};
|
|
28
|
+
readonly image: {
|
|
29
|
+
readonly type: StringConstructor;
|
|
30
|
+
};
|
|
31
|
+
readonly content: {
|
|
32
|
+
readonly type: import('vue').PropType<string | string[]>;
|
|
33
|
+
};
|
|
34
|
+
readonly font: {
|
|
35
|
+
readonly type: import('vue').PropType<import('./types').WatermarkFont>;
|
|
36
|
+
};
|
|
37
|
+
readonly gap: {
|
|
38
|
+
readonly type: import('vue').PropType<[number, number]>;
|
|
39
|
+
readonly default: () => number[];
|
|
40
|
+
};
|
|
41
|
+
readonly offset: {
|
|
42
|
+
readonly type: import('vue').PropType<[number, number]>;
|
|
43
|
+
};
|
|
44
|
+
readonly fullPage: {
|
|
45
|
+
readonly type: BooleanConstructor;
|
|
46
|
+
readonly default: false;
|
|
47
|
+
};
|
|
48
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
49
|
+
readonly width: {
|
|
50
|
+
readonly type: NumberConstructor;
|
|
51
|
+
};
|
|
52
|
+
readonly height: {
|
|
53
|
+
readonly type: NumberConstructor;
|
|
54
|
+
};
|
|
55
|
+
readonly rotate: {
|
|
56
|
+
readonly type: NumberConstructor;
|
|
57
|
+
readonly default: -22;
|
|
58
|
+
};
|
|
59
|
+
readonly zIndex: {
|
|
60
|
+
readonly type: NumberConstructor;
|
|
61
|
+
readonly default: 2000;
|
|
62
|
+
};
|
|
63
|
+
readonly image: {
|
|
64
|
+
readonly type: StringConstructor;
|
|
65
|
+
};
|
|
66
|
+
readonly content: {
|
|
67
|
+
readonly type: import('vue').PropType<string | string[]>;
|
|
68
|
+
};
|
|
69
|
+
readonly font: {
|
|
70
|
+
readonly type: import('vue').PropType<import('./types').WatermarkFont>;
|
|
71
|
+
};
|
|
72
|
+
readonly gap: {
|
|
73
|
+
readonly type: import('vue').PropType<[number, number]>;
|
|
74
|
+
readonly default: () => number[];
|
|
75
|
+
};
|
|
76
|
+
readonly offset: {
|
|
77
|
+
readonly type: import('vue').PropType<[number, number]>;
|
|
78
|
+
};
|
|
79
|
+
readonly fullPage: {
|
|
80
|
+
readonly type: BooleanConstructor;
|
|
81
|
+
readonly default: false;
|
|
82
|
+
};
|
|
83
|
+
}>> & Readonly<{}>, {
|
|
84
|
+
readonly rotate: number;
|
|
85
|
+
readonly zIndex: number;
|
|
86
|
+
readonly gap: [number, number];
|
|
87
|
+
readonly fullPage: boolean;
|
|
88
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
89
|
+
containerRef: HTMLDivElement;
|
|
90
|
+
watermarkRef: HTMLDivElement;
|
|
91
|
+
}, HTMLDivElement>;
|
|
92
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
93
|
+
export default _default;
|
|
94
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
95
|
+
new (): {
|
|
96
|
+
$slots: S;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require('../style/watermark.css');
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),_={width:{type:Number},height:{type:Number},rotate:{type:Number,default:-22},zIndex:{type:Number,default:2e3},image:{type:String},content:{type:[String,Array]},font:{type:Object},gap:{type:Array,default:()=>[100,100]},offset:{type:Array},fullPage:{type:Boolean,default:!1}},N=l.defineComponent({name:"Watermark",__name:"Watermark",props:_,setup(w){const t=w,x=l.ref(null),h=l.ref(null),y=l.ref(""),f=l.computed(()=>t.content?(Array.isArray(t.content)?t.content:[t.content]).filter(n=>typeof n=="string"):[]),p=l.computed(()=>{var n,e,o,i,r;return{color:((n=t.font)==null?void 0:n.color)||"rgba(0, 0, 0, 0.15)",fontSize:((e=t.font)==null?void 0:e.fontSize)||16,fontWeight:((o=t.font)==null?void 0:o.fontWeight)||"normal",fontFamily:((i=t.font)==null?void 0:i.fontFamily)||"sans-serif",fontStyle:((r=t.font)==null?void 0:r.fontStyle)||"normal"}}),b=()=>{const n=document.createElement("canvas"),e=n.getContext("2d");if(!e)return;const o=window.devicePixelRatio||1,[i,r]=t.gap,m=t.rotate*Math.PI/180;if(t.image){const a=new Image;a.crossOrigin="anonymous",a.referrerPolicy="no-referrer",a.src=t.image,a.onload=()=>{const{width:s=120,height:c=64}=t,d=(s+i)*o,g=(c+r)*o;n.width=d,n.height=g,e.scale(o,o),e.translate((s+i)/2,(c+r)/2),e.rotate(m),e.drawImage(a,-s/2,-c/2,s,c),y.value=n.toDataURL()}}else if(f.value.length){const{fontSize:a,color:s,fontWeight:c,fontFamily:d,fontStyle:g}=p.value;e.font=`${g} ${c} ${typeof a=="number"?`${a}px`:a} ${d}`;const k=f.value.map(S=>e.measureText(S).width),R=Math.max(...k),P=typeof a=="number"?a+4:parseInt(String(a))+4,z=t.width||R,$=t.height||P*f.value.length,A=(z+i)*o,M=($+r)*o;n.width=A,n.height=M,e.scale(o,o),e.fillStyle=s,e.font=`${g} ${c} ${typeof a=="number"?`${a}px`:a} ${d}`,e.textBaseline="top",e.textAlign="center",e.translate((z+i)/2,($+r)/2),e.rotate(m),f.value.forEach((S,E)=>{const L=-$/2+E*P;e.fillText(S,0,L)}),y.value=n.toDataURL()}},I=l.computed(()=>{const[n=0,e=0]=t.offset||[],[o,i]=t.gap,{fontSize:r}=p.value,a=document.createElement("canvas").getContext("2d");let s=t.width||120;if(a&&f.value.length&&!t.width){a.font=`${p.value.fontStyle} ${p.value.fontWeight} ${typeof r=="number"?`${r}px`:r} ${p.value.fontFamily}`;const g=f.value.map(k=>a.measureText(k).width);s=Math.max(...g)}const c=typeof r=="number"?r+4:parseInt(String(r))+4,d=t.height||c*(f.value.length||1);return{position:t.fullPage?"fixed":"absolute",left:`${n}px`,top:`${e}px`,width:t.fullPage?"100%":`calc(100% - ${n}px)`,height:t.fullPage?"100%":`calc(100% - ${e}px)`,pointerEvents:"none",backgroundRepeat:"repeat",zIndex:t.zIndex,backgroundImage:`url("${y.value}")`,backgroundSize:`${s+o}px ${d+i}px`}});let u=null;const W=()=>{x.value&&(u=new MutationObserver(n=>{var e;for(const o of n){const i=Array.from(o.removedNodes).includes(h.value),r=o.target===h.value&&o.type==="attributes";if(i||r){const m=(e=h.value)==null?void 0:e.getAttribute("style");if(r&&m&&m.includes(y.value))continue;u==null||u.disconnect(),b(),l.nextTick(()=>W());break}}}),u.observe(x.value,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["style","class"]}))};return l.onMounted(()=>{b(),W()}),l.onUnmounted(()=>{u==null||u.disconnect()}),l.watch(()=>[t.content,t.image,t.rotate,t.gap,t.width,t.height,t.font],()=>{b()},{deep:!0}),(n,e)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"containerRef",ref:x,class:l.normalizeClass(["l-watermark",{"l-watermark--full":n.fullPage}])},[l.renderSlot(n.$slots,"default"),l.createElementVNode("div",{ref_key:"watermarkRef",ref:h,class:"l-watermark__inner",style:l.normalizeStyle(I.value),"aria-hidden":"true"},null,4)],2))}}),v=N;v.install=w=>{w.component("LWatermark",v)};exports.LWatermark=v;exports.default=v;exports.watermarkProps=_;
|