element-ps 2.0.37 → 2.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +448 -327
- package/dist/index.full.min.js +8 -8
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +448 -327
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/es/components/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +19 -82
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +82 -19
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/alert/index.mjs +2 -2
- package/es/components/alert/src/alert.mjs +33 -83
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +83 -33
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/autocomplete/index.d.ts +5 -5
- package/es/components/autocomplete/index.mjs +2 -2
- package/es/components/autocomplete/src/autocomplete.mjs +94 -58
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
- package/es/components/autocomplete/src/autocomplete2.mjs +58 -94
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/avatar/index.mjs +2 -2
- package/es/components/avatar/src/avatar.mjs +61 -29
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar2.mjs +29 -61
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +4 -4
- package/es/components/breadcrumb/src/breadcrumb-item.mjs +46 -11
- package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -46
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb.mjs +12 -37
- package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb2.mjs +37 -12
- package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
- package/es/components/button/index.mjs +2 -2
- package/es/components/button/src/button-group.mjs +1 -1
- package/es/components/button/src/button.mjs +48 -96
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +96 -48
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/calendar/index.mjs +2 -2
- package/es/components/calendar/src/calendar.mjs +9 -188
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +188 -9
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/calendar/src/date-table.mjs +146 -27
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table2.mjs +27 -146
- package/es/components/calendar/src/date-table2.mjs.map +1 -1
- package/es/components/card/index.mjs +2 -2
- package/es/components/card/src/card.mjs +15 -35
- package/es/components/card/src/card.mjs.map +1 -1
- package/es/components/card/src/card2.mjs +35 -15
- package/es/components/card/src/card2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +4 -4
- package/es/components/carousel/src/carousel-item.mjs +148 -7
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +7 -148
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/carousel/src/carousel.mjs +201 -43
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel2.mjs +43 -201
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +7 -20
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +20 -7
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/collection/index.mjs +1 -1
- package/es/components/collection/src/collection.mjs +10 -30
- package/es/components/collection/src/collection.mjs.map +1 -1
- package/es/components/collection/src/collection2.mjs +30 -10
- package/es/components/collection/src/collection2.mjs.map +1 -1
- package/es/components/dialog/index.mjs +2 -2
- package/es/components/dialog/src/dialog.mjs +87 -61
- package/es/components/dialog/src/dialog.mjs.map +1 -1
- package/es/components/dialog/src/dialog2.mjs +61 -87
- package/es/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +23 -117
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +117 -23
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/index.d.ts +3 -3
- package/es/components/dropdown/src/dropdown.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/dropdown/src/dropdown.vue.d.ts +3 -3
- package/es/components/form/index.mjs +4 -4
- package/es/components/form/src/form-item.mjs +46 -171
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/form/src/form-item2.mjs +171 -46
- package/es/components/form/src/form-item2.mjs.map +1 -1
- package/es/components/form/src/form.mjs +40 -45
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form2.mjs +45 -40
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/icon/index.mjs +2 -2
- package/es/components/icon/src/icon.mjs +8 -35
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +35 -8
- package/es/components/icon/src/icon2.mjs.map +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +127 -50
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +50 -127
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +210 -31
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +31 -210
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +34 -34
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +43 -19
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +19 -43
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/menu/index.d.ts +3 -3
- package/es/components/menu/index.mjs +4 -4
- package/es/components/menu/src/menu-item-group.mjs +4 -35
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +35 -4
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/menu/src/menu-item.mjs +74 -15
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +15 -74
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/menu/src/menu.d.ts +4 -4
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +55 -14
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +14 -55
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/components/popover/index.d.ts +6 -6
- package/es/components/popover/src/index.vue.d.ts +3 -3
- package/es/components/popover/src/popover.d.ts +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/content.mjs +52 -64
- package/es/components/popper/src/content.mjs.map +1 -1
- package/es/components/popper/src/content2.mjs +64 -52
- package/es/components/popper/src/content2.mjs.map +1 -1
- package/es/components/progress/index.mjs +2 -2
- package/es/components/progress/src/progress.mjs +230 -57
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +57 -230
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-button.mjs +80 -9
- package/es/components/radio/src/radio-button.mjs.map +1 -1
- package/es/components/radio/src/radio-button2.mjs +9 -80
- package/es/components/radio/src/radio-button2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +73 -28
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +28 -73
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/roving-focus-group/index.mjs +3 -3
- package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -29
- package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs +29 -27
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
- package/es/components/scrollbar/src/bar.mjs +35 -22
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +22 -35
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
- package/es/components/select/index.d.ts +5 -5
- package/es/components/select/src/select.vue.d.ts +5 -5
- package/es/components/select/src/useSelect.d.ts +5 -5
- package/es/components/select-v2/index.d.ts +10 -10
- package/es/components/select-v2/src/option-item.vue.d.ts +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +5 -5
- package/es/components/select-v2/src/useSelect.d.ts +5 -5
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton.mjs +49 -22
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +22 -49
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +81 -176
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +176 -81
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/index.d.ts +39 -86
- package/es/components/table/src/config.mjs +3 -0
- package/es/components/table/src/config.mjs.map +1 -1
- package/es/components/table/src/filter-panel.mjs +8 -1
- package/es/components/table/src/filter-panel.mjs.map +1 -1
- package/es/components/table/src/filter-panel.vue.d.ts +5 -5
- package/es/components/table/src/store/current.mjs +14 -12
- package/es/components/table/src/store/current.mjs.map +1 -1
- package/es/components/table/src/store/helper.mjs +5 -1
- package/es/components/table/src/store/helper.mjs.map +1 -1
- package/es/components/table/src/store/index.mjs +9 -9
- package/es/components/table/src/store/index.mjs.map +1 -1
- package/es/components/table/src/store/watcher.mjs +11 -1
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table/defaults.d.ts +8 -4
- package/es/components/table/src/table/defaults.mjs +3 -4
- package/es/components/table/src/table/defaults.mjs.map +1 -1
- package/es/components/table/src/table/style-helper.d.ts +24 -34
- package/es/components/table/src/table/style-helper.mjs +107 -120
- package/es/components/table/src/table/style-helper.mjs.map +1 -1
- package/es/components/table/src/table/utils-helper.d.ts +1 -1
- package/es/components/table/src/table/utils-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/events-helper.d.ts +1 -3
- package/es/components/table/src/table-body/events-helper.mjs +3 -3
- package/es/components/table/src/table-body/events-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/index.mjs +1 -5
- package/es/components/table/src/table-body/index.mjs.map +1 -1
- package/es/components/table/src/table-body/render-helper.mjs +6 -3
- package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/styles-helper.d.ts +1 -1
- package/es/components/table/src/table-body/styles-helper.mjs +3 -3
- package/es/components/table/src/table-body/styles-helper.mjs.map +1 -1
- package/es/components/table/src/table-column/render-helper.mjs +4 -2
- package/es/components/table/src/table-column/render-helper.mjs.map +1 -1
- package/es/components/table/src/table-header/event-helper.mjs +5 -9
- package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
- package/es/components/table/src/table-header/index.mjs +1 -2
- package/es/components/table/src/table-header/index.mjs.map +1 -1
- package/es/components/table/src/table-header/style.helper.mjs +2 -2
- package/es/components/table/src/table-header/style.helper.mjs.map +1 -1
- package/es/components/table/src/table-layout.d.ts +1 -6
- package/es/components/table/src/table-layout.mjs +0 -64
- package/es/components/table/src/table-layout.mjs.map +1 -1
- package/es/components/table/src/table.mjs +31 -35
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +39 -86
- package/es/components/table/src/util.d.ts +7 -7
- package/es/components/table/src/util.mjs +68 -52
- package/es/components/table/src/util.mjs.map +1 -1
- package/es/components/table-v2/src/components/header.d.ts +1 -1
- package/es/components/table-v2/src/table-grid.d.ts +1 -1
- package/es/components/table-v2/src/table-v2.d.ts +1 -1
- package/es/components/tabs/index.mjs +2 -2
- package/es/components/tabs/src/tab-pane.mjs +61 -15
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +15 -61
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/teleport/index.mjs +2 -2
- package/es/components/teleport/src/teleport.mjs +18 -43
- package/es/components/teleport/src/teleport.mjs.map +1 -1
- package/es/components/teleport/src/teleport2.mjs +43 -18
- package/es/components/teleport/src/teleport2.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +5 -5
- package/es/components/tooltip/index.d.ts +3 -3
- package/es/components/tooltip/src/tooltip.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +3 -3
- package/es/components/tooltip/src/trigger.vue.d.ts +3 -3
- package/es/components/tooltip-v2/index.mjs +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
- package/es/components/tooltip-v2/src/trigger.mjs +89 -11
- package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
- package/es/components/tooltip-v2/src/trigger2.mjs +11 -89
- package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
- package/es/components/upload/index.mjs +4 -4
- package/es/components/upload/src/upload-content.mjs +15 -46
- package/es/components/upload/src/upload-content.mjs.map +1 -1
- package/es/components/upload/src/upload-content2.mjs +46 -15
- package/es/components/upload/src/upload-content2.mjs.map +1 -1
- package/es/components/upload/src/upload-list.mjs +155 -26
- package/es/components/upload/src/upload-list.mjs.map +1 -1
- package/es/components/upload/src/upload-list2.mjs +26 -155
- package/es/components/upload/src/upload-list2.mjs.map +1 -1
- package/es/components/upload/src/upload.mjs +99 -106
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +106 -99
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/index.mjs +34 -34
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +19 -82
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +82 -19
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/alert/index.js +2 -2
- package/lib/components/alert/src/alert.js +33 -82
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +82 -33
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/autocomplete/index.d.ts +5 -5
- package/lib/components/autocomplete/index.js +2 -2
- package/lib/components/autocomplete/src/autocomplete.js +94 -58
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
- package/lib/components/autocomplete/src/autocomplete2.js +58 -94
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/avatar/index.js +2 -2
- package/lib/components/avatar/src/avatar.js +61 -29
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar2.js +29 -61
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +4 -4
- package/lib/components/breadcrumb/src/breadcrumb-item.js +46 -11
- package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -46
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb.js +12 -37
- package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb2.js +37 -12
- package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
- package/lib/components/button/index.js +2 -2
- package/lib/components/button/src/button-group.js +1 -1
- package/lib/components/button/src/button.js +50 -96
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button2.js +96 -50
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/calendar/index.js +2 -2
- package/lib/components/calendar/src/calendar.js +9 -192
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +192 -9
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/calendar/src/date-table.js +151 -30
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table2.js +30 -151
- package/lib/components/calendar/src/date-table2.js.map +1 -1
- package/lib/components/card/index.js +2 -2
- package/lib/components/card/src/card.js +15 -35
- package/lib/components/card/src/card.js.map +1 -1
- package/lib/components/card/src/card2.js +35 -15
- package/lib/components/card/src/card2.js.map +1 -1
- package/lib/components/carousel/index.js +4 -4
- package/lib/components/carousel/src/carousel-item.js +148 -7
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +7 -148
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/carousel/src/carousel.js +201 -43
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel2.js +43 -201
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +7 -20
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +20 -7
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/collection/index.js +1 -1
- package/lib/components/collection/src/collection.js +9 -30
- package/lib/components/collection/src/collection.js.map +1 -1
- package/lib/components/collection/src/collection2.js +30 -9
- package/lib/components/collection/src/collection2.js.map +1 -1
- package/lib/components/dialog/index.js +2 -2
- package/lib/components/dialog/src/dialog.js +87 -61
- package/lib/components/dialog/src/dialog.js.map +1 -1
- package/lib/components/dialog/src/dialog2.js +61 -87
- package/lib/components/dialog/src/dialog2.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +23 -117
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +117 -23
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/index.d.ts +3 -3
- package/lib/components/dropdown/src/dropdown.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/dropdown/src/dropdown.vue.d.ts +3 -3
- package/lib/components/form/index.js +4 -4
- package/lib/components/form/src/form-item.js +47 -171
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/form/src/form-item2.js +171 -47
- package/lib/components/form/src/form-item2.js.map +1 -1
- package/lib/components/form/src/form.js +40 -45
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form2.js +45 -40
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/icon/index.js +2 -2
- package/lib/components/icon/src/icon.js +8 -35
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +35 -8
- package/lib/components/icon/src/icon2.js.map +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.js +127 -50
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +50 -127
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +210 -31
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +31 -210
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +34 -34
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +43 -19
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +19 -43
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/menu/index.d.ts +3 -3
- package/lib/components/menu/index.js +4 -4
- package/lib/components/menu/src/menu-item-group.js +4 -35
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +35 -4
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/menu/src/menu-item.js +74 -16
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +16 -74
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/menu/src/menu.d.ts +4 -4
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +55 -14
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +14 -55
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/components/popover/index.d.ts +6 -6
- package/lib/components/popover/src/index.vue.d.ts +3 -3
- package/lib/components/popover/src/popover.d.ts +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/content.js +52 -65
- package/lib/components/popper/src/content.js.map +1 -1
- package/lib/components/popper/src/content2.js +65 -52
- package/lib/components/popper/src/content2.js.map +1 -1
- package/lib/components/progress/index.js +2 -2
- package/lib/components/progress/src/progress.js +230 -57
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/progress/src/progress2.js +57 -230
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-button.js +79 -8
- package/lib/components/radio/src/radio-button.js.map +1 -1
- package/lib/components/radio/src/radio-button2.js +8 -79
- package/lib/components/radio/src/radio-button2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +73 -30
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +30 -73
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/roving-focus-group/index.js +2 -2
- package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -33
- package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group2.js +33 -27
- package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
- package/lib/components/scrollbar/src/bar.js +35 -22
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +22 -35
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +1 -1
- package/lib/components/select/index.d.ts +5 -5
- package/lib/components/select/src/select.vue.d.ts +5 -5
- package/lib/components/select/src/useSelect.d.ts +5 -5
- package/lib/components/select-v2/index.d.ts +10 -10
- package/lib/components/select-v2/src/option-item.vue.d.ts +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +5 -5
- package/lib/components/select-v2/src/useSelect.d.ts +5 -5
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton.js +49 -22
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +22 -49
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +81 -176
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +176 -81
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/index.d.ts +39 -86
- package/lib/components/table/src/config.js +3 -0
- package/lib/components/table/src/config.js.map +1 -1
- package/lib/components/table/src/filter-panel.js +7 -0
- package/lib/components/table/src/filter-panel.js.map +1 -1
- package/lib/components/table/src/filter-panel.vue.d.ts +5 -5
- package/lib/components/table/src/store/current.js +14 -12
- package/lib/components/table/src/store/current.js.map +1 -1
- package/lib/components/table/src/store/helper.js +5 -1
- package/lib/components/table/src/store/helper.js.map +1 -1
- package/lib/components/table/src/store/index.js +8 -8
- package/lib/components/table/src/store/index.js.map +1 -1
- package/lib/components/table/src/store/watcher.js +11 -1
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table/defaults.d.ts +8 -4
- package/lib/components/table/src/table/defaults.js +3 -4
- package/lib/components/table/src/table/defaults.js.map +1 -1
- package/lib/components/table/src/table/style-helper.d.ts +24 -34
- package/lib/components/table/src/table/style-helper.js +106 -119
- package/lib/components/table/src/table/style-helper.js.map +1 -1
- package/lib/components/table/src/table/utils-helper.d.ts +1 -1
- package/lib/components/table/src/table/utils-helper.js.map +1 -1
- package/lib/components/table/src/table-body/events-helper.d.ts +1 -3
- package/lib/components/table/src/table-body/events-helper.js +3 -3
- package/lib/components/table/src/table-body/events-helper.js.map +1 -1
- package/lib/components/table/src/table-body/index.js +0 -4
- package/lib/components/table/src/table-body/index.js.map +1 -1
- package/lib/components/table/src/table-body/render-helper.js +6 -3
- package/lib/components/table/src/table-body/render-helper.js.map +1 -1
- package/lib/components/table/src/table-body/styles-helper.d.ts +1 -1
- package/lib/components/table/src/table-body/styles-helper.js +3 -3
- package/lib/components/table/src/table-body/styles-helper.js.map +1 -1
- package/lib/components/table/src/table-column/render-helper.js +4 -2
- package/lib/components/table/src/table-column/render-helper.js.map +1 -1
- package/lib/components/table/src/table-header/event-helper.js +5 -9
- package/lib/components/table/src/table-header/event-helper.js.map +1 -1
- package/lib/components/table/src/table-header/index.js +1 -2
- package/lib/components/table/src/table-header/index.js.map +1 -1
- package/lib/components/table/src/table-header/style.helper.js +2 -2
- package/lib/components/table/src/table-header/style.helper.js.map +1 -1
- package/lib/components/table/src/table-layout.d.ts +1 -6
- package/lib/components/table/src/table-layout.js +0 -64
- package/lib/components/table/src/table-layout.js.map +1 -1
- package/lib/components/table/src/table.js +31 -35
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +39 -86
- package/lib/components/table/src/util.d.ts +7 -7
- package/lib/components/table/src/util.js +68 -52
- package/lib/components/table/src/util.js.map +1 -1
- package/lib/components/table-v2/src/components/header.d.ts +1 -1
- package/lib/components/table-v2/src/table-grid.d.ts +1 -1
- package/lib/components/table-v2/src/table-v2.d.ts +1 -1
- package/lib/components/tabs/index.js +2 -2
- package/lib/components/tabs/src/tab-pane.js +61 -15
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +15 -61
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/teleport/index.js +2 -2
- package/lib/components/teleport/src/teleport.js +18 -43
- package/lib/components/teleport/src/teleport.js.map +1 -1
- package/lib/components/teleport/src/teleport2.js +43 -18
- package/lib/components/teleport/src/teleport2.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +5 -5
- package/lib/components/tooltip/index.d.ts +3 -3
- package/lib/components/tooltip/src/tooltip.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +3 -3
- package/lib/components/tooltip/src/trigger.vue.d.ts +3 -3
- package/lib/components/tooltip-v2/index.js +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
- package/lib/components/tooltip-v2/src/trigger.js +89 -11
- package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
- package/lib/components/tooltip-v2/src/trigger2.js +11 -89
- package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
- package/lib/components/upload/index.js +4 -4
- package/lib/components/upload/src/upload-content.js +15 -46
- package/lib/components/upload/src/upload-content.js.map +1 -1
- package/lib/components/upload/src/upload-content2.js +46 -15
- package/lib/components/upload/src/upload-content2.js.map +1 -1
- package/lib/components/upload/src/upload-list.js +155 -27
- package/lib/components/upload/src/upload-list.js.map +1 -1
- package/lib/components/upload/src/upload-list2.js +27 -155
- package/lib/components/upload/src/upload-list2.js.map +1 -1
- package/lib/components/upload/src/upload.js +99 -109
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +109 -99
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/index.js +34 -34
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../../../../packages/components/button/src/button.
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useSizeProp } from '@element-ps/hooks'\nimport { buildProps, iconPropType } from '@element-ps/utils'\nimport { Loading } from '@element-plus/icons-vue'\nimport type { ExtractPropTypes } from 'vue'\nimport type button from './button.vue'\n\nexport const buttonTypes = [\n 'default',\n 'primary',\n 'success',\n 'warning',\n 'info',\n 'danger',\n 'text',\n '',\n] as const\nexport const buttonNativeTypes = ['button', 'submit', 'reset'] as const\n\nexport const buttonProps = buildProps({\n size: useSizeProp,\n disabled: Boolean,\n type: {\n type: String,\n values: buttonTypes,\n default: '',\n },\n icon: {\n type: iconPropType,\n default: '',\n },\n nativeType: {\n type: String,\n values: buttonNativeTypes,\n default: 'button',\n },\n loading: Boolean,\n loadingIcon: {\n type: iconPropType,\n default: () => Loading,\n },\n plain: Boolean,\n autofocus: Boolean,\n round: Boolean,\n circle: Boolean,\n color: String,\n dark: Boolean,\n autoInsertSpace: {\n type: Boolean,\n default: undefined,\n },\n} as const)\n\nexport type ButtonProps = ExtractPropTypes<typeof buttonProps>\n\nexport type ButtonType = ButtonProps['type']\nexport type ButtonNativeType = ButtonProps['nativeType']\n\nexport type ButtonInstance = InstanceType<typeof button>\n\nexport interface ButtonConfigContext {\n autoInsertSpace?: boolean\n}\n"],"names":["buildProps","useSizeProp","iconPropType","Loading"],"mappings":";;;;;;;;;;;AAGY,MAAC,WAAW,GAAG;AAC3B,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,MAAM;AACR,EAAE,QAAQ;AACV,EAAE,MAAM;AACR,EAAE,EAAE;AACJ,EAAE;AACU,MAAC,iBAAiB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;AACnD,MAAC,WAAW,GAAGA,gBAAU,CAAC;AACtC,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,WAAW;AACvB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,iBAAY;AACtB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,iBAAiB;AAC7B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAEA,iBAAY;AACtB,IAAI,OAAO,EAAE,MAAMC,gBAAO;AAC1B,GAAG;AACH,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,CAAC;;;;;;"}
|
|
@@ -2,59 +2,105 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var index$3 = require('../../icon/index.js');
|
|
5
7
|
require('../../../hooks/index.js');
|
|
6
|
-
require('../../../
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
require('../../../tokens/index.js');
|
|
9
|
+
var button = require('./button.js');
|
|
10
|
+
var buttonCustom = require('./button-custom.js');
|
|
11
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
+
var button$1 = require('../../../tokens/button.js');
|
|
13
|
+
var index = require('../../../hooks/use-global-config/index.js');
|
|
14
|
+
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
15
|
+
var index$2 = require('../../../hooks/use-common-props/index.js');
|
|
11
16
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
17
|
+
const _hoisted_1 = ["disabled", "autofocus", "type"];
|
|
18
|
+
const __default__ = {
|
|
19
|
+
name: "PsButton"
|
|
20
|
+
};
|
|
21
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
22
|
+
...__default__,
|
|
23
|
+
props: button.buttonProps,
|
|
24
|
+
setup(__props, { expose }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const slots = vue.useSlots();
|
|
27
|
+
const buttonGroupContext = vue.inject(button$1.buttonGroupContextKey, void 0);
|
|
28
|
+
const globalConfig = index.useGlobalConfig("button");
|
|
29
|
+
const ns = index$1.useNamespace("button");
|
|
30
|
+
const _size = index$2.useSize(vue.computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
|
|
31
|
+
const _disabled = index$2.useDisabled();
|
|
32
|
+
const _ref = vue.ref();
|
|
33
|
+
const _type = vue.computed(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
|
|
34
|
+
const autoInsertSpace = vue.computed(() => {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.autoInsertSpace) != null ? _c : false;
|
|
37
|
+
});
|
|
38
|
+
const shouldAddSpace = vue.computed(() => {
|
|
39
|
+
var _a;
|
|
40
|
+
const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
41
|
+
if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
|
|
42
|
+
const slot = defaultSlot[0];
|
|
43
|
+
if ((slot == null ? void 0 : slot.type) === vue.Text) {
|
|
44
|
+
const text = slot.children;
|
|
45
|
+
return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
});
|
|
50
|
+
const buttonStyle = buttonCustom.useButtonCustomStyle(props);
|
|
51
|
+
expose({
|
|
52
|
+
ref: _ref,
|
|
53
|
+
size: _size,
|
|
54
|
+
type: _type,
|
|
55
|
+
disabled: _disabled,
|
|
56
|
+
shouldAddSpace
|
|
57
|
+
});
|
|
58
|
+
return (_ctx, _cache) => {
|
|
59
|
+
return vue.openBlock(), vue.createElementBlock("button", {
|
|
60
|
+
ref_key: "_ref",
|
|
61
|
+
ref: _ref,
|
|
62
|
+
class: vue.normalizeClass([
|
|
63
|
+
vue.unref(ns).b(),
|
|
64
|
+
vue.unref(ns).m(vue.unref(_type)),
|
|
65
|
+
vue.unref(ns).m(vue.unref(_size)),
|
|
66
|
+
vue.unref(ns).is("disabled", vue.unref(_disabled)),
|
|
67
|
+
vue.unref(ns).is("loading", _ctx.loading),
|
|
68
|
+
vue.unref(ns).is("plain", _ctx.plain),
|
|
69
|
+
vue.unref(ns).is("round", _ctx.round),
|
|
70
|
+
vue.unref(ns).is("circle", _ctx.circle)
|
|
71
|
+
]),
|
|
72
|
+
disabled: vue.unref(_disabled) || _ctx.loading,
|
|
73
|
+
autofocus: _ctx.autofocus,
|
|
74
|
+
type: _ctx.nativeType,
|
|
75
|
+
style: vue.normalizeStyle(vue.unref(buttonStyle))
|
|
76
|
+
}, [
|
|
77
|
+
_ctx.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
78
|
+
_ctx.$slots.loading ? vue.renderSlot(_ctx.$slots, "loading", { key: 0 }) : (vue.openBlock(), vue.createBlock(vue.unref(index$3.PsIcon), {
|
|
79
|
+
key: 1,
|
|
80
|
+
class: vue.normalizeClass(vue.unref(ns).is("loading"))
|
|
81
|
+
}, {
|
|
82
|
+
default: vue.withCtx(() => [
|
|
83
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.loadingIcon)))
|
|
84
|
+
]),
|
|
85
|
+
_: 1
|
|
86
|
+
}, 8, ["class"]))
|
|
87
|
+
], 2112)) : _ctx.icon || _ctx.$slots.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.PsIcon), { key: 1 }, {
|
|
88
|
+
default: vue.withCtx(() => [
|
|
89
|
+
_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon), { key: 0 })) : vue.renderSlot(_ctx.$slots, "icon", { key: 1 })
|
|
90
|
+
]),
|
|
91
|
+
_: 3
|
|
92
|
+
})) : vue.createCommentVNode("v-if", true),
|
|
93
|
+
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
94
|
+
key: 2,
|
|
95
|
+
class: vue.normalizeClass({ [vue.unref(ns).em("text", "expand")]: vue.unref(shouldAddSpace) })
|
|
96
|
+
}, [
|
|
97
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
98
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
|
99
|
+
], 14, _hoisted_1);
|
|
100
|
+
};
|
|
54
101
|
}
|
|
55
102
|
});
|
|
103
|
+
var Button = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/button/src/button.vue"]]);
|
|
56
104
|
|
|
57
|
-
exports
|
|
58
|
-
exports.buttonProps = buttonProps;
|
|
59
|
-
exports.buttonTypes = buttonTypes;
|
|
105
|
+
exports["default"] = Button;
|
|
60
106
|
//# sourceMappingURL=button2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button2.js","sources":["../../../../../../packages/components/button/src/button.
|
|
1
|
+
{"version":3,"file":"button2.js","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n ref=\"_ref\"\n :class=\"[\n ns.b(),\n ns.m(_type),\n ns.m(_size),\n ns.is('disabled', _disabled),\n ns.is('loading', loading),\n ns.is('plain', plain),\n ns.is('round', round),\n ns.is('circle', circle),\n ]\"\n :disabled=\"_disabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n :style=\"buttonStyle\"\n >\n <template v-if=\"loading\">\n <slot v-if=\"$slots.loading\" name=\"loading\" />\n <ps-icon v-else :class=\"ns.is('loading')\">\n <component :is=\"loadingIcon\" />\n </ps-icon>\n </template>\n <ps-icon v-else-if=\"icon || $slots.icon\">\n <component :is=\"icon\" v-if=\"icon\" />\n <slot v-else name=\"icon\" />\n </ps-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ [ns.em('text', 'expand')]: shouldAddSpace }\"\n >\n <slot />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Text, computed, inject, ref, useSlots } from 'vue'\nimport { PsIcon } from '@element-ps/components/icon'\nimport {\n useDisabled,\n useGlobalConfig,\n useNamespace,\n useSize,\n} from '@element-ps/hooks'\nimport { buttonGroupContextKey } from '@element-ps/tokens'\nimport { buttonProps } from './button'\nimport { useButtonCustomStyle } from './button-custom'\n\ndefineOptions({\n name: 'PsButton',\n})\n\nconst props = defineProps(buttonProps)\nconst slots = useSlots()\n\nconst buttonGroupContext = inject(buttonGroupContextKey, undefined)\nconst globalConfig = useGlobalConfig('button')\nconst ns = useNamespace('button')\nconst _size = useSize(computed(() => buttonGroupContext?.size))\nconst _disabled = useDisabled()\nconst _ref = ref<HTMLButtonElement>()\n\nconst _type = computed(() => props.type || buttonGroupContext?.type || '')\nconst autoInsertSpace = computed(\n () => props.autoInsertSpace ?? globalConfig.value?.autoInsertSpace ?? false\n)\n\n// add space between two characters in Chinese\nconst shouldAddSpace = computed(() => {\n const defaultSlot = slots.default?.()\n if (autoInsertSpace.value && defaultSlot?.length === 1) {\n const slot = defaultSlot[0]\n if (slot?.type === Text) {\n const text = slot.children as string\n return /^\\p{Unified_Ideograph}{2}$/u.test(text.trim())\n }\n }\n return false\n})\n\nconst buttonStyle = useButtonCustomStyle(props)\n\ndefineExpose({\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: _size,\n /** @description button type */\n type: _type,\n /** @description button disabled */\n disabled: _disabled,\n /** @description whether adding space */\n shouldAddSpace,\n})\n</script>\n"],"names":["useSlots","inject","buttonGroupContextKey","useGlobalConfig","useNamespace","useSize","computed","useDisabled","ref","Text","useButtonCustomStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,IAAA,MAAA,QAAAA,YAAA,EAAA,CAAA;AAEA,IAAA,MAAA,kBAAA,GAAAC,UAAA,CAAAC,8BAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAA,GAAAC,sBAAA,QAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAAC,qBAAA,QAAA,CAAA,CAAA;AACA,IAAA,MAAA,QAAAC,eAAA,CAAAC,YAAA,CAAA,MAAA,kBAAA,QAAA,GAAA,KAAA,CAAA,GAAA,kBAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAAC,mBAAA,EAAA,CAAA;AACA,IAAA,MAAA,OAAAC,OAAA,EAAA,CAAA;AAEA,IAAA,MAAA,QAAAF,YAAA,CAAA,MAAA,MAAA,IAAA,KAAA,kBAAA,WAAA,KAAA,CAAA,GAAA,kBAAA,CAAA,IAAA,CAAA,IAAA,EAAA,CAAA,CAAA;AACA,IAAA,MAAA,eAAA,GAAAA,aACA,MAAA;AAIA,MAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AACA,MAAA,OAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,qBAAA,KAAA,IAAA,GAAA,EAAA,GAAA,CAAA,EAAA,GAAA,YAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,eAAA,KAAA,IAAA,GAAA,EAAA,GAAA,KAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAAA,YAAA,CAAA,MAAA;AACA,MAAA,IAAA,EAAA,CAAA;AACA,MAAA,MAAA,WAAA,GAAA,CAAA,EAAA,GAAA,KAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;AACA,MAAA,IAAA,eAAA,CAAA,KAAA,IAAA,CAAA,WAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,WAAA,CAAA,MAAA,MAAA,CAAA,EAAA;AAAA,QACA,MAAA,IAAA,GAAA,WAAA,CAAA,CAAA,CAAA,CAAA;AAAA,QACA,IAAA,CAAA,IAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,IAAA,CAAA,IAAA,MAAAG,QAAA,EAAA;AACA,UAAA,MAAA,IAAA,GAAA,IAAA,CAAA,QAAA,CAAA;AAAA,UACA,OAAA,6BAAA,CAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA,CAAA,CAAA;AAEA,SAAA;AAEA,OAAA;AAAA,MAEA,OAAA,KAAA,CAAA;AAAA,KAAA,CAEA,CAAA;AAAA,IAAA,MAEA,WAAA,GAAAC,iCAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,MAEA,CAAA;AAAA,MAEA,GAAA,EAAA,IAAA;AAAA,MACA,IAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var calendar$1 = require('./src/
|
|
7
|
-
var calendar = require('./src/
|
|
6
|
+
var calendar$1 = require('./src/calendar2.js');
|
|
7
|
+
var calendar = require('./src/calendar.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const PsCalendar = install.withInstall(calendar$1["default"]);
|
|
@@ -2,201 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var dayjs = require('dayjs');
|
|
7
|
-
var index$2 = require('../../button/index.js');
|
|
8
|
-
require('../../../hooks/index.js');
|
|
9
5
|
require('../../../utils/index.js');
|
|
10
|
-
var
|
|
11
|
-
var calendar = require('./calendar2.js');
|
|
12
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
13
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
14
|
-
var index$1 = require('../../../hooks/use-locale/index.js');
|
|
15
|
-
var error = require('../../../utils/error.js');
|
|
6
|
+
var props = require('../../../utils/vue/props.js');
|
|
16
7
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
25
|
-
...__default__,
|
|
26
|
-
props: calendar.calendarProps,
|
|
27
|
-
setup(__props, { expose }) {
|
|
28
|
-
const props = __props;
|
|
29
|
-
const COMPONENT_NAME = "PsCalendar";
|
|
30
|
-
const ns = index.useNamespace("calendar");
|
|
31
|
-
const { t, lang } = index$1.useLocale();
|
|
32
|
-
const selectedDay = vue.ref();
|
|
33
|
-
const now = dayjs__default["default"]().locale(lang.value);
|
|
34
|
-
const i18nDate = vue.computed(() => {
|
|
35
|
-
const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
|
|
36
|
-
return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
|
|
37
|
-
});
|
|
38
|
-
const realSelectedDay = vue.computed({
|
|
39
|
-
get() {
|
|
40
|
-
if (!props.modelValue)
|
|
41
|
-
return selectedDay.value;
|
|
42
|
-
return date.value;
|
|
43
|
-
},
|
|
44
|
-
set(val) {
|
|
45
|
-
if (!val)
|
|
46
|
-
return;
|
|
47
|
-
selectedDay.value = val;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
const date = vue.computed(() => {
|
|
51
|
-
if (!props.modelValue) {
|
|
52
|
-
if (realSelectedDay.value) {
|
|
53
|
-
return realSelectedDay.value;
|
|
54
|
-
} else if (validatedRange.value.length) {
|
|
55
|
-
return validatedRange.value[0][0];
|
|
56
|
-
}
|
|
57
|
-
return now;
|
|
58
|
-
} else {
|
|
59
|
-
return dayjs__default["default"](props.modelValue).locale(lang.value);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
const calculateValidatedDateRange = (startDayjs, endDayjs) => {
|
|
63
|
-
const firstDay = startDayjs.startOf("week");
|
|
64
|
-
const lastDay = endDayjs.endOf("week");
|
|
65
|
-
const firstMonth = firstDay.get("month");
|
|
66
|
-
const lastMonth = lastDay.get("month");
|
|
67
|
-
if (firstMonth === lastMonth) {
|
|
68
|
-
return [[firstDay, lastDay]];
|
|
69
|
-
} else if (firstMonth + 1 === lastMonth) {
|
|
70
|
-
const firstMonthLastDay = firstDay.endOf("month");
|
|
71
|
-
const lastMonthFirstDay = lastDay.startOf("month");
|
|
72
|
-
const isSameWeek = firstMonthLastDay.isSame(lastMonthFirstDay, "week");
|
|
73
|
-
const lastMonthStartDay = isSameWeek ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
|
|
74
|
-
return [
|
|
75
|
-
[firstDay, firstMonthLastDay],
|
|
76
|
-
[lastMonthStartDay.startOf("week"), lastDay]
|
|
77
|
-
];
|
|
78
|
-
} else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) {
|
|
79
|
-
const firstMonthLastDay = firstDay.endOf("month");
|
|
80
|
-
const secondMonthFirstDay = firstDay.add(1, "month").startOf("month");
|
|
81
|
-
const secondMonthStartDay = firstMonthLastDay.isSame(secondMonthFirstDay, "week") ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay;
|
|
82
|
-
const secondMonthLastDay = secondMonthStartDay.endOf("month");
|
|
83
|
-
const lastMonthFirstDay = lastDay.startOf("month");
|
|
84
|
-
const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
|
|
85
|
-
return [
|
|
86
|
-
[firstDay, firstMonthLastDay],
|
|
87
|
-
[secondMonthStartDay.startOf("week"), secondMonthLastDay],
|
|
88
|
-
[lastMonthStartDay.startOf("week"), lastDay]
|
|
89
|
-
];
|
|
90
|
-
} else {
|
|
91
|
-
error.debugWarn(COMPONENT_NAME, "start time and end time interval must not exceed two months");
|
|
92
|
-
return [];
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const validatedRange = vue.computed(() => {
|
|
96
|
-
if (!props.range)
|
|
97
|
-
return [];
|
|
98
|
-
const rangeArrDayjs = props.range.map((_) => dayjs__default["default"](_).locale(lang.value));
|
|
99
|
-
const [startDayjs, endDayjs] = rangeArrDayjs;
|
|
100
|
-
if (startDayjs.isAfter(endDayjs)) {
|
|
101
|
-
error.debugWarn(COMPONENT_NAME, "end time should be greater than start time");
|
|
102
|
-
return [];
|
|
103
|
-
}
|
|
104
|
-
if (startDayjs.isSame(endDayjs, "month")) {
|
|
105
|
-
return calculateValidatedDateRange(startDayjs, endDayjs);
|
|
106
|
-
} else {
|
|
107
|
-
if (startDayjs.add(1, "month").month() !== endDayjs.month()) {
|
|
108
|
-
error.debugWarn(COMPONENT_NAME, "start time and end time interval must not exceed two months");
|
|
109
|
-
return [];
|
|
110
|
-
}
|
|
111
|
-
return calculateValidatedDateRange(startDayjs, endDayjs);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
expose({
|
|
115
|
-
selectedDay: realSelectedDay,
|
|
116
|
-
calculateValidatedDateRange
|
|
117
|
-
});
|
|
118
|
-
return (_ctx, _cache) => {
|
|
119
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
120
|
-
class: vue.normalizeClass(vue.unref(ns).b())
|
|
121
|
-
}, [
|
|
122
|
-
vue.createElementVNode("div", {
|
|
123
|
-
class: vue.normalizeClass(vue.unref(ns).e("header"))
|
|
124
|
-
}, [
|
|
125
|
-
vue.renderSlot(_ctx.$slots, "header", { date: vue.unref(i18nDate) }, () => [
|
|
126
|
-
vue.createElementVNode("div", {
|
|
127
|
-
class: vue.normalizeClass(vue.unref(ns).e("title"))
|
|
128
|
-
}, vue.toDisplayString(vue.unref(i18nDate)), 3),
|
|
129
|
-
vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
130
|
-
key: 0,
|
|
131
|
-
class: vue.normalizeClass(vue.unref(ns).e("button-group"))
|
|
132
|
-
}, [
|
|
133
|
-
vue.createVNode(vue.unref(index$2.PsButtonGroup), null, {
|
|
134
|
-
default: vue.withCtx(() => [
|
|
135
|
-
vue.createVNode(vue.unref(index$2.PsButton), { size: "small" }, {
|
|
136
|
-
default: vue.withCtx(() => [
|
|
137
|
-
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.prevMonth")), 1)
|
|
138
|
-
]),
|
|
139
|
-
_: 1
|
|
140
|
-
}),
|
|
141
|
-
vue.createVNode(vue.unref(index$2.PsButton), { size: "small" }, {
|
|
142
|
-
default: vue.withCtx(() => [
|
|
143
|
-
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.today")), 1)
|
|
144
|
-
]),
|
|
145
|
-
_: 1
|
|
146
|
-
}),
|
|
147
|
-
vue.createVNode(vue.unref(index$2.PsButton), { size: "small" }, {
|
|
148
|
-
default: vue.withCtx(() => [
|
|
149
|
-
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.nextMonth")), 1)
|
|
150
|
-
]),
|
|
151
|
-
_: 1
|
|
152
|
-
})
|
|
153
|
-
]),
|
|
154
|
-
_: 1
|
|
155
|
-
})
|
|
156
|
-
], 2)) : vue.createCommentVNode("v-if", true)
|
|
157
|
-
])
|
|
158
|
-
], 2),
|
|
159
|
-
vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
160
|
-
key: 0,
|
|
161
|
-
class: vue.normalizeClass(vue.unref(ns).e("body"))
|
|
162
|
-
}, [
|
|
163
|
-
vue.createVNode(dateTable["default"], {
|
|
164
|
-
date: vue.unref(date),
|
|
165
|
-
"selected-day": vue.unref(realSelectedDay)
|
|
166
|
-
}, vue.createSlots({ _: 2 }, [
|
|
167
|
-
_ctx.$slots.dateCell ? {
|
|
168
|
-
name: "dateCell",
|
|
169
|
-
fn: vue.withCtx((data) => [
|
|
170
|
-
vue.renderSlot(_ctx.$slots, "dateCell", vue.normalizeProps(vue.guardReactiveProps(data)))
|
|
171
|
-
])
|
|
172
|
-
} : void 0
|
|
173
|
-
]), 1032, ["date", "selected-day"])
|
|
174
|
-
], 2)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
175
|
-
key: 1,
|
|
176
|
-
class: vue.normalizeClass(vue.unref(ns).e("body"))
|
|
177
|
-
}, [
|
|
178
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(validatedRange), (range_, index) => {
|
|
179
|
-
return vue.openBlock(), vue.createBlock(dateTable["default"], {
|
|
180
|
-
key: index,
|
|
181
|
-
date: range_[0],
|
|
182
|
-
"selected-day": vue.unref(realSelectedDay),
|
|
183
|
-
range: range_,
|
|
184
|
-
"hide-header": index !== 0
|
|
185
|
-
}, vue.createSlots({ _: 2 }, [
|
|
186
|
-
_ctx.$slots.dateCell ? {
|
|
187
|
-
name: "dateCell",
|
|
188
|
-
fn: vue.withCtx((data) => [
|
|
189
|
-
vue.renderSlot(_ctx.$slots, "dateCell", vue.normalizeProps(vue.guardReactiveProps(data)))
|
|
190
|
-
])
|
|
191
|
-
} : void 0
|
|
192
|
-
]), 1032, ["date", "selected-day", "range", "hide-header"]);
|
|
193
|
-
}), 128))
|
|
194
|
-
], 2))
|
|
195
|
-
], 2);
|
|
196
|
-
};
|
|
8
|
+
const calendarProps = props.buildProps({
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: Date
|
|
11
|
+
},
|
|
12
|
+
range: {
|
|
13
|
+
type: props.definePropType(Array),
|
|
14
|
+
validator: (range) => Array.isArray(range) && range.length === 2 && range.every((item) => item instanceof Date)
|
|
197
15
|
}
|
|
198
16
|
});
|
|
199
|
-
var Calendar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/calendar/src/calendar.vue"]]);
|
|
200
17
|
|
|
201
|
-
exports
|
|
18
|
+
exports.calendarProps = calendarProps;
|
|
202
19
|
//# sourceMappingURL=calendar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sources":["../../../../../../packages/components/calendar/src/calendar.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('header')\">\n <slot name=\"header\" :date=\"i18nDate\">\n <div :class=\"ns.e('title')\">{{ i18nDate }}</div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('button-group')\">\n <ps-button-group>\n <ps-button size=\"small\">\n {{ t('el.datepicker.prevMonth') }}\n </ps-button>\n <ps-button size=\"small\">\n {{ t('el.datepicker.today') }}\n </ps-button>\n <ps-button size=\"small\">\n {{ t('el.datepicker.nextMonth') }}\n </ps-button>\n </ps-button-group>\n </div>\n </slot>\n </div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('body')\">\n <date-table :date=\"date\" :selected-day=\"realSelectedDay\">\n <template v-if=\"$slots.dateCell\" #dateCell=\"data\">\n <slot name=\"dateCell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n <div v-else :class=\"ns.e('body')\">\n <date-table\n v-for=\"(range_, index) in validatedRange\"\n :key=\"index\"\n :date=\"range_[0]\"\n :selected-day=\"realSelectedDay\"\n :range=\"range_\"\n :hide-header=\"index !== 0\"\n >\n <template v-if=\"$slots.dateCell\" #dateCell=\"data\">\n <slot name=\"dateCell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport dayjs from 'dayjs'\nimport { PsButton, PsButtonGroup } from '@element-ps/components/button'\nimport { useLocale, useNamespace } from '@element-ps/hooks'\nimport { debugWarn } from '@element-ps/utils'\nimport DateTable from './date-table.vue'\nimport { calendarProps } from './calendar'\n\nimport type { ComputedRef } from 'vue'\nimport type { Dayjs } from 'dayjs'\n\nconst COMPONENT_NAME = 'PsCalendar'\n\ndefineOptions({\n name: 'PsCalendar',\n})\n\nconst props = defineProps(calendarProps)\n\nconst ns = useNamespace('calendar')\n\nconst { t, lang } = useLocale()\nconst selectedDay = ref<Dayjs>()\nconst now = dayjs().locale(lang.value)\n\nconst i18nDate = computed(() => {\n const pickedMonth = `el.datepicker.month${date.value.format('M')}`\n return `${date.value.year()} ${t('el.datepicker.year')} ${t(pickedMonth)}`\n})\n\nconst realSelectedDay = computed<Dayjs | undefined>({\n get() {\n if (!props.modelValue) return selectedDay.value\n return date.value\n },\n set(val) {\n if (!val) return\n selectedDay.value = val\n },\n})\n\nconst date: ComputedRef<Dayjs> = computed(() => {\n if (!props.modelValue) {\n if (realSelectedDay.value) {\n return realSelectedDay.value\n } else if (validatedRange.value.length) {\n return validatedRange.value[0][0]\n }\n return now\n } else {\n return dayjs(props.modelValue).locale(lang.value)\n }\n})\n\n// https://github.com/element-ps/element-ps/issues/3155\n// Calculate the validate date range according to the start and end dates\nconst calculateValidatedDateRange = (\n startDayjs: Dayjs,\n endDayjs: Dayjs\n): [Dayjs, Dayjs][] => {\n const firstDay = startDayjs.startOf('week')\n const lastDay = endDayjs.endOf('week')\n const firstMonth = firstDay.get('month')\n const lastMonth = lastDay.get('month')\n\n // Current mouth\n if (firstMonth === lastMonth) {\n return [[firstDay, lastDay]]\n }\n // Two adjacent months\n else if (firstMonth + 1 === lastMonth) {\n const firstMonthLastDay = firstDay.endOf('month')\n const lastMonthFirstDay = lastDay.startOf('month')\n\n // Whether the last day of the first month and the first day of the last month is in the same week\n const isSameWeek = firstMonthLastDay.isSame(lastMonthFirstDay, 'week')\n const lastMonthStartDay = isSameWeek\n ? lastMonthFirstDay.add(1, 'week')\n : lastMonthFirstDay\n\n return [\n [firstDay, firstMonthLastDay],\n [lastMonthStartDay.startOf('week'), lastDay],\n ]\n }\n // Three consecutive months (compatible: 2021-01-30 to 2021-02-28)\n else if (\n firstMonth + 2 === lastMonth ||\n (firstMonth + 1) % 11 === lastMonth\n ) {\n const firstMonthLastDay = firstDay.endOf('month')\n const secondMonthFirstDay = firstDay.add(1, 'month').startOf('month')\n\n // Whether the last day of the first month and the second month is in the same week\n const secondMonthStartDay = firstMonthLastDay.isSame(\n secondMonthFirstDay,\n 'week'\n )\n ? secondMonthFirstDay.add(1, 'week')\n : secondMonthFirstDay\n\n const secondMonthLastDay = secondMonthStartDay.endOf('month')\n const lastMonthFirstDay = lastDay.startOf('month')\n\n // Whether the last day of the second month and the last day of the last month is in the same week\n const lastMonthStartDay = secondMonthLastDay.isSame(\n lastMonthFirstDay,\n 'week'\n )\n ? lastMonthFirstDay.add(1, 'week')\n : lastMonthFirstDay\n\n return [\n [firstDay, firstMonthLastDay],\n [secondMonthStartDay.startOf('week'), secondMonthLastDay],\n [lastMonthStartDay.startOf('week'), lastDay],\n ]\n }\n // Other cases\n else {\n debugWarn(\n COMPONENT_NAME,\n 'start time and end time interval must not exceed two months'\n )\n return []\n }\n}\n\n// if range is valid, we get a two-digit array\nconst validatedRange = computed(() => {\n if (!props.range) return []\n const rangeArrDayjs = props.range.map((_) => dayjs(_).locale(lang.value))\n const [startDayjs, endDayjs] = rangeArrDayjs\n if (startDayjs.isAfter(endDayjs)) {\n debugWarn(COMPONENT_NAME, 'end time should be greater than start time')\n return []\n }\n if (startDayjs.isSame(endDayjs, 'month')) {\n // same month\n return calculateValidatedDateRange(startDayjs, endDayjs)\n } else {\n // two months\n if (startDayjs.add(1, 'month').month() !== endDayjs.month()) {\n debugWarn(\n COMPONENT_NAME,\n 'start time and end time interval must not exceed two months'\n )\n return []\n }\n return calculateValidatedDateRange(startDayjs, endDayjs)\n }\n})\n\ndefineExpose({\n /** @description currently selected date */\n selectedDay: realSelectedDay,\n /** @description Calculate the validate date range according to the start and end dates */\n calculateValidatedDateRange,\n})\n</script>\n"],"names":["useNamespace","useLocale","ref","dayjs","computed","debugWarn"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"calendar.js","sources":["../../../../../../packages/components/calendar/src/calendar.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-ps/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-ps/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type Calendar from './calendar.vue'\n\nexport type CalendarDateType =\n | 'prev-month'\n | 'next-month'\n | 'prev-year'\n | 'next-year'\n | 'today'\n\nexport const calendarProps = buildProps({\n modelValue: {\n type: Date,\n },\n range: {\n type: definePropType<[Date, Date]>(Array),\n validator: (range: unknown): range is [Date, Date] =>\n Array.isArray(range) &&\n range.length === 2 &&\n range.every((item) => item instanceof Date),\n },\n} as const)\nexport type CalendarProps = ExtractPropTypes<typeof calendarProps>\n\nexport type CalendarInstance = InstanceType<typeof Calendar>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,aAAa,GAAGA,gBAAU,CAAC;AACxC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAEC,oBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,SAAS,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,IAAI,YAAY,IAAI,CAAC;AACnH,GAAG;AACH,CAAC;;;;"}
|