element-plus 2.2.18 → 2.2.20
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 +1498 -1361
- package/dist/index.full.min.js +25 -25
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +25 -25
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +1499 -1362
- 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/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +2 -1
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/alert/index.d.ts +1 -0
- package/es/components/alert/index.mjs.map +1 -1
- package/es/components/alert/src/alert.d.ts +0 -2
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/instance.d.ts +2 -0
- package/es/components/alert/src/instance.mjs +2 -0
- package/es/components/alert/src/instance.mjs.map +1 -0
- package/es/components/autocomplete/index.d.ts +54 -111
- package/es/components/autocomplete/src/autocomplete.d.ts +1 -3
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +54 -111
- 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 +18 -129
- 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 +12 -0
- package/es/components/calendar/src/use-calendar.mjs +135 -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/carousel/index.d.ts +31 -60
- package/es/components/carousel/index.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item.d.ts +0 -2
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item.vue.d.ts +13 -20
- package/es/components/carousel/src/carousel-item2.mjs +21 -114
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/carousel/src/carousel.d.ts +0 -2
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +67 -84
- package/es/components/carousel/src/carousel2.mjs +40 -205
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/carousel/src/instance.d.ts +4 -0
- package/es/components/carousel/src/instance.mjs +2 -0
- package/es/components/carousel/src/instance.mjs.map +1 -0
- package/es/components/carousel/src/use-carousel-item.d.ts +13 -0
- package/es/components/carousel/src/use-carousel-item.mjs +125 -0
- package/es/components/carousel/src/use-carousel-item.mjs.map +1 -0
- package/es/components/carousel/src/use-carousel.d.ts +22 -0
- package/es/components/carousel/src/use-carousel.mjs +211 -0
- package/es/components/carousel/src/use-carousel.mjs.map +1 -0
- package/es/components/cascader/index.d.ts +66 -128
- package/es/components/cascader/src/index.mjs +9 -14
- package/es/components/cascader/src/index.mjs.map +1 -1
- package/es/components/cascader/src/index.vue.d.ts +33 -64
- package/es/components/cascader-panel/src/index.mjs +5 -3
- package/es/components/cascader-panel/src/index.mjs.map +1 -1
- package/es/components/checkbox/src/composables/use-checkbox.mjs +4 -5
- package/es/components/checkbox/src/composables/use-checkbox.mjs.map +1 -1
- package/es/components/collapse/index.d.ts +20 -59
- package/es/components/collapse/index.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item.d.ts +0 -2
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item.vue.d.ts +21 -32
- package/es/components/collapse/src/collapse-item2.mjs +34 -55
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/collapse/src/collapse.d.ts +0 -2
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse.vue.d.ts +6 -25
- package/es/components/collapse/src/collapse2.mjs +5 -39
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/collapse/src/instance.d.ts +4 -0
- package/es/components/collapse/src/instance.mjs +2 -0
- package/es/components/collapse/src/instance.mjs.map +1 -0
- package/es/components/collapse/src/use-collapse-item.d.ts +20 -0
- package/es/components/collapse/src/use-collapse-item.mjs +75 -0
- package/es/components/collapse/src/use-collapse-item.mjs.map +1 -0
- package/es/components/collapse/src/use-collapse.d.ts +9 -0
- package/es/components/collapse/src/use-collapse.mjs +52 -0
- package/es/components/collapse/src/use-collapse.mjs.map +1 -0
- package/es/components/color-picker/index.d.ts +22 -87
- package/es/components/color-picker/index.mjs +2 -2
- package/es/components/color-picker/src/color-picker.mjs +38 -317
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker.vue.d.ts +22 -87
- package/es/components/color-picker/src/color-picker2.mjs +317 -38
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/color-picker/src/components/predefine.mjs +1 -1
- package/es/components/date-picker/src/composables/use-month-range-header.mjs +2 -2
- package/es/components/date-picker/src/composables/use-month-range-header.mjs.map +1 -1
- 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 +45 -45
- package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +47 -47
- 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 +95 -95
- package/es/components/dialog/index.d.ts +2 -1
- package/es/components/dialog/src/dialog.vue.d.ts +2 -1
- 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 +2 -1
- package/es/components/drawer/src/drawer.vue.d.ts +2 -1
- package/es/components/dropdown/index.d.ts +4 -42
- package/es/components/dropdown/src/dropdown.d.ts +1 -0
- package/es/components/dropdown/src/dropdown.mjs +2 -1
- package/es/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.vue.d.ts +4 -42
- package/es/components/dropdown/src/dropdown2.mjs +2 -2
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/form/src/form2.mjs +2 -0
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/index.mjs +1 -1
- package/es/components/input/index.d.ts +20 -11
- package/es/components/input/index.mjs.map +1 -1
- package/es/components/input/src/input.d.ts +6 -1
- package/es/components/input/src/input.mjs +1 -2
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input.vue.d.ts +18 -11
- package/es/components/input/src/input2.mjs +5 -32
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/input-number/index.d.ts +49 -33
- package/es/components/input-number/src/input-number.vue.d.ts +49 -33
- package/es/components/input-number/src/input-number2.mjs +2 -2
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/message-box/src/message-box.type.d.ts +2 -0
- package/es/components/message-box/src/messageBox.mjs +20 -3
- package/es/components/message-box/src/messageBox.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper.vue.d.ts +18 -11
- package/es/components/pagination/src/components/sizes.vue.d.ts +1 -42
- package/es/components/popconfirm/index.d.ts +4 -76
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +4 -76
- package/es/components/popover/index.d.ts +1 -66
- package/es/components/popover/src/popover.vue.d.ts +1 -66
- package/es/components/popover/style/css.d.ts +1 -1
- package/es/components/popover/style/css.mjs +1 -1
- package/es/components/popover/style/index.d.ts +1 -1
- package/es/components/popover/style/index.mjs +1 -1
- package/es/components/popper/src/utils.d.ts +0 -4
- package/es/components/popper/src/utils.mjs +1 -2
- package/es/components/popper/src/utils.mjs.map +1 -1
- package/es/components/select/index.d.ts +1 -42
- package/es/components/select/src/select.vue.d.ts +1 -42
- package/es/components/select/src/useSelect.d.ts +1 -42
- package/es/components/select/src/useSelect.mjs +9 -9
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/index.d.ts +4 -86
- package/es/components/select-v2/src/select.vue.d.ts +2 -43
- package/es/components/select-v2/src/useSelect.d.ts +2 -43
- package/es/components/select-v2/src/useSelect.mjs +5 -5
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/skeleton/index.d.ts +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/es/components/slider/index.d.ts +49 -153
- package/es/components/slider/src/button.vue.d.ts +0 -24
- package/es/components/slider/src/composables/use-slide.d.ts +0 -96
- package/es/components/slider/src/slider.vue.d.ts +49 -153
- package/es/components/switch/src/switch2.mjs +15 -34
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/src/filter-panel.vue.d.ts +1 -42
- package/es/components/table/src/store/watcher.mjs +10 -0
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table/style-helper.mjs +1 -1
- package/es/components/table/src/table/style-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/render-helper.mjs +1 -1
- package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/styles-helper.d.ts +1 -1
- package/es/components/table/src/table-body/styles-helper.mjs +3 -3
- package/es/components/table/src/table-body/styles-helper.mjs.map +1 -1
- package/es/components/table/src/table-header/style.helper.mjs +2 -2
- package/es/components/table/src/table-header/style.helper.mjs.map +1 -1
- package/es/components/table/src/util.d.ts +5 -5
- package/es/components/table/src/util.mjs +46 -33
- package/es/components/table/src/util.mjs.map +1 -1
- package/es/components/table-v2/src/composables/use-styles.d.ts +1 -0
- package/es/components/table-v2/src/composables/use-styles.mjs +2 -1
- package/es/components/table-v2/src/composables/use-styles.mjs.map +1 -1
- package/es/components/table-v2/src/use-table.mjs +3 -2
- package/es/components/table-v2/src/use-table.mjs.map +1 -1
- package/es/components/tabs/src/tabs.mjs +14 -22
- package/es/components/tabs/src/tabs.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.mjs +2 -0
- package/es/components/time-picker/src/common/picker.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +19 -77
- 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/time-select/index.d.ts +4 -168
- package/es/components/time-select/src/time-select.vue.d.ts +2 -84
- package/es/components/tooltip/index.d.ts +0 -24
- package/es/components/tooltip/src/tooltip.d.ts +0 -7
- package/es/components/tooltip/src/tooltip.mjs +0 -7
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +3 -25
- package/es/components/tooltip/src/tooltip2.mjs +5 -19
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/transfer/index.d.ts +93 -65
- package/es/components/transfer/src/transfer-panel.vue.d.ts +18 -11
- package/es/components/transfer/src/transfer.vue.d.ts +93 -65
- package/es/components/tree-v2/index.d.ts +867 -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 +65 -80
- package/es/components/tree-v2/src/tree-node.mjs.map +1 -1
- package/es/components/tree-v2/src/tree-node.vue.d.ts +565 -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 +867 -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/components/upload/src/use-handlers.mjs +3 -0
- package/es/components/upload/src/use-handlers.mjs.map +1 -1
- package/es/hooks/index.d.ts +0 -1
- package/es/index.mjs +1 -1
- package/es/utils/dom/style.mjs +4 -4
- package/es/utils/dom/style.mjs.map +1 -1
- package/es/utils/index.mjs +1 -1
- package/es/utils/types.d.ts +1 -0
- package/es/utils/types.mjs +8 -2
- package/es/utils/types.mjs.map +1 -1
- package/es/utils/vue/vnode.mjs +4 -0
- package/es/utils/vue/vnode.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/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +2 -1
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/alert/index.d.ts +1 -0
- package/lib/components/alert/index.js.map +1 -1
- package/lib/components/alert/src/alert.d.ts +0 -2
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/instance.d.ts +2 -0
- package/lib/components/alert/src/instance.js +3 -0
- package/lib/components/alert/src/instance.js.map +1 -0
- package/lib/components/autocomplete/index.d.ts +54 -111
- package/lib/components/autocomplete/src/autocomplete.d.ts +1 -3
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +54 -111
- 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 +22 -137
- 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 +12 -0
- package/lib/components/calendar/src/use-calendar.js +143 -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/carousel/index.d.ts +31 -60
- package/lib/components/carousel/index.js.map +1 -1
- package/lib/components/carousel/src/carousel-item.d.ts +0 -2
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item.vue.d.ts +13 -20
- package/lib/components/carousel/src/carousel-item2.js +20 -113
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/carousel/src/carousel.d.ts +0 -2
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +67 -84
- package/lib/components/carousel/src/carousel2.js +42 -207
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/carousel/src/instance.d.ts +4 -0
- package/lib/components/carousel/src/instance.js +3 -0
- package/lib/components/carousel/src/instance.js.map +1 -0
- package/lib/components/carousel/src/use-carousel-item.d.ts +13 -0
- package/lib/components/carousel/src/use-carousel-item.js +129 -0
- package/lib/components/carousel/src/use-carousel-item.js.map +1 -0
- package/lib/components/carousel/src/use-carousel.d.ts +22 -0
- package/lib/components/carousel/src/use-carousel.js +215 -0
- package/lib/components/carousel/src/use-carousel.js.map +1 -0
- package/lib/components/cascader/index.d.ts +66 -128
- package/lib/components/cascader/src/index.js +8 -13
- package/lib/components/cascader/src/index.js.map +1 -1
- package/lib/components/cascader/src/index.vue.d.ts +33 -64
- package/lib/components/cascader-panel/src/index.js +4 -2
- package/lib/components/cascader-panel/src/index.js.map +1 -1
- package/lib/components/checkbox/src/composables/use-checkbox.js +4 -5
- package/lib/components/checkbox/src/composables/use-checkbox.js.map +1 -1
- package/lib/components/collapse/index.d.ts +20 -59
- package/lib/components/collapse/index.js.map +1 -1
- package/lib/components/collapse/src/collapse-item.d.ts +0 -2
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item.vue.d.ts +21 -32
- package/lib/components/collapse/src/collapse-item2.js +37 -58
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/collapse/src/collapse.d.ts +0 -2
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse.vue.d.ts +6 -25
- package/lib/components/collapse/src/collapse2.js +4 -38
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/collapse/src/instance.d.ts +4 -0
- package/lib/components/collapse/src/instance.js +3 -0
- package/lib/components/collapse/src/instance.js.map +1 -0
- package/lib/components/collapse/src/use-collapse-item.d.ts +20 -0
- package/lib/components/collapse/src/use-collapse-item.js +80 -0
- package/lib/components/collapse/src/use-collapse-item.js.map +1 -0
- package/lib/components/collapse/src/use-collapse.d.ts +9 -0
- package/lib/components/collapse/src/use-collapse.js +57 -0
- package/lib/components/collapse/src/use-collapse.js.map +1 -0
- package/lib/components/color-picker/index.d.ts +22 -87
- package/lib/components/color-picker/index.js +2 -2
- package/lib/components/color-picker/src/color-picker.js +38 -315
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker.vue.d.ts +22 -87
- package/lib/components/color-picker/src/color-picker2.js +315 -38
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/color-picker/src/components/predefine.js +1 -1
- package/lib/components/date-picker/src/composables/use-month-range-header.js +2 -2
- package/lib/components/date-picker/src/composables/use-month-range-header.js.map +1 -1
- 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 +45 -45
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +47 -47
- 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 +95 -95
- package/lib/components/dialog/index.d.ts +2 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +2 -1
- 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 +2 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +2 -1
- package/lib/components/dropdown/index.d.ts +4 -42
- package/lib/components/dropdown/src/dropdown.d.ts +1 -0
- package/lib/components/dropdown/src/dropdown.js +2 -1
- package/lib/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.vue.d.ts +4 -42
- package/lib/components/dropdown/src/dropdown2.js +2 -2
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/form/src/form2.js +2 -0
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/input/index.d.ts +20 -11
- package/lib/components/input/index.js.map +1 -1
- package/lib/components/input/src/input.d.ts +6 -1
- package/lib/components/input/src/input.js +1 -2
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input.vue.d.ts +18 -11
- package/lib/components/input/src/input2.js +4 -31
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/input-number/index.d.ts +49 -33
- package/lib/components/input-number/src/input-number.vue.d.ts +49 -33
- package/lib/components/input-number/src/input-number2.js +2 -2
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/message-box/src/message-box.type.d.ts +2 -0
- package/lib/components/message-box/src/messageBox.js +18 -1
- package/lib/components/message-box/src/messageBox.js.map +1 -1
- package/lib/components/pagination/src/components/jumper.vue.d.ts +18 -11
- package/lib/components/pagination/src/components/sizes.vue.d.ts +1 -42
- package/lib/components/popconfirm/index.d.ts +4 -76
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +4 -76
- package/lib/components/popover/index.d.ts +1 -66
- package/lib/components/popover/src/popover.vue.d.ts +1 -66
- package/lib/components/popover/style/css.d.ts +1 -1
- package/lib/components/popover/style/css.js +1 -1
- package/lib/components/popover/style/index.d.ts +1 -1
- package/lib/components/popover/style/index.js +1 -1
- package/lib/components/popper/src/utils.d.ts +0 -4
- package/lib/components/popper/src/utils.js +1 -2
- package/lib/components/popper/src/utils.js.map +1 -1
- package/lib/components/select/index.d.ts +1 -42
- package/lib/components/select/src/select.vue.d.ts +1 -42
- package/lib/components/select/src/useSelect.d.ts +1 -42
- package/lib/components/select/src/useSelect.js +7 -7
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/index.d.ts +4 -86
- package/lib/components/select-v2/src/select.vue.d.ts +2 -43
- package/lib/components/select-v2/src/useSelect.d.ts +2 -43
- package/lib/components/select-v2/src/useSelect.js +5 -5
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/skeleton/index.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/lib/components/slider/index.d.ts +49 -153
- package/lib/components/slider/src/button.vue.d.ts +0 -24
- package/lib/components/slider/src/composables/use-slide.d.ts +0 -96
- package/lib/components/slider/src/slider.vue.d.ts +49 -153
- package/lib/components/switch/src/switch2.js +14 -33
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/src/filter-panel.vue.d.ts +1 -42
- package/lib/components/table/src/store/watcher.js +10 -0
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table/style-helper.js +1 -1
- package/lib/components/table/src/table/style-helper.js.map +1 -1
- package/lib/components/table/src/table-body/render-helper.js +1 -1
- package/lib/components/table/src/table-body/render-helper.js.map +1 -1
- package/lib/components/table/src/table-body/styles-helper.d.ts +1 -1
- package/lib/components/table/src/table-body/styles-helper.js +3 -3
- package/lib/components/table/src/table-body/styles-helper.js.map +1 -1
- package/lib/components/table/src/table-header/style.helper.js +2 -2
- package/lib/components/table/src/table-header/style.helper.js.map +1 -1
- package/lib/components/table/src/util.d.ts +5 -5
- package/lib/components/table/src/util.js +46 -33
- package/lib/components/table/src/util.js.map +1 -1
- package/lib/components/table-v2/src/composables/use-styles.d.ts +1 -0
- package/lib/components/table-v2/src/composables/use-styles.js +2 -1
- package/lib/components/table-v2/src/composables/use-styles.js.map +1 -1
- package/lib/components/table-v2/src/use-table.js +3 -2
- package/lib/components/table-v2/src/use-table.js.map +1 -1
- package/lib/components/tabs/src/tabs.js +17 -25
- package/lib/components/tabs/src/tabs.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.js +2 -0
- package/lib/components/time-picker/src/common/picker.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +19 -77
- 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/time-select/index.d.ts +4 -168
- package/lib/components/time-select/src/time-select.vue.d.ts +2 -84
- package/lib/components/tooltip/index.d.ts +0 -24
- package/lib/components/tooltip/src/tooltip.d.ts +0 -7
- package/lib/components/tooltip/src/tooltip.js +0 -7
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +3 -25
- package/lib/components/tooltip/src/tooltip2.js +4 -18
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/transfer/index.d.ts +93 -65
- package/lib/components/transfer/src/transfer-panel.vue.d.ts +18 -11
- package/lib/components/transfer/src/transfer.vue.d.ts +93 -65
- package/lib/components/tree-v2/index.d.ts +867 -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 +67 -82
- package/lib/components/tree-v2/src/tree-node.js.map +1 -1
- package/lib/components/tree-v2/src/tree-node.vue.d.ts +565 -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 +867 -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/components/upload/src/use-handlers.js +3 -0
- package/lib/components/upload/src/use-handlers.js.map +1 -1
- package/lib/hooks/index.d.ts +0 -1
- package/lib/index.js +1 -1
- package/lib/utils/dom/style.js +4 -4
- package/lib/utils/dom/style.js.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/types.d.ts +1 -0
- package/lib/utils/types.js +7 -0
- package/lib/utils/types.js.map +1 -1
- package/lib/utils/vue/vnode.js +4 -0
- package/lib/utils/vue/vnode.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-cascader.css +1 -1
- package/theme-chalk/el-date-picker.css +1 -1
- package/theme-chalk/el-input-number.css +1 -1
- package/theme-chalk/el-input.css +1 -1
- package/theme-chalk/el-loading.css +1 -1
- package/theme-chalk/el-popover.css +1 -1
- package/theme-chalk/el-select.css +1 -1
- package/theme-chalk/el-slider.css +1 -1
- package/theme-chalk/el-switch.css +1 -1
- package/theme-chalk/el-time-picker.css +1 -1
- package/theme-chalk/el-time-select.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/cascader.scss +2 -0
- package/theme-chalk/src/date-picker/picker.scss +4 -0
- package/theme-chalk/src/input-number.scss +1 -1
- package/theme-chalk/src/input.scss +4 -0
- package/theme-chalk/src/loading.scss +0 -2
- package/theme-chalk/src/popover.scss +10 -1
- package/theme-chalk/src/select.scss +4 -0
- package/theme-chalk/src/slider.scss +1 -0
- package/theme-chalk/src/switch.scss +37 -41
- package/web-types.json +1 -1
- package/es/components/tabs/src/utils/pane.d.ts +0 -22
- package/es/components/tabs/src/utils/pane.mjs +0 -19
- package/es/components/tabs/src/utils/pane.mjs.map +0 -1
- package/lib/components/tabs/src/utils/pane.d.ts +0 -22
- package/lib/components/tabs/src/utils/pane.js +0 -24
- package/lib/components/tabs/src/utils/pane.js.map +0 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { useSlots, ref, computed } from 'vue';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import '../../../utils/index.mjs';
|
|
5
|
+
import '../../../constants/index.mjs';
|
|
6
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
7
|
+
import { INPUT_EVENT, UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
|
|
8
|
+
import { debugWarn } from '../../../utils/error.mjs';
|
|
9
|
+
import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
|
|
10
|
+
|
|
11
|
+
const adjacentMonth = (start, end) => {
|
|
12
|
+
const firstMonthLastDay = start.endOf("month");
|
|
13
|
+
const lastMonthFirstDay = end.startOf("month");
|
|
14
|
+
const isSameWeek = firstMonthLastDay.isSame(lastMonthFirstDay, "week");
|
|
15
|
+
const lastMonthStartDay = isSameWeek ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
|
|
16
|
+
return [
|
|
17
|
+
[start, firstMonthLastDay],
|
|
18
|
+
[lastMonthStartDay.startOf("week"), end]
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
const threeConsecutiveMonth = (start, end) => {
|
|
22
|
+
const firstMonthLastDay = start.endOf("month");
|
|
23
|
+
const secondMonthFirstDay = start.add(1, "month").startOf("month");
|
|
24
|
+
const secondMonthStartDay = firstMonthLastDay.isSame(secondMonthFirstDay, "week") ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay;
|
|
25
|
+
const secondMonthLastDay = secondMonthStartDay.endOf("month");
|
|
26
|
+
const lastMonthFirstDay = end.startOf("month");
|
|
27
|
+
const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
|
|
28
|
+
return [
|
|
29
|
+
[start, firstMonthLastDay],
|
|
30
|
+
[secondMonthStartDay.startOf("week"), secondMonthLastDay],
|
|
31
|
+
[lastMonthStartDay.startOf("week"), end]
|
|
32
|
+
];
|
|
33
|
+
};
|
|
34
|
+
const useCalendar = (props, emit, componentName) => {
|
|
35
|
+
const slots = useSlots();
|
|
36
|
+
const { lang } = useLocale();
|
|
37
|
+
const selectedDay = ref();
|
|
38
|
+
const now = dayjs().locale(lang.value);
|
|
39
|
+
const realSelectedDay = computed({
|
|
40
|
+
get() {
|
|
41
|
+
if (!props.modelValue)
|
|
42
|
+
return selectedDay.value;
|
|
43
|
+
return date.value;
|
|
44
|
+
},
|
|
45
|
+
set(val) {
|
|
46
|
+
if (!val)
|
|
47
|
+
return;
|
|
48
|
+
selectedDay.value = val;
|
|
49
|
+
const result = val.toDate();
|
|
50
|
+
emit(INPUT_EVENT, result);
|
|
51
|
+
emit(UPDATE_MODEL_EVENT, result);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const validatedRange = computed(() => {
|
|
55
|
+
if (!props.range)
|
|
56
|
+
return [];
|
|
57
|
+
const rangeArrDayjs = props.range.map((_) => dayjs(_).locale(lang.value));
|
|
58
|
+
const [startDayjs, endDayjs] = rangeArrDayjs;
|
|
59
|
+
if (startDayjs.isAfter(endDayjs)) {
|
|
60
|
+
debugWarn(componentName, "end time should be greater than start time");
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
if (startDayjs.isSame(endDayjs, "month")) {
|
|
64
|
+
return calculateValidatedDateRange(startDayjs, endDayjs);
|
|
65
|
+
} else {
|
|
66
|
+
if (startDayjs.add(1, "month").month() !== endDayjs.month()) {
|
|
67
|
+
debugWarn(componentName, "start time and end time interval must not exceed two months");
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
return calculateValidatedDateRange(startDayjs, endDayjs);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const date = computed(() => {
|
|
74
|
+
if (!props.modelValue) {
|
|
75
|
+
return realSelectedDay.value || (validatedRange.value.length ? validatedRange.value[0][0] : now);
|
|
76
|
+
} else {
|
|
77
|
+
return dayjs(props.modelValue).locale(lang.value);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const prevMonthDayjs = computed(() => date.value.subtract(1, "month").date(1));
|
|
81
|
+
const nextMonthDayjs = computed(() => date.value.add(1, "month").date(1));
|
|
82
|
+
const prevYearDayjs = computed(() => date.value.subtract(1, "year").date(1));
|
|
83
|
+
const nextYearDayjs = computed(() => date.value.add(1, "year").date(1));
|
|
84
|
+
const calculateValidatedDateRange = (startDayjs, endDayjs) => {
|
|
85
|
+
const firstDay = startDayjs.startOf("week");
|
|
86
|
+
const lastDay = endDayjs.endOf("week");
|
|
87
|
+
const firstMonth = firstDay.get("month");
|
|
88
|
+
const lastMonth = lastDay.get("month");
|
|
89
|
+
if (firstMonth === lastMonth) {
|
|
90
|
+
return [[firstDay, lastDay]];
|
|
91
|
+
} else if (firstMonth + 1 === lastMonth) {
|
|
92
|
+
return adjacentMonth(firstDay, lastDay);
|
|
93
|
+
} else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) {
|
|
94
|
+
return threeConsecutiveMonth(firstDay, lastDay);
|
|
95
|
+
} else {
|
|
96
|
+
debugWarn(componentName, "start time and end time interval must not exceed two months");
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const pickDay = (day) => {
|
|
101
|
+
realSelectedDay.value = day;
|
|
102
|
+
};
|
|
103
|
+
const selectDate = (type) => {
|
|
104
|
+
const dateMap = {
|
|
105
|
+
"prev-month": prevMonthDayjs.value,
|
|
106
|
+
"next-month": nextMonthDayjs.value,
|
|
107
|
+
"prev-year": prevYearDayjs.value,
|
|
108
|
+
"next-year": nextYearDayjs.value,
|
|
109
|
+
today: now
|
|
110
|
+
};
|
|
111
|
+
const day = dateMap[type];
|
|
112
|
+
if (!day.isSame(date.value, "day")) {
|
|
113
|
+
pickDay(day);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
useDeprecated({
|
|
117
|
+
from: '"dateCell"',
|
|
118
|
+
replacement: '"date-cell"',
|
|
119
|
+
scope: "ElCalendar",
|
|
120
|
+
version: "2.3.0",
|
|
121
|
+
ref: "https://element-plus.org/en-US/component/calendar.html#slots",
|
|
122
|
+
type: "Slot"
|
|
123
|
+
}, computed(() => !!slots.dateCell));
|
|
124
|
+
return {
|
|
125
|
+
calculateValidatedDateRange,
|
|
126
|
+
date,
|
|
127
|
+
realSelectedDay,
|
|
128
|
+
pickDay,
|
|
129
|
+
selectDate,
|
|
130
|
+
validatedRange
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export { useCalendar };
|
|
135
|
+
//# sourceMappingURL=use-calendar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-calendar.mjs","sources":["../../../../../../packages/components/calendar/src/use-calendar.ts"],"sourcesContent":["import { computed, ref, useSlots } from 'vue'\nimport dayjs from 'dayjs'\nimport { useDeprecated, useLocale } from '@element-plus/hooks'\nimport { debugWarn } from '@element-plus/utils'\nimport { INPUT_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ComputedRef, SetupContext } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type { CalendarDateType, CalendarEmits, CalendarProps } from './calendar'\n\nconst adjacentMonth = (start: Dayjs, end: Dayjs): [Dayjs, Dayjs][] => {\n const firstMonthLastDay = start.endOf('month')\n const lastMonthFirstDay = end.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 [start, firstMonthLastDay],\n [lastMonthStartDay.startOf('week'), end],\n ]\n}\n\nconst threeConsecutiveMonth = (start: Dayjs, end: Dayjs): [Dayjs, Dayjs][] => {\n const firstMonthLastDay = start.endOf('month')\n const secondMonthFirstDay = start.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 = end.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(lastMonthFirstDay, 'week')\n ? lastMonthFirstDay.add(1, 'week')\n : lastMonthFirstDay\n\n return [\n [start, firstMonthLastDay],\n [secondMonthStartDay.startOf('week'), secondMonthLastDay],\n [lastMonthStartDay.startOf('week'), end],\n ]\n}\n\nexport const useCalendar = (\n props: CalendarProps,\n emit: SetupContext<CalendarEmits>['emit'],\n componentName: string\n) => {\n const slots = useSlots()\n const { lang } = useLocale()\n\n const selectedDay = ref<Dayjs>()\n const now = dayjs().locale(lang.value)\n\n const 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\n const 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(componentName, '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 componentName,\n 'start time and end time interval must not exceed two months'\n )\n return []\n }\n return calculateValidatedDateRange(startDayjs, endDayjs)\n }\n })\n\n const date: ComputedRef<Dayjs> = computed(() => {\n if (!props.modelValue) {\n return (\n realSelectedDay.value ||\n (validatedRange.value.length ? validatedRange.value[0][0] : now)\n )\n } else {\n return dayjs(props.modelValue).locale(lang.value)\n }\n })\n const prevMonthDayjs = computed(() => date.value.subtract(1, 'month').date(1))\n const nextMonthDayjs = computed(() => date.value.add(1, 'month').date(1))\n const prevYearDayjs = computed(() => date.value.subtract(1, 'year').date(1))\n const nextYearDayjs = computed(() => date.value.add(1, 'year').date(1))\n\n // https://github.com/element-plus/element-plus/issues/3155\n // Calculate the validate date range according to the start and end dates\n const 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 return adjacentMonth(firstDay, lastDay)\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 return threeConsecutiveMonth(firstDay, lastDay)\n }\n // Other cases\n else {\n debugWarn(\n componentName,\n 'start time and end time interval must not exceed two months'\n )\n return []\n }\n }\n\n const pickDay = (day: Dayjs) => {\n realSelectedDay.value = day\n }\n\n const selectDate = (type: CalendarDateType) => {\n const dateMap: Record<CalendarDateType, Dayjs> = {\n 'prev-month': prevMonthDayjs.value,\n 'next-month': nextMonthDayjs.value,\n 'prev-year': prevYearDayjs.value,\n 'next-year': nextYearDayjs.value,\n today: now,\n }\n\n const day = dateMap[type]\n\n if (!day.isSame(date.value, 'day')) {\n pickDay(day)\n }\n }\n\n useDeprecated(\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(() => !!slots.dateCell)\n )\n\n return {\n calculateValidatedDateRange,\n date,\n realSelectedDay,\n pickDay,\n selectDate,\n validatedRange,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAKA,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK;AACtC,EAAE,MAAM,iBAAiB,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACjD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BAA2B;AAC/B,IAAI,IAAI;AACR,IAAI,eAAe;AACnB,IAAI,OAAO;AACX,IAAI,UAAU;AACd,IAAI,cAAc;AAClB,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import type { SetupContext } from 'vue';
|
|
3
|
+
import type { Dayjs } from 'dayjs';
|
|
4
|
+
import type { CalendarDateCell, CalendarDateCellType, DateTableEmits, DateTableProps } from './date-table';
|
|
5
|
+
export declare const useDateTable: (props: DateTableProps, emit: SetupContext<DateTableEmits>['emit']) => {
|
|
6
|
+
now: dayjs.Dayjs;
|
|
7
|
+
isInRange: import("vue").ComputedRef<boolean>;
|
|
8
|
+
rows: import("vue").ComputedRef<CalendarDateCell[][]>;
|
|
9
|
+
weekDays: import("vue").ComputedRef<string[]>;
|
|
10
|
+
getFormattedDate: (day: number, type: CalendarDateCellType) => Dayjs;
|
|
11
|
+
handlePickDay: ({ text, type }: CalendarDateCell) => void;
|
|
12
|
+
getSlotData: ({ text, type }: CalendarDateCell) => {
|
|
13
|
+
isSelected: boolean;
|
|
14
|
+
type: string;
|
|
15
|
+
day: string;
|
|
16
|
+
date: Date;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import localeData from 'dayjs/plugin/localeData.js';
|
|
4
|
+
import '../../../hooks/index.mjs';
|
|
5
|
+
import '../../time-picker/index.mjs';
|
|
6
|
+
import '../../../constants/index.mjs';
|
|
7
|
+
import { getPrevMonthLastDays, getMonthDays, toNestedArr } from './date-table.mjs';
|
|
8
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
9
|
+
import { rangeArr } from '../../time-picker/src/utils.mjs';
|
|
10
|
+
import { WEEK_DAYS } from '../../../constants/date.mjs';
|
|
11
|
+
|
|
12
|
+
const useDateTable = (props, emit) => {
|
|
13
|
+
dayjs.extend(localeData);
|
|
14
|
+
const firstDayOfWeek = dayjs.localeData().firstDayOfWeek();
|
|
15
|
+
const { t, lang } = useLocale();
|
|
16
|
+
const now = dayjs().locale(lang.value);
|
|
17
|
+
const isInRange = computed(() => !!props.range && !!props.range.length);
|
|
18
|
+
const rows = computed(() => {
|
|
19
|
+
let days = [];
|
|
20
|
+
if (isInRange.value) {
|
|
21
|
+
const [start, end] = props.range;
|
|
22
|
+
const currentMonthRange = rangeArr(end.date() - start.date() + 1).map((index) => ({
|
|
23
|
+
text: start.date() + index,
|
|
24
|
+
type: "current"
|
|
25
|
+
}));
|
|
26
|
+
let remaining = currentMonthRange.length % 7;
|
|
27
|
+
remaining = remaining === 0 ? 0 : 7 - remaining;
|
|
28
|
+
const nextMonthRange = rangeArr(remaining).map((_, index) => ({
|
|
29
|
+
text: index + 1,
|
|
30
|
+
type: "next"
|
|
31
|
+
}));
|
|
32
|
+
days = currentMonthRange.concat(nextMonthRange);
|
|
33
|
+
} else {
|
|
34
|
+
const firstDay = props.date.startOf("month").day();
|
|
35
|
+
const prevMonthDays = getPrevMonthLastDays(props.date, (firstDay - firstDayOfWeek + 7) % 7).map((day) => ({
|
|
36
|
+
text: day,
|
|
37
|
+
type: "prev"
|
|
38
|
+
}));
|
|
39
|
+
const currentMonthDays = getMonthDays(props.date).map((day) => ({
|
|
40
|
+
text: day,
|
|
41
|
+
type: "current"
|
|
42
|
+
}));
|
|
43
|
+
days = [...prevMonthDays, ...currentMonthDays];
|
|
44
|
+
const remaining = 7 - (days.length % 7 || 7);
|
|
45
|
+
const nextMonthDays = rangeArr(remaining).map((_, index) => ({
|
|
46
|
+
text: index + 1,
|
|
47
|
+
type: "next"
|
|
48
|
+
}));
|
|
49
|
+
days = days.concat(nextMonthDays);
|
|
50
|
+
}
|
|
51
|
+
return toNestedArr(days);
|
|
52
|
+
});
|
|
53
|
+
const weekDays = computed(() => {
|
|
54
|
+
const start = firstDayOfWeek;
|
|
55
|
+
if (start === 0) {
|
|
56
|
+
return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`));
|
|
57
|
+
} else {
|
|
58
|
+
return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start)).map((_) => t(`el.datepicker.weeks.${_}`));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const getFormattedDate = (day, type) => {
|
|
62
|
+
switch (type) {
|
|
63
|
+
case "prev":
|
|
64
|
+
return props.date.startOf("month").subtract(1, "month").date(day);
|
|
65
|
+
case "next":
|
|
66
|
+
return props.date.startOf("month").add(1, "month").date(day);
|
|
67
|
+
case "current":
|
|
68
|
+
return props.date.date(day);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const handlePickDay = ({ text, type }) => {
|
|
72
|
+
const date = getFormattedDate(text, type);
|
|
73
|
+
emit("pick", date);
|
|
74
|
+
};
|
|
75
|
+
const getSlotData = ({ text, type }) => {
|
|
76
|
+
const day = getFormattedDate(text, type);
|
|
77
|
+
return {
|
|
78
|
+
isSelected: day.isSame(props.selectedDay),
|
|
79
|
+
type: `${type}-month`,
|
|
80
|
+
day: day.format("YYYY-MM-DD"),
|
|
81
|
+
date: day.toDate()
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
now,
|
|
86
|
+
isInRange,
|
|
87
|
+
rows,
|
|
88
|
+
weekDays,
|
|
89
|
+
getFormattedDate,
|
|
90
|
+
handlePickDay,
|
|
91
|
+
getSlotData
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export { useDateTable };
|
|
96
|
+
//# sourceMappingURL=use-date-table.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-date-table.mjs","sources":["../../../../../../packages/components/calendar/src/use-date-table.ts"],"sourcesContent":["import { computed } from 'vue'\nimport dayjs from 'dayjs'\nimport localeData from 'dayjs/plugin/localeData.js'\nimport { useLocale } from '@element-plus/hooks'\nimport { rangeArr } from '@element-plus/components/time-picker'\nimport { WEEK_DAYS } from '@element-plus/constants'\nimport { getMonthDays, getPrevMonthLastDays, toNestedArr } from './date-table'\n\nimport type { SetupContext } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type {\n CalendarDateCell,\n CalendarDateCellType,\n DateTableEmits,\n DateTableProps,\n} from './date-table'\n\nexport const useDateTable = (\n props: DateTableProps,\n emit: SetupContext<DateTableEmits>['emit']\n) => {\n dayjs.extend(localeData)\n // https://day.js.org/docs/en/i18n/locale-data\n const firstDayOfWeek: number = dayjs.localeData().firstDayOfWeek()\n\n const { t, lang } = useLocale()\n const now = dayjs().locale(lang.value)\n\n const isInRange = computed(() => !!props.range && !!props.range.length)\n\n const rows = computed(() => {\n let days: CalendarDateCell[] = []\n if (isInRange.value) {\n const [start, end] = props.range!\n const currentMonthRange: CalendarDateCell[] = rangeArr(\n end.date() - start.date() + 1\n ).map((index) => ({\n text: start.date() + index,\n type: 'current',\n }))\n\n let remaining = currentMonthRange.length % 7\n remaining = remaining === 0 ? 0 : 7 - remaining\n const nextMonthRange: CalendarDateCell[] = rangeArr(remaining).map(\n (_, index) => ({\n text: index + 1,\n type: 'next',\n })\n )\n days = currentMonthRange.concat(nextMonthRange)\n } else {\n const firstDay = props.date.startOf('month').day()\n const prevMonthDays: CalendarDateCell[] = getPrevMonthLastDays(\n props.date,\n (firstDay - firstDayOfWeek + 7) % 7\n ).map((day) => ({\n text: day,\n type: 'prev',\n }))\n const currentMonthDays: CalendarDateCell[] = getMonthDays(props.date).map(\n (day) => ({\n text: day,\n type: 'current',\n })\n )\n days = [...prevMonthDays, ...currentMonthDays]\n const remaining = 7 - (days.length % 7 || 7)\n const nextMonthDays: CalendarDateCell[] = rangeArr(remaining).map(\n (_, index) => ({\n text: index + 1,\n type: 'next',\n })\n )\n days = days.concat(nextMonthDays)\n }\n return toNestedArr(days)\n })\n\n const weekDays = computed(() => {\n const start = firstDayOfWeek\n if (start === 0) {\n return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`))\n } else {\n return WEEK_DAYS.slice(start)\n .concat(WEEK_DAYS.slice(0, start))\n .map((_) => t(`el.datepicker.weeks.${_}`))\n }\n })\n\n const getFormattedDate = (day: number, type: CalendarDateCellType): Dayjs => {\n switch (type) {\n case 'prev':\n return props.date.startOf('month').subtract(1, 'month').date(day)\n case 'next':\n return props.date.startOf('month').add(1, 'month').date(day)\n case 'current':\n return props.date.date(day)\n }\n }\n\n const handlePickDay = ({ text, type }: CalendarDateCell) => {\n const date = getFormattedDate(text, type)\n emit('pick', date)\n }\n\n const getSlotData = ({ text, type }: CalendarDateCell) => {\n const day = getFormattedDate(text, type)\n return {\n isSelected: day.isSame(props.selectedDay),\n type: `${type}-month`,\n day: day.format('YYYY-MM-DD'),\n date: day.toDate(),\n }\n }\n\n return {\n now,\n isInRange,\n rows,\n weekDays,\n getFormattedDate,\n handlePickDay,\n getSlotData,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAOY,MAAC,YAAY,GAAG,CAAC,KAAK,EAAE,IAAI,KAAK;AAC7C,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAC3B,EAAE,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,CAAC;AAC7D,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC;AAClC,EAAE,MAAM,GAAG,GAAG,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzC,EAAE,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC1E,EAAE,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM;AAC9B,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;AAClB,IAAI,IAAI,SAAS,CAAC,KAAK,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SAAS;AACb,IAAI,IAAI;AACR,IAAI,QAAQ;AACZ,IAAI,gBAAgB;AACpB,IAAI,aAAa;AACjB,IAAI,WAAW;AACf,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -12,6 +12,7 @@ export declare const ElCarousel: import("element-plus/es/utils").SFCWithInstall<
|
|
|
12
12
|
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
|
|
13
13
|
readonly pauseOnHover: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
14
14
|
}, {
|
|
15
|
+
COMPONENT_NAME: string;
|
|
15
16
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
16
17
|
readonly initialIndex: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
17
18
|
readonly height: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -29,6 +30,23 @@ export declare const ElCarousel: import("element-plus/es/utils").SFCWithInstall<
|
|
|
29
30
|
onChange?: ((current: number, prev: number) => any) | undefined;
|
|
30
31
|
}>>;
|
|
31
32
|
emit: (event: "change", current: number, prev: number) => void;
|
|
33
|
+
root: import("vue").Ref<HTMLDivElement | undefined>;
|
|
34
|
+
activeIndex: import("vue").Ref<number>;
|
|
35
|
+
arrowDisplay: import("vue").ComputedRef<boolean>;
|
|
36
|
+
hasLabel: import("vue").ComputedRef<boolean>;
|
|
37
|
+
hover: import("vue").Ref<boolean>;
|
|
38
|
+
isCardType: import("vue").ComputedRef<boolean>;
|
|
39
|
+
items: import("vue").ShallowRef<import("../..").CarouselItemContext[]>;
|
|
40
|
+
handleButtonEnter: (arrow: "left" | "right") => void;
|
|
41
|
+
handleButtonLeave: () => void;
|
|
42
|
+
handleIndicatorClick: (index: number) => void;
|
|
43
|
+
handleMouseEnter: () => void;
|
|
44
|
+
handleMouseLeave: () => void;
|
|
45
|
+
setActiveItem: (index: string | number) => void;
|
|
46
|
+
prev: () => void;
|
|
47
|
+
next: () => void;
|
|
48
|
+
throttledArrowClick: import("lodash").DebouncedFunc<(index: number) => void>;
|
|
49
|
+
throttledIndicatorHover: import("lodash").DebouncedFunc<(index: number) => void>;
|
|
32
50
|
ns: {
|
|
33
51
|
namespace: import("vue").Ref<string>;
|
|
34
52
|
b: (blockSuffix?: string) => string;
|
|
@@ -47,42 +65,8 @@ export declare const ElCarousel: import("element-plus/es/utils").SFCWithInstall<
|
|
|
47
65
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
48
66
|
cssVarBlockName: (name: string) => string;
|
|
49
67
|
};
|
|
50
|
-
COMPONENT_NAME: string;
|
|
51
|
-
THROTTLE_TIME: number;
|
|
52
|
-
items: import("vue").ShallowRef<import("../..").CarouselItemContext[]>;
|
|
53
|
-
addItem: (child: import("../..").CarouselItemContext) => void;
|
|
54
|
-
removeItem: (uid: number) => void;
|
|
55
|
-
activeIndex: import("vue").Ref<number>;
|
|
56
|
-
timer: import("vue").Ref<number | null>;
|
|
57
|
-
hover: import("vue").Ref<boolean>;
|
|
58
|
-
root: import("vue").Ref<HTMLDivElement | undefined>;
|
|
59
|
-
arrowDisplay: import("vue").ComputedRef<boolean>;
|
|
60
|
-
hasLabel: import("vue").ComputedRef<boolean>;
|
|
61
68
|
carouselClasses: import("vue").ComputedRef<string[]>;
|
|
62
69
|
indicatorsClasses: import("vue").ComputedRef<string[]>;
|
|
63
|
-
isCardType: import("vue").ComputedRef<boolean>;
|
|
64
|
-
isVertical: import("vue").ComputedRef<boolean>;
|
|
65
|
-
throttledArrowClick: import("lodash").DebouncedFunc<(index: number) => void>;
|
|
66
|
-
throttledIndicatorHover: import("lodash").DebouncedFunc<(index: number) => void>;
|
|
67
|
-
pauseTimer: () => void;
|
|
68
|
-
startTimer: () => void;
|
|
69
|
-
playSlides: () => void;
|
|
70
|
-
setActiveItem: (index: string | number) => void;
|
|
71
|
-
resetItemPosition: (oldIndex?: number | undefined) => void;
|
|
72
|
-
itemInStage: (item: import("../..").CarouselItemContext, index: number) => false | "left" | "right";
|
|
73
|
-
handleMouseEnter: () => void;
|
|
74
|
-
handleMouseLeave: () => void;
|
|
75
|
-
handleButtonEnter: (arrow: "left" | "right") => void;
|
|
76
|
-
handleButtonLeave: () => void;
|
|
77
|
-
handleIndicatorClick: (index: number) => void;
|
|
78
|
-
handleIndicatorHover: (index: number) => void;
|
|
79
|
-
prev: () => void;
|
|
80
|
-
next: () => void;
|
|
81
|
-
resetTimer: () => void;
|
|
82
|
-
resizeObserver: import("vue").ShallowRef<{
|
|
83
|
-
isSupported: import("vue").Ref<boolean>;
|
|
84
|
-
stop: () => void;
|
|
85
|
-
} | undefined>;
|
|
86
70
|
ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
87
71
|
readonly size: {
|
|
88
72
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
@@ -208,24 +192,17 @@ export declare const ElCarousel: import("element-plus/es/utils").SFCWithInstall<
|
|
|
208
192
|
cssVarBlockName: (name: string) => string;
|
|
209
193
|
};
|
|
210
194
|
COMPONENT_NAME: string;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
CARD_SCALE: number;
|
|
195
|
+
active: import("vue").Ref<boolean>;
|
|
196
|
+
animating: import("vue").Ref<boolean>;
|
|
214
197
|
hover: import("vue").Ref<boolean>;
|
|
198
|
+
inStage: import("vue").Ref<boolean>;
|
|
199
|
+
isVertical: import("vue").Ref<boolean>;
|
|
215
200
|
translate: import("vue").Ref<number>;
|
|
201
|
+
isCardType: import("vue").Ref<boolean>;
|
|
216
202
|
scale: import("vue").Ref<number>;
|
|
217
|
-
active: import("vue").Ref<boolean>;
|
|
218
203
|
ready: import("vue").Ref<boolean>;
|
|
219
|
-
inStage: import("vue").Ref<boolean>;
|
|
220
|
-
animating: import("vue").Ref<boolean>;
|
|
221
|
-
isCardType: import("vue").Ref<boolean>;
|
|
222
|
-
isVertical: import("vue").Ref<boolean>;
|
|
223
|
-
itemStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
224
|
-
processIndex: (index: number, activeIndex: number, length: number) => number;
|
|
225
|
-
calcCardTranslate: (index: number, activeIndex: number) => number;
|
|
226
|
-
calcTranslate: (index: number, activeIndex: number, isVertical: boolean) => number;
|
|
227
|
-
translateItem: (index: number, activeIndex: number, oldIndex?: number | undefined) => void;
|
|
228
204
|
handleItemClick: () => void;
|
|
205
|
+
itemStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
229
206
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
230
207
|
readonly name: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
231
208
|
readonly label: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
@@ -264,24 +241,17 @@ export declare const ElCarouselItem: import("element-plus/es/utils").SFCWithInst
|
|
|
264
241
|
cssVarBlockName: (name: string) => string;
|
|
265
242
|
};
|
|
266
243
|
COMPONENT_NAME: string;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
CARD_SCALE: number;
|
|
244
|
+
active: import("vue").Ref<boolean>;
|
|
245
|
+
animating: import("vue").Ref<boolean>;
|
|
270
246
|
hover: import("vue").Ref<boolean>;
|
|
247
|
+
inStage: import("vue").Ref<boolean>;
|
|
248
|
+
isVertical: import("vue").Ref<boolean>;
|
|
271
249
|
translate: import("vue").Ref<number>;
|
|
250
|
+
isCardType: import("vue").Ref<boolean>;
|
|
272
251
|
scale: import("vue").Ref<number>;
|
|
273
|
-
active: import("vue").Ref<boolean>;
|
|
274
252
|
ready: import("vue").Ref<boolean>;
|
|
275
|
-
inStage: import("vue").Ref<boolean>;
|
|
276
|
-
animating: import("vue").Ref<boolean>;
|
|
277
|
-
isCardType: import("vue").Ref<boolean>;
|
|
278
|
-
isVertical: import("vue").Ref<boolean>;
|
|
279
|
-
itemStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
280
|
-
processIndex: (index: number, activeIndex: number, length: number) => number;
|
|
281
|
-
calcCardTranslate: (index: number, activeIndex: number) => number;
|
|
282
|
-
calcTranslate: (index: number, activeIndex: number, isVertical: boolean) => number;
|
|
283
|
-
translateItem: (index: number, activeIndex: number, oldIndex?: number | undefined) => void;
|
|
284
253
|
handleItemClick: () => void;
|
|
254
|
+
itemStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
285
255
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
286
256
|
readonly name: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
287
257
|
readonly label: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
@@ -291,3 +261,4 @@ export declare const ElCarouselItem: import("element-plus/es/utils").SFCWithInst
|
|
|
291
261
|
}>>;
|
|
292
262
|
export * from './src/carousel';
|
|
293
263
|
export * from './src/carousel-item';
|
|
264
|
+
export type { CarouselInstance, CarouselItemInstance } from './src/instance';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/carousel/index.ts"],"sourcesContent":["import { withInstall, withNoopInstall } from '@element-plus/utils'\nimport Carousel from './src/carousel.vue'\nimport CarouselItem from './src/carousel-item.vue'\n\nexport const ElCarousel = withInstall(Carousel, {\n CarouselItem,\n})\n\nexport default ElCarousel\n\nexport const ElCarouselItem = withNoopInstall(CarouselItem)\n\nexport * from './src/carousel'\nexport * from './src/carousel-item'\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE;AAChD,EAAE,YAAY;AACd,CAAC,EAAE;AAES,MAAC,cAAc,GAAG,eAAe,CAAC,YAAY;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/carousel/index.ts"],"sourcesContent":["import { withInstall, withNoopInstall } from '@element-plus/utils'\nimport Carousel from './src/carousel.vue'\nimport CarouselItem from './src/carousel-item.vue'\n\nexport const ElCarousel = withInstall(Carousel, {\n CarouselItem,\n})\n\nexport default ElCarousel\n\nexport const ElCarouselItem = withNoopInstall(CarouselItem)\n\nexport * from './src/carousel'\nexport * from './src/carousel-item'\n\nexport type { CarouselInstance, CarouselItemInstance } from './src/instance'\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE;AAChD,EAAE,YAAY;AACd,CAAC,EAAE;AAES,MAAC,cAAc,GAAG,eAAe,CAAC,YAAY;;;;"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue';
|
|
2
|
-
import type CarouselItem from './carousel-item.vue';
|
|
3
2
|
export declare const carouselItemProps: {
|
|
4
3
|
readonly name: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
5
4
|
readonly label: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
6
5
|
};
|
|
7
6
|
export declare type CarouselItemProps = ExtractPropTypes<typeof carouselItemProps>;
|
|
8
|
-
export declare type CarouselItemInstance = InstanceType<typeof CarouselItem>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel-item.mjs","sources":["../../../../../../packages/components/carousel/src/carousel-item.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\
|
|
1
|
+
{"version":3,"file":"carousel-item.mjs","sources":["../../../../../../packages/components/carousel/src/carousel-item.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const carouselItemProps = buildProps({\n name: { type: String, default: '' },\n label: {\n type: [String, Number],\n default: '',\n },\n} as const)\n\nexport type CarouselItemProps = ExtractPropTypes<typeof carouselItemProps>\n"],"names":[],"mappings":";;;AACY,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { CSSProperties } from 'vue';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
|
-
readonly name: import("
|
|
4
|
-
readonly label: import("
|
|
3
|
+
readonly name: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
4
|
+
readonly label: import("../../../utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
5
5
|
}, {
|
|
6
6
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
-
readonly name: import("
|
|
8
|
-
readonly label: import("
|
|
7
|
+
readonly name: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
8
|
+
readonly label: import("../../../utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
9
9
|
}>> & {
|
|
10
10
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
11
11
|
}>>;
|
|
@@ -28,29 +28,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
28
|
cssVarBlockName: (name: string) => string;
|
|
29
29
|
};
|
|
30
30
|
COMPONENT_NAME: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
CARD_SCALE: number;
|
|
31
|
+
active: import("vue").Ref<boolean>;
|
|
32
|
+
animating: import("vue").Ref<boolean>;
|
|
34
33
|
hover: import("vue").Ref<boolean>;
|
|
34
|
+
inStage: import("vue").Ref<boolean>;
|
|
35
|
+
isVertical: import("vue").Ref<boolean>;
|
|
35
36
|
translate: import("vue").Ref<number>;
|
|
37
|
+
isCardType: import("vue").Ref<boolean>;
|
|
36
38
|
scale: import("vue").Ref<number>;
|
|
37
|
-
active: import("vue").Ref<boolean>;
|
|
38
39
|
ready: import("vue").Ref<boolean>;
|
|
39
|
-
inStage: import("vue").Ref<boolean>;
|
|
40
|
-
animating: import("vue").Ref<boolean>;
|
|
41
|
-
isCardType: import("vue").Ref<boolean>;
|
|
42
|
-
isVertical: import("vue").Ref<boolean>;
|
|
43
|
-
itemStyle: import("vue").ComputedRef<CSSProperties>;
|
|
44
|
-
processIndex: (index: number, activeIndex: number, length: number) => number;
|
|
45
|
-
calcCardTranslate: (index: number, activeIndex: number) => number;
|
|
46
|
-
calcTranslate: (index: number, activeIndex: number, isVertical: boolean) => number;
|
|
47
|
-
translateItem: (index: number, activeIndex: number, oldIndex?: number | undefined) => void;
|
|
48
40
|
handleItemClick: () => void;
|
|
41
|
+
itemStyle: import("vue").ComputedRef<CSSProperties>;
|
|
49
42
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
50
|
-
readonly name: import("
|
|
51
|
-
readonly label: import("
|
|
43
|
+
readonly name: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
44
|
+
readonly label: import("../../../utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
52
45
|
}>>, {
|
|
53
46
|
readonly name: string;
|
|
54
|
-
readonly label: import("
|
|
47
|
+
readonly label: import("../../../utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
55
48
|
}>;
|
|
56
49
|
export default _default;
|