element-plus 2.3.4 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +111 -38
- package/dist/index.full.min.js +15 -15
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +15 -15
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +111 -38
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/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 +21 -21
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.js.map +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.min.mjs.map +1 -1
- package/dist/locale/fa.mjs +21 -21
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/carousel/index.d.ts +10 -0
- package/es/components/carousel/src/carousel-item.vue.d.ts +1 -0
- package/es/components/carousel/src/carousel-item2.mjs +7 -1
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +8 -0
- package/es/components/carousel/src/carousel2.mjs +7 -2
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/carousel/src/constants.d.ts +1 -0
- package/es/components/carousel/src/constants.mjs.map +1 -1
- package/es/components/carousel/src/use-carousel-item.d.ts +1 -0
- package/es/components/carousel/src/use-carousel-item.mjs +7 -5
- package/es/components/carousel/src/use-carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/use-carousel.d.ts +8 -0
- package/es/components/carousel/src/use-carousel.mjs +21 -1
- package/es/components/carousel/src/use-carousel.mjs.map +1 -1
- package/es/components/cascader/index.d.ts +16 -16
- package/es/components/cascader/src/cascader.vue.d.ts +8 -8
- package/es/components/check-tag/index.d.ts +1 -0
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag.vue.d.ts +1 -0
- package/es/components/check-tag/src/check-tag2.mjs +3 -2
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +1 -1
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/input-number/src/input-number2.mjs +4 -1
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/loading/src/service.mjs +2 -2
- package/es/components/loading/src/service.mjs.map +1 -1
- package/es/components/menu/src/menu.mjs +1 -1
- package/es/components/menu/src/menu.mjs.map +1 -1
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/select/src/useSelect.mjs +4 -0
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/steps/index.d.ts +2 -0
- package/es/components/steps/src/item.vue.d.ts +1 -0
- package/es/components/steps/src/item2.mjs +9 -6
- package/es/components/steps/src/item2.mjs.map +1 -1
- package/es/components/table/src/table-header/event-helper.mjs +6 -2
- package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
- package/es/components/table-v2/src/renderers/cell.mjs +1 -1
- package/es/components/table-v2/src/renderers/cell.mjs.map +1 -1
- package/es/components/tag/index.d.ts +8 -8
- package/es/components/tag/src/tag.d.ts +2 -2
- package/es/components/tag/src/tag.mjs +2 -2
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag.vue.d.ts +8 -8
- package/es/components/tag/src/tag2.mjs +3 -3
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/time-select/src/time-select.mjs.map +1 -1
- package/es/components/time-select/src/time-select2.mjs.map +1 -1
- package/es/components/timeline/index.d.ts +38 -0
- package/es/components/timeline/src/timeline-item.mjs.map +1 -1
- package/es/components/timeline/src/timeline-item.vue.d.ts +19 -0
- package/es/components/timeline/src/timeline-item2.mjs +9 -7
- package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
- package/es/components/tree/index.d.ts +2 -2
- package/es/components/tree/src/model/useDragNode.mjs +2 -2
- package/es/components/tree/src/model/useDragNode.mjs.map +1 -1
- package/es/components/tree/src/tree.type.d.ts +1 -1
- package/es/components/tree/src/tree.vue.d.ts +1 -1
- package/es/components/tree-select/src/tree-select.mjs.map +1 -1
- package/es/components/tree-select/src/tree.mjs +20 -3
- package/es/components/tree-select/src/tree.mjs.map +1 -1
- package/es/components/upload/src/upload-content2.mjs +5 -1
- package/es/components/upload/src/upload-content2.mjs.map +1 -1
- package/es/locale/lang/fa.mjs +20 -20
- package/es/locale/lang/fa.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/carousel/index.d.ts +10 -0
- package/lib/components/carousel/src/carousel-item.vue.d.ts +1 -0
- package/lib/components/carousel/src/carousel-item2.js +7 -1
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +8 -0
- package/lib/components/carousel/src/carousel2.js +7 -2
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/carousel/src/constants.d.ts +1 -0
- package/lib/components/carousel/src/constants.js.map +1 -1
- package/lib/components/carousel/src/use-carousel-item.d.ts +1 -0
- package/lib/components/carousel/src/use-carousel-item.js +7 -5
- package/lib/components/carousel/src/use-carousel-item.js.map +1 -1
- package/lib/components/carousel/src/use-carousel.d.ts +8 -0
- package/lib/components/carousel/src/use-carousel.js +21 -1
- package/lib/components/carousel/src/use-carousel.js.map +1 -1
- package/lib/components/cascader/index.d.ts +16 -16
- package/lib/components/cascader/src/cascader.vue.d.ts +8 -8
- package/lib/components/check-tag/index.d.ts +1 -0
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag.vue.d.ts +1 -0
- package/lib/components/check-tag/src/check-tag2.js +2 -1
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/image/src/image2.js +1 -1
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/input-number/src/input-number2.js +3 -0
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/loading/src/service.js +2 -2
- package/lib/components/loading/src/service.js.map +1 -1
- package/lib/components/menu/src/menu.js +1 -1
- package/lib/components/menu/src/menu.js.map +1 -1
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/select/src/useSelect.js +4 -0
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/steps/index.d.ts +2 -0
- package/lib/components/steps/src/item.vue.d.ts +1 -0
- package/lib/components/steps/src/item2.js +9 -6
- package/lib/components/steps/src/item2.js.map +1 -1
- package/lib/components/table/src/table-header/event-helper.js +6 -2
- package/lib/components/table/src/table-header/event-helper.js.map +1 -1
- package/lib/components/table-v2/src/renderers/cell.js +1 -1
- package/lib/components/table-v2/src/renderers/cell.js.map +1 -1
- package/lib/components/tag/index.d.ts +8 -8
- package/lib/components/tag/src/tag.d.ts +2 -2
- package/lib/components/tag/src/tag.js +2 -2
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag.vue.d.ts +8 -8
- package/lib/components/tag/src/tag2.js +3 -3
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/time-select/src/time-select.js.map +1 -1
- package/lib/components/time-select/src/time-select2.js.map +1 -1
- package/lib/components/timeline/index.d.ts +38 -0
- package/lib/components/timeline/src/timeline-item.js.map +1 -1
- package/lib/components/timeline/src/timeline-item.vue.d.ts +19 -0
- package/lib/components/timeline/src/timeline-item2.js +8 -6
- package/lib/components/timeline/src/timeline-item2.js.map +1 -1
- package/lib/components/tree/index.d.ts +2 -2
- package/lib/components/tree/src/model/useDragNode.js +2 -2
- package/lib/components/tree/src/model/useDragNode.js.map +1 -1
- package/lib/components/tree/src/tree.type.d.ts +1 -1
- package/lib/components/tree/src/tree.vue.d.ts +1 -1
- package/lib/components/tree-select/src/tree-select.js.map +1 -1
- package/lib/components/tree-select/src/tree.js +20 -3
- package/lib/components/tree-select/src/tree.js.map +1 -1
- package/lib/components/upload/src/upload-content2.js +4 -0
- package/lib/components/upload/src/upload-content2.js.map +1 -1
- package/lib/locale/lang/fa.js +20 -20
- package/lib/locale/lang/fa.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-chalk/el-carousel-item.css +1 -1
- package/theme-chalk/el-carousel.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/carousel-item.scss +8 -0
- package/theme-chalk/src/carousel.scss +9 -2
- package/theme-chalk/src/image.scss +6 -6
- package/theme-chalk/src/progress.scss +10 -1
- package/theme-chalk/src/text.scss +1 -1
- package/web-types.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export declare const ElTag: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
|
-
readonly closable: BooleanConstructor;
|
|
3
2
|
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
|
|
4
|
-
readonly
|
|
3
|
+
readonly closable: BooleanConstructor;
|
|
5
4
|
readonly disableTransitions: BooleanConstructor;
|
|
5
|
+
readonly hit: BooleanConstructor;
|
|
6
6
|
readonly color: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
7
7
|
readonly size: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "small" | "large", unknown, "", boolean>;
|
|
8
8
|
readonly effect: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "light" | "dark" | "plain", unknown, "light", boolean>;
|
|
9
9
|
readonly round: BooleanConstructor;
|
|
10
10
|
}, {
|
|
11
11
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
-
readonly closable: BooleanConstructor;
|
|
13
12
|
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
|
|
14
|
-
readonly
|
|
13
|
+
readonly closable: BooleanConstructor;
|
|
15
14
|
readonly disableTransitions: BooleanConstructor;
|
|
15
|
+
readonly hit: BooleanConstructor;
|
|
16
16
|
readonly color: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
17
17
|
readonly size: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "small" | "large", unknown, "", boolean>;
|
|
18
18
|
readonly effect: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "light" | "dark" | "plain", unknown, "light", boolean>;
|
|
@@ -41,7 +41,7 @@ export declare const ElTag: import("element-plus/es/utils").SFCWithInstall<impor
|
|
|
41
41
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
42
42
|
cssVarBlockName: (name: string) => string;
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
containerKls: import("vue").ComputedRef<string[]>;
|
|
45
45
|
handleClose: (event: MouseEvent) => void;
|
|
46
46
|
handleClick: (event: MouseEvent) => void;
|
|
47
47
|
ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
@@ -112,10 +112,10 @@ export declare const ElTag: import("element-plus/es/utils").SFCWithInstall<impor
|
|
|
112
112
|
close: (evt: MouseEvent) => boolean;
|
|
113
113
|
click: (evt: MouseEvent) => boolean;
|
|
114
114
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
115
|
-
readonly closable: BooleanConstructor;
|
|
116
115
|
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
|
|
117
|
-
readonly
|
|
116
|
+
readonly closable: BooleanConstructor;
|
|
118
117
|
readonly disableTransitions: BooleanConstructor;
|
|
118
|
+
readonly hit: BooleanConstructor;
|
|
119
119
|
readonly color: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
120
120
|
readonly size: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "small" | "large", unknown, "", boolean>;
|
|
121
121
|
readonly effect: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "light" | "dark" | "plain", unknown, "light", boolean>;
|
|
@@ -130,8 +130,8 @@ export declare const ElTag: import("element-plus/es/utils").SFCWithInstall<impor
|
|
|
130
130
|
readonly size: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", unknown>;
|
|
131
131
|
readonly color: string;
|
|
132
132
|
readonly round: boolean;
|
|
133
|
-
readonly hit: boolean;
|
|
134
133
|
readonly disableTransitions: boolean;
|
|
134
|
+
readonly hit: boolean;
|
|
135
135
|
}>> & Record<string, any>;
|
|
136
136
|
export default ElTag;
|
|
137
137
|
export * from './src/tag';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type Tag from './tag.vue';
|
|
2
2
|
import type { ExtractPropTypes } from 'vue';
|
|
3
3
|
export declare const tagProps: {
|
|
4
|
-
readonly closable: BooleanConstructor;
|
|
5
4
|
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
|
|
6
|
-
readonly
|
|
5
|
+
readonly closable: BooleanConstructor;
|
|
7
6
|
readonly disableTransitions: BooleanConstructor;
|
|
7
|
+
readonly hit: BooleanConstructor;
|
|
8
8
|
readonly color: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
9
9
|
readonly size: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "small" | "large", unknown, "", boolean>;
|
|
10
10
|
readonly effect: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "light" | "dark" | "plain", unknown, "light", boolean>;
|
|
@@ -8,14 +8,14 @@ var runtime = require('../../../utils/vue/props/runtime.js');
|
|
|
8
8
|
var size = require('../../../constants/size.js');
|
|
9
9
|
|
|
10
10
|
const tagProps = runtime.buildProps({
|
|
11
|
-
closable: Boolean,
|
|
12
11
|
type: {
|
|
13
12
|
type: String,
|
|
14
13
|
values: ["success", "info", "warning", "danger", ""],
|
|
15
14
|
default: ""
|
|
16
15
|
},
|
|
17
|
-
|
|
16
|
+
closable: Boolean,
|
|
18
17
|
disableTransitions: Boolean,
|
|
18
|
+
hit: Boolean,
|
|
19
19
|
color: {
|
|
20
20
|
type: String,
|
|
21
21
|
default: ""
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sources":["../../../../../../packages/components/tag/src/tag.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\nimport type Tag from './tag.vue'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const tagProps = buildProps({\n
|
|
1
|
+
{"version":3,"file":"tag.js","sources":["../../../../../../packages/components/tag/src/tag.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\nimport type Tag from './tag.vue'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const tagProps = buildProps({\n /**\n * @description type of Tag\n */\n type: {\n type: String,\n values: ['success', 'info', 'warning', 'danger', ''],\n default: '',\n },\n /**\n * @description whether Tag can be removed\n */\n closable: Boolean,\n /**\n * @description whether to disable animations\n */\n disableTransitions: Boolean,\n /**\n * @description whether Tag has a highlighted border\n */\n hit: Boolean,\n /**\n * @description background color of the Tag\n */\n color: {\n type: String,\n default: '',\n },\n /**\n * @description size of Tag\n */\n size: {\n type: String,\n values: componentSizes,\n default: '',\n },\n /**\n * @description theme of Tag\n */\n effect: {\n type: String,\n values: ['dark', 'light', 'plain'],\n default: 'light',\n },\n /**\n * @description whether Tag is rounded\n */\n round: Boolean,\n} as const)\nexport type TagProps = ExtractPropTypes<typeof tagProps>\n\nexport const tagEmits = {\n close: (evt: MouseEvent) => evt instanceof MouseEvent,\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type TagEmits = typeof tagEmits\n\nexport type TagInstance = InstanceType<typeof Tag>\n"],"names":["buildProps","componentSizes"],"mappings":";;;;;;;;;AAEY,MAAC,QAAQ,GAAGA,kBAAU,CAAC;AACnC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AACxD,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,kBAAkB,EAAE,OAAO;AAC7B,EAAE,GAAG,EAAE,OAAO;AACd,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEC,mBAAc;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;AACtC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,KAAK,EAAE,OAAO;AAChB,CAAC,EAAE;AACS,MAAC,QAAQ,GAAG;AACxB,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;;"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
readonly closable: BooleanConstructor;
|
|
3
2
|
readonly type: import("../../../utils").EpPropFinalized<StringConstructor, "" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
|
|
4
|
-
readonly
|
|
3
|
+
readonly closable: BooleanConstructor;
|
|
5
4
|
readonly disableTransitions: BooleanConstructor;
|
|
5
|
+
readonly hit: BooleanConstructor;
|
|
6
6
|
readonly color: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
7
7
|
readonly size: import("../../../utils").EpPropFinalized<StringConstructor, "" | "default" | "small" | "large", unknown, "", boolean>;
|
|
8
8
|
readonly effect: import("../../../utils").EpPropFinalized<StringConstructor, "light" | "dark" | "plain", unknown, "light", boolean>;
|
|
9
9
|
readonly round: BooleanConstructor;
|
|
10
10
|
}, {
|
|
11
11
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
-
readonly closable: BooleanConstructor;
|
|
13
12
|
readonly type: import("../../../utils").EpPropFinalized<StringConstructor, "" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
|
|
14
|
-
readonly
|
|
13
|
+
readonly closable: BooleanConstructor;
|
|
15
14
|
readonly disableTransitions: BooleanConstructor;
|
|
15
|
+
readonly hit: BooleanConstructor;
|
|
16
16
|
readonly color: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
17
17
|
readonly size: import("../../../utils").EpPropFinalized<StringConstructor, "" | "default" | "small" | "large", unknown, "", boolean>;
|
|
18
18
|
readonly effect: import("../../../utils").EpPropFinalized<StringConstructor, "light" | "dark" | "plain", unknown, "light", boolean>;
|
|
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
41
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
42
42
|
cssVarBlockName: (name: string) => string;
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
containerKls: import("vue").ComputedRef<string[]>;
|
|
45
45
|
handleClose: (event: MouseEvent) => void;
|
|
46
46
|
handleClick: (event: MouseEvent) => void;
|
|
47
47
|
ElIcon: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
@@ -112,10 +112,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
112
112
|
close: (evt: MouseEvent) => boolean;
|
|
113
113
|
click: (evt: MouseEvent) => boolean;
|
|
114
114
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
115
|
-
readonly closable: BooleanConstructor;
|
|
116
115
|
readonly type: import("../../../utils").EpPropFinalized<StringConstructor, "" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
|
|
117
|
-
readonly
|
|
116
|
+
readonly closable: BooleanConstructor;
|
|
118
117
|
readonly disableTransitions: BooleanConstructor;
|
|
118
|
+
readonly hit: BooleanConstructor;
|
|
119
119
|
readonly color: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
120
120
|
readonly size: import("../../../utils").EpPropFinalized<StringConstructor, "" | "default" | "small" | "large", unknown, "", boolean>;
|
|
121
121
|
readonly effect: import("../../../utils").EpPropFinalized<StringConstructor, "light" | "dark" | "plain", unknown, "light", boolean>;
|
|
@@ -130,7 +130,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
130
130
|
readonly size: import("../../../utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", unknown>;
|
|
131
131
|
readonly color: string;
|
|
132
132
|
readonly round: boolean;
|
|
133
|
-
readonly hit: boolean;
|
|
134
133
|
readonly disableTransitions: boolean;
|
|
134
|
+
readonly hit: boolean;
|
|
135
135
|
}>;
|
|
136
136
|
export default _default;
|
|
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
23
23
|
const props = __props;
|
|
24
24
|
const tagSize = useFormCommonProps.useFormSize();
|
|
25
25
|
const ns = index.useNamespace("tag");
|
|
26
|
-
const
|
|
26
|
+
const containerKls = vue.computed(() => {
|
|
27
27
|
const { type, hit, effect, closable, round } = props;
|
|
28
28
|
return [
|
|
29
29
|
ns.b(),
|
|
@@ -44,7 +44,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
44
|
return (_ctx, _cache) => {
|
|
45
45
|
return _ctx.disableTransitions ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
46
46
|
key: 0,
|
|
47
|
-
class: vue.normalizeClass(vue.unref(
|
|
47
|
+
class: vue.normalizeClass(vue.unref(containerKls)),
|
|
48
48
|
style: vue.normalizeStyle({ backgroundColor: _ctx.color }),
|
|
49
49
|
onClick: handleClick
|
|
50
50
|
}, [
|
|
@@ -70,7 +70,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
70
70
|
}, {
|
|
71
71
|
default: vue.withCtx(() => [
|
|
72
72
|
vue.createElementVNode("span", {
|
|
73
|
-
class: vue.normalizeClass(vue.unref(
|
|
73
|
+
class: vue.normalizeClass(vue.unref(containerKls)),
|
|
74
74
|
style: vue.normalizeStyle({ backgroundColor: _ctx.color }),
|
|
75
75
|
onClick: handleClick
|
|
76
76
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag2.js","sources":["../../../../../../packages/components/tag/src/tag.vue"],"sourcesContent":["<template>\n <span\n v-if=\"disableTransitions\"\n :class=\"
|
|
1
|
+
{"version":3,"file":"tag2.js","sources":["../../../../../../packages/components/tag/src/tag.vue"],"sourcesContent":["<template>\n <span\n v-if=\"disableTransitions\"\n :class=\"containerKls\"\n :style=\"{ backgroundColor: color }\"\n @click=\"handleClick\"\n >\n <span :class=\"ns.e('content')\">\n <slot />\n </span>\n <el-icon v-if=\"closable\" :class=\"ns.e('close')\" @click.stop=\"handleClose\">\n <Close />\n </el-icon>\n </span>\n <transition v-else :name=\"`${ns.namespace.value}-zoom-in-center`\" appear>\n <span\n :class=\"containerKls\"\n :style=\"{ backgroundColor: color }\"\n @click=\"handleClick\"\n >\n <span :class=\"ns.e('content')\">\n <slot />\n </span>\n <el-icon v-if=\"closable\" :class=\"ns.e('close')\" @click.stop=\"handleClose\">\n <Close />\n </el-icon>\n </span>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport ElIcon from '@element-plus/components/icon'\nimport { Close } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from '@element-plus/components/form'\n\nimport { tagEmits, tagProps } from './tag'\n\ndefineOptions({\n name: 'ElTag',\n})\nconst props = defineProps(tagProps)\nconst emit = defineEmits(tagEmits)\n\nconst tagSize = useFormSize()\nconst ns = useNamespace('tag')\nconst containerKls = computed(() => {\n const { type, hit, effect, closable, round } = props\n return [\n ns.b(),\n ns.is('closable', closable),\n ns.m(type),\n ns.m(tagSize.value),\n ns.m(effect),\n ns.is('hit', hit),\n ns.is('round', round),\n ]\n})\n\n// methods\nconst handleClose = (event: MouseEvent) => {\n emit('close', event)\n}\n\nconst handleClick = (event: MouseEvent) => {\n emit('click', event)\n}\n</script>\n"],"names":["useFormSize","useNamespace","computed"],"mappings":";;;;;;;;;;;;;;uCAuCc,CAAA;AAAA,EACZ,IAAM,EAAA,OAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,UAAUA,8BAAY,EAAA,CAAA;AAC5B,IAAM,MAAA,EAAA,GAAKC,mBAAa,KAAK,CAAA,CAAA;AAC7B,IAAM,MAAA,YAAA,GAAeC,aAAS,MAAM;AAClC,MAAA,MAAM,EAAE,IAAA,EAAM,GAAK,EAAA,MAAA,EAAQ,UAAU,KAAU,EAAA,GAAA,KAAA,CAAA;AAC/C,MAAO,OAAA;AAAA,QACL,GAAG,CAAE,EAAA;AAAA,QACL,EAAA,CAAG,EAAG,CAAA,UAAA,EAAY,QAAQ,CAAA;AAAA,QAC1B,EAAA,CAAG,EAAE,IAAI,CAAA;AAAA,QACT,EAAA,CAAG,CAAE,CAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,QAClB,EAAA,CAAG,EAAE,MAAM,CAAA;AAAA,QACX,EAAA,CAAG,EAAG,CAAA,KAAA,EAAO,GAAG,CAAA;AAAA,QAChB,EAAA,CAAG,EAAG,CAAA,OAAA,EAAS,KAAK,CAAA;AAAA,OACtB,CAAA;AAAA,KACD,CAAA,CAAA;AAGD,IAAM,MAAA,WAAA,GAAc,CAAC,KAAsB,KAAA;AACzC,MAAA,IAAA,CAAK,SAAS,KAAK,CAAA,CAAA;AAAA,KACrB,CAAA;AAEA,IAAM,MAAA,WAAA,GAAc,CAAC,KAAsB,KAAA;AACzC,MAAA,IAAA,CAAK,SAAS,KAAK,CAAA,CAAA;AAAA,KACrB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-select.js","sources":["../../../../../../packages/components/time-select/src/time-select.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { CircleClose, Clock } from '@element-plus/icons-vue'\nimport { useSizeProp } from '@element-plus/hooks'\nimport type TimeSelect from './time-select.vue'\nimport type { Component, ExtractPropTypes, PropType } from 'vue'\n\nexport const timeSelectProps = buildProps({\n format: {\n type: String,\n default: 'HH:mm',\n },\n modelValue: String,\n disabled: Boolean,\n editable: {\n type: Boolean,\n default: true,\n },\n effect: {\n type: String as PropType<'light' | 'dark' | string>,\n default: 'light',\n },\n clearable: {\n type: Boolean,\n default: true,\n },\n size: useSizeProp,\n placeholder: String,\n start: {\n type: String,\n default: '09:00',\n },\n end: {\n type: String,\n default: '18:00',\n },\n step: {\n type: String,\n default: '00:30',\n },\n minTime: String,\n maxTime: String,\n name: String,\n prefixIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => Clock,\n },\n clearIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => CircleClose,\n },\n} as const)\n\nexport type TimeSelectProps = ExtractPropTypes<typeof timeSelectProps>\n\nexport type TimeSelectInstance = InstanceType<typeof TimeSelect>\n"],"names":["buildProps","useSizeProp","definePropType","Clock","CircleClose"],"mappings":";;;;;;;;;;AAGY,MAAC,eAAe,GAAGA,kBAAU,CAAC;AAC1C,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,OAAO,EAAE,MAAM;AACjB,EAAE,OAAO,EAAE,MAAM;AACjB,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAMC,cAAK;AACxB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAED,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAME,oBAAW;AAC9B,GAAG;AACH,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"time-select.js","sources":["../../../../../../packages/components/time-select/src/time-select.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { CircleClose, Clock } from '@element-plus/icons-vue'\nimport { useSizeProp } from '@element-plus/hooks'\nimport type TimeSelect from './time-select.vue'\nimport type { Component, ExtractPropTypes, PropType } from 'vue'\n\nexport const timeSelectProps = buildProps({\n /**\n * @description set format of time\n */\n format: {\n type: String,\n default: 'HH:mm',\n },\n /**\n * @description binding value\n */\n modelValue: String,\n /**\n * @description whether TimeSelect is disabled\n */\n disabled: Boolean,\n /**\n * @description whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n /**\n * @description Tooltip theme, built-in theme: `dark` / `light`\n */\n effect: {\n type: String as PropType<'light' | 'dark' | string>,\n default: 'light',\n },\n /**\n * @description whether to show clear button\n */\n clearable: {\n type: Boolean,\n default: true,\n },\n /**\n * @description size of Input\n */\n size: useSizeProp,\n /**\n * @description placeholder in non-range mode\n */\n placeholder: String,\n /**\n * @description start time\n */\n start: {\n type: String,\n default: '09:00',\n },\n /**\n * @description end time\n */\n end: {\n type: String,\n default: '18:00',\n },\n /**\n * @description time step\n */\n step: {\n type: String,\n default: '00:30',\n },\n /**\n * @description minimum time, any time before this time will be disabled\n */\n minTime: String,\n /**\n * @description maximum time, any time after this time will be disabled\n */\n maxTime: String,\n /**\n * @description same as `name` in native input\n */\n name: String,\n /**\n * @description custom prefix icon component\n */\n prefixIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => Clock,\n },\n /**\n * @description custom clear icon component\n */\n clearIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => CircleClose,\n },\n} as const)\n\nexport type TimeSelectProps = ExtractPropTypes<typeof timeSelectProps>\n\nexport type TimeSelectInstance = InstanceType<typeof TimeSelect>\n"],"names":["buildProps","useSizeProp","definePropType","Clock","CircleClose"],"mappings":";;;;;;;;;;AAGY,MAAC,eAAe,GAAGA,kBAAU,CAAC;AAC1C,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,OAAO,EAAE,MAAM;AACjB,EAAE,OAAO,EAAE,MAAM;AACjB,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAMC,cAAK;AACxB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAED,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAME,oBAAW;AAC9B,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-select2.js","sources":["../../../../../../packages/components/time-select/src/time-select.vue"],"sourcesContent":["<template>\n <el-select\n ref=\"select\"\n :model-value=\"value\"\n :disabled=\"_disabled\"\n :clearable=\"clearable\"\n :clear-icon=\"clearIcon\"\n :size=\"size\"\n :effect=\"effect\"\n :placeholder=\"placeholder\"\n default-first-option\n :filterable=\"editable\"\n @update:model-value=\"(event) => $emit('update:modelValue', event)\"\n @change=\"(event) => $emit('change', event)\"\n @blur=\"(event) => $emit('blur', event)\"\n @focus=\"(event) => $emit('focus', event)\"\n >\n <el-option\n v-for=\"item in items\"\n :key=\"item.value\"\n :label=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n />\n <template #prefix>\n <el-icon v-if=\"prefixIcon\" :class=\"nsInput.e('prefix-icon')\">\n <component :is=\"prefixIcon\" />\n </el-icon>\n </template>\n </el-select>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport dayjs from 'dayjs'\nimport customParseFormat from 'dayjs/plugin/customParseFormat.js'\nimport ElSelect from '@element-plus/components/select'\nimport { useFormDisabled } from '@element-plus/components/form'\nimport ElIcon from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { timeSelectProps } from './time-select'\nimport { compareTime, formatTime, nextTime, parseTime } from './utils'\n\ndayjs.extend(customParseFormat)\n\nconst { Option: ElOption } = ElSelect\n\ndefineOptions({\n name: 'ElTimeSelect',\n})\n\ndefineEmits(['change', 'blur', 'focus', 'update:modelValue'])\n\nconst props = defineProps(timeSelectProps)\n\nconst nsInput = useNamespace('input')\nconst select = ref<typeof ElSelect>()\n\nconst _disabled = useFormDisabled()\n\nconst value = computed(() => props.modelValue)\nconst start = computed(() => {\n const time = parseTime(props.start)\n return time ? formatTime(time) : null\n})\n\nconst end = computed(() => {\n const time = parseTime(props.end)\n return time ? formatTime(time) : null\n})\n\nconst step = computed(() => {\n const time = parseTime(props.step)\n return time ? formatTime(time) : null\n})\n\nconst minTime = computed(() => {\n const time = parseTime(props.minTime || '')\n return time ? formatTime(time) : null\n})\n\nconst maxTime = computed(() => {\n const time = parseTime(props.maxTime || '')\n return time ? formatTime(time) : null\n})\n\nconst items = computed(() => {\n const result: { value: string; disabled: boolean }[] = []\n if (props.start && props.end && props.step) {\n let current = start.value\n let currentTime: string\n while (current && end.value && compareTime(current, end.value) <= 0) {\n currentTime = dayjs(current, 'HH:mm').format(props.format)\n result.push({\n value: currentTime,\n disabled:\n compareTime(current, minTime.value || '-1:-1') <= 0 ||\n compareTime(current, maxTime.value || '100:100') >= 0,\n })\n current = nextTime(current, step.value!)\n }\n }\n return result\n})\n\nconst blur = () => {\n select.value?.blur?.()\n}\n\nconst focus = () => {\n select.value?.focus?.()\n}\n\ndefineExpose({\n blur,\n focus,\n})\n</script>\n"],"names":["dayjs","customParseFormat","ElSelect","useNamespace","ref","useFormDisabled","computed","parseTime","formatTime","compareTime","nextTime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;uCA+Cc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AANA,IAAAA,yBAAA,CAAM,OAAOC,qCAAiB,CAAA,CAAA;AAE9B,IAAM,MAAA,EAAE,QAAQ,QAAa,EAAA,GAAAC,cAAA,CAAA;AAU7B,IAAM,MAAA,OAAA,GAAUC,qBAAa,OAAO,CAAA,CAAA;AACpC,IAAA,MAAM,SAASC,OAAqB,EAAA,CAAA;AAEpC,IAAA,MAAM,YAAYC,kCAAgB,EAAA,CAAA;AAElC,IAAA,MAAM,KAAQ,GAAAC,YAAA,CAAS,MAAM,KAAA,CAAM,UAAU,CAAA,CAAA;AAC7C,IAAM,MAAA,KAAA,GAAQA,aAAS,MAAM;AAC3B,MAAM,MAAA,IAAA,GAAOC,eAAU,CAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAClC,MAAO,OAAA,IAAA,GAAOC,gBAAW,CAAA,IAAI,CAAI,GAAA,IAAA,CAAA;AAAA,KAClC,CAAA,CAAA;AAED,IAAM,MAAA,GAAA,GAAMF,aAAS,MAAM;AACzB,MAAM,MAAA,IAAA,GAAOC,eAAU,CAAA,KAAA,CAAM,GAAG,CAAA,CAAA;AAChC,MAAO,OAAA,IAAA,GAAOC,gBAAW,CAAA,IAAI,CAAI,GAAA,IAAA,CAAA;AAAA,KAClC,CAAA,CAAA;AAED,IAAM,MAAA,IAAA,GAAOF,aAAS,MAAM;AAC1B,MAAM,MAAA,IAAA,GAAOC,eAAU,CAAA,KAAA,CAAM,IAAI,CAAA,CAAA;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AK,IAAA,CAAA;AAAA,WACvD,CAAA,CAAA;AACD,UAAU,OAAA,GAAAC,cAAA,CAAS,OAAS,EAAA,IAAA,CAAK,KAAM,CAAA,CAAA;AAAA,SACzC;AAAA,OACF;AACA,MAAO,OAAA,MAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,IAAA,EAAA;AAAqB,MACvB,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAEA,KAAA,CAAA;AACE,IAAA,MAAA,cAAsB;AAAA,MACxB,IAAA,EAAA,EAAA,EAAA,CAAA;AAEA,MAAa,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"time-select2.js","sources":["../../../../../../packages/components/time-select/src/time-select.vue"],"sourcesContent":["<template>\n <el-select\n ref=\"select\"\n :model-value=\"value\"\n :disabled=\"_disabled\"\n :clearable=\"clearable\"\n :clear-icon=\"clearIcon\"\n :size=\"size\"\n :effect=\"effect\"\n :placeholder=\"placeholder\"\n default-first-option\n :filterable=\"editable\"\n @update:model-value=\"(event) => $emit('update:modelValue', event)\"\n @change=\"(event) => $emit('change', event)\"\n @blur=\"(event) => $emit('blur', event)\"\n @focus=\"(event) => $emit('focus', event)\"\n >\n <el-option\n v-for=\"item in items\"\n :key=\"item.value\"\n :label=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n />\n <template #prefix>\n <el-icon v-if=\"prefixIcon\" :class=\"nsInput.e('prefix-icon')\">\n <component :is=\"prefixIcon\" />\n </el-icon>\n </template>\n </el-select>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport dayjs from 'dayjs'\nimport customParseFormat from 'dayjs/plugin/customParseFormat.js'\nimport ElSelect from '@element-plus/components/select'\nimport { useFormDisabled } from '@element-plus/components/form'\nimport ElIcon from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { timeSelectProps } from './time-select'\nimport { compareTime, formatTime, nextTime, parseTime } from './utils'\n\ndayjs.extend(customParseFormat)\n\nconst { Option: ElOption } = ElSelect\n\ndefineOptions({\n name: 'ElTimeSelect',\n})\n\ndefineEmits(['change', 'blur', 'focus', 'update:modelValue'])\n\nconst props = defineProps(timeSelectProps)\n\nconst nsInput = useNamespace('input')\nconst select = ref<typeof ElSelect>()\n\nconst _disabled = useFormDisabled()\n\nconst value = computed(() => props.modelValue)\nconst start = computed(() => {\n const time = parseTime(props.start)\n return time ? formatTime(time) : null\n})\n\nconst end = computed(() => {\n const time = parseTime(props.end)\n return time ? formatTime(time) : null\n})\n\nconst step = computed(() => {\n const time = parseTime(props.step)\n return time ? formatTime(time) : null\n})\n\nconst minTime = computed(() => {\n const time = parseTime(props.minTime || '')\n return time ? formatTime(time) : null\n})\n\nconst maxTime = computed(() => {\n const time = parseTime(props.maxTime || '')\n return time ? formatTime(time) : null\n})\n\nconst items = computed(() => {\n const result: { value: string; disabled: boolean }[] = []\n if (props.start && props.end && props.step) {\n let current = start.value\n let currentTime: string\n while (current && end.value && compareTime(current, end.value) <= 0) {\n currentTime = dayjs(current, 'HH:mm').format(props.format)\n result.push({\n value: currentTime,\n disabled:\n compareTime(current, minTime.value || '-1:-1') <= 0 ||\n compareTime(current, maxTime.value || '100:100') >= 0,\n })\n current = nextTime(current, step.value!)\n }\n }\n return result\n})\n\nconst blur = () => {\n select.value?.blur?.()\n}\n\nconst focus = () => {\n select.value?.focus?.()\n}\n\ndefineExpose({\n /**\n * @description focus the Input component\n */\n blur,\n /**\n * @description blur the Input component\n */\n focus,\n})\n</script>\n"],"names":["dayjs","customParseFormat","ElSelect","useNamespace","ref","useFormDisabled","computed","parseTime","formatTime","compareTime","nextTime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;uCA+Cc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AANA,IAAAA,yBAAA,CAAM,OAAOC,qCAAiB,CAAA,CAAA;AAE9B,IAAM,MAAA,EAAE,QAAQ,QAAa,EAAA,GAAAC,cAAA,CAAA;AAU7B,IAAM,MAAA,OAAA,GAAUC,qBAAa,OAAO,CAAA,CAAA;AACpC,IAAA,MAAM,SAASC,OAAqB,EAAA,CAAA;AAEpC,IAAA,MAAM,YAAYC,kCAAgB,EAAA,CAAA;AAElC,IAAA,MAAM,KAAQ,GAAAC,YAAA,CAAS,MAAM,KAAA,CAAM,UAAU,CAAA,CAAA;AAC7C,IAAM,MAAA,KAAA,GAAQA,aAAS,MAAM;AAC3B,MAAM,MAAA,IAAA,GAAOC,eAAU,CAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAClC,MAAO,OAAA,IAAA,GAAOC,gBAAW,CAAA,IAAI,CAAI,GAAA,IAAA,CAAA;AAAA,KAClC,CAAA,CAAA;AAED,IAAM,MAAA,GAAA,GAAMF,aAAS,MAAM;AACzB,MAAM,MAAA,IAAA,GAAOC,eAAU,CAAA,KAAA,CAAM,GAAG,CAAA,CAAA;AAChC,MAAO,OAAA,IAAA,GAAOC,gBAAW,CAAA,IAAI,CAAI,GAAA,IAAA,CAAA;AAAA,KAClC,CAAA,CAAA;AAED,IAAM,MAAA,IAAA,GAAOF,aAAS,MAAM;AAC1B,MAAM,MAAA,IAAA,GAAOC,eAAU,CAAA,KAAA,CAAM,IAAI,CAAA,CAAA;AACjC,MAAO,OAAA,IAAA,GAAOC,gBAAW,CAAA,IAAI,CAAI,GAAA,IAAA,CAAA;AAAA,KAClC,CAA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AA,CAAK,KAAM,CAAA,CAAA;AAAA,SACzC;AAAA,OACF;AACA,MAAO,OAAA,MAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,IAAA,EAAA;AAAqB,MACvB,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAEA,KAAA,CAAA;AACE,IAAA,MAAA,cAAsB;AAAA,MACxB,IAAA,EAAA,EAAA,EAAA,CAAA;AAEA,MAAa,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAAA,KAIX,CAAA;AAAA,IAIA,MAAA,CAAA;AAAA,MACD,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -17,6 +17,24 @@ export declare const ElTimeline: import("element-plus/es/utils").SFCWithInstall<
|
|
|
17
17
|
};
|
|
18
18
|
readonly hollow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
19
19
|
}, {
|
|
20
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
readonly timestamp: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
22
|
+
readonly hideTimestamp: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
23
|
+
readonly center: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
24
|
+
readonly placement: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "bottom", boolean>;
|
|
25
|
+
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
|
|
26
|
+
readonly color: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
27
|
+
readonly size: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "large" | "normal", unknown, "normal", boolean>;
|
|
28
|
+
readonly icon: {
|
|
29
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>))[], unknown, unknown>>;
|
|
30
|
+
readonly required: false;
|
|
31
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
32
|
+
__epPropKey: true;
|
|
33
|
+
};
|
|
34
|
+
readonly hollow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
35
|
+
}>> & {
|
|
36
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
37
|
+
}>>;
|
|
20
38
|
ns: {
|
|
21
39
|
namespace: import("vue").ComputedRef<string>;
|
|
22
40
|
b: (blockSuffix?: string) => string;
|
|
@@ -35,6 +53,7 @@ export declare const ElTimeline: import("element-plus/es/utils").SFCWithInstall<
|
|
|
35
53
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
36
54
|
cssVarBlockName: (name: string) => string;
|
|
37
55
|
};
|
|
56
|
+
defaultNodeKls: import("vue").ComputedRef<string[]>;
|
|
38
57
|
ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
39
58
|
readonly size: {
|
|
40
59
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
@@ -141,6 +160,24 @@ export declare const ElTimelineItem: import("element-plus/es/utils").SFCWithInst
|
|
|
141
160
|
};
|
|
142
161
|
readonly hollow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
143
162
|
}, {
|
|
163
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
164
|
+
readonly timestamp: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
165
|
+
readonly hideTimestamp: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
166
|
+
readonly center: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
167
|
+
readonly placement: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "bottom", boolean>;
|
|
168
|
+
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
|
|
169
|
+
readonly color: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
170
|
+
readonly size: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "large" | "normal", unknown, "normal", boolean>;
|
|
171
|
+
readonly icon: {
|
|
172
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>))[], unknown, unknown>>;
|
|
173
|
+
readonly required: false;
|
|
174
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
175
|
+
__epPropKey: true;
|
|
176
|
+
};
|
|
177
|
+
readonly hollow: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
178
|
+
}>> & {
|
|
179
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
180
|
+
}>>;
|
|
144
181
|
ns: {
|
|
145
182
|
namespace: import("vue").ComputedRef<string>;
|
|
146
183
|
b: (blockSuffix?: string) => string;
|
|
@@ -159,6 +196,7 @@ export declare const ElTimelineItem: import("element-plus/es/utils").SFCWithInst
|
|
|
159
196
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
160
197
|
cssVarBlockName: (name: string) => string;
|
|
161
198
|
};
|
|
199
|
+
defaultNodeKls: import("vue").ComputedRef<string[]>;
|
|
162
200
|
ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
163
201
|
readonly size: {
|
|
164
202
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-item.js","sources":["../../../../../../packages/components/timeline/src/timeline-item.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type TimelineItem from './timeline-item.vue'\n\nexport const timelineItemProps = buildProps({\n timestamp: {\n type: String,\n default: '',\n },\n hideTimestamp: {\n type: Boolean,\n default: false,\n },\n center: {\n type: Boolean,\n default: false,\n },\n placement: {\n type: String,\n values: ['top', 'bottom'],\n default: 'bottom',\n },\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'danger', 'info'],\n default: '',\n },\n color: {\n type: String,\n default: '',\n },\n size: {\n type: String,\n values: ['normal', 'large'],\n default: 'normal',\n },\n icon: {\n type: iconPropType,\n },\n hollow: {\n type: Boolean,\n default: false,\n },\n} as const)\nexport type TimelineItemProps = ExtractPropTypes<typeof timelineItemProps>\n\nexport type TimelineItemInstance = InstanceType<typeof TimelineItem>\n"],"names":["buildProps","iconPropType"],"mappings":";;;;;;;;AACY,MAAC,iBAAiB,GAAGA,kBAAU,CAAC;AAC5C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC/D,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC/B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"timeline-item.js","sources":["../../../../../../packages/components/timeline/src/timeline-item.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type TimelineItem from './timeline-item.vue'\n\nexport const timelineItemProps = buildProps({\n /**\n * @description timestamp content\n */\n timestamp: {\n type: String,\n default: '',\n },\n /**\n * @description whether to show timestamp\n */\n hideTimestamp: {\n type: Boolean,\n default: false,\n },\n /**\n * @description whether vertically centered\n */\n center: {\n type: Boolean,\n default: false,\n },\n /**\n * @description position of timestamp\n */\n placement: {\n type: String,\n values: ['top', 'bottom'],\n default: 'bottom',\n },\n /**\n * @description node type\n */\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'danger', 'info'],\n default: '',\n },\n /**\n * @description background color of node\n */\n color: {\n type: String,\n default: '',\n },\n /**\n * @description node size\n */\n size: {\n type: String,\n values: ['normal', 'large'],\n default: 'normal',\n },\n /**\n * @description icon component\n */\n icon: {\n type: iconPropType,\n },\n /**\n * @description icon is hollow\n */\n hollow: {\n type: Boolean,\n default: false,\n },\n} as const)\nexport type TimelineItemProps = ExtractPropTypes<typeof timelineItemProps>\n\nexport type TimelineItemInstance = InstanceType<typeof TimelineItem>\n"],"names":["buildProps","iconPropType"],"mappings":";;;;;;;;AACY,MAAC,iBAAiB,GAAGA,kBAAU,CAAC;AAC5C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC/D,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC/B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -14,6 +14,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
14
|
};
|
|
15
15
|
readonly hollow: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
16
16
|
}, {
|
|
17
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
readonly timestamp: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
19
|
+
readonly hideTimestamp: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
20
|
+
readonly center: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
21
|
+
readonly placement: import("../../../utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "bottom", boolean>;
|
|
22
|
+
readonly type: import("../../../utils").EpPropFinalized<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
|
|
23
|
+
readonly color: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
24
|
+
readonly size: import("../../../utils").EpPropFinalized<StringConstructor, "large" | "normal", unknown, "normal", boolean>;
|
|
25
|
+
readonly icon: {
|
|
26
|
+
readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>))[], unknown, unknown>>;
|
|
27
|
+
readonly required: false;
|
|
28
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
29
|
+
__epPropKey: true;
|
|
30
|
+
};
|
|
31
|
+
readonly hollow: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
32
|
+
}>> & {
|
|
33
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
34
|
+
}>>;
|
|
17
35
|
ns: {
|
|
18
36
|
namespace: import("vue").ComputedRef<string>;
|
|
19
37
|
b: (blockSuffix?: string) => string;
|
|
@@ -32,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
50
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
33
51
|
cssVarBlockName: (name: string) => string;
|
|
34
52
|
};
|
|
53
|
+
defaultNodeKls: import("vue").ComputedRef<string[]>;
|
|
35
54
|
ElIcon: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
36
55
|
readonly size: {
|
|
37
56
|
readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
@@ -16,7 +16,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
16
16
|
...__default__,
|
|
17
17
|
props: timelineItem.timelineItemProps,
|
|
18
18
|
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
19
20
|
const ns = index.useNamespace("timeline-item");
|
|
21
|
+
const defaultNodeKls = vue.computed(() => [
|
|
22
|
+
ns.e("node"),
|
|
23
|
+
ns.em("node", props.size || ""),
|
|
24
|
+
ns.em("node", props.type || ""),
|
|
25
|
+
ns.is("hollow", props.hollow)
|
|
26
|
+
]);
|
|
20
27
|
return (_ctx, _cache) => {
|
|
21
28
|
return vue.openBlock(), vue.createElementBlock("li", {
|
|
22
29
|
class: vue.normalizeClass([vue.unref(ns).b(), { [vue.unref(ns).e("center")]: _ctx.center }])
|
|
@@ -26,12 +33,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
26
33
|
}, null, 2),
|
|
27
34
|
!_ctx.$slots.dot ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
28
35
|
key: 0,
|
|
29
|
-
class: vue.normalizeClass(
|
|
30
|
-
vue.unref(ns).e("node"),
|
|
31
|
-
vue.unref(ns).em("node", _ctx.size || ""),
|
|
32
|
-
vue.unref(ns).em("node", _ctx.type || ""),
|
|
33
|
-
vue.unref(ns).is("hollow", _ctx.hollow)
|
|
34
|
-
]),
|
|
36
|
+
class: vue.normalizeClass(vue.unref(defaultNodeKls)),
|
|
35
37
|
style: vue.normalizeStyle({
|
|
36
38
|
backgroundColor: _ctx.color
|
|
37
39
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-item2.js","sources":["../../../../../../packages/components/timeline/src/timeline-item.vue"],"sourcesContent":["<template>\n <li :class=\"[ns.b(), { [ns.e('center')]: center }]\">\n <div :class=\"ns.e('tail')\" />\n <div\n v-if=\"!$slots.dot\"\n :class=\"
|
|
1
|
+
{"version":3,"file":"timeline-item2.js","sources":["../../../../../../packages/components/timeline/src/timeline-item.vue"],"sourcesContent":["<template>\n <li :class=\"[ns.b(), { [ns.e('center')]: center }]\">\n <div :class=\"ns.e('tail')\" />\n <div\n v-if=\"!$slots.dot\"\n :class=\"defaultNodeKls\"\n :style=\"{\n backgroundColor: color,\n }\"\n >\n <el-icon v-if=\"icon\" :class=\"ns.e('icon')\">\n <component :is=\"icon\" />\n </el-icon>\n </div>\n <div v-if=\"$slots.dot\" :class=\"ns.e('dot')\">\n <slot name=\"dot\" />\n </div>\n\n <div :class=\"ns.e('wrapper')\">\n <div\n v-if=\"!hideTimestamp && placement === 'top'\"\n :class=\"[ns.e('timestamp'), ns.is('top')]\"\n >\n {{ timestamp }}\n </div>\n\n <div :class=\"ns.e('content')\">\n <slot />\n </div>\n\n <div\n v-if=\"!hideTimestamp && placement === 'bottom'\"\n :class=\"[ns.e('timestamp'), ns.is('bottom')]\"\n >\n {{ timestamp }}\n </div>\n </div>\n </li>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { timelineItemProps } from './timeline-item'\n\ndefineOptions({\n name: 'ElTimelineItem',\n})\n\nconst props = defineProps(timelineItemProps)\n\nconst ns = useNamespace('timeline-item')\nconst defaultNodeKls = computed(() => [\n ns.e('node'),\n ns.em('node', props.size || ''),\n ns.em('node', props.type || ''),\n ns.is('hollow', props.hollow),\n])\n</script>\n"],"names":["useNamespace","computed"],"mappings":";;;;;;;;;;;uCA8Cc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAKA,mBAAa,eAAe,CAAA,CAAA;AACvC,IAAM,MAAA,cAAA,GAAiBC,aAAS,MAAM;AAAA,MACpC,EAAA,CAAG,EAAE,MAAM,CAAA;AAAA,MACX,EAAG,CAAA,EAAA,CAAG,MAAQ,EAAA,KAAA,CAAM,QAAQ,EAAE,CAAA;AAAA,MAC9B,EAAG,CAAA,EAAA,CAAG,MAAQ,EAAA,KAAA,CAAM,QAAQ,EAAE,CAAA;AAAA,MAC9B,EAAG,CAAA,EAAA,CAAG,QAAU,EAAA,KAAA,CAAM,MAAM,CAAA;AAAA,KAC7B,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -184,7 +184,7 @@ declare const _Tree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
184
184
|
props: {
|
|
185
185
|
children?: string | undefined;
|
|
186
186
|
label?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => string) | undefined;
|
|
187
|
-
disabled?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) =>
|
|
187
|
+
disabled?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => boolean) | undefined;
|
|
188
188
|
isLeaf?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => boolean) | undefined;
|
|
189
189
|
class?: ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => string | {
|
|
190
190
|
[key: string]: boolean;
|
|
@@ -619,7 +619,7 @@ export declare const ElTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
619
619
|
props: {
|
|
620
620
|
children?: string | undefined;
|
|
621
621
|
label?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => string) | undefined;
|
|
622
|
-
disabled?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) =>
|
|
622
|
+
disabled?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => boolean) | undefined;
|
|
623
623
|
isLeaf?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => boolean) | undefined;
|
|
624
624
|
class?: ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => string | {
|
|
625
625
|
[key: string]: boolean;
|
|
@@ -34,7 +34,7 @@ function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {
|
|
|
34
34
|
const treeNodeDragOver = ({ event, treeNode }) => {
|
|
35
35
|
const dropNode = treeNode;
|
|
36
36
|
const oldDropNode = dragState.value.dropNode;
|
|
37
|
-
if (oldDropNode && oldDropNode !== dropNode) {
|
|
37
|
+
if (oldDropNode && oldDropNode.node.id !== dropNode.node.id) {
|
|
38
38
|
style.removeClass(oldDropNode.$el, ns.is("drop-inner"));
|
|
39
39
|
}
|
|
40
40
|
const draggingNode = dragState.value.draggingNode;
|
|
@@ -50,7 +50,7 @@ function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {
|
|
|
50
50
|
dropNext = props.allowDrop(draggingNode.node, dropNode.node, "next");
|
|
51
51
|
}
|
|
52
52
|
event.dataTransfer.dropEffect = dropInner || dropPrev || dropNext ? "move" : "none";
|
|
53
|
-
if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
|
|
53
|
+
if ((dropPrev || dropInner || dropNext) && (oldDropNode == null ? void 0 : oldDropNode.node.id) !== dropNode.node.id) {
|
|
54
54
|
if (oldDropNode) {
|
|
55
55
|
ctx.emit("node-drag-leave", draggingNode.node, oldDropNode.node, event);
|
|
56
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDragNode.js","sources":["../../../../../../../packages/components/tree/src/model/useDragNode.ts"],"sourcesContent":["// @ts-nocheck\nimport { provide, ref } from 'vue'\nimport { addClass, removeClass } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport type { InjectionKey } from 'vue'\nimport type Node from './node'\nimport type { NodeDropType } from '../tree.type'\n\ninterface TreeNode {\n node: Node\n $el?: HTMLElement\n}\n\ninterface DragOptions {\n event: DragEvent\n treeNode: TreeNode\n}\n\nexport interface DragEvents {\n treeNodeDragStart: (options: DragOptions) => void\n treeNodeDragOver: (options: DragOptions) => void\n treeNodeDragEnd: (event: DragEvent) => void\n}\n\nexport const dragEventsKey: InjectionKey<DragEvents> = Symbol('dragEvents')\n\nexport function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {\n const ns = useNamespace('tree')\n const dragState = ref({\n showDropIndicator: false,\n draggingNode: null,\n dropNode: null,\n allowDrop: true,\n dropType: null,\n })\n\n const treeNodeDragStart = ({ event, treeNode }: DragOptions) => {\n if (\n typeof props.allowDrag === 'function' &&\n !props.allowDrag(treeNode.node)\n ) {\n event.preventDefault()\n return false\n }\n event.dataTransfer.effectAllowed = 'move'\n\n // wrap in try catch to address IE's error when first param is 'text/plain'\n try {\n // setData is required for draggable to work in FireFox\n // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox\n event.dataTransfer.setData('text/plain', '')\n } catch {}\n dragState.value.draggingNode = treeNode\n ctx.emit('node-drag-start', treeNode.node, event)\n }\n\n const treeNodeDragOver = ({ event, treeNode }: DragOptions) => {\n const dropNode = treeNode\n const oldDropNode = dragState.value.dropNode\n if (oldDropNode && oldDropNode !== dropNode) {\n removeClass(oldDropNode.$el, ns.is('drop-inner'))\n }\n const draggingNode = dragState.value.draggingNode\n if (!draggingNode || !dropNode) return\n\n let dropPrev = true\n let dropInner = true\n let dropNext = true\n let userAllowDropInner = true\n if (typeof props.allowDrop === 'function') {\n dropPrev = props.allowDrop(draggingNode.node, dropNode.node, 'prev')\n userAllowDropInner = dropInner = props.allowDrop(\n draggingNode.node,\n dropNode.node,\n 'inner'\n )\n dropNext = props.allowDrop(draggingNode.node, dropNode.node, 'next')\n }\n event.dataTransfer.dropEffect =\n dropInner || dropPrev || dropNext ? 'move' : 'none'\n if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {\n if (oldDropNode) {\n ctx.emit('node-drag-leave', draggingNode.node, oldDropNode.node, event)\n }\n ctx.emit('node-drag-enter', draggingNode.node, dropNode.node, event)\n }\n\n if (dropPrev || dropInner || dropNext) {\n dragState.value.dropNode = dropNode\n }\n\n if (dropNode.node.nextSibling === draggingNode.node) {\n dropNext = false\n }\n if (dropNode.node.previousSibling === draggingNode.node) {\n dropPrev = false\n }\n if (dropNode.node.contains(draggingNode.node, false)) {\n dropInner = false\n }\n if (\n draggingNode.node === dropNode.node ||\n draggingNode.node.contains(dropNode.node)\n ) {\n dropPrev = false\n dropInner = false\n dropNext = false\n }\n\n const targetPosition = dropNode.$el.getBoundingClientRect()\n const treePosition = el$.value.getBoundingClientRect()\n\n let dropType: NodeDropType\n const prevPercent = dropPrev ? (dropInner ? 0.25 : dropNext ? 0.45 : 1) : -1\n const nextPercent = dropNext ? (dropInner ? 0.75 : dropPrev ? 0.55 : 0) : 1\n\n let indicatorTop = -9999\n const distance = event.clientY - targetPosition.top\n if (distance < targetPosition.height * prevPercent) {\n dropType = 'before'\n } else if (distance > targetPosition.height * nextPercent) {\n dropType = 'after'\n } else if (dropInner) {\n dropType = 'inner'\n } else {\n dropType = 'none'\n }\n\n const iconPosition = dropNode.$el\n .querySelector(`.${ns.be('node', 'expand-icon')}`)\n .getBoundingClientRect()\n const dropIndicator = dropIndicator$.value\n if (dropType === 'before') {\n indicatorTop = iconPosition.top - treePosition.top\n } else if (dropType === 'after') {\n indicatorTop = iconPosition.bottom - treePosition.top\n }\n dropIndicator.style.top = `${indicatorTop}px`\n dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`\n\n if (dropType === 'inner') {\n addClass(dropNode.$el, ns.is('drop-inner'))\n } else {\n removeClass(dropNode.$el, ns.is('drop-inner'))\n }\n\n dragState.value.showDropIndicator =\n dropType === 'before' || dropType === 'after'\n dragState.value.allowDrop =\n dragState.value.showDropIndicator || userAllowDropInner\n dragState.value.dropType = dropType\n ctx.emit('node-drag-over', draggingNode.node, dropNode.node, event)\n }\n\n const treeNodeDragEnd = (event: DragEvent) => {\n const { draggingNode, dropType, dropNode } = dragState.value\n event.preventDefault()\n event.dataTransfer.dropEffect = 'move'\n\n if (draggingNode && dropNode) {\n const draggingNodeCopy = { data: draggingNode.node.data }\n if (dropType !== 'none') {\n draggingNode.node.remove()\n }\n if (dropType === 'before') {\n dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node)\n } else if (dropType === 'after') {\n dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node)\n } else if (dropType === 'inner') {\n dropNode.node.insertChild(draggingNodeCopy)\n }\n if (dropType !== 'none') {\n store.value.registerNode(draggingNodeCopy)\n }\n\n removeClass(dropNode.$el, ns.is('drop-inner'))\n\n ctx.emit(\n 'node-drag-end',\n draggingNode.node,\n dropNode.node,\n dropType,\n event\n )\n if (dropType !== 'none') {\n ctx.emit('node-drop', draggingNode.node, dropNode.node, dropType, event)\n }\n }\n if (draggingNode && !dropNode) {\n ctx.emit('node-drag-end', draggingNode.node, null, dropType, event)\n }\n\n dragState.value.showDropIndicator = false\n dragState.value.draggingNode = null\n dragState.value.dropNode = null\n dragState.value.allowDrop = true\n }\n\n provide(dragEventsKey, {\n treeNodeDragStart,\n treeNodeDragOver,\n treeNodeDragEnd,\n })\n\n return {\n dragState,\n }\n}\n"],"names":["useNamespace","ref","removeClass","addClass","provide"],"mappings":";;;;;;;;;;AAGY,MAAC,aAAa,GAAG,MAAM,CAAC,YAAY,EAAE;AAC3C,SAAS,kBAAkB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE;AAC/E,EAAE,MAAM,EAAE,GAAGA,kBAAY,CAAC,MAAM,CAAC,CAAC;AAClC,EAAE,MAAM,SAAS,GAAGC,OAAG,CAAC;AACxB,IAAI,iBAAiB,EAAE,KAAK;AAC5B,IAAI,YAAY,EA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AAO,CAAC,aAAa,EAAE;AACzB,IAAI,iBAAiB;AACrB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,SAAS;AACb,GAAG,CAAC;AACJ;;;;;"}
|
|
1
|
+
{"version":3,"file":"useDragNode.js","sources":["../../../../../../../packages/components/tree/src/model/useDragNode.ts"],"sourcesContent":["// @ts-nocheck\nimport { provide, ref } from 'vue'\nimport { addClass, removeClass } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport type { InjectionKey } from 'vue'\nimport type Node from './node'\nimport type { NodeDropType } from '../tree.type'\n\ninterface TreeNode {\n node: Node\n $el?: HTMLElement\n}\n\ninterface DragOptions {\n event: DragEvent\n treeNode: TreeNode\n}\n\nexport interface DragEvents {\n treeNodeDragStart: (options: DragOptions) => void\n treeNodeDragOver: (options: DragOptions) => void\n treeNodeDragEnd: (event: DragEvent) => void\n}\n\nexport const dragEventsKey: InjectionKey<DragEvents> = Symbol('dragEvents')\n\nexport function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {\n const ns = useNamespace('tree')\n const dragState = ref({\n showDropIndicator: false,\n draggingNode: null,\n dropNode: null,\n allowDrop: true,\n dropType: null,\n })\n\n const treeNodeDragStart = ({ event, treeNode }: DragOptions) => {\n if (\n typeof props.allowDrag === 'function' &&\n !props.allowDrag(treeNode.node)\n ) {\n event.preventDefault()\n return false\n }\n event.dataTransfer.effectAllowed = 'move'\n\n // wrap in try catch to address IE's error when first param is 'text/plain'\n try {\n // setData is required for draggable to work in FireFox\n // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox\n event.dataTransfer.setData('text/plain', '')\n } catch {}\n dragState.value.draggingNode = treeNode\n ctx.emit('node-drag-start', treeNode.node, event)\n }\n\n const treeNodeDragOver = ({ event, treeNode }: DragOptions) => {\n const dropNode = treeNode\n const oldDropNode = dragState.value.dropNode\n if (oldDropNode && oldDropNode.node.id !== dropNode.node.id) {\n removeClass(oldDropNode.$el, ns.is('drop-inner'))\n }\n const draggingNode = dragState.value.draggingNode\n if (!draggingNode || !dropNode) return\n\n let dropPrev = true\n let dropInner = true\n let dropNext = true\n let userAllowDropInner = true\n if (typeof props.allowDrop === 'function') {\n dropPrev = props.allowDrop(draggingNode.node, dropNode.node, 'prev')\n userAllowDropInner = dropInner = props.allowDrop(\n draggingNode.node,\n dropNode.node,\n 'inner'\n )\n dropNext = props.allowDrop(draggingNode.node, dropNode.node, 'next')\n }\n event.dataTransfer.dropEffect =\n dropInner || dropPrev || dropNext ? 'move' : 'none'\n if (\n (dropPrev || dropInner || dropNext) &&\n oldDropNode?.node.id !== dropNode.node.id\n ) {\n if (oldDropNode) {\n ctx.emit('node-drag-leave', draggingNode.node, oldDropNode.node, event)\n }\n ctx.emit('node-drag-enter', draggingNode.node, dropNode.node, event)\n }\n\n if (dropPrev || dropInner || dropNext) {\n dragState.value.dropNode = dropNode\n }\n\n if (dropNode.node.nextSibling === draggingNode.node) {\n dropNext = false\n }\n if (dropNode.node.previousSibling === draggingNode.node) {\n dropPrev = false\n }\n if (dropNode.node.contains(draggingNode.node, false)) {\n dropInner = false\n }\n if (\n draggingNode.node === dropNode.node ||\n draggingNode.node.contains(dropNode.node)\n ) {\n dropPrev = false\n dropInner = false\n dropNext = false\n }\n\n const targetPosition = dropNode.$el.getBoundingClientRect()\n const treePosition = el$.value.getBoundingClientRect()\n\n let dropType: NodeDropType\n const prevPercent = dropPrev ? (dropInner ? 0.25 : dropNext ? 0.45 : 1) : -1\n const nextPercent = dropNext ? (dropInner ? 0.75 : dropPrev ? 0.55 : 0) : 1\n\n let indicatorTop = -9999\n const distance = event.clientY - targetPosition.top\n if (distance < targetPosition.height * prevPercent) {\n dropType = 'before'\n } else if (distance > targetPosition.height * nextPercent) {\n dropType = 'after'\n } else if (dropInner) {\n dropType = 'inner'\n } else {\n dropType = 'none'\n }\n\n const iconPosition = dropNode.$el\n .querySelector(`.${ns.be('node', 'expand-icon')}`)\n .getBoundingClientRect()\n const dropIndicator = dropIndicator$.value\n if (dropType === 'before') {\n indicatorTop = iconPosition.top - treePosition.top\n } else if (dropType === 'after') {\n indicatorTop = iconPosition.bottom - treePosition.top\n }\n dropIndicator.style.top = `${indicatorTop}px`\n dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`\n\n if (dropType === 'inner') {\n addClass(dropNode.$el, ns.is('drop-inner'))\n } else {\n removeClass(dropNode.$el, ns.is('drop-inner'))\n }\n\n dragState.value.showDropIndicator =\n dropType === 'before' || dropType === 'after'\n dragState.value.allowDrop =\n dragState.value.showDropIndicator || userAllowDropInner\n dragState.value.dropType = dropType\n ctx.emit('node-drag-over', draggingNode.node, dropNode.node, event)\n }\n\n const treeNodeDragEnd = (event: DragEvent) => {\n const { draggingNode, dropType, dropNode } = dragState.value\n event.preventDefault()\n event.dataTransfer.dropEffect = 'move'\n\n if (draggingNode && dropNode) {\n const draggingNodeCopy = { data: draggingNode.node.data }\n if (dropType !== 'none') {\n draggingNode.node.remove()\n }\n if (dropType === 'before') {\n dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node)\n } else if (dropType === 'after') {\n dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node)\n } else if (dropType === 'inner') {\n dropNode.node.insertChild(draggingNodeCopy)\n }\n if (dropType !== 'none') {\n store.value.registerNode(draggingNodeCopy)\n }\n\n removeClass(dropNode.$el, ns.is('drop-inner'))\n\n ctx.emit(\n 'node-drag-end',\n draggingNode.node,\n dropNode.node,\n dropType,\n event\n )\n if (dropType !== 'none') {\n ctx.emit('node-drop', draggingNode.node, dropNode.node, dropType, event)\n }\n }\n if (draggingNode && !dropNode) {\n ctx.emit('node-drag-end', draggingNode.node, null, dropType, event)\n }\n\n dragState.value.showDropIndicator = false\n dragState.value.draggingNode = null\n dragState.value.dropNode = null\n dragState.value.allowDrop = true\n }\n\n provide(dragEventsKey, {\n treeNodeDragStart,\n treeNodeDragOver,\n treeNodeDragEnd,\n })\n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,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACjF,OAAO;AACP,KAAK;AACL,IAAI,IAAI,YAAY,IAAI,CAAC,QAAQ,EAAE;AACnC,MAAM,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC1E,KAAK;AACL,IAAI,SAAS,CAAC,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC;AAC9C,IAAI,SAAS,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AACxC,IAAI,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;AACpC,IAAI,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;AACrC,GAAG,CAAC;AACJ,EAAEE,WAAO,CAAC,aAAa,EAAE;AACzB,IAAI,iBAAiB;AACrB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,SAAS;AACb,GAAG,CAAC;AACJ;;;;;"}
|
|
@@ -53,7 +53,7 @@ export declare interface TreeStoreOptions {
|
|
|
53
53
|
export declare interface TreeOptionProps {
|
|
54
54
|
children?: string;
|
|
55
55
|
label?: string | ((data: TreeNodeData, node: Node) => string);
|
|
56
|
-
disabled?: string | ((data: TreeNodeData, node: Node) =>
|
|
56
|
+
disabled?: string | ((data: TreeNodeData, node: Node) => boolean);
|
|
57
57
|
isLeaf?: string | ((data: TreeNodeData, node: Node) => boolean);
|
|
58
58
|
class?: (data: TreeNodeData, node: Node) => string | {
|
|
59
59
|
[key: string]: boolean;
|
|
@@ -187,7 +187,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
187
187
|
props: {
|
|
188
188
|
children?: string | undefined;
|
|
189
189
|
label?: string | ((data: TreeNodeData, node: Node) => string) | undefined;
|
|
190
|
-
disabled?: string | ((data: TreeNodeData, node: Node) =>
|
|
190
|
+
disabled?: string | ((data: TreeNodeData, node: Node) => boolean) | undefined;
|
|
191
191
|
isLeaf?: string | ((data: TreeNodeData, node: Node) => boolean) | undefined;
|
|
192
192
|
class?: ((data: TreeNodeData, node: Node) => string | {
|
|
193
193
|
[key: string]: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-select.js","sources":["../../../../../../packages/components/tree-select/src/tree-select.vue"],"sourcesContent":["<script lang=\"ts\">\n// @ts-nocheck\nimport { computed, defineComponent, h, onMounted, reactive, ref } from 'vue'\nimport { pick } from 'lodash-unified'\nimport ElSelect from '@element-plus/components/select'\nimport ElTree from '@element-plus/components/tree'\nimport { useSelect } from './select'\nimport { useTree } from './tree'\nimport CacheOptions from './cache-options'\n\nexport default defineComponent({\n name: 'ElTreeSelect',\n // disable `ElSelect` inherit current attrs\n inheritAttrs: false,\n props: {\n ...ElSelect.props,\n ...ElTree.props,\n cacheData: {\n type: Array,\n default: () => [],\n },\n },\n setup(props, context) {\n const { slots, expose } = context\n\n const select = ref<InstanceType<typeof ElSelect>>()\n const tree = ref<InstanceType<typeof ElTree>>()\n\n const key = computed(() => props.nodeKey || props.valueKey || 'value')\n\n const selectProps = useSelect(props, context, { select, tree, key })\n const { cacheOptions, ...treeProps } = useTree(props, context, {\n select,\n tree,\n key,\n })\n\n // expose ElTree/ElSelect methods\n const methods = reactive({})\n expose(methods)\n onMounted(() => {\n Object.assign(methods, {\n ...pick(tree.value, [\n 'filter',\n 'updateKeyChildren',\n 'getCheckedNodes',\n 'setCheckedNodes',\n 'getCheckedKeys',\n 'setCheckedKeys',\n 'setChecked',\n 'getHalfCheckedNodes',\n 'getHalfCheckedKeys',\n 'getCurrentKey',\n 'getCurrentNode',\n 'setCurrentKey',\n 'setCurrentNode',\n 'getNode',\n 'remove',\n 'append',\n 'insertBefore',\n 'insertAfter',\n ]),\n ...pick(select.value, ['focus', 'blur']),\n })\n })\n\n return () =>\n h(\n ElSelect,\n /**\n * 1. The `props` is processed into `Refs`, but `v-bind` and\n * render function props cannot read `Refs`, so use `reactive`\n * unwrap the `Refs` and keep reactive.\n * 2. The keyword `ref` requires `Ref`, but `reactive` broke it,\n * so use function.\n */\n reactive({\n ...selectProps,\n ref: (ref) => (select.value = ref),\n }),\n {\n ...slots,\n default: () => [\n h(CacheOptions, { data: cacheOptions.value }),\n h(\n ElTree,\n reactive({\n ...treeProps,\n ref: (ref) => (tree.value = ref),\n })\n ),\n ],\n }\n )\n },\n})\n</script>\n"],"names":["defineComponent","ElSelect","ElTree","select","ref","tree","computed","useSelect","cacheOptions","useTree","reactive","onMounted","pick","h","CacheOptions"],"mappings":";;;;;;;;;;;;;AAUA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,cAAA;AAAA,EAEN,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA;AAAA,IACL,GAAGC,cAAS,CAAA,KAAA;AAAA,IACZ,GAAGC,kBAAO,CAAA,KAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"tree-select.js","sources":["../../../../../../packages/components/tree-select/src/tree-select.vue"],"sourcesContent":["<script lang=\"ts\">\n// @ts-nocheck\nimport { computed, defineComponent, h, onMounted, reactive, ref } from 'vue'\nimport { pick } from 'lodash-unified'\nimport ElSelect from '@element-plus/components/select'\nimport ElTree from '@element-plus/components/tree'\nimport { useSelect } from './select'\nimport { useTree } from './tree'\nimport CacheOptions from './cache-options'\n\nexport default defineComponent({\n name: 'ElTreeSelect',\n // disable `ElSelect` inherit current attrs\n inheritAttrs: false,\n props: {\n ...ElSelect.props,\n ...ElTree.props,\n /**\n * @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data\n */\n cacheData: {\n type: Array,\n default: () => [],\n },\n },\n setup(props, context) {\n const { slots, expose } = context\n\n const select = ref<InstanceType<typeof ElSelect>>()\n const tree = ref<InstanceType<typeof ElTree>>()\n\n const key = computed(() => props.nodeKey || props.valueKey || 'value')\n\n const selectProps = useSelect(props, context, { select, tree, key })\n const { cacheOptions, ...treeProps } = useTree(props, context, {\n select,\n tree,\n key,\n })\n\n // expose ElTree/ElSelect methods\n const methods = reactive({})\n expose(methods)\n onMounted(() => {\n Object.assign(methods, {\n ...pick(tree.value, [\n 'filter',\n 'updateKeyChildren',\n 'getCheckedNodes',\n 'setCheckedNodes',\n 'getCheckedKeys',\n 'setCheckedKeys',\n 'setChecked',\n 'getHalfCheckedNodes',\n 'getHalfCheckedKeys',\n 'getCurrentKey',\n 'getCurrentNode',\n 'setCurrentKey',\n 'setCurrentNode',\n 'getNode',\n 'remove',\n 'append',\n 'insertBefore',\n 'insertAfter',\n ]),\n ...pick(select.value, ['focus', 'blur']),\n })\n })\n\n return () =>\n h(\n ElSelect,\n /**\n * 1. The `props` is processed into `Refs`, but `v-bind` and\n * render function props cannot read `Refs`, so use `reactive`\n * unwrap the `Refs` and keep reactive.\n * 2. The keyword `ref` requires `Ref`, but `reactive` broke it,\n * so use function.\n */\n reactive({\n ...selectProps,\n ref: (ref) => (select.value = ref),\n }),\n {\n ...slots,\n default: () => [\n h(CacheOptions, { data: cacheOptions.value }),\n h(\n ElTree,\n reactive({\n ...treeProps,\n ref: (ref) => (tree.value = ref),\n })\n ),\n ],\n }\n )\n },\n})\n</script>\n"],"names":["defineComponent","ElSelect","ElTree","select","ref","tree","computed","useSelect","cacheOptions","useTree","reactive","onMounted","pick","h","CacheOptions"],"mappings":";;;;;;;;;;;;;AAUA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,cAAA;AAAA,EAEN,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA;AAAA,IACL,GAAGC,cAAS,CAAA,KAAA;AAAA,IACZ,GAAGC,kBAAO,CAAA,KAAA;AAAA,IAIV,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,KAAA;AAAA,MACN,OAAA,EAAS,MAAM,EAAC;AAAA,KAClB;AAAA,GACF;AAAA,EACA,KAAA,CAAM,OAAO,OAAS,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