@element-plus/nightly 0.0.20260504 → 0.0.20260506
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 +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/component.mjs +3 -3
- package/es/components/affix/src/affix.vue.d.ts +2 -2
- package/es/components/alert/src/alert.d.ts +2 -2
- package/es/components/alert/src/alert.vue.d.ts +2 -2
- package/es/components/anchor/src/anchor.vue.d.ts +1 -1
- package/es/components/autocomplete/src/autocomplete.d.ts +4 -4
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +2 -2
- package/es/components/avatar/src/avatar.d.ts +1 -1
- package/es/components/avatar/src/avatar.vue.d.ts +1 -1
- package/es/components/backtop/src/backtop.vue.d.ts +1 -1
- package/es/components/badge/src/badge.d.ts +1 -1
- package/es/components/badge/src/badge.vue.d.ts +1 -1
- package/es/components/button/src/button-group.vue.d.ts +1 -1
- package/es/components/button/src/button.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +4 -4
- package/es/components/card/src/card.d.ts +1 -1
- package/es/components/card/src/card.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +3 -3
- package/es/components/cascader/src/cascader.d.ts +4 -4
- package/es/components/cascader/src/cascader.vue.d.ts +13 -13
- package/es/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/cascader-panel/src/index.vue.d.ts +4 -4
- package/es/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/cascader-panel/src/menu.vue.d.ts +1 -1
- package/es/components/check-tag/src/check-tag.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +5 -5
- package/es/components/checkbox/src/checkbox.d.ts +8 -8
- package/es/components/checkbox/src/checkbox.vue.d.ts +6 -6
- package/es/components/collapse/src/collapse.d.ts +1 -1
- package/es/components/collapse/src/collapse.vue.d.ts +2 -2
- package/es/components/color-picker/src/color-picker.vue.d.ts +5 -5
- package/es/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/es/components/countdown/src/countdown.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/date-picker/src/date-picker.d.ts +11 -11
- package/es/components/date-picker/src/props.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-range.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +6 -6
- package/es/components/descriptions/src/description-item.d.ts +19 -19
- package/es/components/dialog/src/dialog.vue.d.ts +6 -6
- package/es/components/divider/src/divider.d.ts +1 -1
- package/es/components/divider/src/divider.vue.d.ts +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +7 -7
- package/es/components/dropdown/src/dropdown-item.vue.d.ts +4 -4
- package/es/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.d.ts +3 -3
- package/es/components/dropdown/src/dropdown.vue.d.ts +68 -68
- package/es/components/empty/src/empty.vue.d.ts +1 -1
- package/es/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/es/components/form/src/form-item.d.ts +1 -1
- package/es/components/form/src/form.d.ts +2 -2
- package/es/components/form/src/form.vue.d.ts +1 -1
- package/es/components/image/src/image.d.ts +1 -1
- package/es/components/image/src/image.vue.d.ts +5 -5
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/es/components/index.mjs +6 -6
- package/es/components/input/src/input.d.ts +3 -3
- package/es/components/input/src/input.vue.d.ts +14 -14
- package/es/components/input-number/src/input-number.d.ts +2 -2
- package/es/components/input-number/src/input-number.vue.d.ts +8 -8
- package/es/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/input-otp/src/input-otp.vue.d.ts +4 -4
- package/es/components/input-tag/src/input-tag.d.ts +3 -3
- package/es/components/input-tag/src/input-tag.vue.d.ts +14 -14
- package/es/components/link/src/link.d.ts +2 -2
- package/es/components/mention/src/mention.d.ts +3 -3
- package/es/components/mention/src/mention.vue.d.ts +2 -2
- package/es/components/menu/src/menu.d.ts +2 -2
- package/es/components/menu/src/menu.mjs +1 -1
- package/es/components/menu/src/utils/menu-item.mjs +1 -1
- package/es/components/menu/src/utils/submenu.mjs +1 -1
- package/es/components/message/src/message.d.ts +2 -2
- package/es/components/message/src/message.vue.d.ts +3 -3
- package/es/components/message-box/src/index.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/notification/src/notification.d.ts +2 -2
- package/es/components/notification/src/notification.vue.d.ts +4 -4
- package/es/components/pagination/src/pagination.d.ts +4 -4
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
- package/es/components/popover/src/popover.d.ts +1 -1
- package/es/components/popover/src/popover.vue.d.ts +6 -6
- package/es/components/popper/src/composables/use-content.d.ts +4 -4
- package/es/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/es/components/popper/src/content.vue.d.ts +7 -7
- package/es/components/popper/src/popper.d.ts +2 -2
- package/es/components/progress/src/progress.vue.d.ts +1 -1
- package/es/components/radio/src/radio-button.d.ts +3 -3
- package/es/components/radio/src/radio-button.vue.d.ts +2 -2
- package/es/components/radio/src/radio-group.vue.d.ts +7 -7
- package/es/components/radio/src/radio.d.ts +6 -6
- package/es/components/radio/src/radio.vue.d.ts +5 -5
- package/es/components/rate/src/rate.vue.d.ts +4 -4
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
- package/es/components/row/src/row.d.ts +1 -1
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/es/components/segmented/index.d.ts +3 -3
- package/es/components/segmented/src/segmented.d.ts +1 -1
- package/es/components/segmented/src/segmented.vue.d.ts +2 -2
- package/es/components/select/src/option.d.ts +2 -2
- package/es/components/select/src/option.vue.d.ts +5 -5
- package/es/components/select/src/select.d.ts +5 -5
- package/es/components/select/src/select.vue.d.ts +82 -82
- package/es/components/select/src/select.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/select-v2/src/defaults.d.ts +3 -3
- package/es/components/select-v2/src/select.vue.d.ts +67 -67
- package/es/components/select-v2/src/select.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/es/components/slider/src/button.vue.d.ts +1 -1
- package/es/components/slider/src/slider.vue.d.ts +8 -8
- package/es/components/space/src/space.d.ts +1 -1
- package/es/components/splitter/src/splitter.vue.d.ts +2 -2
- package/es/components/steps/src/item.d.ts +1 -1
- package/es/components/steps/src/item.vue.d.ts +1 -1
- package/es/components/steps/src/steps.d.ts +2 -2
- package/es/components/switch/src/switch.vue.d.ts +4 -4
- package/es/components/table/src/table-column/index.d.ts +24 -24
- package/es/components/table/src/table-footer/index.d.ts +1 -1
- package/es/components/table/src/table-header/index.d.ts +18 -18
- package/es/components/table/src/table.vue.d.ts +43 -43
- package/es/components/table/src/table.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/table-v2/src/components/row.d.ts +1 -1
- package/es/components/table-v2/src/table-grid.d.ts +3 -3
- package/es/components/table-v2/src/table-v2.d.ts +3 -3
- package/es/components/tabs/src/tab-nav.d.ts +1 -1
- package/es/components/tabs/src/tabs.d.ts +6 -6
- package/es/components/tag/src/tag.d.ts +2 -2
- package/es/components/text/src/text.d.ts +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +15 -15
- package/es/components/time-picker/src/common/props.d.ts +1 -1
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/time-picker/src/time-picker.d.ts +11 -11
- package/es/components/time-select/src/time-select.vue.d.ts +6 -6
- package/es/components/timeline/src/timeline-item.d.ts +1 -1
- package/es/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/es/components/tooltip/src/content.vue.d.ts +5 -5
- package/es/components/tooltip/src/tooltip.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +14 -14
- package/es/components/tour/src/content.d.ts +1 -1
- package/es/components/tour/src/step.d.ts +2 -2
- package/es/components/tour/src/tour.d.ts +2 -2
- package/es/components/tour/src/tour.vue.d.ts +5 -5
- package/es/components/transfer/src/transfer.vue.d.ts +2 -2
- package/es/components/tree/src/tree.vue.d.ts +24 -24
- package/es/components/tree-select/src/tree-select.vue.d.ts +42 -42
- package/es/components/tree-v2/src/tree.vue.d.ts +3 -3
- package/es/components/upload/src/upload-content.vue.d.ts +3 -3
- package/es/components/upload/src/upload.vue.d.ts +3 -3
- package/es/components/virtual-list/src/builders/build-grid.d.ts +6 -6
- package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +6 -6
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +7 -7
- package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +6 -6
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +7 -7
- package/es/components/watermark/src/watermark.vue.d.ts +1 -1
- package/es/constants/index.mjs +2 -2
- package/es/directives/trap-focus/index.mjs +1 -1
- package/es/hooks/use-floating/index.d.ts +8 -8
- package/es/hooks/use-popper/index.d.ts +4 -4
- package/es/index.mjs +13 -13
- package/es/plugin.mjs +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/component.js +109 -109
- package/lib/components/affix/src/affix.vue.d.ts +2 -2
- package/lib/components/alert/src/alert.d.ts +2 -2
- package/lib/components/alert/src/alert.vue.d.ts +2 -2
- package/lib/components/anchor/src/anchor.vue.d.ts +1 -1
- package/lib/components/autocomplete/src/autocomplete.d.ts +4 -4
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +2 -2
- package/lib/components/avatar/src/avatar.d.ts +1 -1
- package/lib/components/avatar/src/avatar.vue.d.ts +1 -1
- package/lib/components/backtop/src/backtop.vue.d.ts +1 -1
- package/lib/components/badge/src/badge.d.ts +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +1 -1
- package/lib/components/button/src/button-group.vue.d.ts +1 -1
- package/lib/components/button/src/button.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +4 -4
- package/lib/components/card/src/card.d.ts +1 -1
- package/lib/components/card/src/card.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +3 -3
- package/lib/components/cascader/src/cascader.d.ts +4 -4
- package/lib/components/cascader/src/cascader.vue.d.ts +13 -13
- package/lib/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js +40 -40
- package/lib/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/cascader-panel/src/index.vue.d.ts +4 -4
- package/lib/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.js +12 -12
- package/lib/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/cascader-panel/src/menu.vue.d.ts +1 -1
- package/lib/components/check-tag/src/check-tag.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +5 -5
- package/lib/components/checkbox/src/checkbox.d.ts +8 -8
- package/lib/components/checkbox/src/checkbox.vue.d.ts +6 -6
- package/lib/components/collapse/src/collapse.d.ts +1 -1
- package/lib/components/collapse/src/collapse.vue.d.ts +2 -2
- package/lib/components/color-picker/src/color-picker.vue.d.ts +5 -5
- package/lib/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.js +18 -18
- package/lib/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/lib/components/countdown/src/countdown.vue_vue_type_script_setup_true_lang.js +1 -1
- package/lib/components/date-picker/src/date-picker.d.ts +11 -11
- package/lib/components/date-picker/src/props.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.js +18 -18
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-range.vue_vue_type_script_setup_true_lang.js +23 -23
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-range.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +6 -6
- package/lib/components/descriptions/src/description-item.d.ts +19 -19
- package/lib/components/dialog/src/dialog.vue.d.ts +6 -6
- package/lib/components/divider/src/divider.d.ts +1 -1
- package/lib/components/divider/src/divider.vue.d.ts +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +7 -7
- package/lib/components/dropdown/src/dropdown-item.vue.d.ts +4 -4
- package/lib/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.d.ts +3 -3
- package/lib/components/dropdown/src/dropdown.vue.d.ts +68 -68
- package/lib/components/empty/src/empty.vue.d.ts +1 -1
- package/lib/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/lib/components/form/src/form-item.d.ts +1 -1
- package/lib/components/form/src/form.d.ts +2 -2
- package/lib/components/form/src/form.vue.d.ts +1 -1
- package/lib/components/image/src/image.d.ts +1 -1
- package/lib/components/image/src/image.vue.d.ts +5 -5
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/lib/components/index.js +125 -125
- package/lib/components/input/src/input.d.ts +3 -3
- package/lib/components/input/src/input.vue.d.ts +14 -14
- package/lib/components/input-number/src/input-number.d.ts +2 -2
- package/lib/components/input-number/src/input-number.vue.d.ts +8 -8
- package/lib/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js +12 -12
- package/lib/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/input-otp/src/input-otp.vue.d.ts +4 -4
- package/lib/components/input-tag/src/input-tag.d.ts +3 -3
- package/lib/components/input-tag/src/input-tag.vue.d.ts +14 -14
- package/lib/components/link/src/link.d.ts +2 -2
- package/lib/components/mention/src/mention.d.ts +3 -3
- package/lib/components/mention/src/mention.vue.d.ts +2 -2
- package/lib/components/menu/src/menu.d.ts +2 -2
- package/lib/components/menu/src/menu.js +7 -7
- package/lib/components/menu/src/menu.js.map +1 -1
- package/lib/components/menu/src/utils/menu-item.js +11 -11
- package/lib/components/menu/src/utils/menu-item.js.map +1 -1
- package/lib/components/menu/src/utils/submenu.js +9 -9
- package/lib/components/menu/src/utils/submenu.js.map +1 -1
- package/lib/components/message/src/message.d.ts +2 -2
- package/lib/components/message/src/message.vue.d.ts +3 -3
- package/lib/components/message-box/src/index.vue_vue_type_script_lang.js +19 -19
- package/lib/components/message-box/src/index.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/notification/src/notification.d.ts +2 -2
- package/lib/components/notification/src/notification.vue.d.ts +4 -4
- package/lib/components/pagination/src/pagination.d.ts +4 -4
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
- package/lib/components/popover/src/popover.d.ts +1 -1
- package/lib/components/popover/src/popover.vue.d.ts +6 -6
- package/lib/components/popper/src/composables/use-content.d.ts +4 -4
- package/lib/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/lib/components/popper/src/content.vue.d.ts +7 -7
- package/lib/components/popper/src/popper.d.ts +2 -2
- package/lib/components/progress/src/progress.vue.d.ts +1 -1
- package/lib/components/radio/src/radio-button.d.ts +3 -3
- package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
- package/lib/components/radio/src/radio-group.vue.d.ts +7 -7
- package/lib/components/radio/src/radio.d.ts +6 -6
- package/lib/components/radio/src/radio.vue.d.ts +5 -5
- package/lib/components/rate/src/rate.vue.d.ts +4 -4
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
- package/lib/components/row/src/row.d.ts +1 -1
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/lib/components/segmented/index.d.ts +3 -3
- package/lib/components/segmented/src/segmented.d.ts +1 -1
- package/lib/components/segmented/src/segmented.vue.d.ts +2 -2
- package/lib/components/select/src/option.d.ts +2 -2
- package/lib/components/select/src/option.vue.d.ts +5 -5
- package/lib/components/select/src/select.d.ts +5 -5
- package/lib/components/select/src/select.vue.d.ts +82 -82
- package/lib/components/select/src/select.vue_vue_type_script_lang.js +10 -10
- package/lib/components/select/src/select.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/select-v2/src/defaults.d.ts +3 -3
- package/lib/components/select-v2/src/select.vue.d.ts +67 -67
- package/lib/components/select-v2/src/select.vue_vue_type_script_lang.js +10 -10
- package/lib/components/select-v2/src/select.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/lib/components/slider/src/button.vue.d.ts +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +8 -8
- package/lib/components/space/src/space.d.ts +1 -1
- package/lib/components/splitter/src/splitter.vue.d.ts +2 -2
- package/lib/components/steps/src/item.d.ts +1 -1
- package/lib/components/steps/src/item.vue.d.ts +1 -1
- package/lib/components/steps/src/steps.d.ts +2 -2
- package/lib/components/switch/src/switch.vue.d.ts +4 -4
- package/lib/components/table/src/table-column/index.d.ts +24 -24
- package/lib/components/table/src/table-footer/index.d.ts +1 -1
- package/lib/components/table/src/table-header/index.d.ts +18 -18
- package/lib/components/table/src/table.vue.d.ts +43 -43
- package/lib/components/table/src/table.vue_vue_type_script_lang.js +8 -8
- package/lib/components/table/src/table.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/table-v2/src/components/row.d.ts +1 -1
- package/lib/components/table-v2/src/table-grid.d.ts +3 -3
- package/lib/components/table-v2/src/table-v2.d.ts +3 -3
- package/lib/components/tabs/src/tab-nav.d.ts +1 -1
- package/lib/components/tabs/src/tabs.d.ts +6 -6
- package/lib/components/tag/src/tag.d.ts +2 -2
- package/lib/components/text/src/text.d.ts +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +15 -15
- package/lib/components/time-picker/src/common/props.d.ts +1 -1
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_setup_true_lang.js +10 -10
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/time-picker/src/time-picker.d.ts +11 -11
- package/lib/components/time-select/src/time-select.vue.d.ts +6 -6
- package/lib/components/timeline/src/timeline-item.d.ts +1 -1
- package/lib/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/lib/components/tooltip/src/content.vue.d.ts +5 -5
- package/lib/components/tooltip/src/tooltip.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +14 -14
- package/lib/components/tour/src/content.d.ts +1 -1
- package/lib/components/tour/src/step.d.ts +2 -2
- package/lib/components/tour/src/tour.d.ts +2 -2
- package/lib/components/tour/src/tour.vue.d.ts +5 -5
- package/lib/components/transfer/src/transfer.vue.d.ts +2 -2
- package/lib/components/tree/src/tree.vue.d.ts +24 -24
- package/lib/components/tree-select/src/tree-select.vue.d.ts +42 -42
- package/lib/components/tree-v2/src/tree.vue.d.ts +3 -3
- package/lib/components/upload/src/upload-content.vue.d.ts +3 -3
- package/lib/components/upload/src/upload.vue.d.ts +3 -3
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +6 -6
- package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +6 -6
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +7 -7
- package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +6 -6
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +7 -7
- package/lib/components/watermark/src/watermark.vue.d.ts +1 -1
- package/lib/constants/index.js +2 -2
- package/lib/directives/trap-focus/index.js +5 -5
- package/lib/directives/trap-focus/index.js.map +1 -1
- package/lib/hooks/use-floating/index.d.ts +8 -8
- package/lib/hooks/use-popper/index.d.ts +4 -4
- package/lib/index.js +269 -269
- package/lib/plugin.js +12 -12
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +3 -3
- package/web-types.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.js');
|
|
2
|
-
const require_aria = require('../../../
|
|
3
|
-
const require_aria$1 = require('../../../constants/aria.js');
|
|
2
|
+
const require_aria = require('../../../constants/aria.js');
|
|
4
3
|
const require_event = require('../../../constants/event.js');
|
|
4
|
+
const require_aria$1 = require('../../../utils/dom/aria.js');
|
|
5
5
|
const require_event$1 = require('../../../utils/dom/event.js');
|
|
6
6
|
const require_types = require('../../../utils/types.js');
|
|
7
7
|
const require_scroll = require('../../../utils/dom/scroll.js');
|
|
@@ -183,10 +183,10 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
183
183
|
const target = e.target;
|
|
184
184
|
const code = require_event$1.getEventCode(e);
|
|
185
185
|
switch (code) {
|
|
186
|
-
case require_aria
|
|
187
|
-
case require_aria
|
|
186
|
+
case require_aria.EVENT_CODE.up:
|
|
187
|
+
case require_aria.EVENT_CODE.down: {
|
|
188
188
|
e.preventDefault();
|
|
189
|
-
const distance = code === require_aria
|
|
189
|
+
const distance = code === require_aria.EVENT_CODE.up ? -1 : 1;
|
|
190
190
|
if (virtualScroll.value) {
|
|
191
191
|
const menuIndex = require_utils.getMenuIndex(target);
|
|
192
192
|
const menu = menuList.value[menuIndex];
|
|
@@ -206,23 +206,23 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
require_aria.focusNode(require_aria.getSibling(target, distance, `.${ns.b("node")}[tabindex="-1"]`));
|
|
209
|
+
require_aria$1.focusNode(require_aria$1.getSibling(target, distance, `.${ns.b("node")}[tabindex="-1"]`));
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
|
-
case require_aria
|
|
212
|
+
case require_aria.EVENT_CODE.left: {
|
|
213
213
|
e.preventDefault();
|
|
214
214
|
const expandedNode = menuList.value[require_utils.getMenuIndex(target) - 1]?.$el.querySelector(`.${ns.b("node")}[aria-expanded="true"]`);
|
|
215
|
-
require_aria.focusNode(expandedNode);
|
|
215
|
+
require_aria$1.focusNode(expandedNode);
|
|
216
216
|
break;
|
|
217
217
|
}
|
|
218
|
-
case require_aria
|
|
218
|
+
case require_aria.EVENT_CODE.right: {
|
|
219
219
|
e.preventDefault();
|
|
220
220
|
const firstNode = menuList.value[require_utils.getMenuIndex(target) + 1]?.$el.querySelector(`.${ns.b("node")}[tabindex="-1"]`);
|
|
221
|
-
require_aria.focusNode(firstNode);
|
|
221
|
+
require_aria$1.focusNode(firstNode);
|
|
222
222
|
break;
|
|
223
223
|
}
|
|
224
|
-
case require_aria
|
|
225
|
-
case require_aria
|
|
224
|
+
case require_aria.EVENT_CODE.enter:
|
|
225
|
+
case require_aria.EVENT_CODE.numpadEnter:
|
|
226
226
|
require_utils.checkNode(target);
|
|
227
227
|
break;
|
|
228
228
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../../packages/components/cascader-panel/src/index.vue"],"sourcesContent":["<template>\n <div\n :class=\"[ns.b('panel'), ns.is('bordered', border)]\"\n @keydown=\"handleKeyDown\"\n >\n <el-cascader-menu\n v-for=\"(menu, index) in menus\"\n :key=\"index\"\n :ref=\"(item) => (menuList[index] = item as CascaderMenuInstance)\"\n :index=\"index\"\n :nodes=\"[...menu]\"\n :virtual-scroll=\"virtualScroll\"\n :item-size=\"itemSize\"\n :height=\"height\"\n >\n <template #empty>\n <slot name=\"empty\" />\n </template>\n </el-cascader-menu>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onBeforeUpdate,\n onMounted,\n provide,\n reactive,\n ref,\n useSlots,\n watch,\n} from 'vue'\nimport { cloneDeep, flattenDeep, isEqual } from 'lodash-unified'\nimport {\n castArray,\n focusNode,\n getEventCode,\n getSibling,\n isClient,\n isEmpty,\n scrollIntoView,\n unique,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\nimport ElCascaderMenu from './menu.vue'\nimport Store from './store'\nimport Node from './node'\nimport {\n CASCADER_PANEL_HEIGHT,\n CASCADER_PANEL_ITEM_SIZE,\n cascaderPanelEmits,\n useCascaderConfig,\n} from './config'\nimport { checkNode, getMenuIndex, sortByOriginalOrder } from './utils'\nimport { CASCADER_PANEL_INJECTION_KEY } from './types'\n\nimport type {\n CascaderNode,\n CascaderNodeValue,\n CascaderOption,\n CascaderValue,\n ElCascaderPanelContext,\n} from './types'\nimport type { CascaderMenuInstance } from './instance'\nimport type { CascaderPanelProps } from './config'\n\ndefineOptions({\n name: 'ElCascaderPanel',\n})\n\nconst props = withDefaults(defineProps<CascaderPanelProps>(), {\n options: () => [],\n props: () => ({}),\n border: true,\n itemSize: CASCADER_PANEL_ITEM_SIZE,\n height: CASCADER_PANEL_HEIGHT,\n})\nconst emit = defineEmits(cascaderPanelEmits)\n\n// for interrupt sync check status in lazy mode\nlet manualChecked = false\n\nconst ns = useNamespace('cascader')\nconst config = useCascaderConfig(props)\nconst slots = useSlots()\n\nlet store: Store\nconst initialLoaded = ref(true)\nconst initialLoadedOnce = ref(false)\nconst menuList = ref<CascaderMenuInstance[]>([])\nconst checkedValue = ref<CascaderValue>()\nconst menus = ref<CascaderNode[][]>([])\nconst expandingNode = ref<CascaderNode>()\nconst checkedNodes = ref<CascaderNode[]>([])\n\nconst isHoverMenu = computed(() => config.value.expandTrigger === 'hover')\nconst renderLabelFn = computed(() => props.renderLabel || slots.default)\nconst virtualScroll = computed(() => props.virtualScroll)\nconst itemSize = computed(() => props.itemSize)\nconst height = computed(() => props.height)\n\nconst initStore = () => {\n const { options } = props\n const cfg = config.value\n\n manualChecked = false\n store = new Store(options, cfg)\n menus.value = [store.getNodes()]\n\n if (cfg.lazy && isEmpty(props.options)) {\n initialLoaded.value = false\n lazyLoad(undefined, (list) => {\n if (list) {\n store = new Store(list, cfg)\n menus.value = [store.getNodes()]\n }\n initialLoaded.value = true\n syncCheckedValue(false, true)\n })\n } else {\n syncCheckedValue(false, true)\n }\n}\n\nconst lazyLoad: ElCascaderPanelContext['lazyLoad'] = (node, cb) => {\n const cfg = config.value\n node! = node || new Node({}, cfg, undefined, true)\n node.loading = true\n\n const resolve = (dataList?: CascaderOption[]) => {\n const _node = node as Node\n const parent = _node.root ? null : _node\n _node.loading = false\n _node.loaded = true\n _node.childrenData = _node.childrenData || []\n dataList && store?.appendNodes(dataList, parent as Node)\n dataList && cb?.(dataList)\n if (node.level === 0) {\n initialLoadedOnce.value = true\n }\n }\n\n const reject = () => {\n node!.loading = false\n node!.loaded = false\n if (node!.level === 0) {\n initialLoaded.value = true\n }\n }\n\n cfg.lazyLoad(node, resolve, reject)\n}\n\nconst expandNode: ElCascaderPanelContext['expandNode'] = (node, silent) => {\n const { level } = node\n const newMenus = menus.value.slice(0, level)\n let newExpandingNode: CascaderNode\n\n if (node.isLeaf) {\n newExpandingNode = node.pathNodes[level - 2]\n } else {\n newExpandingNode = node\n newMenus.push(node.children)\n }\n\n if (expandingNode.value?.uid !== newExpandingNode?.uid) {\n expandingNode.value = node\n menus.value = newMenus\n !silent && emit('expand-change', node?.pathValues || [])\n }\n}\n\nconst handleCheckChange: ElCascaderPanelContext['handleCheckChange'] = (\n node,\n checked,\n emitClose = true\n) => {\n const { checkStrictly, multiple } = config.value\n const oldNode = checkedNodes.value[0]\n manualChecked = true\n\n !multiple && oldNode?.doCheck(false)\n node.doCheck(checked)\n calculateCheckedValue()\n emitClose && !multiple && !checkStrictly && emit('close')\n !emitClose && !multiple && expandParentNode(node)\n}\n\nconst expandParentNode = (node: Node | undefined) => {\n if (!node) return\n node = node.parent\n expandParentNode(node)\n node && expandNode(node)\n}\n\nconst getFlattedNodes = (leafOnly: boolean) => store?.getFlattedNodes(leafOnly)\n\nconst getCheckedNodes = (leafOnly: boolean) => {\n return getFlattedNodes(leafOnly)?.filter(({ checked }) => checked !== false)\n}\n\nconst clearCheckedNodes = () => {\n checkedNodes.value.forEach((node) => node.doCheck(false))\n calculateCheckedValue()\n menus.value = menus.value.slice(0, 1)\n expandingNode.value = undefined\n emit('expand-change', [])\n}\n\nconst calculateCheckedValue = () => {\n const { checkStrictly, multiple } = config.value\n const oldNodes = checkedNodes.value\n const newNodes = getCheckedNodes(!checkStrictly)!\n // ensure the original order\n const nodes = sortByOriginalOrder(oldNodes, newNodes)\n const values = nodes.map((node) => node.valueByOption)\n checkedNodes.value = nodes\n checkedValue.value = multiple ? values : (values[0] ?? null)\n}\n\nconst syncCheckedValue = (loaded = false, forced = false) => {\n const { modelValue } = props\n const { lazy, multiple, checkStrictly } = config.value\n const leafOnly = !checkStrictly\n\n if (\n !initialLoaded.value ||\n manualChecked ||\n (!forced && isEqual(modelValue, checkedValue.value))\n )\n return\n\n if (lazy && !loaded) {\n const values: CascaderNodeValue[] = unique(\n flattenDeep(castArray(modelValue as CascaderNodeValue[]))\n )\n const nodes = values\n .map((val) => store?.getNodeByValue(val))\n .filter((node) => !!node && !node.loaded && !node.loading) as Node[]\n\n if (nodes.length) {\n nodes.forEach((node) => {\n lazyLoad(node, () => syncCheckedValue(false, forced))\n })\n } else {\n syncCheckedValue(true, forced)\n }\n } else {\n const values = multiple ? castArray(modelValue) : [modelValue]\n const nodes = unique(\n values.map((val) =>\n store?.getNodeByValue(val as CascaderNodeValue, leafOnly)\n )\n ) as Node[]\n syncMenuState(nodes, forced)\n checkedValue.value = cloneDeep(modelValue ?? undefined)\n }\n}\n\nconst syncMenuState = (\n newCheckedNodes: CascaderNode[],\n reserveExpandingState = true\n) => {\n const { checkStrictly } = config.value\n const oldNodes = checkedNodes.value\n const newNodes = newCheckedNodes.filter(\n (node) => !!node && (checkStrictly || node.isLeaf)\n )\n const oldExpandingNode = store?.getSameNode(expandingNode.value!)\n const newExpandingNode =\n (reserveExpandingState && oldExpandingNode) || newNodes[0]\n\n if (newExpandingNode) {\n newExpandingNode.pathNodes.forEach((node) => expandNode(node, true))\n } else {\n expandingNode.value = undefined\n }\n\n oldNodes.forEach((node) => node.doCheck(false))\n reactive(newNodes).forEach((node) => node.doCheck(true))\n checkedNodes.value = newNodes\n nextTick(scrollToExpandingNode)\n}\n\nconst scrollToExpandingNode = () => {\n if (!isClient) return\n\n menuList.value.forEach((menu) => {\n const menuElement = menu?.$el\n if (menuElement) {\n // virtual scroll mode, use scrollToItem method\n if (virtualScroll.value) {\n const activeIndex = menu?.getActiveNodeIndex?.()\n if (activeIndex !== undefined && activeIndex >= 0) {\n menu?.scrollToItem?.(activeIndex)\n }\n } else {\n // logic for non-virtual scroll mode\n const container = menuElement.querySelector(\n `.${ns.namespace.value}-scrollbar__wrap`\n )\n let activeNode = menuElement.querySelector(\n `.${ns.b('node')}.in-active-path`\n )\n if (!activeNode) {\n const activeElements = menuElement.querySelectorAll(\n `.${ns.b('node')}.${ns.is('active')}`\n )\n activeNode = activeElements[activeElements.length - 1]\n }\n scrollIntoView(container, activeNode)\n }\n }\n })\n}\n\nconst handleKeyDown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement\n const code = getEventCode(e)\n\n switch (code) {\n case EVENT_CODE.up:\n case EVENT_CODE.down: {\n e.preventDefault()\n const distance = code === EVENT_CODE.up ? -1 : 1\n\n if (virtualScroll.value) {\n const menuIndex = getMenuIndex(target)\n const menu = menuList.value[menuIndex]\n if (menu) {\n // For virtual scroll, calculate the target index and use focusNodeAt\n const currentIndex = menu.getNodeIndexById(target.id)\n if (currentIndex >= 0) {\n const nodesInMenu = menus.value[menuIndex] ?? []\n const nodesCount = nodesInMenu.length\n // Find the next non-disabled node\n let targetIndex = currentIndex + distance\n while (targetIndex >= 0 && targetIndex < nodesCount) {\n if (!nodesInMenu[targetIndex].isDisabled) {\n menu.focusNodeAt(targetIndex)\n return\n }\n targetIndex += distance\n }\n }\n }\n }\n\n focusNode(\n getSibling(\n target,\n distance,\n `.${ns.b('node')}[tabindex=\"-1\"]`\n ) as HTMLElement\n )\n break\n }\n case EVENT_CODE.left: {\n e.preventDefault()\n const preMenu = menuList.value[getMenuIndex(target) - 1]\n const expandedNode = preMenu?.$el.querySelector(\n `.${ns.b('node')}[aria-expanded=\"true\"]`\n )\n focusNode(expandedNode)\n break\n }\n case EVENT_CODE.right: {\n e.preventDefault()\n const nextMenu = menuList.value[getMenuIndex(target) + 1]\n const firstNode = nextMenu?.$el.querySelector(\n `.${ns.b('node')}[tabindex=\"-1\"]`\n )\n focusNode(firstNode)\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n checkNode(target)\n break\n }\n}\n\nprovide(\n CASCADER_PANEL_INJECTION_KEY,\n reactive({\n config,\n expandingNode,\n checkedNodes,\n isHoverMenu,\n initialLoaded,\n renderLabelFn,\n virtualScroll,\n itemSize,\n height,\n lazyLoad,\n expandNode,\n handleCheckChange,\n })\n)\n\nwatch(\n config,\n (newVal, oldVal) => {\n if (isEqual(newVal, oldVal)) return\n initStore()\n },\n {\n immediate: true,\n }\n)\n\nwatch(() => props.options, initStore, {\n deep: true,\n})\n\nwatch(\n () => props.modelValue,\n () => {\n manualChecked = false\n syncCheckedValue()\n },\n {\n deep: true,\n }\n)\n\nwatch(\n () => checkedValue.value,\n (val) => {\n if (!isEqual(val, props.modelValue)) {\n emit(UPDATE_MODEL_EVENT, val)\n emit(CHANGE_EVENT, val)\n }\n }\n)\n\nconst loadLazyRootNodes = () => {\n if (initialLoadedOnce.value) return\n initStore()\n}\n\nonBeforeUpdate(() => (menuList.value = []))\n\nonMounted(() => !isEmpty(props.modelValue) && syncCheckedValue())\n\ndefineExpose({\n menuList,\n menus,\n checkedNodes,\n handleKeyDown,\n handleCheckChange,\n getFlattedNodes,\n /**\n * @description get an array of currently selected node,(leafOnly) whether only return the leaf checked nodes, default is `false`\n */\n getCheckedNodes,\n /**\n * @description clear checked nodes\n */\n clearCheckedNodes,\n calculateCheckedValue,\n scrollToExpandingNode,\n loadLazyRootNodes,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EA6EA,MAAM,QAAQ;EAOd,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C,SAAK,kCAAoB,IAAG;AAC5B,SAAK,4BAAc,IAAG;;IAG5B;EAEA,MAAM,0BAA0B;AAC9B,OAAI,kBAAkB,MAAO;AAC7B,cAAU;;AAGZ,gCAAsB,SAAS,QAAQ,EAAE,CAAC;AAE1C,2BAAgB,CAAC,sBAAQ,MAAM,WAAW,IAAI,kBAAkB,CAAA;AAEhE,WAAa;GACX;GACA;GACA;GACA;GACA;GACA;GAIA;GAIA;GACA;GACA;GACA;GACD,CAAA;;4DAncO,OAAA;IAjBH,+BAAK,gBAAG,GAAE,CAAC,EAAC,QAAA,iBAAW,GAAE,CAAC,GAAE,YAAa,QAAA,OAAM,CAAA,CAAA;IAC/C,WAAS;8DAeS,cAAA,0BAZO,MAAA,QAAhB,MAAM,UAAK;sDAYF,sBAAA;KAXhB,KAAK;;KACL,MAAM,SAAU,SAAA,MAAS,SAAS;KAC3B;KACP,OAAK,CAAA,GAAM,KAAI;KACf,kBAAgB,cAAA;KAChB,aAAW,SAAA;KACX,QAAQ,OAAA;;KAEE,8BACY,qBAAA,KAAA,QAAA,QAAA"}
|
|
1
|
+
{"version":3,"file":"index.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../../packages/components/cascader-panel/src/index.vue"],"sourcesContent":["<template>\n <div\n :class=\"[ns.b('panel'), ns.is('bordered', border)]\"\n @keydown=\"handleKeyDown\"\n >\n <el-cascader-menu\n v-for=\"(menu, index) in menus\"\n :key=\"index\"\n :ref=\"(item) => (menuList[index] = item as CascaderMenuInstance)\"\n :index=\"index\"\n :nodes=\"[...menu]\"\n :virtual-scroll=\"virtualScroll\"\n :item-size=\"itemSize\"\n :height=\"height\"\n >\n <template #empty>\n <slot name=\"empty\" />\n </template>\n </el-cascader-menu>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onBeforeUpdate,\n onMounted,\n provide,\n reactive,\n ref,\n useSlots,\n watch,\n} from 'vue'\nimport { cloneDeep, flattenDeep, isEqual } from 'lodash-unified'\nimport {\n castArray,\n focusNode,\n getEventCode,\n getSibling,\n isClient,\n isEmpty,\n scrollIntoView,\n unique,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\nimport ElCascaderMenu from './menu.vue'\nimport Store from './store'\nimport Node from './node'\nimport {\n CASCADER_PANEL_HEIGHT,\n CASCADER_PANEL_ITEM_SIZE,\n cascaderPanelEmits,\n useCascaderConfig,\n} from './config'\nimport { checkNode, getMenuIndex, sortByOriginalOrder } from './utils'\nimport { CASCADER_PANEL_INJECTION_KEY } from './types'\n\nimport type {\n CascaderNode,\n CascaderNodeValue,\n CascaderOption,\n CascaderValue,\n ElCascaderPanelContext,\n} from './types'\nimport type { CascaderMenuInstance } from './instance'\nimport type { CascaderPanelProps } from './config'\n\ndefineOptions({\n name: 'ElCascaderPanel',\n})\n\nconst props = withDefaults(defineProps<CascaderPanelProps>(), {\n options: () => [],\n props: () => ({}),\n border: true,\n itemSize: CASCADER_PANEL_ITEM_SIZE,\n height: CASCADER_PANEL_HEIGHT,\n})\nconst emit = defineEmits(cascaderPanelEmits)\n\n// for interrupt sync check status in lazy mode\nlet manualChecked = false\n\nconst ns = useNamespace('cascader')\nconst config = useCascaderConfig(props)\nconst slots = useSlots()\n\nlet store: Store\nconst initialLoaded = ref(true)\nconst initialLoadedOnce = ref(false)\nconst menuList = ref<CascaderMenuInstance[]>([])\nconst checkedValue = ref<CascaderValue>()\nconst menus = ref<CascaderNode[][]>([])\nconst expandingNode = ref<CascaderNode>()\nconst checkedNodes = ref<CascaderNode[]>([])\n\nconst isHoverMenu = computed(() => config.value.expandTrigger === 'hover')\nconst renderLabelFn = computed(() => props.renderLabel || slots.default)\nconst virtualScroll = computed(() => props.virtualScroll)\nconst itemSize = computed(() => props.itemSize)\nconst height = computed(() => props.height)\n\nconst initStore = () => {\n const { options } = props\n const cfg = config.value\n\n manualChecked = false\n store = new Store(options, cfg)\n menus.value = [store.getNodes()]\n\n if (cfg.lazy && isEmpty(props.options)) {\n initialLoaded.value = false\n lazyLoad(undefined, (list) => {\n if (list) {\n store = new Store(list, cfg)\n menus.value = [store.getNodes()]\n }\n initialLoaded.value = true\n syncCheckedValue(false, true)\n })\n } else {\n syncCheckedValue(false, true)\n }\n}\n\nconst lazyLoad: ElCascaderPanelContext['lazyLoad'] = (node, cb) => {\n const cfg = config.value\n node! = node || new Node({}, cfg, undefined, true)\n node.loading = true\n\n const resolve = (dataList?: CascaderOption[]) => {\n const _node = node as Node\n const parent = _node.root ? null : _node\n _node.loading = false\n _node.loaded = true\n _node.childrenData = _node.childrenData || []\n dataList && store?.appendNodes(dataList, parent as Node)\n dataList && cb?.(dataList)\n if (node.level === 0) {\n initialLoadedOnce.value = true\n }\n }\n\n const reject = () => {\n node!.loading = false\n node!.loaded = false\n if (node!.level === 0) {\n initialLoaded.value = true\n }\n }\n\n cfg.lazyLoad(node, resolve, reject)\n}\n\nconst expandNode: ElCascaderPanelContext['expandNode'] = (node, silent) => {\n const { level } = node\n const newMenus = menus.value.slice(0, level)\n let newExpandingNode: CascaderNode\n\n if (node.isLeaf) {\n newExpandingNode = node.pathNodes[level - 2]\n } else {\n newExpandingNode = node\n newMenus.push(node.children)\n }\n\n if (expandingNode.value?.uid !== newExpandingNode?.uid) {\n expandingNode.value = node\n menus.value = newMenus\n !silent && emit('expand-change', node?.pathValues || [])\n }\n}\n\nconst handleCheckChange: ElCascaderPanelContext['handleCheckChange'] = (\n node,\n checked,\n emitClose = true\n) => {\n const { checkStrictly, multiple } = config.value\n const oldNode = checkedNodes.value[0]\n manualChecked = true\n\n !multiple && oldNode?.doCheck(false)\n node.doCheck(checked)\n calculateCheckedValue()\n emitClose && !multiple && !checkStrictly && emit('close')\n !emitClose && !multiple && expandParentNode(node)\n}\n\nconst expandParentNode = (node: Node | undefined) => {\n if (!node) return\n node = node.parent\n expandParentNode(node)\n node && expandNode(node)\n}\n\nconst getFlattedNodes = (leafOnly: boolean) => store?.getFlattedNodes(leafOnly)\n\nconst getCheckedNodes = (leafOnly: boolean) => {\n return getFlattedNodes(leafOnly)?.filter(({ checked }) => checked !== false)\n}\n\nconst clearCheckedNodes = () => {\n checkedNodes.value.forEach((node) => node.doCheck(false))\n calculateCheckedValue()\n menus.value = menus.value.slice(0, 1)\n expandingNode.value = undefined\n emit('expand-change', [])\n}\n\nconst calculateCheckedValue = () => {\n const { checkStrictly, multiple } = config.value\n const oldNodes = checkedNodes.value\n const newNodes = getCheckedNodes(!checkStrictly)!\n // ensure the original order\n const nodes = sortByOriginalOrder(oldNodes, newNodes)\n const values = nodes.map((node) => node.valueByOption)\n checkedNodes.value = nodes\n checkedValue.value = multiple ? values : (values[0] ?? null)\n}\n\nconst syncCheckedValue = (loaded = false, forced = false) => {\n const { modelValue } = props\n const { lazy, multiple, checkStrictly } = config.value\n const leafOnly = !checkStrictly\n\n if (\n !initialLoaded.value ||\n manualChecked ||\n (!forced && isEqual(modelValue, checkedValue.value))\n )\n return\n\n if (lazy && !loaded) {\n const values: CascaderNodeValue[] = unique(\n flattenDeep(castArray(modelValue as CascaderNodeValue[]))\n )\n const nodes = values\n .map((val) => store?.getNodeByValue(val))\n .filter((node) => !!node && !node.loaded && !node.loading) as Node[]\n\n if (nodes.length) {\n nodes.forEach((node) => {\n lazyLoad(node, () => syncCheckedValue(false, forced))\n })\n } else {\n syncCheckedValue(true, forced)\n }\n } else {\n const values = multiple ? castArray(modelValue) : [modelValue]\n const nodes = unique(\n values.map((val) =>\n store?.getNodeByValue(val as CascaderNodeValue, leafOnly)\n )\n ) as Node[]\n syncMenuState(nodes, forced)\n checkedValue.value = cloneDeep(modelValue ?? undefined)\n }\n}\n\nconst syncMenuState = (\n newCheckedNodes: CascaderNode[],\n reserveExpandingState = true\n) => {\n const { checkStrictly } = config.value\n const oldNodes = checkedNodes.value\n const newNodes = newCheckedNodes.filter(\n (node) => !!node && (checkStrictly || node.isLeaf)\n )\n const oldExpandingNode = store?.getSameNode(expandingNode.value!)\n const newExpandingNode =\n (reserveExpandingState && oldExpandingNode) || newNodes[0]\n\n if (newExpandingNode) {\n newExpandingNode.pathNodes.forEach((node) => expandNode(node, true))\n } else {\n expandingNode.value = undefined\n }\n\n oldNodes.forEach((node) => node.doCheck(false))\n reactive(newNodes).forEach((node) => node.doCheck(true))\n checkedNodes.value = newNodes\n nextTick(scrollToExpandingNode)\n}\n\nconst scrollToExpandingNode = () => {\n if (!isClient) return\n\n menuList.value.forEach((menu) => {\n const menuElement = menu?.$el\n if (menuElement) {\n // virtual scroll mode, use scrollToItem method\n if (virtualScroll.value) {\n const activeIndex = menu?.getActiveNodeIndex?.()\n if (activeIndex !== undefined && activeIndex >= 0) {\n menu?.scrollToItem?.(activeIndex)\n }\n } else {\n // logic for non-virtual scroll mode\n const container = menuElement.querySelector(\n `.${ns.namespace.value}-scrollbar__wrap`\n )\n let activeNode = menuElement.querySelector(\n `.${ns.b('node')}.in-active-path`\n )\n if (!activeNode) {\n const activeElements = menuElement.querySelectorAll(\n `.${ns.b('node')}.${ns.is('active')}`\n )\n activeNode = activeElements[activeElements.length - 1]\n }\n scrollIntoView(container, activeNode)\n }\n }\n })\n}\n\nconst handleKeyDown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement\n const code = getEventCode(e)\n\n switch (code) {\n case EVENT_CODE.up:\n case EVENT_CODE.down: {\n e.preventDefault()\n const distance = code === EVENT_CODE.up ? -1 : 1\n\n if (virtualScroll.value) {\n const menuIndex = getMenuIndex(target)\n const menu = menuList.value[menuIndex]\n if (menu) {\n // For virtual scroll, calculate the target index and use focusNodeAt\n const currentIndex = menu.getNodeIndexById(target.id)\n if (currentIndex >= 0) {\n const nodesInMenu = menus.value[menuIndex] ?? []\n const nodesCount = nodesInMenu.length\n // Find the next non-disabled node\n let targetIndex = currentIndex + distance\n while (targetIndex >= 0 && targetIndex < nodesCount) {\n if (!nodesInMenu[targetIndex].isDisabled) {\n menu.focusNodeAt(targetIndex)\n return\n }\n targetIndex += distance\n }\n }\n }\n }\n\n focusNode(\n getSibling(\n target,\n distance,\n `.${ns.b('node')}[tabindex=\"-1\"]`\n ) as HTMLElement\n )\n break\n }\n case EVENT_CODE.left: {\n e.preventDefault()\n const preMenu = menuList.value[getMenuIndex(target) - 1]\n const expandedNode = preMenu?.$el.querySelector(\n `.${ns.b('node')}[aria-expanded=\"true\"]`\n )\n focusNode(expandedNode)\n break\n }\n case EVENT_CODE.right: {\n e.preventDefault()\n const nextMenu = menuList.value[getMenuIndex(target) + 1]\n const firstNode = nextMenu?.$el.querySelector(\n `.${ns.b('node')}[tabindex=\"-1\"]`\n )\n focusNode(firstNode)\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n checkNode(target)\n break\n }\n}\n\nprovide(\n CASCADER_PANEL_INJECTION_KEY,\n reactive({\n config,\n expandingNode,\n checkedNodes,\n isHoverMenu,\n initialLoaded,\n renderLabelFn,\n virtualScroll,\n itemSize,\n height,\n lazyLoad,\n expandNode,\n handleCheckChange,\n })\n)\n\nwatch(\n config,\n (newVal, oldVal) => {\n if (isEqual(newVal, oldVal)) return\n initStore()\n },\n {\n immediate: true,\n }\n)\n\nwatch(() => props.options, initStore, {\n deep: true,\n})\n\nwatch(\n () => props.modelValue,\n () => {\n manualChecked = false\n syncCheckedValue()\n },\n {\n deep: true,\n }\n)\n\nwatch(\n () => checkedValue.value,\n (val) => {\n if (!isEqual(val, props.modelValue)) {\n emit(UPDATE_MODEL_EVENT, val)\n emit(CHANGE_EVENT, val)\n }\n }\n)\n\nconst loadLazyRootNodes = () => {\n if (initialLoadedOnce.value) return\n initStore()\n}\n\nonBeforeUpdate(() => (menuList.value = []))\n\nonMounted(() => !isEmpty(props.modelValue) && syncCheckedValue())\n\ndefineExpose({\n menuList,\n menus,\n checkedNodes,\n handleKeyDown,\n handleCheckChange,\n getFlattedNodes,\n /**\n * @description get an array of currently selected node,(leafOnly) whether only return the leaf checked nodes, default is `false`\n */\n getCheckedNodes,\n /**\n * @description clear checked nodes\n */\n clearCheckedNodes,\n calculateCheckedValue,\n scrollToExpandingNode,\n loadLazyRootNodes,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EA6EA,MAAM,QAAQ;EAOd,MAAM,OAAO;EAGb,IAAI,gBAAgB;EAEpB,MAAM,KAAK,2BAAa,WAAU;EAClC,MAAM,SAAS,iCAAkB,MAAK;EACtC,MAAM,2BAAiB;EAEvB,IAAI;EACJ,MAAM,6BAAoB,KAAI;EAC9B,MAAM,iCAAwB,MAAK;EACnC,MAAM,wBAAuC,EAAE,CAAA;EAC/C,MAAM,6BAAkC;EACxC,MAAM,qBAA8B,EAAE,CAAA;EACtC,MAAM,8BAAkC;EACxC,MAAM,4BAAmC,EAAE,CAAA;EAE3C,MAAM,sCAA6B,OAAO,MAAM,kBAAkB,QAAO;EACzE,MAAM,wCAA+B,MAAM,eAAe,MAAM,QAAO;EACvE,MAAM,wCAA+B,MAAM,cAAa;EACxD,MAAM,mCAA0B,MAAM,SAAQ;EAC9C,MAAM,iCAAwB,MAAM,OAAM;EAE1C,MAAM,kBAAkB;GACtB,MAAM,EAAE,YAAY;GACpB,MAAM,MAAM,OAAO;AAEnB,mBAAgB;AAChB,WAAQ,IAAI,sBAAM,SAAS,IAAG;AAC9B,SAAM,QAAQ,CAAC,MAAM,UAAU,CAAA;AAE/B,OAAI,IAAI,QAAQ,sBAAQ,MAAM,QAAQ,EAAE;AACtC,kBAAc,QAAQ;AACtB,aAAS,SAAY,SAAS;AAC5B,SAAI,MAAM;AACR,cAAQ,IAAI,sBAAM,MAAM,IAAG;AAC3B,YAAM,QAAQ,CAAC,MAAM,UAAU,CAAA;;AAEjC,mBAAc,QAAQ;AACtB,sBAAiB,OAAO,KAAI;MAC7B;SAED,kBAAiB,OAAO,KAAI;;EAIhC,MAAM,YAAgD,MAAM,OAAO;GACjE,MAAM,MAAM,OAAO;AACnB,UAAQ,QAAQ,I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AW,EACpC,MAAM,MACP,CAAA;AAED,uBACQ,MAAM,kBACN;AACJ,mBAAgB;AAChB,qBAAiB;KAEnB,EACE,MAAM,MACR,CACF;AAEA,uBACQ,aAAa,QAClB,QAAQ;AACP,OAAI,6BAAS,KAAK,MAAM,WAAW,EAAE;AACnC,SAAK,kCAAoB,IAAG;AAC5B,SAAK,4BAAc,IAAG;;IAG5B;EAEA,MAAM,0BAA0B;AAC9B,OAAI,kBAAkB,MAAO;AAC7B,cAAU;;AAGZ,gCAAsB,SAAS,QAAQ,EAAE,CAAC;AAE1C,2BAAgB,CAAC,sBAAQ,MAAM,WAAW,IAAI,kBAAkB,CAAA;AAEhE,WAAa;GACX;GACA;GACA;GACA;GACA;GACA;GAIA;GAIA;GACA;GACA;GACA;GACD,CAAA;;4DAncO,OAAA;IAjBH,+BAAK,gBAAG,GAAE,CAAC,EAAC,QAAA,iBAAW,GAAE,CAAC,GAAE,YAAa,QAAA,OAAM,CAAA,CAAA;IAC/C,WAAS;8DAeS,cAAA,0BAZO,MAAA,QAAhB,MAAM,UAAK;sDAYF,sBAAA;KAXhB,KAAK;;KACL,MAAM,SAAU,SAAA,MAAS,SAAS;KAC3B;KACP,OAAK,CAAA,GAAM,KAAI;KACf,kBAAgB,cAAA;KAChB,aAAW,SAAA;KACX,QAAQ,OAAA;;KAEE,8BACY,qBAAA,KAAA,QAAA,QAAA"}
|
|
@@ -24,9 +24,9 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
|
|
|
24
24
|
virtualListRef: vue.Ref<FixedSizeListInstance | undefined, FixedSizeListInstance | undefined>;
|
|
25
25
|
readonly $el: HTMLElement;
|
|
26
26
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
27
|
-
height: number;
|
|
28
27
|
virtualScroll: boolean;
|
|
29
28
|
itemSize: number;
|
|
29
|
+
height: number;
|
|
30
30
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
31
31
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
32
|
declare const _default: typeof __VLS_export;
|
|
@@ -24,7 +24,7 @@ interface CheckTagProps {
|
|
|
24
24
|
declare const checkTagProps: {
|
|
25
25
|
readonly checked: BooleanConstructor;
|
|
26
26
|
readonly disabled: BooleanConstructor;
|
|
27
|
-
readonly type: EpPropFinalized<StringConstructor, "
|
|
27
|
+
readonly type: EpPropFinalized<StringConstructor, "info" | "primary" | "success" | "warning" | "danger", unknown, "primary", boolean>;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* @deprecated Removed after 3.0.0, Use `CheckTagProps` instead.
|
|
@@ -8,19 +8,19 @@ type __VLS_Slots = {} & {
|
|
|
8
8
|
default?: (props: typeof __VLS_1) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: vue.DefineComponent<CheckboxProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
11
|
-
change: (val: CheckboxValueType) => void;
|
|
12
11
|
"update:modelValue": (val: CheckboxValueType) => void;
|
|
12
|
+
change: (val: CheckboxValueType) => void;
|
|
13
13
|
}, string, vue.PublicProps, Readonly<CheckboxProps> & Readonly<{
|
|
14
|
-
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
15
14
|
"onUpdate:modelValue"?: ((val: CheckboxValueType) => any) | undefined;
|
|
15
|
+
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
disabled: boolean;
|
|
18
17
|
modelValue: number | string | boolean;
|
|
19
|
-
validateEvent: boolean;
|
|
20
|
-
id: string;
|
|
21
|
-
value: string | boolean | number | object;
|
|
22
18
|
name: string;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
value: string | boolean | number | object;
|
|
23
21
|
label: string | boolean | number | object;
|
|
22
|
+
id: string;
|
|
23
|
+
validateEvent: boolean;
|
|
24
24
|
trueValue: string | number;
|
|
25
25
|
falseValue: string | number;
|
|
26
26
|
trueLabel: string | number;
|
|
@@ -9,20 +9,20 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
default?: (props: typeof __VLS_8) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: vue.DefineComponent<CheckboxGroupProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
12
|
-
change: (val: CheckboxValueType[]) => void;
|
|
13
12
|
"update:modelValue": (val: CheckboxGroupValueType) => void;
|
|
13
|
+
change: (val: CheckboxValueType[]) => void;
|
|
14
14
|
}, string, vue.PublicProps, Readonly<CheckboxGroupProps> & Readonly<{
|
|
15
|
-
onChange?: ((val: CheckboxValueType[]) => any) | undefined;
|
|
16
15
|
"onUpdate:modelValue"?: ((val: CheckboxGroupValueType) => any) | undefined;
|
|
16
|
+
onChange?: ((val: CheckboxValueType[]) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
|
-
|
|
19
|
-
type: "checkbox" | "button";
|
|
18
|
+
modelValue: CheckboxGroupValueType;
|
|
20
19
|
props: {
|
|
21
20
|
value?: string;
|
|
22
21
|
label?: string;
|
|
23
22
|
disabled?: string;
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
type: "checkbox" | "button";
|
|
25
|
+
disabled: boolean;
|
|
26
26
|
validateEvent: boolean;
|
|
27
27
|
tag: string;
|
|
28
28
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -86,21 +86,21 @@ declare const checkboxProps: {
|
|
|
86
86
|
* @description binding value
|
|
87
87
|
*/
|
|
88
88
|
modelValue: {
|
|
89
|
-
type: (BooleanConstructor |
|
|
89
|
+
type: (BooleanConstructor | NumberConstructor | StringConstructor)[];
|
|
90
90
|
default: undefined;
|
|
91
91
|
};
|
|
92
92
|
/**
|
|
93
93
|
* @description label of the Checkbox when used inside a `checkbox-group`
|
|
94
94
|
*/
|
|
95
95
|
label: {
|
|
96
|
-
type: (BooleanConstructor | ObjectConstructor |
|
|
96
|
+
type: (BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[];
|
|
97
97
|
default: undefined;
|
|
98
98
|
};
|
|
99
99
|
/**
|
|
100
100
|
* @description value of the Checkbox when used inside a `checkbox-group`
|
|
101
101
|
*/
|
|
102
102
|
value: {
|
|
103
|
-
type: (BooleanConstructor | ObjectConstructor |
|
|
103
|
+
type: (BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[];
|
|
104
104
|
default: undefined;
|
|
105
105
|
};
|
|
106
106
|
/**
|
|
@@ -129,14 +129,14 @@ declare const checkboxProps: {
|
|
|
129
129
|
* @description value of the Checkbox if it's checked
|
|
130
130
|
*/
|
|
131
131
|
trueValue: {
|
|
132
|
-
type: (
|
|
132
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
133
133
|
default: undefined;
|
|
134
134
|
};
|
|
135
135
|
/**
|
|
136
136
|
* @description value of the Checkbox if it's not checked
|
|
137
137
|
*/
|
|
138
138
|
falseValue: {
|
|
139
|
-
type: (
|
|
139
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
140
140
|
default: undefined;
|
|
141
141
|
};
|
|
142
142
|
/**
|
|
@@ -144,7 +144,7 @@ declare const checkboxProps: {
|
|
|
144
144
|
* @description value of the Checkbox if it's checked
|
|
145
145
|
*/
|
|
146
146
|
trueLabel: {
|
|
147
|
-
type: (
|
|
147
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
148
148
|
default: undefined;
|
|
149
149
|
};
|
|
150
150
|
/**
|
|
@@ -152,7 +152,7 @@ declare const checkboxProps: {
|
|
|
152
152
|
* @description value of the Checkbox if it's not checked
|
|
153
153
|
*/
|
|
154
154
|
falseLabel: {
|
|
155
|
-
type: (
|
|
155
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
156
156
|
default: undefined;
|
|
157
157
|
};
|
|
158
158
|
/**
|
|
@@ -178,7 +178,7 @@ declare const checkboxProps: {
|
|
|
178
178
|
/**
|
|
179
179
|
* @description input tabindex
|
|
180
180
|
*/
|
|
181
|
-
tabindex: (
|
|
181
|
+
tabindex: (NumberConstructor | StringConstructor)[];
|
|
182
182
|
/**
|
|
183
183
|
* @description whether to trigger form validation
|
|
184
184
|
*/
|
|
@@ -8,19 +8,19 @@ type __VLS_Slots = {} & {
|
|
|
8
8
|
default?: (props: typeof __VLS_10) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: vue.DefineComponent<CheckboxProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
11
|
-
change: (val: CheckboxValueType) => void;
|
|
12
11
|
"update:modelValue": (val: CheckboxValueType) => void;
|
|
12
|
+
change: (val: CheckboxValueType) => void;
|
|
13
13
|
}, string, vue.PublicProps, Readonly<CheckboxProps> & Readonly<{
|
|
14
|
-
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
15
14
|
"onUpdate:modelValue"?: ((val: CheckboxValueType) => any) | undefined;
|
|
15
|
+
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
disabled: boolean;
|
|
18
17
|
modelValue: number | string | boolean;
|
|
19
|
-
validateEvent: boolean;
|
|
20
|
-
id: string;
|
|
21
|
-
value: string | boolean | number | object;
|
|
22
18
|
name: string;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
value: string | boolean | number | object;
|
|
23
21
|
label: string | boolean | number | object;
|
|
22
|
+
id: string;
|
|
23
|
+
validateEvent: boolean;
|
|
24
24
|
trueValue: string | number;
|
|
25
25
|
falseValue: string | number;
|
|
26
26
|
trueLabel: string | number;
|
|
@@ -33,7 +33,7 @@ interface CollapseProps {
|
|
|
33
33
|
declare const collapseProps: {
|
|
34
34
|
readonly accordion: BooleanConstructor;
|
|
35
35
|
readonly modelValue: EpPropFinalized<(new (...args: any[]) => string | number | CollapseActiveName[]) | (() => CollapseModelValue) | (((new (...args: any[]) => string | number | CollapseActiveName[]) | (() => CollapseModelValue)) | null)[], unknown, unknown, () => [], boolean>;
|
|
36
|
-
readonly expandIconPosition: EpPropFinalized<(new (...args: any[]) => "
|
|
36
|
+
readonly expandIconPosition: EpPropFinalized<(new (...args: any[]) => "left" | "right") | (() => CollapseIconPositionType) | (((new (...args: any[]) => "left" | "right") | (() => CollapseIconPositionType)) | null)[], unknown, unknown, "right", boolean>;
|
|
37
37
|
readonly beforeCollapse: {
|
|
38
38
|
readonly type: vue.PropType<(name: CollapseActiveName) => Awaitable<boolean>>;
|
|
39
39
|
readonly required: false;
|
|
@@ -11,11 +11,11 @@ declare const __VLS_base: vue.DefineComponent<CollapseProps, {
|
|
|
11
11
|
/** @description active names */activeNames: vue.Ref<(string | number)[], (string | number)[]>; /** @description set active names */
|
|
12
12
|
setActiveNames: (_activeNames: CollapseActiveName[]) => void;
|
|
13
13
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
14
|
-
change: (value: CollapseModelValue) => void;
|
|
15
14
|
"update:modelValue": (value: CollapseModelValue) => void;
|
|
15
|
+
change: (value: CollapseModelValue) => void;
|
|
16
16
|
}, string, vue.PublicProps, Readonly<CollapseProps> & Readonly<{
|
|
17
|
-
onChange?: ((value: CollapseModelValue) => any) | undefined;
|
|
18
17
|
"onUpdate:modelValue"?: ((value: CollapseModelValue) => any) | undefined;
|
|
18
|
+
onChange?: ((value: CollapseModelValue) => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
20
|
modelValue: CollapseModelValue;
|
|
21
21
|
expandIconPosition: CollapseIconPositionType;
|
|
@@ -29,28 +29,28 @@ declare const __VLS_export: vue.DefineComponent<ColorPickerProps, {
|
|
|
29
29
|
*/
|
|
30
30
|
blur: typeof blur;
|
|
31
31
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
32
|
+
"update:modelValue": (val: string | null) => void;
|
|
32
33
|
change: (val: string | null) => void;
|
|
33
34
|
clear: () => void;
|
|
34
|
-
"update:modelValue": (val: string | null) => void;
|
|
35
35
|
focus: (evt: FocusEvent) => void;
|
|
36
36
|
blur: (evt: FocusEvent) => void;
|
|
37
37
|
activeChange: (val: string | null) => void;
|
|
38
38
|
}, string, vue.PublicProps, Readonly<ColorPickerProps> & Readonly<{
|
|
39
|
+
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
39
40
|
onChange?: ((val: string | null) => any) | undefined;
|
|
40
41
|
onClear?: (() => any) | undefined;
|
|
41
|
-
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
42
42
|
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
43
43
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
44
44
|
onActiveChange?: ((val: string | null) => any) | undefined;
|
|
45
45
|
}>, {
|
|
46
|
-
disabled: boolean;
|
|
47
46
|
modelValue: string | null;
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
teleported: boolean;
|
|
48
49
|
clearable: boolean;
|
|
49
|
-
validateEvent: boolean;
|
|
50
50
|
tabindex: string | number;
|
|
51
|
+
validateEvent: boolean;
|
|
51
52
|
popperStyle: string | false | vue.CSSProperties | vue.StyleValue[] | null;
|
|
52
53
|
persistent: boolean;
|
|
53
|
-
teleported: boolean;
|
|
54
54
|
valueOnClear: string | number | boolean | Function | null;
|
|
55
55
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
56
56
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,16 +2,16 @@ const require_runtime = require('../../../_virtual/_rolldown/runtime.js');
|
|
|
2
2
|
const require_aria = require('../../../constants/aria.js');
|
|
3
3
|
const require_event = require('../../../constants/event.js');
|
|
4
4
|
const require_event$1 = require('../../../utils/dom/event.js');
|
|
5
|
-
const require_index = require('../../../
|
|
6
|
-
const require_index$1 = require('../../../hooks/use-
|
|
7
|
-
const require_index$2 = require('../../../hooks/use-
|
|
8
|
-
const require_index$3 = require('../../../hooks/use-
|
|
9
|
-
const require_index$4 = require('
|
|
5
|
+
const require_index = require('../../../directives/click-outside/index.js');
|
|
6
|
+
const require_index$1 = require('../../../hooks/use-locale/index.js');
|
|
7
|
+
const require_index$2 = require('../../../hooks/use-namespace/index.js');
|
|
8
|
+
const require_index$3 = require('../../../hooks/use-focus-controller/index.js');
|
|
9
|
+
const require_index$4 = require('../../../hooks/use-empty-values/index.js');
|
|
10
|
+
const require_index$5 = require('../../icon/index.js');
|
|
10
11
|
const require_use_form_common_props = require('../../form/src/hooks/use-form-common-props.js');
|
|
11
12
|
const require_use_form_item = require('../../form/src/hooks/use-form-item.js');
|
|
12
|
-
const require_index$
|
|
13
|
-
const require_index$
|
|
14
|
-
const require_index$7 = require('../../../directives/click-outside/index.js');
|
|
13
|
+
const require_index$6 = require('../../tooltip/index.js');
|
|
14
|
+
const require_index$7 = require('../../button/index.js');
|
|
15
15
|
const require_color_picker_panel = require('../../color-picker-panel/src/color-picker-panel.js');
|
|
16
16
|
const require_color = require('../../color-picker-panel/src/utils/color.js');
|
|
17
17
|
const require_use_common_color = require('../../color-picker-panel/src/composables/use-common-color.js');
|
|
@@ -40,12 +40,12 @@ var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
40
40
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
41
41
|
const props = __props;
|
|
42
42
|
const emit = __emit;
|
|
43
|
-
const { t } = require_index.useLocale();
|
|
44
|
-
const ns = require_index$
|
|
43
|
+
const { t } = require_index$1.useLocale();
|
|
44
|
+
const ns = require_index$2.useNamespace("color");
|
|
45
45
|
const { formItem } = require_use_form_item.useFormItem();
|
|
46
46
|
const colorSize = require_use_form_common_props.useFormSize();
|
|
47
47
|
const colorDisabled = require_use_form_common_props.useFormDisabled();
|
|
48
|
-
const { valueOnClear, isEmptyValue } = require_index$
|
|
48
|
+
const { valueOnClear, isEmptyValue } = require_index$4.useEmptyValues(props, null);
|
|
49
49
|
const commonColor = require_use_common_color.useCommonColor(props, emit);
|
|
50
50
|
const { inputId: buttonId, isLabeledByFormItem } = require_use_form_item.useFormItemInputId(props, { formItemContext: formItem });
|
|
51
51
|
const popper = (0, vue.ref)();
|
|
@@ -54,7 +54,7 @@ var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
54
54
|
const showPicker = (0, vue.ref)(false);
|
|
55
55
|
const showPanelColor = (0, vue.ref)(false);
|
|
56
56
|
let shouldActiveChange = true;
|
|
57
|
-
const { isFocused, handleFocus, handleBlur } = require_index$
|
|
57
|
+
const { isFocused, handleFocus, handleBlur } = require_index$3.useFocusController(triggerRef, {
|
|
58
58
|
disabled: colorDisabled,
|
|
59
59
|
beforeBlur(event) {
|
|
60
60
|
return popper.value?.isFocusInsideContent(event);
|
|
@@ -203,7 +203,7 @@ var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
203
203
|
blur
|
|
204
204
|
});
|
|
205
205
|
return (_ctx, _cache) => {
|
|
206
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_index$
|
|
206
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_index$6.ElTooltip), {
|
|
207
207
|
ref_key: "popper",
|
|
208
208
|
ref: popper,
|
|
209
209
|
visible: showPicker.value,
|
|
@@ -239,7 +239,7 @@ var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
239
239
|
"validate-event": false,
|
|
240
240
|
onKeydown: (0, vue.withKeys)(handleEsc, ["esc"])
|
|
241
241
|
}), {
|
|
242
|
-
footer: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", null, [__props.clearable ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_index$
|
|
242
|
+
footer: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", null, [__props.clearable ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_index$7.ElButton), {
|
|
243
243
|
key: 0,
|
|
244
244
|
class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("footer", "link-btn")),
|
|
245
245
|
text: "",
|
|
@@ -248,7 +248,7 @@ var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
248
248
|
}, {
|
|
249
249
|
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.colorpicker.clear")), 1)]),
|
|
250
250
|
_: 1
|
|
251
|
-
}, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createVNode)((0, vue.unref)(require_index$
|
|
251
|
+
}, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createVNode)((0, vue.unref)(require_index$7.ElButton), {
|
|
252
252
|
plain: "",
|
|
253
253
|
size: "small",
|
|
254
254
|
class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("footer", "btn")),
|
|
@@ -259,7 +259,7 @@ var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
259
259
|
}, 8, ["class"])])]),
|
|
260
260
|
_: 1
|
|
261
261
|
}, 16)), [[
|
|
262
|
-
(0, vue.unref)(require_index
|
|
262
|
+
(0, vue.unref)(require_index.default),
|
|
263
263
|
handleClickOutside,
|
|
264
264
|
triggerRef.value
|
|
265
265
|
]])]),
|
|
@@ -284,10 +284,10 @@ var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
284
284
|
}, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("picker", "color"), (0, vue.unref)(ns).is("alpha", __props.showAlpha)]) }, [(0, vue.createElementVNode)("span", {
|
|
285
285
|
class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("picker", "color-inner")),
|
|
286
286
|
style: (0, vue.normalizeStyle)({ backgroundColor: displayedColor.value })
|
|
287
|
-
}, [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(require_index$
|
|
287
|
+
}, [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(require_index$5.ElIcon), { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("picker", "icon"), (0, vue.unref)(ns).is("icon-arrow-down")]) }, {
|
|
288
288
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_element_plus_icons_vue.ArrowDown))]),
|
|
289
289
|
_: 1
|
|
290
|
-
}, 8, ["class"]), [[vue.vShow, __props.modelValue || showPanelColor.value]]), (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(require_index$
|
|
290
|
+
}, 8, ["class"]), [[vue.vShow, __props.modelValue || showPanelColor.value]]), (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(require_index$5.ElIcon), { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("picker", "empty"), (0, vue.unref)(ns).is("icon-close")]) }, {
|
|
291
291
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_element_plus_icons_vue.Close))]),
|
|
292
292
|
_: 1
|
|
293
293
|
}, 8, ["class"]), [[vue.vShow, !__props.modelValue && !showPanelColor.value]])], 6)], 2)], 2)], 16, _hoisted_1)]),
|
package/lib/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-picker.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../../../../packages/components/color-picker/src/color-picker.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"popper\"\n :visible=\"showPicker\"\n :show-arrow=\"false\"\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :offset=\"0\"\n :gpu-acceleration=\"false\"\n :popper-class=\"[ns.be('picker', 'panel'), popperClass!]\"\n :popper-style=\"popperStyle\"\n :stop-popper-mouse-event=\"false\"\n pure\n loop\n role=\"dialog\"\n effect=\"light\"\n trigger=\"click\"\n :teleported=\"teleported\"\n :transition=\"`${ns.namespace.value}-zoom-in-top`\"\n :persistent=\"persistent\"\n :append-to=\"appendTo\"\n @show=\"handleShowTooltip\"\n @hide=\"setShowPicker(false)\"\n >\n <template #content>\n <el-color-picker-panel\n ref=\"pickerPanelRef\"\n v-bind=\"panelProps\"\n v-click-outside:[triggerRef]=\"handleClickOutside\"\n :border=\"false\"\n :validate-event=\"false\"\n @keydown.esc=\"handleEsc\"\n >\n <template #footer>\n <div>\n <el-button\n v-if=\"clearable\"\n :class=\"ns.be('footer', 'link-btn')\"\n text\n size=\"small\"\n @click=\"clear\"\n >\n {{ t('el.colorpicker.clear') }}\n </el-button>\n <el-button\n plain\n size=\"small\"\n :class=\"ns.be('footer', 'btn')\"\n @click=\"confirmValue\"\n >\n {{ t('el.colorpicker.confirm') }}\n </el-button>\n </div>\n </template>\n </el-color-picker-panel>\n </template>\n <template #default>\n <div\n :id=\"buttonId\"\n ref=\"triggerRef\"\n v-bind=\"$attrs\"\n :class=\"btnKls\"\n role=\"button\"\n :aria-label=\"buttonAriaLabel\"\n :aria-labelledby=\"buttonAriaLabelledby\"\n :aria-description=\"\n t('el.colorpicker.description', { color: modelValue || '' })\n \"\n :aria-disabled=\"colorDisabled\"\n :tabindex=\"colorDisabled ? undefined : tabindex\"\n @keydown=\"handleKeyDown\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n >\n <div :class=\"ns.be('picker', 'trigger')\" @click=\"handleTrigger\">\n <span :class=\"[ns.be('picker', 'color'), ns.is('alpha', showAlpha)]\">\n <span\n :class=\"ns.be('picker', 'color-inner')\"\n :style=\"{\n backgroundColor: displayedColor,\n }\"\n >\n <el-icon\n v-show=\"modelValue || showPanelColor\"\n :class=\"[ns.be('picker', 'icon'), ns.is('icon-arrow-down')]\"\n >\n <arrow-down />\n </el-icon>\n <el-icon\n v-show=\"!modelValue && !showPanelColor\"\n :class=\"[ns.be('picker', 'empty'), ns.is('icon-close')]\"\n >\n <close />\n </el-icon>\n </span>\n </span>\n </div>\n </div>\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, nextTick, provide, ref, watch } from 'vue'\nimport { debounce, pick } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { reactiveComputed } from '@vueuse/core'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { ElButton } from '@element-plus/components/button'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n useEmptyValues,\n useFocusController,\n useLocale,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { NOOP, getEventCode } from '@element-plus/utils'\nimport { ArrowDown, Close } from '@element-plus/icons-vue'\nimport { colorPickerEmits, colorPickerPropsDefaults } from './color-picker'\nimport {\n ElColorPickerPanel,\n ROOT_COMMON_COLOR_INJECTION_KEY,\n colorPickerPanelProps,\n} from '@element-plus/components/color-picker-panel'\nimport Color from '@element-plus/components/color-picker-panel/src/utils/color'\nimport { useCommonColor } from '@element-plus/components/color-picker-panel/src/composables/use-common-color'\n\nimport type { ColorPickerPanelInstance } from '@element-plus/components/color-picker-panel'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\nimport type { ColorPickerProps } from './color-picker'\n\ndefineOptions({\n name: 'ElColorPicker',\n})\nconst props = withDefaults(\n defineProps<ColorPickerProps>(),\n colorPickerPropsDefaults\n)\n\nconst emit = defineEmits(colorPickerEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('color')\nconst { formItem } = useFormItem()\nconst colorSize = useFormSize()\nconst colorDisabled = useFormDisabled()\nconst { valueOnClear, isEmptyValue } = useEmptyValues(props, null)\nconst commonColor = useCommonColor(props, emit)\nconst { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst popper = ref<TooltipInstance>()\nconst triggerRef = ref()\nconst pickerPanelRef = ref<ColorPickerPanelInstance>()\nconst showPicker = ref(false)\nconst showPanelColor = ref(false)\n\n// active-change is used to prevent modelValue changes from triggering.\nlet shouldActiveChange = true\n\nconst { isFocused, handleFocus, handleBlur } = useFocusController(triggerRef, {\n disabled: colorDisabled,\n beforeBlur(event) {\n return popper.value?.isFocusInsideContent(event)\n },\n afterBlur() {\n setShowPicker(false)\n resetColor()\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\n }\n },\n})\n\nconst color = reactiveComputed(\n () => pickerPanelRef.value?.color ?? commonColor.color\n) as Color\n\nconst panelProps = computed(() =>\n pick(props, Object.keys(colorPickerPanelProps))\n)\n\nconst displayedColor = computed(() => {\n if (!props.modelValue && !showPanelColor.value) {\n return 'transparent'\n }\n return displayedRgb(color, props.showAlpha)\n})\n\nconst currentColor = computed(() => {\n return !props.modelValue && !showPanelColor.value ? '' : color.value\n})\n\nconst buttonAriaLabel = computed<string | undefined>(() => {\n return !isLabeledByFormItem.value\n ? props.ariaLabel || t('el.colorpicker.defaultLabel')\n : undefined\n})\n\nconst buttonAriaLabelledby = computed<string | undefined>(() => {\n return isLabeledByFormItem.value ? formItem?.labelId : undefined\n})\n\nconst btnKls = computed(() => {\n return [\n ns.b('picker'),\n ns.is('disabled', colorDisabled.value),\n ns.bm('picker', colorSize.value),\n ns.is('focused', isFocused.value),\n ]\n})\n\nfunction displayedRgb(color: Color, showAlpha: boolean) {\n const { r, g, b, a } = color.toRgb()\n return showAlpha ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`\n}\n\nfunction setShowPicker(value: boolean) {\n showPicker.value = value\n}\n\nconst debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true })\nfunction show() {\n if (colorDisabled.value) return\n setShowPicker(true)\n}\n\nfunction hide() {\n debounceSetShowPicker(false)\n resetColor()\n}\n\nfunction resetColor() {\n nextTick(() => {\n if (props.modelValue) {\n color.fromString(props.modelValue)\n } else {\n color.value = ''\n nextTick(() => {\n showPanelColor.value = false\n })\n }\n })\n}\n\nfunction handleTrigger() {\n if (colorDisabled.value) return\n if (showPicker.value) {\n resetColor()\n }\n debounceSetShowPicker(!showPicker.value)\n}\n\nfunction confirmValue() {\n const value = isEmptyValue(color.value) ? valueOnClear.value : color.value\n emit(UPDATE_MODEL_EVENT, value)\n emit(CHANGE_EVENT, value)\n if (props.validateEvent) {\n formItem?.validate('change').catch(NOOP)\n }\n debounceSetShowPicker(false)\n // check if modelValue change, if not change, then reset color.\n nextTick(() => {\n const newColor = new Color({\n enableAlpha: props.showAlpha,\n format: props.colorFormat || '',\n value: props.modelValue,\n })\n if (!color.compare(newColor)) {\n resetColor()\n }\n })\n}\n\nfunction clear() {\n debounceSetShowPicker(false)\n emit(UPDATE_MODEL_EVENT, valueOnClear.value)\n emit(CHANGE_EVENT, valueOnClear.value)\n if (props.modelValue !== valueOnClear.value && props.validateEvent) {\n formItem?.validate('change').catch(NOOP)\n }\n resetColor()\n emit('clear')\n}\n\nfunction handleShowTooltip() {\n pickerPanelRef?.value?.inputRef?.focus()\n}\n\nfunction handleClickOutside() {\n if (!showPicker.value) return\n hide()\n isFocused.value && focus()\n}\n\nfunction handleEsc(event: KeyboardEvent) {\n event.preventDefault()\n event.stopPropagation()\n setShowPicker(false)\n resetColor()\n}\n\nfunction handleKeyDown(event: KeyboardEvent) {\n const code = getEventCode(event)\n\n switch (code) {\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space:\n event.preventDefault()\n event.stopPropagation()\n show()\n break\n case EVENT_CODE.esc:\n handleEsc(event)\n break\n }\n}\n\nfunction focus() {\n triggerRef.value.focus()\n}\n\nfunction blur() {\n triggerRef.value.blur()\n}\n\nwatch(\n () => currentColor.value,\n (val) => {\n shouldActiveChange && emit('activeChange', val)\n shouldActiveChange = true\n }\n)\n\nwatch(\n () => color.value,\n () => {\n if (!props.modelValue && !showPanelColor.value) {\n showPanelColor.value = true\n }\n }\n)\n\nwatch(\n () => props.modelValue,\n (newVal) => {\n if (!newVal) {\n showPanelColor.value = false\n } else if (newVal && newVal !== color.value) {\n shouldActiveChange = false\n color.fromString(newVal)\n }\n }\n)\n\nwatch(\n () => showPicker.value,\n () => {\n pickerPanelRef.value && nextTick(pickerPanelRef.value.update)\n }\n)\n\nprovide(ROOT_COMMON_COLOR_INJECTION_KEY, commonColor)\n\ndefineExpose({\n /**\n * @description current color object\n */\n color,\n /**\n * @description manually show ColorPicker\n */\n show,\n /**\n * @description manually hide ColorPicker\n */\n hide,\n /**\n * @description focus the input element\n */\n focus,\n /**\n * @description blur the input element\n */\n blur,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgJA,MAAM,QAAQ;EAKd,MAAM,OAAO;EAEb,MAAM,EAAE,MAAM,yBAAU;EACxB,MAAM,KAAK,6BAAa,QAAO;EAC/B,MAAM,EAAE,aAAa,mCAAY;EACjC,MAAM,YAAY,2CAAY;EAC9B,MAAM,gBAAgB,+CAAgB;EACtC,MAAM,EAAE,cAAc,iBAAiB,+BAAe,OAAO,KAAI;EACjE,MAAM,cAAc,wCAAe,OAAO,KAAI;EAC9C,MAAM,EAAE,SAAS,UAAU,wBAAwB,yCAAmB,OAAO,EAC3E,iBAAiB,UAClB,CAAA;EAED,MAAM,uBAA8B;EACpC,MAAM,2BAAiB;EACvB,MAAM,+BAA+C;EACrD,MAAM,0BAAiB,MAAK;EAC5B,MAAM,8BAAqB,MAAK;EAGhC,IAAI,qBAAqB;EAEzB,MAAM,EAAE,WAAW,aAAa,eAAe,mCAAmB,YAAY;GAC5E,UAAU;GACV,WAAW,OAAO;AAChB,WAAO,OAAO,OAAO,qBAAqB,MAAK;;GAEjD,YAAY;AACV,kBAAc,MAAK;AACnB,gBAAW;AACX,QAAI,MAAM,cACR,WAAU,WAAW,OAAO,CAAC,MAAM,iBAAI;;GAG5C,CAAA;EAED,MAAM,iDACE,eAAe,OAAO,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AC,GAAE,aAAA,CAAA,CAAA;qCAE/B,qCAAA,8BAAA,CAAA;;oCAHA,QAAA,cAAU,CAAK,eAAA,MAAc"}
|
|
1
|
+
{"version":3,"file":"color-picker.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../../../../packages/components/color-picker/src/color-picker.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"popper\"\n :visible=\"showPicker\"\n :show-arrow=\"false\"\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :offset=\"0\"\n :gpu-acceleration=\"false\"\n :popper-class=\"[ns.be('picker', 'panel'), popperClass!]\"\n :popper-style=\"popperStyle\"\n :stop-popper-mouse-event=\"false\"\n pure\n loop\n role=\"dialog\"\n effect=\"light\"\n trigger=\"click\"\n :teleported=\"teleported\"\n :transition=\"`${ns.namespace.value}-zoom-in-top`\"\n :persistent=\"persistent\"\n :append-to=\"appendTo\"\n @show=\"handleShowTooltip\"\n @hide=\"setShowPicker(false)\"\n >\n <template #content>\n <el-color-picker-panel\n ref=\"pickerPanelRef\"\n v-bind=\"panelProps\"\n v-click-outside:[triggerRef]=\"handleClickOutside\"\n :border=\"false\"\n :validate-event=\"false\"\n @keydown.esc=\"handleEsc\"\n >\n <template #footer>\n <div>\n <el-button\n v-if=\"clearable\"\n :class=\"ns.be('footer', 'link-btn')\"\n text\n size=\"small\"\n @click=\"clear\"\n >\n {{ t('el.colorpicker.clear') }}\n </el-button>\n <el-button\n plain\n size=\"small\"\n :class=\"ns.be('footer', 'btn')\"\n @click=\"confirmValue\"\n >\n {{ t('el.colorpicker.confirm') }}\n </el-button>\n </div>\n </template>\n </el-color-picker-panel>\n </template>\n <template #default>\n <div\n :id=\"buttonId\"\n ref=\"triggerRef\"\n v-bind=\"$attrs\"\n :class=\"btnKls\"\n role=\"button\"\n :aria-label=\"buttonAriaLabel\"\n :aria-labelledby=\"buttonAriaLabelledby\"\n :aria-description=\"\n t('el.colorpicker.description', { color: modelValue || '' })\n \"\n :aria-disabled=\"colorDisabled\"\n :tabindex=\"colorDisabled ? undefined : tabindex\"\n @keydown=\"handleKeyDown\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n >\n <div :class=\"ns.be('picker', 'trigger')\" @click=\"handleTrigger\">\n <span :class=\"[ns.be('picker', 'color'), ns.is('alpha', showAlpha)]\">\n <span\n :class=\"ns.be('picker', 'color-inner')\"\n :style=\"{\n backgroundColor: displayedColor,\n }\"\n >\n <el-icon\n v-show=\"modelValue || showPanelColor\"\n :class=\"[ns.be('picker', 'icon'), ns.is('icon-arrow-down')]\"\n >\n <arrow-down />\n </el-icon>\n <el-icon\n v-show=\"!modelValue && !showPanelColor\"\n :class=\"[ns.be('picker', 'empty'), ns.is('icon-close')]\"\n >\n <close />\n </el-icon>\n </span>\n </span>\n </div>\n </div>\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, nextTick, provide, ref, watch } from 'vue'\nimport { debounce, pick } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { reactiveComputed } from '@vueuse/core'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { ElButton } from '@element-plus/components/button'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n useEmptyValues,\n useFocusController,\n useLocale,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { NOOP, getEventCode } from '@element-plus/utils'\nimport { ArrowDown, Close } from '@element-plus/icons-vue'\nimport { colorPickerEmits, colorPickerPropsDefaults } from './color-picker'\nimport {\n ElColorPickerPanel,\n ROOT_COMMON_COLOR_INJECTION_KEY,\n colorPickerPanelProps,\n} from '@element-plus/components/color-picker-panel'\nimport Color from '@element-plus/components/color-picker-panel/src/utils/color'\nimport { useCommonColor } from '@element-plus/components/color-picker-panel/src/composables/use-common-color'\n\nimport type { ColorPickerPanelInstance } from '@element-plus/components/color-picker-panel'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\nimport type { ColorPickerProps } from './color-picker'\n\ndefineOptions({\n name: 'ElColorPicker',\n})\nconst props = withDefaults(\n defineProps<ColorPickerProps>(),\n colorPickerPropsDefaults\n)\n\nconst emit = defineEmits(colorPickerEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('color')\nconst { formItem } = useFormItem()\nconst colorSize = useFormSize()\nconst colorDisabled = useFormDisabled()\nconst { valueOnClear, isEmptyValue } = useEmptyValues(props, null)\nconst commonColor = useCommonColor(props, emit)\nconst { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst popper = ref<TooltipInstance>()\nconst triggerRef = ref()\nconst pickerPanelRef = ref<ColorPickerPanelInstance>()\nconst showPicker = ref(false)\nconst showPanelColor = ref(false)\n\n// active-change is used to prevent modelValue changes from triggering.\nlet shouldActiveChange = true\n\nconst { isFocused, handleFocus, handleBlur } = useFocusController(triggerRef, {\n disabled: colorDisabled,\n beforeBlur(event) {\n return popper.value?.isFocusInsideContent(event)\n },\n afterBlur() {\n setShowPicker(false)\n resetColor()\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\n }\n },\n})\n\nconst color = reactiveComputed(\n () => pickerPanelRef.value?.color ?? commonColor.color\n) as Color\n\nconst panelProps = computed(() =>\n pick(props, Object.keys(colorPickerPanelProps))\n)\n\nconst displayedColor = computed(() => {\n if (!props.modelValue && !showPanelColor.value) {\n return 'transparent'\n }\n return displayedRgb(color, props.showAlpha)\n})\n\nconst currentColor = computed(() => {\n return !props.modelValue && !showPanelColor.value ? '' : color.value\n})\n\nconst buttonAriaLabel = computed<string | undefined>(() => {\n return !isLabeledByFormItem.value\n ? props.ariaLabel || t('el.colorpicker.defaultLabel')\n : undefined\n})\n\nconst buttonAriaLabelledby = computed<string | undefined>(() => {\n return isLabeledByFormItem.value ? formItem?.labelId : undefined\n})\n\nconst btnKls = computed(() => {\n return [\n ns.b('picker'),\n ns.is('disabled', colorDisabled.value),\n ns.bm('picker', colorSize.value),\n ns.is('focused', isFocused.value),\n ]\n})\n\nfunction displayedRgb(color: Color, showAlpha: boolean) {\n const { r, g, b, a } = color.toRgb()\n return showAlpha ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`\n}\n\nfunction setShowPicker(value: boolean) {\n showPicker.value = value\n}\n\nconst debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true })\nfunction show() {\n if (colorDisabled.value) return\n setShowPicker(true)\n}\n\nfunction hide() {\n debounceSetShowPicker(false)\n resetColor()\n}\n\nfunction resetColor() {\n nextTick(() => {\n if (props.modelValue) {\n color.fromString(props.modelValue)\n } else {\n color.value = ''\n nextTick(() => {\n showPanelColor.value = false\n })\n }\n })\n}\n\nfunction handleTrigger() {\n if (colorDisabled.value) return\n if (showPicker.value) {\n resetColor()\n }\n debounceSetShowPicker(!showPicker.value)\n}\n\nfunction confirmValue() {\n const value = isEmptyValue(color.value) ? valueOnClear.value : color.value\n emit(UPDATE_MODEL_EVENT, value)\n emit(CHANGE_EVENT, value)\n if (props.validateEvent) {\n formItem?.validate('change').catch(NOOP)\n }\n debounceSetShowPicker(false)\n // check if modelValue change, if not change, then reset color.\n nextTick(() => {\n const newColor = new Color({\n enableAlpha: props.showAlpha,\n format: props.colorFormat || '',\n value: props.modelValue,\n })\n if (!color.compare(newColor)) {\n resetColor()\n }\n })\n}\n\nfunction clear() {\n debounceSetShowPicker(false)\n emit(UPDATE_MODEL_EVENT, valueOnClear.value)\n emit(CHANGE_EVENT, valueOnClear.value)\n if (props.modelValue !== valueOnClear.value && props.validateEvent) {\n formItem?.validate('change').catch(NOOP)\n }\n resetColor()\n emit('clear')\n}\n\nfunction handleShowTooltip() {\n pickerPanelRef?.value?.inputRef?.focus()\n}\n\nfunction handleClickOutside() {\n if (!showPicker.value) return\n hide()\n isFocused.value && focus()\n}\n\nfunction handleEsc(event: KeyboardEvent) {\n event.preventDefault()\n event.stopPropagation()\n setShowPicker(false)\n resetColor()\n}\n\nfunction handleKeyDown(event: KeyboardEvent) {\n const code = getEventCode(event)\n\n switch (code) {\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space:\n event.preventDefault()\n event.stopPropagation()\n show()\n break\n case EVENT_CODE.esc:\n handleEsc(event)\n break\n }\n}\n\nfunction focus() {\n triggerRef.value.focus()\n}\n\nfunction blur() {\n triggerRef.value.blur()\n}\n\nwatch(\n () => currentColor.value,\n (val) => {\n shouldActiveChange && emit('activeChange', val)\n shouldActiveChange = true\n }\n)\n\nwatch(\n () => color.value,\n () => {\n if (!props.modelValue && !showPanelColor.value) {\n showPanelColor.value = true\n }\n }\n)\n\nwatch(\n () => props.modelValue,\n (newVal) => {\n if (!newVal) {\n showPanelColor.value = false\n } else if (newVal && newVal !== color.value) {\n shouldActiveChange = false\n color.fromString(newVal)\n }\n }\n)\n\nwatch(\n () => showPicker.value,\n () => {\n pickerPanelRef.value && nextTick(pickerPanelRef.value.update)\n }\n)\n\nprovide(ROOT_COMMON_COLOR_INJECTION_KEY, commonColor)\n\ndefineExpose({\n /**\n * @description current color object\n */\n color,\n /**\n * @description manually show ColorPicker\n */\n show,\n /**\n * @description manually hide ColorPicker\n */\n hide,\n /**\n * @description focus the input element\n */\n focus,\n /**\n * @description blur the input element\n */\n blur,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgJA,MAAM,QAAQ;EAKd,MAAM,OAAO;EAEb,MAAM,EAAE,MAAM,2BAAU;EACxB,MAAM,KAAK,6BAAa,QAAO;EAC/B,MAAM,EAAE,aAAa,mCAAY;EACjC,MAAM,YAAY,2CAAY;EAC9B,MAAM,gBAAgB,+CAAgB;EACtC,MAAM,EAAE,cAAc,iBAAiB,+BAAe,OAAO,KAAI;EACjE,MAAM,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,UAAA,CAAA;KAAwB,SAAO;oCAqBxC,QAAA,EApBA,+BAAK,gBAAG,GAAE,CAAC,GAAE,UAAA,QAAA,iBAAqB,GAAE,CAAC,GAAE,SAAU,QAAA,UAAS,CAAA,CAAA,iCAmBxD,QAAA;KAjBJ,8CAAO,GAAE,CAAC,GAAE,UAAA,cAAA,CAAA;KACZ,+BAAK,mBAAqC,eAAA;oEASjC,uBAAA,EAAA,EAHP,+BAAK,gBAAG,GAAE,CAAC,GAAE,UAAA,OAAA,iBAAoB,GAAE,CAAC,GAAE,kBAAA,CAAA,CAAA;qCAEzB,qCAAA,kCAAA,CAAA;;mCAHN,QAAA,cAAc,eAAA,MAAc,gEAU5B,uBAAA,EAAA,EAHP,+BAAK,gBAAG,GAAE,CAAC,GAAE,UAAA,QAAA,iBAAqB,GAAE,CAAC,GAAE,aAAA,CAAA,CAAA;qCAE/B,qCAAA,8BAAA,CAAA;;oCAHA,QAAA,cAAU,CAAK,eAAA,MAAc"}
|
|
@@ -28,9 +28,9 @@ declare const __VLS_base: vue.DefineComponent<ColorPickerPanelProps, {
|
|
|
28
28
|
}, string, vue.PublicProps, Readonly<ColorPickerPanelProps> & Readonly<{
|
|
29
29
|
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
30
30
|
}>, {
|
|
31
|
+
border: boolean;
|
|
31
32
|
modelValue: string | null;
|
|
32
33
|
validateEvent: boolean;
|
|
33
|
-
border: boolean;
|
|
34
34
|
showAlpha: boolean;
|
|
35
35
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.js');
|
|
2
2
|
const require_event = require('../../../constants/event.js');
|
|
3
3
|
const require_raf = require('../../../utils/raf.js');
|
|
4
|
-
const require_countdown = require('./countdown.js');
|
|
5
4
|
const require_index = require('../../statistic/index.js');
|
|
5
|
+
const require_countdown = require('./countdown.js');
|
|
6
6
|
const require_utils = require('./utils.js');
|
|
7
7
|
let vue = require("vue");
|
|
8
8
|
|