element-pe 2.2.77 → 2.2.79
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.css +1 -1
- package/dist/index.full.js +157 -101
- package/dist/index.full.min.js +13 -13
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +13 -13
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +157 -101
- package/es/components/autocomplete/index.d.ts +3 -3
- package/es/components/autocomplete/src/autocomplete.mjs +1 -0
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +3 -3
- package/es/components/backtop/index.mjs +2 -2
- package/es/components/backtop/src/backtop.mjs +61 -23
- package/es/components/backtop/src/backtop.mjs.map +1 -1
- package/es/components/backtop/src/backtop2.mjs +23 -61
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/breadcrumb/index.d.ts +2 -6
- package/es/components/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb-item.mjs +56 -11
- package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item.vue.d.ts +1 -3
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -56
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/button/index.mjs +3 -3
- package/es/components/button/src/button-group.mjs +30 -6
- package/es/components/button/src/button-group.mjs.map +1 -1
- package/es/components/button/src/button-group2.mjs +6 -30
- package/es/components/button/src/button-group2.mjs.map +1 -1
- package/es/components/button/src/button.mjs +57 -76
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +76 -57
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel.mjs +56 -169
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel2.mjs +169 -56
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/cascader/index.d.ts +8 -6
- package/es/components/cascader/index.mjs +2 -2
- package/es/components/cascader/src/cascader.mjs +82 -640
- package/es/components/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader.vue.d.ts +4 -3
- package/es/components/cascader/src/cascader2.mjs +647 -82
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.mjs +7 -3
- package/es/components/cascader-panel/src/index.mjs.map +1 -1
- package/es/components/cascader-panel/src/menu.mjs +1 -1
- package/es/components/cascader-panel/src/node.mjs +209 -116
- package/es/components/cascader-panel/src/node.mjs.map +1 -1
- package/es/components/cascader-panel/src/node2.mjs +116 -209
- package/es/components/cascader-panel/src/node2.mjs.map +1 -1
- package/es/components/cascader-panel/src/store.mjs +1 -1
- package/es/components/checkbox/index.mjs +2 -2
- package/es/components/checkbox/src/checkbox-button.mjs +1 -1
- package/es/components/checkbox/src/checkbox.mjs +125 -54
- package/es/components/checkbox/src/checkbox.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox2.mjs +54 -125
- package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
- package/es/components/collapse/index.d.ts +6 -0
- package/es/components/collapse/src/collapse-item.vue.d.ts +3 -0
- package/es/components/collapse-transition/index.d.ts +6 -0
- package/es/components/collapse-transition/src/collapse-transition.mjs +15 -8
- package/es/components/collapse-transition/src/collapse-transition.mjs.map +1 -1
- package/es/components/collapse-transition/src/collapse-transition.vue.d.ts +3 -0
- package/es/components/color-picker/index.d.ts +3 -3
- package/es/components/color-picker/src/color-picker.vue.d.ts +3 -3
- package/es/components/countdown/index.mjs +2 -2
- package/es/components/countdown/src/countdown.mjs +23 -76
- package/es/components/countdown/src/countdown.mjs.map +1 -1
- package/es/components/countdown/src/countdown2.mjs +76 -23
- package/es/components/countdown/src/countdown2.mjs.map +1 -1
- package/es/components/date-picker/index.d.ts +1 -0
- package/es/components/date-picker/index.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.mjs +19 -2
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -0
- package/es/components/date-picker/src/date-picker.mjs.map +1 -1
- package/es/components/date-picker/src/instance.d.ts +8 -0
- package/es/components/date-picker/src/instance.mjs +2 -0
- package/es/components/date-picker/src/instance.mjs.map +1 -0
- package/es/components/date-picker/src/panel-utils.d.ts +2 -0
- package/es/components/descriptions/src/description2.mjs +1 -1
- package/es/components/descriptions/src/descriptions-row.mjs +64 -7
- package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
- package/es/components/descriptions/src/descriptions-row2.mjs +7 -64
- package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
- package/es/components/dialog/index.d.ts +48 -45
- package/es/components/dialog/src/dialog-content.d.ts +4 -4
- package/es/components/dialog/src/dialog-content.mjs +4 -16
- package/es/components/dialog/src/dialog-content.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content.vue.d.ts +20 -17
- package/es/components/dialog/src/dialog-content2.mjs +9 -8
- package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
- package/es/components/dialog/src/dialog.d.ts +7 -7
- package/es/components/dialog/src/dialog.mjs +3 -12
- package/es/components/dialog/src/dialog.mjs.map +1 -1
- package/es/components/dialog/src/dialog.vue.d.ts +48 -45
- package/es/components/divider/index.mjs +2 -2
- package/es/components/divider/src/divider.mjs +35 -17
- package/es/components/divider/src/divider.mjs.map +1 -1
- package/es/components/divider/src/divider2.mjs +17 -35
- package/es/components/divider/src/divider2.mjs.map +1 -1
- package/es/components/drawer/index.d.ts +21 -21
- package/es/components/drawer/src/drawer.d.ts +7 -7
- package/es/components/drawer/src/drawer.vue.d.ts +21 -21
- package/es/components/dropdown/index.d.ts +2 -2
- package/es/components/dropdown/index.mjs +2 -2
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown-item.mjs +1 -1
- package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +310 -105
- package/es/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.vue.d.ts +2 -2
- package/es/components/dropdown/src/dropdown2.mjs +105 -310
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/focus-trap/src/focus-trap.mjs +1 -1
- package/es/components/focus-trap/src/focus-trap.mjs.map +1 -1
- package/es/components/form/index.mjs +2 -2
- package/es/components/form/src/form-item.mjs +46 -328
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/form/src/form-item2.mjs +328 -46
- package/es/components/form/src/form-item2.mjs.map +1 -1
- package/es/components/icon/index.mjs +2 -2
- package/es/components/icon/src/icon.mjs +8 -36
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +36 -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 +227 -56
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +56 -227
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +28 -28
- package/es/components/input/index.d.ts +1 -2
- package/es/components/input/index.mjs +2 -2
- package/es/components/input/index.mjs.map +1 -1
- package/es/components/input/src/input.mjs +114 -468
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input2.mjs +468 -114
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/input/src/instance.d.ts +2 -0
- package/es/components/input/src/instance.mjs +2 -0
- package/es/components/input/src/instance.mjs.map +1 -0
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +21 -50
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +50 -21
- package/es/components/link/src/link2.mjs.map +1 -1
- 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 +97 -14
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +14 -97
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/menu/src/sub-menu.mjs +2 -0
- package/es/components/menu/src/sub-menu.mjs.map +1 -1
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +151 -67
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +67 -151
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +17 -103
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +103 -17
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper.mjs +60 -9
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper2.mjs +9 -60
- package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
- package/es/components/pagination/src/components/next.mjs +38 -19
- package/es/components/pagination/src/components/next.mjs.map +1 -1
- package/es/components/pagination/src/components/next2.mjs +19 -38
- package/es/components/pagination/src/components/next2.mjs.map +1 -1
- package/es/components/pagination/src/components/prev.mjs +38 -18
- package/es/components/pagination/src/components/prev.mjs.map +1 -1
- package/es/components/pagination/src/components/prev2.mjs +18 -38
- package/es/components/pagination/src/components/prev2.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes.mjs +70 -22
- package/es/components/pagination/src/components/sizes.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes.vue.d.ts +5 -5
- package/es/components/pagination/src/components/sizes2.mjs +22 -70
- package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +4 -4
- package/es/components/popconfirm/index.d.ts +3 -3
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
- package/es/components/popconfirm/src/popconfirm2.mjs +1 -1
- package/es/components/popover/index.d.ts +3 -3
- package/es/components/popover/src/popover.vue.d.ts +3 -3
- package/es/components/popover/src/popover2.mjs +1 -1
- package/es/components/popper/index.mjs +4 -4
- package/es/components/popper/src/arrow.mjs +39 -8
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +8 -39
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- package/es/components/popper/src/trigger.mjs +31 -121
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs +121 -31
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-button.mjs +1 -1
- package/es/components/radio/src/radio-button.mjs.map +1 -1
- package/es/components/radio/src/radio-group.mjs +42 -70
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +70 -42
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/rate/index.mjs +2 -2
- package/es/components/rate/src/rate.mjs +92 -258
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate2.mjs +258 -92
- package/es/components/rate/src/rate2.mjs.map +1 -1
- package/es/components/row/index.d.ts +18 -4
- package/es/components/row/src/row.d.ts +6 -1
- package/es/components/row/src/row.mjs +1 -1
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row.vue.d.ts +18 -4
- package/es/components/row/src/row2.mjs +1 -2
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/scrollbar/index.mjs +1 -1
- package/es/components/scrollbar/src/bar2.mjs +1 -1
- package/es/components/scrollbar/src/thumb.mjs +11 -134
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +134 -11
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/select/index.d.ts +5 -5
- package/es/components/select/src/select.mjs +16 -18
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/select.vue.d.ts +5 -5
- package/es/components/select/src/useSelect.d.ts +10 -4
- package/es/components/select/src/useSelect.mjs +31 -22
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/index.d.ts +4 -4
- package/es/components/select-v2/src/select.vue.d.ts +2 -2
- package/es/components/select-v2/src/useSelect.d.ts +2 -2
- package/es/components/slider/index.d.ts +5 -5
- package/es/components/slider/index.mjs +2 -2
- package/es/components/slider/src/button.mjs +94 -21
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button.vue.d.ts +1 -1
- package/es/components/slider/src/button2.mjs +21 -94
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/composables/use-slide.d.ts +4 -4
- package/es/components/slider/src/slider.mjs +96 -237
- package/es/components/slider/src/slider.mjs.map +1 -1
- package/es/components/slider/src/slider.vue.d.ts +5 -5
- package/es/components/slider/src/slider2.mjs +237 -96
- package/es/components/slider/src/slider2.mjs.map +1 -1
- package/es/components/switch/index.d.ts +36 -0
- package/es/components/switch/src/switch.d.ts +12 -0
- package/es/components/switch/src/switch.mjs +6 -0
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch.vue.d.ts +36 -0
- package/es/components/switch/src/switch2.mjs +11 -1
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/index.d.ts +1 -0
- package/es/components/table/src/filter-panel.vue.d.ts +2 -2
- package/es/components/table/src/table/utils-helper.d.ts +1 -0
- package/es/components/table/src/table/utils-helper.mjs +4 -0
- package/es/components/table/src/table/utils-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/events-helper.mjs +10 -2
- package/es/components/table/src/table-body/events-helper.mjs.map +1 -1
- package/es/components/table/src/table-column/watcher-helper.mjs +1 -0
- package/es/components/table/src/table-column/watcher-helper.mjs.map +1 -1
- package/es/components/table/src/table.mjs +2 -0
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +1 -0
- package/es/components/teleport/index.mjs +2 -2
- package/es/components/teleport/src/teleport.mjs +44 -18
- package/es/components/teleport/src/teleport.mjs.map +1 -1
- package/es/components/teleport/src/teleport2.mjs +18 -44
- package/es/components/teleport/src/teleport2.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +3 -3
- package/es/components/time-select/index.d.ts +20 -20
- package/es/components/time-select/index.mjs +1 -1
- package/es/components/time-select/src/time-select.mjs +55 -132
- package/es/components/time-select/src/time-select.mjs.map +1 -1
- package/es/components/time-select/src/time-select.vue.d.ts +10 -10
- package/es/components/time-select/src/time-select2.mjs +132 -55
- package/es/components/time-select/src/time-select2.mjs.map +1 -1
- package/es/components/timeline/index.mjs +2 -2
- package/es/components/timeline/src/timeline-item.mjs +72 -42
- package/es/components/timeline/src/timeline-item.mjs.map +1 -1
- package/es/components/timeline/src/timeline-item2.mjs +42 -72
- package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
- package/es/components/tooltip/index.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +151 -410
- package/es/components/tooltip/src/tooltip2.mjs +4 -3
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.mjs +1 -1
- package/es/components/tooltip/src/trigger2.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +4 -4
- package/es/components/tooltip-v2/src/content.mjs +50 -114
- package/es/components/tooltip-v2/src/content.mjs.map +1 -1
- package/es/components/tooltip-v2/src/content2.mjs +114 -50
- package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root.mjs +17 -82
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +82 -17
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +21 -78
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +78 -21
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/components/transfer/index.mjs +2 -2
- package/es/components/transfer/src/composables/use-check.mjs +1 -1
- package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +128 -19
- package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel2.mjs +19 -128
- package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
- package/es/components/transfer/src/transfer.mjs +69 -162
- package/es/components/transfer/src/transfer.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +162 -69
- package/es/components/transfer/src/transfer2.mjs.map +1 -1
- package/es/components/upload/src/upload.d.ts +1 -1
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/hooks/use-focus-controller/index.mjs +0 -1
- package/es/hooks/use-focus-controller/index.mjs.map +1 -1
- package/es/hooks/use-namespace/index.mjs +2 -2
- package/es/hooks/use-namespace/index.mjs.map +1 -1
- package/es/hooks/use-z-index/index.mjs +2 -2
- package/es/hooks/use-z-index/index.mjs.map +1 -1
- package/es/index.mjs +28 -28
- package/lib/components/autocomplete/index.d.ts +3 -3
- package/lib/components/autocomplete/src/autocomplete.js +1 -0
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +3 -3
- package/lib/components/backtop/index.js +2 -2
- package/lib/components/backtop/src/backtop.js +61 -24
- package/lib/components/backtop/src/backtop.js.map +1 -1
- package/lib/components/backtop/src/backtop2.js +24 -61
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/breadcrumb/index.d.ts +2 -6
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb-item.js +56 -11
- package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item.vue.d.ts +1 -3
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -56
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/button/index.js +3 -3
- package/lib/components/button/src/button-group.js +30 -6
- package/lib/components/button/src/button-group.js.map +1 -1
- package/lib/components/button/src/button-group2.js +6 -30
- package/lib/components/button/src/button-group2.js.map +1 -1
- package/lib/components/button/src/button.js +60 -76
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button2.js +76 -60
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel.js +57 -169
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel2.js +169 -57
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/cascader/index.d.ts +8 -6
- package/lib/components/cascader/index.js +2 -2
- package/lib/components/cascader/src/cascader.js +83 -640
- package/lib/components/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader.vue.d.ts +4 -3
- package/lib/components/cascader/src/cascader2.js +647 -83
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/cascader-panel/src/index.js +6 -2
- package/lib/components/cascader-panel/src/index.js.map +1 -1
- package/lib/components/cascader-panel/src/menu.js +1 -1
- package/lib/components/cascader-panel/src/node.js +209 -116
- package/lib/components/cascader-panel/src/node.js.map +1 -1
- package/lib/components/cascader-panel/src/node2.js +116 -209
- package/lib/components/cascader-panel/src/node2.js.map +1 -1
- package/lib/components/cascader-panel/src/store.js +1 -1
- package/lib/components/checkbox/index.js +2 -2
- package/lib/components/checkbox/src/checkbox-button.js +1 -1
- package/lib/components/checkbox/src/checkbox.js +125 -55
- package/lib/components/checkbox/src/checkbox.js.map +1 -1
- package/lib/components/checkbox/src/checkbox2.js +55 -125
- package/lib/components/checkbox/src/checkbox2.js.map +1 -1
- package/lib/components/collapse/index.d.ts +6 -0
- package/lib/components/collapse/src/collapse-item.vue.d.ts +3 -0
- package/lib/components/collapse-transition/index.d.ts +6 -0
- package/lib/components/collapse-transition/src/collapse-transition.js +15 -8
- package/lib/components/collapse-transition/src/collapse-transition.js.map +1 -1
- package/lib/components/collapse-transition/src/collapse-transition.vue.d.ts +3 -0
- package/lib/components/color-picker/index.d.ts +3 -3
- package/lib/components/color-picker/src/color-picker.vue.d.ts +3 -3
- package/lib/components/countdown/index.js +2 -2
- package/lib/components/countdown/src/countdown.js +24 -76
- package/lib/components/countdown/src/countdown.js.map +1 -1
- package/lib/components/countdown/src/countdown2.js +76 -24
- package/lib/components/countdown/src/countdown2.js.map +1 -1
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/date-picker/index.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.js +19 -2
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -0
- package/lib/components/date-picker/src/date-picker.js.map +1 -1
- package/lib/components/date-picker/src/instance.d.ts +8 -0
- package/lib/components/date-picker/src/instance.js +3 -0
- package/lib/components/date-picker/src/instance.js.map +1 -0
- package/lib/components/date-picker/src/panel-utils.d.ts +2 -0
- package/lib/components/descriptions/src/description2.js +1 -1
- package/lib/components/descriptions/src/descriptions-row.js +64 -7
- package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
- package/lib/components/descriptions/src/descriptions-row2.js +7 -64
- package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
- package/lib/components/dialog/index.d.ts +48 -45
- package/lib/components/dialog/src/dialog-content.d.ts +4 -4
- package/lib/components/dialog/src/dialog-content.js +4 -16
- package/lib/components/dialog/src/dialog-content.js.map +1 -1
- package/lib/components/dialog/src/dialog-content.vue.d.ts +20 -17
- package/lib/components/dialog/src/dialog-content2.js +9 -8
- package/lib/components/dialog/src/dialog-content2.js.map +1 -1
- package/lib/components/dialog/src/dialog.d.ts +7 -7
- package/lib/components/dialog/src/dialog.js +3 -12
- package/lib/components/dialog/src/dialog.js.map +1 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +48 -45
- package/lib/components/divider/index.js +2 -2
- package/lib/components/divider/src/divider.js +35 -17
- package/lib/components/divider/src/divider.js.map +1 -1
- package/lib/components/divider/src/divider2.js +17 -35
- package/lib/components/divider/src/divider2.js.map +1 -1
- package/lib/components/drawer/index.d.ts +21 -21
- package/lib/components/drawer/src/drawer.d.ts +7 -7
- package/lib/components/drawer/src/drawer.vue.d.ts +21 -21
- package/lib/components/dropdown/index.d.ts +2 -2
- package/lib/components/dropdown/index.js +2 -2
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown-item.js +1 -1
- package/lib/components/dropdown/src/dropdown-menu.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +310 -114
- package/lib/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.vue.d.ts +2 -2
- package/lib/components/dropdown/src/dropdown2.js +114 -310
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/focus-trap/src/focus-trap.js +1 -1
- package/lib/components/focus-trap/src/focus-trap.js.map +1 -1
- package/lib/components/form/index.js +2 -2
- package/lib/components/form/src/form-item.js +47 -332
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/form/src/form-item2.js +332 -47
- package/lib/components/form/src/form-item2.js.map +1 -1
- package/lib/components/icon/index.js +2 -2
- package/lib/components/icon/src/icon.js +8 -36
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +36 -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 +226 -56
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +56 -226
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +28 -28
- package/lib/components/input/index.d.ts +1 -2
- package/lib/components/input/index.js +2 -2
- package/lib/components/input/index.js.map +1 -1
- package/lib/components/input/src/input.js +114 -467
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input2.js +467 -114
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/input/src/instance.d.ts +2 -0
- package/lib/components/input/src/instance.js +3 -0
- package/lib/components/input/src/instance.js.map +1 -0
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +22 -50
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +50 -22
- package/lib/components/link/src/link2.js.map +1 -1
- 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 +97 -15
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +15 -97
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/menu/src/sub-menu.js +2 -0
- package/lib/components/menu/src/sub-menu.js.map +1 -1
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +150 -68
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +68 -150
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +18 -103
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +103 -18
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/pagination/src/components/jumper.js +60 -9
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/jumper2.js +9 -60
- package/lib/components/pagination/src/components/jumper2.js.map +1 -1
- package/lib/components/pagination/src/components/next.js +38 -19
- package/lib/components/pagination/src/components/next.js.map +1 -1
- package/lib/components/pagination/src/components/next2.js +19 -38
- package/lib/components/pagination/src/components/next2.js.map +1 -1
- package/lib/components/pagination/src/components/prev.js +38 -19
- package/lib/components/pagination/src/components/prev.js.map +1 -1
- package/lib/components/pagination/src/components/prev2.js +19 -38
- package/lib/components/pagination/src/components/prev2.js.map +1 -1
- package/lib/components/pagination/src/components/sizes.js +70 -22
- package/lib/components/pagination/src/components/sizes.js.map +1 -1
- package/lib/components/pagination/src/components/sizes.vue.d.ts +5 -5
- package/lib/components/pagination/src/components/sizes2.js +22 -70
- package/lib/components/pagination/src/components/sizes2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +4 -4
- package/lib/components/popconfirm/index.d.ts +3 -3
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
- package/lib/components/popconfirm/src/popconfirm2.js +1 -1
- package/lib/components/popover/index.d.ts +3 -3
- package/lib/components/popover/src/popover.vue.d.ts +3 -3
- package/lib/components/popover/src/popover2.js +1 -1
- package/lib/components/popper/index.js +4 -4
- package/lib/components/popper/src/arrow.js +39 -9
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +9 -39
- package/lib/components/popper/src/arrow2.js.map +1 -1
- package/lib/components/popper/src/trigger.js +32 -121
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger2.js +121 -32
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-button.js +1 -1
- package/lib/components/radio/src/radio-button.js.map +1 -1
- package/lib/components/radio/src/radio-group.js +43 -70
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +70 -43
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/rate/index.js +2 -2
- package/lib/components/rate/src/rate.js +92 -257
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate2.js +257 -92
- package/lib/components/rate/src/rate2.js.map +1 -1
- package/lib/components/row/index.d.ts +18 -4
- package/lib/components/row/src/row.d.ts +6 -1
- package/lib/components/row/src/row.js +1 -1
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row.vue.d.ts +18 -4
- package/lib/components/row/src/row2.js +1 -2
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/scrollbar/index.js +1 -1
- package/lib/components/scrollbar/src/bar2.js +1 -1
- package/lib/components/scrollbar/src/thumb.js +11 -134
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +134 -11
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/select/index.d.ts +5 -5
- package/lib/components/select/src/select.js +16 -18
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/select.vue.d.ts +5 -5
- package/lib/components/select/src/useSelect.d.ts +10 -4
- package/lib/components/select/src/useSelect.js +30 -21
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/index.d.ts +4 -4
- package/lib/components/select-v2/src/select.vue.d.ts +2 -2
- package/lib/components/select-v2/src/useSelect.d.ts +2 -2
- package/lib/components/slider/index.d.ts +5 -5
- package/lib/components/slider/index.js +2 -2
- package/lib/components/slider/src/button.js +94 -22
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button.vue.d.ts +1 -1
- package/lib/components/slider/src/button2.js +22 -94
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/composables/use-slide.d.ts +4 -4
- package/lib/components/slider/src/slider.js +97 -237
- package/lib/components/slider/src/slider.js.map +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +5 -5
- package/lib/components/slider/src/slider2.js +237 -97
- package/lib/components/slider/src/slider2.js.map +1 -1
- package/lib/components/switch/index.d.ts +36 -0
- package/lib/components/switch/src/switch.d.ts +12 -0
- package/lib/components/switch/src/switch.js +6 -0
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +36 -0
- package/lib/components/switch/src/switch2.js +11 -1
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/index.d.ts +1 -0
- package/lib/components/table/src/filter-panel.vue.d.ts +2 -2
- package/lib/components/table/src/table/utils-helper.d.ts +1 -0
- package/lib/components/table/src/table/utils-helper.js +4 -0
- package/lib/components/table/src/table/utils-helper.js.map +1 -1
- package/lib/components/table/src/table-body/events-helper.js +10 -2
- package/lib/components/table/src/table-body/events-helper.js.map +1 -1
- package/lib/components/table/src/table-column/watcher-helper.js +1 -0
- package/lib/components/table/src/table-column/watcher-helper.js.map +1 -1
- package/lib/components/table/src/table.js +2 -0
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +1 -0
- package/lib/components/teleport/index.js +2 -2
- package/lib/components/teleport/src/teleport.js +44 -18
- package/lib/components/teleport/src/teleport.js.map +1 -1
- package/lib/components/teleport/src/teleport2.js +18 -44
- package/lib/components/teleport/src/teleport2.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +3 -3
- package/lib/components/time-select/index.d.ts +20 -20
- package/lib/components/time-select/index.js +1 -1
- package/lib/components/time-select/src/time-select.js +55 -137
- package/lib/components/time-select/src/time-select.js.map +1 -1
- package/lib/components/time-select/src/time-select.vue.d.ts +10 -10
- package/lib/components/time-select/src/time-select2.js +137 -55
- package/lib/components/time-select/src/time-select2.js.map +1 -1
- package/lib/components/timeline/index.js +2 -2
- package/lib/components/timeline/src/timeline-item.js +72 -42
- package/lib/components/timeline/src/timeline-item.js.map +1 -1
- package/lib/components/timeline/src/timeline-item2.js +42 -72
- package/lib/components/timeline/src/timeline-item2.js.map +1 -1
- package/lib/components/tooltip/index.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +151 -410
- package/lib/components/tooltip/src/tooltip2.js +4 -3
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip/src/trigger.js +1 -1
- package/lib/components/tooltip/src/trigger2.js +1 -1
- package/lib/components/tooltip-v2/index.js +4 -4
- package/lib/components/tooltip-v2/src/content.js +50 -114
- package/lib/components/tooltip-v2/src/content.js.map +1 -1
- package/lib/components/tooltip-v2/src/content2.js +114 -50
- package/lib/components/tooltip-v2/src/content2.js.map +1 -1
- package/lib/components/tooltip-v2/src/root.js +17 -82
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +82 -17
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +21 -78
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +78 -21
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/components/transfer/index.js +2 -2
- package/lib/components/transfer/src/composables/use-check.js +1 -1
- package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +128 -21
- package/lib/components/transfer/src/transfer-panel.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel2.js +21 -128
- package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
- package/lib/components/transfer/src/transfer.js +73 -162
- package/lib/components/transfer/src/transfer.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +162 -73
- package/lib/components/transfer/src/transfer2.js.map +1 -1
- package/lib/components/upload/src/upload.d.ts +1 -1
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/hooks/use-focus-controller/index.js +0 -1
- package/lib/hooks/use-focus-controller/index.js.map +1 -1
- package/lib/hooks/use-namespace/index.js +1 -1
- package/lib/hooks/use-namespace/index.js.map +1 -1
- package/lib/hooks/use-z-index/index.js +1 -1
- package/lib/hooks/use-z-index/index.js.map +1 -1
- package/lib/index.js +28 -28
- package/package.json +1 -1
- package/theme-chalk/el-avatar.css +1 -1
- package/theme-chalk/el-input.css +1 -1
- package/theme-chalk/el-menu.css +1 -1
- package/theme-chalk/el-row.css +1 -1
- package/theme-chalk/el-tree.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/avatar.scss +1 -0
- package/theme-chalk/src/input.scss +1 -1
- package/theme-chalk/src/menu.scss +4 -6
- package/theme-chalk/src/row.scss +3 -0
- package/theme-chalk/src/tree.scss +1 -0
- package/web-types.json +1 -1
|
@@ -2,106 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var index = require('../../tooltip/index.js');
|
|
7
5
|
require('../../../utils/index.js');
|
|
8
|
-
require('../../../
|
|
9
|
-
var
|
|
10
|
-
var menuItem = require('./menu-item.js');
|
|
11
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
-
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
13
|
-
var error = require('../../../utils/error.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
7
|
+
var shared = require('@vue/shared');
|
|
14
8
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ElTooltip: index.ElTooltip
|
|
9
|
+
const menuItemProps = runtime.buildProps({
|
|
10
|
+
index: {
|
|
11
|
+
type: runtime.definePropType([String, null]),
|
|
12
|
+
default: null
|
|
20
13
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const rootMenu = vue.inject("rootMenu");
|
|
26
|
-
const nsMenu = index$1.useNamespace("menu");
|
|
27
|
-
const nsMenuItem = index$1.useNamespace("menu-item");
|
|
28
|
-
if (!rootMenu)
|
|
29
|
-
error.throwError(COMPONENT_NAME, "can not inject root menu");
|
|
30
|
-
const { parentMenu, indexPath } = useMenu["default"](instance, vue.toRef(props, "index"));
|
|
31
|
-
const subMenu = vue.inject(`subMenu:${parentMenu.value.uid}`);
|
|
32
|
-
if (!subMenu)
|
|
33
|
-
error.throwError(COMPONENT_NAME, "can not inject sub menu");
|
|
34
|
-
const active = vue.computed(() => props.index === rootMenu.activeIndex);
|
|
35
|
-
const item = vue.reactive({
|
|
36
|
-
index: props.index,
|
|
37
|
-
indexPath,
|
|
38
|
-
active
|
|
39
|
-
});
|
|
40
|
-
const handleClick = () => {
|
|
41
|
-
if (!props.disabled) {
|
|
42
|
-
rootMenu.handleMenuItemClick({
|
|
43
|
-
index: props.index,
|
|
44
|
-
indexPath: indexPath.value,
|
|
45
|
-
route: props.route
|
|
46
|
-
});
|
|
47
|
-
emit("click", item);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
vue.onMounted(() => {
|
|
51
|
-
subMenu.addSubMenu(item);
|
|
52
|
-
rootMenu.addMenuItem(item);
|
|
53
|
-
});
|
|
54
|
-
vue.onBeforeUnmount(() => {
|
|
55
|
-
subMenu.removeSubMenu(item);
|
|
56
|
-
rootMenu.removeMenuItem(item);
|
|
57
|
-
});
|
|
58
|
-
return {
|
|
59
|
-
parentMenu,
|
|
60
|
-
rootMenu,
|
|
61
|
-
active,
|
|
62
|
-
nsMenu,
|
|
63
|
-
nsMenuItem,
|
|
64
|
-
handleClick
|
|
65
|
-
};
|
|
66
|
-
}
|
|
14
|
+
route: {
|
|
15
|
+
type: runtime.definePropType([String, Object])
|
|
16
|
+
},
|
|
17
|
+
disabled: Boolean
|
|
67
18
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class: vue.normalizeClass([
|
|
72
|
-
_ctx.nsMenuItem.b(),
|
|
73
|
-
_ctx.nsMenuItem.is("active", _ctx.active),
|
|
74
|
-
_ctx.nsMenuItem.is("disabled", _ctx.disabled)
|
|
75
|
-
]),
|
|
76
|
-
role: "menuitem",
|
|
77
|
-
tabindex: "-1",
|
|
78
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
79
|
-
}, [
|
|
80
|
-
_ctx.parentMenu.type.name === "ElMenu" && _ctx.rootMenu.props.collapse && _ctx.$slots.title ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
|
|
81
|
-
key: 0,
|
|
82
|
-
effect: _ctx.rootMenu.props.popperEffect,
|
|
83
|
-
placement: "right",
|
|
84
|
-
"fallback-placements": ["left"],
|
|
85
|
-
persistent: ""
|
|
86
|
-
}, {
|
|
87
|
-
content: vue.withCtx(() => [
|
|
88
|
-
vue.renderSlot(_ctx.$slots, "title")
|
|
89
|
-
]),
|
|
90
|
-
default: vue.withCtx(() => [
|
|
91
|
-
vue.createElementVNode("div", {
|
|
92
|
-
class: vue.normalizeClass(_ctx.nsMenu.be("tooltip", "trigger"))
|
|
93
|
-
}, [
|
|
94
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
95
|
-
], 2)
|
|
96
|
-
]),
|
|
97
|
-
_: 3
|
|
98
|
-
}, 8, ["effect"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
99
|
-
vue.renderSlot(_ctx.$slots, "default"),
|
|
100
|
-
vue.renderSlot(_ctx.$slots, "title")
|
|
101
|
-
], 64))
|
|
102
|
-
], 2);
|
|
103
|
-
}
|
|
104
|
-
var MenuItem = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "D:\\workspace\\element-pe\\packages\\components\\menu\\src\\menu-item.vue"]]);
|
|
19
|
+
const menuItemEmits = {
|
|
20
|
+
click: (item) => shared.isString(item.index) && Array.isArray(item.indexPath)
|
|
21
|
+
};
|
|
105
22
|
|
|
106
|
-
exports
|
|
23
|
+
exports.menuItemEmits = menuItemEmits;
|
|
24
|
+
exports.menuItemProps = menuItemProps;
|
|
107
25
|
//# sourceMappingURL=menu-item2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item2.js","sources":["../../../../../../packages/components/menu/src/menu-item.
|
|
1
|
+
{"version":3,"file":"menu-item2.js","sources":["../../../../../../packages/components/menu/src/menu-item.ts"],"sourcesContent":["import { buildProps, definePropType, isString } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport type { MenuItemRegistered } from './types'\n\nexport const menuItemProps = buildProps({\n index: {\n type: definePropType<string | null>([String, null]),\n default: null,\n },\n route: {\n type: definePropType<RouteLocationRaw>([String, Object]),\n },\n disabled: Boolean,\n} as const)\nexport type MenuItemProps = ExtractPropTypes<typeof menuItemProps>\n\nexport const menuItemEmits = {\n click: (item: MenuItemRegistered) =>\n isString(item.index) && Array.isArray(item.indexPath),\n}\nexport type MenuItemEmits = typeof menuItemEmits\n"],"names":["buildProps","definePropType","isString"],"mappings":";;;;;;;;AACY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACxC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAEA,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,KAAK,EAAE,CAAC,IAAI,KAAKC,eAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;AACxE;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sub-menu.js","sources":["../../../../../../packages/components/menu/src/sub-menu.ts"],"sourcesContent":["import {\n Fragment,\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n vShow,\n withDirectives,\n} from 'vue'\nimport { watch } from '../../config-provider'\nimport { useTimeoutFn } from '@vueuse/core'\nimport ElCollapseTransition from '@element-plus/components/collapse-transition'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport {\n buildProps,\n iconPropType,\n isString,\n throwError,\n} from '@element-plus/utils'\nimport { useDeprecated, useNamespace } from '@element-plus/hooks'\nimport { ArrowDown, ArrowRight } from '@element-plus/icons-vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport useMenu from './use-menu'\nimport { useMenuCssVar } from './use-menu-css-var'\n\nimport type { Placement } from '@element-plus/components/popper'\nimport type { CSSProperties, ExtractPropTypes, VNodeArrayChildren } from 'vue'\nimport type { MenuProvider, SubMenuProvider } from './types'\n\nexport const subMenuProps = buildProps({\n index: {\n type: String,\n required: true,\n },\n showTimeout: {\n type: Number,\n default: 300,\n },\n hideTimeout: {\n type: Number,\n default: 300,\n },\n popperClass: String,\n disabled: Boolean,\n popperAppendToBody: {\n type: Boolean,\n default: undefined,\n },\n teleported: {\n type: Boolean,\n default: undefined,\n },\n popperOffset: {\n type: Number,\n default: 6,\n },\n expandCloseIcon: {\n type: iconPropType,\n },\n expandOpenIcon: {\n type: iconPropType,\n },\n collapseCloseIcon: {\n type: iconPropType,\n },\n collapseOpenIcon: {\n type: iconPropType,\n },\n} as const)\nexport type SubMenuProps = ExtractPropTypes<typeof subMenuProps>\n\nconst COMPONENT_NAME = 'ElSubMenu'\nexport default defineComponent({\n name: COMPONENT_NAME,\n props: subMenuProps,\n\n setup(props, { slots, expose }) {\n useDeprecated(\n {\n from: 'popper-append-to-body',\n replacement: 'teleported',\n scope: COMPONENT_NAME,\n version: '2.3.0',\n ref: 'https://element-plus.org/en-US/component/menu.html#submenu-attributes',\n },\n computed(() => props.popperAppendToBody !== undefined)\n )\n\n const instance = getCurrentInstance()!\n const { indexPath, parentMenu } = useMenu(\n instance,\n computed(() => props.index)\n )\n const nsMenu = useNamespace('menu')\n const nsSubMenu = useNamespace('sub-menu')\n\n // inject\n const rootMenu = inject<MenuProvider>('rootMenu')\n if (!rootMenu) throwError(COMPONENT_NAME, 'can not inject root menu')\n\n const subMenu = inject<SubMenuProvider>(`subMenu:${parentMenu.value!.uid}`)\n if (!subMenu) throwError(COMPONENT_NAME, 'can not inject sub menu')\n\n const items = ref<MenuProvider['items']>({})\n const subMenus = ref<MenuProvider['subMenus']>({})\n\n let timeout: (() => void) | undefined\n const mouseInChild = ref(false)\n const verticalTitleRef = ref<HTMLDivElement>()\n const vPopper = ref<InstanceType<typeof ElTooltip> | null>(null)\n\n // computed\n const currentPlacement = computed<Placement>(() =>\n mode.value === 'horizontal' && isFirstLevel.value\n ? 'bottom-start'\n : 'right-start'\n )\n const subMenuTitleIcon = computed(() => {\n return (mode.value === 'horizontal' && isFirstLevel.value) ||\n (mode.value === 'vertical' && !rootMenu.props.collapse)\n ? props.expandCloseIcon && props.expandOpenIcon\n ? opened.value\n ? props.expandOpenIcon\n : props.expandCloseIcon\n : ArrowDown\n : props.collapseCloseIcon && props.collapseOpenIcon\n ? opened.value\n ? props.collapseOpenIcon\n : props.collapseCloseIcon\n : ArrowRight\n })\n const isFirstLevel = computed(() => {\n return subMenu.level === 0\n })\n const appendToBody = computed(() => {\n const value = props.teleported ?? props.popperAppendToBody\n return value === undefined ? isFirstLevel.value : value\n })\n const menuTransitionName = computed(() =>\n rootMenu.props.collapse\n ? `${nsMenu.namespace.value}-zoom-in-left`\n : `${nsMenu.namespace.value}-zoom-in-top`\n )\n const fallbackPlacements = computed<Placement[]>(() =>\n mode.value === 'horizontal' && isFirstLevel.value\n ? [\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n 'right-start',\n 'left-start',\n ]\n : [\n 'right-start',\n 'left-start',\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n ]\n )\n const opened = computed(() => rootMenu.openedMenus.includes(props.index))\n const active = computed(() => {\n let isActive = false\n\n Object.values(items.value).forEach((item) => {\n if (item.active) {\n isActive = true\n }\n })\n\n Object.values(subMenus.value).forEach((subItem) => {\n if (subItem.active) {\n isActive = true\n }\n })\n\n return isActive\n })\n\n const backgroundColor = computed(() => rootMenu.props.backgroundColor || '')\n const activeTextColor = computed(() => rootMenu.props.activeTextColor || '')\n const textColor = computed(() => rootMenu.props.textColor || '')\n const mode = computed(() => rootMenu.props.mode)\n const item = reactive({\n index: props.index,\n indexPath,\n active,\n })\n\n const ulStyle = useMenuCssVar(rootMenu.props, subMenu.level + 1)\n const titleStyle = computed<CSSProperties>(() => {\n if (mode.value !== 'horizontal') {\n return {\n color: textColor.value,\n }\n }\n return {\n borderBottomColor: active.value\n ? rootMenu.props.activeTextColor\n ? activeTextColor.value\n : ''\n : 'transparent',\n color: active.value ? activeTextColor.value : textColor.value,\n }\n })\n\n // methods\n const doDestroy = () =>\n vPopper.value?.popperRef?.popperInstanceRef?.destroy()\n\n const handleCollapseToggle = (value: boolean) => {\n if (!value) {\n doDestroy()\n }\n }\n\n const handleClick = () => {\n if (\n (rootMenu.props.menuTrigger === 'hover' &&\n rootMenu.props.mode === 'horizontal') ||\n (rootMenu.props.collapse && rootMenu.props.mode === 'vertical') ||\n props.disabled\n )\n return\n\n rootMenu.handleSubMenuClick({\n index: props.index,\n indexPath: indexPath.value,\n active: active.value,\n })\n }\n\n const handleMouseenter = (\n event: MouseEvent | FocusEvent,\n showTimeout = props.showTimeout\n ) => {\n if (event.type === 'focus') {\n return\n }\n if (\n (rootMenu.props.menuTrigger === 'click' &&\n rootMenu.props.mode === 'horizontal') ||\n (!rootMenu.props.collapse && rootMenu.props.mode === 'vertical') ||\n props.disabled\n ) {\n return\n }\n subMenu.mouseInChild.value = true\n\n timeout?.()\n ;({ stop: timeout } = useTimeoutFn(() => {\n rootMenu.openMenu(props.index, indexPath.value)\n }, showTimeout))\n\n if (appendToBody.value) {\n parentMenu.value.vnode.el?.dispatchEvent(new MouseEvent('mouseenter'))\n }\n }\n\n const handleMouseleave = (deepDispatch = false) => {\n if (\n (rootMenu.props.menuTrigger === 'click' &&\n rootMenu.props.mode === 'horizontal') ||\n (!rootMenu.props.collapse && rootMenu.props.mode === 'vertical')\n ) {\n return\n }\n timeout?.()\n subMenu.mouseInChild.value = false\n ;({ stop: timeout } = useTimeoutFn(\n () =>\n !mouseInChild.value &&\n rootMenu.closeMenu(props.index, indexPath.value),\n props.hideTimeout\n ))\n\n if (appendToBody.value && deepDispatch) {\n if (instance.parent?.type.name === 'ElSubMenu') {\n subMenu.handleMouseleave?.(true)\n }\n }\n }\n\n watch(\n () => rootMenu.props.collapse,\n (value) => handleCollapseToggle(Boolean(value))\n )\n\n // provide\n {\n const addSubMenu: SubMenuProvider['addSubMenu'] = (item) => {\n subMenus.value[item.index] = item\n }\n const removeSubMenu: SubMenuProvider['removeSubMenu'] = (item) => {\n delete subMenus.value[item.index]\n }\n provide<SubMenuProvider>(`subMenu:${instance.uid}`, {\n addSubMenu,\n removeSubMenu,\n handleMouseleave,\n mouseInChild,\n level: subMenu.level + 1,\n })\n }\n\n // expose\n expose({\n opened,\n })\n\n // lifecycle\n onMounted(() => {\n rootMenu.addSubMenu(item)\n subMenu.addSubMenu(item)\n })\n\n onBeforeUnmount(() => {\n subMenu.removeSubMenu(item)\n rootMenu.removeSubMenu(item)\n })\n\n return () => {\n const titleTag: VNodeArrayChildren = [\n slots.title?.(),\n h(\n ElIcon,\n {\n class: nsSubMenu.e('icon-arrow'),\n style: {\n transform: opened.value\n ? (props.expandCloseIcon && props.expandOpenIcon) ||\n (props.collapseCloseIcon &&\n props.collapseOpenIcon &&\n rootMenu.props.collapse)\n ? 'none'\n : 'rotateZ(180deg)'\n : 'none',\n },\n },\n {\n default: () =>\n isString(subMenuTitleIcon.value)\n ? h(instance.appContext.components[subMenuTitleIcon.value])\n : h(subMenuTitleIcon.value),\n }\n ),\n ]\n\n // this render function is only used for bypass `Vue`'s compiler caused patching issue.\n // temporarily mark ElPopper as any due to type inconsistency.\n const child = rootMenu.isMenuPopup\n ? h(\n // TODO: correct popper's type.\n ElTooltip as any,\n {\n ref: vPopper,\n visible: opened.value,\n effect: 'light',\n pure: true,\n offset: props.popperOffset,\n showArrow: false,\n persistent: true,\n popperClass: props.popperClass,\n placement: currentPlacement.value,\n teleported: appendToBody.value,\n fallbackPlacements: fallbackPlacements.value,\n transition: menuTransitionName.value,\n gpuAcceleration: false,\n },\n {\n content: () =>\n h(\n 'div',\n {\n class: [\n nsMenu.m(mode.value),\n nsMenu.m('popup-container'),\n props.popperClass,\n ],\n onMouseenter: (evt: MouseEvent) =>\n handleMouseenter(evt, 100),\n onMouseleave: () => handleMouseleave(true),\n onFocus: (evt: FocusEvent) => handleMouseenter(evt, 100),\n },\n [\n h(\n 'ul',\n {\n class: [\n nsMenu.b(),\n nsMenu.m('popup'),\n nsMenu.m(`popup-${currentPlacement.value}`),\n ],\n style: ulStyle.value,\n },\n [slots.default?.()]\n ),\n ]\n ),\n default: () =>\n h(\n 'div',\n {\n class: nsSubMenu.e('title'),\n style: [\n titleStyle.value,\n { backgroundColor: backgroundColor.value },\n ],\n onClick: handleClick,\n },\n titleTag\n ),\n }\n )\n : h(Fragment, {}, [\n h(\n 'div',\n {\n class: nsSubMenu.e('title'),\n style: [\n titleStyle.value,\n { backgroundColor: backgroundColor.value },\n ],\n ref: verticalTitleRef,\n onClick: handleClick,\n },\n titleTag\n ),\n h(\n ElCollapseTransition,\n {},\n {\n default: () =>\n withDirectives(\n h(\n 'ul',\n {\n role: 'menu',\n class: [nsMenu.b(), nsMenu.m('inline')],\n style: ulStyle.value,\n },\n [slots.default?.()]\n ),\n [[vShow, opened.value]]\n ),\n }\n ),\n ])\n\n return h(\n 'li',\n {\n class: [\n nsSubMenu.b(),\n nsSubMenu.is('active', active.value),\n nsSubMenu.is('opened', opened.value),\n nsSubMenu.is('disabled', props.disabled),\n ],\n role: 'menuitem',\n ariaHaspopup: true,\n ariaExpanded: opened.value,\n onMouseenter: handleMouseenter,\n onMouseleave: () => handleMouseleave(true),\n onFocus: handleMouseenter,\n },\n [child]\n )\n }\n },\n})\n"],"names":["buildProps","iconPropType","defineComponent","useDeprecated","computed","getCurrentInstance","useMenu","useNamespace","inject","throwError","ref","ArrowDown","ArrowRight","reactive","useMenuCssVar","useTimeoutFn","watch","provide","onMounted","onBeforeUnmount","h","ElIcon","isString","ElTooltip","Fragment","ElCollapseTransition","withDirectives","vShow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BY,MAAC,YAAY,GAAGA,kBAAU,CAAC;AACvC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,EAAE,cAAc,EAAE;AAClB,IAAI,IAAI,EAAEA,iBAAY;AACtB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAEA,iBAAY;AACtB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,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D,QAAQ,OAAO,EAAE,gBAAgB;AACjC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AAClB,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC;;;;;"}
|
|
1
|
+
{"version":3,"file":"sub-menu.js","sources":["../../../../../../packages/components/menu/src/sub-menu.ts"],"sourcesContent":["import {\n Fragment,\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n vShow,\n withDirectives,\n} from 'vue'\nimport { watch } from '../../config-provider'\nimport { useTimeoutFn } from '@vueuse/core'\nimport ElCollapseTransition from '@element-plus/components/collapse-transition'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport {\n buildProps,\n iconPropType,\n isString,\n throwError,\n} from '@element-plus/utils'\nimport { useDeprecated, useNamespace } from '@element-plus/hooks'\nimport { ArrowDown, ArrowRight } from '@element-plus/icons-vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport useMenu from './use-menu'\nimport { useMenuCssVar } from './use-menu-css-var'\n\nimport type { Placement } from '@element-plus/components/popper'\nimport type { CSSProperties, ExtractPropTypes, VNodeArrayChildren } from 'vue'\nimport type { MenuProvider, SubMenuProvider } from './types'\n\nexport const subMenuProps = buildProps({\n index: {\n type: String,\n required: true,\n },\n showTimeout: {\n type: Number,\n default: 300,\n },\n hideTimeout: {\n type: Number,\n default: 300,\n },\n popperClass: String,\n disabled: Boolean,\n popperAppendToBody: {\n type: Boolean,\n default: undefined,\n },\n teleported: {\n type: Boolean,\n default: undefined,\n },\n popperOffset: {\n type: Number,\n default: 6,\n },\n expandCloseIcon: {\n type: iconPropType,\n },\n expandOpenIcon: {\n type: iconPropType,\n },\n collapseCloseIcon: {\n type: iconPropType,\n },\n collapseOpenIcon: {\n type: iconPropType,\n },\n} as const)\nexport type SubMenuProps = ExtractPropTypes<typeof subMenuProps>\n\nconst COMPONENT_NAME = 'ElSubMenu'\nexport default defineComponent({\n name: COMPONENT_NAME,\n props: subMenuProps,\n\n setup(props, { slots, expose }) {\n useDeprecated(\n {\n from: 'popper-append-to-body',\n replacement: 'teleported',\n scope: COMPONENT_NAME,\n version: '2.3.0',\n ref: 'https://element-plus.org/en-US/component/menu.html#submenu-attributes',\n },\n computed(() => props.popperAppendToBody !== undefined)\n )\n\n const instance = getCurrentInstance()!\n const { indexPath, parentMenu } = useMenu(\n instance,\n computed(() => props.index)\n )\n const nsMenu = useNamespace('menu')\n const nsSubMenu = useNamespace('sub-menu')\n\n // inject\n const rootMenu = inject<MenuProvider>('rootMenu')\n if (!rootMenu) throwError(COMPONENT_NAME, 'can not inject root menu')\n\n const subMenu = inject<SubMenuProvider>(`subMenu:${parentMenu.value!.uid}`)\n if (!subMenu) throwError(COMPONENT_NAME, 'can not inject sub menu')\n\n const items = ref<MenuProvider['items']>({})\n const subMenus = ref<MenuProvider['subMenus']>({})\n\n let timeout: (() => void) | undefined\n const mouseInChild = ref(false)\n const verticalTitleRef = ref<HTMLDivElement>()\n const vPopper = ref<InstanceType<typeof ElTooltip> | null>(null)\n\n // computed\n const currentPlacement = computed<Placement>(() =>\n mode.value === 'horizontal' && isFirstLevel.value\n ? 'bottom-start'\n : 'right-start'\n )\n const subMenuTitleIcon = computed(() => {\n return (mode.value === 'horizontal' && isFirstLevel.value) ||\n (mode.value === 'vertical' && !rootMenu.props.collapse)\n ? props.expandCloseIcon && props.expandOpenIcon\n ? opened.value\n ? props.expandOpenIcon\n : props.expandCloseIcon\n : ArrowDown\n : props.collapseCloseIcon && props.collapseOpenIcon\n ? opened.value\n ? props.collapseOpenIcon\n : props.collapseCloseIcon\n : ArrowRight\n })\n const isFirstLevel = computed(() => {\n return subMenu.level === 0\n })\n const appendToBody = computed(() => {\n const value = props.teleported ?? props.popperAppendToBody\n return value === undefined ? isFirstLevel.value : value\n })\n const menuTransitionName = computed(() =>\n rootMenu.props.collapse\n ? `${nsMenu.namespace.value}-zoom-in-left`\n : `${nsMenu.namespace.value}-zoom-in-top`\n )\n const fallbackPlacements = computed<Placement[]>(() =>\n mode.value === 'horizontal' && isFirstLevel.value\n ? [\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n 'right-start',\n 'left-start',\n ]\n : [\n 'right-start',\n 'right',\n 'right-end',\n 'left-start',\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n ]\n )\n const opened = computed(() => rootMenu.openedMenus.includes(props.index))\n const active = computed(() => {\n let isActive = false\n\n Object.values(items.value).forEach((item) => {\n if (item.active) {\n isActive = true\n }\n })\n\n Object.values(subMenus.value).forEach((subItem) => {\n if (subItem.active) {\n isActive = true\n }\n })\n\n return isActive\n })\n\n const backgroundColor = computed(() => rootMenu.props.backgroundColor || '')\n const activeTextColor = computed(() => rootMenu.props.activeTextColor || '')\n const textColor = computed(() => rootMenu.props.textColor || '')\n const mode = computed(() => rootMenu.props.mode)\n const item = reactive({\n index: props.index,\n indexPath,\n active,\n })\n\n const ulStyle = useMenuCssVar(rootMenu.props, subMenu.level + 1)\n const titleStyle = computed<CSSProperties>(() => {\n if (mode.value !== 'horizontal') {\n return {\n color: textColor.value,\n }\n }\n return {\n borderBottomColor: active.value\n ? rootMenu.props.activeTextColor\n ? activeTextColor.value\n : ''\n : 'transparent',\n color: active.value ? activeTextColor.value : textColor.value,\n }\n })\n\n // methods\n const doDestroy = () =>\n vPopper.value?.popperRef?.popperInstanceRef?.destroy()\n\n const handleCollapseToggle = (value: boolean) => {\n if (!value) {\n doDestroy()\n }\n }\n\n const handleClick = () => {\n if (\n (rootMenu.props.menuTrigger === 'hover' &&\n rootMenu.props.mode === 'horizontal') ||\n (rootMenu.props.collapse && rootMenu.props.mode === 'vertical') ||\n props.disabled\n )\n return\n\n rootMenu.handleSubMenuClick({\n index: props.index,\n indexPath: indexPath.value,\n active: active.value,\n })\n }\n\n const handleMouseenter = (\n event: MouseEvent | FocusEvent,\n showTimeout = props.showTimeout\n ) => {\n if (event.type === 'focus') {\n return\n }\n if (\n (rootMenu.props.menuTrigger === 'click' &&\n rootMenu.props.mode === 'horizontal') ||\n (!rootMenu.props.collapse && rootMenu.props.mode === 'vertical') ||\n props.disabled\n ) {\n return\n }\n subMenu.mouseInChild.value = true\n\n timeout?.()\n ;({ stop: timeout } = useTimeoutFn(() => {\n rootMenu.openMenu(props.index, indexPath.value)\n }, showTimeout))\n\n if (appendToBody.value) {\n parentMenu.value.vnode.el?.dispatchEvent(new MouseEvent('mouseenter'))\n }\n }\n\n const handleMouseleave = (deepDispatch = false) => {\n if (\n (rootMenu.props.menuTrigger === 'click' &&\n rootMenu.props.mode === 'horizontal') ||\n (!rootMenu.props.collapse && rootMenu.props.mode === 'vertical')\n ) {\n return\n }\n timeout?.()\n subMenu.mouseInChild.value = false\n ;({ stop: timeout } = useTimeoutFn(\n () =>\n !mouseInChild.value &&\n rootMenu.closeMenu(props.index, indexPath.value),\n props.hideTimeout\n ))\n\n if (appendToBody.value && deepDispatch) {\n if (instance.parent?.type.name === 'ElSubMenu') {\n subMenu.handleMouseleave?.(true)\n }\n }\n }\n\n watch(\n () => rootMenu.props.collapse,\n (value) => handleCollapseToggle(Boolean(value))\n )\n\n // provide\n {\n const addSubMenu: SubMenuProvider['addSubMenu'] = (item) => {\n subMenus.value[item.index] = item\n }\n const removeSubMenu: SubMenuProvider['removeSubMenu'] = (item) => {\n delete subMenus.value[item.index]\n }\n provide<SubMenuProvider>(`subMenu:${instance.uid}`, {\n addSubMenu,\n removeSubMenu,\n handleMouseleave,\n mouseInChild,\n level: subMenu.level + 1,\n })\n }\n\n // expose\n expose({\n opened,\n })\n\n // lifecycle\n onMounted(() => {\n rootMenu.addSubMenu(item)\n subMenu.addSubMenu(item)\n })\n\n onBeforeUnmount(() => {\n subMenu.removeSubMenu(item)\n rootMenu.removeSubMenu(item)\n })\n\n return () => {\n const titleTag: VNodeArrayChildren = [\n slots.title?.(),\n h(\n ElIcon,\n {\n class: nsSubMenu.e('icon-arrow'),\n style: {\n transform: opened.value\n ? (props.expandCloseIcon && props.expandOpenIcon) ||\n (props.collapseCloseIcon &&\n props.collapseOpenIcon &&\n rootMenu.props.collapse)\n ? 'none'\n : 'rotateZ(180deg)'\n : 'none',\n },\n },\n {\n default: () =>\n isString(subMenuTitleIcon.value)\n ? h(instance.appContext.components[subMenuTitleIcon.value])\n : h(subMenuTitleIcon.value),\n }\n ),\n ]\n\n // this render function is only used for bypass `Vue`'s compiler caused patching issue.\n // temporarily mark ElPopper as any due to type inconsistency.\n const child = rootMenu.isMenuPopup\n ? h(\n // TODO: correct popper's type.\n ElTooltip as any,\n {\n ref: vPopper,\n visible: opened.value,\n effect: 'light',\n pure: true,\n offset: props.popperOffset,\n showArrow: false,\n persistent: true,\n popperClass: props.popperClass,\n placement: currentPlacement.value,\n teleported: appendToBody.value,\n fallbackPlacements: fallbackPlacements.value,\n transition: menuTransitionName.value,\n gpuAcceleration: false,\n },\n {\n content: () =>\n h(\n 'div',\n {\n class: [\n nsMenu.m(mode.value),\n nsMenu.m('popup-container'),\n props.popperClass,\n ],\n onMouseenter: (evt: MouseEvent) =>\n handleMouseenter(evt, 100),\n onMouseleave: () => handleMouseleave(true),\n onFocus: (evt: FocusEvent) => handleMouseenter(evt, 100),\n },\n [\n h(\n 'ul',\n {\n class: [\n nsMenu.b(),\n nsMenu.m('popup'),\n nsMenu.m(`popup-${currentPlacement.value}`),\n ],\n style: ulStyle.value,\n },\n [slots.default?.()]\n ),\n ]\n ),\n default: () =>\n h(\n 'div',\n {\n class: nsSubMenu.e('title'),\n style: [\n titleStyle.value,\n { backgroundColor: backgroundColor.value },\n ],\n onClick: handleClick,\n },\n titleTag\n ),\n }\n )\n : h(Fragment, {}, [\n h(\n 'div',\n {\n class: nsSubMenu.e('title'),\n style: [\n titleStyle.value,\n { backgroundColor: backgroundColor.value },\n ],\n ref: verticalTitleRef,\n onClick: handleClick,\n },\n titleTag\n ),\n h(\n ElCollapseTransition,\n {},\n {\n default: () =>\n withDirectives(\n h(\n 'ul',\n {\n role: 'menu',\n class: [nsMenu.b(), nsMenu.m('inline')],\n style: ulStyle.value,\n },\n [slots.default?.()]\n ),\n [[vShow, opened.value]]\n ),\n }\n ),\n ])\n\n return h(\n 'li',\n {\n class: [\n nsSubMenu.b(),\n nsSubMenu.is('active', active.value),\n nsSubMenu.is('opened', opened.value),\n nsSubMenu.is('disabled', props.disabled),\n ],\n role: 'menuitem',\n ariaHaspopup: true,\n ariaExpanded: opened.value,\n onMouseenter: handleMouseenter,\n onMouseleave: () => handleMouseleave(true),\n onFocus: handleMouseenter,\n },\n [child]\n )\n }\n },\n})\n"],"names":["buildProps","iconPropType","defineComponent","useDeprecated","computed","getCurrentInstance","useMenu","useNamespace","inject","throwError","ref","ArrowDown","ArrowRight","reactive","useMenuCssVar","useTimeoutFn","watch","provide","onMounted","onBeforeUnmount","h","ElIcon","isString","ElTooltip","Fragment","ElCollapseTransition","withDirectives","vShow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BY,MAAC,YAAY,GAAGA,kBAAU,CAAC;AACvC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,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EAAE,MAAM,CAAC,KAAK,CAAC;AAC9C,UAAU,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;AAClD,SAAS;AACT,QAAQ,IAAI,EAAE,UAAU;AACxB,QAAQ,YAAY,EAAE,IAAI;AAC1B,QAAQ,YAAY,EAAE,MAAM,CAAC,KAAK;AAClC,QAAQ,YAAY,EAAE,gBAAgB;AACtC,QAAQ,YAAY,EAAE,MAAM,gBAAgB,CAAC,IAAI,CAAC;AAClD,QAAQ,OAAO,EAAE,gBAAgB;AACjC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AAClB,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC;;;;;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
6
|
var notify = require('./src/notify.js');
|
|
7
|
-
var notification = require('./src/
|
|
7
|
+
var notification = require('./src/notification2.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElNotification = install.withInstallFunction(notify["default"], "$notify");
|
|
@@ -2,77 +2,159 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var core = require('@vueuse/core');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
|
|
8
|
+
require('../../../constants/index.js');
|
|
9
|
+
var index = require('../../icon/index.js');
|
|
10
|
+
require('../../config-provider/index.js');
|
|
11
|
+
var notification = require('./notification2.js');
|
|
12
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
13
|
+
var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
|
|
7
14
|
var icon = require('../../../utils/vue/icon.js');
|
|
15
|
+
var aria = require('../../../constants/aria.js');
|
|
8
16
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const notificationProps = runtime.buildProps({
|
|
16
|
-
customClass: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: ""
|
|
19
|
-
},
|
|
20
|
-
dangerouslyUseHTMLString: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
duration: {
|
|
25
|
-
type: Number,
|
|
26
|
-
default: 4500
|
|
27
|
-
},
|
|
28
|
-
icon: {
|
|
29
|
-
type: icon.iconPropType
|
|
30
|
-
},
|
|
31
|
-
id: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: ""
|
|
34
|
-
},
|
|
35
|
-
message: {
|
|
36
|
-
type: runtime.definePropType([String, Object]),
|
|
37
|
-
default: ""
|
|
38
|
-
},
|
|
39
|
-
offset: {
|
|
40
|
-
type: Number,
|
|
41
|
-
default: 0
|
|
42
|
-
},
|
|
43
|
-
onClick: {
|
|
44
|
-
type: runtime.definePropType(Function),
|
|
45
|
-
default: () => void 0
|
|
46
|
-
},
|
|
47
|
-
onClose: {
|
|
48
|
-
type: runtime.definePropType(Function),
|
|
49
|
-
required: true
|
|
50
|
-
},
|
|
51
|
-
position: {
|
|
52
|
-
type: String,
|
|
53
|
-
values: ["top-right", "top-left", "bottom-right", "bottom-left"],
|
|
54
|
-
default: "top-right"
|
|
55
|
-
},
|
|
56
|
-
showClose: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: true
|
|
59
|
-
},
|
|
60
|
-
title: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: ""
|
|
63
|
-
},
|
|
64
|
-
type: {
|
|
65
|
-
type: String,
|
|
66
|
-
values: [...notificationTypes, ""],
|
|
67
|
-
default: ""
|
|
68
|
-
},
|
|
69
|
-
zIndex: Number
|
|
17
|
+
const _hoisted_1 = ["id"];
|
|
18
|
+
const _hoisted_2 = ["textContent"];
|
|
19
|
+
const _hoisted_3 = { key: 0 };
|
|
20
|
+
const _hoisted_4 = ["innerHTML"];
|
|
21
|
+
const __default__ = vue.defineComponent({
|
|
22
|
+
name: "ElNotification"
|
|
70
23
|
});
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
24
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
25
|
+
...__default__,
|
|
26
|
+
props: notification.notificationProps,
|
|
27
|
+
emits: notification.notificationEmits,
|
|
28
|
+
setup(__props, { expose }) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const forEditor = useGlobalConfig.useGlobalConfig("forEditor");
|
|
31
|
+
const { ns, zIndex } = useGlobalConfig.useGlobalComponentSettings("notification");
|
|
32
|
+
const { nextZIndex, currentZIndex } = zIndex;
|
|
33
|
+
const { Close } = icon.CloseComponents;
|
|
34
|
+
const visible = vue.ref(false);
|
|
35
|
+
let timer = void 0;
|
|
36
|
+
const typeClass = vue.computed(() => {
|
|
37
|
+
const type = props.type;
|
|
38
|
+
return type && icon.TypeComponentsMap[props.type] ? ns.m(type) : "";
|
|
39
|
+
});
|
|
40
|
+
const iconComponent = vue.computed(() => {
|
|
41
|
+
if (!props.type)
|
|
42
|
+
return props.icon;
|
|
43
|
+
return icon.TypeComponentsMap[props.type] || props.icon;
|
|
44
|
+
});
|
|
45
|
+
const horizontalClass = vue.computed(() => props.position.endsWith("right") ? "right" : "left");
|
|
46
|
+
const verticalProperty = vue.computed(() => props.position.startsWith("top") ? "top" : "bottom");
|
|
47
|
+
const positionStyle = vue.computed(() => {
|
|
48
|
+
var _a;
|
|
49
|
+
return {
|
|
50
|
+
[verticalProperty.value]: `${props.offset}px`,
|
|
51
|
+
zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
function startTimer() {
|
|
55
|
+
if (props.duration > 0) {
|
|
56
|
+
;
|
|
57
|
+
({ stop: timer } = core.useTimeoutFn(() => {
|
|
58
|
+
if (visible.value)
|
|
59
|
+
close();
|
|
60
|
+
}, props.duration));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function clearTimer() {
|
|
64
|
+
timer == null ? void 0 : timer();
|
|
65
|
+
}
|
|
66
|
+
function close() {
|
|
67
|
+
visible.value = false;
|
|
68
|
+
}
|
|
69
|
+
function onKeydown({ code }) {
|
|
70
|
+
if (code === aria.EVENT_CODE.delete || code === aria.EVENT_CODE.backspace) {
|
|
71
|
+
clearTimer();
|
|
72
|
+
} else if (code === aria.EVENT_CODE.esc) {
|
|
73
|
+
if (visible.value) {
|
|
74
|
+
close();
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
startTimer();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
vue.onMounted(() => {
|
|
81
|
+
startTimer();
|
|
82
|
+
nextZIndex();
|
|
83
|
+
visible.value = true;
|
|
84
|
+
});
|
|
85
|
+
core.useEventListener(document, "keydown", onKeydown);
|
|
86
|
+
expose({
|
|
87
|
+
visible,
|
|
88
|
+
close
|
|
89
|
+
});
|
|
90
|
+
return (_ctx, _cache) => {
|
|
91
|
+
return vue.openBlock(), vue.createBlock(vue.Transition, {
|
|
92
|
+
name: vue.unref(ns).b("fade"),
|
|
93
|
+
onBeforeLeave: _ctx.onClose,
|
|
94
|
+
onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
|
|
95
|
+
duration: vue.unref(forEditor) ? -1 : 0,
|
|
96
|
+
persisted: ""
|
|
97
|
+
}, {
|
|
98
|
+
default: vue.withCtx(() => [
|
|
99
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
100
|
+
id: _ctx.id,
|
|
101
|
+
class: vue.normalizeClass([vue.unref(ns).b(), _ctx.customClass, vue.unref(horizontalClass)]),
|
|
102
|
+
style: vue.normalizeStyle(vue.unref(positionStyle)),
|
|
103
|
+
role: "alert",
|
|
104
|
+
onMouseenter: clearTimer,
|
|
105
|
+
onMouseleave: startTimer,
|
|
106
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
107
|
+
}, [
|
|
108
|
+
vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
|
|
109
|
+
key: 0,
|
|
110
|
+
class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(typeClass)])
|
|
111
|
+
}, {
|
|
112
|
+
default: vue.withCtx(() => [
|
|
113
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true),
|
|
117
|
+
vue.createElementVNode("div", {
|
|
118
|
+
class: vue.normalizeClass(vue.unref(ns).e("group"))
|
|
119
|
+
}, [
|
|
120
|
+
vue.createElementVNode("h2", {
|
|
121
|
+
class: vue.normalizeClass(vue.unref(ns).e("title")),
|
|
122
|
+
textContent: vue.toDisplayString(_ctx.title)
|
|
123
|
+
}, null, 10, _hoisted_2),
|
|
124
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
125
|
+
class: vue.normalizeClass(vue.unref(ns).e("content")),
|
|
126
|
+
style: vue.normalizeStyle(!!_ctx.title ? void 0 : { margin: 0 })
|
|
127
|
+
}, [
|
|
128
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
129
|
+
!_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3, vue.toDisplayString(_ctx.message), 1)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
130
|
+
vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
|
|
131
|
+
vue.createElementVNode("p", { innerHTML: _ctx.message }, null, 8, _hoisted_4)
|
|
132
|
+
], 2112))
|
|
133
|
+
])
|
|
134
|
+
], 6), [
|
|
135
|
+
[vue.vShow, _ctx.message]
|
|
136
|
+
]),
|
|
137
|
+
_ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
|
|
138
|
+
key: 0,
|
|
139
|
+
class: vue.normalizeClass(vue.unref(ns).e("closeBtn")),
|
|
140
|
+
onClick: vue.withModifiers(close, ["stop"])
|
|
141
|
+
}, {
|
|
142
|
+
default: vue.withCtx(() => [
|
|
143
|
+
vue.createVNode(vue.unref(Close))
|
|
144
|
+
]),
|
|
145
|
+
_: 1
|
|
146
|
+
}, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
|
|
147
|
+
], 2)
|
|
148
|
+
], 46, _hoisted_1), [
|
|
149
|
+
[vue.vShow, visible.value]
|
|
150
|
+
])
|
|
151
|
+
]),
|
|
152
|
+
_: 3
|
|
153
|
+
}, 8, ["name", "onBeforeLeave", "duration"]);
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
var NotificationConstructor = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\workspace\\element-pe\\packages\\components\\notification\\src\\notification.vue"]]);
|
|
74
158
|
|
|
75
|
-
exports
|
|
76
|
-
exports.notificationProps = notificationProps;
|
|
77
|
-
exports.notificationTypes = notificationTypes;
|
|
159
|
+
exports["default"] = NotificationConstructor;
|
|
78
160
|
//# sourceMappingURL=notification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","sources":["../../../../../../packages/components/notification/src/notification.
|
|
1
|
+
{"version":3,"file":"notification.js","sources":["../../../../../../packages/components/notification/src/notification.vue"],"sourcesContent":["<template>\n <transition\n :name=\"ns.b('fade')\"\n @before-leave=\"onClose\"\n @after-leave=\"$emit('destroy')\"\n :duration=\"forEditor ? -1 : 0\"\n >\n <div\n v-show=\"visible\"\n :id=\"id\"\n :class=\"[ns.b(), customClass, horizontalClass]\"\n :style=\"positionStyle\"\n role=\"alert\"\n @mouseenter=\"clearTimer\"\n @mouseleave=\"startTimer\"\n @click=\"onClick\"\n >\n <el-icon v-if=\"iconComponent\" :class=\"[ns.e('icon'), typeClass]\">\n <component :is=\"iconComponent\" />\n </el-icon>\n <div :class=\"ns.e('group')\">\n <h2 :class=\"ns.e('title')\" v-text=\"title\" />\n <div\n v-show=\"message\"\n :class=\"ns.e('content')\"\n :style=\"!!title ? undefined : { margin: 0 }\"\n >\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\">{{ message }}</p>\n <!-- Caution here, message could've been compromised, never use user's input as message -->\n <p v-else v-html=\"message\" />\n </slot>\n </div>\n <el-icon v-if=\"showClose\" :class=\"ns.e('closeBtn')\" @click.stop=\"close\">\n <Close />\n </el-icon>\n </div>\n </div>\n </transition>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref } from 'vue'\nimport { useEventListener, useTimeoutFn } from '@vueuse/core'\nimport { CloseComponents, TypeComponentsMap } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useGlobalComponentSettings, useGlobalConfig } from '../../config-provider'\nimport { notificationEmits, notificationProps } from './notification'\n\nimport type { CSSProperties } from 'vue'\n\nconst forEditor = useGlobalConfig('forEditor')\n\ndefineOptions({\n name: 'ElNotification',\n})\n\nconst props = defineProps(notificationProps)\ndefineEmits(notificationEmits)\n\nconst { ns, zIndex } = useGlobalComponentSettings('notification')\nconst { nextZIndex, currentZIndex } = zIndex\n\nconst { Close } = CloseComponents\n\nconst visible = ref(false)\nlet timer: (() => void) | undefined = undefined\n\nconst typeClass = computed(() => {\n const type = props.type\n return type && TypeComponentsMap[props.type] ? ns.m(type) : ''\n})\n\nconst iconComponent = computed(() => {\n if (!props.type) return props.icon\n return TypeComponentsMap[props.type] || props.icon\n})\n\nconst horizontalClass = computed(() =>\n props.position.endsWith('right') ? 'right' : 'left'\n)\n\nconst verticalProperty = computed(() =>\n props.position.startsWith('top') ? 'top' : 'bottom'\n)\n\nconst positionStyle = computed<CSSProperties>(() => {\n return {\n [verticalProperty.value]: `${props.offset}px`,\n zIndex: props.zIndex ?? currentZIndex.value,\n }\n})\n\nfunction startTimer() {\n if (props.duration > 0) {\n ;({ stop: timer } = useTimeoutFn(() => {\n if (visible.value) close()\n }, props.duration))\n }\n}\n\nfunction clearTimer() {\n timer?.()\n}\n\nfunction close() {\n visible.value = false\n}\n\nfunction onKeydown({ code }: KeyboardEvent) {\n if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {\n clearTimer() // press delete/backspace clear timer\n } else if (code === EVENT_CODE.esc) {\n // press esc to close the notification\n if (visible.value) {\n close()\n }\n } else {\n startTimer() // resume timer\n }\n}\n\n// lifecycle\nonMounted(() => {\n startTimer()\n nextZIndex()\n visible.value = true\n})\n\nuseEventListener(document, 'keydown', onKeydown)\n\ndefineExpose({\n visible,\n /** @description close notification */\n close,\n})\n</script>\n"],"names":["useGlobalConfig","useGlobalComponentSettings","CloseComponents","ref","computed","TypeComponentsMap","useTimeoutFn","EVENT_CODE","onMounted","useEventListener"],"mappings":";;;;;;;;;;;;;;;;;;;;uCAqDc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAJA,IAAM,MAAA,SAAA,GAAYA,gCAAgB,WAAW,CAAA,CAAA;AAS7C,IAAA,MAAM,EAAE,EAAA,EAAI,MAAW,EAAA,GAAAC,0CAAA,CAA2B,cAAc,CAAA,CAAA;AAChE,IAAM,MAAA,EAAE,YAAY,aAAkB,EAAA,GAAA,MAAA,CAAA;AAEtC,IAAA,MAAM,EAAE,KAAU,EAAA,GAAAC,oBAAA,CAAA;AAElB,IAAM,MAAA,OAAA,GAAUC,QAAI,KAAK,CAAA,CAAA;AACzB,IAAA,IAAI,KAAkC,GAAA,KAAA,CAAA,CAAA;AAEtC,IAAM,MAAA,SAAA,GAAYC,aAAS,MAAM;AAC/B,MAAA,MAAM,OAAO,KAAM,CAAA,IAAA,CAAA;AACnB,MAAA,OAAO,QAAQC,sBAAkB,CAAA,KAAA,CAAM,QAAQ,EAAG,CA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