@opentiny/vue-renderless 3.11.8 → 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 +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 +2 -4
- 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
package/anchor/index.js
CHANGED
|
@@ -33,6 +33,7 @@ const updateSkidPosition = ({ vm, state, emit }) => {
|
|
|
33
33
|
if (!activeEl) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
+
emit("change", currentLink);
|
|
36
37
|
emit("onChange", currentLink);
|
|
37
38
|
if (!anchorRef || !skidRef || !maskRef) {
|
|
38
39
|
return;
|
|
@@ -92,7 +93,7 @@ const setChildOffsetTop = ({ state, props }) => {
|
|
|
92
93
|
var _a;
|
|
93
94
|
state.offsetTop = ((_a = document.querySelector(props.links[0].link)) == null ? void 0 : _a.offsetTop) || 0;
|
|
94
95
|
};
|
|
95
|
-
const getContainer = ({ props }) => () => props.containerId
|
|
96
|
+
const getContainer = ({ props }) => () => props.containerId && document.querySelector(props.containerId) || document.body;
|
|
96
97
|
const mounted = ({ state, api, props, nextTick }) => () => {
|
|
97
98
|
nextTick(() => {
|
|
98
99
|
api.setScrollContainer();
|
|
@@ -113,7 +114,7 @@ const unmounted = ({ state, api }) => () => {
|
|
|
113
114
|
state.scrollContainer.removeEventListener("scroll", api.handleScroll());
|
|
114
115
|
}
|
|
115
116
|
};
|
|
116
|
-
const onItersectionObserver = ({ state, props, api }) => () => {
|
|
117
|
+
const onItersectionObserver = ({ state, props, api, vm, emit }) => () => {
|
|
117
118
|
const { expandLink, scrollContainer } = state;
|
|
118
119
|
state.intersectionObserver = new IntersectionObserver(
|
|
119
120
|
(entries) => {
|
|
@@ -123,6 +124,12 @@ const onItersectionObserver = ({ state, props, api }) => () => {
|
|
|
123
124
|
const key = item.target.id;
|
|
124
125
|
state.observerLinks[key] = item;
|
|
125
126
|
});
|
|
127
|
+
if (state.currentHash !== location.hash) {
|
|
128
|
+
state.currentHash = location.hash;
|
|
129
|
+
state.currentLink = state.currentHash;
|
|
130
|
+
updateSkidPosition({ vm, state, emit });
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
126
133
|
for (let key in state.observerLinks) {
|
|
127
134
|
if (Object.prototype.hasOwnProperty.call(state.observerLinks, key)) {
|
|
128
135
|
const item = state.observerLinks[key];
|
|
@@ -152,12 +159,12 @@ const linkClick = ({ state, vm, emit, props, api }) => (e, item) => {
|
|
|
152
159
|
state.currentLink = link;
|
|
153
160
|
updateSkidPosition({ vm, state, emit });
|
|
154
161
|
setMarkClass({ state, props });
|
|
155
|
-
if (scrollContainer !== document.body && !isChangeHash) {
|
|
162
|
+
if (scrollContainer && scrollContainer !== document.body && !isChangeHash) {
|
|
156
163
|
const linkEl = scrollContainer.querySelector(item.link);
|
|
157
|
-
const top = linkEl.offsetTop - scrollContainer.offsetTop;
|
|
164
|
+
const top = (linkEl == null ? void 0 : linkEl.offsetTop) - scrollContainer.offsetTop;
|
|
158
165
|
const param = { top, left: 0, behavior: "smooth" };
|
|
159
|
-
scrollContainer.scrollTo(param);
|
|
160
|
-
scrollContainer.addEventListener("scroll", api.handleScroll());
|
|
166
|
+
scrollContainer == null ? void 0 : scrollContainer.scrollTo(param);
|
|
167
|
+
scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", api.handleScroll());
|
|
161
168
|
}
|
|
162
169
|
};
|
|
163
170
|
export {
|
package/anchor/vue.js
CHANGED
|
@@ -39,7 +39,7 @@ const renderless = (props, { onMounted, onUnmounted, onUpdated, reactive, watch
|
|
|
39
39
|
unmounted: unmounted({ state, api: api2 }),
|
|
40
40
|
getContainer: getContainer({ props }),
|
|
41
41
|
linkClick: linkClick({ state, vm, emit, props, api: api2 }),
|
|
42
|
-
onItersectionObserver: onItersectionObserver({ state, props, api: api2 }),
|
|
42
|
+
onItersectionObserver: onItersectionObserver({ state, props, api: api2, vm, emit }),
|
|
43
43
|
setScrollContainer: setScrollContainer({ state, api: api2 }),
|
|
44
44
|
getCurrentAnchor: getCurrentAnchor({ vm, state, emit }),
|
|
45
45
|
setFixAnchor: setFixAnchor({ vm, props }),
|
package/breadcrumb/index.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const breadcrumbItemSelect = ({
|
|
2
|
+
const breadcrumbItemSelect = ({
|
|
3
|
+
api,
|
|
4
|
+
emit,
|
|
5
|
+
state,
|
|
6
|
+
constants
|
|
7
|
+
}) => {
|
|
3
8
|
state.breadcrumbEmitter.on(constants.EVENT_NAME.breadcrumbItemSelect, (value) => {
|
|
4
9
|
state.currentBreadcrumbItem = value;
|
|
5
10
|
emit("select", value);
|
package/breadcrumb-item/index.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const linkClick = ({
|
|
2
|
+
const linkClick = ({
|
|
3
|
+
props,
|
|
4
|
+
refs,
|
|
5
|
+
router,
|
|
6
|
+
emit,
|
|
7
|
+
breadcrumbEmitter,
|
|
8
|
+
constants
|
|
9
|
+
}) => (event) => {
|
|
3
10
|
const { replace, to, option } = props;
|
|
4
11
|
const currentBreadcrumbItem = { link: refs.link, replace, to, event, option };
|
|
5
12
|
breadcrumbEmitter.emit(constants.EVENT_NAME.breadcrumbItemSelect, currentBreadcrumbItem);
|
package/calendar-bar/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { lastMonth, nextMonth } from "../common/calendar/calendar";
|
|
3
|
+
import { getDirection } from "../common/deps/touch";
|
|
2
4
|
const normalConfig = (config, state) => {
|
|
3
|
-
let {
|
|
4
|
-
const
|
|
5
|
-
const maxWeekFirst = state.dayOfWeek - 1;
|
|
6
|
-
weekFirst = typeof weekFirst === "number" && weekFirst >= minWeekFirst && weekFirst <= maxWeekFirst ? Math.round(weekFirst) : minWeekFirst;
|
|
5
|
+
let { disabled, holiday, workday, mark } = config || {};
|
|
6
|
+
const weekFirst = getWeekFirst(state, { config });
|
|
7
7
|
disabled = typeof disabled === "function" ? disabled : () => false;
|
|
8
8
|
holiday = typeof holiday === "function" ? holiday : () => true;
|
|
9
9
|
workday = typeof workday === "function" ? workday : () => true;
|
|
@@ -26,7 +26,7 @@ const splitDate = (date) => {
|
|
|
26
26
|
return { todayFullYear, todayMonth, todayDate, currentFullYear, currentMonth, currentDate };
|
|
27
27
|
};
|
|
28
28
|
const getBuildDay = (args) => (year, month, date) => {
|
|
29
|
-
const { pad0: pad02, isCurrent,
|
|
29
|
+
const { pad0: pad02, isCurrent, holiday, workday, mark, type } = args;
|
|
30
30
|
const { currentDate, isToday, disabled, dayOfWeek } = args;
|
|
31
31
|
const dateStr = `${year}-${pad02(month)}-${pad02(date)}`;
|
|
32
32
|
const d = new Date(dateStr);
|
|
@@ -34,22 +34,21 @@ const getBuildDay = (args) => (year, month, date) => {
|
|
|
34
34
|
const isSat = d.getDay() === dayOfWeek - 1;
|
|
35
35
|
const isSun = d.getDay() === 0;
|
|
36
36
|
let isWorkday, isHoliday;
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
isHoliday = !isWorkday;
|
|
44
|
-
}
|
|
37
|
+
if (isSat || isSun) {
|
|
38
|
+
isHoliday = holiday(d);
|
|
39
|
+
isWorkday = !isHoliday;
|
|
40
|
+
} else {
|
|
41
|
+
isWorkday = workday(d);
|
|
42
|
+
isHoliday = !isWorkday;
|
|
45
43
|
}
|
|
46
44
|
const markMsg = mark(d);
|
|
47
45
|
const marked = !!markMsg;
|
|
48
46
|
const day = { dateStr, marked, markMsg, isWorkday, isHoliday, isSat, isSun, isCurMon };
|
|
49
|
-
day.isCur = isCurMon && date === currentDate;
|
|
47
|
+
day.isCur = isCurMon && date === currentDate && type === "cur";
|
|
50
48
|
day.isToday = isToday(year, month, date);
|
|
51
49
|
day.disabled = disabled(d);
|
|
52
50
|
day.dateArr = [year, month, date];
|
|
51
|
+
day.type = type;
|
|
53
52
|
return day;
|
|
54
53
|
};
|
|
55
54
|
const getPadCalendarDays = ({ calendarDays, buildDay }) => (flag, count, cur) => {
|
|
@@ -63,10 +62,29 @@ const getPadCalendarDays = ({ calendarDays, buildDay }) => (flag, count, cur) =>
|
|
|
63
62
|
});
|
|
64
63
|
};
|
|
65
64
|
const equalArr = (arr1, arr2) => Array.isArray(arr1) && Array.isArray(arr2) && arr1.join(",") === arr2.join(",");
|
|
66
|
-
const setDayRow = ({ calendarDays, state }) => calendarDays.map((day, i) =>
|
|
65
|
+
const setDayRow = ({ calendarDays, state }) => calendarDays.map((day, i) => {
|
|
66
|
+
day.row = Math.floor(i / state.dayOfWeek);
|
|
67
|
+
if (day.isCur) {
|
|
68
|
+
state.activeRow = day.row;
|
|
69
|
+
state.activeDate = day.dateStr;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
67
72
|
const pad0 = (str, n = 2) => String(str).padStart(n, "0");
|
|
68
|
-
const
|
|
69
|
-
|
|
73
|
+
const getDate = (state, type, date) => {
|
|
74
|
+
let resDate = /* @__PURE__ */ new Date();
|
|
75
|
+
if (type === "last") {
|
|
76
|
+
const { year, month } = lastMonth(state.currentYear, state.currentMonth);
|
|
77
|
+
resDate = /* @__PURE__ */ new Date(`${year}-${month}-01`);
|
|
78
|
+
} else if (type === "next") {
|
|
79
|
+
const { year, month } = nextMonth(state.currentYear, state.currentMonth);
|
|
80
|
+
resDate = /* @__PURE__ */ new Date(`${year}-${month}-01`);
|
|
81
|
+
} else {
|
|
82
|
+
resDate = normalDate(date);
|
|
83
|
+
}
|
|
84
|
+
return resDate;
|
|
85
|
+
};
|
|
86
|
+
const getCalendarDays = (state) => (date, config, type = "cur") => {
|
|
87
|
+
date = getDate(state, type, date);
|
|
70
88
|
let { weekFirst, disabled, holiday, workday, mark } = normalConfig(config, state);
|
|
71
89
|
const { todayFullYear, todayMonth, todayDate, currentFullYear, currentMonth, currentDate } = splitDate(date);
|
|
72
90
|
const isToday = (year, month, date2) => year === todayFullYear && month === todayMonth && date2 === todayDate;
|
|
@@ -76,7 +94,7 @@ const getCalendarDays = (state) => (date, config) => {
|
|
|
76
94
|
const f = (arr) => arr[0];
|
|
77
95
|
const l = (arr) => arr[arr.length - 1];
|
|
78
96
|
const { dayOfWeek } = state;
|
|
79
|
-
const args = { pad0, isCurrent, currentFullYear, currentMonth, holiday, workday, mark };
|
|
97
|
+
const args = { pad0, isCurrent, currentFullYear, currentMonth, holiday, workday, mark, type };
|
|
80
98
|
Object.assign(args, { currentDate, isToday, disabled, dayOfWeek });
|
|
81
99
|
const buildDay = getBuildDay(args);
|
|
82
100
|
const calendarDays = Array.from({ length: monthDays[currentMonth] }).map(
|
|
@@ -90,29 +108,107 @@ const getCalendarDays = (state) => (date, config) => {
|
|
|
90
108
|
padCalendarDays("s", count, new Date(f(calendarDays).dateStr));
|
|
91
109
|
count = monthDaysLast !== l(weekDays) ? dayOfWeek - 1 - weekDays.indexOf(monthDaysLast) : dayOfWeek;
|
|
92
110
|
padCalendarDays("e", count, new Date(l(calendarDays).dateStr));
|
|
111
|
+
setCalendarDays(state, type, calendarDays);
|
|
112
|
+
if (type !== "cur")
|
|
113
|
+
return;
|
|
93
114
|
setDayRow({ calendarDays, state });
|
|
94
115
|
if (!equalArr(state.weekDays, weekDays)) {
|
|
95
116
|
state.weekDays = weekDays;
|
|
96
117
|
}
|
|
97
|
-
state.
|
|
98
|
-
state.
|
|
99
|
-
state.
|
|
100
|
-
state.currentDate = `${currentDate}`;
|
|
118
|
+
state.currentYear = currentFullYear;
|
|
119
|
+
state.currentMonth = currentMonth;
|
|
120
|
+
state.currentDate = currentDate;
|
|
101
121
|
state.cascaderCurrent = [currentFullYear, currentMonth];
|
|
102
122
|
};
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
const setCalendarDays = (state, type, calendarDays) => {
|
|
124
|
+
if (type === "last") {
|
|
125
|
+
state.lastCalendarDays = calendarDays;
|
|
126
|
+
} else if (type === "next") {
|
|
127
|
+
state.nextCalendarDays = calendarDays;
|
|
128
|
+
} else {
|
|
129
|
+
state.calendarDays = calendarDays;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const getPrevWeek = ({ props, emit, state, api }) => () => {
|
|
133
|
+
let newPrevDate = new Date(state.weekDates[0].dateStr);
|
|
134
|
+
newPrevDate.setDate(newPrevDate.getDate() - 7);
|
|
135
|
+
state.weekDates = api.getAllDatesOfCurrWeek(new Date(newPrevDate));
|
|
136
|
+
setActiveDate(state, props, emit);
|
|
137
|
+
};
|
|
138
|
+
const getNextWeek = ({ props, emit, state, api }) => () => {
|
|
139
|
+
let newNextDate = new Date(state.weekDates[6].dateStr);
|
|
140
|
+
newNextDate.setDate(newNextDate.getDate() + 7);
|
|
141
|
+
state.weekDates = api.getAllDatesOfCurrWeek(new Date(newNextDate));
|
|
142
|
+
setActiveDate(state, props, emit);
|
|
143
|
+
};
|
|
144
|
+
const setActiveDate = (state, props, emit) => {
|
|
145
|
+
state.weekDates.forEach((day2) => day2.isCur = false);
|
|
146
|
+
const day = new Date(props.modelValue).getDay();
|
|
147
|
+
const dayIdx = state.weekDays.indexOf(day);
|
|
148
|
+
const curDate = state.weekDates[dayIdx];
|
|
149
|
+
curDate.isCur = true;
|
|
150
|
+
emit("update:modelValue", curDate.dateStr);
|
|
151
|
+
state.activeDate = curDate.dateStr;
|
|
152
|
+
state.currentDate = curDate.dateArr[2];
|
|
153
|
+
state.activeRow = curDate.row;
|
|
154
|
+
};
|
|
155
|
+
const getAllDatesOfCurrWeek = ({ state, props }) => (date) => {
|
|
156
|
+
const weekFirst = getWeekFirst(state, props);
|
|
157
|
+
const weekDates = [];
|
|
158
|
+
let weekDate = new Date(date);
|
|
159
|
+
const calDate = weekDate.getDate() - weekDate.getDay() + weekFirst;
|
|
160
|
+
const weekFirstDate = calDate > weekDate.getDate() ? calDate - 7 : calDate;
|
|
161
|
+
weekDate.setDate(weekFirstDate);
|
|
162
|
+
const threeMonthDays = [...state.calendarDays, ...state.lastCalendarDays, ...state.nextCalendarDays];
|
|
163
|
+
const len = threeMonthDays.length;
|
|
164
|
+
for (let i = 0; i < 7; i++) {
|
|
165
|
+
const date2 = formatDate(new Date(weekDate));
|
|
166
|
+
let findDate = false;
|
|
167
|
+
for (let j = 0; j < len; j++) {
|
|
168
|
+
if (threeMonthDays[j].dateStr === date2) {
|
|
169
|
+
threeMonthDays[j].type = "cur";
|
|
170
|
+
weekDates.push(threeMonthDays[j]);
|
|
171
|
+
findDate = true;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (!findDate) {
|
|
176
|
+
const newDate = new Date(weekDate);
|
|
177
|
+
weekDates.push({ dateStr: date2, dateArr: [newDate.getFullYear(), newDate.getMonth() + 1, newDate.getDate()] });
|
|
178
|
+
}
|
|
179
|
+
weekDate.setDate(weekDate.getDate() + 1);
|
|
180
|
+
}
|
|
181
|
+
return weekDates;
|
|
182
|
+
};
|
|
183
|
+
const getWeekOfDate = ({ api }) => (type, date) => {
|
|
184
|
+
const aWeekTimestamp = 7 * 24 * 60 * 60 * 1e3;
|
|
185
|
+
let nextDate = +new Date(date);
|
|
186
|
+
if (type === "prev") {
|
|
187
|
+
nextDate = +new Date(date) - aWeekTimestamp;
|
|
188
|
+
} else {
|
|
189
|
+
nextDate = +new Date(date) + aWeekTimestamp;
|
|
190
|
+
}
|
|
191
|
+
return api.getAllDatesOfCurrWeek(new Date(nextDate));
|
|
192
|
+
};
|
|
193
|
+
const showWeekChange = ({ state }) => (value) => {
|
|
194
|
+
if (value) {
|
|
195
|
+
state.weekDates = state.calendarDays.filter((day) => day.row === state.activeRow);
|
|
196
|
+
} else {
|
|
197
|
+
state.calendarDays.forEach((date) => {
|
|
198
|
+
if (state.activeDate === date.dateStr) {
|
|
199
|
+
date.isCur = true;
|
|
200
|
+
} else {
|
|
201
|
+
date.isCur = false;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
111
204
|
}
|
|
112
205
|
};
|
|
206
|
+
const formatDate = (date) => {
|
|
207
|
+
const newDate = new Date(date);
|
|
208
|
+
return newDate.getFullYear() + "-" + pad0(newDate.getMonth() + 1) + "-" + pad0(newDate.getDate());
|
|
209
|
+
};
|
|
113
210
|
const computedCurrentRow = (state) => () => {
|
|
114
211
|
const { calendarDays } = state;
|
|
115
|
-
setStackRows(state);
|
|
116
212
|
if (Array.isArray(calendarDays) && calendarDays.length) {
|
|
117
213
|
const currentDay = calendarDays.find((day) => day.isCur);
|
|
118
214
|
if (currentDay) {
|
|
@@ -121,6 +217,13 @@ const computedCurrentRow = (state) => () => {
|
|
|
121
217
|
}
|
|
122
218
|
return null;
|
|
123
219
|
};
|
|
220
|
+
const computedData = (state) => () => {
|
|
221
|
+
if (state.showWeek) {
|
|
222
|
+
return [state.prevWeekDates, state.weekDates, state.nextWeekDates];
|
|
223
|
+
} else {
|
|
224
|
+
return [state.lastCalendarDays, state.calendarDays, state.nextCalendarDays];
|
|
225
|
+
}
|
|
226
|
+
};
|
|
124
227
|
const computedFilteredCalendarDays = (state) => () => {
|
|
125
228
|
const { calendarDays, currentRow, visibleRows } = state;
|
|
126
229
|
if (Array.isArray(calendarDays) && calendarDays.length && currentRow !== null) {
|
|
@@ -129,23 +232,27 @@ const computedFilteredCalendarDays = (state) => () => {
|
|
|
129
232
|
}
|
|
130
233
|
return [];
|
|
131
234
|
};
|
|
132
|
-
const
|
|
133
|
-
const fillVisibleRows = (state) => state.visibleRows = [...new Set((state.calendarDays || []).map((day) => day.row))];
|
|
134
|
-
const handleDraggerClick = (state) => () => {
|
|
135
|
-
const { visibleRows } = state;
|
|
235
|
+
const handleDraggerClick = (state, emit) => () => {
|
|
136
236
|
if (state.dragging)
|
|
137
237
|
return;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
} else {
|
|
141
|
-
fillVisibleRows(state);
|
|
142
|
-
}
|
|
238
|
+
state.showWeek = !state.showWeek;
|
|
239
|
+
emit("expand", !state.showWeek);
|
|
143
240
|
};
|
|
144
|
-
const handleClickDay = ({ api, emit, props }) => (day) => {
|
|
241
|
+
const handleClickDay = ({ api, emit, props, state }) => (day) => {
|
|
145
242
|
if (day.isCur || day.disabled)
|
|
146
243
|
return;
|
|
147
244
|
if (typeof day.dateStr === "string") {
|
|
148
|
-
|
|
245
|
+
const isCurrent = day.dateArr[0] === +state.currentYear && day.dateArr[1] === +state.currentMonth;
|
|
246
|
+
if (!isCurrent) {
|
|
247
|
+
api.getCalendarDays(day.dateStr, props.config, "cur");
|
|
248
|
+
api.getCalendarDays(day.dateStr, props.config, "last");
|
|
249
|
+
api.getCalendarDays(day.dateStr, props.config, "next");
|
|
250
|
+
}
|
|
251
|
+
const showCalendarDays = [...state.calendarDays, ...state.weekDates];
|
|
252
|
+
showCalendarDays.forEach((date) => date.isCur = day.dateStr === date.dateStr);
|
|
253
|
+
state.activeDate = day.dateStr;
|
|
254
|
+
state.currentDate = day.dateArr[2];
|
|
255
|
+
state.activeRow = day.row;
|
|
149
256
|
emit("update:modelValue", day.dateStr);
|
|
150
257
|
}
|
|
151
258
|
};
|
|
@@ -158,36 +265,70 @@ const calcCalendarItemHeight = ({ state, vm }) => () => {
|
|
|
158
265
|
}
|
|
159
266
|
};
|
|
160
267
|
const computedTotalRows = (state) => () => {
|
|
268
|
+
const len = state.dragging ? state.calendarDaysCopy.length : calendarDays.length;
|
|
161
269
|
const { calendarDays, dayOfWeek } = state;
|
|
162
|
-
const total = Math.floor(
|
|
270
|
+
const total = Math.floor(len / dayOfWeek);
|
|
163
271
|
return total;
|
|
164
272
|
};
|
|
165
|
-
const dragStart = ({ state,
|
|
166
|
-
state.
|
|
273
|
+
const dragStart = ({ state, clientX, clientY, vm }) => {
|
|
274
|
+
state.showRows = 0;
|
|
275
|
+
state.calendarDaysCopy = state.calendarDays.slice(0);
|
|
167
276
|
state.calendarPanelHeight = vm.$refs.calendarPanel.offsetHeight;
|
|
168
|
-
state.
|
|
277
|
+
state.dragPosStart = state.dragPos = { clientX, clientY };
|
|
169
278
|
};
|
|
170
|
-
const dragEnd = ({ state, vm, clientY }) => {
|
|
279
|
+
const dragEnd = ({ state, vm, clientY, emit }) => {
|
|
171
280
|
const dy = clientY - state.dragPosStart.clientY;
|
|
281
|
+
if (dy === 0)
|
|
282
|
+
return;
|
|
172
283
|
state.dragPosStart = state.dragPos = {};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
284
|
+
if (state.showWeek) {
|
|
285
|
+
if (state.showRows >= 2) {
|
|
286
|
+
state.showWeek = false;
|
|
287
|
+
}
|
|
288
|
+
} else {
|
|
289
|
+
if (state.showRows <= 5) {
|
|
290
|
+
state.showWeek = true;
|
|
291
|
+
}
|
|
178
292
|
}
|
|
293
|
+
emit("expand", !state.showWeek);
|
|
294
|
+
state.weekDates = state.copyWeekDates;
|
|
295
|
+
state.calendarDays = state.calendarDaysCopy;
|
|
296
|
+
vm.$refs.calendarPanel.style.height = "auto";
|
|
297
|
+
state.showRows = 0;
|
|
179
298
|
};
|
|
180
299
|
const dragMove = ({ state, vm, clientX, clientY }) => {
|
|
181
|
-
const { dragPos: lastPos, itemHeight
|
|
300
|
+
const { dragPos: lastPos, itemHeight } = state;
|
|
301
|
+
const totalRows = 6;
|
|
302
|
+
if (lastPos.clientY === void 0 || lastPos.clientX === void 0) {
|
|
303
|
+
state.dragging = false;
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
182
306
|
const minH = itemHeight;
|
|
183
307
|
const maxH = itemHeight * totalRows;
|
|
184
308
|
state.dragPos = { clientX, clientY };
|
|
185
309
|
state.calendarPanelHeight += clientY - lastPos.clientY;
|
|
186
310
|
let h = state.calendarPanelHeight;
|
|
187
311
|
h = h < minH ? minH : h > maxH ? maxH : h;
|
|
188
|
-
|
|
312
|
+
state.showRows = Math.floor(h / itemHeight);
|
|
189
313
|
vm.$refs.calendarPanel.style.height = `${h}px`;
|
|
190
|
-
|
|
314
|
+
if (state.showWeek) {
|
|
315
|
+
if (state.showRows === 1) {
|
|
316
|
+
state.weekDates = [...state.copyWeekDates];
|
|
317
|
+
}
|
|
318
|
+
if (state.showRows === 2) {
|
|
319
|
+
state.weekDates = [...state.prevWeekDates, ...state.copyWeekDates];
|
|
320
|
+
}
|
|
321
|
+
if (state.showRows === 3) {
|
|
322
|
+
state.weekDates = [...state.prevWeekDates, ...state.copyWeekDates, ...state.nextWeekDates];
|
|
323
|
+
}
|
|
324
|
+
} else {
|
|
325
|
+
getShowedCalendarDays(state);
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
const getShowedCalendarDays = (state) => {
|
|
329
|
+
if (state.showRows === 0)
|
|
330
|
+
return;
|
|
331
|
+
state.calendarDays = state.calendarDaysCopy.slice(0, state.showRows * 7);
|
|
191
332
|
};
|
|
192
333
|
const handleDraggerMousedown = ({ api, state, vm }) => (e) => {
|
|
193
334
|
const { clientX, clientY } = e;
|
|
@@ -195,11 +336,11 @@ const handleDraggerMousedown = ({ api, state, vm }) => (e) => {
|
|
|
195
336
|
document.addEventListener("mouseup", api.handleMouseup);
|
|
196
337
|
document.addEventListener("mousemove", api.throttledHandleMousemove);
|
|
197
338
|
};
|
|
198
|
-
const handleMouseup = ({ api, state, vm }) => (e) => {
|
|
339
|
+
const handleMouseup = ({ api, state, vm, emit }) => (e) => {
|
|
199
340
|
setTimeout(() => state.dragging = false);
|
|
200
341
|
document.removeEventListener("mouseup", api.handleMouseup);
|
|
201
342
|
document.removeEventListener("mousemove", api.throttledHandleMousemove);
|
|
202
|
-
dragEnd({ state, vm, clientY: e.clientY });
|
|
343
|
+
dragEnd({ state, vm, clientY: e.clientY, emit });
|
|
203
344
|
};
|
|
204
345
|
const handleMousemove = ({ state, vm }) => (e) => {
|
|
205
346
|
state.dragging = true;
|
|
@@ -211,10 +352,10 @@ const handleDraggerTouchstart = ({ state, vm }) => (e) => {
|
|
|
211
352
|
state.touching = true;
|
|
212
353
|
dragStart({ state, vm, clientX, clientY });
|
|
213
354
|
};
|
|
214
|
-
const handleDraggerTouchend = ({ state, vm }) => (e) => {
|
|
355
|
+
const handleDraggerTouchend = ({ state, vm, emit }) => (e) => {
|
|
215
356
|
const { clientY } = e.changedTouches[0];
|
|
216
357
|
state.touching = false;
|
|
217
|
-
dragEnd({ state, vm, clientY });
|
|
358
|
+
dragEnd({ state, vm, clientY, emit });
|
|
218
359
|
};
|
|
219
360
|
const handleDraggerTouchmove = ({ state, vm }) => (e) => {
|
|
220
361
|
const { clientX, clientY } = e.changedTouches[0];
|
|
@@ -222,15 +363,12 @@ const handleDraggerTouchmove = ({ state, vm }) => (e) => {
|
|
|
222
363
|
};
|
|
223
364
|
const setCascaderVisible = (state) => (value) => state.cascaderVisible = !!value;
|
|
224
365
|
const handleCascaderChange = ({ api, emit, props, state }) => (val) => {
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
if (curYear !== val[0] || curMonth !== val[1] || curDate !== numberCurrentDate) {
|
|
230
|
-
dateStr = `${val[0]}-${pad0(val[1])}-01`;
|
|
231
|
-
}
|
|
232
|
-
api.getCalendarDays(dateStr, props.config);
|
|
366
|
+
const dateStr = getDateStr(state, val[0], val[1]);
|
|
367
|
+
api.getCalendarDays(dateStr, props.config, "cur");
|
|
368
|
+
api.getCalendarDays(dateStr, props.config, "last");
|
|
369
|
+
api.getCalendarDays(dateStr, props.config, "next");
|
|
233
370
|
emit("update:modelValue", dateStr);
|
|
371
|
+
state.weekDates = state.calendarDays.filter((day) => day.row === state.activeRow);
|
|
234
372
|
};
|
|
235
373
|
const computeCascaderOptions = (t) => () => [
|
|
236
374
|
{
|
|
@@ -247,13 +385,97 @@ const i18nYearMonth = ({ state, t }) => () => {
|
|
|
247
385
|
template = template.replace("%m", monthAbbr);
|
|
248
386
|
return template;
|
|
249
387
|
};
|
|
388
|
+
const touchmove = ({ state }) => (event) => {
|
|
389
|
+
const touch = event.touches[0];
|
|
390
|
+
state.deltaPos.Y = touch.clientY - state.startPos.Y;
|
|
391
|
+
state.deltaPos.X = touch.clientX - state.startPos.X;
|
|
392
|
+
state.offsetPos.Y = Math.abs(state.deltaPos.Y);
|
|
393
|
+
state.offsetPos.X = Math.abs(state.deltaPos.X);
|
|
394
|
+
state.direction = getDirection(state.offsetPos.X, state.offsetPos.Y);
|
|
395
|
+
if (state.direction === "vertical")
|
|
396
|
+
return;
|
|
397
|
+
state.delta = state.deltaPos.X;
|
|
398
|
+
};
|
|
399
|
+
const touchstart = ({ state }) => (event) => {
|
|
400
|
+
event.stopPropagation();
|
|
401
|
+
resetTouchStatus(state);
|
|
402
|
+
state.duration = 300;
|
|
403
|
+
state.moving = true;
|
|
404
|
+
state.touchTime = Date.now();
|
|
405
|
+
state.startPos.X = event.touches[0].clientX;
|
|
406
|
+
state.startPos.Y = event.touches[0].clientY;
|
|
407
|
+
};
|
|
408
|
+
const touchend = ({ state, api, vm }) => () => {
|
|
409
|
+
const weekPanel = vm.$refs.weekPanel;
|
|
410
|
+
const width = weekPanel && weekPanel.offsetWidth;
|
|
411
|
+
const speed = state.delta / (Date.now() - state.touchTime);
|
|
412
|
+
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(state.delta) > +(width / 3).toFixed(2);
|
|
413
|
+
if (isShouldMove) {
|
|
414
|
+
const delta = state.delta;
|
|
415
|
+
state.duration = 300;
|
|
416
|
+
state.delta = delta > 0 ? width : -width;
|
|
417
|
+
setTimeout(() => {
|
|
418
|
+
if (state.showWeek) {
|
|
419
|
+
delta > 0 ? api.getPrevWeek() : api.getNextWeek();
|
|
420
|
+
if (state.weekDates[3].dateArr[0] !== +state.currentYear || state.weekDates[3].dateArr[1] !== +state.currentMonth) {
|
|
421
|
+
api.updateCalendarDays(delta);
|
|
422
|
+
}
|
|
423
|
+
} else {
|
|
424
|
+
api.updateCalendarDays(delta);
|
|
425
|
+
}
|
|
426
|
+
state.duration = 0;
|
|
427
|
+
state.delta = 0;
|
|
428
|
+
}, 300);
|
|
429
|
+
} else {
|
|
430
|
+
state.delta = 0;
|
|
431
|
+
}
|
|
432
|
+
state.moving = false;
|
|
433
|
+
};
|
|
434
|
+
const updateCalendarDays = ({ props, state, api, emit }) => (delta) => {
|
|
435
|
+
let { year, month } = delta > 0 ? lastMonth(state.currentYear, state.currentMonth) : nextMonth(state.currentYear, state.currentMonth);
|
|
436
|
+
const dateStr = getDateStr(state, year, month);
|
|
437
|
+
api.getCalendarDays(dateStr, props.config, "cur");
|
|
438
|
+
api.getCalendarDays(dateStr, props.config, "last");
|
|
439
|
+
api.getCalendarDays(dateStr, props.config, "next");
|
|
440
|
+
!state.showWeek && emit("update:modelValue", dateStr);
|
|
441
|
+
};
|
|
442
|
+
function getDateStr(state, year, month) {
|
|
443
|
+
const { currentDate } = state;
|
|
444
|
+
let dateStr = `${year}-${pad0(month)}-${pad0(currentDate)}`;
|
|
445
|
+
const numberCurrentDate = Number(currentDate);
|
|
446
|
+
const { currentFullYear: curYear, currentMonth: curMonth, currentDate: curDate } = splitDate(new Date(dateStr));
|
|
447
|
+
if (curYear !== year || curMonth !== month || curDate !== numberCurrentDate) {
|
|
448
|
+
dateStr = `${year}-${pad0(month)}-01`;
|
|
449
|
+
}
|
|
450
|
+
return dateStr;
|
|
451
|
+
}
|
|
452
|
+
function getWeekFirst(state, props) {
|
|
453
|
+
let weekFirst = props.config.weekFirst || 0;
|
|
454
|
+
const minWeekFirst = 0;
|
|
455
|
+
const maxWeekFirst = state.dayOfWeek - 1;
|
|
456
|
+
weekFirst = typeof weekFirst === "number" && weekFirst >= minWeekFirst && weekFirst <= maxWeekFirst ? Math.round(weekFirst) : minWeekFirst;
|
|
457
|
+
return weekFirst;
|
|
458
|
+
}
|
|
459
|
+
function resetTouchStatus(state) {
|
|
460
|
+
state.direction = "";
|
|
461
|
+
state.delta = 0;
|
|
462
|
+
state.deltaPos.X = 0;
|
|
463
|
+
state.deltaPos.Y = 0;
|
|
464
|
+
state.offsetPos.X = 0;
|
|
465
|
+
state.offsetPos.Y = 0;
|
|
466
|
+
}
|
|
250
467
|
export {
|
|
251
468
|
calcCalendarItemHeight,
|
|
252
469
|
computeCascaderOptions,
|
|
253
470
|
computedCurrentRow,
|
|
471
|
+
computedData,
|
|
254
472
|
computedFilteredCalendarDays,
|
|
255
473
|
computedTotalRows,
|
|
474
|
+
getAllDatesOfCurrWeek,
|
|
256
475
|
getCalendarDays,
|
|
476
|
+
getNextWeek,
|
|
477
|
+
getPrevWeek,
|
|
478
|
+
getWeekOfDate,
|
|
257
479
|
handleCascaderChange,
|
|
258
480
|
handleClickDay,
|
|
259
481
|
handleDraggerClick,
|
|
@@ -264,5 +486,10 @@ export {
|
|
|
264
486
|
handleMousemove,
|
|
265
487
|
handleMouseup,
|
|
266
488
|
i18nYearMonth,
|
|
267
|
-
setCascaderVisible
|
|
489
|
+
setCascaderVisible,
|
|
490
|
+
showWeekChange,
|
|
491
|
+
touchend,
|
|
492
|
+
touchmove,
|
|
493
|
+
touchstart,
|
|
494
|
+
updateCalendarDays
|
|
268
495
|
};
|