element-plus 2.10.1 → 2.10.2
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.css +1 -1
- package/dist/index.full.js +188 -161
- package/dist/index.full.min.js +16 -16
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +16 -16
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +188 -161
- 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 +6 -6
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.js.map +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.min.mjs.map +1 -1
- package/dist/locale/ru.mjs +6 -6
- 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/autocomplete/index.mjs +2 -2
- package/es/components/autocomplete/src/autocomplete.mjs +370 -80
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete2.mjs +80 -370
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/badge/index.mjs +2 -2
- package/es/components/badge/src/badge.mjs +32 -71
- package/es/components/badge/src/badge.mjs.map +1 -1
- package/es/components/badge/src/badge2.mjs +71 -32
- package/es/components/badge/src/badge2.mjs.map +1 -1
- package/es/components/calendar/index.mjs +2 -2
- package/es/components/calendar/src/calendar.mjs +134 -16
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +16 -134
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/card/index.mjs +2 -2
- package/es/components/card/src/card.mjs +22 -42
- package/es/components/card/src/card.mjs.map +1 -1
- package/es/components/card/src/card2.mjs +42 -22
- package/es/components/card/src/card2.mjs.map +1 -1
- package/es/components/cascader/src/cascader.d.ts +6 -0
- package/es/components/cascader/src/cascader.mjs +4 -1
- package/es/components/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader.vue.d.ts +12 -0
- package/es/components/cascader/src/cascader2.mjs +31 -26
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +14 -38
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +38 -14
- package/es/components/check-tag/src/check-tag2.mjs.map +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 +28 -23
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +23 -28
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/date-picker/src/composables/use-range-picker.d.ts +2 -1
- package/es/components/date-picker/src/composables/use-range-picker.mjs +2 -0
- package/es/components/date-picker/src/composables/use-range-picker.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -2
- package/es/components/date-picker/src/date-picker-com/panel-month-range.mjs +9 -2
- package/es/components/date-picker/src/date-picker-com/panel-month-range.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-month-range.vue.d.ts +3 -0
- package/es/components/date-picker/src/date-picker-com/panel-year-range.mjs +77 -107
- package/es/components/date-picker/src/date-picker-com/panel-year-range.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-year-range.vue.d.ts +3 -0
- package/es/components/date-picker/src/panel-utils.d.ts +12 -5
- package/es/components/date-picker/src/props/panel-date-range.d.ts +1 -1
- package/es/components/date-picker/src/props/panel-date-range.mjs +1 -2
- package/es/components/date-picker/src/props/panel-date-range.mjs.map +1 -1
- package/es/components/date-picker/src/props/panel-month-range.d.ts +1 -0
- package/es/components/date-picker/src/props/panel-year-range.d.ts +1 -0
- package/es/components/date-picker/src/props/shared.d.ts +1 -0
- package/es/components/date-picker/src/props/shared.mjs +1 -0
- package/es/components/date-picker/src/props/shared.mjs.map +1 -1
- package/es/components/date-picker/src/utils.d.ts +2 -1
- package/es/components/date-picker/src/utils.mjs +5 -5
- package/es/components/date-picker/src/utils.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/index.mjs +2 -2
- package/es/components/dialog/src/dialog.mjs +68 -172
- package/es/components/dialog/src/dialog.mjs.map +1 -1
- package/es/components/dialog/src/dialog2.mjs +172 -68
- package/es/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/components/drawer/src/drawer.mjs +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 +2 -2
- package/es/components/form/src/form-item2.mjs +5 -3
- package/es/components/form/src/form-item2.mjs.map +1 -1
- package/es/components/form/src/form.mjs +161 -54
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form.vue.d.ts +7 -1
- package/es/components/form/src/form2.mjs +54 -160
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/form/src/types.d.ts +3 -1
- package/es/components/form/src/utils.mjs +3 -2
- package/es/components/form/src/utils.mjs.map +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +226 -68
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +68 -226
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +25 -25
- package/es/components/input-tag/src/input-tag.mjs +1 -1
- package/es/components/mention/src/mention-dropdown.mjs +166 -15
- package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown2.mjs +15 -166
- package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +1 -1
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +114 -45
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +45 -114
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popper/index.mjs +4 -4
- package/es/components/popper/src/popper.mjs +32 -22
- package/es/components/popper/src/popper.mjs.map +1 -1
- package/es/components/popper/src/popper2.mjs +22 -32
- package/es/components/popper/src/popper2.mjs.map +1 -1
- package/es/components/popper/src/trigger.mjs +31 -127
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs +127 -31
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +62 -30
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +30 -62
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +7 -1
- 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 +168 -42
- package/es/components/segmented/src/segmented.mjs.map +1 -1
- package/es/components/segmented/src/segmented2.mjs +42 -168
- package/es/components/segmented/src/segmented2.mjs.map +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select/src/select2.mjs +45 -15
- package/es/components/select/src/select2.mjs.map +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton-item.mjs +22 -17
- package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +17 -22
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +1 -1
- package/es/components/splitter/index.mjs +2 -2
- package/es/components/splitter/src/split-panel.mjs +19 -153
- package/es/components/splitter/src/split-panel.mjs.map +1 -1
- package/es/components/splitter/src/split-panel2.mjs +153 -19
- package/es/components/splitter/src/split-panel2.mjs.map +1 -1
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/src/tag.mjs +27 -99
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag2.mjs +99 -27
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/teleport/index.mjs +2 -2
- package/es/components/teleport/src/teleport.mjs +8 -18
- package/es/components/teleport/src/teleport.mjs.map +1 -1
- package/es/components/teleport/src/teleport2.mjs +18 -8
- package/es/components/teleport/src/teleport2.mjs.map +1 -1
- package/es/components/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-select2.mjs +132 -54
- package/es/components/time-select/src/time-select2.mjs.map +1 -1
- package/es/components/timeline/index.mjs +2 -2
- package/es/components/timeline/src/timeline-item.mjs +33 -72
- package/es/components/timeline/src/timeline-item.mjs.map +1 -1
- package/es/components/timeline/src/timeline-item2.mjs +72 -33
- package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
- package/es/components/tooltip/src/content.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/trigger.mjs +1 -1
- package/es/components/tooltip/src/trigger2.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +1 -1
- package/es/components/tooltip-v2/src/content.mjs +110 -48
- package/es/components/tooltip-v2/src/content.mjs.map +1 -1
- package/es/components/tooltip-v2/src/content2.mjs +48 -110
- package/es/components/tooltip-v2/src/content2.mjs.map +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/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/tour/src/tour.mjs +1 -1
- package/es/components/transfer/index.mjs +2 -2
- package/es/components/transfer/src/composables/use-check.mjs +1 -1
- package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +130 -19
- package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel2.mjs +19 -130
- package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
- package/es/components/transfer/src/transfer.mjs +68 -164
- package/es/components/transfer/src/transfer.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +164 -68
- package/es/components/transfer/src/transfer2.mjs.map +1 -1
- package/es/components/watermark/index.mjs +2 -2
- package/es/components/watermark/src/watermark.mjs +27 -220
- package/es/components/watermark/src/watermark.mjs.map +1 -1
- package/es/components/watermark/src/watermark2.mjs +220 -27
- package/es/components/watermark/src/watermark2.mjs.map +1 -1
- package/es/hooks/use-focus-controller/index.mjs +3 -2
- package/es/hooks/use-focus-controller/index.mjs.map +1 -1
- package/es/index.d.ts +27 -1
- package/es/index.mjs +25 -25
- package/es/locale/lang/ru.mjs +5 -5
- package/es/locale/lang/ru.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/index.js +2 -2
- package/lib/components/autocomplete/src/autocomplete.js +368 -79
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete2.js +79 -368
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/badge/index.js +2 -2
- package/lib/components/badge/src/badge.js +32 -71
- package/lib/components/badge/src/badge.js.map +1 -1
- package/lib/components/badge/src/badge2.js +71 -32
- package/lib/components/badge/src/badge2.js.map +1 -1
- package/lib/components/calendar/index.js +2 -2
- package/lib/components/calendar/src/calendar.js +134 -17
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +17 -134
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/card/index.js +2 -2
- package/lib/components/card/src/card.js +22 -42
- package/lib/components/card/src/card.js.map +1 -1
- package/lib/components/card/src/card2.js +42 -22
- package/lib/components/card/src/card2.js.map +1 -1
- package/lib/components/cascader/src/cascader.d.ts +6 -0
- package/lib/components/cascader/src/cascader.js +4 -1
- package/lib/components/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader.vue.d.ts +12 -0
- package/lib/components/cascader/src/cascader2.js +37 -32
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +15 -38
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +38 -15
- package/lib/components/check-tag/src/check-tag2.js.map +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 +28 -25
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +25 -28
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/date-picker/src/composables/use-range-picker.d.ts +2 -1
- package/lib/components/date-picker/src/composables/use-range-picker.js +2 -0
- package/lib/components/date-picker/src/composables/use-range-picker.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -2
- package/lib/components/date-picker/src/date-picker-com/panel-month-range.js +8 -1
- package/lib/components/date-picker/src/date-picker-com/panel-month-range.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-month-range.vue.d.ts +3 -0
- package/lib/components/date-picker/src/date-picker-com/panel-year-range.js +79 -109
- package/lib/components/date-picker/src/date-picker-com/panel-year-range.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-year-range.vue.d.ts +3 -0
- package/lib/components/date-picker/src/panel-utils.d.ts +12 -5
- package/lib/components/date-picker/src/props/panel-date-range.d.ts +1 -1
- package/lib/components/date-picker/src/props/panel-date-range.js +1 -2
- package/lib/components/date-picker/src/props/panel-date-range.js.map +1 -1
- package/lib/components/date-picker/src/props/panel-month-range.d.ts +1 -0
- package/lib/components/date-picker/src/props/panel-year-range.d.ts +1 -0
- package/lib/components/date-picker/src/props/shared.d.ts +1 -0
- package/lib/components/date-picker/src/props/shared.js +1 -0
- package/lib/components/date-picker/src/props/shared.js.map +1 -1
- package/lib/components/date-picker/src/utils.d.ts +2 -1
- package/lib/components/date-picker/src/utils.js +5 -5
- package/lib/components/date-picker/src/utils.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/index.js +2 -2
- package/lib/components/dialog/src/dialog.js +69 -172
- package/lib/components/dialog/src/dialog.js.map +1 -1
- package/lib/components/dialog/src/dialog2.js +172 -69
- package/lib/components/dialog/src/dialog2.js.map +1 -1
- package/lib/components/drawer/src/drawer.js +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 +2 -2
- package/lib/components/form/src/form-item2.js +4 -2
- package/lib/components/form/src/form-item2.js.map +1 -1
- package/lib/components/form/src/form.js +160 -55
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form.vue.d.ts +7 -1
- package/lib/components/form/src/form2.js +55 -159
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/form/src/types.d.ts +3 -1
- package/lib/components/form/src/utils.js +3 -2
- package/lib/components/form/src/utils.js.map +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.js +225 -68
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +68 -225
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +25 -25
- package/lib/components/input-tag/src/input-tag.js +1 -1
- package/lib/components/mention/src/mention-dropdown.js +166 -16
- package/lib/components/mention/src/mention-dropdown.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown2.js +16 -166
- package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
- package/lib/components/mention/src/mention2.js +1 -1
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +114 -46
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +46 -114
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popper/index.js +4 -4
- package/lib/components/popper/src/popper.js +32 -25
- package/lib/components/popper/src/popper.js.map +1 -1
- package/lib/components/popper/src/popper2.js +25 -32
- package/lib/components/popper/src/popper2.js.map +1 -1
- package/lib/components/popper/src/trigger.js +32 -127
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger2.js +127 -32
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +62 -32
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +32 -62
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +7 -1
- 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 +168 -44
- package/lib/components/segmented/src/segmented.js.map +1 -1
- package/lib/components/segmented/src/segmented2.js +44 -168
- package/lib/components/segmented/src/segmented2.js.map +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select/src/select2.js +44 -14
- package/lib/components/select/src/select2.js.map +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton-item.js +22 -17
- package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item2.js +17 -22
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +1 -1
- package/lib/components/splitter/index.js +2 -2
- package/lib/components/splitter/src/split-panel.js +19 -153
- package/lib/components/splitter/src/split-panel.js.map +1 -1
- package/lib/components/splitter/src/split-panel2.js +153 -19
- package/lib/components/splitter/src/split-panel2.js.map +1 -1
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/src/tag.js +28 -99
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag2.js +99 -28
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/teleport/index.js +2 -2
- package/lib/components/teleport/src/teleport.js +8 -18
- package/lib/components/teleport/src/teleport.js.map +1 -1
- package/lib/components/teleport/src/teleport2.js +18 -8
- package/lib/components/teleport/src/teleport2.js.map +1 -1
- package/lib/components/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-select2.js +137 -54
- package/lib/components/time-select/src/time-select2.js.map +1 -1
- package/lib/components/timeline/index.js +2 -2
- package/lib/components/timeline/src/timeline-item.js +33 -72
- package/lib/components/timeline/src/timeline-item.js.map +1 -1
- package/lib/components/timeline/src/timeline-item2.js +72 -33
- package/lib/components/timeline/src/timeline-item2.js.map +1 -1
- package/lib/components/tooltip/src/content.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/trigger.js +1 -1
- package/lib/components/tooltip/src/trigger2.js +1 -1
- package/lib/components/tooltip-v2/index.js +1 -1
- package/lib/components/tooltip-v2/src/content.js +110 -48
- package/lib/components/tooltip-v2/src/content.js.map +1 -1
- package/lib/components/tooltip-v2/src/content2.js +48 -110
- package/lib/components/tooltip-v2/src/content2.js.map +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/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/tour/src/tour.js +1 -1
- package/lib/components/transfer/index.js +2 -2
- package/lib/components/transfer/src/composables/use-check.js +1 -1
- package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +130 -21
- package/lib/components/transfer/src/transfer-panel.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel2.js +21 -130
- package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
- package/lib/components/transfer/src/transfer.js +72 -164
- package/lib/components/transfer/src/transfer.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +164 -72
- package/lib/components/transfer/src/transfer2.js.map +1 -1
- package/lib/components/watermark/index.js +2 -2
- package/lib/components/watermark/src/watermark.js +27 -220
- package/lib/components/watermark/src/watermark.js.map +1 -1
- package/lib/components/watermark/src/watermark2.js +220 -27
- package/lib/components/watermark/src/watermark2.js.map +1 -1
- package/lib/hooks/use-focus-controller/index.js +3 -2
- package/lib/hooks/use-focus-controller/index.js.map +1 -1
- package/lib/index.d.ts +27 -1
- package/lib/index.js +25 -25
- package/lib/locale/lang/ru.js +5 -5
- package/lib/locale/lang/ru.js.map +1 -1
- 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/theme-chalk/el-drawer.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/drawer.scss +1 -1
- package/web-types.json +1 -1
|
@@ -7,11 +7,12 @@ type DayRange = [Dayjs | undefined, Dayjs | undefined];
|
|
|
7
7
|
export declare const isValidRange: (range: DayRange) => boolean;
|
|
8
8
|
type GetDefaultValueParams = {
|
|
9
9
|
lang: string;
|
|
10
|
+
step?: number;
|
|
10
11
|
unit: 'month' | 'year';
|
|
11
12
|
unlinkPanels: boolean;
|
|
12
13
|
};
|
|
13
14
|
export type DefaultValue = [Date, Date] | Date | undefined;
|
|
14
|
-
export declare const getDefaultValue: (defaultValue: DefaultValue, { lang, unit, unlinkPanels }: GetDefaultValueParams) => dayjs.Dayjs[];
|
|
15
|
+
export declare const getDefaultValue: (defaultValue: DefaultValue, { lang, step, unit, unlinkPanels }: GetDefaultValueParams) => dayjs.Dayjs[];
|
|
15
16
|
type Dimension = {
|
|
16
17
|
row: number;
|
|
17
18
|
column: number;
|
|
@@ -8,12 +8,12 @@ const isValidRange = (range) => {
|
|
|
8
8
|
const [left, right] = range;
|
|
9
9
|
return dayjs.isDayjs(left) && dayjs.isDayjs(right) && dayjs(left).isValid() && dayjs(right).isValid() && left.isSameOrBefore(right);
|
|
10
10
|
};
|
|
11
|
-
const getDefaultValue = (defaultValue, { lang, unit, unlinkPanels }) => {
|
|
11
|
+
const getDefaultValue = (defaultValue, { lang, step = 1, unit, unlinkPanels }) => {
|
|
12
12
|
let start;
|
|
13
13
|
if (isArray(defaultValue)) {
|
|
14
14
|
let [left, right] = defaultValue.map((d) => dayjs(d).locale(lang));
|
|
15
15
|
if (!unlinkPanels) {
|
|
16
|
-
right = left.add(
|
|
16
|
+
right = left.add(step, unit);
|
|
17
17
|
}
|
|
18
18
|
return [left, right];
|
|
19
19
|
} else if (defaultValue) {
|
|
@@ -22,7 +22,7 @@ const getDefaultValue = (defaultValue, { lang, unit, unlinkPanels }) => {
|
|
|
22
22
|
start = dayjs();
|
|
23
23
|
}
|
|
24
24
|
start = start.locale(lang);
|
|
25
|
-
return [start, start.add(
|
|
25
|
+
return [start, start.add(step, unit)];
|
|
26
26
|
};
|
|
27
27
|
const buildPickerTable = (dimension, rows, {
|
|
28
28
|
columnIndexOffset,
|
|
@@ -73,12 +73,12 @@ const buildPickerTable = (dimension, rows, {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
const datesInMonth = (date, year, month, lang) => {
|
|
76
|
-
const firstDay = dayjs(
|
|
76
|
+
const firstDay = dayjs().locale(lang).startOf("month").month(month).year(year).hour(date.hour()).minute(date.minute()).second(date.second());
|
|
77
77
|
const numOfDays = firstDay.daysInMonth();
|
|
78
78
|
return rangeArr(numOfDays).map((n) => firstDay.add(n, "day").toDate());
|
|
79
79
|
};
|
|
80
80
|
const getValidDateOfMonth = (date, year, month, lang, disabledDate) => {
|
|
81
|
-
const _value = dayjs(
|
|
81
|
+
const _value = dayjs().year(year).month(month).startOf("month").hour(date.hour()).minute(date.minute()).second(date.second());
|
|
82
82
|
const _date = datesInMonth(date, year, month, lang).find((date2) => {
|
|
83
83
|
return !(disabledDate == null ? void 0 : disabledDate(date2));
|
|
84
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../../../../../packages/components/date-picker/src/utils.ts"],"sourcesContent":["import dayjs from 'dayjs'\nimport { isArray, isString } from '@element-plus/utils'\nimport { rangeArr } from '@element-plus/components/time-picker'\n\nimport type { ComputedRef } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type { DateCell } from './date-picker.type'\nimport type { DisabledDateType } from './props/shared'\n\ntype DayRange = [Dayjs | undefined, Dayjs | undefined]\n\nexport const isValidRange = (range: DayRange): boolean => {\n if (!isArray(range)) return false\n\n const [left, right] = range\n\n return (\n dayjs.isDayjs(left) &&\n dayjs.isDayjs(right) &&\n dayjs(left).isValid() &&\n dayjs(right).isValid() &&\n left.isSameOrBefore(right)\n )\n}\n\ntype GetDefaultValueParams = {\n lang: string\n unit: 'month' | 'year'\n unlinkPanels: boolean\n}\n\nexport type DefaultValue = [Date, Date] | Date | undefined\n\nexport const getDefaultValue = (\n defaultValue: DefaultValue,\n { lang, unit, unlinkPanels }: GetDefaultValueParams\n) => {\n let start: Dayjs\n\n if (isArray(defaultValue)) {\n let [left, right] = defaultValue.map((d) => dayjs(d).locale(lang))\n if (!unlinkPanels) {\n right = left.add(1, unit)\n }\n return [left, right]\n } else if (defaultValue) {\n start = dayjs(defaultValue)\n } else {\n start = dayjs()\n }\n start = start.locale(lang)\n return [start, start.add(1, unit)]\n}\n\ntype Dimension = {\n row: number\n column: number\n}\n\ntype BuildPickerTableMetadata = {\n startDate?: Dayjs | null\n unit: 'month' | 'day'\n columnIndexOffset: number\n now: Dayjs\n nextEndDate: Dayjs | null\n relativeDateGetter: (index: number) => Dayjs\n setCellMetadata?: (\n cell: DateCell,\n dimension: { rowIndex: number; columnIndex: number }\n ) => void\n setRowMetadata?: (row: DateCell[]) => void\n}\n\nexport const buildPickerTable = (\n dimension: Dimension,\n rows: DateCell[][],\n {\n columnIndexOffset,\n startDate,\n nextEndDate,\n now,\n unit,\n relativeDateGetter,\n setCellMetadata,\n setRowMetadata,\n }: BuildPickerTableMetadata\n) => {\n for (let rowIndex = 0; rowIndex < dimension.row; rowIndex++) {\n const row = rows[rowIndex]\n for (let columnIndex = 0; columnIndex < dimension.column; columnIndex++) {\n let cell = row[columnIndex + columnIndexOffset]\n if (!cell) {\n cell = {\n row: rowIndex,\n column: columnIndex,\n type: 'normal',\n inRange: false,\n start: false,\n end: false,\n }\n }\n const index = rowIndex * dimension.column + columnIndex\n const nextStartDate = relativeDateGetter(index)\n cell.dayjs = nextStartDate\n cell.date = nextStartDate.toDate()\n cell.timestamp = nextStartDate.valueOf()\n cell.type = 'normal'\n\n cell.inRange =\n !!(\n startDate &&\n nextStartDate.isSameOrAfter(startDate, unit) &&\n nextEndDate &&\n nextStartDate.isSameOrBefore(nextEndDate, unit)\n ) ||\n !!(\n startDate &&\n nextStartDate.isSameOrBefore(startDate, unit) &&\n nextEndDate &&\n nextStartDate.isSameOrAfter(nextEndDate, unit)\n )\n\n if (startDate?.isSameOrAfter(nextEndDate)) {\n cell.start = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit)\n cell.end = startDate && nextStartDate.isSame(startDate, unit)\n } else {\n cell.start = !!startDate && nextStartDate.isSame(startDate, unit)\n cell.end = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit)\n }\n\n const isToday = nextStartDate.isSame(now, unit)\n\n if (isToday) {\n cell.type = 'today'\n }\n setCellMetadata?.(cell, { rowIndex, columnIndex })\n row[columnIndex + columnIndexOffset] = cell\n }\n setRowMetadata?.(row)\n }\n}\n\nexport const datesInMonth = (\n date: Dayjs,\n year: number,\n month: number,\n lang: string\n) => {\n const firstDay = dayjs(date).locale(lang).month(month).year(year)\n const numOfDays = firstDay.daysInMonth()\n return rangeArr(numOfDays).map((n) => firstDay.add(n, 'day').toDate())\n}\n\nexport const getValidDateOfMonth = (\n date: Dayjs,\n year: number,\n month: number,\n lang: string,\n disabledDate?: DisabledDateType\n) => {\n const _value = dayjs(date).year(year).month(month)\n const _date = datesInMonth(date, year, month, lang).find((date) => {\n return !disabledDate?.(date)\n })\n if (_date) {\n return dayjs(_date).locale(lang)\n }\n return _value.locale(lang)\n}\n\nexport const getValidDateOfYear = (\n value: Dayjs,\n lang: string,\n disabledDate?: DisabledDateType\n) => {\n const year = value.year()\n if (!disabledDate?.(value.toDate())) {\n return value.locale(lang)\n }\n const month = value.month()\n if (!datesInMonth(value, year, month, lang).every(disabledDate)) {\n return getValidDateOfMonth(value, year, month, lang, disabledDate)\n }\n for (let i = 0; i < 12; i++) {\n if (!datesInMonth(value, year, i, lang).every(disabledDate)) {\n return getValidDateOfMonth(value, year, i, lang, disabledDate)\n }\n }\n return value\n}\n\nexport const correctlyParseUserInput = (\n value: string | Dayjs | Dayjs[],\n format: string,\n lang: string,\n defaultFormat: ComputedRef<boolean>\n): Dayjs | Dayjs[] => {\n if (isArray(value)) {\n return value.map(\n (v) => correctlyParseUserInput(v, format, lang, defaultFormat) as Dayjs\n )\n }\n if (isString(value)) {\n const dayjsValue = defaultFormat.value ? dayjs(value) : dayjs(value, format)\n if (!dayjsValue.isValid()) {\n // return directly if not valid\n return dayjsValue\n }\n }\n return dayjs(value, format).locale(lang)\n}\n"],"names":[],"mappings":";;;;AAGY,MAAC,YAAY,GAAG,CAAC,KAAK,KAAK;AACvC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AACrB,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC;AAC9B,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAA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,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE;AAC/B,MAAM,OAAO,UAAU,CAAC;AACxB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC3C;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../../../../packages/components/date-picker/src/utils.ts"],"sourcesContent":["import dayjs from 'dayjs'\nimport { isArray, isString } from '@element-plus/utils'\nimport { rangeArr } from '@element-plus/components/time-picker'\n\nimport type { ComputedRef } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type { DateCell } from './date-picker.type'\nimport type { DisabledDateType } from './props/shared'\n\ntype DayRange = [Dayjs | undefined, Dayjs | undefined]\n\nexport const isValidRange = (range: DayRange): boolean => {\n if (!isArray(range)) return false\n\n const [left, right] = range\n\n return (\n dayjs.isDayjs(left) &&\n dayjs.isDayjs(right) &&\n dayjs(left).isValid() &&\n dayjs(right).isValid() &&\n left.isSameOrBefore(right)\n )\n}\n\ntype GetDefaultValueParams = {\n lang: string\n step?: number\n unit: 'month' | 'year'\n unlinkPanels: boolean\n}\n\nexport type DefaultValue = [Date, Date] | Date | undefined\n\nexport const getDefaultValue = (\n defaultValue: DefaultValue,\n { lang, step = 1, unit, unlinkPanels }: GetDefaultValueParams\n) => {\n let start: Dayjs\n\n if (isArray(defaultValue)) {\n let [left, right] = defaultValue.map((d) => dayjs(d).locale(lang))\n if (!unlinkPanels) {\n right = left.add(step, unit)\n }\n return [left, right]\n } else if (defaultValue) {\n start = dayjs(defaultValue)\n } else {\n start = dayjs()\n }\n start = start.locale(lang)\n return [start, start.add(step, unit)]\n}\n\ntype Dimension = {\n row: number\n column: number\n}\n\ntype BuildPickerTableMetadata = {\n startDate?: Dayjs | null\n unit: 'month' | 'day'\n columnIndexOffset: number\n now: Dayjs\n nextEndDate: Dayjs | null\n relativeDateGetter: (index: number) => Dayjs\n setCellMetadata?: (\n cell: DateCell,\n dimension: { rowIndex: number; columnIndex: number }\n ) => void\n setRowMetadata?: (row: DateCell[]) => void\n}\n\nexport const buildPickerTable = (\n dimension: Dimension,\n rows: DateCell[][],\n {\n columnIndexOffset,\n startDate,\n nextEndDate,\n now,\n unit,\n relativeDateGetter,\n setCellMetadata,\n setRowMetadata,\n }: BuildPickerTableMetadata\n) => {\n for (let rowIndex = 0; rowIndex < dimension.row; rowIndex++) {\n const row = rows[rowIndex]\n for (let columnIndex = 0; columnIndex < dimension.column; columnIndex++) {\n let cell = row[columnIndex + columnIndexOffset]\n if (!cell) {\n cell = {\n row: rowIndex,\n column: columnIndex,\n type: 'normal',\n inRange: false,\n start: false,\n end: false,\n }\n }\n const index = rowIndex * dimension.column + columnIndex\n const nextStartDate = relativeDateGetter(index)\n cell.dayjs = nextStartDate\n cell.date = nextStartDate.toDate()\n cell.timestamp = nextStartDate.valueOf()\n cell.type = 'normal'\n\n cell.inRange =\n !!(\n startDate &&\n nextStartDate.isSameOrAfter(startDate, unit) &&\n nextEndDate &&\n nextStartDate.isSameOrBefore(nextEndDate, unit)\n ) ||\n !!(\n startDate &&\n nextStartDate.isSameOrBefore(startDate, unit) &&\n nextEndDate &&\n nextStartDate.isSameOrAfter(nextEndDate, unit)\n )\n\n if (startDate?.isSameOrAfter(nextEndDate)) {\n cell.start = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit)\n cell.end = startDate && nextStartDate.isSame(startDate, unit)\n } else {\n cell.start = !!startDate && nextStartDate.isSame(startDate, unit)\n cell.end = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit)\n }\n\n const isToday = nextStartDate.isSame(now, unit)\n\n if (isToday) {\n cell.type = 'today'\n }\n setCellMetadata?.(cell, { rowIndex, columnIndex })\n row[columnIndex + columnIndexOffset] = cell\n }\n setRowMetadata?.(row)\n }\n}\n\nexport const datesInMonth = (\n date: Dayjs,\n year: number,\n month: number,\n lang: string\n) => {\n const firstDay = dayjs()\n .locale(lang)\n .startOf('month')\n .month(month)\n .year(year)\n .hour(date.hour())\n .minute(date.minute())\n .second(date.second())\n\n const numOfDays = firstDay.daysInMonth()\n return rangeArr(numOfDays).map((n) => firstDay.add(n, 'day').toDate())\n}\n\nexport const getValidDateOfMonth = (\n date: Dayjs,\n year: number,\n month: number,\n lang: string,\n disabledDate?: DisabledDateType\n) => {\n const _value = dayjs()\n .year(year)\n .month(month)\n .startOf('month')\n .hour(date.hour())\n .minute(date.minute())\n .second(date.second())\n const _date = datesInMonth(date, year, month, lang).find((date) => {\n return !disabledDate?.(date)\n })\n if (_date) {\n return dayjs(_date).locale(lang)\n }\n return _value.locale(lang)\n}\n\nexport const getValidDateOfYear = (\n value: Dayjs,\n lang: string,\n disabledDate?: DisabledDateType\n) => {\n const year = value.year()\n if (!disabledDate?.(value.toDate())) {\n return value.locale(lang)\n }\n const month = value.month()\n if (!datesInMonth(value, year, month, lang).every(disabledDate)) {\n return getValidDateOfMonth(value, year, month, lang, disabledDate)\n }\n for (let i = 0; i < 12; i++) {\n if (!datesInMonth(value, year, i, lang).every(disabledDate)) {\n return getValidDateOfMonth(value, year, i, lang, disabledDate)\n }\n }\n return value\n}\n\nexport const correctlyParseUserInput = (\n value: string | Dayjs | Dayjs[],\n format: string,\n lang: string,\n defaultFormat: ComputedRef<boolean>\n): Dayjs | Dayjs[] => {\n if (isArray(value)) {\n return value.map(\n (v) => correctlyParseUserInput(v, format, lang, defaultFormat) as Dayjs\n )\n }\n if (isString(value)) {\n const dayjsValue = defaultFormat.value ? dayjs(value) : dayjs(value, format)\n if (!dayjsValue.isValid()) {\n // return directly if not valid\n return dayjsValue\n }\n }\n return dayjs(value, format).locale(lang)\n}\n"],"names":[],"mappings":";;;;AAGY,MAAC,YAAY,GAAG,CAAC,KAAK,KAAK;AACvC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AACrB,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAA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AAE,OAAO,KAAK,CAAC;AACf,EAAE;AACU,MAAC,uBAAuB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,KAAK;AAC/E,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;AACtB,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,uBAAuB,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;AACrF,GAAG;AACH,EAAE,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;AACvB,IAAI,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACjF,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE;AAC/B,MAAM,OAAO,UAAU,CAAC;AACxB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC3C;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, useSlots, provide, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, createBlock } from 'vue';
|
|
2
|
-
import ElDescriptionsRow from './descriptions-
|
|
2
|
+
import ElDescriptionsRow from './descriptions-row.mjs';
|
|
3
3
|
import { descriptionsKey } from './token.mjs';
|
|
4
4
|
import { descriptionProps } from './description.mjs';
|
|
5
5
|
import { COMPONENT_NAME } from './constants.mjs';
|
|
@@ -1,11 +1,68 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent, inject, unref, openBlock, createElementBlock, Fragment, createElementVNode, renderList, createBlock, createVNode } from 'vue';
|
|
2
|
+
import ElDescriptionsCell from './descriptions-cell.mjs';
|
|
3
|
+
import { descriptionsKey } from './token.mjs';
|
|
4
|
+
import { descriptionsRowProps } from './descriptions-row2.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
2
6
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
const __default__ = defineComponent({
|
|
8
|
+
name: "ElDescriptionsRow"
|
|
9
|
+
});
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
...__default__,
|
|
12
|
+
props: descriptionsRowProps,
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const descriptions = inject(descriptionsKey, {});
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
return unref(descriptions).direction === "vertical" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
17
|
+
createElementVNode("tr", null, [
|
|
18
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
|
|
19
|
+
return openBlock(), createBlock(unref(ElDescriptionsCell), {
|
|
20
|
+
key: `tr1-${_index}`,
|
|
21
|
+
cell,
|
|
22
|
+
tag: "th",
|
|
23
|
+
type: "label"
|
|
24
|
+
}, null, 8, ["cell"]);
|
|
25
|
+
}), 128))
|
|
26
|
+
]),
|
|
27
|
+
createElementVNode("tr", null, [
|
|
28
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
|
|
29
|
+
return openBlock(), createBlock(unref(ElDescriptionsCell), {
|
|
30
|
+
key: `tr2-${_index}`,
|
|
31
|
+
cell,
|
|
32
|
+
tag: "td",
|
|
33
|
+
type: "content"
|
|
34
|
+
}, null, 8, ["cell"]);
|
|
35
|
+
}), 128))
|
|
36
|
+
])
|
|
37
|
+
], 64)) : (openBlock(), createElementBlock("tr", { key: 1 }, [
|
|
38
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
|
|
39
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
40
|
+
key: `tr3-${_index}`
|
|
41
|
+
}, [
|
|
42
|
+
unref(descriptions).border ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
43
|
+
createVNode(unref(ElDescriptionsCell), {
|
|
44
|
+
cell,
|
|
45
|
+
tag: "td",
|
|
46
|
+
type: "label"
|
|
47
|
+
}, null, 8, ["cell"]),
|
|
48
|
+
createVNode(unref(ElDescriptionsCell), {
|
|
49
|
+
cell,
|
|
50
|
+
tag: "td",
|
|
51
|
+
type: "content"
|
|
52
|
+
}, null, 8, ["cell"])
|
|
53
|
+
], 64)) : (openBlock(), createBlock(unref(ElDescriptionsCell), {
|
|
54
|
+
key: 1,
|
|
55
|
+
cell,
|
|
56
|
+
tag: "td",
|
|
57
|
+
type: "both"
|
|
58
|
+
}, null, 8, ["cell"]))
|
|
59
|
+
], 64);
|
|
60
|
+
}), 128))
|
|
61
|
+
]));
|
|
62
|
+
};
|
|
7
63
|
}
|
|
8
64
|
});
|
|
65
|
+
var ElDescriptionsRow = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "descriptions-row.vue"]]);
|
|
9
66
|
|
|
10
|
-
export {
|
|
67
|
+
export { ElDescriptionsRow as default };
|
|
11
68
|
//# sourceMappingURL=descriptions-row.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptions-row.mjs","sources":["../../../../../../packages/components/descriptions/src/descriptions-row.
|
|
1
|
+
{"version":3,"file":"descriptions-row.mjs","sources":["../../../../../../packages/components/descriptions/src/descriptions-row.vue"],"sourcesContent":["<template>\n <template v-if=\"descriptions.direction === 'vertical'\">\n <tr>\n <template v-for=\"(cell, _index) in row\" :key=\"`tr1-${_index}`\">\n <el-descriptions-cell :cell=\"cell\" tag=\"th\" type=\"label\" />\n </template>\n </tr>\n <tr>\n <template v-for=\"(cell, _index) in row\" :key=\"`tr2-${_index}`\">\n <el-descriptions-cell :cell=\"cell\" tag=\"td\" type=\"content\" />\n </template>\n </tr>\n </template>\n <tr v-else>\n <template v-for=\"(cell, _index) in row\" :key=\"`tr3-${_index}`\">\n <template v-if=\"descriptions.border\">\n <el-descriptions-cell :cell=\"cell\" tag=\"td\" type=\"label\" />\n <el-descriptions-cell :cell=\"cell\" tag=\"td\" type=\"content\" />\n </template>\n <el-descriptions-cell v-else :cell=\"cell\" tag=\"td\" type=\"both\" />\n </template>\n </tr>\n</template>\n\n<script lang=\"ts\" setup>\nimport { inject } from 'vue'\n\nimport ElDescriptionsCell from './descriptions-cell'\nimport { descriptionsKey } from './token'\nimport { descriptionsRowProps } from './descriptions-row'\n\nimport type { IDescriptionsInject } from './descriptions.type'\n\ndefineOptions({\n name: 'ElDescriptionsRow',\n})\n\ndefineProps(descriptionsRowProps)\n\nconst descriptions = inject(descriptionsKey, {} as IDescriptionsInject)\n</script>\n"],"names":[],"mappings":";;;;;;mCAiCc,CAAA;AAAA,EACZ,IAAM,EAAA,mBAAA;AACR,CAAA,CAAA,CAAA;;;;;AAIA,IAAA,MAAM,YAAe,GAAA,MAAA,CAAO,eAAiB,EAAA,EAAyB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,68 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import ElDescriptionsCell from './descriptions-cell.mjs';
|
|
3
|
-
import { descriptionsKey } from './token.mjs';
|
|
4
|
-
import { descriptionsRowProps } from './descriptions-row.mjs';
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
1
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
6
2
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...__default__,
|
|
12
|
-
props: descriptionsRowProps,
|
|
13
|
-
setup(__props) {
|
|
14
|
-
const descriptions = inject(descriptionsKey, {});
|
|
15
|
-
return (_ctx, _cache) => {
|
|
16
|
-
return unref(descriptions).direction === "vertical" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
17
|
-
createElementVNode("tr", null, [
|
|
18
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
|
|
19
|
-
return openBlock(), createBlock(unref(ElDescriptionsCell), {
|
|
20
|
-
key: `tr1-${_index}`,
|
|
21
|
-
cell,
|
|
22
|
-
tag: "th",
|
|
23
|
-
type: "label"
|
|
24
|
-
}, null, 8, ["cell"]);
|
|
25
|
-
}), 128))
|
|
26
|
-
]),
|
|
27
|
-
createElementVNode("tr", null, [
|
|
28
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
|
|
29
|
-
return openBlock(), createBlock(unref(ElDescriptionsCell), {
|
|
30
|
-
key: `tr2-${_index}`,
|
|
31
|
-
cell,
|
|
32
|
-
tag: "td",
|
|
33
|
-
type: "content"
|
|
34
|
-
}, null, 8, ["cell"]);
|
|
35
|
-
}), 128))
|
|
36
|
-
])
|
|
37
|
-
], 64)) : (openBlock(), createElementBlock("tr", { key: 1 }, [
|
|
38
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
|
|
39
|
-
return openBlock(), createElementBlock(Fragment, {
|
|
40
|
-
key: `tr3-${_index}`
|
|
41
|
-
}, [
|
|
42
|
-
unref(descriptions).border ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
43
|
-
createVNode(unref(ElDescriptionsCell), {
|
|
44
|
-
cell,
|
|
45
|
-
tag: "td",
|
|
46
|
-
type: "label"
|
|
47
|
-
}, null, 8, ["cell"]),
|
|
48
|
-
createVNode(unref(ElDescriptionsCell), {
|
|
49
|
-
cell,
|
|
50
|
-
tag: "td",
|
|
51
|
-
type: "content"
|
|
52
|
-
}, null, 8, ["cell"])
|
|
53
|
-
], 64)) : (openBlock(), createBlock(unref(ElDescriptionsCell), {
|
|
54
|
-
key: 1,
|
|
55
|
-
cell,
|
|
56
|
-
tag: "td",
|
|
57
|
-
type: "both"
|
|
58
|
-
}, null, 8, ["cell"]))
|
|
59
|
-
], 64);
|
|
60
|
-
}), 128))
|
|
61
|
-
]));
|
|
62
|
-
};
|
|
3
|
+
const descriptionsRowProps = buildProps({
|
|
4
|
+
row: {
|
|
5
|
+
type: definePropType(Array),
|
|
6
|
+
default: () => []
|
|
63
7
|
}
|
|
64
8
|
});
|
|
65
|
-
var ElDescriptionsRow = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "descriptions-row.vue"]]);
|
|
66
9
|
|
|
67
|
-
export {
|
|
10
|
+
export { descriptionsRowProps };
|
|
68
11
|
//# sourceMappingURL=descriptions-row2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptions-row2.mjs","sources":["../../../../../../packages/components/descriptions/src/descriptions-row.
|
|
1
|
+
{"version":3,"file":"descriptions-row2.mjs","sources":["../../../../../../packages/components/descriptions/src/descriptions-row.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { DescriptionItemVNode } from './description-item'\n\nexport const descriptionsRowProps = buildProps({\n row: {\n type: definePropType<DescriptionItemVNode[]>(Array),\n default: () => [],\n },\n} as const)\n"],"names":[],"mappings":";;AACY,MAAC,oBAAoB,GAAG,UAAU,CAAC;AAC/C,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Dialog from './src/
|
|
1
|
+
import Dialog from './src/dialog2.mjs';
|
|
2
2
|
export { useDialog } from './src/use-dialog.mjs';
|
|
3
|
-
export { dialogEmits, dialogProps } from './src/
|
|
3
|
+
export { dialogEmits, dialogProps } from './src/dialog.mjs';
|
|
4
4
|
export { dialogInjectionKey } from './src/constants.mjs';
|
|
5
5
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
6
6
|
|
|
@@ -1,177 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { dialogInjectionKey } from './constants.mjs';
|
|
7
|
-
import { dialogProps, dialogEmits } from './dialog2.mjs';
|
|
8
|
-
import { useDialog } from './use-dialog.mjs';
|
|
9
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
10
|
-
import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
|
|
11
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
12
|
-
import { useSameTarget } from '../../../hooks/use-same-target/index.mjs';
|
|
1
|
+
import { dialogContentProps } from './dialog-content.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { teleportProps } from '../../teleport/src/teleport.mjs';
|
|
4
|
+
import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
|
|
5
|
+
import { isBoolean } from '../../../utils/types.mjs';
|
|
13
6
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
};
|
|
68
|
-
expose({
|
|
69
|
-
visible,
|
|
70
|
-
dialogContentRef,
|
|
71
|
-
resetPosition,
|
|
72
|
-
handleClose
|
|
73
|
-
});
|
|
74
|
-
return (_ctx, _cache) => {
|
|
75
|
-
return openBlock(), createBlock(unref(ElTeleport), {
|
|
76
|
-
to: _ctx.appendTo,
|
|
77
|
-
disabled: _ctx.appendTo !== "body" ? false : !_ctx.appendToBody
|
|
78
|
-
}, {
|
|
79
|
-
default: withCtx(() => [
|
|
80
|
-
createVNode(Transition, {
|
|
81
|
-
name: "dialog-fade",
|
|
82
|
-
onAfterEnter: unref(afterEnter),
|
|
83
|
-
onAfterLeave: unref(afterLeave),
|
|
84
|
-
onBeforeLeave: unref(beforeLeave),
|
|
85
|
-
persisted: ""
|
|
86
|
-
}, {
|
|
87
|
-
default: withCtx(() => [
|
|
88
|
-
withDirectives(createVNode(unref(ElOverlay), {
|
|
89
|
-
"custom-mask-event": "",
|
|
90
|
-
mask: _ctx.modal,
|
|
91
|
-
"overlay-class": _ctx.modalClass,
|
|
92
|
-
"z-index": unref(zIndex)
|
|
93
|
-
}, {
|
|
94
|
-
default: withCtx(() => [
|
|
95
|
-
createElementVNode("div", {
|
|
96
|
-
role: "dialog",
|
|
97
|
-
"aria-modal": "true",
|
|
98
|
-
"aria-label": _ctx.title || void 0,
|
|
99
|
-
"aria-labelledby": !_ctx.title ? unref(titleId) : void 0,
|
|
100
|
-
"aria-describedby": unref(bodyId),
|
|
101
|
-
class: normalizeClass(`${unref(ns).namespace.value}-overlay-dialog`),
|
|
102
|
-
style: normalizeStyle(unref(overlayDialogStyle)),
|
|
103
|
-
onClick: unref(overlayEvent).onClick,
|
|
104
|
-
onMousedown: unref(overlayEvent).onMousedown,
|
|
105
|
-
onMouseup: unref(overlayEvent).onMouseup
|
|
106
|
-
}, [
|
|
107
|
-
createVNode(unref(ElFocusTrap), {
|
|
108
|
-
loop: "",
|
|
109
|
-
trapped: unref(visible),
|
|
110
|
-
"focus-start-el": "container",
|
|
111
|
-
onFocusAfterTrapped: unref(onOpenAutoFocus),
|
|
112
|
-
onFocusAfterReleased: unref(onCloseAutoFocus),
|
|
113
|
-
onFocusoutPrevented: unref(onFocusoutPrevented),
|
|
114
|
-
onReleaseRequested: unref(onCloseRequested)
|
|
115
|
-
}, {
|
|
116
|
-
default: withCtx(() => [
|
|
117
|
-
unref(rendered) ? (openBlock(), createBlock(ElDialogContent, mergeProps({
|
|
118
|
-
key: 0,
|
|
119
|
-
ref_key: "dialogContentRef",
|
|
120
|
-
ref: dialogContentRef
|
|
121
|
-
}, _ctx.$attrs, {
|
|
122
|
-
center: _ctx.center,
|
|
123
|
-
"align-center": _ctx.alignCenter,
|
|
124
|
-
"close-icon": _ctx.closeIcon,
|
|
125
|
-
draggable: unref(draggable),
|
|
126
|
-
overflow: _ctx.overflow,
|
|
127
|
-
fullscreen: _ctx.fullscreen,
|
|
128
|
-
"header-class": _ctx.headerClass,
|
|
129
|
-
"body-class": _ctx.bodyClass,
|
|
130
|
-
"footer-class": _ctx.footerClass,
|
|
131
|
-
"show-close": _ctx.showClose,
|
|
132
|
-
title: _ctx.title,
|
|
133
|
-
"aria-level": _ctx.headerAriaLevel,
|
|
134
|
-
onClose: unref(handleClose)
|
|
135
|
-
}), createSlots({
|
|
136
|
-
header: withCtx(() => [
|
|
137
|
-
!_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
|
|
138
|
-
key: 0,
|
|
139
|
-
close: unref(handleClose),
|
|
140
|
-
titleId: unref(titleId),
|
|
141
|
-
titleClass: unref(ns).e("title")
|
|
142
|
-
}) : renderSlot(_ctx.$slots, "title", { key: 1 })
|
|
143
|
-
]),
|
|
144
|
-
default: withCtx(() => [
|
|
145
|
-
renderSlot(_ctx.$slots, "default")
|
|
146
|
-
]),
|
|
147
|
-
_: 2
|
|
148
|
-
}, [
|
|
149
|
-
_ctx.$slots.footer ? {
|
|
150
|
-
name: "footer",
|
|
151
|
-
fn: withCtx(() => [
|
|
152
|
-
renderSlot(_ctx.$slots, "footer")
|
|
153
|
-
])
|
|
154
|
-
} : void 0
|
|
155
|
-
]), 1040, ["center", "align-center", "close-icon", "draggable", "overflow", "fullscreen", "header-class", "body-class", "footer-class", "show-close", "title", "aria-level", "onClose"])) : createCommentVNode("v-if", true)
|
|
156
|
-
]),
|
|
157
|
-
_: 3
|
|
158
|
-
}, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
|
|
159
|
-
], 46, ["aria-label", "aria-labelledby", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
|
|
160
|
-
]),
|
|
161
|
-
_: 3
|
|
162
|
-
}, 8, ["mask", "overlay-class", "z-index"]), [
|
|
163
|
-
[vShow, unref(visible)]
|
|
164
|
-
])
|
|
165
|
-
]),
|
|
166
|
-
_: 3
|
|
167
|
-
}, 8, ["onAfterEnter", "onAfterLeave", "onBeforeLeave"])
|
|
168
|
-
]),
|
|
169
|
-
_: 3
|
|
170
|
-
}, 8, ["to", "disabled"]);
|
|
171
|
-
};
|
|
7
|
+
const dialogProps = buildProps({
|
|
8
|
+
...dialogContentProps,
|
|
9
|
+
appendToBody: Boolean,
|
|
10
|
+
appendTo: {
|
|
11
|
+
type: teleportProps.to.type,
|
|
12
|
+
default: "body"
|
|
13
|
+
},
|
|
14
|
+
beforeClose: {
|
|
15
|
+
type: definePropType(Function)
|
|
16
|
+
},
|
|
17
|
+
destroyOnClose: Boolean,
|
|
18
|
+
closeOnClickModal: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true
|
|
21
|
+
},
|
|
22
|
+
closeOnPressEscape: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
lockScroll: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: true
|
|
29
|
+
},
|
|
30
|
+
modal: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
openDelay: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 0
|
|
37
|
+
},
|
|
38
|
+
closeDelay: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 0
|
|
41
|
+
},
|
|
42
|
+
top: {
|
|
43
|
+
type: String
|
|
44
|
+
},
|
|
45
|
+
modelValue: Boolean,
|
|
46
|
+
modalClass: String,
|
|
47
|
+
headerClass: String,
|
|
48
|
+
bodyClass: String,
|
|
49
|
+
footerClass: String,
|
|
50
|
+
width: {
|
|
51
|
+
type: [String, Number]
|
|
52
|
+
},
|
|
53
|
+
zIndex: {
|
|
54
|
+
type: Number
|
|
55
|
+
},
|
|
56
|
+
trapFocus: Boolean,
|
|
57
|
+
headerAriaLevel: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "2"
|
|
172
60
|
}
|
|
173
61
|
});
|
|
174
|
-
|
|
62
|
+
const dialogEmits = {
|
|
63
|
+
open: () => true,
|
|
64
|
+
opened: () => true,
|
|
65
|
+
close: () => true,
|
|
66
|
+
closed: () => true,
|
|
67
|
+
[UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
|
|
68
|
+
openAutoFocus: () => true,
|
|
69
|
+
closeAutoFocus: () => true
|
|
70
|
+
};
|
|
175
71
|
|
|
176
|
-
export {
|
|
72
|
+
export { dialogEmits, dialogProps };
|
|
177
73
|
//# sourceMappingURL=dialog.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.mjs","sources":["../../../../../../packages/components/dialog/src/dialog.
|
|
1
|
+
{"version":3,"file":"dialog.mjs","sources":["../../../../../../packages/components/dialog/src/dialog.ts"],"sourcesContent":["import { buildProps, definePropType, isBoolean } from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { teleportProps } from '@element-plus/components/teleport'\nimport { dialogContentProps } from './dialog-content'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type Dialog from './dialog.vue'\n\ntype DoneFn = (cancel?: boolean) => void\nexport type DialogBeforeCloseFn = (done: DoneFn) => void\n\nexport const dialogProps = buildProps({\n ...dialogContentProps,\n /**\n * @description whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true`\n */\n appendToBody: Boolean,\n /**\n * @description which element the Dialog appends to\n */\n appendTo: {\n type: teleportProps.to.type,\n default: 'body',\n },\n /**\n * @description callback before Dialog closes, and it will prevent Dialog from closing, use done to close the dialog\n */\n beforeClose: {\n type: definePropType<DialogBeforeCloseFn>(Function),\n },\n /**\n * @description destroy elements in Dialog when closed\n */\n destroyOnClose: Boolean,\n /**\n * @description whether the Dialog can be closed by clicking the mask\n */\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the Dialog can be closed by pressing ESC\n */\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether scroll of body is disabled while Dialog is displayed\n */\n lockScroll: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether a mask is displayed\n */\n modal: {\n type: Boolean,\n default: true,\n },\n /**\n * @description the Time(milliseconds) before open\n */\n openDelay: {\n type: Number,\n default: 0,\n },\n /**\n * @description the Time(milliseconds) before close\n */\n closeDelay: {\n type: Number,\n default: 0,\n },\n /**\n * @description value for `margin-top` of Dialog CSS, default is 15vh\n */\n top: {\n type: String,\n },\n /**\n * @description visibility of Dialog\n */\n modelValue: Boolean,\n /**\n * @description custom class names for mask\n */\n modalClass: String,\n /**\n * @description custom class names for header wrapper\n */\n headerClass: String,\n /**\n * @description custom class names for body wrapper\n */\n bodyClass: String,\n /**\n * @description custom class names for footer wrapper\n */\n footerClass: String,\n /**\n * @description width of Dialog, default is 50%\n */\n width: {\n type: [String, Number],\n },\n /**\n * @description same as z-index in native CSS, z-order of dialog\n */\n zIndex: {\n type: Number,\n },\n trapFocus: Boolean,\n /**\n * @description header's aria-level attribute\n */\n headerAriaLevel: {\n type: String,\n default: '2',\n },\n} as const)\n\nexport type DialogProps = ExtractPropTypes<typeof dialogProps>\n\nexport const dialogEmits = {\n open: () => true,\n opened: () => true,\n close: () => true,\n closed: () => true,\n [UPDATE_MODEL_EVENT]: (value: boolean) => isBoolean(value),\n openAutoFocus: () => true,\n closeAutoFocus: () => true,\n}\nexport type DialogEmits = typeof dialogEmits\nexport type DialogInstance = InstanceType<typeof Dialog> & unknown\n"],"names":[],"mappings":";;;;;;AAIY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,GAAG,kBAAkB;AACvB,EAAE,YAAY,EAAE,OAAO;AACvB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,aAAa,CAAC,EAAE,CAAC,IAAI;AAC/B,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,cAAc,EAAE,OAAO;AACzB,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AA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