@element-plus/nightly 0.0.20250823 → 0.0.20250824
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.full.js +4 -6
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +3 -3
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +4 -6
- 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/breadcrumb/src/breadcrumb-item.vue.d.ts +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/cascader-panel/src/node2.mjs +2 -4
- package/es/components/cascader-panel/src/node2.mjs.map +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/countdown/index.mjs +2 -2
- package/es/components/countdown/src/countdown.mjs +79 -21
- package/es/components/countdown/src/countdown.mjs.map +1 -1
- package/es/components/countdown/src/countdown2.mjs +21 -79
- package/es/components/countdown/src/countdown2.mjs.map +1 -1
- package/es/components/descriptions/index.mjs +2 -2
- package/es/components/descriptions/src/description.mjs +26 -127
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/descriptions/src/description2.mjs +127 -26
- package/es/components/descriptions/src/description2.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +27 -202
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +202 -27
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/form/src/types.d.ts +1 -62
- package/es/components/index.mjs +13 -13
- package/es/components/input-tag/src/input-tag.mjs +1 -1
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +33 -4
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +4 -33
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +73 -140
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +140 -73
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- package/es/components/popper/src/trigger2.mjs +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton.mjs +48 -18
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +18 -48
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/src/tag.mjs +99 -27
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag2.mjs +27 -99
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/transfer/index.mjs +2 -2
- package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +1 -1
- package/es/components/transfer/src/transfer.mjs +68 -164
- package/es/components/transfer/src/transfer.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +164 -68
- package/es/components/transfer/src/transfer2.mjs.map +1 -1
- package/es/directives/click-outside/index.mjs +1 -1
- package/es/hooks/use-locale/index.d.ts +5 -2
- package/es/hooks/use-locale/index.mjs.map +1 -1
- package/es/hooks/use-lockscreen/index.mjs +1 -1
- package/es/index.d.ts +436 -256
- package/es/index.mjs +13 -13
- package/es/utils/typescript.d.ts +61 -0
- package/es/utils/typescript.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/breadcrumb/src/breadcrumb-item.vue.d.ts +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/cascader-panel/src/node2.js +2 -4
- package/lib/components/cascader-panel/src/node2.js.map +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/countdown/index.js +2 -2
- package/lib/components/countdown/src/countdown.js +79 -22
- package/lib/components/countdown/src/countdown.js.map +1 -1
- package/lib/components/countdown/src/countdown2.js +22 -79
- package/lib/components/countdown/src/countdown2.js.map +1 -1
- package/lib/components/descriptions/index.js +2 -2
- package/lib/components/descriptions/src/description.js +26 -127
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/descriptions/src/description2.js +127 -26
- package/lib/components/descriptions/src/description2.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +28 -202
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +202 -28
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/form/src/types.d.ts +1 -62
- package/lib/components/index.js +18 -18
- package/lib/components/input-tag/src/input-tag.js +1 -1
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +33 -4
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +4 -33
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +74 -139
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +139 -74
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- package/lib/components/popper/src/trigger2.js +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton.js +48 -18
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +18 -48
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/src/tag.js +99 -28
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag2.js +28 -99
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/transfer/index.js +2 -2
- package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +1 -1
- package/lib/components/transfer/src/transfer.js +72 -164
- package/lib/components/transfer/src/transfer.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +164 -72
- package/lib/components/transfer/src/transfer2.js.map +1 -1
- package/lib/directives/click-outside/index.js +1 -1
- package/lib/hooks/use-locale/index.d.ts +5 -2
- package/lib/hooks/use-locale/index.js.map +1 -1
- package/lib/hooks/use-lockscreen/index.js +1 -1
- package/lib/index.d.ts +436 -256
- package/lib/index.js +18 -18
- package/lib/utils/typescript.d.ts +61 -0
- package/lib/utils/typescript.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
@@ -1,27 +1,85 @@
|
|
1
|
-
import {
|
1
|
+
import { defineComponent, ref, computed, onMounted, watch, onBeforeUnmount, openBlock, createBlock, unref, createSlots, renderList, withCtx, renderSlot } from 'vue';
|
2
|
+
import { ElStatistic } from '../../statistic/index.mjs';
|
3
|
+
import { countdownProps, countdownEmits } from './countdown2.mjs';
|
4
|
+
import { formatTime, getTime } from './utils.mjs';
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
6
|
+
import { rAF, cAF } from '../../../utils/raf.mjs';
|
2
7
|
import { CHANGE_EVENT } from '../../../constants/event.mjs';
|
3
|
-
import { isNumber } from '../../../utils/types.mjs';
|
4
8
|
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
const __default__ = defineComponent({
|
10
|
+
name: "ElCountdown"
|
11
|
+
});
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
13
|
+
...__default__,
|
14
|
+
props: countdownProps,
|
15
|
+
emits: countdownEmits,
|
16
|
+
setup(__props, { expose, emit }) {
|
17
|
+
const props = __props;
|
18
|
+
let timer;
|
19
|
+
const rawValue = ref(0);
|
20
|
+
const displayValue = computed(() => formatTime(rawValue.value, props.format));
|
21
|
+
const formatter = (val) => formatTime(val, props.format);
|
22
|
+
const stopTimer = () => {
|
23
|
+
if (timer) {
|
24
|
+
cAF(timer);
|
25
|
+
timer = void 0;
|
26
|
+
}
|
27
|
+
};
|
28
|
+
const startTimer = () => {
|
29
|
+
const timestamp = getTime(props.value);
|
30
|
+
const frameFunc = () => {
|
31
|
+
let diff = timestamp - Date.now();
|
32
|
+
emit(CHANGE_EVENT, diff);
|
33
|
+
if (diff <= 0) {
|
34
|
+
diff = 0;
|
35
|
+
stopTimer();
|
36
|
+
emit("finish");
|
37
|
+
} else {
|
38
|
+
timer = rAF(frameFunc);
|
39
|
+
}
|
40
|
+
rawValue.value = diff;
|
41
|
+
};
|
42
|
+
timer = rAF(frameFunc);
|
43
|
+
};
|
44
|
+
onMounted(() => {
|
45
|
+
rawValue.value = getTime(props.value) - Date.now();
|
46
|
+
watch(() => [props.value, props.format], () => {
|
47
|
+
stopTimer();
|
48
|
+
startTimer();
|
49
|
+
}, {
|
50
|
+
immediate: true
|
51
|
+
});
|
52
|
+
});
|
53
|
+
onBeforeUnmount(() => {
|
54
|
+
stopTimer();
|
55
|
+
});
|
56
|
+
expose({
|
57
|
+
displayValue
|
58
|
+
});
|
59
|
+
return (_ctx, _cache) => {
|
60
|
+
return openBlock(), createBlock(unref(ElStatistic), {
|
61
|
+
value: rawValue.value,
|
62
|
+
title: _ctx.title,
|
63
|
+
prefix: _ctx.prefix,
|
64
|
+
suffix: _ctx.suffix,
|
65
|
+
"value-style": _ctx.valueStyle,
|
66
|
+
formatter
|
67
|
+
}, createSlots({
|
68
|
+
_: 2
|
69
|
+
}, [
|
70
|
+
renderList(_ctx.$slots, (_, name) => {
|
71
|
+
return {
|
72
|
+
name,
|
73
|
+
fn: withCtx(() => [
|
74
|
+
renderSlot(_ctx.$slots, name)
|
75
|
+
])
|
76
|
+
};
|
77
|
+
})
|
78
|
+
]), 1032, ["value", "title", "prefix", "suffix", "value-style"]);
|
79
|
+
};
|
19
80
|
}
|
20
81
|
});
|
21
|
-
|
22
|
-
finish: () => true,
|
23
|
-
[CHANGE_EVENT]: (value) => isNumber(value)
|
24
|
-
};
|
82
|
+
var Countdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "countdown.vue"]]);
|
25
83
|
|
26
|
-
export {
|
84
|
+
export { Countdown as default };
|
27
85
|
//# sourceMappingURL=countdown.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"countdown.mjs","sources":["../../../../../../packages/components/countdown/src/countdown.
|
1
|
+
{"version":3,"file":"countdown.mjs","sources":["../../../../../../packages/components/countdown/src/countdown.vue"],"sourcesContent":["<template>\n <el-statistic\n :value=\"rawValue\"\n :title=\"title\"\n :prefix=\"prefix\"\n :suffix=\"suffix\"\n :value-style=\"valueStyle\"\n :formatter=\"formatter\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]>\n <slot :name=\"name\" />\n </template>\n </el-statistic>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { ElStatistic } from '@element-plus/components/statistic'\nimport { cAF, rAF } from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { countdownEmits, countdownProps } from './countdown'\nimport { formatTime, getTime } from './utils'\n\ndefineOptions({\n name: 'ElCountdown',\n})\n\nconst props = defineProps(countdownProps)\nconst emit = defineEmits(countdownEmits)\n\nlet timer: ReturnType<typeof rAF> | undefined\nconst rawValue = ref<number>(0)\nconst displayValue = computed(() => formatTime(rawValue.value, props.format))\n\nconst formatter = (val: number) => formatTime(val, props.format)\n\nconst stopTimer = () => {\n if (timer) {\n cAF(timer)\n timer = undefined\n }\n}\n\nconst startTimer = () => {\n const timestamp = getTime(props.value)\n const frameFunc = () => {\n let diff = timestamp - Date.now()\n emit(CHANGE_EVENT, diff)\n if (diff <= 0) {\n diff = 0\n stopTimer()\n emit('finish')\n } else {\n timer = rAF(frameFunc)\n }\n rawValue.value = diff\n }\n timer = rAF(frameFunc)\n}\n\nonMounted(() => {\n rawValue.value = getTime(props.value) - Date.now()\n\n watch(\n () => [props.value, props.format],\n () => {\n stopTimer()\n startTimer()\n },\n {\n immediate: true,\n }\n )\n})\n\nonBeforeUnmount(() => {\n stopTimer()\n})\n\ndefineExpose({\n /**\n * @description current display value\n */\n displayValue,\n})\n</script>\n"],"names":["_openBlock","_createBlock","_unref"],"mappings":";;;;;;;;mCAuBc,CAAA;AAAA,EACZ,IAAM,EAAA,aAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAI,IAAA,KAAA,CAAA;AACJ,IAAM,MAAA,QAAA,GAAW,IAAY,CAAC,CAAA,CAAA;AAC9B,IAAM,MAAA,YAAA,GAAe,SAAS,MAAM,UAAA,CAAW,SAAS,KAAO,EAAA,KAAA,CAAM,MAAM,CAAC,CAAA,CAAA;AAE5E,IAAA,MAAM,YAAY,CAAC,GAAA,KAAgB,UAAW,CAAA,GAAA,EAAK,MAAM,MAAM,CAAA,CAAA;AAE/D,IAAA,MAAM,YAAY,MAAM;AACtB,MAAA,IAAI,KAAO,EAAA;AACT,QAAA,GAAA,CAAI,KAAK,CAAA,CAAA;AACT,QAAQ,KAAA,GAAA,KAAA,CAAA,CAAA;AAAA,OACV;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,aAAa,MAAM;AACvB,MAAM,MAAA,SAAA,GAAY,OAAQ,CAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AACrC,MAAA,MAAM,YAAY,MAAM;AACtB,QAAI,IAAA,IAAA,GAAO,SAAY,GAAA,IAAA,CAAK,GAAI,EAAA,CAAA;AAChC,QAAA,IAAA,CAAK,cAAc,IAAI,CAAA,CAAA;AACvB,QAAA,IAAI,QAAQ,CAAG,EAAA;AACb,UAAO,IAAA,GAAA,CAAA,CAAA;AACP,UAAU,SAAA,EAAA,CAAA;AACV,UAAA,IAAA,CAAK,QAAQ,CAAA,CAAA;AAAA,SACR,MAAA;AACL,UAAA,KAAA,GAAQ,IAAI,SAAS,CAAA,CAAA;AAAA,SACvB;AACA,QAAA,QAAA,CAAS,KAAQ,GAAA,IAAA,CAAA;AAAA,OACnB,CAAA;AACA,MAAA,KAAA,GAAQ,IAAI,SAAS,CAAA,CAAA;AAAA,KACvB,CAAA;AAEA,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,QAAA,CAAS,QAAQ,OAAQ,CAAA,KAAA,CAAM,KAAK,CAAA,GAAI,KAAK,GAAI,EAAA,CAAA;AAEjD,MAAA,KAAA,CAAA,MAAA,CAAA,KAAA,CAAA,KAAA,EAAA,KAAA,CAAA,MAAA,CAAA,EAAA,MAAA;AAAA,QACE,SAAa,EAAA,CAAA;AAAmB,QAChC,UAAM,EAAA,CAAA;AACJ,OAAU,EAAA;AACV,QAAW,SAAA,EAAA,IAAA;AAAA,OACb,CAAA,CAAA;AAAA,KACA,CAAA,CAAA;AAAA,IAAA,eACa,CAAA,MAAA;AAAA,MACb,SAAA,EAAA,CAAA;AAAA,KACF,CAAA,CAAA;AAAA,IACF,MAAC,CAAA;AAED,MAAA,YAAA;AACE,KAAU,CAAA,CAAA;AAAA,IACZ,OAAC,CAAA,IAAA,EAAA,MAAA,KAAA;AAED,MAAa,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAAAC,KAAA,CAAA,WAAA,CAAA,EAAA;AAAA,QAAA,KAAA,EAAA,QAAA,CAAA,KAAA;AAAA,QAAA,KAAA,EAAA,IAAA,CAAA,KAAA;AAAA,QAAA,MAAA,EAAA,IAAA,CAAA,MAAA;AAAA,QAIX,MAAA,EAAA,IAAA,CAAA,MAAA;AAAA,QACD,aAAA,EAAA,IAAA,CAAA,UAAA;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1,85 +1,27 @@
|
|
1
|
-
import {
|
2
|
-
import { ElStatistic } from '../../statistic/index.mjs';
|
3
|
-
import { countdownProps, countdownEmits } from './countdown.mjs';
|
4
|
-
import { formatTime, getTime } from './utils.mjs';
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
6
|
-
import { rAF, cAF } from '../../../utils/raf.mjs';
|
1
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
7
2
|
import { CHANGE_EVENT } from '../../../constants/event.mjs';
|
3
|
+
import { isNumber } from '../../../utils/types.mjs';
|
8
4
|
|
9
|
-
const
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
if (timer) {
|
24
|
-
cAF(timer);
|
25
|
-
timer = void 0;
|
26
|
-
}
|
27
|
-
};
|
28
|
-
const startTimer = () => {
|
29
|
-
const timestamp = getTime(props.value);
|
30
|
-
const frameFunc = () => {
|
31
|
-
let diff = timestamp - Date.now();
|
32
|
-
emit(CHANGE_EVENT, diff);
|
33
|
-
if (diff <= 0) {
|
34
|
-
diff = 0;
|
35
|
-
stopTimer();
|
36
|
-
emit("finish");
|
37
|
-
} else {
|
38
|
-
timer = rAF(frameFunc);
|
39
|
-
}
|
40
|
-
rawValue.value = diff;
|
41
|
-
};
|
42
|
-
timer = rAF(frameFunc);
|
43
|
-
};
|
44
|
-
onMounted(() => {
|
45
|
-
rawValue.value = getTime(props.value) - Date.now();
|
46
|
-
watch(() => [props.value, props.format], () => {
|
47
|
-
stopTimer();
|
48
|
-
startTimer();
|
49
|
-
}, {
|
50
|
-
immediate: true
|
51
|
-
});
|
52
|
-
});
|
53
|
-
onBeforeUnmount(() => {
|
54
|
-
stopTimer();
|
55
|
-
});
|
56
|
-
expose({
|
57
|
-
displayValue
|
58
|
-
});
|
59
|
-
return (_ctx, _cache) => {
|
60
|
-
return openBlock(), createBlock(unref(ElStatistic), {
|
61
|
-
value: rawValue.value,
|
62
|
-
title: _ctx.title,
|
63
|
-
prefix: _ctx.prefix,
|
64
|
-
suffix: _ctx.suffix,
|
65
|
-
"value-style": _ctx.valueStyle,
|
66
|
-
formatter
|
67
|
-
}, createSlots({
|
68
|
-
_: 2
|
69
|
-
}, [
|
70
|
-
renderList(_ctx.$slots, (_, name) => {
|
71
|
-
return {
|
72
|
-
name,
|
73
|
-
fn: withCtx(() => [
|
74
|
-
renderSlot(_ctx.$slots, name)
|
75
|
-
])
|
76
|
-
};
|
77
|
-
})
|
78
|
-
]), 1032, ["value", "title", "prefix", "suffix", "value-style"]);
|
79
|
-
};
|
5
|
+
const countdownProps = buildProps({
|
6
|
+
format: {
|
7
|
+
type: String,
|
8
|
+
default: "HH:mm:ss"
|
9
|
+
},
|
10
|
+
prefix: String,
|
11
|
+
suffix: String,
|
12
|
+
title: String,
|
13
|
+
value: {
|
14
|
+
type: definePropType([Number, Object]),
|
15
|
+
default: 0
|
16
|
+
},
|
17
|
+
valueStyle: {
|
18
|
+
type: definePropType([String, Object, Array])
|
80
19
|
}
|
81
20
|
});
|
82
|
-
|
21
|
+
const countdownEmits = {
|
22
|
+
finish: () => true,
|
23
|
+
[CHANGE_EVENT]: (value) => isNumber(value)
|
24
|
+
};
|
83
25
|
|
84
|
-
export {
|
26
|
+
export { countdownEmits, countdownProps };
|
85
27
|
//# sourceMappingURL=countdown2.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"countdown2.mjs","sources":["../../../../../../packages/components/countdown/src/countdown.
|
1
|
+
{"version":3,"file":"countdown2.mjs","sources":["../../../../../../packages/components/countdown/src/countdown.ts"],"sourcesContent":["import { buildProps, definePropType, isNumber } from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\n\nimport type {\n ExtractPropTypes,\n StyleValue,\n __ExtractPublicPropTypes,\n} from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type Countdown from './countdown.vue'\n\nexport const countdownProps = buildProps({\n /**\n * @description Formatting the countdown display\n */\n format: {\n type: String,\n default: 'HH:mm:ss',\n },\n /**\n * @description Sets the prefix of a countdown\n */\n prefix: String,\n /**\n * @description Sets the suffix of a countdown\n */\n suffix: String,\n /**\n * @description countdown titles\n */\n title: String,\n /**\n * @description target time\n */\n value: {\n type: definePropType<number | Dayjs>([Number, Object]),\n default: 0,\n },\n /**\n * @description Styles countdown values\n */\n valueStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n },\n} as const)\nexport type CountdownProps = ExtractPropTypes<typeof countdownProps>\nexport type CountdownPropsPublic = __ExtractPublicPropTypes<\n typeof countdownProps\n>\n\nexport const countdownEmits = {\n finish: () => true,\n [CHANGE_EVENT]: (value: number) => isNumber(value),\n}\nexport type CountdownEmits = typeof countdownEmits\n\nexport type CountdownInstance = InstanceType<typeof Countdown> & unknown\n"],"names":[],"mappings":";;;;AAEY,MAAC,cAAc,GAAG,UAAU,CAAC;AACzC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,UAAU;AACvB,GAAG;AACH,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACjD,GAAG;AACH,CAAC,EAAE;AACS,MAAC,cAAc,GAAG;AAC9B,EAAE,MAAM,EAAE,MAAM,IAAI;AACpB,EAAE,CAAC,YAAY,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAC5C;;;;"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import Descriptions from './src/
|
1
|
+
import Descriptions from './src/description2.mjs';
|
2
2
|
import DescriptionItem from './src/description-item.mjs';
|
3
3
|
export { descriptionItemProps } from './src/description-item.mjs';
|
4
|
-
export { descriptionProps } from './src/
|
4
|
+
export { descriptionProps } from './src/description.mjs';
|
5
5
|
import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
|
6
6
|
|
7
7
|
const ElDescriptions = withInstall(Descriptions, {
|
@@ -1,132 +1,31 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
import { descriptionsKey } from './token.mjs';
|
4
|
-
import { descriptionProps } from './description2.mjs';
|
5
|
-
import { COMPONENT_NAME } from './constants.mjs';
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
7
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
8
|
-
import { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';
|
9
|
-
import { flattedChildren } from '../../../utils/vue/vnode.mjs';
|
1
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
2
|
+
import { useSizeProp } from '../../../hooks/use-size/index.mjs';
|
10
3
|
|
11
|
-
const
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
return node;
|
35
|
-
};
|
36
|
-
const getRows = () => {
|
37
|
-
if (!slots.default)
|
38
|
-
return [];
|
39
|
-
const children = flattedChildren(slots.default()).filter((node) => {
|
40
|
-
var _a;
|
41
|
-
return ((_a = node == null ? void 0 : node.type) == null ? void 0 : _a.name) === COMPONENT_NAME;
|
42
|
-
});
|
43
|
-
const rows = [];
|
44
|
-
let temp = [];
|
45
|
-
let count = props.column;
|
46
|
-
let totalSpan = 0;
|
47
|
-
const rowspanTemp = [];
|
48
|
-
children.forEach((node, index) => {
|
49
|
-
var _a, _b, _c;
|
50
|
-
const span = ((_a = node.props) == null ? void 0 : _a.span) || 1;
|
51
|
-
const rowspan = ((_b = node.props) == null ? void 0 : _b.rowspan) || 1;
|
52
|
-
const rowNo = rows.length;
|
53
|
-
rowspanTemp[rowNo] || (rowspanTemp[rowNo] = 0);
|
54
|
-
if (rowspan > 1) {
|
55
|
-
for (let i = 1; i < rowspan; i++) {
|
56
|
-
rowspanTemp[_c = rowNo + i] || (rowspanTemp[_c] = 0);
|
57
|
-
rowspanTemp[rowNo + i]++;
|
58
|
-
totalSpan++;
|
59
|
-
}
|
60
|
-
}
|
61
|
-
if (rowspanTemp[rowNo] > 0) {
|
62
|
-
count -= rowspanTemp[rowNo];
|
63
|
-
rowspanTemp[rowNo] = 0;
|
64
|
-
}
|
65
|
-
if (index < children.length - 1) {
|
66
|
-
totalSpan += span > count ? count : span;
|
67
|
-
}
|
68
|
-
if (index === children.length - 1) {
|
69
|
-
const lastSpan = props.column - totalSpan % props.column;
|
70
|
-
temp.push(filledNode(node, lastSpan, count, true));
|
71
|
-
rows.push(temp);
|
72
|
-
return;
|
73
|
-
}
|
74
|
-
if (span < count) {
|
75
|
-
count -= span;
|
76
|
-
temp.push(node);
|
77
|
-
} else {
|
78
|
-
temp.push(filledNode(node, span, count));
|
79
|
-
rows.push(temp);
|
80
|
-
count = props.column;
|
81
|
-
temp = [];
|
82
|
-
}
|
83
|
-
});
|
84
|
-
return rows;
|
85
|
-
};
|
86
|
-
return (_ctx, _cache) => {
|
87
|
-
return openBlock(), createElementBlock("div", {
|
88
|
-
class: normalizeClass(unref(descriptionKls))
|
89
|
-
}, [
|
90
|
-
_ctx.title || _ctx.extra || _ctx.$slots.title || _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
|
91
|
-
key: 0,
|
92
|
-
class: normalizeClass(unref(ns).e("header"))
|
93
|
-
}, [
|
94
|
-
createElementVNode("div", {
|
95
|
-
class: normalizeClass(unref(ns).e("title"))
|
96
|
-
}, [
|
97
|
-
renderSlot(_ctx.$slots, "title", {}, () => [
|
98
|
-
createTextVNode(toDisplayString(_ctx.title), 1)
|
99
|
-
])
|
100
|
-
], 2),
|
101
|
-
createElementVNode("div", {
|
102
|
-
class: normalizeClass(unref(ns).e("extra"))
|
103
|
-
}, [
|
104
|
-
renderSlot(_ctx.$slots, "extra", {}, () => [
|
105
|
-
createTextVNode(toDisplayString(_ctx.extra), 1)
|
106
|
-
])
|
107
|
-
], 2)
|
108
|
-
], 2)) : createCommentVNode("v-if", true),
|
109
|
-
createElementVNode("div", {
|
110
|
-
class: normalizeClass(unref(ns).e("body"))
|
111
|
-
}, [
|
112
|
-
createElementVNode("table", {
|
113
|
-
class: normalizeClass([unref(ns).e("table"), unref(ns).is("bordered", _ctx.border)])
|
114
|
-
}, [
|
115
|
-
createElementVNode("tbody", null, [
|
116
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(getRows(), (row, _index) => {
|
117
|
-
return openBlock(), createBlock(ElDescriptionsRow, {
|
118
|
-
key: _index,
|
119
|
-
row
|
120
|
-
}, null, 8, ["row"]);
|
121
|
-
}), 128))
|
122
|
-
])
|
123
|
-
], 2)
|
124
|
-
], 2)
|
125
|
-
], 2);
|
126
|
-
};
|
4
|
+
const descriptionProps = buildProps({
|
5
|
+
border: Boolean,
|
6
|
+
column: {
|
7
|
+
type: Number,
|
8
|
+
default: 3
|
9
|
+
},
|
10
|
+
direction: {
|
11
|
+
type: String,
|
12
|
+
values: ["horizontal", "vertical"],
|
13
|
+
default: "horizontal"
|
14
|
+
},
|
15
|
+
size: useSizeProp,
|
16
|
+
title: {
|
17
|
+
type: String,
|
18
|
+
default: ""
|
19
|
+
},
|
20
|
+
extra: {
|
21
|
+
type: String,
|
22
|
+
default: ""
|
23
|
+
},
|
24
|
+
labelWidth: {
|
25
|
+
type: [String, Number],
|
26
|
+
default: ""
|
127
27
|
}
|
128
28
|
});
|
129
|
-
var Descriptions = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "description.vue"]]);
|
130
29
|
|
131
|
-
export {
|
30
|
+
export { descriptionProps };
|
132
31
|
//# sourceMappingURL=description.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"description.mjs","sources":["../../../../../../packages/components/descriptions/src/description.
|
1
|
+
{"version":3,"file":"description.mjs","sources":["../../../../../../packages/components/descriptions/src/description.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { useSizeProp } from '@element-plus/hooks'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Description from './description.vue'\n\nexport const descriptionProps = buildProps({\n /**\n * @description with or without border\n */\n border: Boolean,\n /**\n * @description numbers of `Descriptions Item` in one line\n */\n column: {\n type: Number,\n default: 3,\n },\n /**\n * @description direction of list\n */\n direction: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'horizontal',\n },\n /**\n * @description size of list\n */\n size: useSizeProp,\n /**\n * @description title text, display on the top left\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description extra text, display on the top right\n */\n extra: {\n type: String,\n default: '',\n },\n /**\n * @description width of every label column\n */\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n} as const)\n\nexport type DescriptionProps = ExtractPropTypes<typeof descriptionProps>\nexport type DescriptionPropsPublic = __ExtractPublicPropTypes<\n typeof descriptionProps\n>\nexport type DescriptionInstance = InstanceType<typeof Description> & unknown\n"],"names":[],"mappings":";;;AAEY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,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,IAAI,EAAE,WAAW;AACnB,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC;;;;"}
|
@@ -1,31 +1,132 @@
|
|
1
|
-
import {
|
2
|
-
import
|
1
|
+
import { defineComponent, useSlots, provide, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, createBlock } from 'vue';
|
2
|
+
import ElDescriptionsRow from './descriptions-row2.mjs';
|
3
|
+
import { descriptionsKey } from './token.mjs';
|
4
|
+
import { descriptionProps } from './description.mjs';
|
5
|
+
import { COMPONENT_NAME } from './constants.mjs';
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
8
|
+
import { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';
|
9
|
+
import { flattedChildren } from '../../../utils/vue/vnode.mjs';
|
3
10
|
|
4
|
-
const
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
11
|
+
const __default__ = defineComponent({
|
12
|
+
name: "ElDescriptions"
|
13
|
+
});
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
15
|
+
...__default__,
|
16
|
+
props: descriptionProps,
|
17
|
+
setup(__props) {
|
18
|
+
const props = __props;
|
19
|
+
const ns = useNamespace("descriptions");
|
20
|
+
const descriptionsSize = useFormSize();
|
21
|
+
const slots = useSlots();
|
22
|
+
provide(descriptionsKey, props);
|
23
|
+
const descriptionKls = computed(() => [ns.b(), ns.m(descriptionsSize.value)]);
|
24
|
+
const filledNode = (node, span, count, isLast = false) => {
|
25
|
+
if (!node.props) {
|
26
|
+
node.props = {};
|
27
|
+
}
|
28
|
+
if (span > count) {
|
29
|
+
node.props.span = count;
|
30
|
+
}
|
31
|
+
if (isLast) {
|
32
|
+
node.props.span = span;
|
33
|
+
}
|
34
|
+
return node;
|
35
|
+
};
|
36
|
+
const getRows = () => {
|
37
|
+
if (!slots.default)
|
38
|
+
return [];
|
39
|
+
const children = flattedChildren(slots.default()).filter((node) => {
|
40
|
+
var _a;
|
41
|
+
return ((_a = node == null ? void 0 : node.type) == null ? void 0 : _a.name) === COMPONENT_NAME;
|
42
|
+
});
|
43
|
+
const rows = [];
|
44
|
+
let temp = [];
|
45
|
+
let count = props.column;
|
46
|
+
let totalSpan = 0;
|
47
|
+
const rowspanTemp = [];
|
48
|
+
children.forEach((node, index) => {
|
49
|
+
var _a, _b, _c;
|
50
|
+
const span = ((_a = node.props) == null ? void 0 : _a.span) || 1;
|
51
|
+
const rowspan = ((_b = node.props) == null ? void 0 : _b.rowspan) || 1;
|
52
|
+
const rowNo = rows.length;
|
53
|
+
rowspanTemp[rowNo] || (rowspanTemp[rowNo] = 0);
|
54
|
+
if (rowspan > 1) {
|
55
|
+
for (let i = 1; i < rowspan; i++) {
|
56
|
+
rowspanTemp[_c = rowNo + i] || (rowspanTemp[_c] = 0);
|
57
|
+
rowspanTemp[rowNo + i]++;
|
58
|
+
totalSpan++;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
if (rowspanTemp[rowNo] > 0) {
|
62
|
+
count -= rowspanTemp[rowNo];
|
63
|
+
rowspanTemp[rowNo] = 0;
|
64
|
+
}
|
65
|
+
if (index < children.length - 1) {
|
66
|
+
totalSpan += span > count ? count : span;
|
67
|
+
}
|
68
|
+
if (index === children.length - 1) {
|
69
|
+
const lastSpan = props.column - totalSpan % props.column;
|
70
|
+
temp.push(filledNode(node, lastSpan, count, true));
|
71
|
+
rows.push(temp);
|
72
|
+
return;
|
73
|
+
}
|
74
|
+
if (span < count) {
|
75
|
+
count -= span;
|
76
|
+
temp.push(node);
|
77
|
+
} else {
|
78
|
+
temp.push(filledNode(node, span, count));
|
79
|
+
rows.push(temp);
|
80
|
+
count = props.column;
|
81
|
+
temp = [];
|
82
|
+
}
|
83
|
+
});
|
84
|
+
return rows;
|
85
|
+
};
|
86
|
+
return (_ctx, _cache) => {
|
87
|
+
return openBlock(), createElementBlock("div", {
|
88
|
+
class: normalizeClass(unref(descriptionKls))
|
89
|
+
}, [
|
90
|
+
_ctx.title || _ctx.extra || _ctx.$slots.title || _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
|
91
|
+
key: 0,
|
92
|
+
class: normalizeClass(unref(ns).e("header"))
|
93
|
+
}, [
|
94
|
+
createElementVNode("div", {
|
95
|
+
class: normalizeClass(unref(ns).e("title"))
|
96
|
+
}, [
|
97
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
98
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
99
|
+
])
|
100
|
+
], 2),
|
101
|
+
createElementVNode("div", {
|
102
|
+
class: normalizeClass(unref(ns).e("extra"))
|
103
|
+
}, [
|
104
|
+
renderSlot(_ctx.$slots, "extra", {}, () => [
|
105
|
+
createTextVNode(toDisplayString(_ctx.extra), 1)
|
106
|
+
])
|
107
|
+
], 2)
|
108
|
+
], 2)) : createCommentVNode("v-if", true),
|
109
|
+
createElementVNode("div", {
|
110
|
+
class: normalizeClass(unref(ns).e("body"))
|
111
|
+
}, [
|
112
|
+
createElementVNode("table", {
|
113
|
+
class: normalizeClass([unref(ns).e("table"), unref(ns).is("bordered", _ctx.border)])
|
114
|
+
}, [
|
115
|
+
createElementVNode("tbody", null, [
|
116
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getRows(), (row, _index) => {
|
117
|
+
return openBlock(), createBlock(ElDescriptionsRow, {
|
118
|
+
key: _index,
|
119
|
+
row
|
120
|
+
}, null, 8, ["row"]);
|
121
|
+
}), 128))
|
122
|
+
])
|
123
|
+
], 2)
|
124
|
+
], 2)
|
125
|
+
], 2);
|
126
|
+
};
|
27
127
|
}
|
28
128
|
});
|
129
|
+
var Descriptions = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "description.vue"]]);
|
29
130
|
|
30
|
-
export {
|
131
|
+
export { Descriptions as default };
|
31
132
|
//# sourceMappingURL=description2.mjs.map
|