@opentiny/vue-renderless 3.11.8 → 3.12.1
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/anchor/index.js +13 -6
- package/anchor/vue.js +1 -1
- package/breadcrumb/index.js +6 -1
- package/breadcrumb-item/index.js +8 -1
- package/calendar-bar/index.js +295 -68
- package/calendar-bar/vue.js +82 -8
- package/calendar-view/index.js +2 -2
- package/card/index.js +4 -4
- package/card/vue.js +2 -3
- package/card-group/vue.js +3 -7
- package/carousel/index.js +26 -27
- package/carousel/vue.js +41 -46
- package/carousel-item/index.js +9 -6
- package/carousel-item/vue.js +4 -4
- package/cascader-mobile/index.js +5 -1
- package/cascader-mobile/vue.js +2 -1
- package/cascader-panel/index.js +6 -2
- package/cascader-view/index.js +363 -0
- package/cascader-view/vue.js +130 -0
- package/chart-core/deps/constants.js +27 -0
- package/chart-core/deps/numerify.js +27 -28
- package/chart-core/index.js +122 -31
- package/chart-core/vue.js +12 -8
- package/chart-radar/index.js +2 -2
- package/checkbox-button/vue.js +8 -1
- package/checkbox-group/vue.js +4 -5
- package/col/index.js +3 -2
- package/col/vue.js +1 -1
- package/collapse-item/index.js +14 -2
- package/color-picker/index.js +24 -34
- package/color-picker/utils/color.js +7 -1
- package/color-picker/vue.js +39 -26
- package/color-select-panel/alpha-select/vue.js +5 -8
- package/color-select-panel/hue-select/index.js +4 -2
- package/color-select-panel/hue-select/vue.js +11 -10
- package/color-select-panel/index.js +29 -17
- package/color-select-panel/utils/color.js +5 -0
- package/color-select-panel/vue.js +16 -7
- package/column-list-item/index.js +19 -5
- package/column-list-item/vue.js +16 -14
- package/common/bigInt.js +1 -1
- package/common/deps/dom.js +37 -5
- package/common/deps/repeat-click.js +3 -2
- package/common/deps/touch-emulator.js +95 -0
- package/common/deps/touch.js +12 -11
- package/common/deps/useEventListener.js +47 -0
- package/common/deps/useTouch.js +68 -0
- package/common/deps/vue-popper.js +2 -3
- package/common/index.js +1 -1
- package/common/runtime.js +1 -1
- package/common/string.js +20 -9
- package/date-picker/index.js +24 -4
- package/date-picker-mobile/index.js +5 -1
- package/file-upload/index.js +148 -50
- package/file-upload/vue.js +24 -6
- package/filter/index.js +2 -1
- package/filter/vue.js +1 -1
- package/form-item/index.js +24 -21
- package/form-item/vue.js +14 -12
- package/grid/plugins/export.js +0 -8
- package/grid/utils/common.js +13 -16
- package/image-viewer/index.js +1 -1
- package/ip-address/index.js +6 -3
- package/menu/index.js +127 -0
- package/menu/vue.js +90 -0
- package/menu-node/index.js +12 -0
- package/menu-node/vue.js +42 -0
- package/modal/index.js +6 -0
- package/modal/vue.js +3 -1
- package/numeric/index.js +18 -2
- package/numeric/vue.js +11 -7
- package/package.json +1 -1
- package/popconfirm/index.js +15 -6
- package/popconfirm/vue.js +5 -4
- package/pull-refresh-mobile-first/index.js +243 -0
- package/pull-refresh-mobile-first/vue.js +116 -0
- package/qr-code/index.js +54 -0
- package/qr-code/vue.js +31 -0
- package/radio/index.js +9 -7
- package/radio/vue.js +4 -4
- package/radio-button/index.js +2 -2
- package/radio-button/vue.js +2 -2
- package/radio-group/vue.js +1 -0
- package/rich-text-edtior/index.js +18 -38
- package/rich-text-edtior/vue.js +52 -63
- package/select/index.js +11 -7
- package/slide-bar/index.js +6 -6
- package/slide-bar/vue.js +5 -5
- package/slider/index.js +47 -14
- package/slider/vue.js +25 -6
- package/slider-button/index.js +5 -1
- package/slider-button/vue.js +1 -0
- package/slider-button-group/index.js +15 -0
- package/slider-button-group/vue.js +8 -11
- package/standard-list-item/index.js +9 -3
- package/standard-list-item/vue.js +3 -2
- package/switch/index.js +11 -9
- package/switch/vue.js +1 -1
- package/tab-bar/index.js +1 -1
- package/tab-bar/vue.js +2 -1
- package/tab-nav/index.js +31 -31
- package/tab-nav/vue.js +13 -12
- package/tabs/vue.js +3 -1
- package/tabs-mf/index.js +14 -9
- package/tabs-mf/vue-bar.js +3 -2
- package/tabs-mf/vue-nav-item.js +2 -1
- package/tabs-mf/vue-nav.js +18 -2
- package/tabs-mf/vue.js +3 -1
- package/tag/index.js +1 -1
- package/toast/index.js +7 -0
- package/toast/vue.js +19 -0
- package/transfer/index.js +2 -2
- package/transfer/vue.js +1 -1
- package/tree-node/index.js +1 -1
- package/types/{action-menu.type.d.mts → action-menu.type.d.ts} +3 -3
- package/types/{alert.type.d.mts → alert.type.d.ts} +2 -1
- package/types/{anchor.type.d.mts → anchor.type.d.ts} +3 -3
- package/types/{badge.type.d.mts → badge.type.d.ts} +1 -1
- package/types/{breadcrumb-item.type.d.mts → breadcrumb-item.type.d.ts} +1 -1
- package/types/{breadcrumb.type.d.mts → breadcrumb.type.d.ts} +1 -1
- package/types/{button-group.type.d.mts → button-group.type.d.ts} +1 -1
- package/types/{button.type.d.mts → button.type.d.ts} +1 -1
- package/types/{cascader-menu.type.d.mts → cascader-menu.type.d.ts} +4 -4
- package/types/{cascader-node.type.d.mts → cascader-node.type.d.ts} +4 -4
- package/types/{cascader-panel.type.d.mts → cascader-panel.type.d.ts} +6 -6
- package/types/{checkbox.type.d.mts → checkbox.type.d.ts} +2 -1
- package/types/{collapse-item.type.d.mts → collapse-item.type.d.ts} +1 -1
- package/types/{collapse.type.d.mts → collapse.type.d.ts} +1 -1
- package/types/{color-picker.type.d.mts → color-picker.type.d.ts} +2 -2
- package/types/{color-select-panel.type.d.mts → color-select-panel.type.d.ts} +2 -2
- package/types/{date-picker.type.d.mts → date-picker.type.d.ts} +6 -2
- package/types/{dialog-box.type.d.mts → dialog-box.type.d.ts} +9 -9
- package/types/{dropdown-item.type-77f0c8c5.d.ts → dropdown-item.type-bf83e929.d.ts} +4 -4
- package/types/{dropdown-item.type.d.mts → dropdown-item.type.d.ts} +3 -3
- package/types/{dropdown-menu.type.d.mts → dropdown-menu.type.d.ts} +3 -3
- package/types/{dropdown.type.d.mts → dropdown.type.d.ts} +1 -1
- package/types/{file-upload.type.d.mts → file-upload.type.d.ts} +2 -2
- package/types/{floatbar.type.d.mts → floatbar.type.d.ts} +7 -7
- package/types/{form-item.type.d.mts → form-item.type.d.ts} +2 -2
- package/types/{form.type-1e2e9272.d.ts → form.type-d0fd42f3.d.ts} +20 -7
- package/types/{form.type.d.mts → form.type.d.ts} +2 -2
- package/types/{image.type.d.mts → image.type.d.ts} +1 -1
- package/types/{input.type.d.mts → input.type.d.ts} +10 -2
- package/types/{link.type.d.mts → link.type.d.ts} +1 -1
- package/types/{loading.type.d.mts → loading.type.d.ts} +1 -1
- package/types/{milestone.type.d.mts → milestone.type.d.ts} +1 -1
- package/types/{modal.type.d.mts → modal.type.d.ts} +18 -19
- package/types/{nav-menu.type.d.mts → nav-menu.type.d.ts} +1 -1
- package/types/{numeric.type.d.mts → numeric.type.d.ts} +9 -3
- package/types/{picker.type.d.mts → picker.type.d.ts} +5 -1
- package/types/{popeditor.type.d.mts → popeditor.type.d.ts} +1 -1
- package/types/{popover.type.d.mts → popover.type.d.ts} +1 -1
- package/types/{progress.type.d.mts → progress.type.d.ts} +1 -1
- package/types/{radio-button.type.d.mts → radio-button.type.d.ts} +3 -3
- package/types/{radio-group.type.d.mts → radio-group.type.d.ts} +5 -1
- package/types/{radio.type.d.mts → radio.type.d.ts} +2 -2
- package/types/{search.type.d.mts → search.type.d.ts} +1 -1
- package/types/{shared.type.d.mts → shared.type.d.ts} +7 -7
- package/types/{slider.type.d.mts → slider.type.d.ts} +1 -1
- package/types/{steps.type.d.mts → steps.type.d.ts} +6 -1
- package/types/{switch.type.d.mts → switch.type.d.ts} +5 -1
- package/types/{tab-bar.type.d.mts → tab-bar.type.d.ts} +3 -2
- package/types/{tab-item.type.d.mts → tab-item.type.d.ts} +2 -2
- package/types/{tab-nav.type.d.mts → tab-nav.type.d.ts} +13 -12
- package/types/{tabs.type.d.mts → tabs.type.d.ts} +6 -4
- package/types/{tag.type.d.mts → tag.type.d.ts} +1 -1
- package/types/{time-line.type-5f76ecc2.d.ts → time-line.type-d7daa669.d.ts} +1 -1
- package/types/{time-line.type.d.mts → time-line.type.d.ts} +2 -2
- package/types/{timeline-item.type.d.mts → timeline-item.type.d.ts} +2 -2
- package/types/toast.type.d.ts +63 -0
- package/types/{tooltip.type.d.mts → tooltip.type.d.ts} +2 -9
- package/types/{upload-dragger.type.d.mts → upload-dragger.type.d.ts} +2 -2
- package/types/{upload-list.type-b934f279.d.ts → upload-list.type-343e8c11.d.ts} +45 -7
- package/types/{upload-list.type.d.mts → upload-list.type.d.ts} +2 -2
- package/types/{upload.type.d.mts → upload.type.d.ts} +2 -2
- package/types/watermark.type.d.ts +33 -0
- package/types/{wizard.type.d.mts → wizard.type.d.ts} +1 -1
- package/upload/index.js +1 -1
- package/upload-list/index.js +3 -2
- package/upload-list/vue.js +12 -2
- package/watermark/index.js +202 -0
- package/watermark/vue.js +27 -0
- package/wizard/index.js +5 -5
- package/card-group/index.js +0 -16
- package/color-picker/alpha-select/index.js +0 -20
- package/color-picker/alpha-select/vue.js +0 -60
- package/color-picker/color-select/index.js +0 -69
- package/color-picker/color-select/vue.js +0 -57
- package/color-picker/utils/use-drag.js +0 -38
- /package/types/{action-sheet.type.d.mts → action-sheet.type.d.ts} +0 -0
- /package/types/{amount.type.d.mts → amount.type.d.ts} +0 -0
- /package/types/{area.type.d.mts → area.type.d.ts} +0 -0
- /package/types/{autocomplete.type.d.mts → autocomplete.type.d.ts} +0 -0
- /package/types/{autonavi-map.type.d.mts → autonavi-map.type.d.ts} +0 -0
- /package/types/{avatar.type.d.mts → avatar.type.d.ts} +0 -0
- /package/types/{baidu-map.type.d.mts → baidu-map.type.d.ts} +0 -0
- /package/types/{bulletin-board.type.d.mts → bulletin-board.type.d.ts} +0 -0
- /package/types/{calendar-bar.type.d.mts → calendar-bar.type.d.ts} +0 -0
- /package/types/{calendar.type.d.mts → calendar.type.d.ts} +0 -0
- /package/types/{card-group.type.d.mts → card-group.type.d.ts} +0 -0
- /package/types/{card-template.type.d.mts → card-template.type.d.ts} +0 -0
- /package/types/{card.type.d.mts → card.type.d.ts} +0 -0
- /package/types/{carousel-item.type.d.mts → carousel-item.type.d.ts} +0 -0
- /package/types/{carousel.type.d.mts → carousel.type.d.ts} +0 -0
- /package/types/{cascader-mobile.type.d.mts → cascader-mobile.type.d.ts} +0 -0
- /package/types/{cascader-select.type.d.mts → cascader-select.type.d.ts} +0 -0
- /package/types/{cascader.type.d.mts → cascader.type.d.ts} +0 -0
- /package/types/{cell.type.d.mts → cell.type.d.ts} +0 -0
- /package/types/{chart-bar.type.d.mts → chart-bar.type.d.ts} +0 -0
- /package/types/{chart-boxplot.type.d.mts → chart-boxplot.type.d.ts} +0 -0
- /package/types/{chart-candle.type.d.mts → chart-candle.type.d.ts} +0 -0
- /package/types/{chart-core.type.d.mts → chart-core.type.d.ts} +0 -0
- /package/types/{chart-funnel.type.d.mts → chart-funnel.type.d.ts} +0 -0
- /package/types/{chart-gauge.type.d.mts → chart-gauge.type.d.ts} +0 -0
- /package/types/{chart-graph.type.d.mts → chart-graph.type.d.ts} +0 -0
- /package/types/{chart-heatmap.type.d.mts → chart-heatmap.type.d.ts} +0 -0
- /package/types/{chart-line.type.d.mts → chart-line.type.d.ts} +0 -0
- /package/types/{chart-liquidfill.type.d.mts → chart-liquidfill.type.d.ts} +0 -0
- /package/types/{chart-map.type.d.mts → chart-map.type.d.ts} +0 -0
- /package/types/{chart-pie.type.d.mts → chart-pie.type.d.ts} +0 -0
- /package/types/{chart-radar.type.d.mts → chart-radar.type.d.ts} +0 -0
- /package/types/{chart-sankey.type.d.mts → chart-sankey.type.d.ts} +0 -0
- /package/types/{chart-scatter.type.d.mts → chart-scatter.type.d.ts} +0 -0
- /package/types/{chart-sunburst.type.d.mts → chart-sunburst.type.d.ts} +0 -0
- /package/types/{chart-tree.type.d.mts → chart-tree.type.d.ts} +0 -0
- /package/types/{chart-waterfall.type.d.mts → chart-waterfall.type.d.ts} +0 -0
- /package/types/{chart-wordcloud.type.d.mts → chart-wordcloud.type.d.ts} +0 -0
- /package/types/{checkbox-button.type.d.mts → checkbox-button.type.d.ts} +0 -0
- /package/types/{checkbox-group.type.d.mts → checkbox-group.type.d.ts} +0 -0
- /package/types/{col.type.d.mts → col.type.d.ts} +0 -0
- /package/types/{column-list-group.type.d.mts → column-list-group.type.d.ts} +0 -0
- /package/types/{column-list-item.type.d.mts → column-list-item.type.d.ts} +0 -0
- /package/types/{common.type.d.mts → common.type.d.ts} +0 -0
- /package/types/{company.type.d.mts → company.type.d.ts} +0 -0
- /package/types/{container.type.d.mts → container.type.d.ts} +0 -0
- /package/types/{country.type.d.mts → country.type.d.ts} +0 -0
- /package/types/{credit-card-form.type.d.mts → credit-card-form.type.d.ts} +0 -0
- /package/types/{credit-card.type.d.mts → credit-card.type.d.ts} +0 -0
- /package/types/{crop.type.d.mts → crop.type.d.ts} +0 -0
- /package/types/{currency.type.d.mts → currency.type.d.ts} +0 -0
- /package/types/{date-panel.type.d.mts → date-panel.type.d.ts} +0 -0
- /package/types/{date-picker-mobile.type.d.mts → date-picker-mobile.type.d.ts} +0 -0
- /package/types/{date-range.type.d.mts → date-range.type.d.ts} +0 -0
- /package/types/{date-table.type.d.mts → date-table.type.d.ts} +0 -0
- /package/types/{dept.type.d.mts → dept.type.d.ts} +0 -0
- /package/types/{detail-page.type.d.mts → detail-page.type.d.ts} +0 -0
- /package/types/{dialog-select.type.d.mts → dialog-select.type.d.ts} +0 -0
- /package/types/{drawer.type.d.mts → drawer.type.d.ts} +0 -0
- /package/types/{drop-roles.type.d.mts → drop-roles.type.d.ts} +0 -0
- /package/types/{drop-times.type.d.mts → drop-times.type.d.ts} +0 -0
- /package/types/{dynamic-scroller-item.type.d.mts → dynamic-scroller-item.type.d.ts} +0 -0
- /package/types/{dynamic-scroller.type.d.mts → dynamic-scroller.type.d.ts} +0 -0
- /package/types/{espace.type.d.mts → espace.type.d.ts} +0 -0
- /package/types/{exception.type.d.mts → exception.type.d.ts} +0 -0
- /package/types/{fall-menu.type.d.mts → fall-menu.type.d.ts} +0 -0
- /package/types/{filter-bar.type.d.mts → filter-bar.type.d.ts} +0 -0
- /package/types/{filter-box.type.d.mts → filter-box.type.d.ts} +0 -0
- /package/types/{filter-panel.type.d.mts → filter-panel.type.d.ts} +0 -0
- /package/types/{filter.type.d.mts → filter.type.d.ts} +0 -0
- /package/types/{floating-button.type.d.mts → floating-button.type.d.ts} +0 -0
- /package/types/{flowchart.type.d.mts → flowchart.type.d.ts} +0 -0
- /package/types/{fullscreen.type.d.mts → fullscreen.type.d.ts} +0 -0
- /package/types/{grid.type.d.mts → grid.type.d.ts} +0 -0
- /package/types/{guide.type.d.mts → guide.type.d.ts} +0 -0
- /package/types/{hrapprover.type.d.mts → hrapprover.type.d.ts} +0 -0
- /package/types/{image-viewer.type.d.mts → image-viewer.type.d.ts} +0 -0
- /package/types/{index-bar-anchor.type.d.mts → index-bar-anchor.type.d.ts} +0 -0
- /package/types/{index-bar.type.d.mts → index-bar.type.d.ts} +0 -0
- /package/types/{ip-address.type.d.mts → ip-address.type.d.ts} +0 -0
- /package/types/{layout.type.d.mts → layout.type.d.ts} +0 -0
- /package/types/{link-menu.type.d.mts → link-menu.type.d.ts} +0 -0
- /package/types/{list.type.d.mts → list.type.d.ts} +0 -0
- /package/types/{locales.type.d.mts → locales.type.d.ts} +0 -0
- /package/types/{logon-user.type.d.mts → logon-user.type.d.ts} +0 -0
- /package/types/{logout.type.d.mts → logout.type.d.ts} +0 -0
- /package/types/{mini-picker.type.d.mts → mini-picker.type.d.ts} +0 -0
- /package/types/{month-range.type.d.mts → month-range.type.d.ts} +0 -0
- /package/types/{month-table.type.d.mts → month-table.type.d.ts} +0 -0
- /package/types/{multi-select.type.d.mts → multi-select.type.d.ts} +0 -0
- /package/types/{notify.type.d.mts → notify.type.d.ts} +0 -0
- /package/types/{option-group.type.d.mts → option-group.type.d.ts} +0 -0
- /package/types/{option.type.d.mts → option.type.d.ts} +0 -0
- /package/types/{pager-item.type.d.mts → pager-item.type.d.ts} +0 -0
- /package/types/{pager.type.d.mts → pager.type.d.ts} +0 -0
- /package/types/{panel.type.d.mts → panel.type.d.ts} +0 -0
- /package/types/{picker-column.type.d.mts → picker-column.type.d.ts} +0 -0
- /package/types/{pop-upload.type.d.mts → pop-upload.type.d.ts} +0 -0
- /package/types/{popconfirm.type.d.mts → popconfirm.type.d.ts} +0 -0
- /package/types/{popup.type.d.mts → popup.type.d.ts} +0 -0
- /package/types/{pull-refresh.type.d.mts → pull-refresh.type.d.ts} +0 -0
- /package/types/{query-builder.type.d.mts → query-builder.type.d.ts} +0 -0
- /package/types/{rate.type.d.mts → rate.type.d.ts} +0 -0
- /package/types/{record.type.d.mts → record.type.d.ts} +0 -0
- /package/types/{recycle-scroller.type.d.mts → recycle-scroller.type.d.ts} +0 -0
- /package/types/{river.type.d.mts → river.type.d.ts} +0 -0
- /package/types/{roles.type.d.mts → roles.type.d.ts} +0 -0
- /package/types/{row.type.d.mts → row.type.d.ts} +0 -0
- /package/types/{scroll-text.type.d.mts → scroll-text.type.d.ts} +0 -0
- /package/types/{scrollbar.type.d.mts → scrollbar.type.d.ts} +0 -0
- /package/types/{select-dropdown.type.d.mts → select-dropdown.type.d.ts} +0 -0
- /package/types/{select-mobile.type.d.mts → select-mobile.type.d.ts} +0 -0
- /package/types/{select-view.type.d.mts → select-view.type.d.ts} +0 -0
- /package/types/{select.type.d.mts → select.type.d.ts} +0 -0
- /package/types/{selected-box.type.d.mts → selected-box.type.d.ts} +0 -0
- /package/types/{slide-bar.type.d.mts → slide-bar.type.d.ts} +0 -0
- /package/types/{slider-button-group.type.d.mts → slider-button-group.type.d.ts} +0 -0
- /package/types/{slider-button.type.d.mts → slider-button.type.d.ts} +0 -0
- /package/types/{split.type.d.mts → split.type.d.ts} +0 -0
- /package/types/{standard-list-item.type.d.mts → standard-list-item.type.d.ts} +0 -0
- /package/types/{tab-dropdown.type.d.mts → tab-dropdown.type.d.ts} +0 -0
- /package/types/{tab-item-mf.type.d.mts → tab-item-mf.type.d.ts} +0 -0
- /package/types/{tabbar-item.type.d.mts → tabbar-item.type.d.ts} +0 -0
- /package/types/{tabbar.type.d.mts → tabbar.type.d.ts} +0 -0
- /package/types/{table.type.d.mts → table.type.d.ts} +0 -0
- /package/types/{tabs-mf.type.d.mts → tabs-mf.type.d.ts} +0 -0
- /package/types/{tag-group.type.d.mts → tag-group.type.d.ts} +0 -0
- /package/types/{tall-storage.type.d.mts → tall-storage.type.d.ts} +0 -0
- /package/types/{text-popup.type.d.mts → text-popup.type.d.ts} +0 -0
- /package/types/{time-panel.type.d.mts → time-panel.type.d.ts} +0 -0
- /package/types/{time-picker-mobile.type.d.mts → time-picker-mobile.type.d.ts} +0 -0
- /package/types/{time-range.type.d.mts → time-range.type.d.ts} +0 -0
- /package/types/{time-spinner.type.d.mts → time-spinner.type.d.ts} +0 -0
- /package/types/{time.type.d.mts → time.type.d.ts} +0 -0
- /package/types/{toggle-menu.type.d.mts → toggle-menu.type.d.ts} +0 -0
- /package/types/{top-box.type.d.mts → top-box.type.d.ts} +0 -0
- /package/types/{transfer-panel.type.d.mts → transfer-panel.type.d.ts} +0 -0
- /package/types/{transfer.type.d.mts → transfer.type.d.ts} +0 -0
- /package/types/{tree-menu.type.d.mts → tree-menu.type.d.ts} +0 -0
- /package/types/{tree-node.type.d.mts → tree-node.type.d.ts} +0 -0
- /package/types/{tree.type.d.mts → tree.type.d.ts} +0 -0
- /package/types/{user-account.type.d.mts → user-account.type.d.ts} +0 -0
- /package/types/{user-contact.type.d.mts → user-contact.type.d.ts} +0 -0
- /package/types/{user-head-group.type.d.mts → user-head-group.type.d.ts} +0 -0
- /package/types/{user-head.type.d.mts → user-head.type.d.ts} +0 -0
- /package/types/{user-link.type.d.mts → user-link.type.d.ts} +0 -0
- /package/types/{user.type.d.mts → user.type.d.ts} +0 -0
- /package/types/{wheel.type.d.mts → wheel.type.d.ts} +0 -0
- /package/types/{year-range.type.d.mts → year-range.type.d.ts} +0 -0
- /package/types/{year-table.type.d.mts → year-table.type.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
|
-
import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.
|
|
3
|
-
import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-
|
|
2
|
+
import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.js';
|
|
3
|
+
import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-343e8c11.js';
|
|
4
4
|
|
|
5
5
|
declare const UploadDraggerProps: {
|
|
6
6
|
disabled: BooleanConstructor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
|
-
import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams, ITinyVm } from './shared.type.
|
|
2
|
+
import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams, ITinyVm } from './shared.type.js';
|
|
3
3
|
|
|
4
4
|
declare const $constants: {
|
|
5
5
|
FILE_UPLOAD_INNER_TEMPLATE: string;
|
|
@@ -65,6 +65,9 @@ declare const $constants: {
|
|
|
65
65
|
KIASTATUS: number;
|
|
66
66
|
NumberExceed: string;
|
|
67
67
|
notSupport: string;
|
|
68
|
+
NOT_SUPPORT_NO_SUFFIX: string;
|
|
69
|
+
STATUS_SPECIAL_CHARACTERS: number;
|
|
70
|
+
NOT_SUPPORT_SPECIAL_CHARACTERS: string;
|
|
68
71
|
};
|
|
69
72
|
IMAGE_TYPE: string;
|
|
70
73
|
FILE_TYPE: {
|
|
@@ -155,6 +158,9 @@ declare const fileUploadProps: {
|
|
|
155
158
|
KIASTATUS: number;
|
|
156
159
|
NumberExceed: string;
|
|
157
160
|
notSupport: string;
|
|
161
|
+
NOT_SUPPORT_NO_SUFFIX: string;
|
|
162
|
+
STATUS_SPECIAL_CHARACTERS: number;
|
|
163
|
+
NOT_SUPPORT_SPECIAL_CHARACTERS: string;
|
|
158
164
|
};
|
|
159
165
|
IMAGE_TYPE: string;
|
|
160
166
|
FILE_TYPE: {
|
|
@@ -331,6 +337,15 @@ declare const fileUploadProps: {
|
|
|
331
337
|
type: BooleanConstructor;
|
|
332
338
|
default: boolean;
|
|
333
339
|
};
|
|
340
|
+
beforeAddFile: FunctionConstructor;
|
|
341
|
+
encryptConfig: {
|
|
342
|
+
type: ObjectConstructor;
|
|
343
|
+
default: () => {
|
|
344
|
+
enabled: boolean;
|
|
345
|
+
encrypt: boolean;
|
|
346
|
+
watermark: string;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
334
349
|
isHidden: {
|
|
335
350
|
type: BooleanConstructor;
|
|
336
351
|
default: boolean;
|
|
@@ -339,6 +354,8 @@ declare const fileUploadProps: {
|
|
|
339
354
|
type: BooleanConstructor;
|
|
340
355
|
default: boolean;
|
|
341
356
|
};
|
|
357
|
+
reUploadable: BooleanConstructor;
|
|
358
|
+
reUploadTip: FunctionConstructor;
|
|
342
359
|
tiny_mode: StringConstructor;
|
|
343
360
|
tiny_mode_root: BooleanConstructor;
|
|
344
361
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -366,7 +383,7 @@ declare const watchListType: ({ constants, state, api }: Pick<IFileUploadRenderl
|
|
|
366
383
|
declare const watchFileList: ({ constants, state, props, api }: Pick<IFileUploadRenderlessParams, 'constants' | 'state' | 'props' | 'api'>) => (fileList: IFileUploadFile[]) => void;
|
|
367
384
|
declare const beforeUpload: ({ props, api, Modal, constants, t, state }: Pick<IFileUploadRenderlessParams, 'props' | 'api' | 'constants' | 't' | 'state'> & IFileUploadModalVm) => (file: IFileUploadFile, autoRemove: boolean, doUpload: Function) => any;
|
|
368
385
|
declare const startUpload: ({ state, constants, vm, Modal, api, t }: Pick<IFileUploadRenderlessParams, 'state' | 'constants' | 'vm' | 'api' | 't'> & IFileUploadModalVm) => (file: IFileUploadFile, isList: boolean) => void;
|
|
369
|
-
declare const properFileSize: ({ props, state, constants, Modal, t }: Pick<IFileUploadRenderlessParams, 'props' | 'state' | 'constants' | 't'> & IFileUploadModalVm) => (file: IFileUploadFile) => boolean;
|
|
386
|
+
declare const properFileSize: ({ props, state, api, constants, Modal, t }: Pick<IFileUploadRenderlessParams, 'props' | 'state' | 'constants' | 'api' | 't'> & IFileUploadModalVm) => (file: IFileUploadFile) => boolean;
|
|
370
387
|
declare const addFileToList: ({ api, constants, emit, props, state, mode }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'emit' | 'props' | 'state' | 'mode'>) => (rawFile: IFileUploadFile, updateId: string, reUpload: boolean) => void;
|
|
371
388
|
declare const getFileHash: ({ emit, Modal, constants, t, CryptoJS, state }: Pick<IFileUploadRenderlessParams, "state" | "t" | "constants" | "emit"> & IFileUploadModalVm & {
|
|
372
389
|
CryptoJS: object;
|
|
@@ -382,9 +399,11 @@ declare const calcUploadingFilesInfo: ({ state, constants }: Pick<IFileUploadRen
|
|
|
382
399
|
uploadedCount: number;
|
|
383
400
|
};
|
|
384
401
|
declare const handleProgress: ({ api, constants, emit, state }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'emit' | 'state'>) => (event: any, rawFile: File) => void;
|
|
385
|
-
declare const handleSuccess: ({ api, constants, emit, state, props }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'emit' | 'state' | 'props'>) => (res: any, rawFile: IFileUploadFile) => void;
|
|
386
|
-
declare const handleError: ({ api, constants, emit, state }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'emit' | 'state'>) => (err: any, rawFile: IFileUploadFile) => void;
|
|
402
|
+
declare const handleSuccess: ({ api, constants, emit, state, props, Modal, t }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'emit' | 'state' | 't' | 'props'>) => (res: any, rawFile: IFileUploadFile) => void;
|
|
403
|
+
declare const handleError: ({ api, constants, emit, state, props }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'emit' | 'state' | 'props'>) => (err: any, rawFile: IFileUploadFile) => void;
|
|
387
404
|
declare const handleRemove: ({ api, emit, props, state, constants }: Pick<IFileUploadRenderlessParams, 'api' | 'emit' | 'props' | 'state' | 'constants'>) => (file: IFileUploadFile, raw: File) => void;
|
|
405
|
+
declare const handleReUpload: ({ vm, constants }: Pick<IFileUploadRenderlessParams, 'vm' | 'constants'>) => (file: IFileUploadFile) => void;
|
|
406
|
+
declare const handleReUploadTotal: (api: IFileUploadRenderlessParams['api']) => (files: IFileUploadFile[]) => void;
|
|
388
407
|
declare const clearUploadingFiles: ({ constants, state }: Pick<IFileUploadRenderlessParams, 'constants' | 'state'>) => () => void;
|
|
389
408
|
declare const getFile: (state: IFileUploadRenderlessParams['state']) => (rawFile: IFileUploadFile) => IFileUploadFile;
|
|
390
409
|
declare const abort$1: ({ constants, vm, state }: Pick<IFileUploadRenderlessParams, 'constants' | 'vm' | 'state'>) => (file: IFileUploadFile) => void;
|
|
@@ -428,7 +447,15 @@ declare const downloadFileSingleHwh5: ({ state, props, emit, constants }: Pick<I
|
|
|
428
447
|
file: IFileUploadFile;
|
|
429
448
|
}) => void;
|
|
430
449
|
declare const downloadFile$1: ({ api, state }: Pick<IFileUploadRenderlessParams, 'api' | 'state'>) => (file: IFileUploadFile) => void;
|
|
431
|
-
declare const downloadFileSingleInner: ({ props, state, api, constants }:
|
|
450
|
+
declare const downloadFileSingleInner: ({ props, state, api, constants }: {
|
|
451
|
+
props: any;
|
|
452
|
+
state: any;
|
|
453
|
+
api: any;
|
|
454
|
+
constants: any;
|
|
455
|
+
}) => ({ file, isBatch }: {
|
|
456
|
+
file: any;
|
|
457
|
+
isBatch: any;
|
|
458
|
+
}) => void;
|
|
432
459
|
declare const getDownloadFileInfo: ({ api, state, props, service }: Pick<IFileUploadRenderlessParams, 'api' | 'state' | 'props' | 'service'>) => ({ docId }: {
|
|
433
460
|
docId: string;
|
|
434
461
|
}) => any;
|
|
@@ -858,6 +885,8 @@ interface IFileUploadApi {
|
|
|
858
885
|
handleChange: ReturnType<typeof handleChange$1>;
|
|
859
886
|
handleClickFileList: ReturnType<typeof handleClickFileList>;
|
|
860
887
|
handleTriggerClick: ReturnType<typeof handleTriggerClick$1>;
|
|
888
|
+
handleReUpload: ReturnType<typeof handleReUpload>;
|
|
889
|
+
handleReUploadTotal: ReturnType<typeof handleReUploadTotal>;
|
|
861
890
|
}
|
|
862
891
|
type IFileUploadNoopFnCreator = ReturnType<typeof noopFnCreator>;
|
|
863
892
|
interface IFileUploadService {
|
|
@@ -888,9 +917,9 @@ type IFileUploadRenderlessParams = ISharedRenderlessFunctionParams<IFileUploadCo
|
|
|
888
917
|
api: IFileUploadApi;
|
|
889
918
|
};
|
|
890
919
|
type IFileUploadVm = ITinyVm<IFileUploadConstants> & IFileUploadProps;
|
|
891
|
-
|
|
920
|
+
interface IFileUploadModalVm {
|
|
892
921
|
Modal: ITinyVm<unknown>;
|
|
893
|
-
}
|
|
922
|
+
}
|
|
894
923
|
type IFileUploadFile = File & {
|
|
895
924
|
[propName: string]: any;
|
|
896
925
|
};
|
|
@@ -1050,6 +1079,8 @@ declare const uploadListProps: {
|
|
|
1050
1079
|
type: BooleanConstructor;
|
|
1051
1080
|
default: boolean;
|
|
1052
1081
|
};
|
|
1082
|
+
reUploadable: BooleanConstructor;
|
|
1083
|
+
reUploadTip: FunctionConstructor;
|
|
1053
1084
|
tiny_mode: StringConstructor;
|
|
1054
1085
|
tiny_mode_root: BooleanConstructor;
|
|
1055
1086
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -1077,6 +1108,13 @@ declare let getApi: () => {
|
|
|
1077
1108
|
interface IUploadListState {
|
|
1078
1109
|
focusing: boolean;
|
|
1079
1110
|
shows: boolean;
|
|
1111
|
+
progressType: string;
|
|
1112
|
+
progressWidth: number;
|
|
1113
|
+
progressStrokeWidth: number;
|
|
1114
|
+
tooltipDisabled: boolean;
|
|
1115
|
+
closeComponent: string;
|
|
1116
|
+
preViewComponent: string;
|
|
1117
|
+
failUploadFileCount: number;
|
|
1080
1118
|
startPostion: number;
|
|
1081
1119
|
screenType: boolean;
|
|
1082
1120
|
showPanel: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-
|
|
3
|
-
import './shared.type.
|
|
2
|
+
export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-343e8c11.js';
|
|
3
|
+
import './shared.type.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-
|
|
3
|
-
import './shared.type.
|
|
2
|
+
export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-343e8c11.js';
|
|
3
|
+
import './shared.type.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const useWatermarkBg: (props: any, state: any) => Promise<any>;
|
|
2
|
+
declare const reRenderWatermark: ({ state }: {
|
|
3
|
+
state: any;
|
|
4
|
+
}) => () => void;
|
|
5
|
+
declare const mounted: ({ vm, state, props }: {
|
|
6
|
+
vm: any;
|
|
7
|
+
state: any;
|
|
8
|
+
props: any;
|
|
9
|
+
}) => () => void;
|
|
10
|
+
declare const unmounted: ({ state }: {
|
|
11
|
+
state: any;
|
|
12
|
+
}) => () => void;
|
|
13
|
+
declare const watchProps: ({ state, vm, props }: {
|
|
14
|
+
state: any;
|
|
15
|
+
vm: any;
|
|
16
|
+
props: any;
|
|
17
|
+
}) => () => Promise<void>;
|
|
18
|
+
|
|
19
|
+
interface IWatermarkState {
|
|
20
|
+
div: HTMLDivElement;
|
|
21
|
+
ob: MutationObserver;
|
|
22
|
+
bg: ReturnType<typeof useWatermarkBg>;
|
|
23
|
+
flag: number;
|
|
24
|
+
}
|
|
25
|
+
interface IWatermarkApi {
|
|
26
|
+
state: IWatermarkState;
|
|
27
|
+
mounted: ReturnType<typeof mounted>;
|
|
28
|
+
reRenderWatermark: ReturnType<typeof reRenderWatermark>;
|
|
29
|
+
unmounted: ReturnType<typeof unmounted>;
|
|
30
|
+
watchProps: ReturnType<typeof watchProps>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { IWatermarkApi };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
|
-
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.
|
|
2
|
+
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
3
3
|
|
|
4
4
|
declare const $constants: {
|
|
5
5
|
DOING_STATUS: string;
|
package/upload/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { KEY_CODE } from "../common";
|
|
3
|
-
const isImage = (str) => str.
|
|
3
|
+
const isImage = (str) => str.includes("image");
|
|
4
4
|
const handleChange = (api) => (event) => {
|
|
5
5
|
const files = event.target.files;
|
|
6
6
|
if (!files) {
|
package/upload-list/index.js
CHANGED
|
@@ -146,11 +146,12 @@ const getFileIcon = ({ constants }) => ({ type }) => {
|
|
|
146
146
|
typeName.split("/").forEach((type2) => iconTypes[type2] = typeValue);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
return iconTypes[type] || iconTypes
|
|
149
|
+
return iconTypes[type] || iconTypes.default;
|
|
150
150
|
};
|
|
151
151
|
const remove = ({ emit }) => ({ file }) => emit("remove", file);
|
|
152
152
|
const calcUploadListLiWidth = ({ vm, nextTick, props, constants }) => () => {
|
|
153
|
-
const { listType } = props
|
|
153
|
+
const { listType } = props;
|
|
154
|
+
const { LIST_TYPE } = constants;
|
|
154
155
|
nextTick(() => {
|
|
155
156
|
const uploadListEle = vm.$refs["upload-list"];
|
|
156
157
|
const uploadListLiEle = vm.$refs["upload-list-li"];
|
package/upload-list/vue.js
CHANGED
|
@@ -45,7 +45,8 @@ const api = [
|
|
|
45
45
|
"handleTriggerClick",
|
|
46
46
|
"chooseFile"
|
|
47
47
|
];
|
|
48
|
-
const renderless = (props, { reactive, onMounted, onUnmounted, watch, inject, computed }, { t, parent, mode, emit, service, vm, nextTick }, { Modal }) => {
|
|
48
|
+
const renderless = (props, { reactive, onMounted, onUnmounted, watch, inject, computed }, { t, parent, mode, emit, service, vm, nextTick, designConfig }, { Modal }) => {
|
|
49
|
+
var _a, _b, _c, _d, _e, _f;
|
|
49
50
|
const api2 = { getApi };
|
|
50
51
|
parent = inject("uploader").$children[0];
|
|
51
52
|
const constants = parent.$constants;
|
|
@@ -53,8 +54,17 @@ const renderless = (props, { reactive, onMounted, onUnmounted, watch, inject, co
|
|
|
53
54
|
const state = reactive({
|
|
54
55
|
focusing: false,
|
|
55
56
|
shows: false,
|
|
57
|
+
progressType: ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.progressType) || "circle",
|
|
58
|
+
progressWidth: (_b = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _b.progressWidth,
|
|
59
|
+
progressStrokeWidth: ((_c = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _c.progressStrokeWidth) || 6,
|
|
60
|
+
tooltipDisabled: ((_d = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _d.tooltipDisabled) !== false,
|
|
61
|
+
closeComponent: ((_e = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _e.closeComponent) || "icon-close",
|
|
62
|
+
preViewComponent: (_f = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _f.preViewComponent,
|
|
63
|
+
failUploadFileCount: computed(
|
|
64
|
+
() => props.files.reduce((total, item) => total += item.status === "fail" ? 1 : 0, 0)
|
|
65
|
+
),
|
|
56
66
|
startPostion: 0,
|
|
57
|
-
screenType: mode === "mobile"
|
|
67
|
+
screenType: mode === "mobile",
|
|
58
68
|
showPanel: false,
|
|
59
69
|
showTriggerPanel: false,
|
|
60
70
|
triggerClickType: "",
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-G2ADBYYC.js";
|
|
5
|
+
const SelfFontGap = 3;
|
|
6
|
+
const getMarkSize = ({ props, ctx, state }) => {
|
|
7
|
+
const { content } = props;
|
|
8
|
+
const { fontSize, fontFamily } = state.font;
|
|
9
|
+
let defaultWidth = 120;
|
|
10
|
+
let defaultHeight = 64;
|
|
11
|
+
if (!props.image && ctx.measureText) {
|
|
12
|
+
ctx.font = `${Number(fontSize)}px ${fontFamily}`;
|
|
13
|
+
const contents = Array.isArray(content) ? content : [content];
|
|
14
|
+
const widths = contents.map((item) => ctx.measureText(item).width);
|
|
15
|
+
defaultWidth = Math.ceil(Math.max(...widths));
|
|
16
|
+
defaultHeight = Number(fontSize) * contents.length + (contents.length - 1) * SelfFontGap;
|
|
17
|
+
}
|
|
18
|
+
return [Math.max(props.width, defaultWidth), Math.max(props.height, defaultHeight)];
|
|
19
|
+
};
|
|
20
|
+
const selfDrawText = ({ props, state, ctx, canvasWidth, canvasHeight, ratios }) => {
|
|
21
|
+
const { rotate, content } = props;
|
|
22
|
+
const { fontSize, color, fontStyle, fontWeight, fontFamily } = state.font;
|
|
23
|
+
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
24
|
+
const mergedFontSize = Number(fontSize) * devicePixelRatio;
|
|
25
|
+
const drawHeight = canvasHeight / devicePixelRatio;
|
|
26
|
+
ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${drawHeight}px ${fontFamily}`;
|
|
27
|
+
ctx.fillStyle = color;
|
|
28
|
+
ctx.textAlign = "center";
|
|
29
|
+
ctx.textBaseline = "bottom";
|
|
30
|
+
ratios.forEach((ratio) => {
|
|
31
|
+
ctx.save();
|
|
32
|
+
ctx.translate(canvasWidth / ratio, canvasHeight / ratio);
|
|
33
|
+
ctx.rotate(Math.PI / 180 * rotate);
|
|
34
|
+
const contents = Array.isArray(content) ? content : [content];
|
|
35
|
+
const fontHeight = mergedFontSize + SelfFontGap * devicePixelRatio;
|
|
36
|
+
const startHeight = (canvasHeight - contents.length * fontHeight) / 2 - canvasHeight / 2;
|
|
37
|
+
contents == null ? void 0 : contents.forEach((item, index) => {
|
|
38
|
+
ctx.fillText(item || "", 0, startHeight + (index + 1) * fontHeight);
|
|
39
|
+
});
|
|
40
|
+
ctx.restore();
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const imageLoad = (props, state, ctx, result, canvas) => {
|
|
44
|
+
const { image, width, height, rotate, interlaced } = props;
|
|
45
|
+
const img = new Image();
|
|
46
|
+
return new Promise((resolve) => {
|
|
47
|
+
img.onload = () => {
|
|
48
|
+
const ratios = interlaced ? [4, 4 / 3] : [2];
|
|
49
|
+
ratios.forEach((ratio) => {
|
|
50
|
+
ctx.save();
|
|
51
|
+
ctx.translate(result.size.width / ratio, result.size.height / ratio);
|
|
52
|
+
ctx.rotate(Math.PI / 180 * rotate);
|
|
53
|
+
ctx.drawImage(img, -width / 2, -height / 2, width, height);
|
|
54
|
+
ctx.restore();
|
|
55
|
+
});
|
|
56
|
+
resolve(__spreadValues({
|
|
57
|
+
base64: canvas.toDataURL()
|
|
58
|
+
}, result));
|
|
59
|
+
};
|
|
60
|
+
img.onerror = () => {
|
|
61
|
+
const propsTmp = props.content ? props : __spreadProps(__spreadValues({}, props), {
|
|
62
|
+
content: "Invalid data"
|
|
63
|
+
});
|
|
64
|
+
if (interlaced) {
|
|
65
|
+
selfDrawText({
|
|
66
|
+
props,
|
|
67
|
+
ctx,
|
|
68
|
+
state,
|
|
69
|
+
canvasWidth: result.size.width,
|
|
70
|
+
canvasHeight: result.size.height,
|
|
71
|
+
ratios: [4, 4 / 3]
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
selfDrawText({
|
|
75
|
+
props: propsTmp,
|
|
76
|
+
ctx,
|
|
77
|
+
state,
|
|
78
|
+
canvasWidth: result.size.width,
|
|
79
|
+
canvasHeight: result.size.height,
|
|
80
|
+
ratios: [2]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
resolve(__spreadValues({
|
|
84
|
+
base64: canvas.toDataURL()
|
|
85
|
+
}, result));
|
|
86
|
+
};
|
|
87
|
+
img.crossOrigin = "anonymous";
|
|
88
|
+
img.referrerPolicy = "no-referrer";
|
|
89
|
+
img.src = image;
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
const useWatermarkBg = function(props, state) {
|
|
93
|
+
const { gap, image, interlaced } = props;
|
|
94
|
+
const [gapX, gapY] = gap;
|
|
95
|
+
const canvas = document.createElement("canvas");
|
|
96
|
+
const ctx = canvas.getContext("2d");
|
|
97
|
+
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
98
|
+
const [markWidth, markHeight] = getMarkSize({ props, state, ctx });
|
|
99
|
+
const singleWidth = (gapX + markWidth) * devicePixelRatio;
|
|
100
|
+
const singleHeight = (gapY + markHeight) * devicePixelRatio;
|
|
101
|
+
const canvasWidth = interlaced ? singleWidth * 2 : singleWidth;
|
|
102
|
+
const canvasHeight = interlaced ? singleHeight * 2 : singleHeight;
|
|
103
|
+
canvas.width = canvasWidth;
|
|
104
|
+
canvas.height = canvasHeight;
|
|
105
|
+
const result = {
|
|
106
|
+
size: {
|
|
107
|
+
width: canvasWidth,
|
|
108
|
+
height: canvasHeight
|
|
109
|
+
},
|
|
110
|
+
styleSize: {
|
|
111
|
+
width: canvasWidth / devicePixelRatio,
|
|
112
|
+
height: canvasHeight / devicePixelRatio
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
if (image) {
|
|
116
|
+
return imageLoad(props, state, ctx, result, canvas);
|
|
117
|
+
} else {
|
|
118
|
+
if (interlaced) {
|
|
119
|
+
selfDrawText({ props, state, ctx, canvasWidth, canvasHeight, ratios: [4, 4 / 3] });
|
|
120
|
+
} else {
|
|
121
|
+
selfDrawText({ props, state, ctx, canvasWidth, canvasHeight, ratios: [2] });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return new Promise(
|
|
125
|
+
(resolve) => resolve(__spreadValues({
|
|
126
|
+
base64: canvas.toDataURL()
|
|
127
|
+
}, result))
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
const updateWatermark = (watermarkBg, props) => {
|
|
131
|
+
const { base64, styleSize } = watermarkBg;
|
|
132
|
+
const watermarkDiv = document.createElement("div");
|
|
133
|
+
watermarkDiv.style.position = "absolute";
|
|
134
|
+
watermarkDiv.style.inset = "0";
|
|
135
|
+
watermarkDiv.style.backgroundImage = `url(${base64})`;
|
|
136
|
+
watermarkDiv.style.backgroundSize = `${styleSize.width}px ${styleSize.height}px`;
|
|
137
|
+
watermarkDiv.style.backgroundRepeat = "repeat";
|
|
138
|
+
watermarkDiv.style.backgroundPosition = `${props.offset[0] || 20}px ${(props == null ? void 0 : props.offset[1]) || 20}px`;
|
|
139
|
+
watermarkDiv.style.width = "100%";
|
|
140
|
+
watermarkDiv.style.height = "100%";
|
|
141
|
+
watermarkDiv.style.pointerEvents = "none";
|
|
142
|
+
watermarkDiv.style.zIndex = `${props.zIndex}`;
|
|
143
|
+
return watermarkDiv;
|
|
144
|
+
};
|
|
145
|
+
async function createWatermark({ vm, state, props }) {
|
|
146
|
+
const parentRef = vm.$refs.parentRef;
|
|
147
|
+
if (!parentRef) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const bgValue = await useWatermarkBg(props, state);
|
|
151
|
+
if (state.watermarkDiv) {
|
|
152
|
+
state.watermarkDiv.remove();
|
|
153
|
+
}
|
|
154
|
+
state.watermarkDiv = updateWatermark(bgValue, props);
|
|
155
|
+
parentRef.appendChild(state.watermarkDiv);
|
|
156
|
+
}
|
|
157
|
+
const reRenderWatermark = ({ state }) => () => {
|
|
158
|
+
state.flag++;
|
|
159
|
+
};
|
|
160
|
+
const mounted = ({ vm, state, props }) => () => {
|
|
161
|
+
createWatermark({ vm, state, props });
|
|
162
|
+
state.observerInstance = new MutationObserver((records) => {
|
|
163
|
+
for (const record of records) {
|
|
164
|
+
for (const dom of Array.from(record.removedNodes)) {
|
|
165
|
+
if (dom === state.watermarkDiv) {
|
|
166
|
+
state.flag++;
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (record.type === "attributes" && record.target === state.watermarkDiv) {
|
|
171
|
+
state.flag++;
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
const parentRef = vm.$refs.parentRef;
|
|
177
|
+
if (parentRef) {
|
|
178
|
+
state.observerInstance.observe(parentRef, {
|
|
179
|
+
childList: true,
|
|
180
|
+
attributes: true,
|
|
181
|
+
subtree: true
|
|
182
|
+
});
|
|
183
|
+
if (props.customClass) {
|
|
184
|
+
parentRef.classList.add(props.customClass);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
const unmounted = ({ state }) => () => {
|
|
189
|
+
if (state.observerInstance) {
|
|
190
|
+
state.observerInstance.disconnect();
|
|
191
|
+
}
|
|
192
|
+
state.watermarkDiv = null;
|
|
193
|
+
};
|
|
194
|
+
const watchProps = ({ state, vm, props }) => () => createWatermark({ state, vm, props });
|
|
195
|
+
export {
|
|
196
|
+
mounted,
|
|
197
|
+
reRenderWatermark,
|
|
198
|
+
unmounted,
|
|
199
|
+
updateWatermark,
|
|
200
|
+
useWatermarkBg,
|
|
201
|
+
watchProps
|
|
202
|
+
};
|
package/watermark/vue.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { mounted, reRenderWatermark, unmounted, watchProps } from "./index";
|
|
3
|
+
const api = ["reRenderWatermark"];
|
|
4
|
+
const renderless = (props, { onMounted, reactive, watch, computed, onUnmounted }, { constants, vm }) => {
|
|
5
|
+
const api2 = {};
|
|
6
|
+
const state = reactive({
|
|
7
|
+
watermarkDiv: null,
|
|
8
|
+
observerInstance: null,
|
|
9
|
+
flag: 0,
|
|
10
|
+
font: computed(() => Object.assign(constants.font, props.font))
|
|
11
|
+
});
|
|
12
|
+
Object.assign(api2, {
|
|
13
|
+
state,
|
|
14
|
+
reRenderWatermark: reRenderWatermark({ state }),
|
|
15
|
+
mounted: mounted({ vm, state, props }),
|
|
16
|
+
unmounted: unmounted({ state }),
|
|
17
|
+
watchProps: watchProps({ state, vm, props })
|
|
18
|
+
});
|
|
19
|
+
onMounted(api2.mounted);
|
|
20
|
+
onUnmounted(api2.unmounted);
|
|
21
|
+
watch([props, () => state.flag], api2.watchProps);
|
|
22
|
+
return api2;
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
api,
|
|
26
|
+
renderless
|
|
27
|
+
};
|
package/wizard/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import { format } from "../common/date";
|
|
|
3
3
|
import { copyArray, extend } from "../common/object";
|
|
4
4
|
import { isObject } from "../common/type";
|
|
5
5
|
const lastStepHandle = ({ state, emit }) => () => {
|
|
6
|
+
if (state.datas[0].status === state.doing) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
6
9
|
for (let i = 0; i < state.datas.length; i++) {
|
|
7
|
-
if (state.datas[0].status === state.doing) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
10
|
if (state.datas[i].status === state.doing) {
|
|
11
11
|
state.datas[i].status = state.wait;
|
|
12
12
|
state.datas[i - 1].status = state.doing;
|
|
@@ -24,10 +24,10 @@ const nextStepHandle = ({ state, emit }) => () => {
|
|
|
24
24
|
state.datas[i].status = state.ready;
|
|
25
25
|
state.datas[i + 1].status = state.doing;
|
|
26
26
|
state.submitShow = i + 2 === state.datas.length;
|
|
27
|
-
|
|
27
|
+
break;
|
|
28
28
|
}
|
|
29
|
-
emit("btnNext", state.datas);
|
|
30
29
|
}
|
|
30
|
+
emit("btnNext", state.datas);
|
|
31
31
|
};
|
|
32
32
|
const btnSaveHandle = ({ state, emit }) => () => {
|
|
33
33
|
emit("btnSave", state.datas);
|
package/card-group/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const getStyle = ({ props }) => () => {
|
|
3
|
-
const size = props.size || "medium";
|
|
4
|
-
const sizeMap = {
|
|
5
|
-
large: "31.25rem",
|
|
6
|
-
medium: "18.75rem",
|
|
7
|
-
small: "12.5rem",
|
|
8
|
-
mini: "6.25rem"
|
|
9
|
-
};
|
|
10
|
-
return {
|
|
11
|
-
"grid-template-columns": `repeat(auto-fit, minmax(${sizeMap[size]}, 1fr))`
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
getStyle
|
|
16
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import "../../chunk-G2ADBYYC.js";
|
|
2
|
-
const calcLeftByAlpha = (wrapper, thumb, alpha) => {
|
|
3
|
-
return Math.round(alpha * (wrapper.offsetWidth - thumb.offsetWidth / 2) / 100);
|
|
4
|
-
};
|
|
5
|
-
const updateThumb = (alpha, thumb, wrapper) => {
|
|
6
|
-
thumb.style.left = `${calcLeftByAlpha(wrapper, thumb, alpha)}px`;
|
|
7
|
-
};
|
|
8
|
-
const onDrag = (event, bar, thumb, alpha) => {
|
|
9
|
-
const rect = bar.value.getBoundingClientRect();
|
|
10
|
-
const { clientX } = event;
|
|
11
|
-
let left = clientX - rect.left;
|
|
12
|
-
left = Math.max(thumb.value.offsetWidth / 2, left);
|
|
13
|
-
left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
|
|
14
|
-
alpha.value = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 100);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
calcLeftByAlpha,
|
|
18
|
-
onDrag,
|
|
19
|
-
updateThumb
|
|
20
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import "../../chunk-G2ADBYYC.js";
|
|
2
|
-
import Color from "../utils/color";
|
|
3
|
-
import { draggable } from "../utils/use-drag";
|
|
4
|
-
import { onDrag, updateThumb } from ".";
|
|
5
|
-
const api = ["state", "color", "slider", "alphaWrapper", "alphaThumb"];
|
|
6
|
-
const renderless = (props, context, { emit }) => {
|
|
7
|
-
const hex = props.color;
|
|
8
|
-
const color = new Color(hex, props.alpha);
|
|
9
|
-
const [rr, gg, bb] = color.getRGB();
|
|
10
|
-
const r = context.ref(rr);
|
|
11
|
-
const g = context.ref(gg);
|
|
12
|
-
const b = context.ref(bb);
|
|
13
|
-
const slider = context.ref();
|
|
14
|
-
const alphaWrapper = context.ref();
|
|
15
|
-
const alphaThumb = context.ref();
|
|
16
|
-
const alpha = context.ref(color.get("a"));
|
|
17
|
-
context.watch(
|
|
18
|
-
() => props.color,
|
|
19
|
-
(hex2) => {
|
|
20
|
-
color.reset(hex2);
|
|
21
|
-
const [rr2, gg2, bb2] = color.getRGB();
|
|
22
|
-
r.value = rr2;
|
|
23
|
-
g.value = gg2;
|
|
24
|
-
b.value = bb2;
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
context.watch(alpha, (newAlpha) => {
|
|
28
|
-
updateThumb(newAlpha, alphaThumb.value, alphaWrapper.value);
|
|
29
|
-
emit("alpha-update", alpha.value);
|
|
30
|
-
});
|
|
31
|
-
const background = context.computed(() => {
|
|
32
|
-
return `linear-gradient(to right, rgba(${r.value}, ${g.value}, ${b.value}, 0) 0%, rgba(${r.value}, ${g.value}, ${b.value}, 1) 100%)`;
|
|
33
|
-
});
|
|
34
|
-
const state = context.reactive({
|
|
35
|
-
background,
|
|
36
|
-
hex
|
|
37
|
-
});
|
|
38
|
-
const api2 = {
|
|
39
|
-
state,
|
|
40
|
-
slider,
|
|
41
|
-
alphaWrapper,
|
|
42
|
-
alphaThumb
|
|
43
|
-
};
|
|
44
|
-
context.onMounted(() => {
|
|
45
|
-
updateThumb(alpha.value, alphaThumb.value, slider.value);
|
|
46
|
-
draggable(slider.value, {
|
|
47
|
-
drag(event) {
|
|
48
|
-
onDrag(event, slider, alphaThumb, alpha);
|
|
49
|
-
},
|
|
50
|
-
start(event) {
|
|
51
|
-
onDrag(event, slider, alphaThumb, alpha);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
return api2;
|
|
56
|
-
};
|
|
57
|
-
export {
|
|
58
|
-
api,
|
|
59
|
-
renderless
|
|
60
|
-
};
|