@element-plus/nightly 0.0.20250625 → 0.0.20250626
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 +118 -104
- package/dist/index.full.min.js +16 -16
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +17 -17
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +119 -105
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +24 -119
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +119 -24
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +4 -4
- package/es/components/breadcrumb/src/breadcrumb-item.mjs +8 -56
- package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +56 -8
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb.mjs +37 -10
- package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb2.mjs +10 -37
- package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
- package/es/components/button/index.mjs +1 -1
- package/es/components/button/src/button-group.mjs +29 -6
- package/es/components/button/src/button-group.mjs.map +1 -1
- package/es/components/button/src/button-group2.mjs +6 -29
- package/es/components/button/src/button-group2.mjs.map +1 -1
- package/es/components/calendar/index.mjs +2 -2
- package/es/components/calendar/src/calendar.mjs +134 -16
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +16 -134
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel.mjs +214 -61
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel2.mjs +61 -208
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/carousel/src/constants.d.ts +1 -1
- package/es/components/carousel/src/constants.mjs.map +1 -1
- package/es/components/carousel/src/use-carousel-item.mjs +18 -19
- package/es/components/carousel/src/use-carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/use-carousel.d.ts +3 -0
- package/es/components/carousel/src/use-carousel.mjs +3 -1
- package/es/components/carousel/src/use-carousel.mjs.map +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/cascader-panel/src/index.mjs +1 -1
- package/es/components/cascader-panel/src/menu.mjs +1 -1
- package/es/components/cascader-panel/src/node.mjs +178 -115
- package/es/components/cascader-panel/src/node.mjs.map +1 -1
- package/es/components/cascader-panel/src/node2.mjs +115 -178
- package/es/components/cascader-panel/src/node2.mjs.map +1 -1
- package/es/components/cascader-panel/src/store.mjs +1 -1
- package/es/components/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +38 -14
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +14 -38
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +43 -64
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +64 -43
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +4 -4
- package/es/components/collapse/src/collapse-item.mjs +18 -95
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item2.mjs +95 -18
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/collapse/src/collapse.mjs +23 -28
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +28 -23
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/color-picker/index.mjs +2 -2
- package/es/components/color-picker/src/color-picker.mjs +401 -44
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +44 -401
- 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/countdown/index.mjs +2 -2
- package/es/components/countdown/src/countdown.mjs +21 -79
- package/es/components/countdown/src/countdown.mjs.map +1 -1
- package/es/components/countdown/src/countdown2.mjs +79 -21
- package/es/components/countdown/src/countdown2.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content.mjs +88 -29
- package/es/components/dialog/src/dialog-content.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content2.mjs +29 -88
- package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
- package/es/components/dialog/src/dialog.mjs +2 -2
- package/es/components/dialog/src/dialog2.mjs +1 -1
- package/es/components/dropdown/index.mjs +2 -2
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown-item.mjs +1 -1
- package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +108 -299
- package/es/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown2.mjs +299 -108
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/form/index.mjs +2 -2
- package/es/components/form/src/form.mjs +161 -54
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form2.mjs +54 -161
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +68 -226
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +226 -68
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +49 -447
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +447 -49
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +24 -24
- package/es/components/input-tag/src/input-tag.mjs +1 -1
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +97 -16
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +16 -97
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/popover/src/popover.mjs +2 -2
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/trigger.mjs +31 -127
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs +127 -31
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/splitter/src/split-panel2.mjs +4 -7
- package/es/components/splitter/src/split-panel2.mjs.map +1 -1
- package/es/components/splitter/src/splitter2.mjs +5 -6
- package/es/components/splitter/src/splitter2.mjs.map +1 -1
- package/es/components/splitter/src/type.d.ts +1 -2
- package/es/components/splitter/src/type.mjs.map +1 -1
- package/es/components/statistic/index.mjs +2 -2
- package/es/components/statistic/src/statistic.mjs +25 -69
- package/es/components/statistic/src/statistic.mjs.map +1 -1
- package/es/components/statistic/src/statistic2.mjs +69 -25
- package/es/components/statistic/src/statistic2.mjs.map +1 -1
- package/es/components/steps/src/item.vue.d.ts +1 -1
- package/es/components/steps/src/item2.mjs +5 -5
- package/es/components/steps/src/item2.mjs.map +1 -1
- package/es/components/steps/src/steps2.mjs +5 -3
- package/es/components/steps/src/steps2.mjs.map +1 -1
- package/es/components/tabs/index.mjs +2 -2
- package/es/components/tabs/src/constants.d.ts +1 -2
- package/es/components/tabs/src/constants.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane.mjs +13 -71
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +68 -13
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/tabs/src/tabs.d.ts +2 -2
- package/es/components/tabs/src/tabs.mjs +23 -28
- package/es/components/tabs/src/tabs.mjs.map +1 -1
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/src/tag.mjs +27 -99
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag2.mjs +99 -27
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/teleport/index.mjs +2 -2
- package/es/components/teleport/src/teleport.mjs +18 -8
- package/es/components/teleport/src/teleport.mjs.map +1 -1
- package/es/components/teleport/src/teleport2.mjs +8 -18
- package/es/components/teleport/src/teleport2.mjs.map +1 -1
- package/es/components/text/index.mjs +2 -2
- package/es/components/text/src/text.mjs +21 -67
- package/es/components/text/src/text.mjs.map +1 -1
- package/es/components/text/src/text2.mjs +67 -21
- package/es/components/text/src/text2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/content2.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tooltip/src/trigger.mjs +72 -14
- package/es/components/tooltip/src/trigger.mjs.map +1 -1
- package/es/components/tooltip/src/trigger2.mjs +14 -72
- package/es/components/tooltip/src/trigger2.mjs.map +1 -1
- package/es/components/tour/src/mask.mjs +18 -75
- package/es/components/tour/src/mask.mjs.map +1 -1
- package/es/components/tour/src/mask2.mjs +75 -18
- package/es/components/tour/src/mask2.mjs.map +1 -1
- package/es/components/tour/src/tour.mjs +1 -1
- package/es/components/tour/src/tour2.mjs +1 -1
- package/es/components/upload/index.mjs +2 -2
- package/es/components/upload/src/upload-content.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +125 -97
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +97 -125
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/hooks/use-ordered-children/index.d.ts +5 -2
- package/es/hooks/use-ordered-children/index.mjs +25 -8
- package/es/hooks/use-ordered-children/index.mjs.map +1 -1
- package/es/index.d.ts +6 -4
- package/es/index.mjs +24 -24
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +25 -119
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +119 -25
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +4 -4
- package/lib/components/breadcrumb/src/breadcrumb-item.js +8 -56
- package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +56 -8
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb.js +37 -10
- package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb2.js +10 -37
- package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
- package/lib/components/button/index.js +1 -1
- package/lib/components/button/src/button-group.js +29 -6
- package/lib/components/button/src/button-group.js.map +1 -1
- package/lib/components/button/src/button-group2.js +6 -29
- package/lib/components/button/src/button-group2.js.map +1 -1
- package/lib/components/calendar/index.js +2 -2
- package/lib/components/calendar/src/calendar.js +134 -17
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +17 -134
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel.js +214 -62
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel2.js +62 -208
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/carousel/src/constants.d.ts +1 -1
- package/lib/components/carousel/src/constants.js.map +1 -1
- package/lib/components/carousel/src/use-carousel-item.js +17 -18
- package/lib/components/carousel/src/use-carousel-item.js.map +1 -1
- package/lib/components/carousel/src/use-carousel.d.ts +3 -0
- package/lib/components/carousel/src/use-carousel.js +3 -1
- package/lib/components/carousel/src/use-carousel.js.map +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/cascader-panel/src/index.js +1 -1
- package/lib/components/cascader-panel/src/menu.js +1 -1
- package/lib/components/cascader-panel/src/node.js +178 -115
- package/lib/components/cascader-panel/src/node.js.map +1 -1
- package/lib/components/cascader-panel/src/node2.js +115 -178
- package/lib/components/cascader-panel/src/node2.js.map +1 -1
- package/lib/components/cascader-panel/src/store.js +1 -1
- package/lib/components/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +38 -15
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +15 -38
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +43 -64
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +64 -43
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/collapse/index.js +4 -4
- package/lib/components/collapse/src/collapse-item.js +18 -95
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item2.js +95 -18
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/collapse/src/collapse.js +25 -28
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +28 -25
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/color-picker/index.js +2 -2
- package/lib/components/color-picker/src/color-picker.js +400 -45
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +45 -400
- 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/countdown/index.js +2 -2
- package/lib/components/countdown/src/countdown.js +22 -79
- package/lib/components/countdown/src/countdown.js.map +1 -1
- package/lib/components/countdown/src/countdown2.js +79 -22
- package/lib/components/countdown/src/countdown2.js.map +1 -1
- package/lib/components/dialog/src/dialog-content.js +87 -29
- package/lib/components/dialog/src/dialog-content.js.map +1 -1
- package/lib/components/dialog/src/dialog-content2.js +29 -87
- package/lib/components/dialog/src/dialog-content2.js.map +1 -1
- package/lib/components/dialog/src/dialog.js +2 -2
- package/lib/components/dialog/src/dialog2.js +1 -1
- package/lib/components/dropdown/index.js +2 -2
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown-item.js +1 -1
- package/lib/components/dropdown/src/dropdown-menu.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +117 -299
- package/lib/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/components/dropdown/src/dropdown2.js +299 -117
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/form/index.js +2 -2
- package/lib/components/form/src/form.js +160 -55
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form2.js +55 -160
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.js +68 -225
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +225 -68
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +50 -447
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +447 -50
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +24 -24
- package/lib/components/input-tag/src/input-tag.js +1 -1
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +97 -17
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +17 -97
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/popover/src/popover.js +2 -2
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/trigger.js +32 -127
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger2.js +127 -32
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/splitter/src/split-panel2.js +3 -6
- package/lib/components/splitter/src/split-panel2.js.map +1 -1
- package/lib/components/splitter/src/splitter2.js +4 -5
- package/lib/components/splitter/src/splitter2.js.map +1 -1
- package/lib/components/splitter/src/type.d.ts +1 -2
- package/lib/components/splitter/src/type.js.map +1 -1
- package/lib/components/statistic/index.js +2 -2
- package/lib/components/statistic/src/statistic.js +25 -69
- package/lib/components/statistic/src/statistic.js.map +1 -1
- package/lib/components/statistic/src/statistic2.js +69 -25
- package/lib/components/statistic/src/statistic2.js.map +1 -1
- package/lib/components/steps/src/item.vue.d.ts +1 -1
- package/lib/components/steps/src/item2.js +4 -4
- package/lib/components/steps/src/item2.js.map +1 -1
- package/lib/components/steps/src/steps2.js +4 -2
- package/lib/components/steps/src/steps2.js.map +1 -1
- package/lib/components/tabs/index.js +2 -2
- package/lib/components/tabs/src/constants.d.ts +1 -2
- package/lib/components/tabs/src/constants.js.map +1 -1
- package/lib/components/tabs/src/tab-pane.js +13 -71
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +68 -13
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/tabs/src/tabs.d.ts +2 -2
- package/lib/components/tabs/src/tabs.js +23 -28
- package/lib/components/tabs/src/tabs.js.map +1 -1
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/src/tag.js +28 -99
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag2.js +99 -28
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/teleport/index.js +2 -2
- package/lib/components/teleport/src/teleport.js +18 -8
- package/lib/components/teleport/src/teleport.js.map +1 -1
- package/lib/components/teleport/src/teleport2.js +8 -18
- package/lib/components/teleport/src/teleport2.js.map +1 -1
- package/lib/components/text/index.js +2 -2
- package/lib/components/text/src/text.js +21 -67
- package/lib/components/text/src/text.js.map +1 -1
- package/lib/components/text/src/text2.js +67 -21
- package/lib/components/text/src/text2.js.map +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/content2.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tooltip/src/trigger.js +72 -14
- package/lib/components/tooltip/src/trigger.js.map +1 -1
- package/lib/components/tooltip/src/trigger2.js +14 -72
- package/lib/components/tooltip/src/trigger2.js.map +1 -1
- package/lib/components/tour/src/mask.js +18 -75
- package/lib/components/tour/src/mask.js.map +1 -1
- package/lib/components/tour/src/mask2.js +75 -18
- package/lib/components/tour/src/mask2.js.map +1 -1
- package/lib/components/tour/src/tour.js +1 -1
- package/lib/components/tour/src/tour2.js +1 -1
- package/lib/components/upload/index.js +2 -2
- package/lib/components/upload/src/upload-content.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +125 -100
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +100 -125
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/hooks/use-ordered-children/index.d.ts +5 -2
- package/lib/hooks/use-ordered-children/index.js +24 -7
- package/lib/hooks/use-ordered-children/index.js.map +1 -1
- package/lib/index.d.ts +6 -4
- package/lib/index.js +24 -24
- 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 +1 @@
|
|
1
|
-
{"version":3,"file":"carousel2.js","sources":["../../../../../../packages/components/carousel/src/carousel.
|
1
|
+
{"version":3,"file":"carousel2.js","sources":["../../../../../../packages/components/carousel/src/carousel.ts"],"sourcesContent":["import { buildProps, isNumber } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const carouselProps = buildProps({\n /**\n * @description index of the initially active slide (starting from 0)\n */\n initialIndex: {\n type: Number,\n default: 0,\n },\n /**\n * @description height of the carousel\n */\n height: {\n type: String,\n default: '',\n },\n /**\n * @description how indicators are triggered\n */\n trigger: {\n type: String,\n values: ['hover', 'click'],\n default: 'hover',\n },\n /**\n * @description whether automatically loop the slides\n */\n autoplay: {\n type: Boolean,\n default: true,\n },\n /**\n * @description interval of the auto loop, in milliseconds\n */\n interval: {\n type: Number,\n default: 3000,\n },\n /**\n * @description position of the indicators\n */\n indicatorPosition: {\n type: String,\n values: ['', 'none', 'outside'],\n default: '',\n },\n /**\n * @description when arrows are shown\n */\n arrow: {\n type: String,\n values: ['always', 'hover', 'never'],\n default: 'hover',\n },\n /**\n * @description type of the Carousel\n */\n type: {\n type: String,\n values: ['', 'card'],\n default: '',\n },\n /**\n * @description when type is card, scaled size of secondary cards\n */\n cardScale: {\n type: Number,\n default: 0.83,\n },\n /**\n * @description display the items in loop\n */\n loop: {\n type: Boolean,\n default: true,\n },\n /**\n * @description display direction\n */\n direction: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'horizontal',\n },\n /**\n * @description pause autoplay when hover\n */\n pauseOnHover: {\n type: Boolean,\n default: true,\n },\n /**\n * @description infuse dynamism and smoothness into the carousel\n */\n motionBlur: Boolean,\n} as const)\n\nexport const carouselEmits = {\n /**\n * @description triggers when the active slide switches\n * @param current index of the new active slide\n * @param prev index of the old active slide\n */\n change: (current: number, prev: number) => [current, prev].every(isNumber),\n}\n\nexport type CarouselProps = ExtractPropTypes<typeof carouselProps>\nexport type CarouselEmits = typeof carouselEmits\n"],"names":["buildProps","isNumber"],"mappings":";;;;;;;AACY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;AAC9B,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC;AACnC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;AACxC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC;AACxB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACtC,IAAI,OAAO,EAAE,YAAY;AACzB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,UAAU,EAAE,OAAO;AACrB,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,KAAK,CAACC,cAAQ,CAAC;AAC5D;;;;;"}
|
@@ -23,7 +23,7 @@ export type CarouselContext = {
|
|
23
23
|
loop: boolean;
|
24
24
|
cardScale: number;
|
25
25
|
addItem: (item: CarouselItemContext) => void;
|
26
|
-
removeItem: (
|
26
|
+
removeItem: (item: CarouselItemContext) => void;
|
27
27
|
setActiveItem: (index: number) => void;
|
28
28
|
setContainerHeight: (height: number) => void;
|
29
29
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../../packages/components/carousel/src/constants.ts"],"sourcesContent":["import type { InjectionKey, Ref } from 'vue'\nimport type { CarouselItemProps } from './carousel-item'\n\nexport type CarouselItemStates = {\n hover: boolean\n translate: number\n scale: number\n active: boolean\n ready: boolean\n inStage: boolean\n animating: boolean\n}\n\nexport type CarouselItemContext = {\n props: CarouselItemProps\n states: CarouselItemStates\n uid: number\n translateItem: (index: number, activeIndex: number, oldIndex?: number) => void\n}\n\nexport type CarouselContext = {\n root: Ref<HTMLElement | undefined>\n items: Ref<CarouselItemContext[]>\n isCardType: Ref<boolean>\n isVertical: Ref<boolean>\n loop: boolean\n cardScale: number\n addItem: (item: CarouselItemContext) => void\n removeItem: (
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../packages/components/carousel/src/constants.ts"],"sourcesContent":["import type { InjectionKey, Ref } from 'vue'\nimport type { CarouselItemProps } from './carousel-item'\n\nexport type CarouselItemStates = {\n hover: boolean\n translate: number\n scale: number\n active: boolean\n ready: boolean\n inStage: boolean\n animating: boolean\n}\n\nexport type CarouselItemContext = {\n props: CarouselItemProps\n states: CarouselItemStates\n uid: number\n translateItem: (index: number, activeIndex: number, oldIndex?: number) => void\n}\n\nexport type CarouselContext = {\n root: Ref<HTMLElement | undefined>\n items: Ref<CarouselItemContext[]>\n isCardType: Ref<boolean>\n isVertical: Ref<boolean>\n loop: boolean\n cardScale: number\n addItem: (item: CarouselItemContext) => void\n removeItem: (item: CarouselItemContext) => void\n setActiveItem: (index: number) => void\n setContainerHeight: (height: number) => void\n}\n\nexport const carouselContextKey: InjectionKey<CarouselContext> =\n Symbol('carouselContextKey')\n\nexport const CAROUSEL_ITEM_NAME = 'ElCarouselItem'\n"],"names":[],"mappings":";;;;AAAY,MAAC,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,EAAE;AACnD,MAAC,kBAAkB,GAAG;;;;;"}
|
@@ -90,24 +90,23 @@ const useCarouselItem = (props) => {
|
|
90
90
|
carouselContext.setActiveItem(index);
|
91
91
|
}
|
92
92
|
}
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
carouselContext.removeItem(instance.uid);
|
93
|
+
const carouselItemContext = {
|
94
|
+
props,
|
95
|
+
states: vue.reactive({
|
96
|
+
hover,
|
97
|
+
translate,
|
98
|
+
scale,
|
99
|
+
active,
|
100
|
+
ready,
|
101
|
+
inStage,
|
102
|
+
animating
|
103
|
+
}),
|
104
|
+
uid: instance.uid,
|
105
|
+
translateItem
|
106
|
+
};
|
107
|
+
carouselContext.addItem(carouselItemContext);
|
108
|
+
vue.onBeforeUnmount(() => {
|
109
|
+
carouselContext.removeItem(carouselItemContext);
|
111
110
|
});
|
112
111
|
return {
|
113
112
|
carouselItemRef,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-carousel-item.js","sources":["../../../../../../packages/components/carousel/src/use-carousel-item.ts"],"sourcesContent":["import {\n getCurrentInstance,\n inject,\n
|
1
|
+
{"version":3,"file":"use-carousel-item.js","sources":["../../../../../../packages/components/carousel/src/use-carousel-item.ts"],"sourcesContent":["import {\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n reactive,\n ref,\n unref,\n} from 'vue'\nimport { debugWarn, isUndefined } from '@element-plus/utils'\nimport { CAROUSEL_ITEM_NAME, carouselContextKey } from './constants'\n\nimport type { CarouselItemProps } from './carousel-item'\n\nexport const useCarouselItem = (props: CarouselItemProps) => {\n const carouselContext = inject(carouselContextKey)!\n // instance\n const instance = getCurrentInstance()!\n if (!carouselContext) {\n debugWarn(\n CAROUSEL_ITEM_NAME,\n 'usage: <el-carousel></el-carousel-item></el-carousel>'\n )\n }\n\n if (!instance) {\n debugWarn(\n CAROUSEL_ITEM_NAME,\n 'compositional hook can only be invoked inside setups'\n )\n }\n\n const carouselItemRef = ref<HTMLElement>()\n const hover = ref(false)\n const translate = ref(0)\n const scale = ref(1)\n const active = ref(false)\n const ready = ref(false)\n const inStage = ref(false)\n const animating = ref(false)\n\n // computed\n const { isCardType, isVertical, cardScale } = carouselContext\n\n // methods\n\n function processIndex(index: number, activeIndex: number, length: number) {\n const lastItemIndex = length - 1\n const prevItemIndex = activeIndex - 1\n const nextItemIndex = activeIndex + 1\n const halfItemIndex = length / 2\n\n if (activeIndex === 0 && index === lastItemIndex) {\n return -1\n } else if (activeIndex === lastItemIndex && index === 0) {\n return length\n } else if (index < prevItemIndex && activeIndex - index >= halfItemIndex) {\n return length + 1\n } else if (index > nextItemIndex && index - activeIndex >= halfItemIndex) {\n return -2\n }\n return index\n }\n\n function calcCardTranslate(index: number, activeIndex: number) {\n const parentWidth = unref(isVertical)\n ? carouselContext.root.value?.offsetHeight || 0\n : carouselContext.root.value?.offsetWidth || 0\n\n if (inStage.value) {\n return (parentWidth * ((2 - cardScale) * (index - activeIndex) + 1)) / 4\n } else if (index < activeIndex) {\n return (-(1 + cardScale) * parentWidth) / 4\n } else {\n return ((3 + cardScale) * parentWidth) / 4\n }\n }\n\n function calcTranslate(\n index: number,\n activeIndex: number,\n isVertical: boolean\n ) {\n const rootEl = carouselContext.root.value\n if (!rootEl) return 0\n\n const distance =\n (isVertical ? rootEl.offsetHeight : rootEl.offsetWidth) || 0\n return distance * (index - activeIndex)\n }\n\n const translateItem = (\n index: number,\n activeIndex: number,\n oldIndex?: number\n ) => {\n const _isCardType = unref(isCardType)\n const carouselItemLength = carouselContext.items.value.length ?? Number.NaN\n\n const isActive = index === activeIndex\n if (!_isCardType && !isUndefined(oldIndex)) {\n animating.value = isActive || index === oldIndex\n }\n\n if (!isActive && carouselItemLength > 2 && carouselContext.loop) {\n index = processIndex(index, activeIndex, carouselItemLength)\n }\n\n const _isVertical = unref(isVertical)\n active.value = isActive\n\n if (_isCardType) {\n inStage.value = Math.round(Math.abs(index - activeIndex)) <= 1\n translate.value = calcCardTranslate(index, activeIndex)\n scale.value = unref(active) ? 1 : cardScale\n } else {\n translate.value = calcTranslate(index, activeIndex, _isVertical)\n }\n\n ready.value = true\n\n if (isActive && carouselItemRef.value) {\n carouselContext.setContainerHeight(carouselItemRef.value.offsetHeight)\n }\n }\n\n function handleItemClick() {\n if (carouselContext && unref(isCardType)) {\n const index = carouselContext.items.value.findIndex(\n ({ uid }) => uid === instance.uid\n )\n carouselContext.setActiveItem(index)\n }\n }\n\n const carouselItemContext = {\n props,\n states: reactive({\n hover,\n translate,\n scale,\n active,\n ready,\n inStage,\n animating,\n }),\n uid: instance.uid,\n translateItem,\n }\n\n carouselContext.addItem(carouselItemContext)\n\n onBeforeUnmount(() => {\n carouselContext.removeItem(carouselItemContext)\n })\n\n return {\n carouselItemRef,\n active,\n animating,\n hover,\n inStage,\n isVertical,\n translate,\n isCardType,\n scale,\n ready,\n handleItemClick,\n }\n}\n"],"names":["inject","carouselContextKey","getCurrentInstance","debugWarn","CAROUSEL_ITEM_NAME","ref","unref","isUndefined","reactive","onBeforeUnmount"],"mappings":";;;;;;;;;AAUY,MAAC,eAAe,GAAG,CAAC,KAAK,KAAK;AAC1C,EAAE,MAAM,eAAe,GAAGA,UAAM,CAACC,4BAAkB,CAAC,CAAC;AACrD,EAAE,MAAM,QAAQ,GAAGC,sBAAkB,EAAE,CAAC;AACxC,EAAE,IAAI,CAAC,eAAe,EAAE;AACxB,IAAIC,eAAS,CAACC,4BAAkB,EAAE,uDAAuD,CAAC,CAAC;AAC3F,GAAG;AACH,EAAE,IAAI,CAAC,QAAQ,EAAE;AACjB,IAAID,eAAS,CAACC,4BAAkB,EAAE,sDAAsD,CAAC,CAAC;AAC1F,GAAG;AACH,EAAE,MAAM,eAAe,GAAGC,OAAG,EAAE,CAAC;AAChC,EAAE,MAAM,KAAK,GAAGA,OAAG,CAAC,KAAK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IAAI,eAAe;AACnB,GAAG,CAAC;AACJ;;;;"}
|
@@ -31,6 +31,9 @@ export declare const useCarousel: (props: CarouselProps, emit: SetupContext<Caro
|
|
31
31
|
$stable?: boolean;
|
32
32
|
})[] | null;
|
33
33
|
isTwoLengthShow: (index: number) => boolean;
|
34
|
+
ItemsSorter: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
35
|
+
[key: string]: any;
|
36
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
34
37
|
throttledArrowClick: import("lodash").DebouncedFunc<(index: number) => void>;
|
35
38
|
throttledIndicatorHover: import("lodash").DebouncedFunc<(index: number) => void>;
|
36
39
|
};
|
@@ -17,7 +17,8 @@ const useCarousel = (props, emit, componentName) => {
|
|
17
17
|
const {
|
18
18
|
children: items,
|
19
19
|
addChild: addItem,
|
20
|
-
removeChild: removeItem
|
20
|
+
removeChild: removeItem,
|
21
|
+
ChildrenSorter: ItemsSorter
|
21
22
|
} = index.useOrderedChildren(vue.getCurrentInstance(), constants.CAROUSEL_ITEM_NAME);
|
22
23
|
const slots = vue.useSlots();
|
23
24
|
const activeIndex = vue.ref(-1);
|
@@ -259,6 +260,7 @@ const useCarousel = (props, emit, componentName) => {
|
|
259
260
|
next,
|
260
261
|
PlaceholderItem,
|
261
262
|
isTwoLengthShow,
|
263
|
+
ItemsSorter,
|
262
264
|
throttledArrowClick,
|
263
265
|
throttledIndicatorHover
|
264
266
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-carousel.js","sources":["../../../../../../packages/components/carousel/src/use-carousel.ts"],"sourcesContent":["import {\n computed,\n getCurrentInstance,\n isVNode,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n unref,\n useSlots,\n watch,\n} from 'vue'\nimport { throttle } from 'lodash-unified'\nimport { useResizeObserver } from '@vueuse/core'\nimport { debugWarn, flattedChildren, isString } from '@element-plus/utils'\nimport { useOrderedChildren } from '@element-plus/hooks'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { CAROUSEL_ITEM_NAME, carouselContextKey } from './constants'\n\nimport type { SetupContext } from 'vue'\nimport type { CarouselItemContext } from './constants'\nimport type { CarouselEmits, CarouselProps } from './carousel'\n\nconst THROTTLE_TIME = 300\n\nexport const useCarousel = (\n props: CarouselProps,\n emit: SetupContext<CarouselEmits>['emit'],\n componentName: string\n) => {\n const {\n children: items,\n addChild: addItem,\n removeChild: removeItem,\n } = useOrderedChildren<CarouselItemContext>(\n getCurrentInstance()!,\n CAROUSEL_ITEM_NAME\n )\n\n const slots = useSlots()\n\n // refs\n const activeIndex = ref(-1)\n const timer = ref<ReturnType<typeof setInterval> | null>(null)\n const hover = ref(false)\n const root = ref<HTMLDivElement>()\n const containerHeight = ref<number>(0)\n const isItemsTwoLength = ref(true)\n\n // computed\n const arrowDisplay = computed(\n () => props.arrow !== 'never' && !unref(isVertical)\n )\n\n const hasLabel = computed(() => {\n return items.value.some((item) => item.props.label.toString().length > 0)\n })\n\n const isCardType = computed(() => props.type === 'card')\n const isVertical = computed(() => props.direction === 'vertical')\n\n const containerStyle = computed(() => {\n if (props.height !== 'auto') {\n return {\n height: props.height,\n }\n }\n return {\n height: `${containerHeight.value}px`,\n overflow: 'hidden',\n }\n })\n\n // methods\n const throttledArrowClick = throttle(\n (index: number) => {\n setActiveItem(index)\n },\n THROTTLE_TIME,\n { trailing: true }\n )\n\n const throttledIndicatorHover = throttle((index: number) => {\n handleIndicatorHover(index)\n }, THROTTLE_TIME)\n\n const isTwoLengthShow = (index: number) => {\n if (!isItemsTwoLength.value) return true\n return activeIndex.value <= 1 ? index <= 1 : index > 1\n }\n\n function pauseTimer() {\n if (timer.value) {\n clearInterval(timer.value)\n timer.value = null\n }\n }\n\n function startTimer() {\n if (props.interval <= 0 || !props.autoplay || timer.value) return\n timer.value = setInterval(() => playSlides(), props.interval)\n }\n\n const playSlides = () => {\n if (activeIndex.value < items.value.length - 1) {\n activeIndex.value = activeIndex.value + 1\n } else if (props.loop) {\n activeIndex.value = 0\n }\n }\n\n function setActiveItem(index: number | string) {\n if (isString(index)) {\n const filteredItems = items.value.filter(\n (item) => item.props.name === index\n )\n if (filteredItems.length > 0) {\n index = items.value.indexOf(filteredItems[0])\n }\n }\n index = Number(index)\n if (Number.isNaN(index) || index !== Math.floor(index)) {\n debugWarn(componentName, 'index must be integer.')\n return\n }\n const itemCount = items.value.length\n const oldIndex = activeIndex.value\n if (index < 0) {\n activeIndex.value = props.loop ? itemCount - 1 : 0\n } else if (index >= itemCount) {\n activeIndex.value = props.loop ? 0 : itemCount - 1\n } else {\n activeIndex.value = index\n }\n if (oldIndex === activeIndex.value) {\n resetItemPosition(oldIndex)\n }\n resetTimer()\n }\n\n function resetItemPosition(oldIndex?: number) {\n items.value.forEach((item, index) => {\n item.translateItem(index, activeIndex.value, oldIndex)\n })\n }\n\n function itemInStage(item: CarouselItemContext, index: number) {\n const _items = unref(items)\n const itemCount = _items.length\n if (itemCount === 0 || !item.states.inStage) return false\n const nextItemIndex = index + 1\n const prevItemIndex = index - 1\n const lastItemIndex = itemCount - 1\n const isLastItemActive = _items[lastItemIndex].states.active\n const isFirstItemActive = _items[0].states.active\n const isNextItemActive = _items[nextItemIndex]?.states?.active\n const isPrevItemActive = _items[prevItemIndex]?.states?.active\n\n if ((index === lastItemIndex && isFirstItemActive) || isNextItemActive) {\n return 'left'\n } else if ((index === 0 && isLastItemActive) || isPrevItemActive) {\n return 'right'\n }\n return false\n }\n\n function handleMouseEnter() {\n hover.value = true\n if (props.pauseOnHover) {\n pauseTimer()\n }\n }\n\n function handleMouseLeave() {\n hover.value = false\n startTimer()\n }\n\n function handleButtonEnter(arrow: 'left' | 'right') {\n if (unref(isVertical)) return\n items.value.forEach((item, index) => {\n if (arrow === itemInStage(item, index)) {\n item.states.hover = true\n }\n })\n }\n\n function handleButtonLeave() {\n if (unref(isVertical)) return\n items.value.forEach((item) => {\n item.states.hover = false\n })\n }\n\n function handleIndicatorClick(index: number) {\n activeIndex.value = index\n }\n\n function handleIndicatorHover(index: number) {\n if (props.trigger === 'hover' && index !== activeIndex.value) {\n activeIndex.value = index\n }\n }\n\n function prev() {\n setActiveItem(activeIndex.value - 1)\n }\n\n function next() {\n setActiveItem(activeIndex.value + 1)\n }\n\n function resetTimer() {\n pauseTimer()\n if (!props.pauseOnHover) startTimer()\n }\n\n function setContainerHeight(height: number) {\n if (props.height !== 'auto') return\n containerHeight.value = height\n }\n\n function PlaceholderItem() {\n // fix: https://github.com/element-plus/element-plus/issues/12139\n const defaultSlots = slots.default?.()\n if (!defaultSlots) return null\n\n const flatSlots = flattedChildren(defaultSlots)\n\n const normalizeSlots = flatSlots.filter((slot) => {\n return isVNode(slot) && (slot.type as any).name === CAROUSEL_ITEM_NAME\n })\n\n if (normalizeSlots?.length === 2 && props.loop && !isCardType.value) {\n isItemsTwoLength.value = true\n return normalizeSlots\n }\n isItemsTwoLength.value = false\n return null\n }\n\n // watch\n watch(\n () => activeIndex.value,\n (current, prev) => {\n resetItemPosition(prev)\n if (isItemsTwoLength.value) {\n current = current % 2\n prev = prev % 2\n }\n if (prev > -1) {\n emit(CHANGE_EVENT, current, prev)\n }\n }\n )\n watch(\n () => props.autoplay,\n (autoplay) => {\n autoplay ? startTimer() : pauseTimer()\n }\n )\n watch(\n () => props.loop,\n () => {\n setActiveItem(activeIndex.value)\n }\n )\n\n watch(\n () => props.interval,\n () => {\n resetTimer()\n }\n )\n\n const resizeObserver = shallowRef<ReturnType<typeof useResizeObserver>>()\n // lifecycle\n onMounted(() => {\n watch(\n () => items.value,\n () => {\n if (items.value.length > 0) setActiveItem(props.initialIndex)\n },\n {\n immediate: true,\n }\n )\n\n resizeObserver.value = useResizeObserver(root.value, () => {\n resetItemPosition()\n })\n startTimer()\n })\n\n onBeforeUnmount(() => {\n pauseTimer()\n if (root.value && resizeObserver.value) resizeObserver.value.stop()\n })\n\n // provide\n provide(carouselContextKey, {\n root,\n isCardType,\n isVertical,\n items,\n loop: props.loop,\n cardScale: props.cardScale,\n addItem,\n removeItem,\n setActiveItem,\n setContainerHeight,\n })\n\n return {\n root,\n activeIndex,\n arrowDisplay,\n hasLabel,\n hover,\n isCardType,\n items,\n isVertical,\n containerStyle,\n isItemsTwoLength,\n handleButtonEnter,\n handleButtonLeave,\n handleIndicatorClick,\n handleMouseEnter,\n handleMouseLeave,\n setActiveItem,\n prev,\n next,\n PlaceholderItem,\n isTwoLengthShow,\n throttledArrowClick,\n throttledIndicatorHover,\n }\n}\n"],"names":["useOrderedChildren","getCurrentInstance","CAROUSEL_ITEM_NAME","useSlots","ref","computed","unref","throttle","isString","debugWarn","flattedChildren","isVNode","watch","CHANGE_EVENT","shallowRef","onMounted","useResizeObserver","onBeforeUnmount","provide","carouselContextKey"],"mappings":";;;;;;;;;;;;;;AAmBA,MAAM,aAAa,GAAG,GAAG,CAAC;AACd,MAAC,WAAW,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,KAAK;AAC3D,EAAE,MAAM;AACR,IAAI,QAAQ,EAAE,KAAK;AACnB,IAAI,QAAQ,EAAE,OAAO;AACrB,IAAI,WAAW,EAAE,UAAU;AAC3B,GAAG,GAAGA,wBAAkB,CAACC,sBAAkB,EAAE,EAAEC,4BAAkB,CAAC,CAAC;AACnE,EAAE,MAAM,KAAK,GAAGC,YAAQ,EAAE,CAAC;AAC3B,EAAE,MAAM,WAAW,GAAGC,OAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9B,EAAE,MAAM,KAAK,GAAGA,OAAG,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,MAAM,KAAK,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AAC3B,EAAE,MAAM,IAAI,GAAGA,OAAG,EAAE,CAAC;AACrB,EAAE,M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AI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,cAAc;AAClB,IAAI,gBAAgB;AACpB,IAAI,iBAAiB;AACrB,IAAI,iBAAiB;AACrB,IAAI,oBAAoB;AACxB,IAAI,gBAAgB;AACpB,IAAI,gBAAgB;AACpB,IAAI,aAAa;AACjB,IAAI,IAAI;AACR,IAAI,IAAI;AACR,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,mBAAmB;AACvB,IAAI,uBAAuB;AAC3B,GAAG,CAAC;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"use-carousel.js","sources":["../../../../../../packages/components/carousel/src/use-carousel.ts"],"sourcesContent":["import {\n computed,\n getCurrentInstance,\n isVNode,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n unref,\n useSlots,\n watch,\n} from 'vue'\nimport { throttle } from 'lodash-unified'\nimport { useResizeObserver } from '@vueuse/core'\nimport { debugWarn, flattedChildren, isString } from '@element-plus/utils'\nimport { useOrderedChildren } from '@element-plus/hooks'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { CAROUSEL_ITEM_NAME, carouselContextKey } from './constants'\n\nimport type { SetupContext } from 'vue'\nimport type { CarouselItemContext } from './constants'\nimport type { CarouselEmits, CarouselProps } from './carousel'\n\nconst THROTTLE_TIME = 300\n\nexport const useCarousel = (\n props: CarouselProps,\n emit: SetupContext<CarouselEmits>['emit'],\n componentName: string\n) => {\n const {\n children: items,\n addChild: addItem,\n removeChild: removeItem,\n ChildrenSorter: ItemsSorter,\n } = useOrderedChildren<CarouselItemContext>(\n getCurrentInstance()!,\n CAROUSEL_ITEM_NAME\n )\n\n const slots = useSlots()\n\n // refs\n const activeIndex = ref(-1)\n const timer = ref<ReturnType<typeof setInterval> | null>(null)\n const hover = ref(false)\n const root = ref<HTMLDivElement>()\n const containerHeight = ref<number>(0)\n const isItemsTwoLength = ref(true)\n\n // computed\n const arrowDisplay = computed(\n () => props.arrow !== 'never' && !unref(isVertical)\n )\n\n const hasLabel = computed(() => {\n return items.value.some((item) => item.props.label.toString().length > 0)\n })\n\n const isCardType = computed(() => props.type === 'card')\n const isVertical = computed(() => props.direction === 'vertical')\n\n const containerStyle = computed(() => {\n if (props.height !== 'auto') {\n return {\n height: props.height,\n }\n }\n return {\n height: `${containerHeight.value}px`,\n overflow: 'hidden',\n }\n })\n\n // methods\n const throttledArrowClick = throttle(\n (index: number) => {\n setActiveItem(index)\n },\n THROTTLE_TIME,\n { trailing: true }\n )\n\n const throttledIndicatorHover = throttle((index: number) => {\n handleIndicatorHover(index)\n }, THROTTLE_TIME)\n\n const isTwoLengthShow = (index: number) => {\n if (!isItemsTwoLength.value) return true\n return activeIndex.value <= 1 ? index <= 1 : index > 1\n }\n\n function pauseTimer() {\n if (timer.value) {\n clearInterval(timer.value)\n timer.value = null\n }\n }\n\n function startTimer() {\n if (props.interval <= 0 || !props.autoplay || timer.value) return\n timer.value = setInterval(() => playSlides(), props.interval)\n }\n\n const playSlides = () => {\n if (activeIndex.value < items.value.length - 1) {\n activeIndex.value = activeIndex.value + 1\n } else if (props.loop) {\n activeIndex.value = 0\n }\n }\n\n function setActiveItem(index: number | string) {\n if (isString(index)) {\n const filteredItems = items.value.filter(\n (item) => item.props.name === index\n )\n if (filteredItems.length > 0) {\n index = items.value.indexOf(filteredItems[0])\n }\n }\n index = Number(index)\n if (Number.isNaN(index) || index !== Math.floor(index)) {\n debugWarn(componentName, 'index must be integer.')\n return\n }\n const itemCount = items.value.length\n const oldIndex = activeIndex.value\n if (index < 0) {\n activeIndex.value = props.loop ? itemCount - 1 : 0\n } else if (index >= itemCount) {\n activeIndex.value = props.loop ? 0 : itemCount - 1\n } else {\n activeIndex.value = index\n }\n if (oldIndex === activeIndex.value) {\n resetItemPosition(oldIndex)\n }\n resetTimer()\n }\n\n function resetItemPosition(oldIndex?: number) {\n items.value.forEach((item, index) => {\n item.translateItem(index, activeIndex.value, oldIndex)\n })\n }\n\n function itemInStage(item: CarouselItemContext, index: number) {\n const _items = unref(items)\n const itemCount = _items.length\n if (itemCount === 0 || !item.states.inStage) return false\n const nextItemIndex = index + 1\n const prevItemIndex = index - 1\n const lastItemIndex = itemCount - 1\n const isLastItemActive = _items[lastItemIndex].states.active\n const isFirstItemActive = _items[0].states.active\n const isNextItemActive = _items[nextItemIndex]?.states?.active\n const isPrevItemActive = _items[prevItemIndex]?.states?.active\n\n if ((index === lastItemIndex && isFirstItemActive) || isNextItemActive) {\n return 'left'\n } else if ((index === 0 && isLastItemActive) || isPrevItemActive) {\n return 'right'\n }\n return false\n }\n\n function handleMouseEnter() {\n hover.value = true\n if (props.pauseOnHover) {\n pauseTimer()\n }\n }\n\n function handleMouseLeave() {\n hover.value = false\n startTimer()\n }\n\n function handleButtonEnter(arrow: 'left' | 'right') {\n if (unref(isVertical)) return\n items.value.forEach((item, index) => {\n if (arrow === itemInStage(item, index)) {\n item.states.hover = true\n }\n })\n }\n\n function handleButtonLeave() {\n if (unref(isVertical)) return\n items.value.forEach((item) => {\n item.states.hover = false\n })\n }\n\n function handleIndicatorClick(index: number) {\n activeIndex.value = index\n }\n\n function handleIndicatorHover(index: number) {\n if (props.trigger === 'hover' && index !== activeIndex.value) {\n activeIndex.value = index\n }\n }\n\n function prev() {\n setActiveItem(activeIndex.value - 1)\n }\n\n function next() {\n setActiveItem(activeIndex.value + 1)\n }\n\n function resetTimer() {\n pauseTimer()\n if (!props.pauseOnHover) startTimer()\n }\n\n function setContainerHeight(height: number) {\n if (props.height !== 'auto') return\n containerHeight.value = height\n }\n\n function PlaceholderItem() {\n // fix: https://github.com/element-plus/element-plus/issues/12139\n const defaultSlots = slots.default?.()\n if (!defaultSlots) return null\n\n const flatSlots = flattedChildren(defaultSlots)\n\n const normalizeSlots = flatSlots.filter((slot) => {\n return isVNode(slot) && (slot.type as any).name === CAROUSEL_ITEM_NAME\n })\n\n if (normalizeSlots?.length === 2 && props.loop && !isCardType.value) {\n isItemsTwoLength.value = true\n return normalizeSlots\n }\n isItemsTwoLength.value = false\n return null\n }\n\n // watch\n watch(\n () => activeIndex.value,\n (current, prev) => {\n resetItemPosition(prev)\n if (isItemsTwoLength.value) {\n current = current % 2\n prev = prev % 2\n }\n if (prev > -1) {\n emit(CHANGE_EVENT, current, prev)\n }\n }\n )\n watch(\n () => props.autoplay,\n (autoplay) => {\n autoplay ? startTimer() : pauseTimer()\n }\n )\n watch(\n () => props.loop,\n () => {\n setActiveItem(activeIndex.value)\n }\n )\n\n watch(\n () => props.interval,\n () => {\n resetTimer()\n }\n )\n\n const resizeObserver = shallowRef<ReturnType<typeof useResizeObserver>>()\n // lifecycle\n onMounted(() => {\n watch(\n () => items.value,\n () => {\n if (items.value.length > 0) setActiveItem(props.initialIndex)\n },\n {\n immediate: true,\n }\n )\n\n resizeObserver.value = useResizeObserver(root.value, () => {\n resetItemPosition()\n })\n startTimer()\n })\n\n onBeforeUnmount(() => {\n pauseTimer()\n if (root.value && resizeObserver.value) resizeObserver.value.stop()\n })\n\n // provide\n provide(carouselContextKey, {\n root,\n isCardType,\n isVertical,\n items,\n loop: props.loop,\n cardScale: props.cardScale,\n addItem,\n removeItem,\n setActiveItem,\n setContainerHeight,\n })\n\n return {\n root,\n activeIndex,\n arrowDisplay,\n hasLabel,\n hover,\n isCardType,\n items,\n isVertical,\n containerStyle,\n isItemsTwoLength,\n handleButtonEnter,\n handleButtonLeave,\n handleIndicatorClick,\n handleMouseEnter,\n handleMouseLeave,\n setActiveItem,\n prev,\n next,\n PlaceholderItem,\n isTwoLengthShow,\n ItemsSorter,\n throttledArrowClick,\n throttledIndicatorHover,\n }\n}\n"],"names":["useOrderedChildren","getCurrentInstance","CAROUSEL_ITEM_NAME","useSlots","ref","computed","unref","throttle","isString","debugWarn","flattedChildren","isVNode","watch","CHANGE_EVENT","shallowRef","onMounted","useResizeObserver","onBeforeUnmount","provide","carouselContextKey"],"mappings":";;;;;;;;;;;;;;AAmBA,MAAM,aAAa,GAAG,GAAG,CAA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AC,CAAC;AACL,EAAEC,mBAAe,CAAC,MAAM;AACxB,IAAI,UAAU,EAAE,CAAC;AACjB,IAAI,IAAI,IAAI,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK;AAC1C,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;AAClC,GAAG,CAAC,CAAC;AACL,EAAEC,WAAO,CAACC,4BAAkB,EAAE;AAC9B,IAAI,IAAI;AACR,IAAI,UAAU;AACd,IAAI,UAAU;AACd,IAAI,KAAK;AACT,IAAI,IAAI,EAAE,KAAK,CAAC,IAAI;AACpB,IAAI,SAAS,EAAE,KAAK,CAAC,SAAS;AAC9B,IAAI,OAAO;AACX,IAAI,UAAU;AACd,IAAI,aAAa;AACjB,IAAI,kBAAkB;AACtB,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,WAAW;AACf,IAAI,YAAY;AAChB,IAAI,QAAQ;AACZ,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,cAAc;AAClB,IAAI,gBAAgB;AACpB,IAAI,iBAAiB;AACrB,IAAI,iBAAiB;AACrB,IAAI,oBAAoB;AACxB,IAAI,gBAAgB;AACpB,IAAI,gBAAgB;AACpB,IAAI,aAAa;AACjB,IAAI,IAAI;AACR,IAAI,IAAI;AACR,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,WAAW;AACf,IAAI,mBAAmB;AACvB,IAAI,uBAAuB;AAC3B,GAAG,CAAC;AACJ;;;;"}
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
var core = require('@popperjs/core');
|
6
6
|
var config = require('../../cascader-panel/src/config.js');
|
7
|
-
var tag = require('../../tag/src/
|
7
|
+
var tag = require('../../tag/src/tag.js');
|
8
8
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
9
9
|
var index = require('../../../hooks/use-size/index.js');
|
10
10
|
var content = require('../../tooltip/src/content2.js');
|
@@ -6,7 +6,7 @@ var vue = require('vue');
|
|
6
6
|
var lodashUnified = require('lodash-unified');
|
7
7
|
var menu = require('./menu.js');
|
8
8
|
var store = require('./store.js');
|
9
|
-
var node = require('./
|
9
|
+
var node = require('./node2.js');
|
10
10
|
var config = require('./config.js');
|
11
11
|
var utils = require('./utils.js');
|
12
12
|
var types = require('./types.js');
|
@@ -6,7 +6,7 @@ var vue = require('vue');
|
|
6
6
|
var index$3 = require('../../scrollbar/index.js');
|
7
7
|
var iconsVue = require('@element-plus/icons-vue');
|
8
8
|
var index$4 = require('../../icon/index.js');
|
9
|
-
var node = require('./
|
9
|
+
var node = require('./node.js');
|
10
10
|
var types = require('./types.js');
|
11
11
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
12
12
|
var index = require('../../../hooks/use-namespace/index.js');
|
@@ -2,124 +2,187 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var
|
6
|
-
var
|
5
|
+
var vue = require('vue');
|
6
|
+
var index$1 = require('../../checkbox/index.js');
|
7
|
+
var index$2 = require('../../radio/index.js');
|
8
|
+
var index$3 = require('../../icon/index.js');
|
9
|
+
var iconsVue = require('@element-plus/icons-vue');
|
10
|
+
var nodeContent = require('./node-content.js');
|
11
|
+
var types = require('./types.js');
|
12
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
13
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
7
14
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
const
|
29
|
-
const childrenData = data[childrenKey];
|
30
|
-
const pathNodes = calculatePathNodes(this);
|
31
|
-
this.level = root ? 0 : parent ? parent.level + 1 : 1;
|
32
|
-
this.value = data[valueKey];
|
33
|
-
this.label = data[labelKey];
|
34
|
-
this.pathNodes = pathNodes;
|
35
|
-
this.pathValues = pathNodes.map((node) => node.value);
|
36
|
-
this.pathLabels = pathNodes.map((node) => node.label);
|
37
|
-
this.childrenData = childrenData;
|
38
|
-
this.children = (childrenData || []).map((child) => new Node(child, config, this));
|
39
|
-
this.loaded = !config.lazy || this.isLeaf || !types.isEmpty(childrenData);
|
40
|
-
this.text = "";
|
41
|
-
}
|
42
|
-
get isDisabled() {
|
43
|
-
const { data, parent, config } = this;
|
44
|
-
const { disabled, checkStrictly } = config;
|
45
|
-
const isDisabled = shared.isFunction(disabled) ? disabled(data, this) : !!data[disabled];
|
46
|
-
return isDisabled || !checkStrictly && !!(parent == null ? void 0 : parent.isDisabled);
|
47
|
-
}
|
48
|
-
get isLeaf() {
|
49
|
-
const { data, config, childrenData, loaded } = this;
|
50
|
-
const { lazy, leaf } = config;
|
51
|
-
const isLeaf = shared.isFunction(leaf) ? leaf(data, this) : data[leaf];
|
52
|
-
return types.isUndefined(isLeaf) ? lazy && !loaded ? false : !(shared.isArray(childrenData) && childrenData.length) : !!isLeaf;
|
53
|
-
}
|
54
|
-
get valueByOption() {
|
55
|
-
return this.config.emitPath ? this.pathValues : this.value;
|
56
|
-
}
|
57
|
-
appendChild(childData) {
|
58
|
-
const { childrenData, children } = this;
|
59
|
-
const node = new Node(childData, this.config, this);
|
60
|
-
if (shared.isArray(childrenData)) {
|
61
|
-
childrenData.push(childData);
|
62
|
-
} else {
|
63
|
-
this.childrenData = [childData];
|
64
|
-
}
|
65
|
-
children.push(node);
|
66
|
-
return node;
|
67
|
-
}
|
68
|
-
calcText(allLevels, separator) {
|
69
|
-
const text = allLevels ? this.pathLabels.join(separator) : this.label;
|
70
|
-
this.text = text;
|
71
|
-
return text;
|
72
|
-
}
|
73
|
-
broadcast(checked) {
|
74
|
-
this.children.forEach((child) => {
|
15
|
+
const __default__ = vue.defineComponent({
|
16
|
+
name: "ElCascaderNode"
|
17
|
+
});
|
18
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
19
|
+
...__default__,
|
20
|
+
props: {
|
21
|
+
node: {
|
22
|
+
type: Object,
|
23
|
+
required: true
|
24
|
+
},
|
25
|
+
menuId: String
|
26
|
+
},
|
27
|
+
emits: ["expand"],
|
28
|
+
setup(__props, { emit }) {
|
29
|
+
const props = __props;
|
30
|
+
const panel = vue.inject(types.CASCADER_PANEL_INJECTION_KEY);
|
31
|
+
const ns = index.useNamespace("cascader-node");
|
32
|
+
const isHoverMenu = vue.computed(() => panel.isHoverMenu);
|
33
|
+
const multiple = vue.computed(() => panel.config.multiple);
|
34
|
+
const checkStrictly = vue.computed(() => panel.config.checkStrictly);
|
35
|
+
const checkedNodeId = vue.computed(() => {
|
75
36
|
var _a;
|
76
|
-
|
77
|
-
child.broadcast(checked);
|
78
|
-
(_a = child.onParentCheck) == null ? void 0 : _a.call(child, checked);
|
79
|
-
}
|
37
|
+
return (_a = panel.checkedNodes[0]) == null ? void 0 : _a.uid;
|
80
38
|
});
|
39
|
+
const isDisabled = vue.computed(() => props.node.isDisabled);
|
40
|
+
const isLeaf = vue.computed(() => props.node.isLeaf);
|
41
|
+
const expandable = vue.computed(() => checkStrictly.value && !isLeaf.value || !isDisabled.value);
|
42
|
+
const inExpandingPath = vue.computed(() => isInPath(panel.expandingNode));
|
43
|
+
const inCheckedPath = vue.computed(() => checkStrictly.value && panel.checkedNodes.some(isInPath));
|
44
|
+
const isInPath = (node) => {
|
45
|
+
var _a;
|
46
|
+
const { level, uid } = props.node;
|
47
|
+
return ((_a = node == null ? void 0 : node.pathNodes[level - 1]) == null ? void 0 : _a.uid) === uid;
|
48
|
+
};
|
49
|
+
const doExpand = () => {
|
50
|
+
if (inExpandingPath.value)
|
51
|
+
return;
|
52
|
+
panel.expandNode(props.node);
|
53
|
+
};
|
54
|
+
const doCheck = (checked) => {
|
55
|
+
const { node } = props;
|
56
|
+
if (checked === node.checked)
|
57
|
+
return;
|
58
|
+
panel.handleCheckChange(node, checked);
|
59
|
+
};
|
60
|
+
const doLoad = () => {
|
61
|
+
panel.lazyLoad(props.node, () => {
|
62
|
+
if (!isLeaf.value)
|
63
|
+
doExpand();
|
64
|
+
});
|
65
|
+
};
|
66
|
+
const handleHoverExpand = (e) => {
|
67
|
+
if (!isHoverMenu.value)
|
68
|
+
return;
|
69
|
+
handleExpand();
|
70
|
+
!isLeaf.value && emit("expand", e);
|
71
|
+
};
|
72
|
+
const handleExpand = () => {
|
73
|
+
const { node } = props;
|
74
|
+
if (!expandable.value || node.loading)
|
75
|
+
return;
|
76
|
+
node.loaded ? doExpand() : doLoad();
|
77
|
+
};
|
78
|
+
const handleClick = () => {
|
79
|
+
if (isHoverMenu.value && !isLeaf.value)
|
80
|
+
return;
|
81
|
+
if (isLeaf.value && !isDisabled.value && !checkStrictly.value && !multiple.value) {
|
82
|
+
handleCheck(true);
|
83
|
+
} else {
|
84
|
+
handleExpand();
|
85
|
+
}
|
86
|
+
};
|
87
|
+
const handleSelectCheck = (checked) => {
|
88
|
+
if (checkStrictly.value) {
|
89
|
+
doCheck(checked);
|
90
|
+
if (props.node.loaded) {
|
91
|
+
doExpand();
|
92
|
+
}
|
93
|
+
} else {
|
94
|
+
handleCheck(checked);
|
95
|
+
}
|
96
|
+
};
|
97
|
+
const handleCheck = (checked) => {
|
98
|
+
if (!props.node.loaded) {
|
99
|
+
doLoad();
|
100
|
+
} else {
|
101
|
+
doCheck(checked);
|
102
|
+
!checkStrictly.value && doExpand();
|
103
|
+
}
|
104
|
+
};
|
105
|
+
return (_ctx, _cache) => {
|
106
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
107
|
+
id: `${__props.menuId}-${__props.node.uid}`,
|
108
|
+
role: "menuitem",
|
109
|
+
"aria-haspopup": !vue.unref(isLeaf),
|
110
|
+
"aria-owns": vue.unref(isLeaf) ? void 0 : __props.menuId,
|
111
|
+
"aria-expanded": vue.unref(inExpandingPath),
|
112
|
+
tabindex: vue.unref(expandable) ? -1 : void 0,
|
113
|
+
class: vue.normalizeClass([
|
114
|
+
vue.unref(ns).b(),
|
115
|
+
vue.unref(ns).is("selectable", vue.unref(checkStrictly)),
|
116
|
+
vue.unref(ns).is("active", __props.node.checked),
|
117
|
+
vue.unref(ns).is("disabled", !vue.unref(expandable)),
|
118
|
+
vue.unref(inExpandingPath) && "in-active-path",
|
119
|
+
vue.unref(inCheckedPath) && "in-checked-path"
|
120
|
+
]),
|
121
|
+
onMouseenter: handleHoverExpand,
|
122
|
+
onFocus: handleHoverExpand,
|
123
|
+
onClick: handleClick
|
124
|
+
}, [
|
125
|
+
vue.createCommentVNode(" prefix "),
|
126
|
+
vue.unref(multiple) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElCheckbox), {
|
127
|
+
key: 0,
|
128
|
+
"model-value": __props.node.checked,
|
129
|
+
indeterminate: __props.node.indeterminate,
|
130
|
+
disabled: vue.unref(isDisabled),
|
131
|
+
onClick: vue.withModifiers(() => {
|
132
|
+
}, ["stop"]),
|
133
|
+
"onUpdate:modelValue": handleSelectCheck
|
134
|
+
}, null, 8, ["model-value", "indeterminate", "disabled", "onClick"])) : vue.unref(checkStrictly) ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.ElRadio), {
|
135
|
+
key: 1,
|
136
|
+
"model-value": vue.unref(checkedNodeId),
|
137
|
+
label: __props.node.uid,
|
138
|
+
disabled: vue.unref(isDisabled),
|
139
|
+
"onUpdate:modelValue": handleSelectCheck,
|
140
|
+
onClick: vue.withModifiers(() => {
|
141
|
+
}, ["stop"])
|
142
|
+
}, {
|
143
|
+
default: vue.withCtx(() => [
|
144
|
+
vue.createCommentVNode("\n Add an empty element to avoid render label,\n do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485\n "),
|
145
|
+
vue.createElementVNode("span")
|
146
|
+
]),
|
147
|
+
_: 1
|
148
|
+
}, 8, ["model-value", "label", "disabled", "onClick"])) : vue.unref(isLeaf) && __props.node.checked ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.ElIcon), {
|
149
|
+
key: 2,
|
150
|
+
class: vue.normalizeClass(vue.unref(ns).e("prefix"))
|
151
|
+
}, {
|
152
|
+
default: vue.withCtx(() => [
|
153
|
+
vue.createVNode(vue.unref(iconsVue.Check))
|
154
|
+
]),
|
155
|
+
_: 1
|
156
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true),
|
157
|
+
vue.createVNode(vue.unref(nodeContent["default"]), {
|
158
|
+
"render-label-fn": vue.unref(panel).renderLabelFn,
|
159
|
+
node: __props.node
|
160
|
+
}, null, 8, ["render-label-fn", "node"]),
|
161
|
+
vue.createCommentVNode(" postfix "),
|
162
|
+
!vue.unref(isLeaf) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
|
163
|
+
__props.node.loading ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.ElIcon), {
|
164
|
+
key: 0,
|
165
|
+
class: vue.normalizeClass([vue.unref(ns).is("loading"), vue.unref(ns).e("postfix")])
|
166
|
+
}, {
|
167
|
+
default: vue.withCtx(() => [
|
168
|
+
vue.createVNode(vue.unref(iconsVue.Loading))
|
169
|
+
]),
|
170
|
+
_: 1
|
171
|
+
}, 8, ["class"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$3.ElIcon), {
|
172
|
+
key: 1,
|
173
|
+
class: vue.normalizeClass(["arrow-right", vue.unref(ns).e("postfix")])
|
174
|
+
}, {
|
175
|
+
default: vue.withCtx(() => [
|
176
|
+
vue.createVNode(vue.unref(iconsVue.ArrowRight))
|
177
|
+
]),
|
178
|
+
_: 1
|
179
|
+
}, 8, ["class"]))
|
180
|
+
], 64)) : vue.createCommentVNode("v-if", true)
|
181
|
+
], 42, ["id", "aria-haspopup", "aria-owns", "aria-expanded", "tabindex"]);
|
182
|
+
};
|
81
183
|
}
|
82
|
-
|
83
|
-
|
84
|
-
const { parent } = this;
|
85
|
-
if (parent) {
|
86
|
-
(_a = parent.onChildCheck) == null ? void 0 : _a.call(parent);
|
87
|
-
parent.emit();
|
88
|
-
}
|
89
|
-
}
|
90
|
-
onParentCheck(checked) {
|
91
|
-
if (!this.isDisabled) {
|
92
|
-
this.setCheckState(checked);
|
93
|
-
}
|
94
|
-
}
|
95
|
-
onChildCheck() {
|
96
|
-
const { children } = this;
|
97
|
-
const validChildren = children.filter((child) => !child.isDisabled);
|
98
|
-
const checked = validChildren.length ? validChildren.every((child) => child.checked) : false;
|
99
|
-
this.setCheckState(checked);
|
100
|
-
}
|
101
|
-
setCheckState(checked) {
|
102
|
-
const totalNum = this.children.length;
|
103
|
-
const checkedNum = this.children.reduce((c, p) => {
|
104
|
-
const num = p.checked ? 1 : p.indeterminate ? 0.5 : 0;
|
105
|
-
return c + num;
|
106
|
-
}, 0);
|
107
|
-
this.checked = this.loaded && this.children.filter((child) => !child.isDisabled).every((child) => child.loaded && child.checked) && checked;
|
108
|
-
this.indeterminate = this.loaded && checkedNum !== totalNum && checkedNum > 0;
|
109
|
-
}
|
110
|
-
doCheck(checked) {
|
111
|
-
if (this.checked === checked)
|
112
|
-
return;
|
113
|
-
const { checkStrictly, multiple } = this.config;
|
114
|
-
if (checkStrictly || !multiple) {
|
115
|
-
this.checked = checked;
|
116
|
-
} else {
|
117
|
-
this.broadcast(checked);
|
118
|
-
this.setCheckState(checked);
|
119
|
-
this.emit();
|
120
|
-
}
|
121
|
-
}
|
122
|
-
}
|
184
|
+
});
|
185
|
+
var ElCascaderNode = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "node.vue"]]);
|
123
186
|
|
124
|
-
exports["default"] =
|
187
|
+
exports["default"] = ElCascaderNode;
|
125
188
|
//# sourceMappingURL=node.js.map
|