element-ps 2.0.28 → 2.0.31
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 +164 -13
- 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 +164 -13
- package/es/components/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +82 -19
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +19 -82
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete.mjs +1 -1
- package/es/components/backtop/index.mjs +2 -2
- package/es/components/backtop/src/backtop.mjs +18 -59
- package/es/components/backtop/src/backtop.mjs.map +1 -1
- package/es/components/backtop/src/backtop2.mjs +59 -18
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +2 -2
- 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/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 +27 -146
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table2.mjs +146 -27
- 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/cascader/src/index.mjs +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/divider/index.mjs +2 -2
- package/es/components/divider/src/divider.mjs +17 -34
- package/es/components/divider/src/divider.mjs.map +1 -1
- package/es/components/divider/src/divider2.mjs +34 -17
- package/es/components/divider/src/divider2.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +117 -23
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +23 -117
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.mjs +2 -2
- package/es/components/empty/index.mjs +2 -2
- package/es/components/empty/src/empty.mjs +11 -56
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/empty/src/empty2.mjs +56 -11
- package/es/components/empty/src/empty2.mjs.map +1 -1
- package/es/components/form/index.mjs +4 -4
- package/es/components/form/src/form-item.mjs +46 -177
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/form/src/form-item2.mjs +177 -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 +35 -8
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +8 -35
- 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/index.mjs +28 -28
- 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 +2 -0
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item.mjs +15 -65
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +73 -15
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/menu/src/menu.d.ts +3 -0
- package/es/components/menu/src/menu.mjs +86 -6
- package/es/components/menu/src/menu.mjs.map +1 -1
- package/es/components/menu/src/sub-menu.mjs +35 -4
- package/es/components/menu/src/sub-menu.mjs.map +1 -1
- package/es/components/menu/src/types.d.ts +8 -0
- package/es/components/popconfirm/src/popconfirm2.mjs +1 -1
- package/es/components/popover/src/popover.mjs +1 -1
- package/es/components/popper/index.mjs +6 -6
- package/es/components/popper/src/arrow.mjs +31 -7
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +7 -31
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- 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/popper/src/popper.mjs +20 -27
- package/es/components/popper/src/popper.mjs.map +1 -1
- package/es/components/popper/src/popper2.mjs +27 -20
- package/es/components/popper/src/popper2.mjs.map +1 -1
- package/es/components/progress/index.mjs +2 -2
- package/es/components/progress/src/progress.mjs +57 -230
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +230 -57
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/radio/index.mjs +6 -6
- package/es/components/radio/src/radio-button.mjs +9 -80
- package/es/components/radio/src/radio-button.mjs.map +1 -1
- package/es/components/radio/src/radio-button2.mjs +80 -9
- package/es/components/radio/src/radio-button2.mjs.map +1 -1
- package/es/components/radio/src/radio-group.mjs +37 -18
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +18 -37
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/radio/src/radio.mjs +74 -62
- package/es/components/radio/src/radio.mjs.map +1 -1
- package/es/components/radio/src/radio2.mjs +62 -74
- package/es/components/radio/src/radio2.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/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton.mjs +22 -49
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +49 -22
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/tabs/index.d.ts +8 -0
- package/es/components/tabs/src/tab-bar.d.ts +1 -0
- package/es/components/tabs/src/tab-bar.vue.d.ts +4 -0
- package/es/components/tabs/src/tab-nav.d.ts +4 -0
- package/es/components/tabs/src/tab-nav.mjs +2 -1
- package/es/components/tabs/src/tab-nav.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane.d.ts +1 -0
- package/es/components/tabs/src/tab-pane.mjs +2 -1
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane.vue.d.ts +3 -0
- package/es/components/tabs/src/tab-pane2.mjs +3 -2
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/tabs/src/tabs.d.ts +2 -0
- package/es/components/tabs/src/tabs.mjs +10 -1
- package/es/components/tabs/src/tabs.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +2 -2
- package/es/components/tooltip/src/tooltip.mjs +64 -51
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +51 -64
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +2 -2
- package/es/components/tooltip-v2/src/root.mjs +81 -17
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +17 -81
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +2 -2
- package/es/components/tooltip-v2/src/tooltip2.mjs +4 -4
- 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 +3 -3
- 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-dragger.mjs +11 -32
- package/es/components/upload/src/upload-dragger.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger2.mjs +32 -11
- package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
- package/es/components/upload/src/upload-list.mjs +26 -155
- package/es/components/upload/src/upload-list.mjs.map +1 -1
- package/es/components/upload/src/upload-list2.mjs +155 -26
- package/es/components/upload/src/upload-list2.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +2 -2
- package/es/index.mjs +28 -28
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +82 -19
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +19 -82
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.js +1 -1
- package/lib/components/backtop/index.js +2 -2
- package/lib/components/backtop/src/backtop.js +18 -59
- package/lib/components/backtop/src/backtop.js.map +1 -1
- package/lib/components/backtop/src/backtop2.js +59 -18
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- 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/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 +30 -151
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table2.js +151 -30
- 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/cascader/src/index.js +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/divider/index.js +2 -2
- package/lib/components/divider/src/divider.js +17 -34
- package/lib/components/divider/src/divider.js.map +1 -1
- package/lib/components/divider/src/divider2.js +34 -17
- package/lib/components/divider/src/divider2.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +117 -23
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +23 -117
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.js +2 -2
- package/lib/components/empty/index.js +2 -2
- package/lib/components/empty/src/empty.js +11 -56
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/empty/src/empty2.js +56 -11
- package/lib/components/empty/src/empty2.js.map +1 -1
- package/lib/components/form/index.js +4 -4
- package/lib/components/form/src/form-item.js +47 -177
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/form/src/form-item2.js +177 -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 +35 -8
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +8 -35
- 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/index.js +28 -28
- 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 +2 -0
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item.js +16 -65
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +73 -16
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/menu/src/menu.d.ts +3 -0
- package/lib/components/menu/src/menu.js +87 -7
- package/lib/components/menu/src/menu.js.map +1 -1
- package/lib/components/menu/src/sub-menu.js +34 -3
- package/lib/components/menu/src/sub-menu.js.map +1 -1
- package/lib/components/menu/src/types.d.ts +8 -0
- package/lib/components/popconfirm/src/popconfirm2.js +1 -1
- package/lib/components/popover/src/popover.js +1 -1
- package/lib/components/popper/index.js +6 -6
- package/lib/components/popper/src/arrow.js +31 -7
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +7 -31
- package/lib/components/popper/src/arrow2.js.map +1 -1
- 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/popper/src/popper.js +21 -27
- package/lib/components/popper/src/popper.js.map +1 -1
- package/lib/components/popper/src/popper2.js +27 -21
- package/lib/components/popper/src/popper2.js.map +1 -1
- package/lib/components/progress/index.js +2 -2
- package/lib/components/progress/src/progress.js +57 -230
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/progress/src/progress2.js +230 -57
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/radio/index.js +6 -6
- package/lib/components/radio/src/radio-button.js +9 -80
- package/lib/components/radio/src/radio-button.js.map +1 -1
- package/lib/components/radio/src/radio-button2.js +80 -9
- package/lib/components/radio/src/radio-button2.js.map +1 -1
- package/lib/components/radio/src/radio-group.js +37 -18
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +18 -37
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/radio/src/radio.js +73 -64
- package/lib/components/radio/src/radio.js.map +1 -1
- package/lib/components/radio/src/radio2.js +64 -73
- package/lib/components/radio/src/radio2.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/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton.js +22 -49
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +49 -22
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/tabs/index.d.ts +8 -0
- package/lib/components/tabs/src/tab-bar.d.ts +1 -0
- package/lib/components/tabs/src/tab-bar.vue.d.ts +4 -0
- package/lib/components/tabs/src/tab-nav.d.ts +4 -0
- package/lib/components/tabs/src/tab-nav.js +2 -1
- package/lib/components/tabs/src/tab-nav.js.map +1 -1
- package/lib/components/tabs/src/tab-pane.d.ts +1 -0
- package/lib/components/tabs/src/tab-pane.js +2 -1
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane.vue.d.ts +3 -0
- package/lib/components/tabs/src/tab-pane2.js +3 -2
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/tabs/src/tabs.d.ts +2 -0
- package/lib/components/tabs/src/tabs.js +9 -0
- package/lib/components/tabs/src/tabs.js.map +1 -1
- package/lib/components/tooltip/index.js +2 -2
- package/lib/components/tooltip/src/tooltip.js +65 -50
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +50 -65
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip/src/trigger.js +1 -1
- package/lib/components/tooltip-v2/index.js +2 -2
- package/lib/components/tooltip-v2/src/root.js +81 -17
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +17 -81
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +2 -2
- package/lib/components/tooltip-v2/src/tooltip2.js +4 -4
- 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 +3 -3
- 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-dragger.js +12 -32
- package/lib/components/upload/src/upload-dragger.js.map +1 -1
- package/lib/components/upload/src/upload-dragger2.js +32 -12
- package/lib/components/upload/src/upload-dragger2.js.map +1 -1
- package/lib/components/upload/src/upload-list.js +27 -155
- package/lib/components/upload/src/upload-list.js.map +1 -1
- package/lib/components/upload/src/upload-list2.js +155 -27
- package/lib/components/upload/src/upload-list2.js.map +1 -1
- package/lib/components/upload/src/upload2.js +2 -2
- package/lib/index.js +28 -28
- package/package.json +1 -1
- package/web-types.json +1 -1
package/dist/index.full.mjs
CHANGED
|
@@ -2211,6 +2211,9 @@ const isArray = Array.isArray;
|
|
|
2211
2211
|
const isFunction = (val) => typeof val === "function";
|
|
2212
2212
|
const isString = (val) => typeof val === "string";
|
|
2213
2213
|
const isObject$1 = (val) => val !== null && typeof val === "object";
|
|
2214
|
+
const isPromise = (val) => {
|
|
2215
|
+
return isObject$1(val) && isFunction(val.then) && isFunction(val.catch);
|
|
2216
|
+
};
|
|
2214
2217
|
const objectToString = Object.prototype.toString;
|
|
2215
2218
|
const toTypeString = (value) => objectToString.call(value);
|
|
2216
2219
|
const toRawType = (value) => {
|
|
@@ -19238,7 +19241,7 @@ var SubMenu = defineComponent({
|
|
|
19238
19241
|
props: subMenuProps,
|
|
19239
19242
|
setup(props, { slots, expose }) {
|
|
19240
19243
|
const instance = getCurrentInstance();
|
|
19241
|
-
const { paddingStyle, parentMenu } = useMenu(instance, computed(() => props.index));
|
|
19244
|
+
const { paddingStyle, indexPath, parentMenu } = useMenu(instance, computed(() => props.index));
|
|
19242
19245
|
const nsMenu = useNamespace("menu");
|
|
19243
19246
|
const nsSubMenu = useNamespace("sub-menu");
|
|
19244
19247
|
const rootMenu = inject("rootMenu");
|
|
@@ -19291,8 +19294,8 @@ var SubMenu = defineComponent({
|
|
|
19291
19294
|
const opened = computed(() => rootMenu.openedMenus.includes(props.index));
|
|
19292
19295
|
const active = computed(() => {
|
|
19293
19296
|
let isActive = false;
|
|
19294
|
-
Object.values(items.value).forEach((
|
|
19295
|
-
if (
|
|
19297
|
+
Object.values(items.value).forEach((item2) => {
|
|
19298
|
+
if (item2.active) {
|
|
19296
19299
|
isActive = true;
|
|
19297
19300
|
}
|
|
19298
19301
|
});
|
|
@@ -19307,6 +19310,11 @@ var SubMenu = defineComponent({
|
|
|
19307
19310
|
const activeTextColor = computed(() => rootMenu.props.activeTextColor || "");
|
|
19308
19311
|
const textColor = computed(() => rootMenu.props.textColor || "");
|
|
19309
19312
|
const mode = computed(() => rootMenu.props.mode);
|
|
19313
|
+
const item = reactive({
|
|
19314
|
+
index: props.index,
|
|
19315
|
+
indexPath,
|
|
19316
|
+
active
|
|
19317
|
+
});
|
|
19310
19318
|
const titleStyle = computed(() => {
|
|
19311
19319
|
if (mode.value !== "horizontal") {
|
|
19312
19320
|
return {
|
|
@@ -19318,14 +19326,40 @@ var SubMenu = defineComponent({
|
|
|
19318
19326
|
color: active.value ? activeTextColor.value : textColor.value
|
|
19319
19327
|
};
|
|
19320
19328
|
});
|
|
19329
|
+
const doDestroy = () => {
|
|
19330
|
+
var _a, _b, _c;
|
|
19331
|
+
return (_c = (_b = (_a = vPopper.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.popperInstanceRef) == null ? void 0 : _c.destroy();
|
|
19332
|
+
};
|
|
19333
|
+
const handleCollapseToggle = (value) => {
|
|
19334
|
+
if (!value) {
|
|
19335
|
+
doDestroy();
|
|
19336
|
+
}
|
|
19337
|
+
};
|
|
19338
|
+
watch(() => rootMenu.props.collapse, (value) => handleCollapseToggle(Boolean(value)));
|
|
19321
19339
|
{
|
|
19340
|
+
const addSubMenu = (item2) => {
|
|
19341
|
+
subMenus.value[item2.index] = item2;
|
|
19342
|
+
};
|
|
19343
|
+
const removeSubMenu = (item2) => {
|
|
19344
|
+
delete subMenus.value[item2.index];
|
|
19345
|
+
};
|
|
19322
19346
|
provide(`subMenu:${instance.uid}`, {
|
|
19347
|
+
addSubMenu,
|
|
19348
|
+
removeSubMenu,
|
|
19323
19349
|
mouseInChild
|
|
19324
19350
|
});
|
|
19325
19351
|
}
|
|
19326
19352
|
expose({
|
|
19327
19353
|
opened
|
|
19328
19354
|
});
|
|
19355
|
+
onMounted(() => {
|
|
19356
|
+
rootMenu.addSubMenu(item);
|
|
19357
|
+
subMenu.addSubMenu(item);
|
|
19358
|
+
});
|
|
19359
|
+
onBeforeUnmount(() => {
|
|
19360
|
+
subMenu.removeSubMenu(item);
|
|
19361
|
+
rootMenu.removeSubMenu(item);
|
|
19362
|
+
});
|
|
19329
19363
|
return () => {
|
|
19330
19364
|
var _a;
|
|
19331
19365
|
const titleTag = [
|
|
@@ -19441,12 +19475,13 @@ const menuProps = buildProps({
|
|
|
19441
19475
|
ellipsis: {
|
|
19442
19476
|
type: Boolean,
|
|
19443
19477
|
default: true
|
|
19444
|
-
}
|
|
19478
|
+
},
|
|
19479
|
+
widget: String
|
|
19445
19480
|
});
|
|
19446
19481
|
var Menu = defineComponent({
|
|
19447
19482
|
name: "PsMenu",
|
|
19448
19483
|
props: menuProps,
|
|
19449
|
-
setup(props, { slots }) {
|
|
19484
|
+
setup(props, { slots, expose }) {
|
|
19450
19485
|
const instance = getCurrentInstance();
|
|
19451
19486
|
const menu = ref();
|
|
19452
19487
|
const nsMenu = useNamespace("menu");
|
|
@@ -19462,17 +19497,80 @@ var Menu = defineComponent({
|
|
|
19462
19497
|
const activeItem = activeIndex.value && items.value[activeIndex.value];
|
|
19463
19498
|
if (!activeItem || props.mode === "horizontal" || props.collapse)
|
|
19464
19499
|
return;
|
|
19500
|
+
const indexPath = activeItem.indexPath;
|
|
19501
|
+
indexPath.forEach((index) => {
|
|
19502
|
+
const subMenu = subMenus.value[index];
|
|
19503
|
+
subMenu && openMenu(index, subMenu.indexPath);
|
|
19504
|
+
});
|
|
19505
|
+
};
|
|
19506
|
+
const openMenu = (index, indexPath) => {
|
|
19507
|
+
if (openedMenus.value.includes(index))
|
|
19508
|
+
return;
|
|
19509
|
+
if (props.uniqueOpened) {
|
|
19510
|
+
openedMenus.value = openedMenus.value.filter((index2) => indexPath.includes(index2));
|
|
19511
|
+
}
|
|
19512
|
+
openedMenus.value.push(index);
|
|
19513
|
+
};
|
|
19514
|
+
const closeMenu = (index, indexPath) => {
|
|
19515
|
+
const i = openedMenus.value.indexOf(index);
|
|
19516
|
+
if (i !== -1) {
|
|
19517
|
+
openedMenus.value.splice(i, 1);
|
|
19518
|
+
}
|
|
19519
|
+
};
|
|
19520
|
+
const updateActiveIndex = (val) => {
|
|
19521
|
+
const itemsInData = items.value;
|
|
19522
|
+
const item = itemsInData[val] || activeIndex.value && itemsInData[activeIndex.value] || itemsInData[props.defaultActive];
|
|
19523
|
+
if (item) {
|
|
19524
|
+
activeIndex.value = item.index;
|
|
19525
|
+
initMenu();
|
|
19526
|
+
} else {
|
|
19527
|
+
activeIndex.value = val;
|
|
19528
|
+
}
|
|
19529
|
+
};
|
|
19530
|
+
const handleResize = () => {
|
|
19531
|
+
nextTick(() => instance.proxy.$forceUpdate());
|
|
19465
19532
|
};
|
|
19533
|
+
watch(() => props.defaultActive, (currentActive) => {
|
|
19534
|
+
if (!items.value[currentActive]) {
|
|
19535
|
+
activeIndex.value = "";
|
|
19536
|
+
}
|
|
19537
|
+
updateActiveIndex(currentActive);
|
|
19538
|
+
});
|
|
19539
|
+
watch(items.value, () => initMenu());
|
|
19540
|
+
watch(() => props.collapse, (value) => {
|
|
19541
|
+
if (value)
|
|
19542
|
+
openedMenus.value = [];
|
|
19543
|
+
});
|
|
19466
19544
|
{
|
|
19545
|
+
const addSubMenu = (item) => {
|
|
19546
|
+
subMenus.value[item.index] = item;
|
|
19547
|
+
};
|
|
19548
|
+
const removeSubMenu = (item) => {
|
|
19549
|
+
delete subMenus.value[item.index];
|
|
19550
|
+
};
|
|
19551
|
+
const addMenuItem = (item) => {
|
|
19552
|
+
items.value[item.index] = item;
|
|
19553
|
+
};
|
|
19554
|
+
const removeMenuItem = (item) => {
|
|
19555
|
+
delete items.value[item.index];
|
|
19556
|
+
};
|
|
19467
19557
|
provide("rootMenu", reactive({
|
|
19468
19558
|
props,
|
|
19469
19559
|
openedMenus,
|
|
19470
19560
|
items,
|
|
19471
19561
|
subMenus,
|
|
19472
19562
|
activeIndex,
|
|
19473
|
-
isMenuPopup
|
|
19563
|
+
isMenuPopup,
|
|
19564
|
+
addMenuItem,
|
|
19565
|
+
removeMenuItem,
|
|
19566
|
+
addSubMenu,
|
|
19567
|
+
removeSubMenu,
|
|
19568
|
+
openMenu,
|
|
19569
|
+
closeMenu
|
|
19474
19570
|
}));
|
|
19475
19571
|
provide(`subMenu:${instance.uid}`, {
|
|
19572
|
+
addSubMenu,
|
|
19573
|
+
removeSubMenu,
|
|
19476
19574
|
mouseInChild: ref(false)
|
|
19477
19575
|
});
|
|
19478
19576
|
}
|
|
@@ -19482,6 +19580,17 @@ var Menu = defineComponent({
|
|
|
19482
19580
|
new Menubar(instance.vnode.el, nsMenu.namespace.value);
|
|
19483
19581
|
}
|
|
19484
19582
|
});
|
|
19583
|
+
{
|
|
19584
|
+
const open = (index) => {
|
|
19585
|
+
const { indexPath } = subMenus.value[index];
|
|
19586
|
+
indexPath.forEach((i) => openMenu(i, indexPath));
|
|
19587
|
+
};
|
|
19588
|
+
expose({
|
|
19589
|
+
open,
|
|
19590
|
+
close: closeMenu,
|
|
19591
|
+
handleResize
|
|
19592
|
+
});
|
|
19593
|
+
}
|
|
19485
19594
|
const flattedChildren = (children) => {
|
|
19486
19595
|
const vnodes = Array.isArray(children) ? children : [children];
|
|
19487
19596
|
const result = [];
|
|
@@ -19494,7 +19603,7 @@ var Menu = defineComponent({
|
|
|
19494
19603
|
});
|
|
19495
19604
|
return result;
|
|
19496
19605
|
};
|
|
19497
|
-
const useVNodeResize = (vnode) => vnode;
|
|
19606
|
+
const useVNodeResize = (vnode) => props.mode === "horizontal" ? withDirectives(vnode, [[Resize, handleResize]]) : vnode;
|
|
19498
19607
|
return () => {
|
|
19499
19608
|
var _a, _b, _c, _d;
|
|
19500
19609
|
let slot = (_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : [];
|
|
@@ -19540,7 +19649,8 @@ var Menu = defineComponent({
|
|
|
19540
19649
|
[nsMenu.b()]: true,
|
|
19541
19650
|
[nsMenu.m("horizontal")]: props.mode === "horizontal",
|
|
19542
19651
|
[nsMenu.m("collapse")]: props.collapse
|
|
19543
|
-
}
|
|
19652
|
+
},
|
|
19653
|
+
widget: props.widget
|
|
19544
19654
|
}, [...slot, ...vShowMore]));
|
|
19545
19655
|
if (props.collapseTransition && props.mode === "vertical") {
|
|
19546
19656
|
return h$1(PsMenuCollapseTransition, () => vMenu);
|
|
@@ -19581,11 +19691,19 @@ const _sfc_main$T = defineComponent({
|
|
|
19581
19691
|
if (!subMenu)
|
|
19582
19692
|
throwError(COMPONENT_NAME$8, "can not inject sub menu");
|
|
19583
19693
|
const active = computed(() => props.index === rootMenu.activeIndex);
|
|
19584
|
-
reactive({
|
|
19694
|
+
const item = reactive({
|
|
19585
19695
|
index: props.index,
|
|
19586
19696
|
indexPath,
|
|
19587
19697
|
active
|
|
19588
19698
|
});
|
|
19699
|
+
onMounted(() => {
|
|
19700
|
+
subMenu.addSubMenu(item);
|
|
19701
|
+
rootMenu.addMenuItem(item);
|
|
19702
|
+
});
|
|
19703
|
+
onBeforeUnmount(() => {
|
|
19704
|
+
subMenu.removeSubMenu(item);
|
|
19705
|
+
rootMenu.removeMenuItem(item);
|
|
19706
|
+
});
|
|
19589
19707
|
return {
|
|
19590
19708
|
Effect,
|
|
19591
19709
|
parentMenu,
|
|
@@ -31735,7 +31853,8 @@ const TabNav = defineComponent({
|
|
|
31735
31853
|
if (closable && (ev.code === EVENT_CODE.delete || ev.code === EVENT_CODE.backspace)) {
|
|
31736
31854
|
props.onTabRemove(pane, ev);
|
|
31737
31855
|
}
|
|
31738
|
-
}
|
|
31856
|
+
},
|
|
31857
|
+
"widget": pane.props.widget ? "tab-pane:label:" + pane.props.widget.split(":")[1] : void 0
|
|
31739
31858
|
}, [...[tabLabelContent, btnClose]]);
|
|
31740
31859
|
});
|
|
31741
31860
|
return createVNode("div", {
|
|
@@ -31851,8 +31970,38 @@ var Tabs = defineComponent({
|
|
|
31851
31970
|
panes.value = [];
|
|
31852
31971
|
}
|
|
31853
31972
|
};
|
|
31973
|
+
const changeCurrentName = (value) => {
|
|
31974
|
+
currentName.value = value;
|
|
31975
|
+
emit(INPUT_EVENT, value);
|
|
31976
|
+
emit(UPDATE_MODEL_EVENT, value);
|
|
31977
|
+
emit("tab-change", value);
|
|
31978
|
+
};
|
|
31979
|
+
const setCurrentName = (value) => {
|
|
31980
|
+
var _a;
|
|
31981
|
+
if (currentName.value === value)
|
|
31982
|
+
return;
|
|
31983
|
+
const canLeave = (_a = props.beforeLeave) == null ? void 0 : _a.call(props, value, currentName.value);
|
|
31984
|
+
if (isPromise(canLeave)) {
|
|
31985
|
+
canLeave.then(() => {
|
|
31986
|
+
var _a2, _b;
|
|
31987
|
+
changeCurrentName(value);
|
|
31988
|
+
(_b = (_a2 = nav$.value) == null ? void 0 : _a2.removeFocus) == null ? void 0 : _b.call(_a2);
|
|
31989
|
+
}, NOOP);
|
|
31990
|
+
} else if (canLeave !== false) {
|
|
31991
|
+
changeCurrentName(value);
|
|
31992
|
+
}
|
|
31993
|
+
};
|
|
31854
31994
|
onUpdated(() => updatePaneInstances());
|
|
31855
31995
|
onMounted(() => updatePaneInstances());
|
|
31996
|
+
watch(() => props.activeName, (modelValue) => setCurrentName(modelValue));
|
|
31997
|
+
watch(() => props.modelValue, (modelValue) => setCurrentName(modelValue));
|
|
31998
|
+
watch(currentName, async () => {
|
|
31999
|
+
var _a, _b;
|
|
32000
|
+
updatePaneInstances(true);
|
|
32001
|
+
await nextTick();
|
|
32002
|
+
await ((_a = nav$.value) == null ? void 0 : _a.$nextTick());
|
|
32003
|
+
(_b = nav$.value) == null ? void 0 : _b.scrollToActiveTab();
|
|
32004
|
+
});
|
|
31856
32005
|
provide(tabsRootContextKey, {
|
|
31857
32006
|
props,
|
|
31858
32007
|
currentName,
|
|
@@ -31904,10 +32053,11 @@ const tabPaneProps = buildProps({
|
|
|
31904
32053
|
},
|
|
31905
32054
|
closable: Boolean,
|
|
31906
32055
|
disabled: Boolean,
|
|
31907
|
-
lazy: Boolean
|
|
32056
|
+
lazy: Boolean,
|
|
32057
|
+
widget: String
|
|
31908
32058
|
});
|
|
31909
32059
|
|
|
31910
|
-
const _hoisted_1$6 = ["id", "aria-hidden", "aria-labelledby"];
|
|
32060
|
+
const _hoisted_1$6 = ["id", "aria-hidden", "aria-labelledby", "widget"];
|
|
31911
32061
|
const __default__$9 = {
|
|
31912
32062
|
name: "PsTabPane"
|
|
31913
32063
|
};
|
|
@@ -31948,7 +32098,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
31948
32098
|
class: normalizeClass(unref(ns).b()),
|
|
31949
32099
|
role: "tabpanel",
|
|
31950
32100
|
"aria-hidden": !unref(active),
|
|
31951
|
-
"aria-labelledby": `tab-${unref(paneName)}
|
|
32101
|
+
"aria-labelledby": `tab-${unref(paneName)}`,
|
|
32102
|
+
widget: _ctx.widget ? "tab-pane:default:" + _ctx.widget.split(":")[1] : void 0
|
|
31952
32103
|
}, [
|
|
31953
32104
|
renderSlot(_ctx.$slots, "default")
|
|
31954
32105
|
], 10, _hoisted_1$6)), [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Affix from './src/
|
|
3
|
-
export { affixProps } from './src/
|
|
2
|
+
import Affix from './src/affix.mjs';
|
|
3
|
+
export { affixProps } from './src/affix2.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const PsAffix = withInstall(Affix);
|
|
@@ -1,25 +1,88 @@
|
|
|
1
|
+
import { defineComponent, shallowRef, ref, computed, onMounted, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createElementVNode, renderSlot } from 'vue';
|
|
2
|
+
import { useWindowSize, useElementBounding } from '@vueuse/core';
|
|
1
3
|
import '../../../utils/index.mjs';
|
|
2
|
-
import
|
|
4
|
+
import '../../../hooks/index.mjs';
|
|
5
|
+
import { affixProps } from './affix2.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
|
+
import { throwError } from '../../../utils/error.mjs';
|
|
9
|
+
import { getScrollContainer } from '../../../utils/dom/scroll.mjs';
|
|
3
10
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
const __default__ = {
|
|
12
|
+
name: "PsAffix"
|
|
13
|
+
};
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
...__default__,
|
|
16
|
+
props: affixProps,
|
|
17
|
+
setup(__props, { expose }) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const COMPONENT_NAME = "PsAffix";
|
|
20
|
+
const ns = useNamespace("affix");
|
|
21
|
+
const target = shallowRef();
|
|
22
|
+
const root = shallowRef();
|
|
23
|
+
const scrollContainer = shallowRef();
|
|
24
|
+
const { height: windowHeight } = useWindowSize();
|
|
25
|
+
const {
|
|
26
|
+
height: rootHeight,
|
|
27
|
+
width: rootWidth,
|
|
28
|
+
top: rootTop,
|
|
29
|
+
bottom: rootBottom,
|
|
30
|
+
update: updateRoot
|
|
31
|
+
} = useElementBounding(root);
|
|
32
|
+
const targetRect = useElementBounding(target);
|
|
33
|
+
const fixed = ref(false);
|
|
34
|
+
const scrollTop = ref(0);
|
|
35
|
+
const transform = ref(0);
|
|
36
|
+
const rootStyle = computed(() => {
|
|
37
|
+
return {
|
|
38
|
+
height: fixed.value ? `${rootHeight.value}px` : "",
|
|
39
|
+
width: fixed.value ? `${rootWidth.value}px` : ""
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
const affixStyle = computed(() => {
|
|
43
|
+
if (!fixed.value)
|
|
44
|
+
return {};
|
|
45
|
+
const offset = props.offset ? `${props.offset}px` : 0;
|
|
46
|
+
return {
|
|
47
|
+
height: `${rootHeight.value}px`,
|
|
48
|
+
width: `${rootWidth.value}px`,
|
|
49
|
+
top: props.position === "top" ? offset : "",
|
|
50
|
+
bottom: props.position === "bottom" ? offset : "",
|
|
51
|
+
transform: transform.value ? `translateY(${transform.value}px)` : "",
|
|
52
|
+
zIndex: props.zIndex
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
onMounted(() => {
|
|
56
|
+
var _a;
|
|
57
|
+
if (props.target) {
|
|
58
|
+
target.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
|
|
59
|
+
if (!target.value)
|
|
60
|
+
throwError(COMPONENT_NAME, `Target is not existed: ${props.target}`);
|
|
61
|
+
} else {
|
|
62
|
+
target.value = document.documentElement;
|
|
63
|
+
}
|
|
64
|
+
scrollContainer.value = getScrollContainer(root.value, true);
|
|
65
|
+
updateRoot();
|
|
66
|
+
});
|
|
67
|
+
expose({});
|
|
68
|
+
return (_ctx, _cache) => {
|
|
69
|
+
return openBlock(), createElementBlock("div", {
|
|
70
|
+
ref_key: "root",
|
|
71
|
+
ref: root,
|
|
72
|
+
class: normalizeClass(unref(ns).b()),
|
|
73
|
+
style: normalizeStyle(unref(rootStyle))
|
|
74
|
+
}, [
|
|
75
|
+
createElementVNode("div", {
|
|
76
|
+
class: normalizeClass({ [unref(ns).m("fixed")]: fixed.value }),
|
|
77
|
+
style: normalizeStyle(unref(affixStyle))
|
|
78
|
+
}, [
|
|
79
|
+
renderSlot(_ctx.$slots, "default")
|
|
80
|
+
], 6)
|
|
81
|
+
], 6);
|
|
82
|
+
};
|
|
21
83
|
}
|
|
22
84
|
});
|
|
85
|
+
var Affix = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/affix/src/affix.vue"]]);
|
|
23
86
|
|
|
24
|
-
export {
|
|
87
|
+
export { Affix as default };
|
|
25
88
|
//# sourceMappingURL=affix.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affix.mjs","sources":["../../../../../../packages/components/affix/src/affix.
|
|
1
|
+
{"version":3,"file":"affix.mjs","sources":["../../../../../../packages/components/affix/src/affix.vue"],"sourcesContent":["<template>\n <div ref=\"root\" :class=\"ns.b()\" :style=\"rootStyle\">\n <div :class=\"{ [ns.m('fixed')]: fixed }\" :style=\"affixStyle\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, shallowRef, watch, watchEffect } from 'vue'\nimport {\n useElementBounding,\n useWindowSize,\n} from '@vueuse/core'\nimport { getScrollContainer, throwError } from '@element-ps/utils'\nimport { useNamespace } from '@element-ps/hooks'\nimport { affixProps } from './affix'\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'PsAffix'\ndefineOptions({\n name: 'PsAffix',\n})\n\nconst props = defineProps(affixProps)\n\nconst ns = useNamespace('affix')\n\nconst target = shallowRef<HTMLElement>()\nconst root = shallowRef<HTMLDivElement>()\nconst scrollContainer = shallowRef<HTMLElement | Window>()\nconst { height: windowHeight } = useWindowSize()\nconst {\n height: rootHeight,\n width: rootWidth,\n top: rootTop,\n bottom: rootBottom,\n update: updateRoot,\n} = useElementBounding(root)\nconst targetRect = useElementBounding(target)\n\nconst fixed = ref(false)\nconst scrollTop = ref(0)\nconst transform = ref(0)\n\nconst rootStyle = computed<CSSProperties>(() => {\n return {\n height: fixed.value ? `${rootHeight.value}px` : '',\n width: fixed.value ? `${rootWidth.value}px` : '',\n }\n})\n\nconst affixStyle = computed<CSSProperties>(() => {\n if (!fixed.value) return {}\n\n const offset = props.offset ? `${props.offset}px` : 0\n return {\n height: `${rootHeight.value}px`,\n width: `${rootWidth.value}px`,\n top: props.position === 'top' ? offset : '',\n bottom: props.position === 'bottom' ? offset : '',\n transform: transform.value ? `translateY(${transform.value}px)` : '',\n zIndex: props.zIndex,\n }\n})\n\nonMounted(() => {\n if (props.target) {\n target.value =\n document.querySelector<HTMLElement>(props.target) ?? undefined\n if (!target.value)\n throwError(COMPONENT_NAME, `Target is not existed: ${props.target}`)\n } else {\n target.value = document.documentElement\n }\n scrollContainer.value = getScrollContainer(root.value!, true)\n updateRoot()\n})\n\ndefineExpose({\n /** @description update affix status */\n})\n</script>\n"],"names":[],"mappings":"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"}
|
|
@@ -1,88 +1,25 @@
|
|
|
1
|
-
import { defineComponent, shallowRef, ref, computed, onMounted, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createElementVNode, renderSlot } from 'vue';
|
|
2
|
-
import { useWindowSize, useElementBounding } from '@vueuse/core';
|
|
3
1
|
import '../../../utils/index.mjs';
|
|
4
|
-
import '../../../
|
|
5
|
-
import { affixProps } from './affix.mjs';
|
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
|
-
import { throwError } from '../../../utils/error.mjs';
|
|
9
|
-
import { getScrollContainer } from '../../../utils/dom/scroll.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
|
|
10
3
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
top: rootTop,
|
|
29
|
-
bottom: rootBottom,
|
|
30
|
-
update: updateRoot
|
|
31
|
-
} = useElementBounding(root);
|
|
32
|
-
const targetRect = useElementBounding(target);
|
|
33
|
-
const fixed = ref(false);
|
|
34
|
-
const scrollTop = ref(0);
|
|
35
|
-
const transform = ref(0);
|
|
36
|
-
const rootStyle = computed(() => {
|
|
37
|
-
return {
|
|
38
|
-
height: fixed.value ? `${rootHeight.value}px` : "",
|
|
39
|
-
width: fixed.value ? `${rootWidth.value}px` : ""
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
const affixStyle = computed(() => {
|
|
43
|
-
if (!fixed.value)
|
|
44
|
-
return {};
|
|
45
|
-
const offset = props.offset ? `${props.offset}px` : 0;
|
|
46
|
-
return {
|
|
47
|
-
height: `${rootHeight.value}px`,
|
|
48
|
-
width: `${rootWidth.value}px`,
|
|
49
|
-
top: props.position === "top" ? offset : "",
|
|
50
|
-
bottom: props.position === "bottom" ? offset : "",
|
|
51
|
-
transform: transform.value ? `translateY(${transform.value}px)` : "",
|
|
52
|
-
zIndex: props.zIndex
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
onMounted(() => {
|
|
56
|
-
var _a;
|
|
57
|
-
if (props.target) {
|
|
58
|
-
target.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
|
|
59
|
-
if (!target.value)
|
|
60
|
-
throwError(COMPONENT_NAME, `Target is not existed: ${props.target}`);
|
|
61
|
-
} else {
|
|
62
|
-
target.value = document.documentElement;
|
|
63
|
-
}
|
|
64
|
-
scrollContainer.value = getScrollContainer(root.value, true);
|
|
65
|
-
updateRoot();
|
|
66
|
-
});
|
|
67
|
-
expose({});
|
|
68
|
-
return (_ctx, _cache) => {
|
|
69
|
-
return openBlock(), createElementBlock("div", {
|
|
70
|
-
ref_key: "root",
|
|
71
|
-
ref: root,
|
|
72
|
-
class: normalizeClass(unref(ns).b()),
|
|
73
|
-
style: normalizeStyle(unref(rootStyle))
|
|
74
|
-
}, [
|
|
75
|
-
createElementVNode("div", {
|
|
76
|
-
class: normalizeClass({ [unref(ns).m("fixed")]: fixed.value }),
|
|
77
|
-
style: normalizeStyle(unref(affixStyle))
|
|
78
|
-
}, [
|
|
79
|
-
renderSlot(_ctx.$slots, "default")
|
|
80
|
-
], 6)
|
|
81
|
-
], 6);
|
|
82
|
-
};
|
|
4
|
+
const affixProps = buildProps({
|
|
5
|
+
zIndex: {
|
|
6
|
+
type: definePropType([Number, String]),
|
|
7
|
+
default: 100
|
|
8
|
+
},
|
|
9
|
+
target: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
offset: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 0
|
|
16
|
+
},
|
|
17
|
+
position: {
|
|
18
|
+
type: String,
|
|
19
|
+
values: ["top", "bottom"],
|
|
20
|
+
default: "top"
|
|
83
21
|
}
|
|
84
22
|
});
|
|
85
|
-
var Affix = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/affix/src/affix.vue"]]);
|
|
86
23
|
|
|
87
|
-
export {
|
|
24
|
+
export { affixProps };
|
|
88
25
|
//# sourceMappingURL=affix2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affix2.mjs","sources":["../../../../../../packages/components/affix/src/affix.
|
|
1
|
+
{"version":3,"file":"affix2.mjs","sources":["../../../../../../packages/components/affix/src/affix.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-ps/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { ZIndexProperty } from 'csstype'\nimport type Affix from './affix.vue'\n\nexport const affixProps = buildProps({\n zIndex: {\n type: definePropType<ZIndexProperty>([Number, String]),\n default: 100,\n },\n target: {\n type: String,\n default: '',\n },\n offset: {\n type: Number,\n default: 0,\n },\n position: {\n type: String,\n values: ['top', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type AffixProps = ExtractPropTypes<typeof affixProps>\n\nexport type AffixInstance = InstanceType<typeof Affix>\n"],"names":[],"mappings":";;;AACY,MAAC,UAAU,GAAG,UAAU,CAAC;AACrC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7B,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -2,7 +2,7 @@ import { NOOP } from '@vue/shared';
|
|
|
2
2
|
import '../../../utils/index.mjs';
|
|
3
3
|
import '../../tooltip/index.mjs';
|
|
4
4
|
import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
|
|
5
|
-
import { useTooltipContentProps } from '../../tooltip/src/
|
|
5
|
+
import { useTooltipContentProps } from '../../tooltip/src/tooltip.mjs';
|
|
6
6
|
|
|
7
7
|
const autocompleteProps = buildProps({
|
|
8
8
|
valueKey: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Backtop from './src/
|
|
3
|
-
export { backtopProps } from './src/
|
|
2
|
+
import Backtop from './src/backtop2.mjs';
|
|
3
|
+
export { backtopProps } from './src/backtop.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const PsBacktop = withInstall(Backtop);
|