@element-plus/nightly 0.0.20250630 → 0.0.20250701
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 +152 -118
- package/dist/index.full.min.js +16 -16
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +16 -16
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +152 -118
- 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/components/alert/src/alert.d.ts +1 -1
- package/es/components/alert/src/alert.vue.d.ts +3 -3
- package/es/components/badge/src/badge.d.ts +1 -1
- package/es/components/badge/src/badge.vue.d.ts +3 -3
- package/es/components/button/index.mjs +2 -2
- package/es/components/button/src/button-group.d.ts +1 -1
- package/es/components/button/src/button-group.mjs +1 -1
- package/es/components/button/src/button-group.vue.d.ts +3 -3
- package/es/components/button/src/button.d.ts +1 -1
- package/es/components/button/src/button.mjs +62 -87
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button.vue.d.ts +3 -3
- package/es/components/button/src/button2.mjs +87 -62
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +1 -1
- package/es/components/calendar/src/date-table.mjs +89 -31
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table2.mjs +31 -89
- package/es/components/calendar/src/date-table2.mjs.map +1 -1
- package/es/components/calendar/src/use-date-table.mjs +1 -1
- package/es/components/cascader/src/cascader.d.ts +1 -1
- package/es/components/cascader/src/cascader.vue.d.ts +3 -3
- package/es/components/check-tag/src/check-tag.d.ts +1 -1
- package/es/components/check-tag/src/check-tag.vue.d.ts +3 -3
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +28 -23
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +23 -28
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +1 -3
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/descriptions/src/description-item.d.ts +1 -1
- package/es/components/dialog/src/dialog.mjs +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +178 -26
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +26 -178
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
- package/es/components/dropdown/src/dropdown.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/dropdown/src/dropdown.vue.d.ts +3 -3
- package/es/components/dropdown/src/dropdown2.mjs +1 -1
- package/es/components/empty/index.mjs +2 -2
- package/es/components/empty/src/empty.mjs +52 -11
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/empty/src/empty2.mjs +11 -52
- package/es/components/empty/src/empty2.mjs.map +1 -1
- package/es/components/form/src/form-item.d.ts +1 -1
- package/es/components/form/src/form-item.vue.d.ts +3 -3
- package/es/components/form/src/form.vue.d.ts +1 -1
- package/es/components/index.mjs +17 -17
- package/es/components/input/index.mjs +2 -2
- package/es/components/input/src/input.mjs +106 -437
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input2.mjs +435 -106
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/input-number/index.mjs +2 -2
- package/es/components/input-number/src/input-number.mjs +65 -348
- package/es/components/input-number/src/input-number.mjs.map +1 -1
- package/es/components/input-number/src/input-number2.mjs +348 -65
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/input-tag/index.mjs +2 -2
- package/es/components/input-tag/src/composables/use-input-tag.mjs +1 -3
- package/es/components/input-tag/src/composables/use-input-tag.mjs.map +1 -1
- package/es/components/input-tag/src/input-tag.d.ts +1 -1
- package/es/components/input-tag/src/input-tag.mjs +73 -215
- package/es/components/input-tag/src/input-tag.mjs.map +1 -1
- package/es/components/input-tag/src/input-tag.vue.d.ts +4 -4
- package/es/components/input-tag/src/input-tag2.mjs +215 -73
- package/es/components/input-tag/src/input-tag2.mjs.map +1 -1
- package/es/components/link/src/link.d.ts +1 -1
- package/es/components/link/src/link.vue.d.ts +3 -3
- package/es/components/loading/src/directive.mjs +23 -16
- package/es/components/loading/src/directive.mjs.map +1 -1
- package/es/components/mention/index.mjs +2 -2
- package/es/components/mention/src/mention.mjs +65 -287
- package/es/components/mention/src/mention.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +285 -65
- package/es/components/mention/src/mention2.mjs.map +1 -1
- package/es/components/message/src/message.d.ts +1 -1
- package/es/components/message/src/message.vue.d.ts +3 -3
- package/es/components/message-box/src/index.vue.d.ts +1 -1
- package/es/components/notification/src/notification.d.ts +1 -1
- package/es/components/notification/src/notification.vue.d.ts +3 -3
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +16 -97
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +97 -16
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +6 -6
- package/es/components/popover/src/popover.vue.d.ts +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/popper.mjs +32 -22
- package/es/components/popper/src/popper.mjs.map +1 -1
- package/es/components/popper/src/popper2.mjs +22 -32
- package/es/components/popper/src/popper2.mjs.map +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-button.mjs +1 -1
- package/es/components/radio/src/radio-group.mjs +1 -1
- package/es/components/radio/src/radio.mjs +74 -32
- package/es/components/radio/src/radio.mjs.map +1 -1
- package/es/components/radio/src/radio2.mjs +32 -74
- package/es/components/radio/src/radio2.mjs.map +1 -1
- package/es/components/rate/index.mjs +2 -2
- package/es/components/rate/src/rate.mjs +258 -83
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate2.mjs +83 -258
- package/es/components/rate/src/rate2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/result/src/result.mjs +62 -30
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result.vue.d.ts +3 -3
- package/es/components/result/src/result2.mjs +30 -62
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/roving-focus-group/index.mjs +3 -3
- package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -27
- package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs +27 -27
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
- package/es/components/select/src/select.d.ts +1 -1
- package/es/components/select/src/select.vue.d.ts +5 -5
- package/es/components/select/src/useSelect.d.ts +2 -2
- package/es/components/select/src/useSelect.mjs +11 -13
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/src/defaults.d.ts +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +5 -5
- package/es/components/select-v2/src/useSelect.d.ts +2 -2
- package/es/components/select-v2/src/useSelect.mjs +2 -4
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/skeleton/index.mjs +4 -4
- package/es/components/skeleton/src/skeleton-item.mjs +22 -17
- package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +17 -22
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton.mjs +48 -21
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +21 -48
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/slider/src/button.mjs +91 -19
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +19 -91
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/components/splitter/index.mjs +2 -2
- package/es/components/splitter/src/split-panel.mjs +19 -150
- package/es/components/splitter/src/split-panel.mjs.map +1 -1
- package/es/components/splitter/src/split-panel2.mjs +150 -19
- package/es/components/splitter/src/split-panel2.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +72 -228
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +228 -72
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/src/config.d.ts +12 -11
- package/es/components/table/src/config.mjs +12 -4
- package/es/components/table/src/config.mjs.map +1 -1
- package/es/components/table/src/filter-panel.mjs +15 -9
- package/es/components/table/src/filter-panel.mjs.map +1 -1
- package/es/components/table/src/filter-panel.vue.d.ts +11 -7
- package/es/components/table/src/h-helper.d.ts +8 -1
- package/es/components/table/src/h-helper.mjs.map +1 -1
- package/es/components/table/src/layout-observer.d.ts +2 -2
- package/es/components/table/src/layout-observer.mjs.map +1 -1
- package/es/components/table/src/store/current.d.ts +4 -3
- package/es/components/table/src/store/current.mjs +4 -3
- package/es/components/table/src/store/current.mjs.map +1 -1
- package/es/components/table/src/store/helper.d.ts +24 -24
- package/es/components/table/src/store/helper.mjs +8 -8
- package/es/components/table/src/store/helper.mjs.map +1 -1
- package/es/components/table/src/store/index.d.ts +44 -44
- package/es/components/table/src/store/watcher.d.ts +2 -2
- package/es/components/table/src/table/utils-helper.d.ts +3 -2
- package/es/components/table/src/table/utils-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/defaults.d.ts +6 -6
- package/es/components/table/src/table-body/defaults.mjs.map +1 -1
- package/es/components/table/src/table-body/index.d.ts +12 -12
- package/es/components/table/src/table-header/index.d.ts +1 -1
- package/es/components/table/src/table-header/index.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +16 -16
- package/es/components/tabs/src/constants.d.ts +4 -2
- package/es/components/tabs/src/constants.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar.d.ts +22 -4
- package/es/components/tabs/src/tab-bar.mjs +4 -0
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar.vue.d.ts +48 -9
- package/es/components/tabs/src/tab-bar2.mjs +8 -16
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.d.ts +33 -18
- package/es/components/tabs/src/tab-nav.mjs +16 -3
- package/es/components/tabs/src/tab-nav.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +9 -1
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/tabs/src/tabs.d.ts +3 -3
- package/es/components/tabs/src/tabs.mjs +6 -2
- package/es/components/tabs/src/tabs.mjs.map +1 -1
- package/es/components/tag/src/tag.d.ts +1 -1
- package/es/components/tag/src/tag.vue.d.ts +3 -3
- package/es/components/teleport/index.mjs +2 -2
- package/es/components/teleport/src/teleport.mjs +8 -18
- package/es/components/teleport/src/teleport.mjs.map +1 -1
- package/es/components/teleport/src/teleport2.mjs +18 -8
- package/es/components/teleport/src/teleport2.mjs.map +1 -1
- package/es/components/text/src/text.d.ts +1 -1
- package/es/components/text/src/text.vue.d.ts +3 -3
- package/es/components/time-picker/src/common/picker-range-trigger.mjs +5 -2
- package/es/components/time-picker/src/common/picker-range-trigger.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.mjs +5 -4
- package/es/components/time-picker/src/common/picker.mjs.map +1 -1
- package/es/components/timeline/src/timeline-item.d.ts +1 -1
- package/es/components/timeline/src/timeline-item.vue.d.ts +3 -3
- package/es/components/tooltip/src/content.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +1 -1
- package/es/components/tour/src/tour.mjs +1 -1
- package/es/hooks/use-focus-controller/index.d.ts +3 -1
- package/es/hooks/use-focus-controller/index.mjs +6 -7
- package/es/hooks/use-focus-controller/index.mjs.map +1 -1
- package/es/index.d.ts +234 -159
- package/es/index.mjs +17 -17
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/alert/src/alert.d.ts +1 -1
- package/lib/components/alert/src/alert.vue.d.ts +3 -3
- package/lib/components/badge/src/badge.d.ts +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +3 -3
- package/lib/components/button/index.js +2 -2
- package/lib/components/button/src/button-group.d.ts +1 -1
- package/lib/components/button/src/button-group.js +1 -1
- package/lib/components/button/src/button-group.vue.d.ts +3 -3
- package/lib/components/button/src/button.d.ts +1 -1
- package/lib/components/button/src/button.js +65 -87
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button.vue.d.ts +3 -3
- package/lib/components/button/src/button2.js +87 -65
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +1 -1
- package/lib/components/calendar/src/date-table.js +89 -35
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table2.js +35 -89
- package/lib/components/calendar/src/date-table2.js.map +1 -1
- package/lib/components/calendar/src/use-date-table.js +1 -1
- package/lib/components/cascader/src/cascader.d.ts +1 -1
- package/lib/components/cascader/src/cascader.vue.d.ts +3 -3
- package/lib/components/check-tag/src/check-tag.d.ts +1 -1
- package/lib/components/check-tag/src/check-tag.vue.d.ts +3 -3
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +28 -25
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +25 -28
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +1 -3
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/descriptions/src/description-item.d.ts +1 -1
- package/lib/components/dialog/src/dialog.js +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +178 -27
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +27 -178
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown-menu.js +1 -1
- package/lib/components/dropdown/src/dropdown.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/dropdown/src/dropdown.vue.d.ts +3 -3
- package/lib/components/dropdown/src/dropdown2.js +1 -1
- package/lib/components/empty/index.js +2 -2
- package/lib/components/empty/src/empty.js +52 -11
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/empty/src/empty2.js +11 -52
- package/lib/components/empty/src/empty2.js.map +1 -1
- package/lib/components/form/src/form-item.d.ts +1 -1
- package/lib/components/form/src/form-item.vue.d.ts +3 -3
- package/lib/components/form/src/form.vue.d.ts +1 -1
- package/lib/components/index.js +17 -17
- package/lib/components/input/index.js +2 -2
- package/lib/components/input/src/input.js +104 -434
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input2.js +432 -104
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/input-number/index.js +2 -2
- package/lib/components/input-number/src/input-number.js +64 -346
- package/lib/components/input-number/src/input-number.js.map +1 -1
- package/lib/components/input-number/src/input-number2.js +346 -64
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/input-tag/index.js +2 -2
- package/lib/components/input-tag/src/composables/use-input-tag.js +1 -3
- package/lib/components/input-tag/src/composables/use-input-tag.js.map +1 -1
- package/lib/components/input-tag/src/input-tag.d.ts +1 -1
- package/lib/components/input-tag/src/input-tag.js +73 -214
- package/lib/components/input-tag/src/input-tag.js.map +1 -1
- package/lib/components/input-tag/src/input-tag.vue.d.ts +4 -4
- package/lib/components/input-tag/src/input-tag2.js +214 -73
- package/lib/components/input-tag/src/input-tag2.js.map +1 -1
- package/lib/components/link/src/link.d.ts +1 -1
- package/lib/components/link/src/link.vue.d.ts +3 -3
- package/lib/components/loading/src/directive.js +22 -15
- package/lib/components/loading/src/directive.js.map +1 -1
- package/lib/components/mention/index.js +2 -2
- package/lib/components/mention/src/mention.js +64 -285
- package/lib/components/mention/src/mention.js.map +1 -1
- package/lib/components/mention/src/mention2.js +283 -64
- package/lib/components/mention/src/mention2.js.map +1 -1
- package/lib/components/message/src/message.d.ts +1 -1
- package/lib/components/message/src/message.vue.d.ts +3 -3
- package/lib/components/message-box/src/index.vue.d.ts +1 -1
- package/lib/components/notification/src/notification.d.ts +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +3 -3
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +17 -97
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +97 -17
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +6 -6
- package/lib/components/popover/src/popover.vue.d.ts +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/popper.js +32 -25
- package/lib/components/popper/src/popper.js.map +1 -1
- package/lib/components/popper/src/popper2.js +25 -32
- package/lib/components/popper/src/popper2.js.map +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-button.js +1 -1
- package/lib/components/radio/src/radio-group.js +1 -1
- package/lib/components/radio/src/radio.js +73 -33
- package/lib/components/radio/src/radio.js.map +1 -1
- package/lib/components/radio/src/radio2.js +33 -73
- package/lib/components/radio/src/radio2.js.map +1 -1
- package/lib/components/rate/index.js +2 -2
- package/lib/components/rate/src/rate.js +257 -83
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate2.js +83 -257
- package/lib/components/rate/src/rate2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/result/src/result.js +62 -32
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result.vue.d.ts +3 -3
- package/lib/components/result/src/result2.js +32 -62
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/roving-focus-group/index.js +2 -2
- package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -31
- package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group2.js +31 -27
- package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
- package/lib/components/select/src/select.d.ts +1 -1
- package/lib/components/select/src/select.vue.d.ts +5 -5
- package/lib/components/select/src/useSelect.d.ts +2 -2
- package/lib/components/select/src/useSelect.js +15 -17
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/src/defaults.d.ts +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +5 -5
- package/lib/components/select-v2/src/useSelect.d.ts +2 -2
- package/lib/components/select-v2/src/useSelect.js +2 -4
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/skeleton/index.js +4 -4
- package/lib/components/skeleton/src/skeleton-item.js +22 -17
- package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item2.js +17 -22
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton.js +48 -21
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +21 -48
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/slider/src/button.js +91 -20
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +20 -91
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/components/splitter/index.js +2 -2
- package/lib/components/splitter/src/split-panel.js +19 -150
- package/lib/components/splitter/src/split-panel.js.map +1 -1
- package/lib/components/splitter/src/split-panel2.js +150 -19
- package/lib/components/splitter/src/split-panel2.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +72 -227
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +227 -72
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/src/config.d.ts +12 -11
- package/lib/components/table/src/config.js +12 -4
- package/lib/components/table/src/config.js.map +1 -1
- package/lib/components/table/src/filter-panel.js +15 -9
- package/lib/components/table/src/filter-panel.js.map +1 -1
- package/lib/components/table/src/filter-panel.vue.d.ts +11 -7
- package/lib/components/table/src/h-helper.d.ts +8 -1
- package/lib/components/table/src/h-helper.js.map +1 -1
- package/lib/components/table/src/layout-observer.d.ts +2 -2
- package/lib/components/table/src/layout-observer.js.map +1 -1
- package/lib/components/table/src/store/current.d.ts +4 -3
- package/lib/components/table/src/store/current.js +4 -3
- package/lib/components/table/src/store/current.js.map +1 -1
- package/lib/components/table/src/store/helper.d.ts +24 -24
- package/lib/components/table/src/store/helper.js +8 -8
- package/lib/components/table/src/store/helper.js.map +1 -1
- package/lib/components/table/src/store/index.d.ts +44 -44
- package/lib/components/table/src/store/watcher.d.ts +2 -2
- package/lib/components/table/src/table/utils-helper.d.ts +3 -2
- package/lib/components/table/src/table/utils-helper.js.map +1 -1
- package/lib/components/table/src/table-body/defaults.d.ts +6 -6
- package/lib/components/table/src/table-body/defaults.js.map +1 -1
- package/lib/components/table/src/table-body/index.d.ts +12 -12
- package/lib/components/table/src/table-header/index.d.ts +1 -1
- package/lib/components/table/src/table-header/index.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +16 -16
- package/lib/components/tabs/src/constants.d.ts +4 -2
- package/lib/components/tabs/src/constants.js.map +1 -1
- package/lib/components/tabs/src/tab-bar.d.ts +22 -4
- package/lib/components/tabs/src/tab-bar.js +4 -0
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar.vue.d.ts +48 -9
- package/lib/components/tabs/src/tab-bar2.js +7 -15
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.d.ts +33 -18
- package/lib/components/tabs/src/tab-nav.js +16 -3
- package/lib/components/tabs/src/tab-nav.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +9 -1
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/tabs/src/tabs.d.ts +3 -3
- package/lib/components/tabs/src/tabs.js +6 -2
- package/lib/components/tabs/src/tabs.js.map +1 -1
- package/lib/components/tag/src/tag.d.ts +1 -1
- package/lib/components/tag/src/tag.vue.d.ts +3 -3
- package/lib/components/teleport/index.js +2 -2
- package/lib/components/teleport/src/teleport.js +8 -18
- package/lib/components/teleport/src/teleport.js.map +1 -1
- package/lib/components/teleport/src/teleport2.js +18 -8
- package/lib/components/teleport/src/teleport2.js.map +1 -1
- package/lib/components/text/src/text.d.ts +1 -1
- package/lib/components/text/src/text.vue.d.ts +3 -3
- package/lib/components/time-picker/src/common/picker-range-trigger.js +4 -1
- package/lib/components/time-picker/src/common/picker-range-trigger.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.js +5 -4
- package/lib/components/time-picker/src/common/picker.js.map +1 -1
- package/lib/components/timeline/src/timeline-item.d.ts +1 -1
- package/lib/components/timeline/src/timeline-item.vue.d.ts +3 -3
- package/lib/components/tooltip/src/content.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +1 -1
- package/lib/components/tour/src/tour.js +1 -1
- package/lib/hooks/use-focus-controller/index.d.ts +3 -1
- package/lib/hooks/use-focus-controller/index.js +5 -6
- package/lib/hooks/use-focus-controller/index.js.map +1 -1
- package/lib/index.d.ts +234 -159
- package/lib/index.js +17 -17
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
@@ -1,77 +1,233 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
1
|
+
import { defineComponent, computed, ref, watch, onMounted, openBlock, createElementBlock, normalizeClass, unref, withModifiers, createElementVNode, withKeys, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, toDisplayString, normalizeStyle, createVNode, renderSlot, nextTick } from 'vue';
|
2
|
+
import { ElIcon } from '../../icon/index.mjs';
|
3
|
+
import { Loading } from '@element-plus/icons-vue';
|
4
|
+
import { switchProps, switchEmits } from './switch.mjs';
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
6
|
+
import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
|
7
|
+
import { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
|
8
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
9
|
+
import { addUnit } from '../../../utils/dom/style.mjs';
|
5
10
|
import { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
|
6
|
-
import {
|
7
|
-
import {
|
11
|
+
import { debugWarn, throwError } from '../../../utils/error.mjs';
|
12
|
+
import { isPromise } from '@vue/shared';
|
13
|
+
import { isBoolean } from '../../../utils/types.mjs';
|
8
14
|
|
9
|
-
const
|
10
|
-
|
11
|
-
|
12
|
-
default: false
|
13
|
-
},
|
14
|
-
disabled: Boolean,
|
15
|
-
loading: Boolean,
|
16
|
-
size: {
|
17
|
-
type: String,
|
18
|
-
validator: isValidComponentSize
|
19
|
-
},
|
20
|
-
width: {
|
21
|
-
type: [String, Number],
|
22
|
-
default: ""
|
23
|
-
},
|
24
|
-
inlinePrompt: Boolean,
|
25
|
-
inactiveActionIcon: {
|
26
|
-
type: iconPropType
|
27
|
-
},
|
28
|
-
activeActionIcon: {
|
29
|
-
type: iconPropType
|
30
|
-
},
|
31
|
-
activeIcon: {
|
32
|
-
type: iconPropType
|
33
|
-
},
|
34
|
-
inactiveIcon: {
|
35
|
-
type: iconPropType
|
36
|
-
},
|
37
|
-
activeText: {
|
38
|
-
type: String,
|
39
|
-
default: ""
|
40
|
-
},
|
41
|
-
inactiveText: {
|
42
|
-
type: String,
|
43
|
-
default: ""
|
44
|
-
},
|
45
|
-
activeValue: {
|
46
|
-
type: [Boolean, String, Number],
|
47
|
-
default: true
|
48
|
-
},
|
49
|
-
inactiveValue: {
|
50
|
-
type: [Boolean, String, Number],
|
51
|
-
default: false
|
52
|
-
},
|
53
|
-
name: {
|
54
|
-
type: String,
|
55
|
-
default: ""
|
56
|
-
},
|
57
|
-
validateEvent: {
|
58
|
-
type: Boolean,
|
59
|
-
default: true
|
60
|
-
},
|
61
|
-
beforeChange: {
|
62
|
-
type: definePropType(Function)
|
63
|
-
},
|
64
|
-
id: String,
|
65
|
-
tabindex: {
|
66
|
-
type: [String, Number]
|
67
|
-
},
|
68
|
-
...useAriaProps(["ariaLabel"])
|
15
|
+
const COMPONENT_NAME = "ElSwitch";
|
16
|
+
const __default__ = defineComponent({
|
17
|
+
name: COMPONENT_NAME
|
69
18
|
});
|
70
|
-
const
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
}
|
19
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
20
|
+
...__default__,
|
21
|
+
props: switchProps,
|
22
|
+
emits: switchEmits,
|
23
|
+
setup(__props, { expose, emit }) {
|
24
|
+
const props = __props;
|
25
|
+
const { formItem } = useFormItem();
|
26
|
+
const switchSize = useFormSize();
|
27
|
+
const ns = useNamespace("switch");
|
28
|
+
const { inputId } = useFormItemInputId(props, {
|
29
|
+
formItemContext: formItem
|
30
|
+
});
|
31
|
+
const switchDisabled = useFormDisabled(computed(() => props.loading));
|
32
|
+
const isControlled = ref(props.modelValue !== false);
|
33
|
+
const input = ref();
|
34
|
+
const core = ref();
|
35
|
+
const switchKls = computed(() => [
|
36
|
+
ns.b(),
|
37
|
+
ns.m(switchSize.value),
|
38
|
+
ns.is("disabled", switchDisabled.value),
|
39
|
+
ns.is("checked", checked.value)
|
40
|
+
]);
|
41
|
+
const labelLeftKls = computed(() => [
|
42
|
+
ns.e("label"),
|
43
|
+
ns.em("label", "left"),
|
44
|
+
ns.is("active", !checked.value)
|
45
|
+
]);
|
46
|
+
const labelRightKls = computed(() => [
|
47
|
+
ns.e("label"),
|
48
|
+
ns.em("label", "right"),
|
49
|
+
ns.is("active", checked.value)
|
50
|
+
]);
|
51
|
+
const coreStyle = computed(() => ({
|
52
|
+
width: addUnit(props.width)
|
53
|
+
}));
|
54
|
+
watch(() => props.modelValue, () => {
|
55
|
+
isControlled.value = true;
|
56
|
+
});
|
57
|
+
const actualValue = computed(() => {
|
58
|
+
return isControlled.value ? props.modelValue : false;
|
59
|
+
});
|
60
|
+
const checked = computed(() => actualValue.value === props.activeValue);
|
61
|
+
if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
|
62
|
+
emit(UPDATE_MODEL_EVENT, props.inactiveValue);
|
63
|
+
emit(CHANGE_EVENT, props.inactiveValue);
|
64
|
+
emit(INPUT_EVENT, props.inactiveValue);
|
65
|
+
}
|
66
|
+
watch(checked, (val) => {
|
67
|
+
var _a;
|
68
|
+
input.value.checked = val;
|
69
|
+
if (props.validateEvent) {
|
70
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
|
71
|
+
}
|
72
|
+
});
|
73
|
+
const handleChange = () => {
|
74
|
+
const val = checked.value ? props.inactiveValue : props.activeValue;
|
75
|
+
emit(UPDATE_MODEL_EVENT, val);
|
76
|
+
emit(CHANGE_EVENT, val);
|
77
|
+
emit(INPUT_EVENT, val);
|
78
|
+
nextTick(() => {
|
79
|
+
input.value.checked = checked.value;
|
80
|
+
});
|
81
|
+
};
|
82
|
+
const switchValue = () => {
|
83
|
+
if (switchDisabled.value)
|
84
|
+
return;
|
85
|
+
const { beforeChange } = props;
|
86
|
+
if (!beforeChange) {
|
87
|
+
handleChange();
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
const shouldChange = beforeChange();
|
91
|
+
const isPromiseOrBool = [
|
92
|
+
isPromise(shouldChange),
|
93
|
+
isBoolean(shouldChange)
|
94
|
+
].includes(true);
|
95
|
+
if (!isPromiseOrBool) {
|
96
|
+
throwError(COMPONENT_NAME, "beforeChange must return type `Promise<boolean>` or `boolean`");
|
97
|
+
}
|
98
|
+
if (isPromise(shouldChange)) {
|
99
|
+
shouldChange.then((result) => {
|
100
|
+
if (result) {
|
101
|
+
handleChange();
|
102
|
+
}
|
103
|
+
}).catch((e) => {
|
104
|
+
debugWarn(COMPONENT_NAME, `some error occurred: ${e}`);
|
105
|
+
});
|
106
|
+
} else if (shouldChange) {
|
107
|
+
handleChange();
|
108
|
+
}
|
109
|
+
};
|
110
|
+
const focus = () => {
|
111
|
+
var _a, _b;
|
112
|
+
(_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
113
|
+
};
|
114
|
+
onMounted(() => {
|
115
|
+
input.value.checked = checked.value;
|
116
|
+
});
|
117
|
+
expose({
|
118
|
+
focus,
|
119
|
+
checked
|
120
|
+
});
|
121
|
+
return (_ctx, _cache) => {
|
122
|
+
return openBlock(), createElementBlock("div", {
|
123
|
+
class: normalizeClass(unref(switchKls)),
|
124
|
+
onClick: withModifiers(switchValue, ["prevent"])
|
125
|
+
}, [
|
126
|
+
createElementVNode("input", {
|
127
|
+
id: unref(inputId),
|
128
|
+
ref_key: "input",
|
129
|
+
ref: input,
|
130
|
+
class: normalizeClass(unref(ns).e("input")),
|
131
|
+
type: "checkbox",
|
132
|
+
role: "switch",
|
133
|
+
"aria-checked": unref(checked),
|
134
|
+
"aria-disabled": unref(switchDisabled),
|
135
|
+
"aria-label": _ctx.ariaLabel,
|
136
|
+
name: _ctx.name,
|
137
|
+
"true-value": _ctx.activeValue,
|
138
|
+
"false-value": _ctx.inactiveValue,
|
139
|
+
disabled: unref(switchDisabled),
|
140
|
+
tabindex: _ctx.tabindex,
|
141
|
+
onChange: handleChange,
|
142
|
+
onKeydown: withKeys(switchValue, ["enter"])
|
143
|
+
}, null, 42, ["id", "aria-checked", "aria-disabled", "aria-label", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"]),
|
144
|
+
!_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
|
145
|
+
key: 0,
|
146
|
+
class: normalizeClass(unref(labelLeftKls))
|
147
|
+
}, [
|
148
|
+
_ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
149
|
+
default: withCtx(() => [
|
150
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
|
151
|
+
]),
|
152
|
+
_: 1
|
153
|
+
})) : createCommentVNode("v-if", true),
|
154
|
+
!_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
|
155
|
+
key: 1,
|
156
|
+
"aria-hidden": unref(checked)
|
157
|
+
}, toDisplayString(_ctx.inactiveText), 9, ["aria-hidden"])) : createCommentVNode("v-if", true)
|
158
|
+
], 2)) : createCommentVNode("v-if", true),
|
159
|
+
createElementVNode("span", {
|
160
|
+
ref_key: "core",
|
161
|
+
ref: core,
|
162
|
+
class: normalizeClass(unref(ns).e("core")),
|
163
|
+
style: normalizeStyle(unref(coreStyle))
|
164
|
+
}, [
|
165
|
+
_ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
|
166
|
+
key: 0,
|
167
|
+
class: normalizeClass(unref(ns).e("inner"))
|
168
|
+
}, [
|
169
|
+
_ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
|
170
|
+
key: 0,
|
171
|
+
class: normalizeClass(unref(ns).is("icon"))
|
172
|
+
}, {
|
173
|
+
default: withCtx(() => [
|
174
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
|
175
|
+
]),
|
176
|
+
_: 1
|
177
|
+
}, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
|
178
|
+
key: 1,
|
179
|
+
class: normalizeClass(unref(ns).is("text")),
|
180
|
+
"aria-hidden": !unref(checked)
|
181
|
+
}, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, ["aria-hidden"])) : createCommentVNode("v-if", true)
|
182
|
+
], 2)) : createCommentVNode("v-if", true),
|
183
|
+
createElementVNode("div", {
|
184
|
+
class: normalizeClass(unref(ns).e("action"))
|
185
|
+
}, [
|
186
|
+
_ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
|
187
|
+
key: 0,
|
188
|
+
class: normalizeClass(unref(ns).is("loading"))
|
189
|
+
}, {
|
190
|
+
default: withCtx(() => [
|
191
|
+
createVNode(unref(Loading))
|
192
|
+
]),
|
193
|
+
_: 1
|
194
|
+
}, 8, ["class"])) : unref(checked) ? renderSlot(_ctx.$slots, "active-action", { key: 1 }, () => [
|
195
|
+
_ctx.activeActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
196
|
+
default: withCtx(() => [
|
197
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.activeActionIcon)))
|
198
|
+
]),
|
199
|
+
_: 1
|
200
|
+
})) : createCommentVNode("v-if", true)
|
201
|
+
]) : !unref(checked) ? renderSlot(_ctx.$slots, "inactive-action", { key: 2 }, () => [
|
202
|
+
_ctx.inactiveActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
203
|
+
default: withCtx(() => [
|
204
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveActionIcon)))
|
205
|
+
]),
|
206
|
+
_: 1
|
207
|
+
})) : createCommentVNode("v-if", true)
|
208
|
+
]) : createCommentVNode("v-if", true)
|
209
|
+
], 2)
|
210
|
+
], 6),
|
211
|
+
!_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
|
212
|
+
key: 1,
|
213
|
+
class: normalizeClass(unref(labelRightKls))
|
214
|
+
}, [
|
215
|
+
_ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
216
|
+
default: withCtx(() => [
|
217
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
|
218
|
+
]),
|
219
|
+
_: 1
|
220
|
+
})) : createCommentVNode("v-if", true),
|
221
|
+
!_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
|
222
|
+
key: 1,
|
223
|
+
"aria-hidden": !unref(checked)
|
224
|
+
}, toDisplayString(_ctx.activeText), 9, ["aria-hidden"])) : createCommentVNode("v-if", true)
|
225
|
+
], 2)) : createCommentVNode("v-if", true)
|
226
|
+
], 10, ["onClick"]);
|
227
|
+
};
|
228
|
+
}
|
229
|
+
});
|
230
|
+
var Switch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "switch.vue"]]);
|
75
231
|
|
76
|
-
export {
|
232
|
+
export { Switch as default };
|
77
233
|
//# sourceMappingURL=switch2.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"switch2.mjs","sources":["../../../../../../packages/components/switch/src/switch.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useAriaProps } from '@element-plus/hooks'\n\nimport type { ComponentSize } from '@element-plus/constants'\nimport type Switch from './switch.vue'\nimport type { ExtractPropTypes, PropType } from 'vue'\n\nexport const switchProps = buildProps({\n /**\n * @description binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type\n */\n modelValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n /**\n * @description whether Switch is disabled\n */\n disabled: Boolean,\n /**\n * @description whether Switch is in loading state\n */\n loading: Boolean,\n /**\n * @description size of Switch\n */\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n /**\n * @description width of Switch\n */\n width: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether icon or text is displayed inside dot, only the first character will be rendered for text\n */\n inlinePrompt: Boolean,\n /**\n * @description component of the icon displayed in action when in `off` state\n */\n inactiveActionIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed in action when in `on` state\n */\n activeActionIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed when in `on` state, overrides `active-text`\n */\n activeIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed when in `off` state, overrides `inactive-text`\n */\n inactiveIcon: {\n type: iconPropType,\n },\n /**\n * @description text displayed when in `on` state\n */\n activeText: {\n type: String,\n default: '',\n },\n /**\n * @description text displayed when in `off` state\n */\n inactiveText: {\n type: String,\n default: '',\n },\n /**\n * @description switch value when in `on` state\n */\n activeValue: {\n type: [Boolean, String, Number],\n default: true,\n },\n /**\n * @description switch value when in `off` state\n */\n inactiveValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n /**\n * @description input name of Switch\n */\n name: {\n type: String,\n default: '',\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description before-change hook before the switch state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop switching\n */\n beforeChange: {\n type: definePropType<() => Promise<boolean> | boolean>(Function),\n },\n /**\n * @description id for input\n */\n id: String,\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n },\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport type SwitchProps = ExtractPropTypes<typeof switchProps>\n\nexport const switchEmits = {\n [UPDATE_MODEL_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n [CHANGE_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n [INPUT_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n}\nexport type SwitchEmits = typeof switchEmits\n\nexport type SwitchInstance = InstanceType<typeof Switch> & unknown\n"],"names":[],"mappings":";;;;;;;;AAeY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;AACnC,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,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AI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,GAAG;AACH,EAAE,GAAG,YAAY,CAAC,CAAC,WAAW,CAAC,CAAC;AAChC,CAAC,EAAE;AACS,MAAC,WAAW,GAAG;AAC3B,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AACjF,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AAC3E,EAAE,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AAC1E;;;;"}
|
1
|
+
{"version":3,"file":"switch2.mjs","sources":["../../../../../../packages/components/switch/src/switch.vue"],"sourcesContent":["<template>\n <div :class=\"switchKls\" @click.prevent=\"switchValue\">\n <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"ns.e('input')\"\n type=\"checkbox\"\n role=\"switch\"\n :aria-checked=\"checked\"\n :aria-disabled=\"switchDisabled\"\n :aria-label=\"ariaLabel\"\n :name=\"name\"\n :true-value=\"activeValue\"\n :false-value=\"inactiveValue\"\n :disabled=\"switchDisabled\"\n :tabindex=\"tabindex\"\n @change=\"handleChange\"\n @keydown.enter=\"switchValue\"\n />\n <span\n v-if=\"!inlinePrompt && (inactiveIcon || inactiveText)\"\n :class=\"labelLeftKls\"\n >\n <el-icon v-if=\"inactiveIcon\">\n <component :is=\"inactiveIcon\" />\n </el-icon>\n <span v-if=\"!inactiveIcon && inactiveText\" :aria-hidden=\"checked\">{{\n inactiveText\n }}</span>\n </span>\n <span ref=\"core\" :class=\"ns.e('core')\" :style=\"coreStyle\">\n <div v-if=\"inlinePrompt\" :class=\"ns.e('inner')\">\n <template v-if=\"activeIcon || inactiveIcon\">\n <el-icon :class=\"ns.is('icon')\">\n <component :is=\"checked ? activeIcon : inactiveIcon\" />\n </el-icon>\n </template>\n <template v-else-if=\"activeText || inactiveText\">\n <span :class=\"ns.is('text')\" :aria-hidden=\"!checked\">\n {{ checked ? activeText : inactiveText }}\n </span>\n </template>\n </div>\n <div :class=\"ns.e('action')\">\n <el-icon v-if=\"loading\" :class=\"ns.is('loading')\">\n <loading />\n </el-icon>\n <slot v-else-if=\"checked\" name=\"active-action\">\n <el-icon v-if=\"activeActionIcon\">\n <component :is=\"activeActionIcon\" />\n </el-icon>\n </slot>\n <slot v-else-if=\"!checked\" name=\"inactive-action\">\n <el-icon v-if=\"inactiveActionIcon\">\n <component :is=\"inactiveActionIcon\" />\n </el-icon>\n </slot>\n </div>\n </span>\n <span\n v-if=\"!inlinePrompt && (activeIcon || activeText)\"\n :class=\"labelRightKls\"\n >\n <el-icon v-if=\"activeIcon\">\n <component :is=\"activeIcon\" />\n </el-icon>\n <span v-if=\"!activeIcon && activeText\" :aria-hidden=\"!checked\">{{\n activeText\n }}</span>\n </span>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, nextTick, onMounted, ref, watch } from 'vue'\nimport {\n addUnit,\n debugWarn,\n isBoolean,\n isPromise,\n throwError,\n} from '@element-plus/utils'\nimport ElIcon from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { Loading } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\nimport { switchEmits, switchProps } from './switch'\n\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElSwitch'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(switchProps)\nconst emit = defineEmits(switchEmits)\n\nconst { formItem } = useFormItem()\nconst switchSize = useFormSize()\nconst ns = useNamespace('switch')\n\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst switchDisabled = useFormDisabled(computed(() => props.loading))\nconst isControlled = ref(props.modelValue !== false)\nconst input = ref<HTMLInputElement>()\nconst core = ref<HTMLSpanElement>()\n\nconst switchKls = computed(() => [\n ns.b(),\n ns.m(switchSize.value),\n ns.is('disabled', switchDisabled.value),\n ns.is('checked', checked.value),\n])\n\nconst labelLeftKls = computed(() => [\n ns.e('label'),\n ns.em('label', 'left'),\n ns.is('active', !checked.value),\n])\n\nconst labelRightKls = computed(() => [\n ns.e('label'),\n ns.em('label', 'right'),\n ns.is('active', checked.value),\n])\n\nconst coreStyle = computed<CSSProperties>(() => ({\n width: addUnit(props.width),\n}))\n\nwatch(\n () => props.modelValue,\n () => {\n isControlled.value = true\n }\n)\n\nconst actualValue = computed(() => {\n return isControlled.value ? props.modelValue : false\n})\n\nconst checked = computed(() => actualValue.value === props.activeValue)\n\nif (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {\n emit(UPDATE_MODEL_EVENT, props.inactiveValue)\n emit(CHANGE_EVENT, props.inactiveValue)\n emit(INPUT_EVENT, props.inactiveValue)\n}\n\nwatch(checked, (val) => {\n input.value!.checked = val\n\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n})\n\nconst handleChange = () => {\n const val = checked.value ? props.inactiveValue : props.activeValue\n emit(UPDATE_MODEL_EVENT, val)\n emit(CHANGE_EVENT, val)\n emit(INPUT_EVENT, val)\n nextTick(() => {\n input.value!.checked = checked.value\n })\n}\n\nconst switchValue = () => {\n if (switchDisabled.value) return\n\n const { beforeChange } = props\n if (!beforeChange) {\n handleChange()\n return\n }\n\n const shouldChange = beforeChange()\n\n const isPromiseOrBool = [\n isPromise(shouldChange),\n isBoolean(shouldChange),\n ].includes(true)\n if (!isPromiseOrBool) {\n throwError(\n COMPONENT_NAME,\n 'beforeChange must return type `Promise<boolean>` or `boolean`'\n )\n }\n\n if (isPromise(shouldChange)) {\n shouldChange\n .then((result) => {\n if (result) {\n handleChange()\n }\n })\n .catch((e) => {\n debugWarn(COMPONENT_NAME, `some error occurred: ${e}`)\n })\n } else if (shouldChange) {\n handleChange()\n }\n}\n\nconst focus = (): void => {\n input.value?.focus?.()\n}\n\nonMounted(() => {\n input.value!.checked = checked.value\n})\n\ndefineExpose({\n /**\n * @description manual focus to the switch component\n **/\n focus,\n /**\n * @description whether Switch is checked\n */\n checked,\n})\n</script>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_withModifiers","_createElementVNode"],"mappings":";;;;;;;;;;;;;;;mCAqGc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAM,MAAA,EAAE,QAAS,EAAA,GAAI,WAAY,EAAA,CAAA;AACjC,IAAA,MAAM,aAAa,WAAY,EAAA,CAAA;AAC/B,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAEhC,IAAA,MAAM,EAAE,OAAA,EAAY,GAAA,kBAAA,CAAmB,KAAO,EAAA;AAAA,MAC5C,eAAiB,EAAA,QAAA;AAAA,KAClB,CAAA,CAAA;AAED,IAAA,MAAM,iBAAiB,eAAgB,CAAA,QAAA,CAAS,MAAM,KAAA,CAAM,OAAO,CAAC,CAAA,CAAA;AACpE,IAAA,MAAM,YAAe,GAAA,GAAA,CAAI,KAAM,CAAA,UAAA,KAAe,KAAK,CAAA,CAAA;AACnD,IAAA,MAAM,QAAQ,GAAsB,EAAA,CAAA;AACpC,IAAA,MAAM,OAAO,GAAqB,EAAA,CAAA;AAElC,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM;AAAA,MAC/B,GAAG,CAAE,EAAA;AAAA,MACL,EAAA,CAAG,CAAE,CAAA,UAAA,CAAW,KAAK,CAAA;AAAA,MACrB,EAAG,CAAA,EAAA,CAAG,UAAY,EAAA,cAAA,CAAe,KAAK,CAA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AA,EAAAC,kBAAA,CAAA,KAAA,EAAA;AAAA,QAAA,KAAA,EAAAC,cAAA,CAAAC,KAAA,CAAA,SAAA,CAAA,CAAA;AAAA,QAIX,OAAA,EAAAC,aAAA,CAAA,WAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,OAAA,EAAA;AAAA,QAAAC,kBAAA,CAAA,OAAA,EAAA;AAAA,UAAA,EAAA,EAAAF,KAAA,CAAA,OAAA,CAAA;AAAA,UAIA,OAAA,EAAA,OAAA;AAAA,UACD,GAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { VNode } from 'vue';
|
2
2
|
import type { TableColumnCtx } from './table-column/defaults';
|
3
3
|
import type { Store } from './store';
|
4
|
-
import type { TreeNode } from './table/defaults';
|
4
|
+
import type { DefaultRow, TreeNode } from './table/defaults';
|
5
5
|
export declare const cellStarts: {
|
6
6
|
default: {
|
7
7
|
order: string;
|
@@ -25,19 +25,20 @@ export declare const cellStarts: {
|
|
25
25
|
order: string;
|
26
26
|
};
|
27
27
|
};
|
28
|
-
export declare const getDefaultClassName: (type:
|
28
|
+
export declare const getDefaultClassName: (type: string) => "table-column--selection" | "table__expand-column";
|
29
29
|
export declare const cellForced: {
|
30
30
|
selection: {
|
31
|
-
renderHeader<T>({ store, column }: {
|
31
|
+
renderHeader<T extends DefaultRow>({ store, column, }: {
|
32
32
|
store: Store<T>;
|
33
|
+
column: TableColumnCtx<T>;
|
33
34
|
}): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
34
35
|
[key: string]: any;
|
35
36
|
}>;
|
36
|
-
renderCell<T>({ row, column, store, $index, }: {
|
37
|
+
renderCell<T extends DefaultRow>({ row, column, store, $index, }: {
|
37
38
|
row: T;
|
38
39
|
column: TableColumnCtx<T>;
|
39
40
|
store: Store<T>;
|
40
|
-
$index:
|
41
|
+
$index: number;
|
41
42
|
}): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
42
43
|
[key: string]: any;
|
43
44
|
}>;
|
@@ -45,10 +46,10 @@ export declare const cellForced: {
|
|
45
46
|
resizable: boolean;
|
46
47
|
};
|
47
48
|
index: {
|
48
|
-
renderHeader<T>({ column }: {
|
49
|
+
renderHeader<T extends DefaultRow>({ column, }: {
|
49
50
|
column: TableColumnCtx<T>;
|
50
51
|
}): string;
|
51
|
-
renderCell<T>({ column, $index, }: {
|
52
|
+
renderCell<T extends DefaultRow>({ column, $index, }: {
|
52
53
|
column: TableColumnCtx<T>;
|
53
54
|
$index: number;
|
54
55
|
}): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
@@ -57,10 +58,10 @@ export declare const cellForced: {
|
|
57
58
|
sortable: boolean;
|
58
59
|
};
|
59
60
|
expand: {
|
60
|
-
renderHeader<T>({ column }: {
|
61
|
+
renderHeader<T extends DefaultRow>({ column, }: {
|
61
62
|
column: TableColumnCtx<T>;
|
62
63
|
}): string;
|
63
|
-
renderCell<T>({ column, row, store, expanded, }: {
|
64
|
+
renderCell<T extends DefaultRow>({ column, row, store, expanded, }: {
|
64
65
|
column: TableColumnCtx<T>;
|
65
66
|
row: T;
|
66
67
|
store: Store<T>;
|
@@ -72,12 +73,12 @@ export declare const cellForced: {
|
|
72
73
|
resizable: boolean;
|
73
74
|
};
|
74
75
|
};
|
75
|
-
export declare function defaultRenderCell<T>({ row, column, $index, }: {
|
76
|
+
export declare function defaultRenderCell<T extends DefaultRow>({ row, column, $index, }: {
|
76
77
|
row: T;
|
77
78
|
column: TableColumnCtx<T>;
|
78
79
|
$index: number;
|
79
80
|
}): any;
|
80
|
-
export declare function treeCellPrefix<T>({ row, treeNode, store, }: {
|
81
|
+
export declare function treeCellPrefix<T extends DefaultRow>({ row, treeNode, store, }: {
|
81
82
|
row: T;
|
82
83
|
treeNode: TreeNode;
|
83
84
|
store: Store<T>;
|
@@ -38,7 +38,11 @@ const getDefaultClassName = (type) => {
|
|
38
38
|
};
|
39
39
|
const cellForced = {
|
40
40
|
selection: {
|
41
|
-
renderHeader({
|
41
|
+
renderHeader({
|
42
|
+
store,
|
43
|
+
column
|
44
|
+
}) {
|
45
|
+
var _a;
|
42
46
|
function isDisabled() {
|
43
47
|
return store.states.data.value && store.states.data.value.length === 0;
|
44
48
|
}
|
@@ -46,7 +50,7 @@ const cellForced = {
|
|
46
50
|
disabled: isDisabled(),
|
47
51
|
size: store.states.tableSize.value,
|
48
52
|
indeterminate: store.states.selection.value.length > 0 && !store.states.isAllSelected.value,
|
49
|
-
"onUpdate:modelValue": store.toggleAllSelection,
|
53
|
+
"onUpdate:modelValue": (_a = store.toggleAllSelection) != null ? _a : void 0,
|
50
54
|
modelValue: store.states.isAllSelected.value,
|
51
55
|
ariaLabel: column.label
|
52
56
|
});
|
@@ -72,7 +76,9 @@ const cellForced = {
|
|
72
76
|
resizable: false
|
73
77
|
},
|
74
78
|
index: {
|
75
|
-
renderHeader({
|
79
|
+
renderHeader({
|
80
|
+
column
|
81
|
+
}) {
|
76
82
|
return column.label || "#";
|
77
83
|
},
|
78
84
|
renderCell({
|
@@ -91,7 +97,9 @@ const cellForced = {
|
|
91
97
|
sortable: false
|
92
98
|
},
|
93
99
|
expand: {
|
94
|
-
renderHeader({
|
100
|
+
renderHeader({
|
101
|
+
column
|
102
|
+
}) {
|
95
103
|
return column.label || "";
|
96
104
|
},
|
97
105
|
renderCell({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.mjs","sources":["../../../../../../packages/components/table/src/config.ts"],"sourcesContent":["// @ts-nocheck\nimport { h } from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ArrowRight, Loading } from '@element-plus/icons-vue'\nimport { getProp, isBoolean, isFunction, isNumber } from '@element-plus/utils'\n\nimport type { VNode } from 'vue'\nimport type { TableColumnCtx } from './table-column/defaults'\nimport type { Store } from './store'\nimport type { TreeNode } from './table/defaults'\n\nconst defaultClassNames = {\n selection: 'table-column--selection',\n expand: 'table__expand-column',\n}\n\nexport const cellStarts = {\n default: {\n order: '',\n },\n selection: {\n width: 48,\n minWidth: 48,\n realWidth: 48,\n order: '',\n },\n expand: {\n width: 48,\n minWidth: 48,\n realWidth: 48,\n order: '',\n },\n index: {\n width: 48,\n minWidth: 48,\n realWidth: 48,\n order: '',\n },\n}\n\nexport const getDefaultClassName = (type) => {\n return defaultClassNames[type] || ''\n}\n\n// 这些选项不应该被覆盖\nexport const cellForced = {\n selection: {\n renderHeader<T>({ store, column }: { store: Store<T> }) {\n function isDisabled() {\n return store.states.data.value && store.states.data.value.length === 0\n }\n return h(ElCheckbox, {\n disabled: isDisabled(),\n size: store.states.tableSize.value,\n indeterminate:\n store.states.selection.value.length > 0 &&\n !store.states.isAllSelected.value,\n 'onUpdate:modelValue': store.toggleAllSelection,\n modelValue: store.states.isAllSelected.value,\n ariaLabel: column.label,\n })\n },\n renderCell<T>({\n row,\n column,\n store,\n $index,\n }: {\n row: T\n column: TableColumnCtx<T>\n store: Store<T>\n $index: string\n }) {\n return h(ElCheckbox, {\n disabled: column.selectable\n ? !column.selectable.call(null, row, $index)\n : false,\n size: store.states.tableSize.value,\n onChange: () => {\n store.commit('rowSelectedChanged', row)\n },\n onClick: (event: Event) => event.stopPropagation(),\n modelValue: store.isSelected(row),\n ariaLabel: column.label,\n })\n },\n sortable: false,\n resizable: false,\n },\n index: {\n renderHeader<T>({ column }: { column: TableColumnCtx<T> }) {\n return column.label || '#'\n },\n renderCell<T>({\n column,\n $index,\n }: {\n column: TableColumnCtx<T>\n $index: number\n }) {\n let i = $index + 1\n const index = column.index\n\n if (isNumber(index)) {\n i = $index + index\n } else if (isFunction(index)) {\n i = index($index)\n }\n return h('div', {}, [i])\n },\n sortable: false,\n },\n expand: {\n renderHeader<T>({ column }: { column: TableColumnCtx<T> }) {\n return column.label || ''\n },\n renderCell<T>({\n column,\n row,\n store,\n expanded,\n }: {\n column: TableColumnCtx<T>\n row: T\n store: Store<T>\n expanded: boolean\n }) {\n const { ns } = store\n const classes = [ns.e('expand-icon')]\n\n if (!column.renderExpand && expanded) {\n classes.push(ns.em('expand-icon', 'expanded'))\n }\n const callback = function (e: Event) {\n e.stopPropagation()\n store.toggleRowExpansion(row)\n }\n return h(\n 'div',\n {\n class: classes,\n onClick: callback,\n },\n {\n default: () => {\n if (column.renderExpand) {\n return [\n column.renderExpand({\n expanded,\n }),\n ]\n }\n\n return [\n h(ElIcon, null, {\n default: () => {\n return [h(ArrowRight)]\n },\n }),\n ]\n },\n }\n )\n },\n sortable: false,\n resizable: false,\n },\n}\n\nexport function defaultRenderCell<T>({\n row,\n column,\n $index,\n}: {\n row: T\n column: TableColumnCtx<T>\n $index: number\n}) {\n const property = column.property\n const value = property && getProp(row, property).value\n if (column && column.formatter) {\n return column.formatter(row, column, value, $index)\n }\n return value?.toString?.() || ''\n}\n\nexport function treeCellPrefix<T>(\n {\n row,\n treeNode,\n store,\n }: {\n row: T\n treeNode: TreeNode\n store: Store<T>\n },\n createPlaceholder = false\n) {\n const { ns } = store\n if (!treeNode) {\n if (createPlaceholder) {\n return [\n h('span', {\n class: ns.e('placeholder'),\n }),\n ]\n }\n return null\n }\n const ele: VNode[] = []\n const callback = function (e) {\n e.stopPropagation()\n if (treeNode.loading) {\n return\n }\n store.loadOrToggle(row)\n }\n if (treeNode.indent) {\n ele.push(\n h('span', {\n class: ns.e('indent'),\n style: { 'padding-left': `${treeNode.indent}px` },\n })\n )\n }\n if (isBoolean(treeNode.expanded) && !treeNode.noLazyChildren) {\n const expandClasses = [\n ns.e('expand-icon'),\n treeNode.expanded ? ns.em('expand-icon', 'expanded') : '',\n ]\n let icon = ArrowRight\n if (treeNode.loading) {\n icon = Loading\n }\n\n ele.push(\n h(\n 'div',\n {\n class: expandClasses,\n onClick: callback,\n },\n {\n default: () => {\n return [\n h(\n ElIcon,\n { class: { [ns.is('loading')]: treeNode.loading } },\n {\n default: () => [h(icon)],\n }\n ),\n ]\n },\n }\n )\n )\n } else {\n ele.push(\n h('span', {\n class: ns.e('placeholder'),\n })\n )\n }\n return ele\n}\n"],"names":[],"mappings":";;;;;;;;AAKA,MAAM,iBAAiB,GAAG;AAC1B,EAAE,SAAS,EAAE,yBAAyB;AACtC,EAAE,MAAM,EAAE,sBAAsB;AAChC,CAAC,CAAC;AACU,MAAC,UAAU,GAAG;AAC1B,EAAE,OAAO,EAAE;AACX,IAAI,KAAK,EAAE,EAAE;AACb,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,KAAK,EAAE,EAAE;AACb,IAAI,QAAQ,EAAE,EAAE;AAChB,IAAI,SAAS,EAAE,EAAE;AACjB,IAAI,KAAK,EAAE,EAAE;AACb,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,KAAK,EAAE,EAAE;AACb,IAAI,QAAQ,EAAE,EAAE;AAChB,IAAI,SAAS,EAAE,EAAE;AACjB,IAAI,KAAK,EAAE,EAAE;AACb,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,KAAK,EAAE,EAAE;AACb,IAAI,QAAQ,EAAE,EAAE;AAChB,IAAI,SAAS,EAAE,EAAE;AACjB,IAAI,KAAK,EAAE,EAAE;AACb,GAAG;AACH,EAAE;AACU,MAAC,mBAAmB,GAAG,CAAC,IAAI,KAAK;AAC7C,EAAE,OAAO,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE;AACU,MAAC,UAAU,GAAG;AAC1B,EAAE,SAAS,EAAE;AACb,IAAI,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;AACpC,MAAM,SAAS,UAAU,GAAG;AAC5B,QAAQ,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;A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config.ts"],"sourcesContent":["import { h } from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ArrowRight, Loading } from '@element-plus/icons-vue'\nimport { getProp, isBoolean, isFunction, isNumber } from '@element-plus/utils'\n\nimport type { VNode } from 'vue'\nimport type { TableColumnCtx } from './table-column/defaults'\nimport type { Store } from './store'\nimport type { DefaultRow, TreeNode } from './table/defaults'\n\nconst defaultClassNames = {\n selection: 'table-column--selection',\n expand: 'table__expand-column',\n} as const\n\nexport const cellStarts = {\n default: {\n order: '',\n },\n selection: {\n width: 48,\n minWidth: 48,\n realWidth: 48,\n order: '',\n },\n expand: {\n width: 48,\n minWidth: 48,\n realWidth: 48,\n order: '',\n },\n index: {\n width: 48,\n minWidth: 48,\n realWidth: 48,\n order: '',\n },\n}\n\nexport const getDefaultClassName = (type: string) => {\n return defaultClassNames[type as keyof typeof defaultClassNames] || ''\n}\n\n// 这些选项不应该被覆盖\nexport const cellForced = {\n selection: {\n renderHeader<T extends DefaultRow>({\n store,\n column,\n }: {\n store: Store<T>\n column: TableColumnCtx<T>\n }) {\n function isDisabled() {\n return store.states.data.value && store.states.data.value.length === 0\n }\n return h(ElCheckbox, {\n disabled: isDisabled(),\n size: store.states.tableSize.value,\n indeterminate:\n store.states.selection.value.length > 0 &&\n !store.states.isAllSelected.value,\n 'onUpdate:modelValue': store.toggleAllSelection ?? undefined,\n modelValue: store.states.isAllSelected.value,\n ariaLabel: column.label,\n })\n },\n renderCell<T extends DefaultRow>({\n row,\n column,\n store,\n $index,\n }: {\n row: T\n column: TableColumnCtx<T>\n store: Store<T>\n $index: number\n }) {\n return h(ElCheckbox, {\n disabled: column.selectable\n ? !column.selectable.call(null, row, $index)\n : false,\n size: store.states.tableSize.value,\n onChange: () => {\n store.commit('rowSelectedChanged', row)\n },\n onClick: (event: Event) => event.stopPropagation(),\n modelValue: store.isSelected(row),\n ariaLabel: column.label,\n })\n },\n sortable: false,\n resizable: false,\n },\n index: {\n renderHeader<T extends DefaultRow>({\n column,\n }: {\n column: TableColumnCtx<T>\n }) {\n return column.label || '#'\n },\n renderCell<T extends DefaultRow>({\n column,\n $index,\n }: {\n column: TableColumnCtx<T>\n $index: number\n }) {\n let i = $index + 1\n const index = column.index\n\n if (isNumber(index)) {\n i = $index + index\n } else if (isFunction(index)) {\n i = index($index)\n }\n return h('div', {}, [i])\n },\n sortable: false,\n },\n expand: {\n renderHeader<T extends DefaultRow>({\n column,\n }: {\n column: TableColumnCtx<T>\n }) {\n return column.label || ''\n },\n renderCell<T extends DefaultRow>({\n column,\n row,\n store,\n expanded,\n }: {\n column: TableColumnCtx<T>\n row: T\n store: Store<T>\n expanded: boolean\n }) {\n const { ns } = store\n const classes = [ns.e('expand-icon')]\n\n if (!column.renderExpand && expanded) {\n classes.push(ns.em('expand-icon', 'expanded'))\n }\n const callback = function (e: Event) {\n e.stopPropagation()\n store.toggleRowExpansion(row)\n }\n return h(\n 'div',\n {\n class: classes,\n onClick: callback,\n },\n {\n default: () => {\n if (column.renderExpand) {\n return [\n column.renderExpand({\n expanded,\n }),\n ]\n }\n\n return [\n h(ElIcon, null, {\n default: () => {\n return [h(ArrowRight)]\n },\n }),\n ]\n },\n }\n )\n },\n sortable: false,\n resizable: false,\n },\n}\n\nexport function defaultRenderCell<T extends DefaultRow>({\n row,\n column,\n $index,\n}: {\n row: T\n column: TableColumnCtx<T>\n $index: number\n}) {\n const property = column.property\n const value = property && getProp(row, property).value\n if (column && column.formatter) {\n return column.formatter(row, column, value, $index)\n }\n return value?.toString?.() || ''\n}\n\nexport function treeCellPrefix<T extends DefaultRow>(\n {\n row,\n treeNode,\n store,\n }: {\n row: T\n treeNode: TreeNode\n store: Store<T>\n },\n createPlaceholder = false\n) {\n const { ns } = store\n if (!treeNode) {\n if (createPlaceholder) {\n return [\n h('span', {\n class: ns.e('placeholder'),\n }),\n ]\n }\n return null\n }\n const ele: VNode[] = []\n const callback = function (e: Event) {\n e.stopPropagation()\n if (treeNode.loading) {\n return\n }\n store.loadOrToggle(row)\n }\n if (treeNode.indent) {\n ele.push(\n h('span', {\n class: ns.e('indent'),\n style: { 'padding-left': `${treeNode.indent}px` },\n })\n )\n }\n if (isBoolean(treeNode.expanded) && !treeNode.noLazyChildren) {\n const expandClasses = [\n ns.e('expand-icon'),\n treeNode.expanded ? ns.em('expand-icon', 'expanded') : '',\n ]\n let icon = ArrowRight\n if (treeNode.loading) {\n icon = Loading\n }\n\n ele.push(\n h(\n 'div',\n {\n class: expandClasses,\n onClick: callback,\n },\n {\n default: () => {\n return [\n h(\n ElIcon,\n { class: { [ns.is('loading')]: treeNode.loading } },\n {\n default: () => [h(icon)],\n }\n ),\n ]\n },\n }\n )\n )\n } else {\n ele.push(\n h('span', {\n class: ns.e('placeholder'),\n })\n )\n }\n return ele\n}\n"],"names":[],"mappings":";;;;;;;;AAKA,MAAM,iBAAiB,GAAG;AAC1B,EAAE,SAAS,EAAE,yBAAyB;AACtC,EAAE,MAAM,EAAE,sBAAsB;AAChC,CAAC,CAAC;AACU,MAAC,UAAU,GAAG;AAC1B,EAAE,OAAO,EAAE;AACX,IAAI,KAAK,EAAE,EAAE;AACb,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,KAAK,EAAE,EAAE;AACb,IAAI,QAAQ,EAAE,EAAE;AAChB,IAAI,SAAS,EAAE,EAAE;AACjB,IAAI,KAAK,EAAE,EAAE;AACb,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,KAAK,EAAE,EAAE;AACb,IAAI,QAAQ,EAAE,EAAE;AAChB,IAAI,SAAS,EAAE,EAAE;AACjB,IAAI,KAAK,EAAE,EAAE;AACb,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,KAAK,EAAE,EAAE;AACb,IAAI,QAAQ,EAAE,EAAE;AAChB,IAAI,SAAS,EAAE,EAAE;AACjB,IAAI,KAAK,EAAE,EAAE;AACb,GAAG;AACH,EAAE;AACU,MAAC,mBAAmB,GAAG,CAA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C,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,EAAE;AACzE,YAAY,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACpC,WAAW,CAAC;AACZ,SAAS,CAAC;AACV,OAAO;AACP,KAAK,CAAC,CAAC,CAAC;AACR,GAAG,MAAM;AACT,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE;AACvB,MAAM,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;AAChC,KAAK,CAAC,CAAC,CAAC;AACR,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb;;;;"}
|
@@ -45,7 +45,7 @@ const _sfc_main = defineComponent({
|
|
45
45
|
const { t } = useLocale();
|
46
46
|
const ns = useNamespace("table-filter");
|
47
47
|
const parent = instance == null ? void 0 : instance.parent;
|
48
|
-
if (!parent.filterPanels.value[props.column.id]) {
|
48
|
+
if (props.column && !parent.filterPanels.value[props.column.id]) {
|
49
49
|
parent.filterPanels.value[props.column.id] = instance;
|
50
50
|
}
|
51
51
|
const tooltipVisible = ref(false);
|
@@ -54,7 +54,7 @@ const _sfc_main = defineComponent({
|
|
54
54
|
return props.column && props.column.filters;
|
55
55
|
});
|
56
56
|
const filterClassName = computed(() => {
|
57
|
-
if (props.column.filterClassName) {
|
57
|
+
if (props.column && props.column.filterClassName) {
|
58
58
|
return `${ns.b()} ${props.column.filterClassName}`;
|
59
59
|
}
|
60
60
|
return ns.b();
|
@@ -82,8 +82,9 @@ const _sfc_main = defineComponent({
|
|
82
82
|
return [];
|
83
83
|
},
|
84
84
|
set(value) {
|
85
|
+
var _a;
|
85
86
|
if (props.column) {
|
86
|
-
props.upDataColumn("filteredValue", value);
|
87
|
+
(_a = props.upDataColumn) == null ? void 0 : _a.call(props, "filteredValue", value);
|
87
88
|
}
|
88
89
|
}
|
89
90
|
});
|
@@ -125,15 +126,17 @@ const _sfc_main = defineComponent({
|
|
125
126
|
hidden();
|
126
127
|
};
|
127
128
|
const confirmFilter = (filteredValue2) => {
|
128
|
-
|
129
|
+
var _a, _b;
|
130
|
+
(_a = props.store) == null ? void 0 : _a.commit("filterChange", {
|
129
131
|
column: props.column,
|
130
132
|
values: filteredValue2
|
131
133
|
});
|
132
|
-
props.store.updateAllSelected();
|
134
|
+
(_b = props.store) == null ? void 0 : _b.updateAllSelected();
|
133
135
|
};
|
134
136
|
watch(tooltipVisible, (value) => {
|
137
|
+
var _a;
|
135
138
|
if (props.column) {
|
136
|
-
props.upDataColumn("filterOpened", value);
|
139
|
+
(_a = props.upDataColumn) == null ? void 0 : _a.call(props, "filterOpened", value);
|
137
140
|
}
|
138
141
|
}, {
|
139
142
|
immediate: true
|
@@ -266,9 +269,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
266
269
|
}, [
|
267
270
|
createVNode(_component_el_icon, null, {
|
268
271
|
default: withCtx(() => [
|
269
|
-
renderSlot(_ctx.$slots, "filter-icon", {}, () =>
|
270
|
-
|
271
|
-
|
272
|
+
renderSlot(_ctx.$slots, "filter-icon", {}, () => {
|
273
|
+
var _a;
|
274
|
+
return [
|
275
|
+
((_a = _ctx.column) == null ? void 0 : _a.filterOpened) ? (openBlock(), createBlock(_component_arrow_up, { key: 0 })) : (openBlock(), createBlock(_component_arrow_down, { key: 1 }))
|
276
|
+
];
|
277
|
+
})
|
272
278
|
]),
|
273
279
|
_: 3
|
274
280
|
})
|