@element-plus/nightly 0.0.20250430 → 0.0.20250502
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/attributes.json +1 -1
- package/dist/index.full.js +37 -26
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +37 -26
- 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/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +119 -24
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +24 -119
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/anchor/index.mjs +3 -3
- package/es/components/anchor/src/anchor-link.mjs +81 -5
- package/es/components/anchor/src/anchor-link.mjs.map +1 -1
- package/es/components/anchor/src/anchor-link2.mjs +5 -81
- package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
- package/es/components/anchor/src/anchor.mjs +193 -42
- package/es/components/anchor/src/anchor.mjs.map +1 -1
- package/es/components/anchor/src/anchor2.mjs +42 -193
- package/es/components/anchor/src/anchor2.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete.mjs +1 -1
- package/es/components/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb.mjs +37 -10
- package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb2.mjs +10 -37
- package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +69 -7
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +7 -69
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/cascader-panel/src/index.mjs +1 -1
- package/es/components/cascader-panel/src/menu.mjs +1 -1
- package/es/components/cascader-panel/src/node.mjs +206 -115
- package/es/components/cascader-panel/src/node.mjs.map +1 -1
- package/es/components/cascader-panel/src/node2.mjs +115 -206
- package/es/components/cascader-panel/src/node2.mjs.map +1 -1
- package/es/components/cascader-panel/src/store.mjs +1 -1
- package/es/components/collapse/src/collapse-item.vue.d.ts +3 -1
- package/es/components/collapse/src/collapse-item2.mjs +1 -1
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/color-picker/index.mjs +2 -2
- package/es/components/color-picker/src/color-picker.mjs +39 -401
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +401 -39
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/color-picker/src/components/predefine.mjs +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-year-range.mjs +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-year-range.mjs.map +1 -1
- package/es/components/descriptions/src/description2.mjs +1 -1
- package/es/components/descriptions/src/descriptions-row.mjs +63 -6
- package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
- package/es/components/descriptions/src/descriptions-row2.mjs +6 -63
- package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content.mjs +88 -29
- package/es/components/dialog/src/dialog-content.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content2.mjs +29 -88
- package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
- package/es/components/dialog/src/dialog.mjs +1 -1
- package/es/components/dialog/src/dialog2.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.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/index.mjs +4 -4
- package/es/components/form/src/form-item.mjs +319 -47
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/form/src/form-item2.mjs +47 -319
- package/es/components/form/src/form-item2.mjs.map +1 -1
- package/es/components/form/src/form.mjs +153 -53
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form.vue.d.ts +569 -2
- package/es/components/form/src/form2.mjs +53 -153
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/index.mjs +17 -17
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +65 -25
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +25 -65
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +33 -4
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +4 -33
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/message/index.mjs +1 -1
- package/es/components/message/src/message.mjs +86 -153
- package/es/components/message/src/message.mjs.map +1 -1
- package/es/components/message/src/message2.mjs +153 -86
- package/es/components/message/src/message2.mjs.map +1 -1
- package/es/components/message/src/method.mjs +2 -2
- package/es/components/pagination/src/components/pager.mjs +16 -210
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +210 -16
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/components/popover/src/popover.d.ts +6 -0
- package/es/components/popover/src/popover.mjs +2 -1
- package/es/components/popover/src/popover.mjs.map +1 -1
- package/es/components/popover/src/popover.vue.d.ts +12 -0
- package/es/components/popover/src/popover2.mjs +2 -1
- package/es/components/popover/src/popover2.mjs.map +1 -1
- package/es/components/progress/src/progress.vue.d.ts +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select/src/useSelect.mjs +1 -1
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/select-v2/src/useSelect.mjs +1 -1
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/slider/src/button.mjs +19 -91
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +91 -19
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/components/steps/index.mjs +2 -2
- package/es/components/steps/src/steps.mjs +35 -38
- package/es/components/steps/src/steps.mjs.map +1 -1
- package/es/components/steps/src/steps2.mjs +38 -35
- package/es/components/steps/src/steps2.mjs.map +1 -1
- package/es/components/table/src/filter-panel.mjs +1 -1
- package/es/components/table/src/store/helper.d.ts +435 -1
- package/es/components/table/src/store/index.d.ts +872 -2
- package/es/components/table/src/store/tree.d.ts +19 -1
- package/es/components/table/src/store/tree.mjs +7 -4
- package/es/components/table/src/store/tree.mjs.map +1 -1
- package/es/components/table/src/store/watcher.d.ts +78 -1
- package/es/components/table/src/table/utils-helper.d.ts +1 -1
- package/es/components/table/src/table-footer/index.d.ts +1 -1
- package/es/components/table/src/table-footer/mapState-helper.d.ts +6 -6
- package/es/components/table/src/table-footer/mapState-helper.mjs +12 -6
- package/es/components/table/src/table-footer/mapState-helper.mjs.map +1 -1
- package/es/components/table/src/table-footer/style-helper.d.ts +1 -1
- package/es/components/table/src/table-header/utils-helper.d.ts +1 -1
- package/es/components/table/src/table.vue.d.ts +437 -3
- package/es/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -1
- package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +1 -1
- package/es/components/time-select/index.mjs +2 -2
- package/es/components/time-select/src/time-select.mjs +54 -132
- package/es/components/time-select/src/time-select.mjs.map +1 -1
- package/es/components/time-select/src/time-select.vue.d.ts +1 -1
- package/es/components/time-select/src/time-select2.mjs +132 -54
- package/es/components/time-select/src/time-select2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/content.mjs +193 -29
- package/es/components/tooltip/src/content.mjs.map +1 -1
- package/es/components/tooltip/src/content2.mjs +29 -193
- package/es/components/tooltip/src/content2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
- package/es/components/tooltip-v2/src/trigger.mjs +89 -12
- package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
- package/es/components/tooltip-v2/src/trigger2.mjs +12 -89
- package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
- package/es/components/tour/index.mjs +2 -2
- package/es/components/tour/src/step.mjs +44 -168
- package/es/components/tour/src/step.mjs.map +1 -1
- package/es/components/tour/src/step2.mjs +168 -44
- package/es/components/tour/src/step2.mjs.map +1 -1
- package/es/components/transfer/src/transfer.vue.d.ts +1 -1
- package/es/components/upload/src/upload-content.vue.d.ts +1 -1
- package/es/components/upload/src/upload.vue.d.ts +1 -1
- package/es/components/watermark/index.mjs +2 -2
- package/es/components/watermark/src/watermark.mjs +220 -27
- package/es/components/watermark/src/watermark.mjs.map +1 -1
- package/es/components/watermark/src/watermark2.mjs +27 -220
- package/es/components/watermark/src/watermark2.mjs.map +1 -1
- 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/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +119 -25
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +25 -119
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/anchor/index.js +3 -3
- package/lib/components/anchor/src/anchor-link.js +81 -5
- package/lib/components/anchor/src/anchor-link.js.map +1 -1
- package/lib/components/anchor/src/anchor-link2.js +5 -81
- package/lib/components/anchor/src/anchor-link2.js.map +1 -1
- package/lib/components/anchor/src/anchor.js +192 -42
- package/lib/components/anchor/src/anchor.js.map +1 -1
- package/lib/components/anchor/src/anchor2.js +42 -192
- package/lib/components/anchor/src/anchor2.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.js +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb.js +37 -10
- package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb2.js +10 -37
- package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +69 -7
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +7 -69
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/cascader-panel/src/index.js +1 -1
- package/lib/components/cascader-panel/src/menu.js +1 -1
- package/lib/components/cascader-panel/src/node.js +206 -115
- package/lib/components/cascader-panel/src/node.js.map +1 -1
- package/lib/components/cascader-panel/src/node2.js +115 -206
- package/lib/components/cascader-panel/src/node2.js.map +1 -1
- package/lib/components/cascader-panel/src/store.js +1 -1
- package/lib/components/collapse/src/collapse-item.vue.d.ts +3 -1
- package/lib/components/collapse/src/collapse-item2.js +1 -1
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/color-picker/index.js +2 -2
- package/lib/components/color-picker/src/color-picker.js +40 -400
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +400 -40
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/color-picker/src/components/predefine.js +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-year-range.js +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-year-range.js.map +1 -1
- package/lib/components/descriptions/src/description2.js +1 -1
- package/lib/components/descriptions/src/descriptions-row.js +63 -6
- package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
- package/lib/components/descriptions/src/descriptions-row2.js +6 -63
- package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
- package/lib/components/dialog/src/dialog-content.js +87 -29
- package/lib/components/dialog/src/dialog-content.js.map +1 -1
- package/lib/components/dialog/src/dialog-content2.js +29 -87
- package/lib/components/dialog/src/dialog-content2.js.map +1 -1
- package/lib/components/dialog/src/dialog.js +1 -1
- package/lib/components/dialog/src/dialog2.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.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/index.js +4 -4
- package/lib/components/form/src/form-item.js +323 -48
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/form/src/form-item2.js +48 -323
- package/lib/components/form/src/form-item2.js.map +1 -1
- package/lib/components/form/src/form.js +152 -54
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form.vue.d.ts +569 -2
- package/lib/components/form/src/form2.js +54 -152
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/index.js +17 -17
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +65 -26
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +26 -65
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +33 -4
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +4 -33
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/message/index.js +1 -1
- package/lib/components/message/src/message.js +88 -152
- package/lib/components/message/src/message.js.map +1 -1
- package/lib/components/message/src/message2.js +152 -88
- package/lib/components/message/src/message2.js.map +1 -1
- package/lib/components/message/src/method.js +2 -2
- package/lib/components/pagination/src/components/pager.js +16 -210
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +210 -16
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/components/popover/src/popover.d.ts +6 -0
- package/lib/components/popover/src/popover.js +2 -1
- package/lib/components/popover/src/popover.js.map +1 -1
- package/lib/components/popover/src/popover.vue.d.ts +12 -0
- package/lib/components/popover/src/popover2.js +2 -1
- package/lib/components/popover/src/popover2.js.map +1 -1
- package/lib/components/progress/src/progress.vue.d.ts +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select/src/useSelect.js +1 -1
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/select-v2/src/useSelect.js +1 -1
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/slider/src/button.js +20 -91
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +91 -20
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/components/steps/index.js +2 -2
- package/lib/components/steps/src/steps.js +36 -38
- package/lib/components/steps/src/steps.js.map +1 -1
- package/lib/components/steps/src/steps2.js +38 -36
- package/lib/components/steps/src/steps2.js.map +1 -1
- package/lib/components/table/src/filter-panel.js +1 -1
- package/lib/components/table/src/store/helper.d.ts +435 -1
- package/lib/components/table/src/store/index.d.ts +872 -2
- package/lib/components/table/src/store/tree.d.ts +19 -1
- package/lib/components/table/src/store/tree.js +7 -4
- package/lib/components/table/src/store/tree.js.map +1 -1
- package/lib/components/table/src/store/watcher.d.ts +78 -1
- package/lib/components/table/src/table/utils-helper.d.ts +1 -1
- package/lib/components/table/src/table-footer/index.d.ts +1 -1
- package/lib/components/table/src/table-footer/mapState-helper.d.ts +6 -6
- package/lib/components/table/src/table-footer/mapState-helper.js +12 -6
- package/lib/components/table/src/table-footer/mapState-helper.js.map +1 -1
- package/lib/components/table/src/table-footer/style-helper.d.ts +1 -1
- package/lib/components/table/src/table-header/utils-helper.d.ts +1 -1
- package/lib/components/table/src/table.vue.d.ts +437 -3
- package/lib/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -1
- package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +1 -1
- package/lib/components/time-select/index.js +2 -2
- package/lib/components/time-select/src/time-select.js +54 -137
- package/lib/components/time-select/src/time-select.js.map +1 -1
- package/lib/components/time-select/src/time-select.vue.d.ts +1 -1
- package/lib/components/time-select/src/time-select2.js +137 -54
- package/lib/components/time-select/src/time-select2.js.map +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/content.js +193 -29
- package/lib/components/tooltip/src/content.js.map +1 -1
- package/lib/components/tooltip/src/content2.js +29 -193
- package/lib/components/tooltip/src/content2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tooltip-v2/index.js +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
- package/lib/components/tooltip-v2/src/trigger.js +89 -12
- package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
- package/lib/components/tooltip-v2/src/trigger2.js +12 -89
- package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
- package/lib/components/tour/index.js +2 -2
- package/lib/components/tour/src/step.js +44 -167
- package/lib/components/tour/src/step.js.map +1 -1
- package/lib/components/tour/src/step2.js +167 -44
- package/lib/components/tour/src/step2.js.map +1 -1
- package/lib/components/transfer/src/transfer.vue.d.ts +1 -1
- package/lib/components/upload/src/upload-content.vue.d.ts +1 -1
- package/lib/components/upload/src/upload.vue.d.ts +1 -1
- package/lib/components/watermark/index.js +2 -2
- package/lib/components/watermark/src/watermark.js +220 -27
- package/lib/components/watermark/src/watermark.js.map +1 -1
- package/lib/components/watermark/src/watermark2.js +27 -220
- package/lib/components/watermark/src/watermark2.js.map +1 -1
- 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/tags.json +1 -1
- package/web-types.json +1 -1
@@ -1,3 +1,21 @@
|
|
1
1
|
import type { WatcherPropsData } from '.';
|
2
|
-
declare function useTree<T>(watcherData: WatcherPropsData<T>):
|
2
|
+
declare function useTree<T>(watcherData: WatcherPropsData<T>): {
|
3
|
+
loadData: (row: T, key: string, treeNode: any) => void;
|
4
|
+
loadOrToggle: (row: any) => void;
|
5
|
+
toggleTreeExpansion: (row: T, expanded?: boolean) => void;
|
6
|
+
updateTreeExpandKeys: (value: string[]) => void;
|
7
|
+
updateTreeData: (ifChangeExpandRowKeys?: boolean) => void;
|
8
|
+
updateKeyChildren: (key: string, data: T[]) => void;
|
9
|
+
normalize: (data: any) => {};
|
10
|
+
states: {
|
11
|
+
expandRowKeys: import("vue").Ref<string[]>;
|
12
|
+
treeData: import("vue").Ref<unknown>;
|
13
|
+
indent: import("vue").Ref<number>;
|
14
|
+
lazy: import("vue").Ref<boolean>;
|
15
|
+
lazyTreeNodeMap: import("vue").Ref<{}>;
|
16
|
+
lazyColumnIdentifier: import("vue").Ref<string>;
|
17
|
+
childrenColumnName: import("vue").Ref<string>;
|
18
|
+
checkStrictly: import("vue").Ref<boolean>;
|
19
|
+
};
|
20
|
+
};
|
3
21
|
export default useTree;
|
@@ -60,18 +60,21 @@ function useTree(watcherData) {
|
|
60
60
|
}, childrenColumnName.value, lazyColumnIdentifier.value);
|
61
61
|
return res;
|
62
62
|
};
|
63
|
-
|
64
|
-
|
63
|
+
let isInitTree = true;
|
64
|
+
const updateTreeData = (ifChangeExpandRowKeys = false) => {
|
65
|
+
var _a, _b;
|
65
66
|
const nested = normalizedData.value;
|
66
67
|
const normalizedLazyNode_ = normalizedLazyNode.value;
|
67
68
|
const keys = Object.keys(nested);
|
68
69
|
const newTreeData = {};
|
70
|
+
const ifExpandAll = ((_a = instance.store) == null ? void 0 : _a.states.defaultExpandAll.value) && isInitTree;
|
71
|
+
isInitTree = false;
|
69
72
|
if (keys.length) {
|
70
73
|
const oldTreeData = unref(treeData);
|
71
74
|
const rootLazyRowKeys = [];
|
72
75
|
const getExpanded = (oldValue, key) => {
|
73
76
|
if (ifChangeExpandRowKeys) {
|
74
|
-
if (expandRowKeys.value) {
|
77
|
+
if (expandRowKeys.value.length) {
|
75
78
|
return ifExpandAll || expandRowKeys.value.includes(key);
|
76
79
|
} else {
|
77
80
|
return !!(ifExpandAll || (oldValue == null ? void 0 : oldValue.expanded));
|
@@ -118,7 +121,7 @@ function useTree(watcherData) {
|
|
118
121
|
}
|
119
122
|
}
|
120
123
|
treeData.value = newTreeData;
|
121
|
-
(
|
124
|
+
(_b = instance.store) == null ? void 0 : _b.updateTableScrollY();
|
122
125
|
};
|
123
126
|
watch(() => expandRowKeys.value, () => {
|
124
127
|
updateTreeData(true);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tree.mjs","sources":["../../../../../../../packages/components/table/src/store/tree.ts"],"sourcesContent":["// @ts-nocheck\nimport { computed, getCurrentInstance, ref, unref, watch } from 'vue'\nimport { isArray, isUndefined } from '@element-plus/utils'\nimport { getRowIdentity, walkTreeNode } from '../util'\n\nimport type { WatcherPropsData } from '.'\nimport type { Table, TableProps } from '../table/defaults'\n\nfunction useTree<T>(watcherData: WatcherPropsData<T>) {\n const expandRowKeys = ref<string[]>([])\n const treeData = ref<unknown>({})\n const indent = ref(16)\n const lazy = ref(false)\n const lazyTreeNodeMap = ref({})\n const lazyColumnIdentifier = ref('hasChildren')\n const childrenColumnName = ref('children')\n const checkStrictly = ref(false)\n const instance = getCurrentInstance() as Table<T>\n const normalizedData = computed(() => {\n if (!watcherData.rowKey.value) return {}\n const data = watcherData.data.value || []\n return normalize(data)\n })\n const normalizedLazyNode = computed(() => {\n const rowKey = watcherData.rowKey.value\n const keys = Object.keys(lazyTreeNodeMap.value)\n const res = {}\n if (!keys.length) return res\n keys.forEach((key) => {\n if (lazyTreeNodeMap.value[key].length) {\n const item = { children: [] }\n lazyTreeNodeMap.value[key].forEach((row) => {\n const currentRowKey = getRowIdentity(row, rowKey)\n item.children.push(currentRowKey)\n if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) {\n res[currentRowKey] = { children: [] }\n }\n })\n res[key] = item\n }\n })\n return res\n })\n\n const normalize = (data) => {\n const rowKey = watcherData.rowKey.value\n const res = {}\n walkTreeNode(\n data,\n (parent, children, level) => {\n const parentId = getRowIdentity(parent, rowKey)\n if (isArray(children)) {\n res[parentId] = {\n children: children.map((row) => getRowIdentity(row, rowKey)),\n level,\n }\n } else if (lazy.value) {\n // 当 children 不存在且 lazy 为 true,该节点即为懒加载的节点\n res[parentId] = {\n children: [],\n lazy: true,\n level,\n }\n }\n },\n childrenColumnName.value,\n lazyColumnIdentifier.value\n )\n return res\n }\n\n const updateTreeData = (\n ifChangeExpandRowKeys = false,\n ifExpandAll = instance.store?.states.defaultExpandAll.value\n ) => {\n const nested = normalizedData.value\n const normalizedLazyNode_ = normalizedLazyNode.value\n const keys = Object.keys(nested)\n const newTreeData = {}\n if (keys.length) {\n const oldTreeData = unref(treeData)\n const rootLazyRowKeys = []\n const getExpanded = (oldValue, key) => {\n if (ifChangeExpandRowKeys) {\n if (expandRowKeys.value) {\n return ifExpandAll || expandRowKeys.value.includes(key)\n } else {\n return !!(ifExpandAll || oldValue?.expanded)\n }\n } else {\n const included =\n ifExpandAll ||\n (expandRowKeys.value && expandRowKeys.value.includes(key))\n return !!(oldValue?.expanded || included)\n }\n }\n // 合并 expanded 与 display,确保数据刷新后,状态不变\n keys.forEach((key) => {\n const oldValue = oldTreeData[key]\n const newValue = { ...nested[key] }\n newValue.expanded = getExpanded(oldValue, key)\n if (newValue.lazy) {\n const { loaded = false, loading = false } = oldValue || {}\n newValue.loaded = !!loaded\n newValue.loading = !!loading\n rootLazyRowKeys.push(key)\n }\n newTreeData[key] = newValue\n })\n // 根据懒加载数据更新 treeData\n const lazyKeys = Object.keys(normalizedLazyNode_)\n if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) {\n lazyKeys.forEach((key) => {\n const oldValue = oldTreeData[key]\n const lazyNodeChildren = normalizedLazyNode_[key].children\n if (rootLazyRowKeys.includes(key)) {\n // 懒加载的 root 节点,更新一下原有的数据,原来的 children 一定是空数组\n if (newTreeData[key].children.length !== 0) {\n throw new Error('[ElTable]children must be an empty array.')\n }\n newTreeData[key].children = lazyNodeChildren\n } else {\n const { loaded = false, loading = false } = oldValue || {}\n newTreeData[key] = {\n lazy: true,\n loaded: !!loaded,\n loading: !!loading,\n expanded: getExpanded(oldValue, key),\n children: lazyNodeChildren,\n level: '',\n }\n }\n })\n }\n }\n treeData.value = newTreeData\n instance.store?.updateTableScrollY()\n }\n\n watch(\n () => expandRowKeys.value,\n () => {\n updateTreeData(true)\n }\n )\n\n watch(\n () => normalizedData.value,\n () => {\n updateTreeData()\n }\n )\n watch(\n () => normalizedLazyNode.value,\n () => {\n updateTreeData()\n }\n )\n\n const updateTreeExpandKeys = (value: string[]) => {\n expandRowKeys.value = value\n updateTreeData()\n }\n const isUseLazy = (data): boolean => {\n return lazy.value && data && 'loaded' in data && !data.loaded\n }\n const toggleTreeExpansion = (row: T, expanded?: boolean) => {\n instance.store.assertRowKey()\n\n const rowKey = watcherData.rowKey.value\n const id = getRowIdentity(row, rowKey)\n const data = id && treeData.value[id]\n if (id && data && 'expanded' in data) {\n const oldExpanded = data.expanded\n expanded = isUndefined(expanded) ? !data.expanded : expanded\n treeData.value[id].expanded = expanded\n if (oldExpanded !== expanded) {\n instance.emit('expand-change', row, expanded)\n }\n isUseLazy(data) && loadData(row, id, data)\n instance.store.updateTableScrollY()\n }\n }\n\n const loadOrToggle = (row) => {\n instance.store.assertRowKey()\n const rowKey = watcherData.rowKey.value\n const id = getRowIdentity(row, rowKey)\n const data = treeData.value[id]\n if (isUseLazy(data)) {\n loadData(row, id, data)\n } else {\n toggleTreeExpansion(row, undefined)\n }\n }\n\n const loadData = (row: T, key: string, treeNode) => {\n const { load } = instance.props as unknown as TableProps<T>\n if (load && !treeData.value[key].loaded) {\n treeData.value[key].loading = true\n load(row, treeNode, (data) => {\n if (!isArray(data)) {\n throw new TypeError('[ElTable] data must be an array')\n }\n treeData.value[key].loading = false\n treeData.value[key].loaded = true\n treeData.value[key].expanded = true\n if (data.length) {\n lazyTreeNodeMap.value[key] = data\n }\n instance.emit('expand-change', row, true)\n })\n }\n }\n\n const updateKeyChildren = (key: string, data: T[]) => {\n const { lazy, rowKey } = instance.props as unknown as TableProps<T>\n if (!lazy) return\n if (!rowKey) throw new Error('[Table] rowKey is required in updateKeyChild')\n\n if (lazyTreeNodeMap.value[key]) {\n lazyTreeNodeMap.value[key] = data\n }\n }\n\n return {\n loadData,\n loadOrToggle,\n toggleTreeExpansion,\n updateTreeExpandKeys,\n updateTreeData,\n updateKeyChildren,\n normalize,\n states: {\n expandRowKeys,\n treeData,\n indent,\n lazy,\n lazyTreeNodeMap,\n lazyColumnIdentifier,\n childrenColumnName,\n checkStrictly,\n },\n }\n}\n\nexport default useTree\n"],"names":[],"mappings":";;;;;AAGA,SAAS,OAAO,CAAC,WAAW,EAAE;AAC9B,EAAE,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAChC,EAAE,MAAM,QAAQ,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAC3B,EAAE,MAAM,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AACzB,EAAE,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;AAC1B,EAAE,MAAM,eAAe,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAClC,EAAE,MAAM,oBAAoB,GAAG,GAAG,CAAC,aAAa,CAAC,CAAC;AAClD,EAAE,MAAM,kBAAkB,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;AAC7C,EAAE,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;AACnC,EAAE,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM;AACxC,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK;AACjC,MAAM,OAAO,EA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AAC;AACT,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;AAC3C,IAAI,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC;AACnD,IAAI,IAAI,CAAC,KAAK;AACd,MAAM,OAAO;AACb,IAAI,IAAI,CAAC,MAAM;AACf,MAAM,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;AACtE,IAAI,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;AACpC,MAAM,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACxC,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,QAAQ;AACZ,IAAI,YAAY;AAChB,IAAI,mBAAmB;AACvB,IAAI,oBAAoB;AACxB,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,SAAS;AACb,IAAI,MAAM,EAAE;AACZ,MAAM,aAAa;AACnB,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,IAAI;AACV,MAAM,eAAe;AACrB,MAAM,oBAAoB;AAC1B,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"tree.mjs","sources":["../../../../../../../packages/components/table/src/store/tree.ts"],"sourcesContent":["// @ts-nocheck\nimport { computed, getCurrentInstance, ref, unref, watch } from 'vue'\nimport { isArray, isUndefined } from '@element-plus/utils'\nimport { getRowIdentity, walkTreeNode } from '../util'\n\nimport type { WatcherPropsData } from '.'\nimport type { Table, TableProps } from '../table/defaults'\n\nfunction useTree<T>(watcherData: WatcherPropsData<T>) {\n const expandRowKeys = ref<string[]>([])\n const treeData = ref<unknown>({})\n const indent = ref(16)\n const lazy = ref(false)\n const lazyTreeNodeMap = ref({})\n const lazyColumnIdentifier = ref('hasChildren')\n const childrenColumnName = ref('children')\n const checkStrictly = ref(false)\n const instance = getCurrentInstance() as Table<T>\n const normalizedData = computed(() => {\n if (!watcherData.rowKey.value) return {}\n const data = watcherData.data.value || []\n return normalize(data)\n })\n const normalizedLazyNode = computed(() => {\n const rowKey = watcherData.rowKey.value\n const keys = Object.keys(lazyTreeNodeMap.value)\n const res = {}\n if (!keys.length) return res\n keys.forEach((key) => {\n if (lazyTreeNodeMap.value[key].length) {\n const item = { children: [] }\n lazyTreeNodeMap.value[key].forEach((row) => {\n const currentRowKey = getRowIdentity(row, rowKey)\n item.children.push(currentRowKey)\n if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) {\n res[currentRowKey] = { children: [] }\n }\n })\n res[key] = item\n }\n })\n return res\n })\n\n const normalize = (data) => {\n const rowKey = watcherData.rowKey.value\n const res = {}\n walkTreeNode(\n data,\n (parent, children, level) => {\n const parentId = getRowIdentity(parent, rowKey)\n if (isArray(children)) {\n res[parentId] = {\n children: children.map((row) => getRowIdentity(row, rowKey)),\n level,\n }\n } else if (lazy.value) {\n // 当 children 不存在且 lazy 为 true,该节点即为懒加载的节点\n res[parentId] = {\n children: [],\n lazy: true,\n level,\n }\n }\n },\n childrenColumnName.value,\n lazyColumnIdentifier.value\n )\n return res\n }\n\n let isInitTree = true\n const updateTreeData = (ifChangeExpandRowKeys = false) => {\n const nested = normalizedData.value\n const normalizedLazyNode_ = normalizedLazyNode.value\n const keys = Object.keys(nested)\n const newTreeData = {}\n const ifExpandAll =\n instance.store?.states.defaultExpandAll.value && isInitTree\n isInitTree = false\n if (keys.length) {\n const oldTreeData = unref(treeData)\n const rootLazyRowKeys = []\n const getExpanded = (oldValue, key) => {\n if (ifChangeExpandRowKeys) {\n if (expandRowKeys.value.length) {\n return ifExpandAll || expandRowKeys.value.includes(key)\n } else {\n return !!(ifExpandAll || oldValue?.expanded)\n }\n } else {\n const included =\n ifExpandAll ||\n (expandRowKeys.value && expandRowKeys.value.includes(key))\n return !!(oldValue?.expanded || included)\n }\n }\n // 合并 expanded 与 display,确保数据刷新后,状态不变\n keys.forEach((key) => {\n const oldValue = oldTreeData[key]\n const newValue = { ...nested[key] }\n newValue.expanded = getExpanded(oldValue, key)\n if (newValue.lazy) {\n const { loaded = false, loading = false } = oldValue || {}\n newValue.loaded = !!loaded\n newValue.loading = !!loading\n rootLazyRowKeys.push(key)\n }\n newTreeData[key] = newValue\n })\n // 根据懒加载数据更新 treeData\n const lazyKeys = Object.keys(normalizedLazyNode_)\n if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) {\n lazyKeys.forEach((key) => {\n const oldValue = oldTreeData[key]\n const lazyNodeChildren = normalizedLazyNode_[key].children\n if (rootLazyRowKeys.includes(key)) {\n // 懒加载的 root 节点,更新一下原有的数据,原来的 children 一定是空数组\n if (newTreeData[key].children.length !== 0) {\n throw new Error('[ElTable]children must be an empty array.')\n }\n newTreeData[key].children = lazyNodeChildren\n } else {\n const { loaded = false, loading = false } = oldValue || {}\n newTreeData[key] = {\n lazy: true,\n loaded: !!loaded,\n loading: !!loading,\n expanded: getExpanded(oldValue, key),\n children: lazyNodeChildren,\n level: '',\n }\n }\n })\n }\n }\n treeData.value = newTreeData\n instance.store?.updateTableScrollY()\n }\n\n watch(\n () => expandRowKeys.value,\n () => {\n updateTreeData(true)\n }\n )\n\n watch(\n () => normalizedData.value,\n () => {\n updateTreeData()\n }\n )\n watch(\n () => normalizedLazyNode.value,\n () => {\n updateTreeData()\n }\n )\n\n const updateTreeExpandKeys = (value: string[]) => {\n expandRowKeys.value = value\n updateTreeData()\n }\n const isUseLazy = (data): boolean => {\n return lazy.value && data && 'loaded' in data && !data.loaded\n }\n const toggleTreeExpansion = (row: T, expanded?: boolean) => {\n instance.store.assertRowKey()\n\n const rowKey = watcherData.rowKey.value\n const id = getRowIdentity(row, rowKey)\n const data = id && treeData.value[id]\n if (id && data && 'expanded' in data) {\n const oldExpanded = data.expanded\n expanded = isUndefined(expanded) ? !data.expanded : expanded\n treeData.value[id].expanded = expanded\n if (oldExpanded !== expanded) {\n instance.emit('expand-change', row, expanded)\n }\n isUseLazy(data) && loadData(row, id, data)\n instance.store.updateTableScrollY()\n }\n }\n\n const loadOrToggle = (row) => {\n instance.store.assertRowKey()\n const rowKey = watcherData.rowKey.value\n const id = getRowIdentity(row, rowKey)\n const data = treeData.value[id]\n if (isUseLazy(data)) {\n loadData(row, id, data)\n } else {\n toggleTreeExpansion(row, undefined)\n }\n }\n\n const loadData = (row: T, key: string, treeNode) => {\n const { load } = instance.props as unknown as TableProps<T>\n if (load && !treeData.value[key].loaded) {\n treeData.value[key].loading = true\n load(row, treeNode, (data) => {\n if (!isArray(data)) {\n throw new TypeError('[ElTable] data must be an array')\n }\n treeData.value[key].loading = false\n treeData.value[key].loaded = true\n treeData.value[key].expanded = true\n if (data.length) {\n lazyTreeNodeMap.value[key] = data\n }\n instance.emit('expand-change', row, true)\n })\n }\n }\n\n const updateKeyChildren = (key: string, data: T[]) => {\n const { lazy, rowKey } = instance.props as unknown as TableProps<T>\n if (!lazy) return\n if (!rowKey) throw new Error('[Table] rowKey is required in updateKeyChild')\n\n if (lazyTreeNodeMap.value[key]) {\n lazyTreeNodeMap.value[key] = data\n }\n }\n\n return {\n loadData,\n loadOrToggle,\n toggleTreeExpansion,\n updateTreeExpandKeys,\n updateTreeData,\n updateKeyChildren,\n normalize,\n states: {\n expandRowKeys,\n treeData,\n indent,\n lazy,\n lazyTreeNodeMap,\n lazyColumnIdentifier,\n childrenColumnName,\n checkStrictly,\n },\n }\n}\n\nexport default useTree\n"],"names":[],"mappings":";;;;;AAGA,SAAS,OAAO,CAAC,WAAW,EAAE;AAC9B,EAAE,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAChC,EAAE,MAAM,QAAQ,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAC3B,EAAE,MAAM,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AACzB,EAAE,MAAM,IAAI,GA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;AACnB,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,IAAI;AACV,MAAM,eAAe;AACrB,MAAM,oBAAoB;AAC1B,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
|
@@ -1,2 +1,79 @@
|
|
1
|
-
|
1
|
+
import type { Ref } from 'vue';
|
2
|
+
import type { TableColumnCtx } from '../table-column/defaults';
|
3
|
+
import type { DefaultRow } from '../table/defaults';
|
4
|
+
import type { StoreFilter } from '.';
|
5
|
+
declare function useWatcher<T>(): {
|
6
|
+
assertRowKey: () => void;
|
7
|
+
updateColumns: () => void;
|
8
|
+
scheduleLayout: (needUpdateColumns?: boolean, immediate?: boolean) => void;
|
9
|
+
isSelected: (row: DefaultRow) => boolean;
|
10
|
+
clearSelection: () => void;
|
11
|
+
cleanSelection: () => void;
|
12
|
+
getSelectionRows: () => T[];
|
13
|
+
toggleRowSelection: (row: T, selected?: boolean, emitChange?: boolean, ignoreSelectable?: boolean) => void;
|
14
|
+
_toggleAllSelection: () => void;
|
15
|
+
toggleAllSelection: null;
|
16
|
+
updateSelectionByRowKey: () => void;
|
17
|
+
updateAllSelected: () => void;
|
18
|
+
updateFilters: (columns: any, values: any) => {};
|
19
|
+
updateCurrentRow: (_currentRow: T) => void;
|
20
|
+
updateSort: (column: any, prop: any, order: any) => void;
|
21
|
+
execFilter: () => void;
|
22
|
+
execSort: () => void;
|
23
|
+
execQuery: (ignore?: undefined) => void;
|
24
|
+
clearFilter: (columnKeys: any) => void;
|
25
|
+
clearSort: () => void;
|
26
|
+
toggleRowExpansion: (row: T, expanded?: boolean) => void;
|
27
|
+
setExpandRowKeysAdapter: (val: string[]) => void;
|
28
|
+
setCurrentRowKey: (key: string) => void;
|
29
|
+
toggleRowExpansionAdapter: (row: T, expanded?: boolean) => void;
|
30
|
+
isRowExpanded: (row: T) => boolean;
|
31
|
+
updateExpandRows: () => void;
|
32
|
+
updateCurrentRowData: () => void;
|
33
|
+
loadOrToggle: (row: any) => void;
|
34
|
+
updateTreeData: (ifChangeExpandRowKeys?: boolean) => void;
|
35
|
+
updateKeyChildren: (key: string, data: T[]) => void;
|
36
|
+
states: {
|
37
|
+
_currentRowKey: Ref<string>;
|
38
|
+
currentRow: Ref<T>;
|
39
|
+
expandRowKeys: Ref<string[]>;
|
40
|
+
treeData: Ref<unknown>;
|
41
|
+
indent: Ref<number>;
|
42
|
+
lazy: Ref<boolean>;
|
43
|
+
lazyTreeNodeMap: Ref<{}>;
|
44
|
+
lazyColumnIdentifier: Ref<string>;
|
45
|
+
childrenColumnName: Ref<string>;
|
46
|
+
checkStrictly: Ref<boolean>;
|
47
|
+
expandRows: Ref<T[]>;
|
48
|
+
defaultExpandAll: Ref<boolean>;
|
49
|
+
tableSize: Ref<any>;
|
50
|
+
rowKey: Ref<string>;
|
51
|
+
data: Ref<T[]>;
|
52
|
+
_data: Ref<T[]>;
|
53
|
+
isComplex: Ref<boolean>;
|
54
|
+
_columns: Ref<TableColumnCtx<T>[]>;
|
55
|
+
originColumns: Ref<TableColumnCtx<T>[]>;
|
56
|
+
columns: Ref<TableColumnCtx<T>[]>;
|
57
|
+
fixedColumns: Ref<TableColumnCtx<T>[]>;
|
58
|
+
rightFixedColumns: Ref<TableColumnCtx<T>[]>;
|
59
|
+
leafColumns: Ref<TableColumnCtx<T>[]>;
|
60
|
+
fixedLeafColumns: Ref<TableColumnCtx<T>[]>;
|
61
|
+
rightFixedLeafColumns: Ref<TableColumnCtx<T>[]>;
|
62
|
+
updateOrderFns: (() => void)[];
|
63
|
+
leafColumnsLength: Ref<number>;
|
64
|
+
fixedLeafColumnsLength: Ref<number>;
|
65
|
+
rightFixedLeafColumnsLength: Ref<number>;
|
66
|
+
isAllSelected: Ref<boolean>;
|
67
|
+
selection: Ref<T[]>;
|
68
|
+
reserveSelection: Ref<boolean>;
|
69
|
+
selectOnIndeterminate: Ref<boolean>;
|
70
|
+
selectable: Ref<(row: T, index: number) => boolean>;
|
71
|
+
filters: Ref<StoreFilter>;
|
72
|
+
filteredData: Ref<null>;
|
73
|
+
sortingColumn: Ref<null>;
|
74
|
+
sortProp: Ref<null>;
|
75
|
+
sortOrder: Ref<null>;
|
76
|
+
hoverRow: Ref<null>;
|
77
|
+
};
|
78
|
+
};
|
2
79
|
export default useWatcher;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { Store } from '../store';
|
2
2
|
declare function useUtils<T>(store: Store<T>): {
|
3
3
|
setCurrentRow: (row: T) => void;
|
4
|
-
getSelectionRows: () =>
|
4
|
+
getSelectionRows: () => T[];
|
5
5
|
toggleRowSelection: (row: T, selected?: boolean, ignoreSelectable?: boolean) => void;
|
6
6
|
clearSelection: () => void;
|
7
7
|
clearFilter: (columnKeys?: string[]) => void;
|
@@ -51,7 +51,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
51
51
|
onColumnsChange: (layout: import("../table-layout").default<any>) => void;
|
52
52
|
getCellClasses: (columns: import("../table-column/defaults").TableColumnCtx<any>[], cellIndex: number) => string[];
|
53
53
|
getCellStyles: (column: import("../table-column/defaults").TableColumnCtx<any>, cellIndex: number) => any;
|
54
|
-
columns: any
|
54
|
+
columns: never[] | import("vue").Ref<import("../table-column/defaults").TableColumnCtx<any>[]>;
|
55
55
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
56
56
|
fixed: {
|
57
57
|
type: StringConstructor;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
declare function useMapState(): {
|
2
|
-
leftFixedLeafCount: import("vue").ComputedRef<
|
3
|
-
rightFixedLeafCount: import("vue").ComputedRef<
|
4
|
-
columnsCount: import("vue").ComputedRef<
|
5
|
-
leftFixedCount: import("vue").ComputedRef<
|
6
|
-
rightFixedCount: import("vue").ComputedRef<
|
7
|
-
columns: any
|
2
|
+
leftFixedLeafCount: import("vue").ComputedRef<number>;
|
3
|
+
rightFixedLeafCount: import("vue").ComputedRef<number>;
|
4
|
+
columnsCount: import("vue").ComputedRef<number>;
|
5
|
+
leftFixedCount: import("vue").ComputedRef<number>;
|
6
|
+
rightFixedCount: import("vue").ComputedRef<number>;
|
7
|
+
columns: never[] | import("vue").Ref<import("element-plus").TableColumnCtx<any>[]>;
|
8
8
|
};
|
9
9
|
export default useMapState;
|
@@ -2,22 +2,28 @@ import { inject, computed } from 'vue';
|
|
2
2
|
import { TABLE_INJECTION_KEY } from '../tokens.mjs';
|
3
3
|
|
4
4
|
function useMapState() {
|
5
|
+
var _a;
|
5
6
|
const table = inject(TABLE_INJECTION_KEY);
|
6
7
|
const store = table == null ? void 0 : table.store;
|
7
8
|
const leftFixedLeafCount = computed(() => {
|
8
|
-
|
9
|
+
var _a2;
|
10
|
+
return (_a2 = store == null ? void 0 : store.states.fixedLeafColumnsLength.value) != null ? _a2 : 0;
|
9
11
|
});
|
10
12
|
const rightFixedLeafCount = computed(() => {
|
11
|
-
|
13
|
+
var _a2;
|
14
|
+
return (_a2 = store == null ? void 0 : store.states.rightFixedColumns.value.length) != null ? _a2 : 0;
|
12
15
|
});
|
13
16
|
const columnsCount = computed(() => {
|
14
|
-
|
17
|
+
var _a2;
|
18
|
+
return (_a2 = store == null ? void 0 : store.states.columns.value.length) != null ? _a2 : 0;
|
15
19
|
});
|
16
20
|
const leftFixedCount = computed(() => {
|
17
|
-
|
21
|
+
var _a2;
|
22
|
+
return (_a2 = store == null ? void 0 : store.states.fixedColumns.value.length) != null ? _a2 : 0;
|
18
23
|
});
|
19
24
|
const rightFixedCount = computed(() => {
|
20
|
-
|
25
|
+
var _a2;
|
26
|
+
return (_a2 = store == null ? void 0 : store.states.rightFixedColumns.value.length) != null ? _a2 : 0;
|
21
27
|
});
|
22
28
|
return {
|
23
29
|
leftFixedLeafCount,
|
@@ -25,7 +31,7 @@ function useMapState() {
|
|
25
31
|
columnsCount,
|
26
32
|
leftFixedCount,
|
27
33
|
rightFixedCount,
|
28
|
-
columns: store.states.columns
|
34
|
+
columns: (_a = store == null ? void 0 : store.states.columns) != null ? _a : []
|
29
35
|
};
|
30
36
|
}
|
31
37
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mapState-helper.mjs","sources":["../../../../../../../packages/components/table/src/table-footer/mapState-helper.ts"],"sourcesContent":["import { computed, inject } from 'vue'\nimport { TABLE_INJECTION_KEY } from '../tokens'\n\nfunction useMapState() {\n const table = inject(TABLE_INJECTION_KEY)\n const store = table?.store\n const leftFixedLeafCount = computed(() => {\n return store
|
1
|
+
{"version":3,"file":"mapState-helper.mjs","sources":["../../../../../../../packages/components/table/src/table-footer/mapState-helper.ts"],"sourcesContent":["import { computed, inject } from 'vue'\nimport { TABLE_INJECTION_KEY } from '../tokens'\n\nfunction useMapState() {\n const table = inject(TABLE_INJECTION_KEY)\n const store = table?.store\n const leftFixedLeafCount = computed(() => {\n return store?.states.fixedLeafColumnsLength.value ?? 0\n })\n const rightFixedLeafCount = computed(() => {\n return store?.states.rightFixedColumns.value.length ?? 0\n })\n const columnsCount = computed(() => {\n return store?.states.columns.value.length ?? 0\n })\n const leftFixedCount = computed(() => {\n return store?.states.fixedColumns.value.length ?? 0\n })\n const rightFixedCount = computed(() => {\n return store?.states.rightFixedColumns.value.length ?? 0\n })\n\n return {\n leftFixedLeafCount,\n rightFixedLeafCount,\n columnsCount,\n leftFixedCount,\n rightFixedCount,\n columns: store?.states.columns ?? [],\n }\n}\n\nexport default useMapState\n"],"names":[],"mappings":";;;AAEA,SAAS,WAAW,GAAG;AACvB,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC5C,EAAE,MAAM,KAAK,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;AACrD,EAAE,MAAM,kBAAkB,GAAG,QAAQ,CA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AC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;AAC1G,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,kBAAkB;AACtB,IAAI,mBAAmB;AACvB,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,OAAO,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE;AACnF,GAAG,CAAC;AACJ;;;;"}
|
@@ -3,6 +3,6 @@ import type { TableFooter } from '.';
|
|
3
3
|
declare function useStyle<T>(props: TableFooter<T>): {
|
4
4
|
getCellClasses: (columns: TableColumnCtx<T>[], cellIndex: number) => string[];
|
5
5
|
getCellStyles: (column: TableColumnCtx<T>, cellIndex: number) => any;
|
6
|
-
columns: any
|
6
|
+
columns: never[] | import("vue").Ref<TableColumnCtx<any>[]>;
|
7
7
|
};
|
8
8
|
export default useStyle;
|
@@ -4,6 +4,6 @@ export declare const convertToRows: <T>(originColumns: TableColumnCtx<T>[]) => T
|
|
4
4
|
declare function useUtils<T>(props: TableHeaderProps<T>): {
|
5
5
|
isGroup: import("vue").ComputedRef<boolean>;
|
6
6
|
toggleAllSelection: (event: Event) => void;
|
7
|
-
columnRows: import("vue").ComputedRef<TableColumnCtx<
|
7
|
+
columnRows: import("vue").ComputedRef<TableColumnCtx<T>[]>;
|
8
8
|
};
|
9
9
|
export default useUtils;
|