@sdata/web-vue 1.11.1 → 1.13.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/dist/sd.css +177 -6
- package/dist/sd.min.css +1 -1
- package/es/_components/icon-hover.vue.d.ts +1 -1
- package/es/_components/picker/input-range.vue.d.ts +1 -1
- package/es/_components/picker/input.vue.d.ts +1 -1
- package/es/_components/select-view/style/index.css +13 -6
- package/es/_components/virtual-list/virtual-list.vue.d.ts +6 -6
- package/es/_components/virtual-list/virtual-list.vue_vue_type_script_lang.js +2 -2
- package/es/_hooks/use-allow-search.d.ts +10 -0
- package/es/_hooks/use-allow-search.js +31 -0
- package/es/_hooks/use-component-ref.d.ts +1 -1
- package/es/_hooks/use-dropdown-virtual-list-props.d.ts +5 -0
- package/es/_hooks/use-dropdown-virtual-list-props.js +21 -0
- package/es/_hooks/use-form-item.d.ts +1 -1
- package/es/_hooks/use-scrollbar.js +1 -1
- package/es/_hooks/use-size.d.ts +1 -1
- package/es/_hooks/use-trigger.d.ts +1 -1
- package/es/_utils/color.js +1 -1
- package/es/_utils/date.js +7 -1
- package/es/_utils/dom.js +1 -1
- package/es/_utils/global-config.js +1 -1
- package/es/_utils/omit.js +1 -1
- package/es/_utils/responsive-observe.js +1 -1
- package/es/_utils/virtual-dropdown.js +1 -1
- package/es/_utils/vue-utils.js +4 -18
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/asyncToGenerator.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/defineProperty.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/extends.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/objectDestructuringEmpty.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/objectSpread2.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/objectWithoutProperties.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/objectWithoutPropertiesLoose.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/toPrimitive.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/toPropertyKey.js +1 -1
- package/es/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/typeof.js +1 -1
- package/es/affix/affix.vue_vue_type_script_lang.js +31 -3
- package/es/alert/alert.vue.d.ts +2 -2
- package/es/alert/alert.vue_vue_type_script_lang.js +55 -0
- package/es/alert/index.d.ts +5 -5
- package/es/anchor/anchor-link.vue_vue_type_script_lang.js +8 -0
- package/es/anchor/anchor.vue_vue_type_script_lang.js +32 -0
- package/es/auto-complete/auto-complete.d.ts +1 -1
- package/es/auto-complete/auto-complete.js +107 -3
- package/es/auto-complete/index.d.ts +3 -3
- package/es/avatar/avatar-group.js +31 -0
- package/es/avatar/avatar.vue_vue_type_script_lang.js +51 -1
- package/es/back-top/back-top.vue_vue_type_script_lang.js +16 -0
- package/es/badge/badge.js +34 -1
- package/es/breadcrumb/breadcrumb-item.js +27 -0
- package/es/breadcrumb/breadcrumb.js +39 -0
- package/es/button/button-group.vue_vue_type_script_lang.js +22 -0
- package/es/button/button.vue_vue_type_script_lang.js +58 -1
- package/es/calendar/calendar.js +47 -0
- package/es/calendar/month.js +1 -1
- package/es/calendar/year.js +1 -1
- package/es/card/card-grid.vue_vue_type_script_lang.js +6 -1
- package/es/card/card-meta.js +23 -0
- package/es/card/card.js +54 -0
- package/es/carousel/carousel.js +68 -1
- package/es/cascader/cascader-panel.js +2 -28
- package/es/cascader/cascader-panel.vue.d.ts +24 -306
- package/es/cascader/{cascader-panel.vue_vue_type_script_lang.js → cascader-panel.vue_vue_type_script_setup_true_lang.js} +92 -101
- package/es/cascader/cascader.js +2 -145
- package/es/cascader/cascader.vue.d.ts +54 -1290
- package/es/cascader/{cascader.vue_vue_type_script_lang.js → cascader.vue_vue_type_script_setup_true_lang.js} +257 -177
- package/es/cascader/index.d.ts +4 -2986
- package/es/cascader/types.d.ts +79 -0
- package/es/checkbox/checkbox-group.js +48 -0
- package/es/checkbox/checkbox.d.ts +1 -1
- package/es/checkbox/checkbox.js +35 -0
- package/es/checkbox/index.d.ts +2 -2
- package/es/collapse/collapse-item.d.ts +1 -1
- package/es/collapse/collapse-item.js +36 -0
- package/es/collapse/collapse.vue_vue_type_script_lang.js +47 -0
- package/es/collapse/index.d.ts +1 -1
- package/es/color-picker/color-picker.d.ts +1 -1
- package/es/color-picker/color-picker.js +90 -1
- package/es/color-picker/index.d.ts +3 -3
- package/es/color-picker/panel.js +5 -2
- package/es/color-picker/utils.js +1 -1
- package/es/comment/comment.js +47 -1
- package/es/comment/comment.vue.d.ts +2 -2
- package/es/comment/index.d.ts +3 -3
- package/es/components.d.ts +132 -127
- package/es/config-provider/config-provider.vue.d.ts +16 -0
- package/es/config-provider/config-provider.vue_vue_type_script_lang.js +78 -1
- package/es/config-provider/context.d.ts +3 -0
- package/es/config-provider/index.d.ts +24 -0
- package/es/config-provider/theme-provider.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/config-provider/theme.js +1 -1
- package/es/copy/copy.js +5 -0
- package/es/copy/copy.vue.d.ts +15 -0
- package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +95 -0
- package/es/copy/index.d.ts +15 -0
- package/es/copy/index.js +10 -0
- package/es/copy/style/css.js +2 -0
- package/es/copy/style/index.css +25 -0
- package/es/copy/style/index.d.ts +2 -0
- package/es/copy/style/index.js +2 -0
- package/es/copy/style/index.scss +15 -0
- package/es/copy/style/token.scss +3 -0
- package/es/copy/types.d.ts +21 -0
- package/es/cropper/cropper.js +5 -0
- package/es/cropper/cropper.vue.d.ts +45 -0
- package/es/cropper/cropper.vue_vue_type_script_setup_true_lang.js +266 -0
- package/es/cropper/index.d.ts +130 -0
- package/es/cropper/index.js +10 -0
- package/es/cropper/interface.d.ts +59 -0
- package/es/cropper/style/css.js +2 -0
- package/es/cropper/style/index.css +51 -0
- package/es/cropper/style/index.d.ts +2 -0
- package/es/cropper/style/index.js +2 -0
- package/es/cropper/style/index.scss +43 -0
- package/es/cropper/style/token.scss +8 -0
- package/es/date-picker/hooks/use-range-time-picker-value.js +1 -1
- package/es/date-picker/index.d.ts +187 -709
- package/es/date-picker/panels/date/index.js +1 -1
- package/es/date-picker/panels/date/index.vue.d.ts +1 -1
- package/es/date-picker/panels/date/index.vue_vue_type_script_lang.js +1 -1
- package/es/date-picker/panels/footer.vue.d.ts +55 -577
- package/es/date-picker/panels/footer.vue_vue_type_script_lang.js +1 -1
- package/es/date-picker/panels/month/index.js +1 -1
- package/es/date-picker/panels/quarter/index.js +1 -1
- package/es/date-picker/panels/week/index.vue.d.ts +1 -1
- package/es/date-picker/panels/year/index.js +1 -1
- package/es/date-picker/picker-panel.vue.d.ts +264 -786
- package/es/date-picker/picker.js +1 -1
- package/es/date-picker/picker.vue.d.ts +174 -696
- package/es/date-picker/picker.vue_vue_type_script_lang.js +193 -1
- package/es/date-picker/pickers/date-picker.js +42 -0
- package/es/date-picker/pickers/month-picker.js +12 -0
- package/es/date-picker/pickers/quarter-picker.js +17 -0
- package/es/date-picker/pickers/week-picker.js +23 -0
- package/es/date-picker/pickers/year-picker.js +12 -0
- package/es/date-picker/range-picker-panel.vue.d.ts +263 -785
- package/es/date-picker/range-picker-panel.vue_vue_type_script_lang.js +1 -1
- package/es/date-picker/range-picker.js +1 -1
- package/es/date-picker/range-picker.vue.d.ts +187 -709
- package/es/date-picker/range-picker.vue_vue_type_script_lang.js +120 -1
- package/es/descriptions/descriptions-item.vue_vue_type_script_lang.js +16 -0
- package/es/descriptions/descriptions.d.ts +1 -1
- package/es/descriptions/descriptions.js +65 -1
- package/es/descriptions/index.d.ts +3 -3
- package/es/divider/divider.js +24 -0
- package/es/drawer/drawer.vue.d.ts +2 -2
- package/es/drawer/drawer.vue_vue_type_script_lang.js +161 -2
- package/es/drawer/index.d.ts +5 -5
- package/es/drawer/index.js +2 -2
- package/es/dropdown/dropdown-button.vue.d.ts +18 -18
- package/es/dropdown/dropdown-button.vue_vue_type_script_lang.js +70 -0
- package/es/dropdown/dropdown-group.vue_vue_type_script_lang.js +12 -1
- package/es/dropdown/dropdown-option.vue.d.ts +2 -2
- package/es/dropdown/dropdown-option.vue_vue_type_script_lang.js +20 -1
- package/es/dropdown/dropdown-panel.vue.d.ts +6 -6
- package/es/dropdown/dropdown-submenu.vue.d.ts +20 -20
- package/es/dropdown/dropdown-submenu.vue_vue_type_script_lang.js +57 -0
- package/es/dropdown/dropdown.vue.d.ts +18 -18
- package/es/dropdown/dropdown.vue_vue_type_script_lang.js +55 -0
- package/es/dropdown/index.d.ts +76 -76
- package/es/ellipsis/ellipsis.vue.d.ts +24 -24
- package/es/ellipsis/ellipsis.vue_vue_type_script_lang.js +25 -2
- package/es/ellipsis/index.d.ts +96 -96
- package/es/ellipsis/performant-ellipsis.vue.d.ts +24 -24
- package/es/ellipsis/performant-ellipsis.vue_vue_type_script_lang.js +24 -1
- package/es/empty/empty.js +18 -0
- package/es/form/form-item-label.vue.d.ts +24 -24
- package/es/form/form-item.vue.d.ts +28 -28
- package/es/form/form-item.vue_vue_type_script_lang.js +146 -3
- package/es/form/form.vue_vue_type_script_lang.js +108 -0
- package/es/form/index.d.ts +28 -28
- package/es/grid/grid-col.vue_vue_type_script_lang.js +42 -1
- package/es/grid/grid-item.vue_vue_type_script_lang.js +13 -1
- package/es/grid/grid-row.vue_vue_type_script_lang.js +21 -0
- package/es/grid/grid.vue_vue_type_script_lang.js +20 -0
- package/es/icon.js +5 -5
- package/es/image/image.js +1 -1
- package/es/image/image.vue.d.ts +26 -26
- package/es/image/image.vue_vue_type_script_lang.js +82 -0
- package/es/image/preview-action.d.ts +24 -24
- package/es/image/preview-action.js +8 -0
- package/es/image/preview-group.js +1 -1
- package/es/image/preview-group.vue.d.ts +24 -24
- package/es/image/preview-group.vue_vue_type_script_lang.js +48 -0
- package/es/image/preview-toolbar.vue.d.ts +24 -24
- package/es/image/preview-toolbar.vue_vue_type_script_lang.js +1 -0
- package/es/image/preview.vue.d.ts +24 -24
- package/es/image/preview.vue_vue_type_script_lang.js +56 -1
- package/es/index.css +177 -6
- package/es/index.d.ts +9 -1
- package/es/index.js +6 -2
- package/es/index.scss +4 -0
- package/es/input/index.d.ts +5 -5
- package/es/input/input-password.vue.d.ts +2 -2
- package/es/input/input-password.vue_vue_type_script_lang.js +13 -0
- package/es/input/input-search.js +35 -1
- package/es/input/input.d.ts +1 -1
- package/es/input/input.js +129 -1
- package/es/input-number/index.d.ts +38 -26
- package/es/input-number/input-number.d.ts +20 -11
- package/es/input-number/input-number.js +205 -23
- package/es/input-tag/input-tag.js +137 -1
- package/es/input-tag/style/index.css +13 -6
- package/es/input-tag/utils.js +1 -1
- package/es/layout/content.js +5 -0
- package/es/layout/footer.js +5 -0
- package/es/layout/header.js +5 -0
- package/es/layout/layout.vue_vue_type_script_lang.js +6 -1
- package/es/layout/sider.vue_vue_type_script_lang.js +46 -0
- package/es/link/index.d.ts +44 -564
- package/es/link/interface.d.ts +15 -0
- package/es/link/link.js +2 -17
- package/es/link/link.vue.d.ts +31 -286
- package/es/link/link.vue_vue_type_script_setup_true_lang.js +112 -0
- package/es/link/style/index.css +6 -0
- package/es/link/style/index.scss +10 -0
- package/es/list/index.d.ts +3 -3
- package/es/list/list-item-meta.vue_vue_type_script_lang.js +23 -0
- package/es/list/list-item.js +21 -1
- package/es/list/list.d.ts +1 -1
- package/es/list/list.js +104 -2
- package/es/mention/index.d.ts +6 -6
- package/es/mention/mention.d.ts +2 -2
- package/es/mention/mention.js +87 -1
- package/es/menu/base-menu.vue.d.ts +1 -1
- package/es/menu/base-menu.vue_vue_type_script_lang.js +102 -0
- package/es/menu/item-group.vue_vue_type_script_lang.js +11 -1
- package/es/menu/item.d.ts +1 -1
- package/es/menu/item.js +13 -2
- package/es/menu/menu.d.ts +2 -2
- package/es/menu/menu.js +2 -1
- package/es/menu/sub-menu-pop.vue.d.ts +14 -14
- package/es/menu/sub-menu.js +40 -1
- package/es/message/index.js +1 -1
- package/es/message/message.vue.d.ts +1 -1
- package/es/modal/index.d.ts +5 -5
- package/es/modal/index.js +2 -2
- package/es/modal/modal.vue.d.ts +2 -2
- package/es/modal/modal.vue_vue_type_script_lang.js +193 -2
- package/es/notification/index.js +1 -1
- package/es/notification/notification.vue.d.ts +1 -1
- package/es/overflow-list/index.d.ts +3 -3
- package/es/overflow-list/overflow-list.d.ts +1 -1
- package/es/overflow-list/overflow-list.js +25 -1
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/page-header.vue.d.ts +1 -1
- package/es/page-header/page-header.vue_vue_type_script_lang.js +38 -0
- package/es/pagination/page-jumper.vue.d.ts +38 -25
- package/es/pagination/page-options.vue.d.ts +34 -34
- package/es/pagination/pagination.js +122 -0
- package/es/popconfirm/index.d.ts +24 -24
- package/es/popconfirm/popconfirm.vue.d.ts +12 -12
- package/es/popconfirm/popconfirm.vue_vue_type_script_lang.js +95 -1
- package/es/popover/index.d.ts +24 -24
- package/es/popover/popover.vue.d.ts +12 -12
- package/es/popover/popover.vue_vue_type_script_lang.js +62 -0
- package/es/progress/circle.vue.d.ts +3 -3
- package/es/progress/index.d.ts +23 -23
- package/es/progress/line.vue.d.ts +2 -2
- package/es/progress/line.vue_vue_type_script_lang.js +1 -1
- package/es/progress/progress.vue.d.ts +12 -12
- package/es/progress/progress.vue_vue_type_script_lang.js +48 -0
- package/es/progress/steps.vue.d.ts +2 -2
- package/es/radio/index.d.ts +2 -2
- package/es/radio/radio-group.js +53 -0
- package/es/radio/radio.d.ts +1 -1
- package/es/radio/radio.js +36 -0
- package/es/rate/rate.js +54 -0
- package/es/resize-box/resize-box.vue_vue_type_script_lang.js +47 -1
- package/es/result/result.vue_vue_type_script_lang.js +40 -0
- package/es/scrollbar/index.d.ts +6 -6
- package/es/scrollbar/scrollbar.vue.d.ts +3 -3
- package/es/scrollbar/scrollbar.vue_vue_type_script_lang.js +108 -2
- package/es/sd-vue.js +10 -2
- package/es/secret/index.d.ts +48 -0
- package/es/secret/index.js +10 -0
- package/es/secret/secret.js +5 -0
- package/es/secret/secret.vue.d.ts +17 -0
- package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +64 -0
- package/es/secret/style/css.js +2 -0
- package/es/secret/style/index.css +54 -0
- package/es/secret/style/index.d.ts +2 -0
- package/es/secret/style/index.js +2 -0
- package/es/secret/style/index.scss +48 -0
- package/es/secret/style/token.scss +9 -0
- package/es/select/hooks/use-options.js +1 -1
- package/es/select/index.d.ts +34 -34
- package/es/select/optgroup.vue_vue_type_script_lang.js +12 -1
- package/es/select/option.vue.d.ts +4 -4
- package/es/select/option.vue_vue_type_script_lang.js +27 -0
- package/es/select/select-dropdown.vue.d.ts +7 -7
- package/es/select/select.d.ts +14 -14
- package/es/select/select.js +13 -9
- package/es/select/utils.js +1 -1
- package/es/skeleton/line.vue_vue_type_script_lang.js +16 -0
- package/es/skeleton/shape.vue_vue_type_script_lang.js +10 -0
- package/es/skeleton/skeleton.vue_vue_type_script_lang.js +8 -0
- package/es/slider/index.d.ts +120 -96
- package/es/slider/slider-button.vue.d.ts +24 -24
- package/es/slider/slider-input.vue.d.ts +36 -24
- package/es/slider/slider.vue.d.ts +60 -48
- package/es/slider/slider.vue_vue_type_script_lang.js +55 -0
- package/es/space/index.d.ts +6 -6
- package/es/space/space.d.ts +1 -1
- package/es/space/space.js +27 -0
- package/es/spin/spin.js +35 -0
- package/es/split/split.vue_vue_type_script_lang.js +62 -1
- package/es/statistic/countdown.vue_vue_type_script_lang.js +36 -1
- package/es/statistic/statistic.vue_vue_type_script_lang.js +74 -0
- package/es/steps/index.d.ts +3 -3
- package/es/steps/step.vue_vue_type_script_lang.js +36 -0
- package/es/steps/steps.vue.d.ts +1 -1
- package/es/steps/steps.vue_vue_type_script_lang.js +47 -0
- package/es/switch/switch.vue_vue_type_script_lang.js +98 -1
- package/es/table/index.d.ts +14 -14
- package/es/table/table-column.d.ts +2 -2
- package/es/table/table-column.js +115 -0
- package/es/table/table-operation-td.d.ts +4 -4
- package/es/table/table-operation-td.js +1 -1
- package/es/table/table-operation-th.js +1 -1
- package/es/table/table-td.js +1 -1
- package/es/table/table-th.js +1 -1
- package/es/table/table.d.ts +7 -7
- package/es/table/table.js +442 -3
- package/es/table/utils.js +1 -1
- package/es/tabs/tab-pane.vue_vue_type_script_lang.js +23 -1
- package/es/tabs/tabs-tab.vue.d.ts +1 -1
- package/es/tabs/tabs.js +104 -0
- package/es/tag/index.d.ts +29238 -75
- package/es/tag/interface.d.ts +9 -1
- package/es/tag/style/index.css +13 -6
- package/es/tag/style/index.scss +16 -4
- package/es/tag/tag.js +26 -5
- package/es/tag/tag.vue.d.ts +11690 -9
- package/es/tag/tag.vue_vue_type_script_lang.js +139 -3
- package/es/tag-group/index.d.ts +64 -0
- package/es/tag-group/index.js +10 -0
- package/es/tag-group/interface.d.ts +18 -0
- package/es/tag-group/style/css.js +2 -0
- package/es/tag-group/style/index.css +92 -0
- package/es/tag-group/style/index.d.ts +2 -0
- package/es/tag-group/style/index.js +2 -0
- package/es/tag-group/style/index.scss +108 -0
- package/es/tag-group/style/token.scss +6 -0
- package/es/tag-group/tag-group.js +5 -0
- package/es/tag-group/tag-group.vue.d.ts +46 -0
- package/es/tag-group/tag-group.vue_vue_type_script_setup_true_lang.js +360 -0
- package/es/textarea/index.d.ts +2 -2
- package/es/textarea/textarea.vue.d.ts +1 -1
- package/es/textarea/textarea.vue_vue_type_script_lang.js +90 -1
- package/es/time-picker/index.d.ts +35 -35
- package/es/time-picker/panel.vue.d.ts +1 -1
- package/es/time-picker/range-panel.d.ts +1 -1
- package/es/time-picker/range-panel.js +1 -1
- package/es/time-picker/time-picker.js +1 -1
- package/es/time-picker/time-picker.vue.d.ts +17 -17
- package/es/time-picker/time-picker.vue_vue_type_script_lang.js +132 -0
- package/es/timeline/item.vue_vue_type_script_lang.js +38 -1
- package/es/timeline/timeline.js +28 -0
- package/es/tooltip/index.d.ts +24 -24
- package/es/tooltip/tooltip.vue.d.ts +12 -12
- package/es/tooltip/tooltip.vue_vue_type_script_lang.js +61 -1
- package/es/transfer/index.d.ts +27 -27
- package/es/transfer/transfer-view.vue.d.ts +12 -12
- package/es/transfer/transfer.vue.d.ts +13 -13
- package/es/transfer/transfer.vue_vue_type_script_lang.js +136 -0
- package/es/tree/base-node.vue.d.ts +2 -2
- package/es/tree/base-node.vue_vue_type_script_lang.js +7 -0
- package/es/tree/node.js +1 -1
- package/es/tree/transition-node-list.vue.d.ts +2 -2
- package/es/tree/tree.vue.d.ts +8 -8
- package/es/tree/tree.vue_vue_type_script_lang.js +287 -2
- package/es/tree/utils/tree-data.js +1 -1
- package/es/tree-select/hooks/use-selected-state.js +1 -1
- package/es/tree-select/panel.js +1 -1
- package/es/tree-select/tree-select.js +1 -1
- package/es/tree-select/tree-select.vue.d.ts +17 -17
- package/es/tree-select/tree-select.vue_vue_type_script_lang.js +287 -10
- package/es/trigger/index.d.ts +12 -12
- package/es/trigger/trigger.d.ts +7 -7
- package/es/trigger/trigger.js +161 -1
- package/es/trigger/utils.js +1 -1
- package/es/typography/base.d.ts +8 -1
- package/es/typography/base.js +127 -3
- package/es/typography/edit-content.vue.d.ts +15 -15
- package/es/typography/index.d.ts +1 -1
- package/es/typography/interface.d.ts +2 -0
- package/es/typography/operations.js +30 -0
- package/es/typography/operations.vue.d.ts +24 -24
- package/es/typography/paragraph.js +8 -0
- package/es/typography/title.d.ts +1 -1
- package/es/typography/title.js +6 -1
- package/es/upload/upload-button.d.ts +1 -1
- package/es/upload/upload.js +279 -2
- package/es/verification-code/index.d.ts +3 -3
- package/es/verification-code/verification-code.d.ts +1 -1
- package/es/verification-code/verification-code.js +59 -0
- package/es/watermark/hooks/use-mutation-observer.js +1 -1
- package/es/watermark/index.d.ts +3 -3
- package/es/watermark/watermark.d.ts +1 -1
- package/es/watermark/watermark.js +58 -1
- package/es/web-vue.css +24 -24
- package/json/vetur-attributes.json +137 -218
- package/json/vetur-tags.json +59 -67
- package/json/web-types.json +312 -493
- package/package.json +9 -7
- package/es/_utils/clipboard.d.ts +0 -1
- package/es/_utils/clipboard.js +0 -35
- package/es/link/link.vue_vue_type_script_lang.js +0 -56
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/objectSpread2.js";
|
|
2
|
+
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
|
+
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/asyncToGenerator.js";
|
|
4
|
+
import Button from "../button/index.js";
|
|
5
|
+
import Tooltip from "../tooltip/index.js";
|
|
6
|
+
import IconCopy from "../icon/icon-copy/index.js";
|
|
7
|
+
import Link from "../link/index.js";
|
|
8
|
+
import Message from "../message/index.js";
|
|
9
|
+
import { computed, createBlock, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, unref, useAttrs, withCtx } from "vue";
|
|
10
|
+
import copy from "copy-to-clipboard";
|
|
11
|
+
//#region components/copy/copy.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
+
var copy_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent(_objectSpread2(_objectSpread2({}, {
|
|
13
|
+
name: "Copy",
|
|
14
|
+
inheritAttrs: false
|
|
15
|
+
}), {}, {
|
|
16
|
+
__name: "copy",
|
|
17
|
+
props: {
|
|
18
|
+
content: { default: "" },
|
|
19
|
+
tooltip: { default: "复制" },
|
|
20
|
+
tooltipProps: { default: void 0 },
|
|
21
|
+
clipboardProps: { default: void 0 },
|
|
22
|
+
textInherit: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
successMessage: { default: "复制成功" },
|
|
27
|
+
href: {},
|
|
28
|
+
status: {},
|
|
29
|
+
hoverable: { type: Boolean },
|
|
30
|
+
icon: { type: Boolean },
|
|
31
|
+
ellipsis: { type: Boolean },
|
|
32
|
+
ellipsisLineClamp: {},
|
|
33
|
+
ellipsisExpandTrigger: {},
|
|
34
|
+
ellipsisTooltip: { type: [Boolean, Object] },
|
|
35
|
+
iconTooltip: {},
|
|
36
|
+
loading: { type: Boolean },
|
|
37
|
+
disabled: { type: Boolean },
|
|
38
|
+
component: { default: "link" },
|
|
39
|
+
type: {},
|
|
40
|
+
shape: {},
|
|
41
|
+
size: {},
|
|
42
|
+
long: { type: Boolean },
|
|
43
|
+
htmlType: {},
|
|
44
|
+
autofocus: { type: Boolean }
|
|
45
|
+
},
|
|
46
|
+
emits: ["copy"],
|
|
47
|
+
setup(__props, { emit: __emit }) {
|
|
48
|
+
const props = __props;
|
|
49
|
+
const emit = __emit;
|
|
50
|
+
const attrs = useAttrs();
|
|
51
|
+
const prefixCls = getPrefixCls("copy");
|
|
52
|
+
const componentMap = {
|
|
53
|
+
link: Link,
|
|
54
|
+
button: Button
|
|
55
|
+
};
|
|
56
|
+
const renderComponent = computed(() => componentMap[props.component]);
|
|
57
|
+
const componentClass = computed(() => [prefixCls, { [`${prefixCls}-inherit`]: props.component === "link" && props.textInherit }]);
|
|
58
|
+
const isDisabled = computed(() => {
|
|
59
|
+
var _props$disabled;
|
|
60
|
+
const disabled = (_props$disabled = props.disabled) !== null && _props$disabled !== void 0 ? _props$disabled : attrs.disabled;
|
|
61
|
+
return disabled === "" || disabled === true || disabled === "true";
|
|
62
|
+
});
|
|
63
|
+
const mergedTooltipProps = computed(() => {
|
|
64
|
+
var _props$tooltipProps$c, _props$tooltipProps;
|
|
65
|
+
return _objectSpread2(_objectSpread2({}, props.tooltipProps), {}, { content: (_props$tooltipProps$c = (_props$tooltipProps = props.tooltipProps) === null || _props$tooltipProps === void 0 ? void 0 : _props$tooltipProps.content) !== null && _props$tooltipProps$c !== void 0 ? _props$tooltipProps$c : props.tooltip });
|
|
66
|
+
});
|
|
67
|
+
function handleCopy() {
|
|
68
|
+
return _handleCopy.apply(this, arguments);
|
|
69
|
+
}
|
|
70
|
+
function _handleCopy() {
|
|
71
|
+
_handleCopy = _asyncToGenerator(function* () {
|
|
72
|
+
if (isDisabled.value) return;
|
|
73
|
+
yield copy(props.content, props.clipboardProps);
|
|
74
|
+
Message.success(props.successMessage);
|
|
75
|
+
emit("copy", props.content);
|
|
76
|
+
});
|
|
77
|
+
return _handleCopy.apply(this, arguments);
|
|
78
|
+
}
|
|
79
|
+
return (_ctx, _cache) => {
|
|
80
|
+
return openBlock(), createBlock(unref(Tooltip), normalizeProps(guardReactiveProps(mergedTooltipProps.value)), {
|
|
81
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(renderComponent.value), mergeProps(unref(attrs), {
|
|
82
|
+
class: componentClass.value,
|
|
83
|
+
onClick: handleCopy
|
|
84
|
+
}), {
|
|
85
|
+
icon: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(unref(IconCopy))])]),
|
|
86
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
87
|
+
_: 3
|
|
88
|
+
}, 16, ["class"]))]),
|
|
89
|
+
_: 3
|
|
90
|
+
}, 16);
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}));
|
|
94
|
+
//#endregion
|
|
95
|
+
export { copy_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import type { SDOptions } from '../_utils/types';
|
|
3
|
+
import _Copy from './copy.vue';
|
|
4
|
+
declare const Copy: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps> & (new () => {
|
|
5
|
+
$slots: {
|
|
6
|
+
icon?: (props: {}) => any;
|
|
7
|
+
} & {
|
|
8
|
+
default?: (props: {}) => any;
|
|
9
|
+
};
|
|
10
|
+
}) & {
|
|
11
|
+
install: (app: App, options?: SDOptions) => void;
|
|
12
|
+
};
|
|
13
|
+
export type CopyInstance = InstanceType<typeof _Copy>;
|
|
14
|
+
export type { CopyButtonProps, CopyComponentType, CopyLinkProps, CopyProps } from './types';
|
|
15
|
+
export default Copy;
|
package/es/copy/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getComponentPrefix, setGlobalConfig } from "../_utils/global-config.js";
|
|
2
|
+
import copy_default from "./copy.js";
|
|
3
|
+
//#region components/copy/index.ts
|
|
4
|
+
var Copy = Object.assign(copy_default, { install: (app, options) => {
|
|
5
|
+
setGlobalConfig(app, options);
|
|
6
|
+
const componentPrefix = getComponentPrefix(options);
|
|
7
|
+
app.component(componentPrefix + copy_default.name, copy_default);
|
|
8
|
+
} });
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Copy as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/******** borderSize *******/
|
|
2
|
+
/******** borderStyle *******/
|
|
3
|
+
/******** radius *******/
|
|
4
|
+
/******** shadow distance *******/
|
|
5
|
+
/******** size *******/
|
|
6
|
+
/******** spacing *******/
|
|
7
|
+
/******** shadow *******/
|
|
8
|
+
/******** opacity *******/
|
|
9
|
+
/******** fontSize *******/
|
|
10
|
+
/******** fontWeight ********/
|
|
11
|
+
/******** Primary *******/
|
|
12
|
+
/******** success *******/
|
|
13
|
+
/******** warning *******/
|
|
14
|
+
/******** danger *******/
|
|
15
|
+
/******** link *******/
|
|
16
|
+
/******** radius *******/
|
|
17
|
+
/********* icon hover *********/
|
|
18
|
+
.sd-copy {
|
|
19
|
+
border-radius: 2px;
|
|
20
|
+
}
|
|
21
|
+
.sd-copy.sd-copy-inherit {
|
|
22
|
+
color: inherit;
|
|
23
|
+
font: inherit;
|
|
24
|
+
line-height: inherit;
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@use '@style/theme/index.scss' as theme;
|
|
2
|
+
@use 'sass:string';
|
|
3
|
+
@use '@components/copy/style/token.scss' as *;
|
|
4
|
+
|
|
5
|
+
$copy-prefix-cls: string.unquote('#{theme.$prefix}-copy');
|
|
6
|
+
|
|
7
|
+
.#{$copy-prefix-cls} {
|
|
8
|
+
border-radius: $copy-border-radius;
|
|
9
|
+
|
|
10
|
+
&#{&}-inherit {
|
|
11
|
+
color: inherit;
|
|
12
|
+
font: inherit;
|
|
13
|
+
line-height: inherit;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Options as ClipboardOptions } from 'copy-to-clipboard';
|
|
2
|
+
import type { ButtonProps } from '../button';
|
|
3
|
+
import type { LinkProps } from '../link';
|
|
4
|
+
import type { TooltipInstance } from '../tooltip';
|
|
5
|
+
export type CopyComponentType = 'link' | 'button';
|
|
6
|
+
type CopyBaseProps = {
|
|
7
|
+
content?: string;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
tooltipProps?: TooltipInstance['$props'];
|
|
10
|
+
clipboardProps?: ClipboardOptions;
|
|
11
|
+
textInherit?: boolean;
|
|
12
|
+
successMessage?: string;
|
|
13
|
+
};
|
|
14
|
+
export type CopyLinkProps = CopyBaseProps & LinkProps & {
|
|
15
|
+
component?: 'link';
|
|
16
|
+
};
|
|
17
|
+
export type CopyButtonProps = CopyBaseProps & ButtonProps & {
|
|
18
|
+
component: 'button';
|
|
19
|
+
};
|
|
20
|
+
export type CopyProps = CopyLinkProps | CopyButtonProps;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import cropper_vue_vue_type_script_setup_true_lang_default from "./cropper.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region components/cropper/cropper.vue
|
|
3
|
+
var cropper_default = cropper_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { cropper_default as default };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CropperCanvasProps, CropperExpose, CropperImageProps, CropperProps, CropperSelectionChangeDetail, CropperSelectionProps } from './interface';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<CropperProps, CropperExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
"selection:change": (detail: CropperSelectionChangeDetail) => any;
|
|
4
|
+
"update:selectionX": (value: number) => any;
|
|
5
|
+
"update:selectionY": (value: number) => any;
|
|
6
|
+
"update:selectionWidth": (value: number) => any;
|
|
7
|
+
"update:selectionHeight": (value: number) => any;
|
|
8
|
+
"canvas:action": (detail: unknown) => any;
|
|
9
|
+
"canvas:actionstart": (detail: unknown) => any;
|
|
10
|
+
"canvas:actionmove": (detail: unknown) => any;
|
|
11
|
+
"canvas:actionend": (detail: unknown) => any;
|
|
12
|
+
"image:transform": (detail: {
|
|
13
|
+
matrix: number[];
|
|
14
|
+
oldMatrix: number[];
|
|
15
|
+
}) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<CropperProps> & Readonly<{
|
|
17
|
+
"onSelection:change"?: ((detail: CropperSelectionChangeDetail) => any) | undefined;
|
|
18
|
+
"onUpdate:selectionX"?: ((value: number) => any) | undefined;
|
|
19
|
+
"onUpdate:selectionY"?: ((value: number) => any) | undefined;
|
|
20
|
+
"onUpdate:selectionWidth"?: ((value: number) => any) | undefined;
|
|
21
|
+
"onUpdate:selectionHeight"?: ((value: number) => any) | undefined;
|
|
22
|
+
"onCanvas:action"?: ((detail: unknown) => any) | undefined;
|
|
23
|
+
"onCanvas:actionstart"?: ((detail: unknown) => any) | undefined;
|
|
24
|
+
"onCanvas:actionmove"?: ((detail: unknown) => any) | undefined;
|
|
25
|
+
"onCanvas:actionend"?: ((detail: unknown) => any) | undefined;
|
|
26
|
+
"onImage:transform"?: ((detail: {
|
|
27
|
+
matrix: number[];
|
|
28
|
+
oldMatrix: number[];
|
|
29
|
+
}) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
template: string;
|
|
32
|
+
width: number | string;
|
|
33
|
+
height: number | string;
|
|
34
|
+
src: string;
|
|
35
|
+
canvasProps: CropperCanvasProps;
|
|
36
|
+
imageProps: CropperImageProps;
|
|
37
|
+
selectionProps: CropperSelectionProps;
|
|
38
|
+
selectionX: number;
|
|
39
|
+
selectionY: number;
|
|
40
|
+
selectionWidth: number;
|
|
41
|
+
selectionHeight: number;
|
|
42
|
+
fitSelectionToImage: boolean;
|
|
43
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
|
+
declare const _default: typeof __VLS_export;
|
|
45
|
+
export default _default;
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/objectSpread2.js";
|
|
2
|
+
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
|
+
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/asyncToGenerator.js";
|
|
4
|
+
import { computed, createElementBlock, createElementVNode, defineComponent, mergeProps, nextTick, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, unref, useAttrs, watch } from "vue";
|
|
5
|
+
import { isNumber, isString } from "es-toolkit";
|
|
6
|
+
//#region components/cropper/cropper.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var _hoisted_1 = ["src"];
|
|
8
|
+
var cropper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent(_objectSpread2(_objectSpread2({}, {
|
|
9
|
+
name: "Cropper",
|
|
10
|
+
inheritAttrs: false
|
|
11
|
+
}), {}, {
|
|
12
|
+
__name: "cropper",
|
|
13
|
+
props: {
|
|
14
|
+
src: { default: "" },
|
|
15
|
+
canvasProps: { default: () => ({}) },
|
|
16
|
+
imageProps: { default: () => ({}) },
|
|
17
|
+
selectionProps: { default: () => ({}) },
|
|
18
|
+
template: { default: void 0 },
|
|
19
|
+
selectionX: { default: void 0 },
|
|
20
|
+
selectionY: { default: void 0 },
|
|
21
|
+
selectionWidth: { default: void 0 },
|
|
22
|
+
selectionHeight: { default: void 0 },
|
|
23
|
+
width: { default: "100%" },
|
|
24
|
+
height: { default: "100%" },
|
|
25
|
+
fitSelectionToImage: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
emits: [
|
|
31
|
+
"selection:change",
|
|
32
|
+
"update:selectionX",
|
|
33
|
+
"update:selectionY",
|
|
34
|
+
"update:selectionWidth",
|
|
35
|
+
"update:selectionHeight",
|
|
36
|
+
"canvas:action",
|
|
37
|
+
"canvas:actionstart",
|
|
38
|
+
"canvas:actionmove",
|
|
39
|
+
"canvas:actionend",
|
|
40
|
+
"image:transform"
|
|
41
|
+
],
|
|
42
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
43
|
+
const props = __props;
|
|
44
|
+
const emit = __emit;
|
|
45
|
+
const attrs = useAttrs();
|
|
46
|
+
const prefixCls = getPrefixCls("cropper");
|
|
47
|
+
const imgRef = ref();
|
|
48
|
+
const trackedHandlers = [];
|
|
49
|
+
let cropperInstance = null;
|
|
50
|
+
let cropperConstructorPromise = null;
|
|
51
|
+
function loadCropperConstructor() {
|
|
52
|
+
if (!cropperConstructorPromise) cropperConstructorPromise = import("cropperjs").then((module) => module.default);
|
|
53
|
+
return cropperConstructorPromise;
|
|
54
|
+
}
|
|
55
|
+
const resolveSize = (value) => {
|
|
56
|
+
if (isNumber(value)) return `${value}px`;
|
|
57
|
+
if (isString(value)) return value;
|
|
58
|
+
return "100%";
|
|
59
|
+
};
|
|
60
|
+
const rootClass = computed(() => [prefixCls]);
|
|
61
|
+
const rootStyle = computed(() => ({
|
|
62
|
+
"--sd-cropper-width": resolveSize(props.width),
|
|
63
|
+
"--sd-cropper-height": resolveSize(props.height)
|
|
64
|
+
}));
|
|
65
|
+
function addTrackedListener(el, event, fn) {
|
|
66
|
+
el.addEventListener(event, fn);
|
|
67
|
+
trackedHandlers.push({
|
|
68
|
+
el,
|
|
69
|
+
event,
|
|
70
|
+
fn
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function toKebabCase(key) {
|
|
74
|
+
return key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
75
|
+
}
|
|
76
|
+
function syncPropsToElement(el, propsObject) {
|
|
77
|
+
if (!el) return;
|
|
78
|
+
for (const [key, value] of Object.entries(propsObject)) {
|
|
79
|
+
const attrName = toKebabCase(key);
|
|
80
|
+
if (value === void 0 || value === null || value === false) {
|
|
81
|
+
el.removeAttribute(attrName);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (value === true) {
|
|
85
|
+
el.setAttribute(attrName, "");
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
el.setAttribute(attrName, String(value));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function getCropperCanvas() {
|
|
92
|
+
var _cropperInstance$getC;
|
|
93
|
+
return (_cropperInstance$getC = cropperInstance === null || cropperInstance === void 0 ? void 0 : cropperInstance.getCropperCanvas()) !== null && _cropperInstance$getC !== void 0 ? _cropperInstance$getC : null;
|
|
94
|
+
}
|
|
95
|
+
function getCropperImage() {
|
|
96
|
+
var _cropperInstance$getC2;
|
|
97
|
+
return (_cropperInstance$getC2 = cropperInstance === null || cropperInstance === void 0 ? void 0 : cropperInstance.getCropperImage()) !== null && _cropperInstance$getC2 !== void 0 ? _cropperInstance$getC2 : null;
|
|
98
|
+
}
|
|
99
|
+
function getCropperSelection() {
|
|
100
|
+
var _cropperInstance$getC3;
|
|
101
|
+
return (_cropperInstance$getC3 = cropperInstance === null || cropperInstance === void 0 ? void 0 : cropperInstance.getCropperSelection()) !== null && _cropperInstance$getC3 !== void 0 ? _cropperInstance$getC3 : null;
|
|
102
|
+
}
|
|
103
|
+
function getCropperSelections() {
|
|
104
|
+
var _cropperInstance$getC4;
|
|
105
|
+
return (_cropperInstance$getC4 = cropperInstance === null || cropperInstance === void 0 ? void 0 : cropperInstance.getCropperSelections()) !== null && _cropperInstance$getC4 !== void 0 ? _cropperInstance$getC4 : null;
|
|
106
|
+
}
|
|
107
|
+
function alignSelectionToImage() {
|
|
108
|
+
var _matrix$, _matrix$2;
|
|
109
|
+
const image = getCropperImage();
|
|
110
|
+
const selection = getCropperSelection();
|
|
111
|
+
const imageElement = imgRef.value;
|
|
112
|
+
if (!image || !selection || !imageElement) return;
|
|
113
|
+
const naturalWidth = imageElement.naturalWidth;
|
|
114
|
+
const naturalHeight = imageElement.naturalHeight;
|
|
115
|
+
if (!naturalWidth || !naturalHeight) return;
|
|
116
|
+
const matrix = image.$getTransform();
|
|
117
|
+
const scaleX = (_matrix$ = matrix[0]) !== null && _matrix$ !== void 0 ? _matrix$ : 0;
|
|
118
|
+
const scaleY = (_matrix$2 = matrix[3]) !== null && _matrix$2 !== void 0 ? _matrix$2 : 0;
|
|
119
|
+
if (!scaleX || !scaleY) return;
|
|
120
|
+
const renderedWidth = naturalWidth * scaleX;
|
|
121
|
+
const renderedHeight = naturalHeight * scaleY;
|
|
122
|
+
selection.$change(1, 1, (scaleX > 1 ? renderedWidth : image.clientWidth) - 2, (scaleY > 1 ? renderedHeight : image.clientHeight) - 2);
|
|
123
|
+
}
|
|
124
|
+
function bindCanvasEvents(canvas) {
|
|
125
|
+
for (const eventName of [
|
|
126
|
+
"action",
|
|
127
|
+
"actionstart",
|
|
128
|
+
"actionmove",
|
|
129
|
+
"actionend"
|
|
130
|
+
]) addTrackedListener(canvas, eventName, (event) => {
|
|
131
|
+
const detail = event.detail;
|
|
132
|
+
if (eventName === "action") emit("canvas:action", detail);
|
|
133
|
+
if (eventName === "actionstart") emit("canvas:actionstart", detail);
|
|
134
|
+
if (eventName === "actionmove") emit("canvas:actionmove", detail);
|
|
135
|
+
if (eventName === "actionend") emit("canvas:actionend", detail);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function bindSelectionEvents(selection) {
|
|
139
|
+
addTrackedListener(selection, "change", (event) => {
|
|
140
|
+
const detail = event.detail;
|
|
141
|
+
emit("selection:change", detail);
|
|
142
|
+
emit("update:selectionX", detail.x);
|
|
143
|
+
emit("update:selectionY", detail.y);
|
|
144
|
+
emit("update:selectionWidth", detail.width);
|
|
145
|
+
emit("update:selectionHeight", detail.height);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function bindImageEvents(image) {
|
|
149
|
+
addTrackedListener(image, "transform", (event) => {
|
|
150
|
+
emit("image:transform", event.detail);
|
|
151
|
+
});
|
|
152
|
+
if (!props.fitSelectionToImage) return;
|
|
153
|
+
const imageElement = imgRef.value;
|
|
154
|
+
if (!imageElement) return;
|
|
155
|
+
const align = () => nextTick(() => alignSelectionToImage());
|
|
156
|
+
if (imageElement.complete && imageElement.naturalWidth > 0) {
|
|
157
|
+
align();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const onLoad = () => {
|
|
161
|
+
imageElement.removeEventListener("load", onLoad);
|
|
162
|
+
align();
|
|
163
|
+
};
|
|
164
|
+
imageElement.addEventListener("load", onLoad);
|
|
165
|
+
}
|
|
166
|
+
function syncChildProps() {
|
|
167
|
+
syncPropsToElement(getCropperCanvas(), props.canvasProps);
|
|
168
|
+
syncPropsToElement(getCropperImage(), props.imageProps);
|
|
169
|
+
syncPropsToElement(getCropperSelection(), props.selectionProps);
|
|
170
|
+
}
|
|
171
|
+
function destroy() {
|
|
172
|
+
for (const { el, event, fn } of trackedHandlers) el.removeEventListener(event, fn);
|
|
173
|
+
trackedHandlers.length = 0;
|
|
174
|
+
cropperInstance === null || cropperInstance === void 0 || cropperInstance.destroy();
|
|
175
|
+
cropperInstance = null;
|
|
176
|
+
}
|
|
177
|
+
onMounted(_asyncToGenerator(function* () {
|
|
178
|
+
if (!imgRef.value) return;
|
|
179
|
+
const CropperConstructor = yield loadCropperConstructor();
|
|
180
|
+
const options = {};
|
|
181
|
+
if (props.template !== void 0) options.template = props.template;
|
|
182
|
+
cropperInstance = new CropperConstructor(imgRef.value, options);
|
|
183
|
+
nextTick(() => {
|
|
184
|
+
syncChildProps();
|
|
185
|
+
const canvas = getCropperCanvas();
|
|
186
|
+
if (canvas) bindCanvasEvents(canvas);
|
|
187
|
+
const selection = getCropperSelection();
|
|
188
|
+
if (selection) bindSelectionEvents(selection);
|
|
189
|
+
const image = getCropperImage();
|
|
190
|
+
if (image) bindImageEvents(image);
|
|
191
|
+
});
|
|
192
|
+
}));
|
|
193
|
+
onBeforeUnmount(() => {
|
|
194
|
+
destroy();
|
|
195
|
+
});
|
|
196
|
+
watch(() => props.src, (value) => {
|
|
197
|
+
const cropperImage = getCropperImage();
|
|
198
|
+
if (cropperImage) {
|
|
199
|
+
cropperImage.src = value !== null && value !== void 0 ? value : "";
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (imgRef.value) imgRef.value.src = value !== null && value !== void 0 ? value : "";
|
|
203
|
+
});
|
|
204
|
+
watch(() => props.canvasProps, () => {
|
|
205
|
+
nextTick(() => {
|
|
206
|
+
syncPropsToElement(getCropperCanvas(), props.canvasProps);
|
|
207
|
+
});
|
|
208
|
+
}, { deep: true });
|
|
209
|
+
watch(() => props.imageProps, () => {
|
|
210
|
+
nextTick(() => {
|
|
211
|
+
syncPropsToElement(getCropperImage(), props.imageProps);
|
|
212
|
+
});
|
|
213
|
+
}, { deep: true });
|
|
214
|
+
watch(() => props.selectionProps, () => {
|
|
215
|
+
nextTick(() => {
|
|
216
|
+
syncPropsToElement(getCropperSelection(), props.selectionProps);
|
|
217
|
+
});
|
|
218
|
+
}, { deep: true });
|
|
219
|
+
watch([
|
|
220
|
+
() => props.selectionX,
|
|
221
|
+
() => props.selectionY,
|
|
222
|
+
() => props.selectionWidth,
|
|
223
|
+
() => props.selectionHeight
|
|
224
|
+
], ([x, y, width, height]) => {
|
|
225
|
+
if (x === void 0 && y === void 0 && width === void 0 && height === void 0) return;
|
|
226
|
+
const selection = getCropperSelection();
|
|
227
|
+
if (!selection) return;
|
|
228
|
+
nextTick(() => {
|
|
229
|
+
const nextX = x !== null && x !== void 0 ? x : selection.x;
|
|
230
|
+
const nextY = y !== null && y !== void 0 ? y : selection.y;
|
|
231
|
+
const nextWidth = width !== null && width !== void 0 ? width : selection.width;
|
|
232
|
+
const nextHeight = height !== null && height !== void 0 ? height : selection.height;
|
|
233
|
+
if (typeof selection.$change !== "function") {
|
|
234
|
+
selection.x = nextX;
|
|
235
|
+
selection.y = nextY;
|
|
236
|
+
selection.width = nextWidth;
|
|
237
|
+
selection.height = nextHeight;
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
selection.$change(nextX, nextY, nextWidth, nextHeight);
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
__expose({
|
|
244
|
+
getInstance: () => cropperInstance,
|
|
245
|
+
getCropperCanvas,
|
|
246
|
+
getCropperImage,
|
|
247
|
+
getCropperSelection,
|
|
248
|
+
getCropperSelections,
|
|
249
|
+
destroy
|
|
250
|
+
});
|
|
251
|
+
return (_ctx, _cache) => {
|
|
252
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
253
|
+
class: rootClass.value,
|
|
254
|
+
style: rootStyle.value
|
|
255
|
+
}, unref(attrs)), [createElementVNode("img", {
|
|
256
|
+
ref_key: "imgRef",
|
|
257
|
+
ref: imgRef,
|
|
258
|
+
src: props.src,
|
|
259
|
+
alt: "",
|
|
260
|
+
class: normalizeClass(`${unref(prefixCls)}-source-image`)
|
|
261
|
+
}, null, 10, _hoisted_1)], 16);
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
}));
|
|
265
|
+
//#endregion
|
|
266
|
+
export { cropper_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import type { SDOptions } from '../_utils/types';
|
|
3
|
+
import _Cropper from './cropper.vue';
|
|
4
|
+
declare const Cropper: {
|
|
5
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./interface").CropperProps> & Readonly<{
|
|
6
|
+
"onSelection:change"?: ((detail: import("./interface").CropperSelectionChangeDetail) => any) | undefined;
|
|
7
|
+
"onUpdate:selectionX"?: ((value: number) => any) | undefined;
|
|
8
|
+
"onUpdate:selectionY"?: ((value: number) => any) | undefined;
|
|
9
|
+
"onUpdate:selectionWidth"?: ((value: number) => any) | undefined;
|
|
10
|
+
"onUpdate:selectionHeight"?: ((value: number) => any) | undefined;
|
|
11
|
+
"onCanvas:action"?: ((detail: unknown) => any) | undefined;
|
|
12
|
+
"onCanvas:actionstart"?: ((detail: unknown) => any) | undefined;
|
|
13
|
+
"onCanvas:actionmove"?: ((detail: unknown) => any) | undefined;
|
|
14
|
+
"onCanvas:actionend"?: ((detail: unknown) => any) | undefined;
|
|
15
|
+
"onImage:transform"?: ((detail: {
|
|
16
|
+
matrix: number[];
|
|
17
|
+
oldMatrix: number[];
|
|
18
|
+
}) => any) | undefined;
|
|
19
|
+
}>, import("./interface").CropperExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
"selection:change": (detail: import("./interface").CropperSelectionChangeDetail) => any;
|
|
21
|
+
"update:selectionX": (value: number) => any;
|
|
22
|
+
"update:selectionY": (value: number) => any;
|
|
23
|
+
"update:selectionWidth": (value: number) => any;
|
|
24
|
+
"update:selectionHeight": (value: number) => any;
|
|
25
|
+
"canvas:action": (detail: unknown) => any;
|
|
26
|
+
"canvas:actionstart": (detail: unknown) => any;
|
|
27
|
+
"canvas:actionmove": (detail: unknown) => any;
|
|
28
|
+
"canvas:actionend": (detail: unknown) => any;
|
|
29
|
+
"image:transform": (detail: {
|
|
30
|
+
matrix: number[];
|
|
31
|
+
oldMatrix: number[];
|
|
32
|
+
}) => any;
|
|
33
|
+
}, import("vue").PublicProps, {
|
|
34
|
+
template: string;
|
|
35
|
+
width: number | string;
|
|
36
|
+
height: number | string;
|
|
37
|
+
src: string;
|
|
38
|
+
canvasProps: import("./interface").CropperCanvasProps;
|
|
39
|
+
imageProps: import("./interface").CropperImageProps;
|
|
40
|
+
selectionProps: import("./interface").CropperSelectionProps;
|
|
41
|
+
selectionX: number;
|
|
42
|
+
selectionY: number;
|
|
43
|
+
selectionWidth: number;
|
|
44
|
+
selectionHeight: number;
|
|
45
|
+
fitSelectionToImage: boolean;
|
|
46
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
47
|
+
P: {};
|
|
48
|
+
B: {};
|
|
49
|
+
D: {};
|
|
50
|
+
C: {};
|
|
51
|
+
M: {};
|
|
52
|
+
Defaults: {};
|
|
53
|
+
}, Readonly<import("./interface").CropperProps> & Readonly<{
|
|
54
|
+
"onSelection:change"?: ((detail: import("./interface").CropperSelectionChangeDetail) => any) | undefined;
|
|
55
|
+
"onUpdate:selectionX"?: ((value: number) => any) | undefined;
|
|
56
|
+
"onUpdate:selectionY"?: ((value: number) => any) | undefined;
|
|
57
|
+
"onUpdate:selectionWidth"?: ((value: number) => any) | undefined;
|
|
58
|
+
"onUpdate:selectionHeight"?: ((value: number) => any) | undefined;
|
|
59
|
+
"onCanvas:action"?: ((detail: unknown) => any) | undefined;
|
|
60
|
+
"onCanvas:actionstart"?: ((detail: unknown) => any) | undefined;
|
|
61
|
+
"onCanvas:actionmove"?: ((detail: unknown) => any) | undefined;
|
|
62
|
+
"onCanvas:actionend"?: ((detail: unknown) => any) | undefined;
|
|
63
|
+
"onImage:transform"?: ((detail: {
|
|
64
|
+
matrix: number[];
|
|
65
|
+
oldMatrix: number[];
|
|
66
|
+
}) => any) | undefined;
|
|
67
|
+
}>, import("./interface").CropperExpose, {}, {}, {}, {
|
|
68
|
+
template: string;
|
|
69
|
+
width: number | string;
|
|
70
|
+
height: number | string;
|
|
71
|
+
src: string;
|
|
72
|
+
canvasProps: import("./interface").CropperCanvasProps;
|
|
73
|
+
imageProps: import("./interface").CropperImageProps;
|
|
74
|
+
selectionProps: import("./interface").CropperSelectionProps;
|
|
75
|
+
selectionX: number;
|
|
76
|
+
selectionY: number;
|
|
77
|
+
selectionWidth: number;
|
|
78
|
+
selectionHeight: number;
|
|
79
|
+
fitSelectionToImage: boolean;
|
|
80
|
+
}>;
|
|
81
|
+
__isFragment?: never;
|
|
82
|
+
__isTeleport?: never;
|
|
83
|
+
__isSuspense?: never;
|
|
84
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./interface").CropperProps> & Readonly<{
|
|
85
|
+
"onSelection:change"?: ((detail: import("./interface").CropperSelectionChangeDetail) => any) | undefined;
|
|
86
|
+
"onUpdate:selectionX"?: ((value: number) => any) | undefined;
|
|
87
|
+
"onUpdate:selectionY"?: ((value: number) => any) | undefined;
|
|
88
|
+
"onUpdate:selectionWidth"?: ((value: number) => any) | undefined;
|
|
89
|
+
"onUpdate:selectionHeight"?: ((value: number) => any) | undefined;
|
|
90
|
+
"onCanvas:action"?: ((detail: unknown) => any) | undefined;
|
|
91
|
+
"onCanvas:actionstart"?: ((detail: unknown) => any) | undefined;
|
|
92
|
+
"onCanvas:actionmove"?: ((detail: unknown) => any) | undefined;
|
|
93
|
+
"onCanvas:actionend"?: ((detail: unknown) => any) | undefined;
|
|
94
|
+
"onImage:transform"?: ((detail: {
|
|
95
|
+
matrix: number[];
|
|
96
|
+
oldMatrix: number[];
|
|
97
|
+
}) => any) | undefined;
|
|
98
|
+
}>, import("./interface").CropperExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
99
|
+
"selection:change": (detail: import("./interface").CropperSelectionChangeDetail) => any;
|
|
100
|
+
"update:selectionX": (value: number) => any;
|
|
101
|
+
"update:selectionY": (value: number) => any;
|
|
102
|
+
"update:selectionWidth": (value: number) => any;
|
|
103
|
+
"update:selectionHeight": (value: number) => any;
|
|
104
|
+
"canvas:action": (detail: unknown) => any;
|
|
105
|
+
"canvas:actionstart": (detail: unknown) => any;
|
|
106
|
+
"canvas:actionmove": (detail: unknown) => any;
|
|
107
|
+
"canvas:actionend": (detail: unknown) => any;
|
|
108
|
+
"image:transform": (detail: {
|
|
109
|
+
matrix: number[];
|
|
110
|
+
oldMatrix: number[];
|
|
111
|
+
}) => any;
|
|
112
|
+
}, string, {
|
|
113
|
+
template: string;
|
|
114
|
+
width: number | string;
|
|
115
|
+
height: number | string;
|
|
116
|
+
src: string;
|
|
117
|
+
canvasProps: import("./interface").CropperCanvasProps;
|
|
118
|
+
imageProps: import("./interface").CropperImageProps;
|
|
119
|
+
selectionProps: import("./interface").CropperSelectionProps;
|
|
120
|
+
selectionX: number;
|
|
121
|
+
selectionY: number;
|
|
122
|
+
selectionWidth: number;
|
|
123
|
+
selectionHeight: number;
|
|
124
|
+
fitSelectionToImage: boolean;
|
|
125
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
126
|
+
install: (app: App, options?: SDOptions) => void;
|
|
127
|
+
};
|
|
128
|
+
export type CropperInstance = InstanceType<typeof _Cropper>;
|
|
129
|
+
export type { CropperCanvasProps, CropperExpose, CropperImageProps, CropperImageTransformDetail, CropperProps, CropperSelectionChangeDetail, CropperSelectionProps, } from './interface';
|
|
130
|
+
export default Cropper;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getComponentPrefix, setGlobalConfig } from "../_utils/global-config.js";
|
|
2
|
+
import cropper_default from "./cropper.js";
|
|
3
|
+
//#region components/cropper/index.ts
|
|
4
|
+
var Cropper = Object.assign(cropper_default, { install: (app, options) => {
|
|
5
|
+
setGlobalConfig(app, options);
|
|
6
|
+
const componentPrefix = getComponentPrefix(options);
|
|
7
|
+
app.component(componentPrefix + cropper_default.name, cropper_default);
|
|
8
|
+
} });
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Cropper as default };
|