@element-plus/nightly 0.0.20251212 → 0.0.20251214
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.full.js +91 -45
- package/dist/index.full.min.js +10 -10
- 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 +91 -45
- 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/anchor/index.mjs +1 -1
- 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/backtop/index.mjs +2 -2
- package/es/components/backtop/src/backtop.mjs +53 -21
- package/es/components/backtop/src/backtop.mjs.map +1 -1
- package/es/components/backtop/src/backtop2.mjs +21 -53
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +64 -43
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +43 -64
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +23 -28
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +28 -23
- package/es/components/collapse/src/collapse2.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/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +234 -69
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +69 -234
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +19 -19
- package/es/components/input-tag/src/input-tag.mjs +1 -1
- package/es/components/menu/index.mjs +4 -4
- package/es/components/menu/src/menu-item-group.mjs +4 -33
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +33 -4
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/menu/src/menu-item.mjs +103 -15
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +15 -103
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/message/index.mjs +1 -1
- package/es/components/message/src/message.mjs +107 -168
- package/es/components/message/src/message.mjs.map +1 -1
- package/es/components/message/src/message2.mjs +168 -107
- package/es/components/message/src/message2.mjs.map +1 -1
- package/es/components/message/src/method.mjs +2 -2
- package/es/components/progress/index.mjs +2 -2
- package/es/components/progress/src/progress.mjs +53 -207
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +207 -53
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +30 -62
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +62 -30
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/scrollbar/index.mjs +3 -3
- package/es/components/scrollbar/src/bar2.mjs +1 -1
- package/es/components/scrollbar/src/scrollbar.mjs +57 -228
- package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +228 -57
- package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb.mjs +139 -11
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +11 -139
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/segmented/index.mjs +2 -2
- package/es/components/segmented/src/segmented.mjs +171 -45
- package/es/components/segmented/src/segmented.mjs.map +1 -1
- package/es/components/segmented/src/segmented2.mjs +45 -171
- package/es/components/segmented/src/segmented2.mjs.map +1 -1
- package/es/components/select/src/select.mjs +2 -2
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/steps/index.mjs +4 -4
- package/es/components/steps/src/item.mjs +198 -19
- package/es/components/steps/src/item.mjs.map +1 -1
- package/es/components/steps/src/item2.mjs +19 -198
- package/es/components/steps/src/item2.mjs.map +1 -1
- package/es/components/steps/src/steps.mjs +41 -35
- package/es/components/steps/src/steps.mjs.map +1 -1
- package/es/components/steps/src/steps2.mjs +35 -41
- package/es/components/steps/src/steps2.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +248 -75
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch.vue.d.ts +4 -0
- package/es/components/switch/src/switch2.mjs +75 -230
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/src/table-header/index.mjs +1 -0
- package/es/components/table/src/table-header/index.mjs.map +1 -1
- package/es/components/table-v2/src/components/expand-icon.d.ts +1 -0
- package/es/components/table-v2/src/components/expand-icon.mjs +9 -4
- package/es/components/table-v2/src/components/expand-icon.mjs.map +1 -1
- package/es/components/table-v2/src/components/sort-icon.d.ts +1 -0
- package/es/components/table-v2/src/components/sort-icon.mjs +6 -3
- package/es/components/table-v2/src/components/sort-icon.mjs.map +1 -1
- package/es/components/table-v2/src/renderers/cell.d.ts +2 -1
- package/es/components/table-v2/src/renderers/cell.mjs +2 -0
- package/es/components/table-v2/src/renderers/cell.mjs.map +1 -1
- package/es/components/table-v2/src/renderers/header-cell.d.ts +2 -1
- package/es/components/table-v2/src/renderers/header-cell.mjs +14 -2
- package/es/components/table-v2/src/renderers/header-cell.mjs.map +1 -1
- package/es/components/table-v2/src/table-v2.mjs +7 -1
- package/es/components/table-v2/src/table-v2.mjs.map +1 -1
- package/es/components/tabs/index.mjs +1 -1
- package/es/components/tabs/src/tab-bar.mjs +92 -11
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +11 -92
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.mjs +1 -1
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/src/tag.mjs +27 -109
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag2.mjs +109 -27
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/text/index.mjs +2 -2
- package/es/components/text/src/text.mjs +67 -21
- package/es/components/text/src/text.mjs.map +1 -1
- package/es/components/text/src/text2.mjs +21 -67
- package/es/components/text/src/text2.mjs.map +1 -1
- package/es/components/upload/index.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-dragger.mjs +60 -10
- package/es/components/upload/src/upload-dragger.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger2.mjs +10 -60
- package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
- package/es/index.mjs +19 -19
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/anchor/index.js +1 -1
- 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/backtop/index.js +2 -2
- package/lib/components/backtop/src/backtop.js +53 -22
- package/lib/components/backtop/src/backtop.js.map +1 -1
- package/lib/components/backtop/src/backtop2.js +22 -53
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +64 -43
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +43 -64
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +25 -28
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +28 -25
- package/lib/components/collapse/src/collapse2.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/image/index.js +2 -2
- package/lib/components/image/src/image.js +233 -69
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +69 -233
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +19 -19
- package/lib/components/input-tag/src/input-tag.js +1 -1
- package/lib/components/menu/index.js +4 -4
- package/lib/components/menu/src/menu-item-group.js +4 -33
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +33 -4
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/menu/src/menu-item.js +103 -16
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +16 -103
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/message/index.js +1 -1
- package/lib/components/message/src/message.js +111 -167
- package/lib/components/message/src/message.js.map +1 -1
- package/lib/components/message/src/message2.js +167 -111
- package/lib/components/message/src/message2.js.map +1 -1
- package/lib/components/message/src/method.js +2 -2
- package/lib/components/progress/index.js +2 -2
- package/lib/components/progress/src/progress.js +53 -207
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/progress/src/progress2.js +207 -53
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +32 -62
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +62 -32
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/scrollbar/index.js +3 -3
- package/lib/components/scrollbar/src/bar2.js +1 -1
- package/lib/components/scrollbar/src/scrollbar.js +58 -228
- package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +228 -58
- package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
- package/lib/components/scrollbar/src/thumb.js +139 -11
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +11 -139
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/segmented/index.js +2 -2
- package/lib/components/segmented/src/segmented.js +171 -47
- package/lib/components/segmented/src/segmented.js.map +1 -1
- package/lib/components/segmented/src/segmented2.js +47 -171
- package/lib/components/segmented/src/segmented2.js.map +1 -1
- package/lib/components/select/src/select.js +2 -2
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/steps/index.js +4 -4
- package/lib/components/steps/src/item.js +198 -19
- package/lib/components/steps/src/item.js.map +1 -1
- package/lib/components/steps/src/item2.js +19 -198
- package/lib/components/steps/src/item2.js.map +1 -1
- package/lib/components/steps/src/steps.js +41 -36
- package/lib/components/steps/src/steps.js.map +1 -1
- package/lib/components/steps/src/steps2.js +36 -41
- package/lib/components/steps/src/steps2.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +247 -75
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +4 -0
- package/lib/components/switch/src/switch2.js +75 -229
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/src/table-header/index.js +1 -0
- package/lib/components/table/src/table-header/index.js.map +1 -1
- package/lib/components/table-v2/src/components/expand-icon.d.ts +1 -0
- package/lib/components/table-v2/src/components/expand-icon.js +9 -4
- package/lib/components/table-v2/src/components/expand-icon.js.map +1 -1
- package/lib/components/table-v2/src/components/sort-icon.d.ts +1 -0
- package/lib/components/table-v2/src/components/sort-icon.js +6 -3
- package/lib/components/table-v2/src/components/sort-icon.js.map +1 -1
- package/lib/components/table-v2/src/renderers/cell.d.ts +2 -1
- package/lib/components/table-v2/src/renderers/cell.js +2 -0
- package/lib/components/table-v2/src/renderers/cell.js.map +1 -1
- package/lib/components/table-v2/src/renderers/header-cell.d.ts +2 -1
- package/lib/components/table-v2/src/renderers/header-cell.js +14 -2
- package/lib/components/table-v2/src/renderers/header-cell.js.map +1 -1
- package/lib/components/table-v2/src/table-v2.js +7 -1
- package/lib/components/table-v2/src/table-v2.js.map +1 -1
- package/lib/components/tabs/index.js +1 -1
- package/lib/components/tabs/src/tab-bar.js +92 -11
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +11 -92
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.js +1 -1
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/src/tag.js +28 -109
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag2.js +109 -28
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/text/index.js +2 -2
- package/lib/components/text/src/text.js +67 -21
- package/lib/components/text/src/text.js.map +1 -1
- package/lib/components/text/src/text2.js +21 -67
- package/lib/components/text/src/text2.js.map +1 -1
- package/lib/components/upload/index.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-dragger.js +60 -11
- package/lib/components/upload/src/upload-dragger.js.map +1 -1
- package/lib/components/upload/src/upload-dragger2.js +11 -60
- package/lib/components/upload/src/upload-dragger2.js.map +1 -1
- package/lib/index.js +19 -19
- 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/theme-chalk/el-switch.css +1 -1
- package/theme-chalk/el-table-v2.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/switch.scss +3 -2
- package/theme-chalk/src/table-v2.scss +3 -2
- package/web-types.json +1 -1
|
@@ -1,235 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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';
|
|
1
|
+
import { isValidComponentSize } from '../../../utils/vue/validator.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
4
|
+
import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
|
|
10
5
|
import { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { isBoolean } from '../../../utils/types.mjs';
|
|
6
|
+
import { isBoolean, isNumber } from '../../../utils/types.mjs';
|
|
7
|
+
import { isString } from '@vue/shared';
|
|
14
8
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
const switchProps = buildProps({
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [Boolean, String, Number],
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
14
|
+
disabled: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
loading: Boolean,
|
|
19
|
+
size: {
|
|
20
|
+
type: String,
|
|
21
|
+
validator: isValidComponentSize
|
|
22
|
+
},
|
|
23
|
+
width: {
|
|
24
|
+
type: [String, Number],
|
|
25
|
+
default: ""
|
|
26
|
+
},
|
|
27
|
+
inlinePrompt: Boolean,
|
|
28
|
+
inactiveActionIcon: {
|
|
29
|
+
type: iconPropType
|
|
30
|
+
},
|
|
31
|
+
activeActionIcon: {
|
|
32
|
+
type: iconPropType
|
|
33
|
+
},
|
|
34
|
+
activeIcon: {
|
|
35
|
+
type: iconPropType
|
|
36
|
+
},
|
|
37
|
+
inactiveIcon: {
|
|
38
|
+
type: iconPropType
|
|
39
|
+
},
|
|
40
|
+
activeText: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: ""
|
|
43
|
+
},
|
|
44
|
+
inactiveText: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ""
|
|
47
|
+
},
|
|
48
|
+
activeValue: {
|
|
49
|
+
type: [Boolean, String, Number],
|
|
50
|
+
default: true
|
|
51
|
+
},
|
|
52
|
+
inactiveValue: {
|
|
53
|
+
type: [Boolean, String, Number],
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
name: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
},
|
|
60
|
+
validateEvent: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true
|
|
63
|
+
},
|
|
64
|
+
beforeChange: {
|
|
65
|
+
type: definePropType(Function)
|
|
66
|
+
},
|
|
67
|
+
id: String,
|
|
68
|
+
tabindex: {
|
|
69
|
+
type: [String, Number]
|
|
70
|
+
},
|
|
71
|
+
...useAriaProps(["ariaLabel"])
|
|
18
72
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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(() => {
|
|
32
|
-
if (props.loading) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
return void 0;
|
|
36
|
-
}));
|
|
37
|
-
const isControlled = ref(props.modelValue !== false);
|
|
38
|
-
const input = shallowRef();
|
|
39
|
-
const switchKls = computed(() => [
|
|
40
|
-
ns.b(),
|
|
41
|
-
ns.m(switchSize.value),
|
|
42
|
-
ns.is("disabled", switchDisabled.value),
|
|
43
|
-
ns.is("checked", checked.value)
|
|
44
|
-
]);
|
|
45
|
-
const labelLeftKls = computed(() => [
|
|
46
|
-
ns.e("label"),
|
|
47
|
-
ns.em("label", "left"),
|
|
48
|
-
ns.is("active", !checked.value)
|
|
49
|
-
]);
|
|
50
|
-
const labelRightKls = computed(() => [
|
|
51
|
-
ns.e("label"),
|
|
52
|
-
ns.em("label", "right"),
|
|
53
|
-
ns.is("active", checked.value)
|
|
54
|
-
]);
|
|
55
|
-
const coreStyle = computed(() => ({
|
|
56
|
-
width: addUnit(props.width)
|
|
57
|
-
}));
|
|
58
|
-
watch(() => props.modelValue, () => {
|
|
59
|
-
isControlled.value = true;
|
|
60
|
-
});
|
|
61
|
-
const actualValue = computed(() => {
|
|
62
|
-
return isControlled.value ? props.modelValue : false;
|
|
63
|
-
});
|
|
64
|
-
const checked = computed(() => actualValue.value === props.activeValue);
|
|
65
|
-
if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
|
|
66
|
-
emit(UPDATE_MODEL_EVENT, props.inactiveValue);
|
|
67
|
-
emit(CHANGE_EVENT, props.inactiveValue);
|
|
68
|
-
emit(INPUT_EVENT, props.inactiveValue);
|
|
69
|
-
}
|
|
70
|
-
watch(checked, (val) => {
|
|
71
|
-
var _a;
|
|
72
|
-
input.value.checked = val;
|
|
73
|
-
if (props.validateEvent) {
|
|
74
|
-
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
const handleChange = () => {
|
|
78
|
-
const val = checked.value ? props.inactiveValue : props.activeValue;
|
|
79
|
-
emit(UPDATE_MODEL_EVENT, val);
|
|
80
|
-
emit(CHANGE_EVENT, val);
|
|
81
|
-
emit(INPUT_EVENT, val);
|
|
82
|
-
nextTick(() => {
|
|
83
|
-
input.value.checked = checked.value;
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
const switchValue = () => {
|
|
87
|
-
if (switchDisabled.value)
|
|
88
|
-
return;
|
|
89
|
-
const { beforeChange } = props;
|
|
90
|
-
if (!beforeChange) {
|
|
91
|
-
handleChange();
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const shouldChange = beforeChange();
|
|
95
|
-
const isPromiseOrBool = [
|
|
96
|
-
isPromise(shouldChange),
|
|
97
|
-
isBoolean(shouldChange)
|
|
98
|
-
].includes(true);
|
|
99
|
-
if (!isPromiseOrBool) {
|
|
100
|
-
throwError(COMPONENT_NAME, "beforeChange must return type `Promise<boolean>` or `boolean`");
|
|
101
|
-
}
|
|
102
|
-
if (isPromise(shouldChange)) {
|
|
103
|
-
shouldChange.then((result) => {
|
|
104
|
-
if (result) {
|
|
105
|
-
handleChange();
|
|
106
|
-
}
|
|
107
|
-
}).catch((e) => {
|
|
108
|
-
debugWarn(COMPONENT_NAME, `some error occurred: ${e}`);
|
|
109
|
-
});
|
|
110
|
-
} else if (shouldChange) {
|
|
111
|
-
handleChange();
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
const focus = () => {
|
|
115
|
-
var _a, _b;
|
|
116
|
-
(_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
117
|
-
};
|
|
118
|
-
onMounted(() => {
|
|
119
|
-
input.value.checked = checked.value;
|
|
120
|
-
});
|
|
121
|
-
expose({
|
|
122
|
-
focus,
|
|
123
|
-
checked
|
|
124
|
-
});
|
|
125
|
-
return (_ctx, _cache) => {
|
|
126
|
-
return openBlock(), createElementBlock("div", {
|
|
127
|
-
class: normalizeClass(unref(switchKls)),
|
|
128
|
-
onClick: withModifiers(switchValue, ["prevent"])
|
|
129
|
-
}, [
|
|
130
|
-
createElementVNode("input", {
|
|
131
|
-
id: unref(inputId),
|
|
132
|
-
ref_key: "input",
|
|
133
|
-
ref: input,
|
|
134
|
-
class: normalizeClass(unref(ns).e("input")),
|
|
135
|
-
type: "checkbox",
|
|
136
|
-
role: "switch",
|
|
137
|
-
"aria-checked": unref(checked),
|
|
138
|
-
"aria-disabled": unref(switchDisabled),
|
|
139
|
-
"aria-label": _ctx.ariaLabel,
|
|
140
|
-
name: _ctx.name,
|
|
141
|
-
"true-value": _ctx.activeValue,
|
|
142
|
-
"false-value": _ctx.inactiveValue,
|
|
143
|
-
disabled: unref(switchDisabled),
|
|
144
|
-
tabindex: _ctx.tabindex,
|
|
145
|
-
onChange: handleChange,
|
|
146
|
-
onKeydown: withKeys(switchValue, ["enter"])
|
|
147
|
-
}, null, 42, ["id", "aria-checked", "aria-disabled", "aria-label", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"]),
|
|
148
|
-
!_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
|
|
149
|
-
key: 0,
|
|
150
|
-
class: normalizeClass(unref(labelLeftKls))
|
|
151
|
-
}, [
|
|
152
|
-
_ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
153
|
-
default: withCtx(() => [
|
|
154
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
|
|
155
|
-
]),
|
|
156
|
-
_: 1
|
|
157
|
-
})) : createCommentVNode("v-if", true),
|
|
158
|
-
!_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
|
|
159
|
-
key: 1,
|
|
160
|
-
"aria-hidden": unref(checked)
|
|
161
|
-
}, toDisplayString(_ctx.inactiveText), 9, ["aria-hidden"])) : createCommentVNode("v-if", true)
|
|
162
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
163
|
-
createElementVNode("span", {
|
|
164
|
-
class: normalizeClass(unref(ns).e("core")),
|
|
165
|
-
style: normalizeStyle(unref(coreStyle))
|
|
166
|
-
}, [
|
|
167
|
-
_ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
|
|
168
|
-
key: 0,
|
|
169
|
-
class: normalizeClass(unref(ns).e("inner"))
|
|
170
|
-
}, [
|
|
171
|
-
_ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
|
|
172
|
-
key: 0,
|
|
173
|
-
class: normalizeClass(unref(ns).is("icon"))
|
|
174
|
-
}, {
|
|
175
|
-
default: withCtx(() => [
|
|
176
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
|
|
177
|
-
]),
|
|
178
|
-
_: 1
|
|
179
|
-
}, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
|
|
180
|
-
key: 1,
|
|
181
|
-
class: normalizeClass(unref(ns).is("text")),
|
|
182
|
-
"aria-hidden": !unref(checked)
|
|
183
|
-
}, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, ["aria-hidden"])) : createCommentVNode("v-if", true)
|
|
184
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
185
|
-
createElementVNode("div", {
|
|
186
|
-
class: normalizeClass(unref(ns).e("action"))
|
|
187
|
-
}, [
|
|
188
|
-
_ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
|
|
189
|
-
key: 0,
|
|
190
|
-
class: normalizeClass(unref(ns).is("loading"))
|
|
191
|
-
}, {
|
|
192
|
-
default: withCtx(() => [
|
|
193
|
-
createVNode(unref(Loading))
|
|
194
|
-
]),
|
|
195
|
-
_: 1
|
|
196
|
-
}, 8, ["class"])) : unref(checked) ? renderSlot(_ctx.$slots, "active-action", { key: 1 }, () => [
|
|
197
|
-
_ctx.activeActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
198
|
-
default: withCtx(() => [
|
|
199
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.activeActionIcon)))
|
|
200
|
-
]),
|
|
201
|
-
_: 1
|
|
202
|
-
})) : createCommentVNode("v-if", true)
|
|
203
|
-
]) : !unref(checked) ? renderSlot(_ctx.$slots, "inactive-action", { key: 2 }, () => [
|
|
204
|
-
_ctx.inactiveActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
205
|
-
default: withCtx(() => [
|
|
206
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveActionIcon)))
|
|
207
|
-
]),
|
|
208
|
-
_: 1
|
|
209
|
-
})) : createCommentVNode("v-if", true)
|
|
210
|
-
]) : createCommentVNode("v-if", true)
|
|
211
|
-
], 2)
|
|
212
|
-
], 6),
|
|
213
|
-
!_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
|
|
214
|
-
key: 1,
|
|
215
|
-
class: normalizeClass(unref(labelRightKls))
|
|
216
|
-
}, [
|
|
217
|
-
_ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
218
|
-
default: withCtx(() => [
|
|
219
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
|
|
220
|
-
]),
|
|
221
|
-
_: 1
|
|
222
|
-
})) : createCommentVNode("v-if", true),
|
|
223
|
-
!_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
|
|
224
|
-
key: 1,
|
|
225
|
-
"aria-hidden": !unref(checked)
|
|
226
|
-
}, toDisplayString(_ctx.activeText), 9, ["aria-hidden"])) : createCommentVNode("v-if", true)
|
|
227
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
228
|
-
], 10, ["onClick"]);
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
var Switch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "switch.vue"]]);
|
|
73
|
+
const switchEmits = {
|
|
74
|
+
[UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
|
|
75
|
+
[CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
|
|
76
|
+
[INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
|
|
77
|
+
};
|
|
233
78
|
|
|
234
|
-
export {
|
|
79
|
+
export { switchEmits, switchProps };
|
|
235
80
|
//# sourceMappingURL=switch2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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 :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, shallowRef, 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(\n computed(() => {\n if (props.loading) {\n return true\n }\n return undefined\n })\n)\nconst isControlled = ref(props.modelValue !== false)\nconst input = shallowRef<HTMLInputElement>()\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,cAAiB,GAAA,eAAA,CAAA,QAAA,CAAA,MAAA;AAAA,MACrB,SAAS,CAAM,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MACL,YAAyB,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AACvB,KAAa,CAAA;AAAA,IACf,SAAA,CAAA,MAAA;AAAA,MACF,KAAA,CAAA,KAAA,CAAA,OAAA,GAAA,OAAA,CAAA,KAAA,CAAA;AAEA,KAAA,CAAA,CAAA;AACE,IAAA,MAAA,CAAA;AAAqB,MACvB,KAAA;AAEA,MAAA,OAAA;AACE,KAAM,CAAA,CAAA;AAAyB,IACjC,OAAC,CAAA,IAAA,EAAA,MAAA,KAAA;AAED,MAAa,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;AAAA,QAAA,KAAA,EAAAC,cAAA,CAAAC,KAAA,CAAA,SAAA,CAAA,CAAA;AAAA,QAAA,OAAA,EAAAC,aAAA,CAAA,WAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,OAAA,EAAA;AAAA,QAIXC,kBAAA,CAAA,OAAA,EAAA;AAAA,UAAA,EAAA,EAAAF,KAAA,CAAA,OAAA,CAAA;AAAA,UAAA,OAAA,EAAA,OAAA;AAAA,UAAA,GAAA,EAAA,KAAA;AAAA,UAIA,KAAA,EAAAD,cAAA,CAAAC,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAA;AAAA,UACD,IAAA,EAAA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
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, __ExtractPublicPropTypes } 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: {\n type: Boolean,\n default: undefined,\n },\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>\nexport type SwitchPropsPublic = __ExtractPublicPropTypes<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;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,EAAE,oBAAoB;AACnC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,YAAY,EAAE,OAAO;AACvB,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,YAA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C,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;;;;"}
|
|
@@ -169,6 +169,7 @@ var TableHeader = defineComponent({
|
|
|
169
169
|
key: `${column.id}-thead`,
|
|
170
170
|
rowspan: column.rowSpan,
|
|
171
171
|
scope: column.colSpan > 1 ? "colgroup" : "col",
|
|
172
|
+
ariaSort: column.sortable ? column.order : void 0,
|
|
172
173
|
style: getHeaderCellStyle(rowIndex, cellIndex, subColumns, column),
|
|
173
174
|
onClick: ($event) => {
|
|
174
175
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/table/src/table-header/index.ts"],"sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n h,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useLocale } from '@element-plus/hooks/use-locale'\nimport FilterPanel from '../filter-panel.vue'\nimport useLayoutObserver from '../layout-observer'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport useEvent from './event-helper'\nimport useStyle from './style.helper'\nimport useUtils from './utils-helper'\n\nimport type TableLayout from '../table-layout'\nimport type { ComponentInternalInstance, PropType, Ref } from 'vue'\nimport type { DefaultRow, Sort } from '../table/defaults'\nimport type { Store } from '../store'\n\nexport interface TableHeader extends ComponentInternalInstance {\n state: {\n onColumnsChange: (layout: TableLayout<any>) => void\n onScrollableChange: (layout: TableLayout<any>) => void\n }\n filterPanels: Ref<DefaultRow>\n}\nexport interface TableHeaderProps<T extends DefaultRow> {\n fixed: string\n store: Store<T>\n border: boolean\n defaultSort: Sort\n allowDragLastColumn: boolean\n}\n\nexport default defineComponent({\n name: 'ElTableHeader',\n components: {\n ElCheckbox,\n },\n props: {\n fixed: {\n type: String,\n default: '',\n },\n store: {\n required: true,\n type: Object as PropType<TableHeaderProps<any>['store']>,\n },\n border: Boolean,\n defaultSort: {\n type: Object as PropType<TableHeaderProps<any>['defaultSort']>,\n default: () => {\n return {\n prop: '',\n order: '',\n }\n },\n },\n appendFilterPanelTo: {\n type: String,\n },\n allowDragLastColumn: {\n type: Boolean,\n },\n },\n setup(props, { emit }) {\n const instance = getCurrentInstance() as TableHeader\n const parent = inject(TABLE_INJECTION_KEY)\n const ns = useNamespace('table')\n const filterPanels = ref({})\n const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent!)\n\n const isTableLayoutAuto = parent?.props.tableLayout === 'auto'\n const saveIndexSelection = reactive(new Map())\n const theadRef = ref()\n\n let delayId: ReturnType<typeof setTimeout> | undefined\n const updateFixedColumnStyle = () => {\n delayId = setTimeout(() => {\n if (saveIndexSelection.size > 0) {\n saveIndexSelection.forEach((column, key) => {\n const el = theadRef.value.querySelector(\n `.${key.replace(/\\s/g, '.')}`\n )\n if (el) {\n const width = el.getBoundingClientRect().width\n column.width = width || column.width\n }\n })\n saveIndexSelection.clear()\n }\n })\n }\n\n watch(saveIndexSelection, updateFixedColumnStyle)\n onBeforeUnmount(() => {\n if (delayId) {\n clearTimeout(delayId)\n delayId = undefined\n }\n })\n\n onMounted(async () => {\n // Need double await, because updateColumns is executed after nextTick for now\n await nextTick()\n await nextTick()\n const { prop, order } = props.defaultSort\n parent?.store.commit('sort', { prop, order, init: true })\n\n updateFixedColumnStyle()\n })\n\n const {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n } = useEvent(props as TableHeaderProps<any>, emit)\n const {\n getHeaderRowStyle,\n getHeaderRowClass,\n getHeaderCellStyle,\n getHeaderCellClass,\n } = useStyle(props as TableHeaderProps<any>)\n const { isGroup, toggleAllSelection, columnRows } = useUtils(\n props as TableHeaderProps<any>\n )\n\n const { t } = useLocale()\n\n instance.state = {\n onColumnsChange,\n onScrollableChange,\n }\n instance.filterPanels = filterPanels\n\n return {\n ns,\n t,\n filterPanels,\n onColumnsChange,\n onScrollableChange,\n columnRows,\n getHeaderRowClass,\n getHeaderRowStyle,\n getHeaderCellClass,\n getHeaderCellStyle,\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n isGroup,\n toggleAllSelection,\n saveIndexSelection,\n isTableLayoutAuto,\n theadRef,\n updateFixedColumnStyle,\n }\n },\n render() {\n const {\n ns,\n t,\n isGroup,\n columnRows,\n getHeaderCellStyle,\n getHeaderCellClass,\n getHeaderRowClass,\n getHeaderRowStyle,\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleSortClick,\n handleMouseOut,\n store,\n $parent,\n saveIndexSelection,\n isTableLayoutAuto,\n } = this\n let rowSpan = 1\n return h(\n 'thead',\n {\n ref: 'theadRef',\n class: ns.is('group', isGroup),\n },\n columnRows.map((subColumns, rowIndex) =>\n h(\n 'tr',\n {\n class: getHeaderRowClass(rowIndex),\n key: rowIndex,\n style: getHeaderRowStyle(rowIndex),\n },\n subColumns.map((column, cellIndex) => {\n if (column.rowSpan > rowSpan) {\n rowSpan = column.rowSpan\n }\n const _class = getHeaderCellClass(\n rowIndex,\n cellIndex,\n subColumns,\n column\n )\n if (isTableLayoutAuto && column.fixed) {\n saveIndexSelection.set(_class, column)\n }\n return h(\n 'th',\n {\n class: _class,\n colspan: column.colSpan,\n key: `${column.id}-thead`,\n rowspan: column.rowSpan,\n scope: column.colSpan > 1 ? 'colgroup' : 'col',\n style: getHeaderCellStyle(\n rowIndex,\n cellIndex,\n subColumns,\n column\n ),\n onClick: ($event: Event) => {\n if (\n ($event.currentTarget as Element)?.classList.contains(\n 'noclick'\n )\n ) {\n return\n }\n handleHeaderClick($event, column)\n },\n onContextmenu: ($event: MouseEvent) =>\n handleHeaderContextMenu($event, column),\n onMousedown: ($event: MouseEvent) =>\n handleMouseDown($event, column),\n onMousemove: ($event: MouseEvent) =>\n handleMouseMove($event, column),\n onMouseout: handleMouseOut,\n },\n [\n h(\n 'div',\n {\n class: [\n 'cell',\n column.filteredValue && column.filteredValue.length > 0\n ? 'highlight'\n : '',\n ],\n },\n [\n column.renderHeader\n ? column.renderHeader({\n column,\n $index: cellIndex,\n store,\n _self: $parent,\n })\n : column.label,\n column.sortable &&\n h(\n 'button',\n {\n type: 'button',\n class: 'caret-wrapper',\n 'aria-label': t('el.table.sortLabel', {\n column: column.label || '',\n }),\n onClick: ($event: Event) =>\n handleSortClick($event, column),\n },\n [\n h('i', {\n onClick: ($event: Event) =>\n handleSortClick($event, column, 'ascending'),\n class: 'sort-caret ascending',\n }),\n h('i', {\n onClick: ($event: Event) =>\n handleSortClick($event, column, 'descending'),\n class: 'sort-caret descending',\n }),\n ]\n ),\n column.filterable &&\n h(\n FilterPanel as any,\n {\n store,\n placement: column.filterPlacement || 'bottom-start',\n appendTo: ($parent as any)?.appendFilterPanelTo,\n column,\n upDataColumn: (key: never, value: never) => {\n column[key] = value\n },\n },\n {\n 'filter-icon': () =>\n column.renderFilterIcon\n ? column.renderFilterIcon({\n filterOpened: column.filterOpened,\n })\n : null,\n }\n ),\n ]\n ),\n ]\n )\n })\n )\n )\n )\n },\n})\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA,kBAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,eAAe;AACvB,EAAE,UAAU,EAAE;AACd,IAAI,UAAU;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,KAAK,EAAE;AACX,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,EAAE;AACjB,KAAK;AACL,I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b,YAAY,aAAa,EAAE,MAAM,MAAM,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACnF,cAAc,YAAY,EAAE,MAAM,CAAC,YAAY;AAC/C,aAAa,CAAC,GAAG,IAAI;AACrB,WAAW,CAAC;AACZ,SAAS,CAAC;AACV,OAAO,CAAC,CAAC;AACT,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACV,GAAG;AACH,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/table/src/table-header/index.ts"],"sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n h,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useLocale } from '@element-plus/hooks/use-locale'\nimport FilterPanel from '../filter-panel.vue'\nimport useLayoutObserver from '../layout-observer'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport useEvent from './event-helper'\nimport useStyle from './style.helper'\nimport useUtils from './utils-helper'\n\nimport type TableLayout from '../table-layout'\nimport type { ComponentInternalInstance, PropType, Ref } from 'vue'\nimport type { DefaultRow, Sort } from '../table/defaults'\nimport type { Store } from '../store'\n\nexport interface TableHeader extends ComponentInternalInstance {\n state: {\n onColumnsChange: (layout: TableLayout<any>) => void\n onScrollableChange: (layout: TableLayout<any>) => void\n }\n filterPanels: Ref<DefaultRow>\n}\nexport interface TableHeaderProps<T extends DefaultRow> {\n fixed: string\n store: Store<T>\n border: boolean\n defaultSort: Sort\n allowDragLastColumn: boolean\n}\n\nexport default defineComponent({\n name: 'ElTableHeader',\n components: {\n ElCheckbox,\n },\n props: {\n fixed: {\n type: String,\n default: '',\n },\n store: {\n required: true,\n type: Object as PropType<TableHeaderProps<any>['store']>,\n },\n border: Boolean,\n defaultSort: {\n type: Object as PropType<TableHeaderProps<any>['defaultSort']>,\n default: () => {\n return {\n prop: '',\n order: '',\n }\n },\n },\n appendFilterPanelTo: {\n type: String,\n },\n allowDragLastColumn: {\n type: Boolean,\n },\n },\n setup(props, { emit }) {\n const instance = getCurrentInstance() as TableHeader\n const parent = inject(TABLE_INJECTION_KEY)\n const ns = useNamespace('table')\n const filterPanels = ref({})\n const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent!)\n\n const isTableLayoutAuto = parent?.props.tableLayout === 'auto'\n const saveIndexSelection = reactive(new Map())\n const theadRef = ref()\n\n let delayId: ReturnType<typeof setTimeout> | undefined\n const updateFixedColumnStyle = () => {\n delayId = setTimeout(() => {\n if (saveIndexSelection.size > 0) {\n saveIndexSelection.forEach((column, key) => {\n const el = theadRef.value.querySelector(\n `.${key.replace(/\\s/g, '.')}`\n )\n if (el) {\n const width = el.getBoundingClientRect().width\n column.width = width || column.width\n }\n })\n saveIndexSelection.clear()\n }\n })\n }\n\n watch(saveIndexSelection, updateFixedColumnStyle)\n onBeforeUnmount(() => {\n if (delayId) {\n clearTimeout(delayId)\n delayId = undefined\n }\n })\n\n onMounted(async () => {\n // Need double await, because updateColumns is executed after nextTick for now\n await nextTick()\n await nextTick()\n const { prop, order } = props.defaultSort\n parent?.store.commit('sort', { prop, order, init: true })\n\n updateFixedColumnStyle()\n })\n\n const {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n } = useEvent(props as TableHeaderProps<any>, emit)\n const {\n getHeaderRowStyle,\n getHeaderRowClass,\n getHeaderCellStyle,\n getHeaderCellClass,\n } = useStyle(props as TableHeaderProps<any>)\n const { isGroup, toggleAllSelection, columnRows } = useUtils(\n props as TableHeaderProps<any>\n )\n\n const { t } = useLocale()\n\n instance.state = {\n onColumnsChange,\n onScrollableChange,\n }\n instance.filterPanels = filterPanels\n\n return {\n ns,\n t,\n filterPanels,\n onColumnsChange,\n onScrollableChange,\n columnRows,\n getHeaderRowClass,\n getHeaderRowStyle,\n getHeaderCellClass,\n getHeaderCellStyle,\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n isGroup,\n toggleAllSelection,\n saveIndexSelection,\n isTableLayoutAuto,\n theadRef,\n updateFixedColumnStyle,\n }\n },\n render() {\n const {\n ns,\n t,\n isGroup,\n columnRows,\n getHeaderCellStyle,\n getHeaderCellClass,\n getHeaderRowClass,\n getHeaderRowStyle,\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleSortClick,\n handleMouseOut,\n store,\n $parent,\n saveIndexSelection,\n isTableLayoutAuto,\n } = this\n let rowSpan = 1\n return h(\n 'thead',\n {\n ref: 'theadRef',\n class: ns.is('group', isGroup),\n },\n columnRows.map((subColumns, rowIndex) =>\n h(\n 'tr',\n {\n class: getHeaderRowClass(rowIndex),\n key: rowIndex,\n style: getHeaderRowStyle(rowIndex),\n },\n subColumns.map((column, cellIndex) => {\n if (column.rowSpan > rowSpan) {\n rowSpan = column.rowSpan\n }\n const _class = getHeaderCellClass(\n rowIndex,\n cellIndex,\n subColumns,\n column\n )\n if (isTableLayoutAuto && column.fixed) {\n saveIndexSelection.set(_class, column)\n }\n return h(\n 'th',\n {\n class: _class,\n colspan: column.colSpan,\n key: `${column.id}-thead`,\n rowspan: column.rowSpan,\n scope: column.colSpan > 1 ? 'colgroup' : 'col',\n ariaSort: column.sortable ? column.order : undefined,\n style: getHeaderCellStyle(\n rowIndex,\n cellIndex,\n subColumns,\n column\n ),\n onClick: ($event: Event) => {\n if (\n ($event.currentTarget as Element)?.classList.contains(\n 'noclick'\n )\n ) {\n return\n }\n handleHeaderClick($event, column)\n },\n onContextmenu: ($event: MouseEvent) =>\n handleHeaderContextMenu($event, column),\n onMousedown: ($event: MouseEvent) =>\n handleMouseDown($event, column),\n onMousemove: ($event: MouseEvent) =>\n handleMouseMove($event, column),\n onMouseout: handleMouseOut,\n },\n [\n h(\n 'div',\n {\n class: [\n 'cell',\n column.filteredValue && column.filteredValue.length > 0\n ? 'highlight'\n : '',\n ],\n },\n [\n column.renderHeader\n ? column.renderHeader({\n column,\n $index: cellIndex,\n store,\n _self: $parent,\n })\n : column.label,\n column.sortable &&\n h(\n 'button',\n {\n type: 'button',\n class: 'caret-wrapper',\n 'aria-label': t('el.table.sortLabel', {\n column: column.label || '',\n }),\n onClick: ($event: Event) =>\n handleSortClick($event, column),\n },\n [\n h('i', {\n onClick: ($event: Event) =>\n handleSortClick($event, column, 'ascending'),\n class: 'sort-caret ascending',\n }),\n h('i', {\n onClick: ($event: Event) =>\n handleSortClick($event, column, 'descending'),\n class: 'sort-caret descending',\n }),\n ]\n ),\n column.filterable &&\n h(\n FilterPanel as any,\n {\n store,\n placement: column.filterPlacement || 'bottom-start',\n appendTo: ($parent as any)?.appendFilterPanelTo,\n column,\n upDataColumn: (key: never, value: never) => {\n column[key] = value\n },\n },\n {\n 'filter-icon': () =>\n column.renderFilterIcon\n ? column.renderFilterIcon({\n filterOpened: column.filterOpened,\n })\n : null,\n }\n ),\n ]\n ),\n ]\n )\n })\n )\n )\n )\n },\n})\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA,kBAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,eAAe;AACvB,EAAE,UAAU,EAAE;AACd,IAAI,UAAU;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,KAAK,EAAE;AACX,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,EAAE;AACjB,KAAK;AACL,IAAI,KAAK,EAAE;AACX,MAAM,QAAQ,EAAE,IAAI;AACpB,MAAM,IAAI,EAAE,MAAM;AAClB,KAAK;AACL,IAAI,MAAM,EAAE,OAAO;AACnB,IAAI,WAAW,EAAE;AACjB,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,MAAM;AACrB,QAAQ,OAAO;AACf,UAAU,IAAI,EAAE,EAAE;AACl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AAC;AACZ,SAAS,CAAC;AACV,OAAO,CAAC,CAAC;AACT,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACV,GAAG;AACH,CAAC,CAAC;;;;"}
|
|
@@ -3,6 +3,7 @@ import type { TableV2RowCellRenderParam } from './row';
|
|
|
3
3
|
declare const ExpandIcon: (props: TableV2RowCellRenderParam["expandIconProps"] & {
|
|
4
4
|
class?: string | string[];
|
|
5
5
|
style: StyleValue;
|
|
6
|
+
ariaLabel?: string;
|
|
6
7
|
size: number;
|
|
7
8
|
expanded: boolean;
|
|
8
9
|
expandable: boolean;
|
|
@@ -8,18 +8,23 @@ const ExpandIcon = (props) => {
|
|
|
8
8
|
expandable,
|
|
9
9
|
onExpand,
|
|
10
10
|
style,
|
|
11
|
-
size
|
|
11
|
+
size,
|
|
12
|
+
ariaLabel
|
|
12
13
|
} = props;
|
|
13
14
|
const expandIconProps = {
|
|
14
15
|
onClick: expandable ? () => onExpand(!expanded) : void 0,
|
|
16
|
+
ariaLabel,
|
|
17
|
+
ariaExpanded: expanded,
|
|
15
18
|
class: props.class
|
|
16
19
|
};
|
|
17
|
-
return createVNode(
|
|
20
|
+
return createVNode("button", mergeProps(expandIconProps, {
|
|
21
|
+
"type": "button"
|
|
22
|
+
}), [createVNode(ElIcon, {
|
|
18
23
|
"size": size,
|
|
19
24
|
"style": style
|
|
20
|
-
}
|
|
25
|
+
}, {
|
|
21
26
|
default: () => [createVNode(ArrowRight, null, null)]
|
|
22
|
-
});
|
|
27
|
+
})]);
|
|
23
28
|
};
|
|
24
29
|
var ExpandIcon$1 = ExpandIcon;
|
|
25
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expand-icon.mjs","sources":["../../../../../../../packages/components/table-v2/src/components/expand-icon.tsx"],"sourcesContent":["import ElIcon from '@element-plus/components/icon'\nimport { ArrowRight } from '@element-plus/icons-vue'\n\nimport type { StyleValue } from 'vue'\nimport type { TableV2RowCellRenderParam } from './row'\n\nconst ExpandIcon = (\n props: TableV2RowCellRenderParam['expandIconProps'] & {\n class?: string | string[]\n style: StyleValue\n size: number\n expanded: boolean\n expandable: boolean\n }\n) => {\n const { expanded, expandable, onExpand, style, size } = props\n\n const expandIconProps = {\n onClick: expandable ? () => onExpand(!expanded) : undefined,\n class: props.class,\n } as any\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"expand-icon.mjs","sources":["../../../../../../../packages/components/table-v2/src/components/expand-icon.tsx"],"sourcesContent":["import ElIcon from '@element-plus/components/icon'\nimport { ArrowRight } from '@element-plus/icons-vue'\n\nimport type { StyleValue } from 'vue'\nimport type { TableV2RowCellRenderParam } from './row'\n\nconst ExpandIcon = (\n props: TableV2RowCellRenderParam['expandIconProps'] & {\n class?: string | string[]\n style: StyleValue\n ariaLabel?: string\n size: number\n expanded: boolean\n expandable: boolean\n }\n) => {\n const { expanded, expandable, onExpand, style, size, ariaLabel } = props\n\n const expandIconProps = {\n onClick: expandable ? () => onExpand(!expanded) : undefined,\n ariaLabel,\n ariaExpanded: expanded,\n class: props.class,\n } as any\n\n return (\n <button {...expandIconProps} type=\"button\">\n <ElIcon size={size} style={style}>\n <ArrowRight />\n </ElIcon>\n </button>\n )\n}\n\nexport default ExpandIcon\n\nexport type ExpandIconInstance = ReturnType<typeof ExpandIcon>\n"],"names":["ExpandIcon","expanded","expandable","onExpand","style","size","ariaLabel","onClick","ariaExpanded","class","_createVNode","_mergeProps"],"mappings":";;;;;AAMA,EAAMA,MAAAA;IAUE,QAAA;IAAEC,UAAF;IAAYC,QAAZ;IAAwBC,KAAxB;IAAkCC,IAAlC;IAAyCC,SAAzC;AAA+CC,GAAAA,GAAAA,KAAAA,CAAAA;AAA/C,EAAA,MAAN,eAAA,GAAA;AAEA,IAAA,mBAAqB,GAAG,MAAA,QAAA,CAAA,CAAA,QAAA,CAAA,GAAA,KAAA,CAAA;IACtBC,SAASL;IACTI,YAFsB,EAAA,QAAA;AAGtBE,IAAAA,KAAAA,EAAAA,KAAY,MAHU;IAItBC;EAJsB,OAAxBC,WAAA,CAAA,QAAA,EAAAC,UAAA,CAAA,eAAA,EAAA;AAOA,IAAA,MAAA,EAAA,QAAA;IAAA,EACoC,CAAAD,WAAA,CAAA,MAAA,EAAA;AADpC,IAAA,MAAA,EAAA,IAAA;AAAA,IAAA,OAAA,EAAA,KAAA;KAE+BN;AAF/B,IAAA,OAAA,EAAA,MAAA,CAAAM,WAAA,CAAA,UAAA,EAAA,IAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOD,mBA1BD,UAAA;;;;"}
|
|
@@ -2,6 +2,7 @@ import { SortOrder } from '../constants';
|
|
|
2
2
|
import type { FunctionalComponent } from 'vue';
|
|
3
3
|
export type SortIconProps = {
|
|
4
4
|
sortOrder: SortOrder;
|
|
5
|
+
ariaLabel?: string;
|
|
5
6
|
class?: JSX.IntrinsicAttributes['class'];
|
|
6
7
|
};
|
|
7
8
|
declare const SortIcon: FunctionalComponent<SortIconProps>;
|
|
@@ -7,12 +7,15 @@ const SortIcon = (props) => {
|
|
|
7
7
|
const {
|
|
8
8
|
sortOrder
|
|
9
9
|
} = props;
|
|
10
|
-
return createVNode(
|
|
11
|
-
"
|
|
10
|
+
return createVNode("button", {
|
|
11
|
+
"type": "button",
|
|
12
|
+
"aria-label": props.ariaLabel,
|
|
12
13
|
"class": props.class
|
|
14
|
+
}, [createVNode(ElIcon, {
|
|
15
|
+
"size": 14
|
|
13
16
|
}, {
|
|
14
17
|
default: () => [sortOrder === SortOrder.ASC ? createVNode(SortUp, null, null) : createVNode(SortDown, null, null)]
|
|
15
|
-
});
|
|
18
|
+
})]);
|
|
16
19
|
};
|
|
17
20
|
var SortIcon$1 = SortIcon;
|
|
18
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-icon.mjs","sources":["../../../../../../../packages/components/table-v2/src/components/sort-icon.tsx"],"sourcesContent":["import ElIcon from '@element-plus/components/icon'\nimport { SortDown, SortUp } from '@element-plus/icons-vue'\nimport { SortOrder } from '../constants'\n\nimport type { FunctionalComponent } from 'vue'\n\nexport type SortIconProps = {\n sortOrder: SortOrder\n class?: JSX.IntrinsicAttributes['class']\n}\n\nconst SortIcon: FunctionalComponent<SortIconProps> = (props) => {\n const { sortOrder } = props\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"sort-icon.mjs","sources":["../../../../../../../packages/components/table-v2/src/components/sort-icon.tsx"],"sourcesContent":["import ElIcon from '@element-plus/components/icon'\nimport { SortDown, SortUp } from '@element-plus/icons-vue'\nimport { SortOrder } from '../constants'\n\nimport type { FunctionalComponent } from 'vue'\n\nexport type SortIconProps = {\n sortOrder: SortOrder\n ariaLabel?: string\n class?: JSX.IntrinsicAttributes['class']\n}\n\nconst SortIcon: FunctionalComponent<SortIconProps> = (props) => {\n const { sortOrder } = props\n\n return (\n <button type=\"button\" aria-label={props.ariaLabel} class={props.class}>\n <ElIcon size={14}>\n {sortOrder === SortOrder.ASC ? <SortUp /> : <SortDown />}\n </ElIcon>\n </button>\n )\n}\n\nexport default SortIcon\n"],"names":["SortIcon","sortOrder","_createVNode","props","ariaLabel","class"],"mappings":";;;;;;AAYA,EAAMA,MAAAA;IACE,SAAA;AAAEC,GAAAA,GAAAA,KAAAA,CAAAA;AAAF,EAAA,OAANC,WAAA,CAAA,QAAA,EAAA;AAEA,IAAA,MAAA,EAAA,QAAA;AAAA,IAAA,YAAA,EAAA,KAAA,CAAA,SAAA;IAAA,OACoCC,EAAAA,KAAAA,CAAAA,KAAMC;AAD1C,GAAA,EAAA,CAAAF,WACiE,CAACG,MAAAA,EAAAA;AADlE,IAAA,MAAA,EAAA,EAAA;KAEkB;AAFlB,IAAA,OAAA,EAAA,MAAA,CAAA,SAAA,KAAA,SAAA,CAAA,GAAA,GAAAH,WAAA,CAAA,MAAA,EAAA,IAAA,EAAA,IAAA,CAAA,GAAAA,WAAA,CAAA,QAAA,EAAA,IAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOD,iBAVD,QAAA;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { FunctionalComponent, UnwrapNestedRefs } from 'vue';
|
|
2
2
|
import type { TableV2RowCellRenderParam } from '../components';
|
|
3
|
-
import type { UseNamespaceReturn } from '@element-plus/nightly/es/hooks';
|
|
3
|
+
import type { Translator, UseNamespaceReturn } from '@element-plus/nightly/es/hooks';
|
|
4
4
|
import type { UseTableReturn } from '../use-table';
|
|
5
5
|
import type { TableV2Props } from '../table';
|
|
6
6
|
type CellRendererProps = TableV2RowCellRenderParam & Pick<TableV2Props, 'cellProps' | 'expandColumnKey' | 'indentSize' | 'iconSize' | 'rowKey'> & UnwrapNestedRefs<Pick<UseTableReturn, 'expandedRowKeys'>> & {
|
|
7
7
|
ns: UseNamespaceReturn;
|
|
8
|
+
t: Translator;
|
|
8
9
|
};
|
|
9
10
|
declare const CellRenderer: FunctionalComponent<CellRendererProps>;
|
|
10
11
|
export default CellRenderer;
|
|
@@ -19,6 +19,7 @@ const CellRenderer = ({
|
|
|
19
19
|
style,
|
|
20
20
|
expandedRowKeys,
|
|
21
21
|
ns,
|
|
22
|
+
t,
|
|
22
23
|
cellProps: _cellProps,
|
|
23
24
|
expandColumnKey,
|
|
24
25
|
indentSize,
|
|
@@ -77,6 +78,7 @@ const CellRenderer = ({
|
|
|
77
78
|
"class": [ns.e("expand-icon"), ns.is("expanded", expanded)],
|
|
78
79
|
"size": iconSize,
|
|
79
80
|
"expanded": expanded,
|
|
81
|
+
"ariaLabel": t(expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"),
|
|
80
82
|
"style": iconStyle,
|
|
81
83
|
"expandable": true
|
|
82
84
|
}), null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.mjs","sources":["../../../../../../../packages/components/table-v2/src/renderers/cell.tsx"],"sourcesContent":["import { renderSlot } from 'vue'\nimport { get } from 'lodash-unified'\nimport { isFunction, isObject } from '@element-plus/utils'\nimport { ExpandIcon, TableCell } from '../components'\nimport { Alignment } from '../constants'\nimport { placeholderSign } from '../private'\nimport { componentToSlot, enforceUnit, tryCall } from '../utils'\n\nimport type { FunctionalComponent, UnwrapNestedRefs, VNode } from 'vue'\nimport type { TableV2RowCellRenderParam } from '../components'\nimport type { UseNamespaceReturn } from '@element-plus/hooks'\nimport type { UseTableReturn } from '../use-table'\nimport type { TableV2Props } from '../table'\n\ntype CellRendererProps = TableV2RowCellRenderParam &\n Pick<\n TableV2Props,\n 'cellProps' | 'expandColumnKey' | 'indentSize' | 'iconSize' | 'rowKey'\n > &\n UnwrapNestedRefs<Pick<UseTableReturn, 'expandedRowKeys'>> & {\n ns: UseNamespaceReturn\n }\n\nconst CellRenderer: FunctionalComponent<CellRendererProps> = (\n {\n // renderer props\n columns,\n column,\n columnIndex,\n depth,\n expandIconProps,\n isScrolling,\n rowData,\n rowIndex,\n // from use-table\n style,\n expandedRowKeys,\n ns,\n // derived props\n cellProps: _cellProps,\n expandColumnKey,\n indentSize,\n iconSize,\n rowKey,\n },\n { slots }\n) => {\n const cellStyle = enforceUnit(style)\n\n if (column.placeholderSign === placeholderSign) {\n return <div class={ns.em('row-cell', 'placeholder')} style={cellStyle} />\n }\n const { cellRenderer, dataKey, dataGetter } = column\n\n const cellData = isFunction(dataGetter)\n ? dataGetter({ columns, column, columnIndex, rowData, rowIndex })\n : get(rowData, dataKey ?? '')\n\n const extraCellProps = tryCall(_cellProps, {\n cellData,\n columns,\n column,\n columnIndex,\n rowIndex,\n rowData,\n })\n\n const cellProps = {\n class: ns.e('cell-text'),\n columns,\n column,\n columnIndex,\n cellData,\n isScrolling,\n rowData,\n rowIndex,\n }\n const columnCellRenderer = componentToSlot<typeof cellProps>(cellRenderer)\n const Cell = columnCellRenderer\n ? columnCellRenderer(cellProps)\n : renderSlot(slots, 'default', cellProps, () => [\n <TableCell {...cellProps}></TableCell>,\n ])\n\n const kls = [\n ns.e('row-cell'),\n column.class,\n column.align === Alignment.CENTER && ns.is('align-center'),\n column.align === Alignment.RIGHT && ns.is('align-right'),\n ]\n\n const expandable =\n rowIndex >= 0 && expandColumnKey && column.key === expandColumnKey\n const expanded = rowIndex >= 0 && expandedRowKeys.includes(rowData[rowKey])\n\n let IconOrPlaceholder: VNode | undefined\n const iconStyle = `margin-inline-start: ${depth * indentSize}px;`\n if (expandable) {\n if (isObject(expandIconProps)) {\n IconOrPlaceholder = (\n <ExpandIcon\n {...expandIconProps}\n class={[ns.e('expand-icon'), ns.is('expanded', expanded)]}\n size={iconSize}\n expanded={expanded}\n style={iconStyle}\n expandable\n />\n )\n } else {\n IconOrPlaceholder = (\n <div\n style={[\n iconStyle,\n `width: ${iconSize}px; height: ${iconSize}px;`,\n ].join(' ')}\n />\n )\n }\n }\n\n return (\n <div class={kls} style={cellStyle} {...extraCellProps} role=\"cell\">\n {IconOrPlaceholder}\n {Cell}\n </div>\n )\n}\n\nCellRenderer.inheritAttrs = false\n\nexport default CellRenderer\n"],"names":["CellRenderer","columns","column","columnIndex","depth","expandIconProps","isScrolling","rowData","rowIndex","style","expandedRowKeys","ns","cellProps","indentSize","rowKey","slots","cellStyle","cellRenderer","dataKey","dataGetter","cellData","class","_createVNode","columnCellRenderer","Cell","kls","expandColumnKey","_mergeProps","expanded","includes","iconStyle","isObject","IconOrPlaceholder"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cell.mjs","sources":["../../../../../../../packages/components/table-v2/src/renderers/cell.tsx"],"sourcesContent":["import { renderSlot } from 'vue'\nimport { get } from 'lodash-unified'\nimport { isFunction, isObject } from '@element-plus/utils'\nimport { ExpandIcon, TableCell } from '../components'\nimport { Alignment } from '../constants'\nimport { placeholderSign } from '../private'\nimport { componentToSlot, enforceUnit, tryCall } from '../utils'\n\nimport type { FunctionalComponent, UnwrapNestedRefs, VNode } from 'vue'\nimport type { TableV2RowCellRenderParam } from '../components'\nimport type { Translator, UseNamespaceReturn } from '@element-plus/hooks'\nimport type { UseTableReturn } from '../use-table'\nimport type { TableV2Props } from '../table'\n\ntype CellRendererProps = TableV2RowCellRenderParam &\n Pick<\n TableV2Props,\n 'cellProps' | 'expandColumnKey' | 'indentSize' | 'iconSize' | 'rowKey'\n > &\n UnwrapNestedRefs<Pick<UseTableReturn, 'expandedRowKeys'>> & {\n ns: UseNamespaceReturn\n t: Translator\n }\n\nconst CellRenderer: FunctionalComponent<CellRendererProps> = (\n {\n // renderer props\n columns,\n column,\n columnIndex,\n depth,\n expandIconProps,\n isScrolling,\n rowData,\n rowIndex,\n // from use-table\n style,\n expandedRowKeys,\n ns,\n t,\n // derived props\n cellProps: _cellProps,\n expandColumnKey,\n indentSize,\n iconSize,\n rowKey,\n },\n { slots }\n) => {\n const cellStyle = enforceUnit(style)\n\n if (column.placeholderSign === placeholderSign) {\n return <div class={ns.em('row-cell', 'placeholder')} style={cellStyle} />\n }\n const { cellRenderer, dataKey, dataGetter } = column\n\n const cellData = isFunction(dataGetter)\n ? dataGetter({ columns, column, columnIndex, rowData, rowIndex })\n : get(rowData, dataKey ?? '')\n\n const extraCellProps = tryCall(_cellProps, {\n cellData,\n columns,\n column,\n columnIndex,\n rowIndex,\n rowData,\n })\n\n const cellProps = {\n class: ns.e('cell-text'),\n columns,\n column,\n columnIndex,\n cellData,\n isScrolling,\n rowData,\n rowIndex,\n }\n const columnCellRenderer = componentToSlot<typeof cellProps>(cellRenderer)\n const Cell = columnCellRenderer\n ? columnCellRenderer(cellProps)\n : renderSlot(slots, 'default', cellProps, () => [\n <TableCell {...cellProps}></TableCell>,\n ])\n\n const kls = [\n ns.e('row-cell'),\n column.class,\n column.align === Alignment.CENTER && ns.is('align-center'),\n column.align === Alignment.RIGHT && ns.is('align-right'),\n ]\n\n const expandable =\n rowIndex >= 0 && expandColumnKey && column.key === expandColumnKey\n const expanded = rowIndex >= 0 && expandedRowKeys.includes(rowData[rowKey])\n\n let IconOrPlaceholder: VNode | undefined\n const iconStyle = `margin-inline-start: ${depth * indentSize}px;`\n if (expandable) {\n if (isObject(expandIconProps)) {\n IconOrPlaceholder = (\n <ExpandIcon\n {...expandIconProps}\n class={[ns.e('expand-icon'), ns.is('expanded', expanded)]}\n size={iconSize}\n expanded={expanded}\n ariaLabel={t(\n expanded ? 'el.table.collapseRowLabel' : 'el.table.expandRowLabel'\n )}\n style={iconStyle}\n expandable\n />\n )\n } else {\n IconOrPlaceholder = (\n <div\n style={[\n iconStyle,\n `width: ${iconSize}px; height: ${iconSize}px;`,\n ].join(' ')}\n />\n )\n }\n }\n\n return (\n <div class={kls} style={cellStyle} {...extraCellProps} role=\"cell\">\n {IconOrPlaceholder}\n {Cell}\n </div>\n )\n}\n\nCellRenderer.inheritAttrs = false\n\nexport default CellRenderer\n"],"names":["CellRenderer","columns","column","columnIndex","depth","expandIconProps","isScrolling","rowData","rowIndex","style","expandedRowKeys","ns","t","cellProps","indentSize","rowKey","slots","cellStyle","cellRenderer","dataKey","dataGetter","cellData","class","_createVNode","columnCellRenderer","Cell","kls","expandColumnKey","_mergeProps","expanded","includes","iconStyle","isObject","IconOrPlaceholder"],"mappings":";;;;;;;;;;AAwBA,EAAMA,OAAAA;AAEF,EAAA,MAAA;EACAC,WAFF;EAGEC,KAHF;EAIEC,eAJF;EAKEC,WALF;EAMEC,OANF;EAOEC,QAPF;EAQEC,KARF;EASEC,eATF;AAUE,EAAA,EAAA;EACAC,CAXF;EAYEC,SAZF,EAAA,UAAA;EAaEC,eAbF;EAcEC,UAdF;AAeE,EAAA,QAAA;AACAC,EAAAA,MAAAA;GAhBF;EAkBEC,KAlBF;MAAA;AAoBEC,EAAAA,MAAAA,SAAAA,GAAAA,WAAAA,CAAAA,KAAAA,CAAAA,CAAAA;AApBF,EAsBA,IAAA,MAAA,CAAA,eAAA,KAAA,eAAA,EAAA;AAAEC,IAAAA,OAAAA,WAAAA,CAAAA,KAAAA,EAAAA;AAAF,MACG,OAAA,EAAA,EAA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AA,YAAA;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { FunctionalComponent, UnwrapNestedRefs } from 'vue';
|
|
2
|
-
import type { UseNamespaceReturn } from '@element-plus/nightly/es/hooks';
|
|
2
|
+
import type { Translator, UseNamespaceReturn } from '@element-plus/nightly/es/hooks';
|
|
3
3
|
import type { TableV2HeaderRowCellRendererParams } from '../components';
|
|
4
4
|
import type { UseTableReturn } from '../use-table';
|
|
5
5
|
import type { TableV2Props } from '../table';
|
|
6
6
|
export type HeaderCellRendererProps = TableV2HeaderRowCellRendererParams & UnwrapNestedRefs<Pick<UseTableReturn, 'onColumnSorted'>> & Pick<TableV2Props, 'sortBy' | 'sortState' | 'headerCellProps'> & {
|
|
7
7
|
ns: UseNamespaceReturn;
|
|
8
|
+
t: Translator;
|
|
8
9
|
};
|
|
9
10
|
declare const HeaderCellRenderer: FunctionalComponent<HeaderCellRendererProps>;
|
|
10
11
|
export default HeaderCellRenderer;
|