@element-plus/nightly 0.0.20221019 → 0.0.20221021
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +815 -774
- package/dist/index.full.min.js +20 -20
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +21 -21
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +815 -774
- 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.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/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/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/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/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/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/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/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-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/backtop/index.d.ts +2 -6
- package/es/components/backtop/index.mjs.map +1 -1
- package/es/components/backtop/src/backtop.d.ts +0 -2
- package/es/components/backtop/src/backtop.mjs.map +1 -1
- package/es/components/backtop/src/backtop.vue.d.ts +5 -10
- package/es/components/backtop/src/backtop2.mjs +6 -52
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/backtop/src/instance.d.ts +2 -0
- package/es/components/backtop/src/instance.mjs +2 -0
- package/es/components/backtop/src/instance.mjs.map +1 -0
- package/es/components/backtop/src/use-backtop.d.ts +6 -0
- package/es/components/backtop/src/use-backtop.mjs +58 -0
- package/es/components/backtop/src/use-backtop.mjs.map +1 -0
- package/es/components/button/index.d.ts +4 -10
- package/es/components/button/index.mjs.map +1 -1
- package/es/components/button/src/button-group.d.ts +0 -2
- package/es/components/button/src/button-group.mjs.map +1 -1
- package/es/components/button/src/button.d.ts +0 -2
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button.vue.d.ts +3 -10
- package/es/components/button/src/button2.mjs +5 -46
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/button/src/instance.d.ts +4 -0
- package/es/components/button/src/instance.mjs +2 -0
- package/es/components/button/src/instance.mjs.map +1 -0
- package/es/components/button/src/use-button.d.ts +10 -0
- package/es/components/button/src/use-button.mjs +59 -0
- package/es/components/button/src/use-button.mjs.map +1 -0
- package/es/components/calendar/index.d.ts +39 -58
- package/es/components/calendar/index.mjs.map +1 -1
- package/es/components/calendar/src/calendar.d.ts +0 -2
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar.vue.d.ts +101 -125
- package/es/components/calendar/src/calendar2.mjs +19 -134
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/calendar/src/date-table.d.ts +0 -2
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table.vue.d.ts +26 -31
- package/es/components/calendar/src/date-table2.mjs +14 -82
- package/es/components/calendar/src/date-table2.mjs.map +1 -1
- package/es/components/calendar/src/instance.d.ts +5 -0
- package/es/components/calendar/src/instance.mjs +2 -0
- package/es/components/calendar/src/instance.mjs.map +1 -0
- package/es/components/calendar/src/use-calendar.d.ts +14 -0
- package/es/components/calendar/src/use-calendar.mjs +140 -0
- package/es/components/calendar/src/use-calendar.mjs.map +1 -0
- package/es/components/calendar/src/use-date-table.d.ts +18 -0
- package/es/components/calendar/src/use-date-table.mjs +96 -0
- package/es/components/calendar/src/use-date-table.mjs.map +1 -0
- package/es/components/color-picker/index.d.ts +3 -10
- package/es/components/color-picker/src/color-picker.vue.d.ts +3 -10
- package/es/components/date-picker/src/composables/use-range-picker.d.ts +1 -1
- package/es/components/date-picker/src/date-picker-com/basic-date-table.vue.d.ts +6 -6
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +27 -34
- package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +29 -36
- package/es/components/date-picker/src/date-picker-com/panel-month-range.vue.d.ts +3 -3
- package/es/components/date-picker/src/panel-utils.d.ts +59 -73
- package/es/components/dialog/index.d.ts +1 -0
- package/es/components/dialog/src/dialog.vue.d.ts +1 -0
- package/es/components/dialog/src/dialog2.mjs +4 -2
- package/es/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/components/dialog/src/use-dialog.d.ts +1 -0
- package/es/components/dialog/src/use-dialog.mjs +7 -0
- package/es/components/dialog/src/use-dialog.mjs.map +1 -1
- package/es/components/drawer/index.d.ts +1 -0
- package/es/components/drawer/src/drawer.vue.d.ts +1 -0
- package/es/components/pagination/src/components/next.mjs +34 -19
- package/es/components/pagination/src/components/next.mjs.map +1 -1
- package/es/components/pagination/src/components/next2.mjs +19 -34
- package/es/components/pagination/src/components/next2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/popconfirm/index.d.ts +3 -10
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +3 -10
- package/es/components/skeleton/index.d.ts +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/es/components/time-picker/src/composables/use-time-picker.d.ts +2 -2
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +5 -5
- package/es/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +17 -17
- package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +17 -17
- package/es/components/transfer/index.d.ts +3 -10
- package/es/components/transfer/src/transfer.vue.d.ts +3 -10
- package/es/components/tree-v2/index.d.ts +868 -3
- package/es/components/tree-v2/src/composables/useCheck.d.ts +2 -1
- package/es/components/tree-v2/src/composables/useCheck.mjs.map +1 -1
- package/es/components/tree-v2/src/composables/useTree.d.ts +6 -3
- package/es/components/tree-v2/src/composables/useTree.mjs +1 -1
- package/es/components/tree-v2/src/composables/useTree.mjs.map +1 -1
- package/es/components/tree-v2/src/tree-node.mjs +63 -78
- package/es/components/tree-v2/src/tree-node.mjs.map +1 -1
- package/es/components/tree-v2/src/tree-node.vue.d.ts +566 -3
- package/es/components/tree-v2/src/tree.mjs +62 -75
- package/es/components/tree-v2/src/tree.mjs.map +1 -1
- package/es/components/tree-v2/src/tree.vue.d.ts +868 -3
- package/es/components/tree-v2/src/types.d.ts +1 -1
- package/es/components/tree-v2/src/virtual-tree.d.ts +3 -2
- package/es/components/tree-v2/src/virtual-tree.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/backtop/index.d.ts +2 -6
- package/lib/components/backtop/index.js.map +1 -1
- package/lib/components/backtop/src/backtop.d.ts +0 -2
- package/lib/components/backtop/src/backtop.js.map +1 -1
- package/lib/components/backtop/src/backtop.vue.d.ts +5 -10
- package/lib/components/backtop/src/backtop2.js +5 -51
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/backtop/src/instance.d.ts +2 -0
- package/lib/components/backtop/src/instance.js +3 -0
- package/lib/components/backtop/src/instance.js.map +1 -0
- package/lib/components/backtop/src/use-backtop.d.ts +6 -0
- package/lib/components/backtop/src/use-backtop.js +62 -0
- package/lib/components/backtop/src/use-backtop.js.map +1 -0
- package/lib/components/button/index.d.ts +4 -10
- package/lib/components/button/index.js.map +1 -1
- package/lib/components/button/src/button-group.d.ts +0 -2
- package/lib/components/button/src/button-group.js.map +1 -1
- package/lib/components/button/src/button.d.ts +0 -2
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button.vue.d.ts +3 -10
- package/lib/components/button/src/button2.js +8 -49
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/button/src/instance.d.ts +4 -0
- package/lib/components/button/src/instance.js +3 -0
- package/lib/components/button/src/instance.js.map +1 -0
- package/lib/components/button/src/use-button.d.ts +10 -0
- package/lib/components/button/src/use-button.js +63 -0
- package/lib/components/button/src/use-button.js.map +1 -0
- package/lib/components/calendar/index.d.ts +39 -58
- package/lib/components/calendar/index.js.map +1 -1
- package/lib/components/calendar/src/calendar.d.ts +0 -2
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar.vue.d.ts +101 -125
- package/lib/components/calendar/src/calendar2.js +23 -142
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/calendar/src/date-table.d.ts +0 -2
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table.vue.d.ts +26 -31
- package/lib/components/calendar/src/date-table2.js +15 -88
- package/lib/components/calendar/src/date-table2.js.map +1 -1
- package/lib/components/calendar/src/instance.d.ts +5 -0
- package/lib/components/calendar/src/instance.js +3 -0
- package/lib/components/calendar/src/instance.js.map +1 -0
- package/lib/components/calendar/src/use-calendar.d.ts +14 -0
- package/lib/components/calendar/src/use-calendar.js +148 -0
- package/lib/components/calendar/src/use-calendar.js.map +1 -0
- package/lib/components/calendar/src/use-date-table.d.ts +18 -0
- package/lib/components/calendar/src/use-date-table.js +105 -0
- package/lib/components/calendar/src/use-date-table.js.map +1 -0
- package/lib/components/color-picker/index.d.ts +3 -10
- package/lib/components/color-picker/src/color-picker.vue.d.ts +3 -10
- package/lib/components/date-picker/src/composables/use-range-picker.d.ts +1 -1
- package/lib/components/date-picker/src/date-picker-com/basic-date-table.vue.d.ts +6 -6
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +27 -34
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +29 -36
- package/lib/components/date-picker/src/date-picker-com/panel-month-range.vue.d.ts +3 -3
- package/lib/components/date-picker/src/panel-utils.d.ts +59 -73
- package/lib/components/dialog/index.d.ts +1 -0
- package/lib/components/dialog/src/dialog.vue.d.ts +1 -0
- package/lib/components/dialog/src/dialog2.js +4 -2
- package/lib/components/dialog/src/dialog2.js.map +1 -1
- package/lib/components/dialog/src/use-dialog.d.ts +1 -0
- package/lib/components/dialog/src/use-dialog.js +7 -0
- package/lib/components/dialog/src/use-dialog.js.map +1 -1
- package/lib/components/drawer/index.d.ts +1 -0
- package/lib/components/drawer/src/drawer.vue.d.ts +1 -0
- package/lib/components/pagination/src/components/next.js +34 -19
- package/lib/components/pagination/src/components/next.js.map +1 -1
- package/lib/components/pagination/src/components/next2.js +19 -34
- package/lib/components/pagination/src/components/next2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/popconfirm/index.d.ts +3 -10
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +3 -10
- package/lib/components/skeleton/index.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/lib/components/time-picker/src/composables/use-time-picker.d.ts +2 -2
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +5 -5
- package/lib/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +17 -17
- package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +17 -17
- package/lib/components/transfer/index.d.ts +3 -10
- package/lib/components/transfer/src/transfer.vue.d.ts +3 -10
- package/lib/components/tree-v2/index.d.ts +868 -3
- package/lib/components/tree-v2/src/composables/useCheck.d.ts +2 -1
- package/lib/components/tree-v2/src/composables/useCheck.js.map +1 -1
- package/lib/components/tree-v2/src/composables/useTree.d.ts +6 -3
- package/lib/components/tree-v2/src/composables/useTree.js +1 -1
- package/lib/components/tree-v2/src/composables/useTree.js.map +1 -1
- package/lib/components/tree-v2/src/tree-node.js +66 -81
- package/lib/components/tree-v2/src/tree-node.js.map +1 -1
- package/lib/components/tree-v2/src/tree-node.vue.d.ts +566 -3
- package/lib/components/tree-v2/src/tree.js +61 -74
- package/lib/components/tree-v2/src/tree.js.map +1 -1
- package/lib/components/tree-v2/src/tree.vue.d.ts +868 -3
- package/lib/components/tree-v2/src/types.d.ts +1 -1
- package/lib/components/tree-v2/src/virtual-tree.d.ts +3 -2
- package/lib/components/tree-v2/src/virtual-tree.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/web-types.json +1 -1
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
import dayjs from 'dayjs';
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, toDisplayString, createVNode, withCtx, createTextVNode, createCommentVNode, createSlots, normalizeProps, mergeProps, Fragment, renderList, createBlock } from 'vue';
|
|
3
2
|
import { ElButtonGroup, ElButton } from '../../button/index.mjs';
|
|
4
3
|
import '../../../hooks/index.mjs';
|
|
5
|
-
import '../../../utils/index.mjs';
|
|
6
|
-
import '../../../constants/index.mjs';
|
|
7
4
|
import DateTable from './date-table2.mjs';
|
|
5
|
+
import { useCalendar } from './use-calendar.mjs';
|
|
8
6
|
import { calendarProps, calendarEmits } from './calendar.mjs';
|
|
9
7
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
10
8
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
11
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
12
|
-
import { INPUT_EVENT, UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
|
|
13
|
-
import { debugWarn } from '../../../utils/error.mjs';
|
|
14
|
-
import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
|
|
15
9
|
|
|
16
10
|
const COMPONENT_NAME = "ElCalendar";
|
|
17
11
|
const __default__ = defineComponent({
|
|
@@ -23,126 +17,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
17
|
emits: calendarEmits,
|
|
24
18
|
setup(__props, { expose, emit }) {
|
|
25
19
|
const props = __props;
|
|
26
|
-
const solts = useSlots();
|
|
27
20
|
const ns = useNamespace("calendar");
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!val)
|
|
39
|
-
return;
|
|
40
|
-
selectedDay.value = val;
|
|
41
|
-
const result = val.toDate();
|
|
42
|
-
emit(INPUT_EVENT, result);
|
|
43
|
-
emit(UPDATE_MODEL_EVENT, result);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const validatedRange = computed(() => {
|
|
47
|
-
if (!props.range)
|
|
48
|
-
return [];
|
|
49
|
-
const rangeArrDayjs = props.range.map((_) => dayjs(_).locale(lang.value));
|
|
50
|
-
const [startDayjs, endDayjs] = rangeArrDayjs;
|
|
51
|
-
if (startDayjs.isAfter(endDayjs)) {
|
|
52
|
-
debugWarn(COMPONENT_NAME, "end time should be greater than start time");
|
|
53
|
-
return [];
|
|
54
|
-
}
|
|
55
|
-
if (startDayjs.isSame(endDayjs, "month")) {
|
|
56
|
-
return calculateValidatedDateRange(startDayjs, endDayjs);
|
|
57
|
-
} else {
|
|
58
|
-
if (startDayjs.add(1, "month").month() !== endDayjs.month()) {
|
|
59
|
-
debugWarn(COMPONENT_NAME, "start time and end time interval must not exceed two months");
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
return calculateValidatedDateRange(startDayjs, endDayjs);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
const date = computed(() => {
|
|
66
|
-
if (!props.modelValue) {
|
|
67
|
-
if (realSelectedDay.value) {
|
|
68
|
-
return realSelectedDay.value;
|
|
69
|
-
} else if (validatedRange.value.length) {
|
|
70
|
-
return validatedRange.value[0][0];
|
|
71
|
-
}
|
|
72
|
-
return now;
|
|
73
|
-
} else {
|
|
74
|
-
return dayjs(props.modelValue).locale(lang.value);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
const prevMonthDayjs = computed(() => date.value.subtract(1, "month").date(1));
|
|
78
|
-
const nextMonthDayjs = computed(() => date.value.add(1, "month").date(1));
|
|
79
|
-
const prevYearDayjs = computed(() => date.value.subtract(1, "year").date(1));
|
|
80
|
-
const nextYearDayjs = computed(() => date.value.add(1, "year").date(1));
|
|
81
|
-
const i18nDate = computed(() => {
|
|
82
|
-
const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
|
|
83
|
-
return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
|
|
84
|
-
});
|
|
85
|
-
const calculateValidatedDateRange = (startDayjs, endDayjs) => {
|
|
86
|
-
const firstDay = startDayjs.startOf("week");
|
|
87
|
-
const lastDay = endDayjs.endOf("week");
|
|
88
|
-
const firstMonth = firstDay.get("month");
|
|
89
|
-
const lastMonth = lastDay.get("month");
|
|
90
|
-
if (firstMonth === lastMonth) {
|
|
91
|
-
return [[firstDay, lastDay]];
|
|
92
|
-
} else if (firstMonth + 1 === lastMonth) {
|
|
93
|
-
const firstMonthLastDay = firstDay.endOf("month");
|
|
94
|
-
const lastMonthFirstDay = lastDay.startOf("month");
|
|
95
|
-
const isSameWeek = firstMonthLastDay.isSame(lastMonthFirstDay, "week");
|
|
96
|
-
const lastMonthStartDay = isSameWeek ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
|
|
97
|
-
return [
|
|
98
|
-
[firstDay, firstMonthLastDay],
|
|
99
|
-
[lastMonthStartDay.startOf("week"), lastDay]
|
|
100
|
-
];
|
|
101
|
-
} else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) {
|
|
102
|
-
const firstMonthLastDay = firstDay.endOf("month");
|
|
103
|
-
const secondMonthFirstDay = firstDay.add(1, "month").startOf("month");
|
|
104
|
-
const secondMonthStartDay = firstMonthLastDay.isSame(secondMonthFirstDay, "week") ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay;
|
|
105
|
-
const secondMonthLastDay = secondMonthStartDay.endOf("month");
|
|
106
|
-
const lastMonthFirstDay = lastDay.startOf("month");
|
|
107
|
-
const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
|
|
108
|
-
return [
|
|
109
|
-
[firstDay, firstMonthLastDay],
|
|
110
|
-
[secondMonthStartDay.startOf("week"), secondMonthLastDay],
|
|
111
|
-
[lastMonthStartDay.startOf("week"), lastDay]
|
|
112
|
-
];
|
|
113
|
-
} else {
|
|
114
|
-
debugWarn(COMPONENT_NAME, "start time and end time interval must not exceed two months");
|
|
115
|
-
return [];
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
const pickDay = (day) => {
|
|
119
|
-
realSelectedDay.value = day;
|
|
120
|
-
};
|
|
121
|
-
const selectDate = (type) => {
|
|
122
|
-
let day;
|
|
123
|
-
if (type === "prev-month") {
|
|
124
|
-
day = prevMonthDayjs.value;
|
|
125
|
-
} else if (type === "next-month") {
|
|
126
|
-
day = nextMonthDayjs.value;
|
|
127
|
-
} else if (type === "prev-year") {
|
|
128
|
-
day = prevYearDayjs.value;
|
|
129
|
-
} else if (type === "next-year") {
|
|
130
|
-
day = nextYearDayjs.value;
|
|
131
|
-
} else {
|
|
132
|
-
day = now;
|
|
133
|
-
}
|
|
134
|
-
if (day.isSame(date.value, "day"))
|
|
135
|
-
return;
|
|
136
|
-
pickDay(day);
|
|
137
|
-
};
|
|
138
|
-
useDeprecated({
|
|
139
|
-
from: '"dateCell"',
|
|
140
|
-
replacement: '"date-cell"',
|
|
141
|
-
scope: "ElCalendar",
|
|
142
|
-
version: "2.3.0",
|
|
143
|
-
ref: "https://element-plus.org/en-US/component/calendar.html#slots",
|
|
144
|
-
type: "Slot"
|
|
145
|
-
}, computed(() => !!solts.dateCell));
|
|
21
|
+
const {
|
|
22
|
+
calculateValidatedDateRange,
|
|
23
|
+
date,
|
|
24
|
+
pickDay,
|
|
25
|
+
realSelectedDay,
|
|
26
|
+
selectDate,
|
|
27
|
+
t,
|
|
28
|
+
i18nDate,
|
|
29
|
+
validatedRange
|
|
30
|
+
} = useCalendar(props, emit, COMPONENT_NAME);
|
|
146
31
|
expose({
|
|
147
32
|
selectedDay: realSelectedDay,
|
|
148
33
|
pickDay,
|
|
@@ -168,7 +53,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
168
53
|
default: withCtx(() => [
|
|
169
54
|
createVNode(unref(ElButton), {
|
|
170
55
|
size: "small",
|
|
171
|
-
onClick: _cache[0] || (_cache[0] = ($event) => selectDate("prev-month"))
|
|
56
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(selectDate)("prev-month"))
|
|
172
57
|
}, {
|
|
173
58
|
default: withCtx(() => [
|
|
174
59
|
createTextVNode(toDisplayString(unref(t)("el.datepicker.prevMonth")), 1)
|
|
@@ -177,7 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
177
62
|
}),
|
|
178
63
|
createVNode(unref(ElButton), {
|
|
179
64
|
size: "small",
|
|
180
|
-
onClick: _cache[1] || (_cache[1] = ($event) => selectDate("today"))
|
|
65
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(selectDate)("today"))
|
|
181
66
|
}, {
|
|
182
67
|
default: withCtx(() => [
|
|
183
68
|
createTextVNode(toDisplayString(unref(t)("el.datepicker.today")), 1)
|
|
@@ -186,7 +71,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
186
71
|
}),
|
|
187
72
|
createVNode(unref(ElButton), {
|
|
188
73
|
size: "small",
|
|
189
|
-
onClick: _cache[2] || (_cache[2] = ($event) => selectDate("next-month"))
|
|
74
|
+
onClick: _cache[2] || (_cache[2] = ($event) => unref(selectDate)("next-month"))
|
|
190
75
|
}, {
|
|
191
76
|
default: withCtx(() => [
|
|
192
77
|
createTextVNode(toDisplayString(unref(t)("el.datepicker.nextMonth")), 1)
|
|
@@ -206,7 +91,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
206
91
|
createVNode(DateTable, {
|
|
207
92
|
date: unref(date),
|
|
208
93
|
"selected-day": unref(realSelectedDay),
|
|
209
|
-
onPick: pickDay
|
|
94
|
+
onPick: unref(pickDay)
|
|
210
95
|
}, createSlots({ _: 2 }, [
|
|
211
96
|
_ctx.$slots["date-cell"] || _ctx.$slots.dateCell ? {
|
|
212
97
|
name: "date-cell",
|
|
@@ -214,7 +99,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
214
99
|
_ctx.$slots["date-cell"] ? renderSlot(_ctx.$slots, "date-cell", normalizeProps(mergeProps({ key: 0 }, data))) : renderSlot(_ctx.$slots, "dateCell", normalizeProps(mergeProps({ key: 1 }, data)))
|
|
215
100
|
])
|
|
216
101
|
} : void 0
|
|
217
|
-
]), 1032, ["date", "selected-day"])
|
|
102
|
+
]), 1032, ["date", "selected-day", "onPick"])
|
|
218
103
|
], 2)) : (openBlock(), createElementBlock("div", {
|
|
219
104
|
key: 1,
|
|
220
105
|
class: normalizeClass(unref(ns).e("body"))
|
|
@@ -226,7 +111,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
226
111
|
"selected-day": unref(realSelectedDay),
|
|
227
112
|
range: range_,
|
|
228
113
|
"hide-header": index !== 0,
|
|
229
|
-
onPick: pickDay
|
|
114
|
+
onPick: unref(pickDay)
|
|
230
115
|
}, createSlots({ _: 2 }, [
|
|
231
116
|
_ctx.$slots["date-cell"] || _ctx.$slots.dateCell ? {
|
|
232
117
|
name: "date-cell",
|
|
@@ -234,7 +119,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
234
119
|
_ctx.$slots["date-cell"] ? renderSlot(_ctx.$slots, "date-cell", normalizeProps(mergeProps({ key: 0 }, data))) : renderSlot(_ctx.$slots, "dateCell", normalizeProps(mergeProps({ key: 1 }, data)))
|
|
235
120
|
])
|
|
236
121
|
} : void 0
|
|
237
|
-
]), 1032, ["date", "selected-day", "range", "hide-header"]);
|
|
122
|
+
]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
|
|
238
123
|
}), 128))
|
|
239
124
|
], 2))
|
|
240
125
|
], 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar2.mjs","sources":["../../../../../../packages/components/calendar/src/calendar.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('header')\">\n <slot name=\"header\" :date=\"i18nDate\">\n <div :class=\"ns.e('title')\">{{ i18nDate }}</div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('button-group')\">\n <el-button-group>\n <el-button size=\"small\" @click=\"selectDate('prev-month')\">\n {{ t('el.datepicker.prevMonth') }}\n </el-button>\n <el-button size=\"small\" @click=\"selectDate('today')\">\n {{ t('el.datepicker.today') }}\n </el-button>\n <el-button size=\"small\" @click=\"selectDate('next-month')\">\n {{ t('el.datepicker.nextMonth') }}\n </el-button>\n </el-button-group>\n </div>\n </slot>\n </div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('body')\">\n <date-table :date=\"date\" :selected-day=\"realSelectedDay\" @pick=\"pickDay\">\n <template\n v-if=\"$slots['date-cell'] || $slots.dateCell\"\n #date-cell=\"data\"\n >\n <slot v-if=\"$slots['date-cell']\" name=\"date-cell\" v-bind=\"data\" />\n <slot v-else name=\"dateCell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n <div v-else :class=\"ns.e('body')\">\n <date-table\n v-for=\"(range_, index) in validatedRange\"\n :key=\"index\"\n :date=\"range_[0]\"\n :selected-day=\"realSelectedDay\"\n :range=\"range_\"\n :hide-header=\"index !== 0\"\n @pick=\"pickDay\"\n >\n <template\n v-if=\"$slots['date-cell'] || $slots.dateCell\"\n #date-cell=\"data\"\n >\n <slot v-if=\"$slots['date-cell']\" name=\"date-cell\" v-bind=\"data\" />\n <slot v-else name=\"dateCell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, useSlots } from 'vue'\nimport dayjs from 'dayjs'\nimport { ElButton, ElButtonGroup } from '@element-plus/components/button'\nimport { useDeprecated, useLocale, useNamespace } from '@element-plus/hooks'\nimport { debugWarn } from '@element-plus/utils'\nimport { INPUT_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport DateTable from './date-table.vue'\nimport { calendarEmits, calendarProps } from './calendar'\n\nimport type { CalendarDateType } from './calendar'\nimport type { ComputedRef } from 'vue'\nimport type { Dayjs } from 'dayjs'\n\nconst COMPONENT_NAME = 'ElCalendar'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(calendarProps)\nconst emit = defineEmits(calendarEmits)\n\nconst solts = useSlots()\nconst ns = useNamespace('calendar')\nconst { t, lang } = useLocale()\n\nconst selectedDay = ref<Dayjs>()\nconst now = dayjs().locale(lang.value)\n\nconst realSelectedDay = computed<Dayjs | undefined>({\n get() {\n if (!props.modelValue) return selectedDay.value\n return date.value\n },\n set(val) {\n if (!val) return\n selectedDay.value = val\n const result = val.toDate()\n\n emit(INPUT_EVENT, result)\n emit(UPDATE_MODEL_EVENT, result)\n },\n})\n\n// if range is valid, we get a two-digit array\nconst validatedRange = computed(() => {\n if (!props.range) return []\n const rangeArrDayjs = props.range.map((_) => dayjs(_).locale(lang.value))\n const [startDayjs, endDayjs] = rangeArrDayjs\n if (startDayjs.isAfter(endDayjs)) {\n debugWarn(COMPONENT_NAME, 'end time should be greater than start time')\n return []\n }\n if (startDayjs.isSame(endDayjs, 'month')) {\n // same month\n return calculateValidatedDateRange(startDayjs, endDayjs)\n } else {\n // two months\n if (startDayjs.add(1, 'month').month() !== endDayjs.month()) {\n debugWarn(\n COMPONENT_NAME,\n 'start time and end time interval must not exceed two months'\n )\n return []\n }\n return calculateValidatedDateRange(startDayjs, endDayjs)\n }\n})\n\nconst date: ComputedRef<Dayjs> = computed(() => {\n if (!props.modelValue) {\n if (realSelectedDay.value) {\n return realSelectedDay.value\n } else if (validatedRange.value.length) {\n return validatedRange.value[0][0]\n }\n return now\n } else {\n return dayjs(props.modelValue).locale(lang.value)\n }\n})\nconst prevMonthDayjs = computed(() => date.value.subtract(1, 'month').date(1))\nconst nextMonthDayjs = computed(() => date.value.add(1, 'month').date(1))\nconst prevYearDayjs = computed(() => date.value.subtract(1, 'year').date(1))\nconst nextYearDayjs = computed(() => date.value.add(1, 'year').date(1))\n\nconst i18nDate = computed(() => {\n const pickedMonth = `el.datepicker.month${date.value.format('M')}`\n return `${date.value.year()} ${t('el.datepicker.year')} ${t(pickedMonth)}`\n})\n\n// https://github.com/element-plus/element-plus/issues/3155\n// Calculate the validate date range according to the start and end dates\nconst calculateValidatedDateRange = (\n startDayjs: Dayjs,\n endDayjs: Dayjs\n): [Dayjs, Dayjs][] => {\n const firstDay = startDayjs.startOf('week')\n const lastDay = endDayjs.endOf('week')\n const firstMonth = firstDay.get('month')\n const lastMonth = lastDay.get('month')\n\n // Current mouth\n if (firstMonth === lastMonth) {\n return [[firstDay, lastDay]]\n }\n // Two adjacent months\n else if (firstMonth + 1 === lastMonth) {\n const firstMonthLastDay = firstDay.endOf('month')\n const lastMonthFirstDay = lastDay.startOf('month')\n\n // Whether the last day of the first month and the first day of the last month is in the same week\n const isSameWeek = firstMonthLastDay.isSame(lastMonthFirstDay, 'week')\n const lastMonthStartDay = isSameWeek\n ? lastMonthFirstDay.add(1, 'week')\n : lastMonthFirstDay\n\n return [\n [firstDay, firstMonthLastDay],\n [lastMonthStartDay.startOf('week'), lastDay],\n ]\n }\n // Three consecutive months (compatible: 2021-01-30 to 2021-02-28)\n else if (\n firstMonth + 2 === lastMonth ||\n (firstMonth + 1) % 11 === lastMonth\n ) {\n const firstMonthLastDay = firstDay.endOf('month')\n const secondMonthFirstDay = firstDay.add(1, 'month').startOf('month')\n\n // Whether the last day of the first month and the second month is in the same week\n const secondMonthStartDay = firstMonthLastDay.isSame(\n secondMonthFirstDay,\n 'week'\n )\n ? secondMonthFirstDay.add(1, 'week')\n : secondMonthFirstDay\n\n const secondMonthLastDay = secondMonthStartDay.endOf('month')\n const lastMonthFirstDay = lastDay.startOf('month')\n\n // Whether the last day of the second month and the last day of the last month is in the same week\n const lastMonthStartDay = secondMonthLastDay.isSame(\n lastMonthFirstDay,\n 'week'\n )\n ? lastMonthFirstDay.add(1, 'week')\n : lastMonthFirstDay\n\n return [\n [firstDay, firstMonthLastDay],\n [secondMonthStartDay.startOf('week'), secondMonthLastDay],\n [lastMonthStartDay.startOf('week'), lastDay],\n ]\n }\n // Other cases\n else {\n debugWarn(\n COMPONENT_NAME,\n 'start time and end time interval must not exceed two months'\n )\n return []\n }\n}\n\nconst pickDay = (day: Dayjs) => {\n realSelectedDay.value = day\n}\n\nconst selectDate = (type: CalendarDateType) => {\n let day: Dayjs\n if (type === 'prev-month') {\n day = prevMonthDayjs.value\n } else if (type === 'next-month') {\n day = nextMonthDayjs.value\n } else if (type === 'prev-year') {\n day = prevYearDayjs.value\n } else if (type === 'next-year') {\n day = nextYearDayjs.value\n } else {\n day = now\n }\n\n if (day.isSame(date.value, 'day')) return\n pickDay(day)\n}\n\nuseDeprecated(\n {\n from: '\"dateCell\"',\n replacement: '\"date-cell\"',\n scope: 'ElCalendar',\n version: '2.3.0',\n ref: 'https://element-plus.org/en-US/component/calendar.html#slots',\n type: 'Slot',\n },\n computed(() => !!solts.dateCell)\n)\n\ndefineExpose({\n /** @description currently selected date */\n selectedDay: realSelectedDay,\n /** @description select a specific date */\n pickDay,\n /** @description select date */\n selectDate,\n /** @description Calculate the validate date range according to the start and end dates */\n calculateValidatedDateRange,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;mCAoEc,CAAA;AAAA,EACZ,IAAM,EAAA,cA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OAAS,EAAA,OAAA;AAAA,MACT,GAAK,EAAA,8DAAA;AAAA,MACL,IAAM,EAAA,MAAA;AAAA,OAER,QAAS,CAAA,MAAM,CAAC,CAAC,KAAA,CAAM,QAAQ,CACjC,CAAA,CAAA;AAEA,IAAa,MAAA,CAAA;AAAA,MAEX,WAAa,EAAA,eAAA;AAAA,MAEb,OAAA;AAAA,MAEA,UAAA;AAAA,MAEA,2BAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"calendar2.mjs","sources":["../../../../../../packages/components/calendar/src/calendar.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('header')\">\n <slot name=\"header\" :date=\"i18nDate\">\n <div :class=\"ns.e('title')\">{{ i18nDate }}</div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('button-group')\">\n <el-button-group>\n <el-button size=\"small\" @click=\"selectDate('prev-month')\">\n {{ t('el.datepicker.prevMonth') }}\n </el-button>\n <el-button size=\"small\" @click=\"selectDate('today')\">\n {{ t('el.datepicker.today') }}\n </el-button>\n <el-button size=\"small\" @click=\"selectDate('next-month')\">\n {{ t('el.datepicker.nextMonth') }}\n </el-button>\n </el-button-group>\n </div>\n </slot>\n </div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('body')\">\n <date-table :date=\"date\" :selected-day=\"realSelectedDay\" @pick=\"pickDay\">\n <template\n v-if=\"$slots['date-cell'] || $slots.dateCell\"\n #date-cell=\"data\"\n >\n <slot v-if=\"$slots['date-cell']\" name=\"date-cell\" v-bind=\"data\" />\n <slot v-else name=\"dateCell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n <div v-else :class=\"ns.e('body')\">\n <date-table\n v-for=\"(range_, index) in validatedRange\"\n :key=\"index\"\n :date=\"range_[0]\"\n :selected-day=\"realSelectedDay\"\n :range=\"range_\"\n :hide-header=\"index !== 0\"\n @pick=\"pickDay\"\n >\n <template\n v-if=\"$slots['date-cell'] || $slots.dateCell\"\n #date-cell=\"data\"\n >\n <slot v-if=\"$slots['date-cell']\" name=\"date-cell\" v-bind=\"data\" />\n <slot v-else name=\"dateCell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ElButton, ElButtonGroup } from '@element-plus/components/button'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport DateTable from './date-table.vue'\nimport { useCalendar } from './use-calendar'\nimport { calendarEmits, calendarProps } from './calendar'\n\nconst ns = useNamespace('calendar')\n\nconst COMPONENT_NAME = 'ElCalendar'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(calendarProps)\nconst emit = defineEmits(calendarEmits)\n\nconst {\n calculateValidatedDateRange,\n date,\n pickDay,\n realSelectedDay,\n selectDate,\n t,\n i18nDate,\n validatedRange,\n} = useCalendar(props, emit, COMPONENT_NAME)\n\ndefineExpose({\n /** @description currently selected date */\n selectedDay: realSelectedDay,\n /** @description select a specific date */\n pickDay,\n /** @description select date */\n selectDate,\n /** @description Calculate the validate date range according to the start and end dates */\n calculateValidatedDateRange,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;mCAgEc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AALA,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAUlC,IAAM,MAAA;AAAA,MACJ,2BAAA;AAAA,MACA,IAAA;AAAA,MACA,OAAA;AAAA,MACA,eAAA;AAAA,MACA,UAAA;AAAA,MACA,CAAA;AAAA,MACA,QAAA;AAAA,MACA,cAAA;AAAA,KACE,GAAA,WAAA,CAAY,KAAO,EAAA,IAAA,EAAM,cAAc,CAAA,CAAA;AAE3C,IAAa,MAAA,CAAA;AAAA,MAEX,WAAa,EAAA,eAAA;AAAA,MAEb,OAAA;AAAA,MAEA,UAAA;AAAA,MAEA,2BAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue';
|
|
2
2
|
import type { Dayjs } from 'dayjs';
|
|
3
|
-
import type DateTable from './date-table.vue';
|
|
4
3
|
export declare type CalendarDateCellType = 'next' | 'prev' | 'current';
|
|
5
4
|
export declare type CalendarDateCell = {
|
|
6
5
|
text: number;
|
|
@@ -40,4 +39,3 @@ export declare const dateTableEmits: {
|
|
|
40
39
|
pick: (value: Dayjs) => boolean;
|
|
41
40
|
};
|
|
42
41
|
export declare type DateTableEmits = typeof dateTableEmits;
|
|
43
|
-
export declare type DateTableInstance = InstanceType<typeof DateTable>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-table.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.ts"],"sourcesContent":["import { buildProps, definePropType, isObject } from '@element-plus/utils'\nimport { rangeArr } from '@element-plus/components/time-picker'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Dayjs } from 'dayjs'\
|
|
1
|
+
{"version":3,"file":"date-table.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.ts"],"sourcesContent":["import { buildProps, definePropType, isObject } from '@element-plus/utils'\nimport { rangeArr } from '@element-plus/components/time-picker'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Dayjs } from 'dayjs'\n\nexport type CalendarDateCellType = 'next' | 'prev' | 'current'\nexport type CalendarDateCell = {\n text: number\n type: CalendarDateCellType\n}\n\nexport const getPrevMonthLastDays = (date: Dayjs, count: number) => {\n const lastDay = date.subtract(1, 'month').endOf('month').date()\n return rangeArr(count).map((_, index) => lastDay - (count - index - 1))\n}\n\nexport const getMonthDays = (date: Dayjs) => {\n const days = date.daysInMonth()\n return rangeArr(days).map((_, index) => index + 1)\n}\n\nexport const toNestedArr = (days: CalendarDateCell[]) =>\n rangeArr(days.length / 7).map((index) => {\n const start = index * 7\n return days.slice(start, start + 7)\n })\n\nexport const dateTableProps = buildProps({\n selectedDay: {\n type: definePropType<Dayjs>(Object),\n },\n range: {\n type: definePropType<[Dayjs, Dayjs]>(Array),\n },\n date: {\n type: definePropType<Dayjs>(Object),\n required: true,\n },\n hideHeader: {\n type: Boolean,\n },\n} as const)\nexport type DateTableProps = ExtractPropTypes<typeof dateTableProps>\n\nexport const dateTableEmits = {\n pick: (value: Dayjs) => isObject(value),\n}\nexport type DateTableEmits = typeof dateTableEmits\n"],"names":[],"mappings":";;;;;;AAEY,MAAC,oBAAoB,GAAG,CAAC,IAAI,EAAE,KAAK,KAAK;AACrD,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAClE,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,IAAI,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAClC,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC;AACrD,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAC9E,EAAE,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;AAC1B,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC,EAAE;AACS,MAAC,cAAc,GAAG,UAAU,CAAC;AACzC,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,cAAc,GAAG;AAC9B,EAAE,IAAI,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClC;;;;"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { CalendarDateCell, CalendarDateCellType } from './date-table';
|
|
3
|
-
import type { Dayjs } from 'dayjs';
|
|
1
|
+
import type { CalendarDateCell } from './date-table';
|
|
4
2
|
declare const _default: import("vue").DefineComponent<{
|
|
5
3
|
readonly selectedDay: {
|
|
6
|
-
readonly type: import("vue").PropType<dayjs.Dayjs>;
|
|
4
|
+
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
|
|
7
5
|
readonly required: false;
|
|
8
6
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
9
7
|
__epPropKey: true;
|
|
10
8
|
};
|
|
11
9
|
readonly range: {
|
|
12
|
-
readonly type: import("vue").PropType<[dayjs.Dayjs, dayjs.Dayjs]>;
|
|
10
|
+
readonly type: import("vue").PropType<[import("dayjs").Dayjs, import("dayjs").Dayjs]>;
|
|
13
11
|
readonly required: false;
|
|
14
12
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
15
13
|
__epPropKey: true;
|
|
16
14
|
};
|
|
17
15
|
readonly date: {
|
|
18
|
-
readonly type: import("vue").PropType<dayjs.Dayjs>;
|
|
16
|
+
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
|
|
19
17
|
readonly required: true;
|
|
20
18
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
21
19
|
__epPropKey: true;
|
|
@@ -29,19 +27,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
29
27
|
}, {
|
|
30
28
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
31
29
|
readonly selectedDay: {
|
|
32
|
-
readonly type: import("vue").PropType<dayjs.Dayjs>;
|
|
30
|
+
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
|
|
33
31
|
readonly required: false;
|
|
34
32
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
35
33
|
__epPropKey: true;
|
|
36
34
|
};
|
|
37
35
|
readonly range: {
|
|
38
|
-
readonly type: import("vue").PropType<[dayjs.Dayjs, dayjs.Dayjs]>;
|
|
36
|
+
readonly type: import("vue").PropType<[import("dayjs").Dayjs, import("dayjs").Dayjs]>;
|
|
39
37
|
readonly required: false;
|
|
40
38
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
41
39
|
__epPropKey: true;
|
|
42
40
|
};
|
|
43
41
|
readonly date: {
|
|
44
|
-
readonly type: import("vue").PropType<dayjs.Dayjs>;
|
|
42
|
+
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
|
|
45
43
|
readonly required: true;
|
|
46
44
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
47
45
|
__epPropKey: true;
|
|
@@ -53,11 +51,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
51
|
__epPropKey: true;
|
|
54
52
|
};
|
|
55
53
|
}>> & {
|
|
56
|
-
onPick?: ((value: dayjs.Dayjs) => any) | undefined;
|
|
54
|
+
onPick?: ((value: import("dayjs").Dayjs) => any) | undefined;
|
|
57
55
|
}>>;
|
|
58
|
-
emit: (event: "pick", value: dayjs.Dayjs) => void;
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
emit: (event: "pick", value: import("dayjs").Dayjs) => void;
|
|
57
|
+
isInRange: import("vue").ComputedRef<boolean>;
|
|
58
|
+
now: import("dayjs").Dayjs;
|
|
59
|
+
rows: import("vue").ComputedRef<CalendarDateCell[][]>;
|
|
60
|
+
weekDays: import("vue").ComputedRef<string[]>;
|
|
61
|
+
getFormattedDate: (day: number, type: import("./date-table").CalendarDateCellType) => import("dayjs").Dayjs;
|
|
62
|
+
handlePickDay: ({ text, type }: CalendarDateCell) => void;
|
|
63
|
+
getSlotData: ({ text, type }: CalendarDateCell) => {
|
|
64
|
+
isSelected: boolean;
|
|
65
|
+
type: string;
|
|
66
|
+
day: string;
|
|
67
|
+
date: Date;
|
|
68
|
+
};
|
|
61
69
|
nsTable: {
|
|
62
70
|
namespace: import("vue").Ref<string>;
|
|
63
71
|
b: (blockSuffix?: string) => string;
|
|
@@ -94,37 +102,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
94
102
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
95
103
|
cssVarBlockName: (name: string) => string;
|
|
96
104
|
};
|
|
97
|
-
now: dayjs.Dayjs;
|
|
98
|
-
firstDayOfWeek: number;
|
|
99
|
-
isInRange: import("vue").ComputedRef<boolean>;
|
|
100
|
-
rows: import("vue").ComputedRef<CalendarDateCell[][]>;
|
|
101
|
-
weekDays: import("vue").ComputedRef<string[]>;
|
|
102
|
-
getFormattedDate: (day: number, type: CalendarDateCellType) => Dayjs;
|
|
103
105
|
getCellClass: ({ text, type }: CalendarDateCell) => string[];
|
|
104
|
-
handlePickDay: ({ text, type }: CalendarDateCell) => void;
|
|
105
|
-
getSlotData: ({ text, type }: CalendarDateCell) => {
|
|
106
|
-
isSelected: boolean;
|
|
107
|
-
type: string;
|
|
108
|
-
day: string;
|
|
109
|
-
date: Date;
|
|
110
|
-
};
|
|
111
106
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
112
|
-
pick: (value: dayjs.Dayjs) => boolean;
|
|
107
|
+
pick: (value: import("dayjs").Dayjs) => boolean;
|
|
113
108
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
114
109
|
readonly selectedDay: {
|
|
115
|
-
readonly type: import("vue").PropType<dayjs.Dayjs>;
|
|
110
|
+
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
|
|
116
111
|
readonly required: false;
|
|
117
112
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
118
113
|
__epPropKey: true;
|
|
119
114
|
};
|
|
120
115
|
readonly range: {
|
|
121
|
-
readonly type: import("vue").PropType<[dayjs.Dayjs, dayjs.Dayjs]>;
|
|
116
|
+
readonly type: import("vue").PropType<[import("dayjs").Dayjs, import("dayjs").Dayjs]>;
|
|
122
117
|
readonly required: false;
|
|
123
118
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
124
119
|
__epPropKey: true;
|
|
125
120
|
};
|
|
126
121
|
readonly date: {
|
|
127
|
-
readonly type: import("vue").PropType<dayjs.Dayjs>;
|
|
122
|
+
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
|
|
128
123
|
readonly required: true;
|
|
129
124
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
130
125
|
__epPropKey: true;
|
|
@@ -136,6 +131,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
136
131
|
__epPropKey: true;
|
|
137
132
|
};
|
|
138
133
|
}>> & {
|
|
139
|
-
onPick?: ((value: dayjs.Dayjs) => any) | undefined;
|
|
134
|
+
onPick?: ((value: import("dayjs").Dayjs) => any) | undefined;
|
|
140
135
|
}, {}>;
|
|
141
136
|
export default _default;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
import dayjs from 'dayjs';
|
|
3
|
-
import localeData from 'dayjs/plugin/localeData.js';
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, Fragment, renderList, toDisplayString, createCommentVNode, createElementVNode, renderSlot } from 'vue';
|
|
4
2
|
import '../../../hooks/index.mjs';
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
7
|
-
import { dateTableProps, dateTableEmits, getPrevMonthLastDays, getMonthDays, toNestedArr } from './date-table.mjs';
|
|
3
|
+
import { dateTableProps, dateTableEmits } from './date-table.mjs';
|
|
4
|
+
import { useDateTable } from './use-date-table.mjs';
|
|
8
5
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
9
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
10
6
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
11
|
-
import { rangeArr } from '../../time-picker/src/utils.mjs';
|
|
12
|
-
import { WEEK_DAYS } from '../../../constants/date.mjs';
|
|
13
7
|
|
|
14
8
|
const _hoisted_1 = { key: 0 };
|
|
15
9
|
const _hoisted_2 = ["onClick"];
|
|
@@ -22,66 +16,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
16
|
emits: dateTableEmits,
|
|
23
17
|
setup(__props, { expose, emit }) {
|
|
24
18
|
const props = __props;
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
const {
|
|
20
|
+
isInRange,
|
|
21
|
+
now,
|
|
22
|
+
rows,
|
|
23
|
+
weekDays,
|
|
24
|
+
getFormattedDate,
|
|
25
|
+
handlePickDay,
|
|
26
|
+
getSlotData
|
|
27
|
+
} = useDateTable(props, emit);
|
|
27
28
|
const nsTable = useNamespace("calendar-table");
|
|
28
29
|
const nsDay = useNamespace("calendar-day");
|
|
29
|
-
const now = dayjs().locale(lang.value);
|
|
30
|
-
const firstDayOfWeek = dayjs.localeData().firstDayOfWeek();
|
|
31
|
-
const isInRange = computed(() => !!props.range && !!props.range.length);
|
|
32
|
-
const rows = computed(() => {
|
|
33
|
-
let days = [];
|
|
34
|
-
if (isInRange.value) {
|
|
35
|
-
const [start, end] = props.range;
|
|
36
|
-
const currentMonthRange = rangeArr(end.date() - start.date() + 1).map((index) => ({
|
|
37
|
-
text: start.date() + index,
|
|
38
|
-
type: "current"
|
|
39
|
-
}));
|
|
40
|
-
let remaining = currentMonthRange.length % 7;
|
|
41
|
-
remaining = remaining === 0 ? 0 : 7 - remaining;
|
|
42
|
-
const nextMonthRange = rangeArr(remaining).map((_, index) => ({
|
|
43
|
-
text: index + 1,
|
|
44
|
-
type: "next"
|
|
45
|
-
}));
|
|
46
|
-
days = currentMonthRange.concat(nextMonthRange);
|
|
47
|
-
} else {
|
|
48
|
-
const firstDay = props.date.startOf("month").day();
|
|
49
|
-
const prevMonthDays = getPrevMonthLastDays(props.date, (firstDay - firstDayOfWeek + 7) % 7).map((day) => ({
|
|
50
|
-
text: day,
|
|
51
|
-
type: "prev"
|
|
52
|
-
}));
|
|
53
|
-
const currentMonthDays = getMonthDays(props.date).map((day) => ({
|
|
54
|
-
text: day,
|
|
55
|
-
type: "current"
|
|
56
|
-
}));
|
|
57
|
-
days = [...prevMonthDays, ...currentMonthDays];
|
|
58
|
-
const remaining = 7 - (days.length % 7 || 7);
|
|
59
|
-
const nextMonthDays = rangeArr(remaining).map((_, index) => ({
|
|
60
|
-
text: index + 1,
|
|
61
|
-
type: "next"
|
|
62
|
-
}));
|
|
63
|
-
days = days.concat(nextMonthDays);
|
|
64
|
-
}
|
|
65
|
-
return toNestedArr(days);
|
|
66
|
-
});
|
|
67
|
-
const weekDays = computed(() => {
|
|
68
|
-
const start = firstDayOfWeek;
|
|
69
|
-
if (start === 0) {
|
|
70
|
-
return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`));
|
|
71
|
-
} else {
|
|
72
|
-
return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start)).map((_) => t(`el.datepicker.weeks.${_}`));
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
const getFormattedDate = (day, type) => {
|
|
76
|
-
switch (type) {
|
|
77
|
-
case "prev":
|
|
78
|
-
return props.date.startOf("month").subtract(1, "month").date(day);
|
|
79
|
-
case "next":
|
|
80
|
-
return props.date.startOf("month").add(1, "month").date(day);
|
|
81
|
-
case "current":
|
|
82
|
-
return props.date.date(day);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
30
|
const getCellClass = ({ text, type }) => {
|
|
86
31
|
const classes = [type];
|
|
87
32
|
if (type === "current") {
|
|
@@ -95,19 +40,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
95
40
|
}
|
|
96
41
|
return classes;
|
|
97
42
|
};
|
|
98
|
-
const handlePickDay = ({ text, type }) => {
|
|
99
|
-
const date = getFormattedDate(text, type);
|
|
100
|
-
emit("pick", date);
|
|
101
|
-
};
|
|
102
|
-
const getSlotData = ({ text, type }) => {
|
|
103
|
-
const day = getFormattedDate(text, type);
|
|
104
|
-
return {
|
|
105
|
-
isSelected: day.isSame(props.selectedDay),
|
|
106
|
-
type: `${type}-month`,
|
|
107
|
-
day: day.format("YYYY-MM-DD"),
|
|
108
|
-
date: day.toDate()
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
43
|
expose({
|
|
112
44
|
getFormattedDate
|
|
113
45
|
});
|
|
@@ -135,13 +67,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
135
67
|
return openBlock(), createElementBlock("td", {
|
|
136
68
|
key,
|
|
137
69
|
class: normalizeClass(getCellClass(cell)),
|
|
138
|
-
onClick: ($event) => handlePickDay(cell)
|
|
70
|
+
onClick: ($event) => unref(handlePickDay)(cell)
|
|
139
71
|
}, [
|
|
140
72
|
createElementVNode("div", {
|
|
141
73
|
class: normalizeClass(unref(nsDay).b())
|
|
142
74
|
}, [
|
|
143
75
|
renderSlot(_ctx.$slots, "date-cell", {
|
|
144
|
-
data: getSlotData(cell)
|
|
76
|
+
data: unref(getSlotData)(cell)
|
|
145
77
|
}, () => [
|
|
146
78
|
createElementVNode("span", null, toDisplayString(cell.text), 1)
|
|
147
79
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-table2.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.vue"],"sourcesContent":["<template>\n <table\n :class=\"[nsTable.b(), nsTable.is('range', isInRange)]\"\n cellspacing=\"0\"\n cellpadding=\"0\"\n >\n <thead v-if=\"!hideHeader\">\n <th v-for=\"day in weekDays\" :key=\"day\">{{ day }}</th>\n </thead>\n\n <tbody>\n <tr\n v-for=\"(row, index) in rows\"\n :key=\"index\"\n :class=\"{\n [nsTable.e('row')]: true,\n [nsTable.em('row', 'hide-border')]: index === 0 && hideHeader,\n }\"\n >\n <td\n v-for=\"(cell, key) in row\"\n :key=\"key\"\n :class=\"getCellClass(cell)\"\n @click=\"handlePickDay(cell)\"\n >\n <div :class=\"nsDay.b()\">\n <slot name=\"date-cell\" :data=\"getSlotData(cell)\">\n <span>{{ cell.text }}</span>\n </slot>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<script lang=\"ts\" setup>\nimport {
|
|
1
|
+
{"version":3,"file":"date-table2.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.vue"],"sourcesContent":["<template>\n <table\n :class=\"[nsTable.b(), nsTable.is('range', isInRange)]\"\n cellspacing=\"0\"\n cellpadding=\"0\"\n >\n <thead v-if=\"!hideHeader\">\n <th v-for=\"day in weekDays\" :key=\"day\">{{ day }}</th>\n </thead>\n\n <tbody>\n <tr\n v-for=\"(row, index) in rows\"\n :key=\"index\"\n :class=\"{\n [nsTable.e('row')]: true,\n [nsTable.em('row', 'hide-border')]: index === 0 && hideHeader,\n }\"\n >\n <td\n v-for=\"(cell, key) in row\"\n :key=\"key\"\n :class=\"getCellClass(cell)\"\n @click=\"handlePickDay(cell)\"\n >\n <div :class=\"nsDay.b()\">\n <slot name=\"date-cell\" :data=\"getSlotData(cell)\">\n <span>{{ cell.text }}</span>\n </slot>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useNamespace } from '@element-plus/hooks'\nimport { dateTableEmits, dateTableProps } from './date-table'\nimport { useDateTable } from './use-date-table'\n\nimport type { CalendarDateCell } from './date-table'\n\ndefineOptions({\n name: 'DateTable',\n})\n\nconst props = defineProps(dateTableProps)\nconst emit = defineEmits(dateTableEmits)\n\nconst {\n isInRange,\n now,\n rows,\n weekDays,\n getFormattedDate,\n handlePickDay,\n getSlotData,\n} = useDateTable(props, emit)\n\nconst nsTable = useNamespace('calendar-table')\nconst nsDay = useNamespace('calendar-day')\n\nconst getCellClass = ({ text, type }: CalendarDateCell) => {\n const classes: string[] = [type]\n if (type === 'current') {\n const date = getFormattedDate(text, type)\n if (date.isSame(props.selectedDay, 'day')) {\n classes.push(nsDay.is('selected'))\n }\n if (date.isSame(now, 'day')) {\n classes.push(nsDay.is('today'))\n }\n }\n return classes\n}\n\ndefineExpose({\n /** @description toggle date panel */\n getFormattedDate,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;mCA2Cc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA;AAAA,MACJ,SAAA;AAAA,MACA,GAAA;AAAA,MACA,IAAA;AAAA,MACA,QAAA;AAAA,MACA,gBAAA;AAAA,MACA,aAAA;AAAA,MACA,WAAA;AAAA,KACE,GAAA,YAAA,CAAa,OAAO,IAAI,CAAA,CAAA;AAE5B,IAAM,MAAA,OAAA,GAAU,aAAa,gBAAgB,CAAA,CAAA;AAC7C,IAAM,MAAA,KAAA,GAAQ,aAAa,cAAc,CAAA,CAAA;AAEzC,IAAA,MAAM,YAAe,GAAA,CAAC,EAAE,IAAA,EAAM,IAA6B,EAAA,KAAA;AACzD,MAAM,MAAA,OAAA,GAAoB,CAAC,IAAI,CAAA,CAAA;AAC/B,MAAA,IAAI,SAAS,SAAW,EAAA;AACtB,QAAM,MAAA,IAAA,GAAO,gBAAiB,CAAA,IAAA,EAAM,IAAI,CAAA,CAAA;AACxC,QAAA,IAAI,IAAK,CAAA,MAAA,CAAO,KAAM,CAAA,WAAA,EAAa,KAAK,CAAG,EAAA;AACzC,UAAA,OAAA,CAAQ,IAAK,CAAA,KAAA,CAAM,EAAG,CAAA,UAAU,CAAC,CAAA,CAAA;AAAA,SACnC;AACA,QAAA,IAAI,IAAK,CAAA,MAAA,CAAO,GAAK,EAAA,KAAK,CAAG,EAAA;AAC3B,UAAA,OAAA,CAAQ,IAAK,CAAA,KAAA,CAAM,EAAG,CAAA,OAAO,CAAC,CAAA,CAAA;AAAA,SAChC;AAAA,OACF;AACA,MAAO,OAAA,OAAA,CAAA;AAAA,KACT,CAAA;AAEA,IAAa,MAAA,CAAA;AAAA,MAEX,gBAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type DateTable from './date-table.vue';
|
|
2
|
+
import type Calendar from './calendar.vue';
|
|
3
|
+
export declare type DateTableInstance = InstanceType<typeof DateTable>;
|
|
4
|
+
export declare type CalendarDateTableInstance = DateTableInstance;
|
|
5
|
+
export declare type CalendarInstance = InstanceType<typeof Calendar>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import type { ComputedRef, SetupContext } from 'vue';
|
|
3
|
+
import type { Dayjs } from 'dayjs';
|
|
4
|
+
import type { CalendarDateType, CalendarEmits, CalendarProps } from './calendar';
|
|
5
|
+
export declare const useCalendar: (props: CalendarProps, emit: SetupContext<CalendarEmits>['emit'], componentName: string) => {
|
|
6
|
+
calculateValidatedDateRange: (startDayjs: Dayjs, endDayjs: Dayjs) => [Dayjs, Dayjs][];
|
|
7
|
+
date: ComputedRef<dayjs.Dayjs>;
|
|
8
|
+
realSelectedDay: import("vue").WritableComputedRef<dayjs.Dayjs | undefined>;
|
|
9
|
+
pickDay: (day: Dayjs) => void;
|
|
10
|
+
selectDate: (type: CalendarDateType) => void;
|
|
11
|
+
validatedRange: ComputedRef<[dayjs.Dayjs, dayjs.Dayjs][]>;
|
|
12
|
+
t: import("element-plus/es/hooks").Translator;
|
|
13
|
+
i18nDate: ComputedRef<string>;
|
|
14
|
+
};
|