@opentiny/vue-renderless 3.11.7 → 3.12.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/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 +5 -9
- package/col/vue.js +4 -3
- 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 +3 -4
- 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 +6 -6
- package/select/vue.js +1 -1
- 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} +5 -1
- 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,11 +1,9 @@
|
|
|
1
1
|
import "../../chunk-G2ADBYYC.js";
|
|
2
|
-
import Color from "../utils/color";
|
|
3
2
|
import { draggable } from "../utils/use-drag";
|
|
4
3
|
import { onDrag, updateThumb } from ".";
|
|
5
4
|
const api = ["state", "color", "slider", "alphaWrapper", "alphaThumb"];
|
|
6
5
|
const renderless = (props, context, { emit }) => {
|
|
7
|
-
const
|
|
8
|
-
const color = new Color(hex, props.alpha);
|
|
6
|
+
const color = props.color;
|
|
9
7
|
const [rr, gg, bb] = color.getRGB();
|
|
10
8
|
const r = context.ref(rr);
|
|
11
9
|
const g = context.ref(gg);
|
|
@@ -16,14 +14,14 @@ const renderless = (props, context, { emit }) => {
|
|
|
16
14
|
const alpha = context.ref(color.get("a"));
|
|
17
15
|
context.watch(
|
|
18
16
|
() => props.color,
|
|
19
|
-
(
|
|
20
|
-
color.reset(hex2);
|
|
17
|
+
() => {
|
|
21
18
|
const [rr2, gg2, bb2] = color.getRGB();
|
|
22
19
|
r.value = rr2;
|
|
23
20
|
g.value = gg2;
|
|
24
21
|
b.value = bb2;
|
|
25
22
|
alpha.value = color.get("a");
|
|
26
|
-
}
|
|
23
|
+
},
|
|
24
|
+
{ deep: true }
|
|
27
25
|
);
|
|
28
26
|
context.watch(alpha, (newAlpha) => {
|
|
29
27
|
updateThumb(newAlpha, alphaThumb.value, alphaWrapper.value);
|
|
@@ -33,8 +31,7 @@ const renderless = (props, context, { emit }) => {
|
|
|
33
31
|
return `linear-gradient(to right, rgba(${r.value}, ${g.value}, ${b.value}, 0) 0%, rgba(${r.value}, ${g.value}, ${b.value}, 1) 100%)`;
|
|
34
32
|
});
|
|
35
33
|
const state = context.reactive({
|
|
36
|
-
background
|
|
37
|
-
hex
|
|
34
|
+
background
|
|
38
35
|
});
|
|
39
36
|
const api2 = {
|
|
40
37
|
state,
|
|
@@ -35,11 +35,13 @@ const updateCursor = (wrapper, cursor, emit) => {
|
|
|
35
35
|
const { x, y } = updatePosition(event, rect, cursor);
|
|
36
36
|
color.set({
|
|
37
37
|
s: calcSaturation(x, rect.width) * 100,
|
|
38
|
-
v: calcBrightness(y, rect.height)
|
|
38
|
+
v: calcBrightness(y, rect.height),
|
|
39
|
+
h: color.get("h")
|
|
39
40
|
});
|
|
40
41
|
emit("sv-update", {
|
|
41
42
|
s: color.get("s"),
|
|
42
|
-
v: color.get("v")
|
|
43
|
+
v: color.get("v"),
|
|
44
|
+
h: color.get("h")
|
|
43
45
|
});
|
|
44
46
|
};
|
|
45
47
|
};
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import "../../chunk-G2ADBYYC.js";
|
|
2
2
|
import { draggable } from "../utils/use-drag";
|
|
3
|
-
import Color from "../utils/color";
|
|
4
3
|
import { getThumbTop, resetCursor, updateThumb, updateCursor } from "./index";
|
|
5
4
|
const api = ["state", "cursor", "wrapper", "bar", "thumb"];
|
|
6
|
-
const renderless = (props, context, { emit }) => {
|
|
5
|
+
const renderless = (props, context, { emit, expose }) => {
|
|
7
6
|
const cursor = context.ref();
|
|
8
7
|
const wrapper = context.ref();
|
|
9
8
|
const thumb = context.ref();
|
|
10
9
|
const bar = context.ref();
|
|
11
|
-
const color =
|
|
10
|
+
const color = props.color;
|
|
12
11
|
const h = context.ref(color.get("h"));
|
|
13
|
-
const background =
|
|
14
|
-
return `hsl(${h.value}deg, 100%, 50%)`;
|
|
15
|
-
});
|
|
12
|
+
const background = `hsl(${h.value}deg, 100%, 50%)`;
|
|
16
13
|
const state = context.reactive({
|
|
17
14
|
background
|
|
18
15
|
});
|
|
19
16
|
const api2 = { state, cursor, wrapper, bar, thumb };
|
|
20
17
|
context.watch(
|
|
21
|
-
() => props
|
|
22
|
-
(
|
|
23
|
-
color.
|
|
18
|
+
() => props,
|
|
19
|
+
() => {
|
|
20
|
+
h.value = color.get("h");
|
|
24
21
|
resetCursor(color.get("s"), color.get("v"), wrapper, cursor, thumb, color, h);
|
|
25
|
-
}
|
|
22
|
+
},
|
|
23
|
+
{ deep: true }
|
|
26
24
|
);
|
|
25
|
+
context.watch(h, (newHue) => {
|
|
26
|
+
state.background = `hsl(${newHue}deg, 100%, 50%)`;
|
|
27
|
+
});
|
|
27
28
|
context.onMounted(() => {
|
|
28
29
|
const update = {
|
|
29
30
|
thumb: updateThumb(bar, thumb, h, emit),
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-G2ADBYYC.js";
|
|
5
|
+
import Color from "./utils/color";
|
|
6
|
+
const onConfirm = (hex, pre, res, emit, stack, enableHistory, color) => {
|
|
3
7
|
return () => {
|
|
8
|
+
pre.value = hex.value;
|
|
4
9
|
hex.value = res.value;
|
|
5
|
-
triggerBg.value = res.value;
|
|
6
10
|
if (enableHistory) {
|
|
7
11
|
const itemIdx = Math.max(
|
|
8
12
|
stack.value.indexOf(res.value),
|
|
@@ -14,32 +18,36 @@ const onConfirm = (hex, triggerBg, res, emit, stack, enableHistory) => {
|
|
|
14
18
|
}
|
|
15
19
|
stack.value.unshift(res.value);
|
|
16
20
|
}
|
|
21
|
+
color.value.setPrevH(color.value.get("h"));
|
|
17
22
|
emit("confirm", res.value);
|
|
18
23
|
};
|
|
19
24
|
};
|
|
20
|
-
const onCancel = (res,
|
|
25
|
+
const onCancel = (res, pre, emit, isShow, hex, color) => {
|
|
21
26
|
return () => {
|
|
22
27
|
if (isShow.value) {
|
|
23
|
-
res.value =
|
|
24
|
-
hex.value =
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
res.value = pre.value;
|
|
29
|
+
hex.value = pre.value;
|
|
30
|
+
const tmpColor = new Color(pre.value);
|
|
31
|
+
color.value.set(__spreadProps(__spreadValues({}, tmpColor.getHSV()), {
|
|
32
|
+
h: color.value.get("preH")
|
|
33
|
+
}));
|
|
34
|
+
emit("cancel", color);
|
|
27
35
|
}
|
|
28
36
|
};
|
|
29
37
|
};
|
|
30
38
|
const onColorUpdate = (color, res) => {
|
|
31
|
-
res.value = color.getHex();
|
|
39
|
+
res.value = color.value.getHex();
|
|
32
40
|
};
|
|
33
41
|
const onHSVUpdate = (color, res, hex, emit) => {
|
|
34
42
|
return {
|
|
35
43
|
onHueUpdate: (hue) => {
|
|
36
|
-
color.set({ h: hue });
|
|
44
|
+
color.value.set({ h: hue });
|
|
37
45
|
onColorUpdate(color, res);
|
|
38
|
-
hex.value = color.getHex();
|
|
46
|
+
hex.value = color.value.getHex();
|
|
39
47
|
emit("hue-update", hue);
|
|
40
48
|
},
|
|
41
49
|
onSVUpdate: ({ s, v }) => {
|
|
42
|
-
color.
|
|
50
|
+
hex.value = color.value.getHex();
|
|
43
51
|
onColorUpdate(color, res);
|
|
44
52
|
emit("sv-update", { s, v });
|
|
45
53
|
}
|
|
@@ -48,23 +56,27 @@ const onHSVUpdate = (color, res, hex, emit) => {
|
|
|
48
56
|
const onAlphaUpdate = (color, res) => {
|
|
49
57
|
return {
|
|
50
58
|
update: (alpha) => {
|
|
51
|
-
color.set({ a: alpha });
|
|
59
|
+
color.value.set({ a: alpha });
|
|
52
60
|
onColorUpdate(color, res);
|
|
53
61
|
}
|
|
54
62
|
};
|
|
55
63
|
};
|
|
56
|
-
const handleHistoryClick = (hex, res, color) => {
|
|
64
|
+
const handleHistoryClick = (hex, res, color, emit) => {
|
|
57
65
|
return (history) => {
|
|
58
66
|
hex.value = history;
|
|
59
67
|
res.value = history;
|
|
60
|
-
|
|
68
|
+
const tmpColor = new Color(history);
|
|
69
|
+
color.value.set(__spreadValues({}, tmpColor.getHSV()));
|
|
70
|
+
emit("color-update", color);
|
|
61
71
|
};
|
|
62
72
|
};
|
|
63
|
-
const handlePredefineClick = (hex, res, color) => {
|
|
73
|
+
const handlePredefineClick = (hex, res, color, emit) => {
|
|
64
74
|
return (selectedColor) => {
|
|
65
75
|
hex.value = selectedColor;
|
|
66
76
|
res.value = selectedColor;
|
|
67
|
-
|
|
77
|
+
const tmpColor = new Color(selectedColor);
|
|
78
|
+
color.value.set(__spreadValues({}, tmpColor.getHSV()));
|
|
79
|
+
emit("color-update", color);
|
|
68
80
|
};
|
|
69
81
|
};
|
|
70
82
|
export {
|
|
@@ -33,6 +33,7 @@ class Color {
|
|
|
33
33
|
this.s = 0;
|
|
34
34
|
this.v = 0;
|
|
35
35
|
this.a = 100;
|
|
36
|
+
this.preH = 0;
|
|
36
37
|
this.enableAlpha = false;
|
|
37
38
|
this.reset(value);
|
|
38
39
|
this.enableAlpha = alpha;
|
|
@@ -48,6 +49,7 @@ class Color {
|
|
|
48
49
|
this.hex = normalizeHexColor(hex);
|
|
49
50
|
const { r, g, b, a } = hexToRgb(this.hex);
|
|
50
51
|
const { h, s, v } = rgb([r, g, b, a]).hsv().object();
|
|
52
|
+
this.preH = h;
|
|
51
53
|
this.h = h;
|
|
52
54
|
this.s = s;
|
|
53
55
|
this.v = v;
|
|
@@ -59,6 +61,9 @@ class Color {
|
|
|
59
61
|
this.v = v != null ? v : this.v;
|
|
60
62
|
this.a = a != null ? a : this.a;
|
|
61
63
|
}
|
|
64
|
+
setPrevH(val) {
|
|
65
|
+
this.preH = val;
|
|
66
|
+
}
|
|
62
67
|
/**
|
|
63
68
|
*
|
|
64
69
|
* @returns [R,G,B]
|
|
@@ -19,6 +19,7 @@ const renderless = (props, context, { emit }) => {
|
|
|
19
19
|
const { modelValue, visible, history, predefine } = context.toRefs(props);
|
|
20
20
|
const hex = context.ref((_a = modelValue == null ? void 0 : modelValue.value) != null ? _a : "transparent");
|
|
21
21
|
const res = context.ref((_b = modelValue == null ? void 0 : modelValue.value) != null ? _b : "transparent");
|
|
22
|
+
const pre = context.ref(res.value);
|
|
22
23
|
const triggerBg = context.ref((_c = modelValue == null ? void 0 : modelValue.value) != null ? _c : "transparent");
|
|
23
24
|
const isShow = context.ref((_d = visible == null ? void 0 : visible.value) != null ? _d : false);
|
|
24
25
|
const cursor = context.ref();
|
|
@@ -29,7 +30,7 @@ const renderless = (props, context, { emit }) => {
|
|
|
29
30
|
const changeVisible = (state2) => {
|
|
30
31
|
isShow.value = state2;
|
|
31
32
|
};
|
|
32
|
-
const color = new Color(hex.value, props.alpha);
|
|
33
|
+
const color = context.ref(new Color(hex.value, props.alpha));
|
|
33
34
|
const state = context.reactive({
|
|
34
35
|
isShow,
|
|
35
36
|
hex,
|
|
@@ -56,11 +57,19 @@ const renderless = (props, context, { emit }) => {
|
|
|
56
57
|
},
|
|
57
58
|
{ deep: true }
|
|
58
59
|
);
|
|
60
|
+
context.watch(
|
|
61
|
+
state,
|
|
62
|
+
() => {
|
|
63
|
+
state.color = state.color;
|
|
64
|
+
},
|
|
65
|
+
{ deep: true }
|
|
66
|
+
);
|
|
59
67
|
context.watch(modelValue, (newValue) => {
|
|
68
|
+
pre.value = res.value;
|
|
60
69
|
hex.value = newValue;
|
|
61
70
|
res.value = newValue;
|
|
62
|
-
|
|
63
|
-
color.reset(
|
|
71
|
+
color.value.reset(newValue);
|
|
72
|
+
state.color.reset(newValue);
|
|
64
73
|
});
|
|
65
74
|
context.watch(visible, (visible2) => {
|
|
66
75
|
isShow.value = visible2;
|
|
@@ -72,11 +81,11 @@ const renderless = (props, context, { emit }) => {
|
|
|
72
81
|
changeVisible,
|
|
73
82
|
onHueUpdate,
|
|
74
83
|
onSVUpdate,
|
|
75
|
-
onConfirm: onConfirm(hex,
|
|
76
|
-
onCancel: onCancel(res,
|
|
84
|
+
onConfirm: onConfirm(hex, pre, res, emit, stack, enableHistory, color),
|
|
85
|
+
onCancel: onCancel(res, pre, emit, isShow, hex, color),
|
|
77
86
|
onAlphaUpdate: update,
|
|
78
|
-
onHistoryClick: handleHistoryClick(hex, res, color),
|
|
79
|
-
onPredefineColorClick: handlePredefineClick(hex, res, color),
|
|
87
|
+
onHistoryClick: handleHistoryClick(hex, res, color, emit),
|
|
88
|
+
onPredefineColorClick: handlePredefineClick(hex, res, color, emit),
|
|
80
89
|
cursor
|
|
81
90
|
};
|
|
82
91
|
return api2;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { isNull } from "../common/type";
|
|
3
|
-
const handelIconClick = ({ emit }) => (item, index) => {
|
|
3
|
+
const handelIconClick = ({ emit }) => (item, index, event) => {
|
|
4
4
|
if (item.disabled)
|
|
5
5
|
return;
|
|
6
|
-
emit("icon-click", item, index);
|
|
6
|
+
emit("icon-click", item, index, event);
|
|
7
7
|
};
|
|
8
8
|
const handleChange = ({ constants, dispatch, emit, state, nextTick }) => () => {
|
|
9
9
|
nextTick(() => {
|
|
@@ -24,23 +24,37 @@ const getIsGroup = ({ constants, parent: $parent, state }) => () => {
|
|
|
24
24
|
return false;
|
|
25
25
|
};
|
|
26
26
|
const getSize = ({ props, state }) => () => state.isGroup ? state.columnGroup.size || props.size : props.size;
|
|
27
|
-
const isDisabled = ({ props, state }) => () => props.
|
|
27
|
+
const isDisabled = ({ props, state }) => () => props.disabled || state.columnGroup.disabled;
|
|
28
28
|
const getModel = ({ props, state }) => () => {
|
|
29
29
|
const model = state.isGroup ? state.store : props.modelValue !== void 0 ? props.modelValue : state.selfModel;
|
|
30
|
-
|
|
30
|
+
if (state.showCheckbox) {
|
|
31
|
+
return isNull(model) ? [] : model;
|
|
32
|
+
} else {
|
|
33
|
+
return state.store;
|
|
34
|
+
}
|
|
31
35
|
};
|
|
32
36
|
const setModel = ({ constants, dispatch, emit, state }) => (val) => {
|
|
33
37
|
if (state.isGroup) {
|
|
34
38
|
dispatch(constants.COLUMN_GROUP, "update:modelValue", [val]);
|
|
35
39
|
} else {
|
|
36
40
|
emit("update:modelValue", val);
|
|
37
|
-
state.selfModel = val;
|
|
41
|
+
state.showCheckbox && (state.selfModel = val);
|
|
38
42
|
}
|
|
39
43
|
};
|
|
40
44
|
const computedStore = ({ state, props }) => () => state.isGroup ? state.columnGroup.modelValue : props.modelValue;
|
|
45
|
+
const getItemChecked = ({ props, state }) => () => {
|
|
46
|
+
if (!state.showCheckbox || !state.showRadio)
|
|
47
|
+
return;
|
|
48
|
+
if (state.showCheckbox) {
|
|
49
|
+
return state.isGroup || Array.isArray(state.model) ? ~state.model.indexOf(props.label) : state.model;
|
|
50
|
+
} else {
|
|
51
|
+
return state.model === props.label;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
41
54
|
export {
|
|
42
55
|
computedStore,
|
|
43
56
|
getIsGroup,
|
|
57
|
+
getItemChecked,
|
|
44
58
|
getModel,
|
|
45
59
|
getSize,
|
|
46
60
|
handelIconClick,
|
package/column-list-item/vue.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import {
|
|
3
|
+
getModel,
|
|
4
|
+
setModel,
|
|
3
5
|
handelIconClick,
|
|
6
|
+
computedStore,
|
|
7
|
+
getItemChecked,
|
|
4
8
|
handleChange,
|
|
5
9
|
getIsGroup,
|
|
6
10
|
getSize,
|
|
7
|
-
isDisabled
|
|
8
|
-
getModel,
|
|
9
|
-
setModel,
|
|
10
|
-
computedStore
|
|
11
|
+
isDisabled
|
|
11
12
|
} from "./index";
|
|
12
|
-
const api = ["state", "handelIconClick"];
|
|
13
|
-
const renderless = (props, { reactive,
|
|
13
|
+
const api = ["state", "handelIconClick", "handleChange"];
|
|
14
|
+
const renderless = (props, { reactive, computed }, { vm, parent, emit, nextTick, dispatch, constants }) => {
|
|
14
15
|
const api2 = {};
|
|
15
16
|
const state = reactive({
|
|
16
17
|
columnGroup: {},
|
|
17
|
-
|
|
18
|
+
size: computed(() => api2.getSize()),
|
|
19
|
+
disabled: computed(() => api2.isDisabled()),
|
|
20
|
+
itemChecked: computed(() => api2.getItemChecked()),
|
|
18
21
|
sliceNum: computed(() => props.size === "small" ? 1 : 2),
|
|
19
22
|
iconNum: computed(() => props.size === "small" ? 2 : 3),
|
|
20
23
|
effectOptions: computed(() => props.options.filter((item) => !item.hidden)),
|
|
21
24
|
showCheckbox: computed(() => props.showCheckbox || state.columnGroup.showCheckbox),
|
|
25
|
+
showRadio: computed(() => props.showRadio || state.columnGroup.showRadio),
|
|
22
26
|
store: computed(() => api2.computedStore()),
|
|
23
|
-
|
|
24
|
-
size: computed(() => api2.getSize()),
|
|
25
|
-
disabled: computed(() => api2.isDisabled()),
|
|
27
|
+
isGroup: computed(() => api2.getIsGroup()),
|
|
26
28
|
model: computed({
|
|
27
29
|
get: () => api2.getModel(),
|
|
28
30
|
set: (val) => api2.setModel(val)
|
|
@@ -30,16 +32,16 @@ const renderless = (props, { reactive, watch, computed }, { vm, parent, emit, co
|
|
|
30
32
|
});
|
|
31
33
|
Object.assign(api2, {
|
|
32
34
|
state,
|
|
33
|
-
getSize: getSize({ props, state }),
|
|
34
|
-
getModel: getModel({ props, state }),
|
|
35
35
|
getIsGroup: getIsGroup({ constants, parent, state }),
|
|
36
36
|
isDisabled: isDisabled({ props, state }),
|
|
37
37
|
setModel: setModel({ constants, dispatch, emit, props, vm, state }),
|
|
38
|
+
getSize: getSize({ props, state }),
|
|
39
|
+
getModel: getModel({ props, state }),
|
|
38
40
|
handleChange: handleChange({ constants, dispatch, emit, state, nextTick }),
|
|
39
41
|
computedStore: computedStore({ state, props }),
|
|
40
|
-
handelIconClick: handelIconClick({ emit })
|
|
42
|
+
handelIconClick: handelIconClick({ emit }),
|
|
43
|
+
getItemChecked: getItemChecked({ state, props })
|
|
41
44
|
});
|
|
42
|
-
watch(() => state.model, api2.handleChange, { deep: true });
|
|
43
45
|
return api2;
|
|
44
46
|
};
|
|
45
47
|
export {
|
package/common/bigInt.js
CHANGED
|
@@ -125,7 +125,7 @@ class BigIntDecimal {
|
|
|
125
125
|
const trimRet = trimNumber(mergedValue);
|
|
126
126
|
this.negative = trimRet.negative;
|
|
127
127
|
const numbers = trimRet.trimStr.split(".");
|
|
128
|
-
this.integer = numbers[0].
|
|
128
|
+
this.integer = !numbers[0].includes("e") ? BigInt(numbers[0]) : numbers[0];
|
|
129
129
|
const decimalStr = numbers[1] || "0";
|
|
130
130
|
this.decimal = convertBigInt(decimalStr);
|
|
131
131
|
this.decimalLen = decimalStr.length;
|
package/common/deps/dom.js
CHANGED
|
@@ -5,15 +5,15 @@ const isServer = typeof window === "undefined";
|
|
|
5
5
|
const SPECIAL_CHARS_REGEXP = /([:\-_]+(.))/g;
|
|
6
6
|
const MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
|
7
7
|
const camelCase = (name) => name.replace(SPECIAL_CHARS_REGEXP, (_, separator, letter, offset) => offset ? letter.toUpperCase() : letter).replace(MOZ_HACK_REGEXP, "Moz$1");
|
|
8
|
-
const on = (el, event, handler) => {
|
|
8
|
+
const on = (el, event, handler, options = false) => {
|
|
9
9
|
if (el && event && handler) {
|
|
10
|
-
el.addEventListener(event, handler,
|
|
10
|
+
el.addEventListener(event, handler, options);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
const off = (el, event, handler) => {
|
|
13
|
+
const off = (el, event, handler, options = false) => {
|
|
14
14
|
window.document;
|
|
15
15
|
if (el && event) {
|
|
16
|
-
el.removeEventListener(event, handler,
|
|
16
|
+
el.removeEventListener(event, handler, options);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
const once = (el, event, fn) => {
|
|
@@ -145,18 +145,50 @@ const getDomNode = () => {
|
|
|
145
145
|
visibleWidth: documentElement.clientWidth || bodyElem.clientWidth
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
|
+
const getScrollTop = (el) => {
|
|
149
|
+
const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
|
|
150
|
+
return Math.max(top, 0);
|
|
151
|
+
};
|
|
152
|
+
const stopPropagation = (event) => event.stopPropagation();
|
|
153
|
+
const preventDefault = (event, isStopPropagation) => {
|
|
154
|
+
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
}
|
|
157
|
+
if (isStopPropagation) {
|
|
158
|
+
stopPropagation(event);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const overflowScrollReg = /scroll|auto|overlay/i;
|
|
162
|
+
const defaultRoot = isServer ? void 0 : window;
|
|
163
|
+
const isElement = (node) => node.tagName !== "HTML" && node.tagName !== "BODY" && node.nodeType === 1;
|
|
164
|
+
const getScrollParent = (el, root = defaultRoot) => {
|
|
165
|
+
let node = el;
|
|
166
|
+
while (node && node !== root && isElement(node)) {
|
|
167
|
+
const { overflowY } = window.getComputedStyle(node);
|
|
168
|
+
if (overflowScrollReg.test(overflowY)) {
|
|
169
|
+
return node;
|
|
170
|
+
}
|
|
171
|
+
node = node.parentNode;
|
|
172
|
+
}
|
|
173
|
+
return root;
|
|
174
|
+
};
|
|
148
175
|
export {
|
|
149
176
|
addClass,
|
|
150
177
|
getDomNode,
|
|
151
178
|
getScrollContainer,
|
|
179
|
+
getScrollParent,
|
|
180
|
+
getScrollTop,
|
|
152
181
|
getStyle,
|
|
153
182
|
hasClass,
|
|
154
183
|
isInContainer,
|
|
155
184
|
isScroll,
|
|
185
|
+
isServer,
|
|
156
186
|
isVNode,
|
|
157
187
|
off,
|
|
158
188
|
on,
|
|
159
189
|
once,
|
|
190
|
+
preventDefault,
|
|
160
191
|
removeClass,
|
|
161
|
-
setStyle
|
|
192
|
+
setStyle,
|
|
193
|
+
stopPropagation
|
|
162
194
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import "../../chunk-G2ADBYYC.js";
|
|
2
2
|
import { on, once } from "./dom";
|
|
3
3
|
var repeat_click_default = (el, binding) => {
|
|
4
|
+
const LONG_PRESS_INTERVAL = 200;
|
|
4
5
|
let interval = null;
|
|
5
6
|
let startTime;
|
|
6
7
|
const handler = () => {
|
|
7
8
|
typeof binding.value === "function" && binding.value.apply();
|
|
8
9
|
};
|
|
9
10
|
const clear = () => {
|
|
10
|
-
if (Date.now() - startTime <
|
|
11
|
+
if (Date.now() - startTime < LONG_PRESS_INTERVAL) {
|
|
11
12
|
handler();
|
|
12
13
|
}
|
|
13
14
|
clearInterval(interval);
|
|
@@ -20,7 +21,7 @@ var repeat_click_default = (el, binding) => {
|
|
|
20
21
|
startTime = Date.now();
|
|
21
22
|
once(document, "mouseup", clear);
|
|
22
23
|
clearInterval(interval);
|
|
23
|
-
interval = setInterval(handler,
|
|
24
|
+
interval = setInterval(handler, LONG_PRESS_INTERVAL);
|
|
24
25
|
});
|
|
25
26
|
};
|
|
26
27
|
export {
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import "../../chunk-G2ADBYYC.js";
|
|
2
|
+
let emulated = false;
|
|
3
|
+
let initiated = false;
|
|
4
|
+
let eventTarget = null;
|
|
5
|
+
let mouseTarget = null;
|
|
6
|
+
const matches = Element.prototype.matches || Element.prototype.webkitMatchesSelector;
|
|
7
|
+
const closest = (el, s) => {
|
|
8
|
+
do {
|
|
9
|
+
if (matches.call(el, s))
|
|
10
|
+
return el;
|
|
11
|
+
el = el.parentElement || el.parentNode;
|
|
12
|
+
} while (el !== null && el.nodeType === 1);
|
|
13
|
+
return null;
|
|
14
|
+
};
|
|
15
|
+
class Touch {
|
|
16
|
+
constructor(target, identifier, pos, deltaX, deltaY) {
|
|
17
|
+
this.target = target;
|
|
18
|
+
this.identifier = identifier;
|
|
19
|
+
deltaX = deltaX || 0;
|
|
20
|
+
deltaY = deltaY || 0;
|
|
21
|
+
this.pageX = pos.pageX + deltaX;
|
|
22
|
+
this.pageY = pos.pageY + deltaY;
|
|
23
|
+
this.screenX = pos.screenX + deltaX;
|
|
24
|
+
this.screenY = pos.screenY + deltaY;
|
|
25
|
+
this.clientX = pos.clientX + deltaX;
|
|
26
|
+
this.clientY = pos.clientY + deltaY;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const TouchList = () => {
|
|
30
|
+
const touchList = [];
|
|
31
|
+
touchList.item = (index) => touchList[index] || null;
|
|
32
|
+
touchList.identifiedTouch = (id) => touchList[id + 1] || null;
|
|
33
|
+
return touchList;
|
|
34
|
+
};
|
|
35
|
+
const createTouchList = (mouseEv) => {
|
|
36
|
+
const touchList = TouchList();
|
|
37
|
+
touchList.push(new Touch(eventTarget, 1, mouseEv, 0, 0));
|
|
38
|
+
return touchList;
|
|
39
|
+
};
|
|
40
|
+
const getActiveTouches = (mouseEv) => {
|
|
41
|
+
if (mouseEv.type === "mouseup") {
|
|
42
|
+
return TouchList();
|
|
43
|
+
}
|
|
44
|
+
return createTouchList(mouseEv);
|
|
45
|
+
};
|
|
46
|
+
const triggerTouch = (eventName, mouseEv) => {
|
|
47
|
+
const touchEvent = document.createEvent("Event");
|
|
48
|
+
touchEvent.initEvent(eventName, true, true);
|
|
49
|
+
touchEvent.altKey = mouseEv.altKey;
|
|
50
|
+
touchEvent.metaKey = mouseEv.metaKey;
|
|
51
|
+
touchEvent.ctrlKey = mouseEv.ctrlKey;
|
|
52
|
+
touchEvent.shiftKey = mouseEv.shiftKey;
|
|
53
|
+
touchEvent.changedTouches = createTouchList(mouseEv);
|
|
54
|
+
touchEvent.targetTouches = getActiveTouches(mouseEv);
|
|
55
|
+
touchEvent.touches = getActiveTouches(mouseEv);
|
|
56
|
+
touchEvent.isTinySimulate = true;
|
|
57
|
+
eventTarget.dispatchEvent(touchEvent);
|
|
58
|
+
};
|
|
59
|
+
const onMouse = (touchType) => (ev) => {
|
|
60
|
+
if (ev.type === "mousedown") {
|
|
61
|
+
initiated = true;
|
|
62
|
+
}
|
|
63
|
+
if (ev.type === "mouseup") {
|
|
64
|
+
initiated = false;
|
|
65
|
+
}
|
|
66
|
+
if (ev.type === "mousemove" && !initiated) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (ev.type === "mousedown" || !mouseTarget) {
|
|
70
|
+
mouseTarget = ev.target;
|
|
71
|
+
}
|
|
72
|
+
if ((eventTarget = closest(mouseTarget, "[data-tiny-touch-simulate-container]")) && eventTarget.dispatchEvent) {
|
|
73
|
+
triggerTouch(touchType, ev);
|
|
74
|
+
}
|
|
75
|
+
if (ev.type === "mouseup") {
|
|
76
|
+
eventTarget = null;
|
|
77
|
+
mouseTarget = null;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const touchEmulator = () => {
|
|
81
|
+
window.addEventListener("mousedown", onMouse("touchstart"), true);
|
|
82
|
+
window.addEventListener("mousemove", onMouse("touchmove"), true);
|
|
83
|
+
window.addEventListener("mouseup", onMouse("touchend"), true);
|
|
84
|
+
};
|
|
85
|
+
const emulate = () => {
|
|
86
|
+
const supportTouch = "ontouchstart" in window;
|
|
87
|
+
if (!emulated && !supportTouch) {
|
|
88
|
+
emulated = true;
|
|
89
|
+
touchEmulator();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
var touch_emulator_default = emulate;
|
|
93
|
+
export {
|
|
94
|
+
touch_emulator_default as default
|
|
95
|
+
};
|
package/common/deps/touch.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import "../../chunk-G2ADBYYC.js";
|
|
2
2
|
const MIN_DISTANCE = 10;
|
|
3
|
-
|
|
4
|
-
if (
|
|
5
|
-
return "vertical";
|
|
6
|
-
} else if (w > h && w > MIN_DISTANCE) {
|
|
3
|
+
const getDirection = (x, y) => {
|
|
4
|
+
if (x > y && x > MIN_DISTANCE) {
|
|
7
5
|
return "horizontal";
|
|
8
6
|
}
|
|
7
|
+
if (y > x && y > MIN_DISTANCE) {
|
|
8
|
+
return "vertical";
|
|
9
|
+
}
|
|
9
10
|
return "";
|
|
10
|
-
}
|
|
11
|
-
const resetTouchStatus = (state) => {
|
|
12
|
-
state.direction = "";
|
|
13
|
-
state.deltaX = 0;
|
|
14
|
-
state.deltaY = 0;
|
|
15
|
-
state.offsetX = 0;
|
|
16
|
-
state.offsetY = 0;
|
|
17
11
|
};
|
|
18
12
|
const touchStart = (state) => (event) => {
|
|
19
13
|
resetTouchStatus(state);
|
|
@@ -28,6 +22,13 @@ const touchMove = (state) => (event) => {
|
|
|
28
22
|
state.offsetY = Math.abs(state.deltaY);
|
|
29
23
|
state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
|
|
30
24
|
};
|
|
25
|
+
const resetTouchStatus = (state) => {
|
|
26
|
+
state.direction = "";
|
|
27
|
+
state.deltaX = 0;
|
|
28
|
+
state.deltaY = 0;
|
|
29
|
+
state.offsetX = 0;
|
|
30
|
+
state.offsetY = 0;
|
|
31
|
+
};
|
|
31
32
|
export {
|
|
32
33
|
getDirection,
|
|
33
34
|
resetTouchStatus,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "../../chunk-G2ADBYYC.js";
|
|
2
|
+
import { on, off, isServer } from "./dom";
|
|
3
|
+
const onMountedOrActivated = ({ onMounted, onActivated, nextTick }) => (hook) => {
|
|
4
|
+
let mounted;
|
|
5
|
+
onMounted(() => (hook(), nextTick(() => mounted = true)));
|
|
6
|
+
onActivated(() => mounted && hook());
|
|
7
|
+
};
|
|
8
|
+
const useEventListener = ({ unref, isRef, watch, nextTick, onMounted, onUnmounted, onActivated, onDeactivated }) => (type, listener, options = {}) => {
|
|
9
|
+
if (isServer)
|
|
10
|
+
return;
|
|
11
|
+
const { target = window, passive = false, capture = false } = options;
|
|
12
|
+
let cleaned = false;
|
|
13
|
+
let attached;
|
|
14
|
+
const add = (target2) => {
|
|
15
|
+
if (cleaned)
|
|
16
|
+
return;
|
|
17
|
+
const element = unref(target2);
|
|
18
|
+
if (element && !attached) {
|
|
19
|
+
on(element, type, listener, { capture, passive });
|
|
20
|
+
attached = true;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const remove = (target2) => {
|
|
24
|
+
if (cleaned)
|
|
25
|
+
return;
|
|
26
|
+
const element = unref(target2);
|
|
27
|
+
if (element && attached) {
|
|
28
|
+
off(element, type, listener, { capture, passive });
|
|
29
|
+
attached = false;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
onUnmounted(() => remove(target));
|
|
33
|
+
onDeactivated(() => remove(target));
|
|
34
|
+
onMountedOrActivated({ onMounted, onActivated, nextTick })(() => add(target));
|
|
35
|
+
let stopWatch;
|
|
36
|
+
if (isRef(target)) {
|
|
37
|
+
stopWatch = watch(target, (val, oldVal) => (remove(oldVal), add(val)));
|
|
38
|
+
}
|
|
39
|
+
return () => {
|
|
40
|
+
stopWatch && stopWatch();
|
|
41
|
+
remove(target);
|
|
42
|
+
cleaned = true;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
useEventListener
|
|
47
|
+
};
|