@element-plus/nightly 0.0.20240228 → 0.0.20240229
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 +158 -85
- package/dist/index.full.min.js +19 -19
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +19 -19
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +158 -85
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/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/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/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/anchor/index.mjs +2 -2
- package/es/components/anchor/src/anchor.mjs +38 -190
- package/es/components/anchor/src/anchor.mjs.map +1 -1
- package/es/components/anchor/src/anchor2.mjs +190 -38
- package/es/components/anchor/src/anchor2.mjs.map +1 -1
- package/es/components/avatar/index.mjs +2 -2
- package/es/components/avatar/src/avatar.mjs +32 -67
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar2.mjs +67 -32
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/calendar/index.mjs +2 -2
- package/es/components/calendar/src/calendar.mjs +18 -131
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +131 -18
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/card/index.mjs +2 -2
- package/es/components/card/src/card.mjs +43 -21
- package/es/components/card/src/card.mjs.map +1 -1
- package/es/components/card/src/card2.mjs +21 -43
- package/es/components/card/src/card2.mjs.map +1 -1
- package/es/components/carousel/index.d.ts +7 -0
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +8 -70
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +70 -8
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/carousel/src/carousel.d.ts +1 -0
- package/es/components/carousel/src/carousel.mjs +4 -0
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +7 -0
- package/es/components/carousel/src/carousel2.mjs +100 -66
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/carousel/src/use-carousel.d.ts +2 -0
- package/es/components/carousel/src/use-carousel.mjs +23 -0
- package/es/components/carousel/src/use-carousel.mjs.map +1 -1
- package/es/components/cascader/index.mjs +2 -2
- package/es/components/cascader/src/cascader.mjs +65 -626
- package/es/components/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader2.mjs +626 -65
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/index.mjs +10 -10
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +35 -4
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +4 -35
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/menu/src/menu.mjs +2 -0
- package/es/components/menu/src/menu.mjs.map +1 -1
- package/es/components/select-v2/src/useSelect.mjs +9 -2
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +82 -234
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +234 -82
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/tour/index.mjs +2 -2
- package/es/components/tour/src/tour.mjs +69 -152
- package/es/components/tour/src/tour.mjs.map +1 -1
- package/es/components/tour/src/tour2.mjs +152 -69
- package/es/components/tour/src/tour2.mjs.map +1 -1
- package/es/components/tree-select/src/select.d.ts +1 -1
- package/es/components/tree-select/src/select.mjs +15 -11
- package/es/components/tree-select/src/select.mjs.map +1 -1
- package/es/components/tree-select/src/tree.mjs +5 -6
- package/es/components/tree-select/src/tree.mjs.map +1 -1
- package/es/components/upload/index.mjs +2 -2
- package/es/components/upload/src/upload-content.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +118 -104
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +104 -118
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/index.mjs +10 -10
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/anchor/index.js +2 -2
- package/lib/components/anchor/src/anchor.js +38 -189
- package/lib/components/anchor/src/anchor.js.map +1 -1
- package/lib/components/anchor/src/anchor2.js +189 -38
- package/lib/components/anchor/src/anchor2.js.map +1 -1
- package/lib/components/avatar/index.js +2 -2
- package/lib/components/avatar/src/avatar.js +33 -67
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar2.js +67 -33
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/calendar/index.js +2 -2
- package/lib/components/calendar/src/calendar.js +19 -131
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +131 -19
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/card/index.js +2 -2
- package/lib/components/card/src/card.js +43 -21
- package/lib/components/card/src/card.js.map +1 -1
- package/lib/components/card/src/card2.js +21 -43
- package/lib/components/card/src/card2.js.map +1 -1
- package/lib/components/carousel/index.d.ts +7 -0
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +8 -70
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +70 -8
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/carousel/src/carousel.d.ts +1 -0
- package/lib/components/carousel/src/carousel.js +4 -0
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +7 -0
- package/lib/components/carousel/src/carousel2.js +99 -65
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/carousel/src/use-carousel.d.ts +2 -0
- package/lib/components/carousel/src/use-carousel.js +23 -0
- package/lib/components/carousel/src/use-carousel.js.map +1 -1
- package/lib/components/cascader/index.js +2 -2
- package/lib/components/cascader/src/cascader.js +66 -626
- package/lib/components/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader2.js +626 -66
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/index.js +10 -10
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +35 -4
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +4 -35
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/menu/src/menu.js +2 -0
- package/lib/components/menu/src/menu.js.map +1 -1
- package/lib/components/select-v2/src/useSelect.js +9 -2
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +82 -233
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +233 -82
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/tour/index.js +2 -2
- package/lib/components/tour/src/tour.js +69 -151
- package/lib/components/tour/src/tour.js.map +1 -1
- package/lib/components/tour/src/tour2.js +151 -69
- package/lib/components/tour/src/tour2.js.map +1 -1
- package/lib/components/tree-select/src/select.d.ts +1 -1
- package/lib/components/tree-select/src/select.js +14 -10
- package/lib/components/tree-select/src/select.js.map +1 -1
- package/lib/components/tree-select/src/tree.js +5 -6
- package/lib/components/tree-select/src/tree.js.map +1 -1
- package/lib/components/upload/index.js +2 -2
- package/lib/components/upload/src/upload-content.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +118 -107
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +107 -118
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/index.js +10 -10
- 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.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/carousel.scss +8 -0
- package/web-types.json +1 -1
|
@@ -2,77 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var index$1 = require('../../icon/index.js');
|
|
7
|
-
require('../../../hooks/index.js');
|
|
8
5
|
require('../../../utils/index.js');
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var shared = require('@vue/shared');
|
|
6
|
+
require('../../../constants/index.js');
|
|
7
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
8
|
+
var size = require('../../../constants/size.js');
|
|
13
9
|
var types = require('../../../utils/types.js');
|
|
14
|
-
var
|
|
10
|
+
var icon = require('../../../utils/vue/icon.js');
|
|
15
11
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const { size } = props;
|
|
41
|
-
return types.isNumber(size) ? ns.cssVarBlock({
|
|
42
|
-
size: style.addUnit(size) || ""
|
|
43
|
-
}) : void 0;
|
|
44
|
-
});
|
|
45
|
-
const fitStyle = vue.computed(() => ({
|
|
46
|
-
objectFit: props.fit
|
|
47
|
-
}));
|
|
48
|
-
vue.watch(() => props.src, () => hasLoadError.value = false);
|
|
49
|
-
function handleError(e) {
|
|
50
|
-
hasLoadError.value = true;
|
|
51
|
-
emit("error", e);
|
|
52
|
-
}
|
|
53
|
-
return (_ctx, _cache) => {
|
|
54
|
-
return vue.openBlock(), vue.createElementBlock("span", {
|
|
55
|
-
class: vue.normalizeClass(vue.unref(avatarClass)),
|
|
56
|
-
style: vue.normalizeStyle(vue.unref(sizeStyle))
|
|
57
|
-
}, [
|
|
58
|
-
(_ctx.src || _ctx.srcSet) && !hasLoadError.value ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
59
|
-
key: 0,
|
|
60
|
-
src: _ctx.src,
|
|
61
|
-
alt: _ctx.alt,
|
|
62
|
-
srcset: _ctx.srcSet,
|
|
63
|
-
style: vue.normalizeStyle(vue.unref(fitStyle)),
|
|
64
|
-
onError: handleError
|
|
65
|
-
}, null, 44, _hoisted_1)) : _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), { key: 1 }, {
|
|
66
|
-
default: vue.withCtx(() => [
|
|
67
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
|
|
68
|
-
]),
|
|
69
|
-
_: 1
|
|
70
|
-
})) : vue.renderSlot(_ctx.$slots, "default", { key: 2 })
|
|
71
|
-
], 6);
|
|
72
|
-
};
|
|
12
|
+
const avatarProps = runtime.buildProps({
|
|
13
|
+
size: {
|
|
14
|
+
type: [Number, String],
|
|
15
|
+
values: size.componentSizes,
|
|
16
|
+
default: "",
|
|
17
|
+
validator: (val) => types.isNumber(val)
|
|
18
|
+
},
|
|
19
|
+
shape: {
|
|
20
|
+
type: String,
|
|
21
|
+
values: ["circle", "square"],
|
|
22
|
+
default: "circle"
|
|
23
|
+
},
|
|
24
|
+
icon: {
|
|
25
|
+
type: icon.iconPropType
|
|
26
|
+
},
|
|
27
|
+
src: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
alt: String,
|
|
32
|
+
srcSet: String,
|
|
33
|
+
fit: {
|
|
34
|
+
type: runtime.definePropType(String),
|
|
35
|
+
default: "cover"
|
|
73
36
|
}
|
|
74
37
|
});
|
|
75
|
-
|
|
38
|
+
const avatarEmits = {
|
|
39
|
+
error: (evt) => evt instanceof Event
|
|
40
|
+
};
|
|
76
41
|
|
|
77
|
-
exports
|
|
42
|
+
exports.avatarEmits = avatarEmits;
|
|
43
|
+
exports.avatarProps = avatarProps;
|
|
78
44
|
//# sourceMappingURL=avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sources":["../../../../../../packages/components/avatar/src/avatar.
|
|
1
|
+
{"version":3,"file":"avatar.js","sources":["../../../../../../packages/components/avatar/src/avatar.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isNumber,\n} from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type { ObjectFitProperty } from 'csstype'\n\nexport const avatarProps = buildProps({\n /**\n * @description avatar size.\n */\n size: {\n type: [Number, String],\n values: componentSizes,\n default: '',\n validator: (val: unknown): val is number => isNumber(val),\n },\n /**\n * @description avatar shape.\n */\n shape: {\n type: String,\n values: ['circle', 'square'],\n default: 'circle',\n },\n /**\n * @description representation type to icon, more info on icon component.\n */\n icon: {\n type: iconPropType,\n },\n /**\n * @description the source of the image for an image avatar.\n */\n src: {\n type: String,\n default: '',\n },\n /**\n * @description native attribute `alt` of image avatar.\n */\n alt: String,\n /**\n * @description native attribute srcset of image avatar.\n */\n srcSet: String,\n /**\n * @description set how the image fit its container for an image avatar.\n */\n fit: {\n type: definePropType<ObjectFitProperty>(String),\n default: 'cover',\n },\n} as const)\nexport type AvatarProps = ExtractPropTypes<typeof avatarProps>\n\nexport const avatarEmits = {\n error: (evt: Event) => evt instanceof Event,\n}\nexport type AvatarEmits = typeof avatarEmits\n"],"names":["buildProps","componentSizes","isNumber","iconPropType","definePropType"],"mappings":";;;;;;;;;;;AAOY,MAAC,WAAW,GAAGA,kBAAU,CAAC;AACtC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,MAAM,EAAEC,mBAAc;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,SAAS,EAAE,CAAC,GAAG,KAAKC,cAAQ,CAAC,GAAG,CAAC;AACrC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAChC,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAEC,sBAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,WAAW,GAAG;AAC3B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,KAAK;AACtC;;;;;"}
|
|
@@ -2,43 +2,77 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var index$1 = require('../../icon/index.js');
|
|
7
|
+
require('../../../hooks/index.js');
|
|
5
8
|
require('../../../utils/index.js');
|
|
6
|
-
require('
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
+
var avatar = require('./avatar.js');
|
|
10
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
11
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
12
|
+
var shared = require('@vue/shared');
|
|
9
13
|
var types = require('../../../utils/types.js');
|
|
10
|
-
var
|
|
14
|
+
var style = require('../../../utils/dom/style.js');
|
|
11
15
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
const _hoisted_1 = ["src", "alt", "srcset"];
|
|
17
|
+
const __default__ = vue.defineComponent({
|
|
18
|
+
name: "ElAvatar"
|
|
19
|
+
});
|
|
20
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
21
|
+
...__default__,
|
|
22
|
+
props: avatar.avatarProps,
|
|
23
|
+
emits: avatar.avatarEmits,
|
|
24
|
+
setup(__props, { emit }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const ns = index.useNamespace("avatar");
|
|
27
|
+
const hasLoadError = vue.ref(false);
|
|
28
|
+
const avatarClass = vue.computed(() => {
|
|
29
|
+
const { size, icon, shape } = props;
|
|
30
|
+
const classList = [ns.b()];
|
|
31
|
+
if (shared.isString(size))
|
|
32
|
+
classList.push(ns.m(size));
|
|
33
|
+
if (icon)
|
|
34
|
+
classList.push(ns.m("icon"));
|
|
35
|
+
if (shape)
|
|
36
|
+
classList.push(ns.m(shape));
|
|
37
|
+
return classList;
|
|
38
|
+
});
|
|
39
|
+
const sizeStyle = vue.computed(() => {
|
|
40
|
+
const { size } = props;
|
|
41
|
+
return types.isNumber(size) ? ns.cssVarBlock({
|
|
42
|
+
size: style.addUnit(size) || ""
|
|
43
|
+
}) : void 0;
|
|
44
|
+
});
|
|
45
|
+
const fitStyle = vue.computed(() => ({
|
|
46
|
+
objectFit: props.fit
|
|
47
|
+
}));
|
|
48
|
+
vue.watch(() => props.src, () => hasLoadError.value = false);
|
|
49
|
+
function handleError(e) {
|
|
50
|
+
hasLoadError.value = true;
|
|
51
|
+
emit("error", e);
|
|
52
|
+
}
|
|
53
|
+
return (_ctx, _cache) => {
|
|
54
|
+
return vue.openBlock(), vue.createElementBlock("span", {
|
|
55
|
+
class: vue.normalizeClass(vue.unref(avatarClass)),
|
|
56
|
+
style: vue.normalizeStyle(vue.unref(sizeStyle))
|
|
57
|
+
}, [
|
|
58
|
+
(_ctx.src || _ctx.srcSet) && !hasLoadError.value ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
59
|
+
key: 0,
|
|
60
|
+
src: _ctx.src,
|
|
61
|
+
alt: _ctx.alt,
|
|
62
|
+
srcset: _ctx.srcSet,
|
|
63
|
+
style: vue.normalizeStyle(vue.unref(fitStyle)),
|
|
64
|
+
onError: handleError
|
|
65
|
+
}, null, 44, _hoisted_1)) : _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), { key: 1 }, {
|
|
66
|
+
default: vue.withCtx(() => [
|
|
67
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
})) : vue.renderSlot(_ctx.$slots, "default", { key: 2 })
|
|
71
|
+
], 6);
|
|
72
|
+
};
|
|
36
73
|
}
|
|
37
74
|
});
|
|
38
|
-
|
|
39
|
-
error: (evt) => evt instanceof Event
|
|
40
|
-
};
|
|
75
|
+
var Avatar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "avatar.vue"]]);
|
|
41
76
|
|
|
42
|
-
exports
|
|
43
|
-
exports.avatarProps = avatarProps;
|
|
77
|
+
exports["default"] = Avatar;
|
|
44
78
|
//# sourceMappingURL=avatar2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar2.js","sources":["../../../../../../packages/components/avatar/src/avatar.
|
|
1
|
+
{"version":3,"file":"avatar2.js","sources":["../../../../../../packages/components/avatar/src/avatar.vue"],"sourcesContent":["<template>\n <span :class=\"avatarClass\" :style=\"sizeStyle\">\n <img\n v-if=\"(src || srcSet) && !hasLoadError\"\n :src=\"src\"\n :alt=\"alt\"\n :srcset=\"srcSet\"\n :style=\"fitStyle\"\n @error=\"handleError\"\n />\n <el-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </el-icon>\n <slot v-else />\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { addUnit, isNumber, isString } from '@element-plus/utils'\nimport { avatarEmits, avatarProps } from './avatar'\n\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElAvatar',\n})\n\nconst props = defineProps(avatarProps)\nconst emit = defineEmits(avatarEmits)\n\nconst ns = useNamespace('avatar')\n\nconst hasLoadError = ref(false)\n\nconst avatarClass = computed(() => {\n const { size, icon, shape } = props\n const classList = [ns.b()]\n if (isString(size)) classList.push(ns.m(size))\n if (icon) classList.push(ns.m('icon'))\n if (shape) classList.push(ns.m(shape))\n return classList\n})\n\nconst sizeStyle = computed(() => {\n const { size } = props\n return isNumber(size)\n ? (ns.cssVarBlock({\n size: addUnit(size) || '',\n }) as CSSProperties)\n : undefined\n})\n\nconst fitStyle = computed<CSSProperties>(() => ({\n objectFit: props.fit,\n}))\n\n// need reset hasLoadError to false if src changed\nwatch(\n () => props.src,\n () => (hasLoadError.value = false)\n)\n\nfunction handleError(e: Event) {\n hasLoadError.value = true\n emit('error', e)\n}\n</script>\n"],"names":["useNamespace","ref","computed","isString","isNumber","addUnit","watch"],"mappings":";;;;;;;;;;;;;;;;uCA0Bc,CAAA;AAAA,EACZ,IAAM,EAAA,UAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,QAAQ,CAAA,CAAA;AAEhC,IAAM,MAAA,YAAA,GAAeC,QAAI,KAAK,CAAA,CAAA;AAE9B,IAAM,MAAA,WAAA,GAAcC,aAAS,MAAM;AACjC,MAAM,MAAA,EAAE,IAAM,EAAA,IAAA,EAAM,KAAU,EAAA,GAAA,KAAA,CAAA;AAC9B,MAAA,MAAM,SAAY,GAAA,CAAC,EAAG,CAAA,CAAA,EAAG,CAAA,CAAA;AACzB,MAAA,IAAIC,gBAAS,IAAI,CAAA;AAAG,QAAA,SAAA,CAAU,IAAK,CAAA,EAAA,CAAG,CAAE,CAAA,IAAI,CAAC,CAAA,CAAA;AAC7C,MAAI,IAAA,IAAA;AAAM,QAAA,SAAA,CAAU,IAAK,CAAA,EAAA,CAAG,CAAE,CAAA,MAAM,CAAC,CAAA,CAAA;AACrC,MAAI,IAAA,KAAA;AAAO,QAAA,SAAA,CAAU,IAAK,CAAA,EAAA,CAAG,CAAE,CAAA,KAAK,CAAC,CAAA,CAAA;AACrC,MAAO,OAAA,SAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAM,MAAA,SAAA,GAAYD,aAAS,MAAM;AAC/B,MAAA,MAAM,EAAE,IAAS,EAAA,GAAA,KAAA,CAAA;AACjB,MAAA,OAAOE,cAAS,CAAA,IAAI,CACf,GAAA,EAAA,CAAG,WAAY,CAAA;AAAA,QACd,IAAA,EAAMC,aAAQ,CAAA,IAAI,CAAK,IAAA,EAAA;AAAA,OACxB,CACD,GAAA,KAAA,CAAA,CAAA;AAAA,KACL,CAAA,CAAA;AAED,IAAM,MAAA,QAAA,GAAWH,aAAwB,OAAO;AAAA,MAC9C,WAAW,KAAM,CAAA,GAAA;AAAA,KACjB,CAAA,CAAA,CAAA;AAGF,IAAAI,SAAA,CACE,MAAM,KAAM,CAAA,GAAA,EACZ,MAAO,YAAA,CAAa,QAAQ,KAC9B,CAAA,CAAA;AAEA,IAAA,SAAA,WAAA,CAAqB,CAAU,EAAA;AAC7B,MAAA,YAAA,CAAa,KAAQ,GAAA,IAAA,CAAA;AACrB,MAAA,IAAA,CAAK,SAAS,CAAC,CAAA,CAAA;AAAA,KACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var calendar$1 = require('./src/
|
|
7
|
-
var calendar = require('./src/
|
|
6
|
+
var calendar$1 = require('./src/calendar2.js');
|
|
7
|
+
var calendar = require('./src/calendar.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElCalendar = install.withInstall(calendar$1["default"]);
|
|
@@ -2,139 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
require('
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var calendar = require('./calendar2.js');
|
|
11
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
13
|
-
var index$1 = require('../../../hooks/use-locale/index.js');
|
|
5
|
+
require('../../../utils/index.js');
|
|
6
|
+
require('../../../constants/index.js');
|
|
7
|
+
var shared = require('@vue/shared');
|
|
8
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
9
|
+
var event = require('../../../constants/event.js');
|
|
14
10
|
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
setup(__props, { expose, emit }) {
|
|
24
|
-
const props = __props;
|
|
25
|
-
const ns = index.useNamespace("calendar");
|
|
26
|
-
const {
|
|
27
|
-
calculateValidatedDateRange,
|
|
28
|
-
date,
|
|
29
|
-
pickDay,
|
|
30
|
-
realSelectedDay,
|
|
31
|
-
selectDate,
|
|
32
|
-
validatedRange
|
|
33
|
-
} = useCalendar.useCalendar(props, emit, COMPONENT_NAME);
|
|
34
|
-
const { t } = index$1.useLocale();
|
|
35
|
-
const i18nDate = vue.computed(() => {
|
|
36
|
-
const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
|
|
37
|
-
return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
|
|
38
|
-
});
|
|
39
|
-
expose({
|
|
40
|
-
selectedDay: realSelectedDay,
|
|
41
|
-
pickDay,
|
|
42
|
-
selectDate,
|
|
43
|
-
calculateValidatedDateRange
|
|
44
|
-
});
|
|
45
|
-
return (_ctx, _cache) => {
|
|
46
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
47
|
-
class: vue.normalizeClass(vue.unref(ns).b())
|
|
48
|
-
}, [
|
|
49
|
-
vue.createElementVNode("div", {
|
|
50
|
-
class: vue.normalizeClass(vue.unref(ns).e("header"))
|
|
51
|
-
}, [
|
|
52
|
-
vue.renderSlot(_ctx.$slots, "header", { date: vue.unref(i18nDate) }, () => [
|
|
53
|
-
vue.createElementVNode("div", {
|
|
54
|
-
class: vue.normalizeClass(vue.unref(ns).e("title"))
|
|
55
|
-
}, vue.toDisplayString(vue.unref(i18nDate)), 3),
|
|
56
|
-
vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
57
|
-
key: 0,
|
|
58
|
-
class: vue.normalizeClass(vue.unref(ns).e("button-group"))
|
|
59
|
-
}, [
|
|
60
|
-
vue.createVNode(vue.unref(index$2.ElButtonGroup), null, {
|
|
61
|
-
default: vue.withCtx(() => [
|
|
62
|
-
vue.createVNode(vue.unref(index$2.ElButton), {
|
|
63
|
-
size: "small",
|
|
64
|
-
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(selectDate)("prev-month"))
|
|
65
|
-
}, {
|
|
66
|
-
default: vue.withCtx(() => [
|
|
67
|
-
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.prevMonth")), 1)
|
|
68
|
-
]),
|
|
69
|
-
_: 1
|
|
70
|
-
}),
|
|
71
|
-
vue.createVNode(vue.unref(index$2.ElButton), {
|
|
72
|
-
size: "small",
|
|
73
|
-
onClick: _cache[1] || (_cache[1] = ($event) => vue.unref(selectDate)("today"))
|
|
74
|
-
}, {
|
|
75
|
-
default: vue.withCtx(() => [
|
|
76
|
-
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.today")), 1)
|
|
77
|
-
]),
|
|
78
|
-
_: 1
|
|
79
|
-
}),
|
|
80
|
-
vue.createVNode(vue.unref(index$2.ElButton), {
|
|
81
|
-
size: "small",
|
|
82
|
-
onClick: _cache[2] || (_cache[2] = ($event) => vue.unref(selectDate)("next-month"))
|
|
83
|
-
}, {
|
|
84
|
-
default: vue.withCtx(() => [
|
|
85
|
-
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.nextMonth")), 1)
|
|
86
|
-
]),
|
|
87
|
-
_: 1
|
|
88
|
-
})
|
|
89
|
-
]),
|
|
90
|
-
_: 1
|
|
91
|
-
})
|
|
92
|
-
], 2)) : vue.createCommentVNode("v-if", true)
|
|
93
|
-
])
|
|
94
|
-
], 2),
|
|
95
|
-
vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
96
|
-
key: 0,
|
|
97
|
-
class: vue.normalizeClass(vue.unref(ns).e("body"))
|
|
98
|
-
}, [
|
|
99
|
-
vue.createVNode(dateTable["default"], {
|
|
100
|
-
date: vue.unref(date),
|
|
101
|
-
"selected-day": vue.unref(realSelectedDay),
|
|
102
|
-
onPick: vue.unref(pickDay)
|
|
103
|
-
}, vue.createSlots({ _: 2 }, [
|
|
104
|
-
_ctx.$slots["date-cell"] ? {
|
|
105
|
-
name: "date-cell",
|
|
106
|
-
fn: vue.withCtx((data) => [
|
|
107
|
-
vue.renderSlot(_ctx.$slots, "date-cell", vue.normalizeProps(vue.guardReactiveProps(data)))
|
|
108
|
-
])
|
|
109
|
-
} : void 0
|
|
110
|
-
]), 1032, ["date", "selected-day", "onPick"])
|
|
111
|
-
], 2)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
112
|
-
key: 1,
|
|
113
|
-
class: vue.normalizeClass(vue.unref(ns).e("body"))
|
|
114
|
-
}, [
|
|
115
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(validatedRange), (range_, index) => {
|
|
116
|
-
return vue.openBlock(), vue.createBlock(dateTable["default"], {
|
|
117
|
-
key: index,
|
|
118
|
-
date: range_[0],
|
|
119
|
-
"selected-day": vue.unref(realSelectedDay),
|
|
120
|
-
range: range_,
|
|
121
|
-
"hide-header": index !== 0,
|
|
122
|
-
onPick: vue.unref(pickDay)
|
|
123
|
-
}, vue.createSlots({ _: 2 }, [
|
|
124
|
-
_ctx.$slots["date-cell"] ? {
|
|
125
|
-
name: "date-cell",
|
|
126
|
-
fn: vue.withCtx((data) => [
|
|
127
|
-
vue.renderSlot(_ctx.$slots, "date-cell", vue.normalizeProps(vue.guardReactiveProps(data)))
|
|
128
|
-
])
|
|
129
|
-
} : void 0
|
|
130
|
-
]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
|
|
131
|
-
}), 128))
|
|
132
|
-
], 2))
|
|
133
|
-
], 2);
|
|
134
|
-
};
|
|
11
|
+
const isValidRange = (range) => shared.isArray(range) && range.length === 2 && range.every((item) => shared.isDate(item));
|
|
12
|
+
const calendarProps = runtime.buildProps({
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: Date
|
|
15
|
+
},
|
|
16
|
+
range: {
|
|
17
|
+
type: runtime.definePropType(Array),
|
|
18
|
+
validator: isValidRange
|
|
135
19
|
}
|
|
136
20
|
});
|
|
137
|
-
|
|
21
|
+
const calendarEmits = {
|
|
22
|
+
[event.UPDATE_MODEL_EVENT]: (value) => shared.isDate(value),
|
|
23
|
+
[event.INPUT_EVENT]: (value) => shared.isDate(value)
|
|
24
|
+
};
|
|
138
25
|
|
|
139
|
-
exports
|
|
26
|
+
exports.calendarEmits = calendarEmits;
|
|
27
|
+
exports.calendarProps = calendarProps;
|
|
140
28
|
//# sourceMappingURL=calendar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sources":["../../../../../../packages/components/calendar/src/calendar.
|
|
1
|
+
{"version":3,"file":"calendar.js","sources":["../../../../../../packages/components/calendar/src/calendar.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isArray,\n isDate,\n} from '@element-plus/utils'\nimport { INPUT_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\n\nexport type CalendarDateType =\n | 'prev-month'\n | 'next-month'\n | 'prev-year'\n | 'next-year'\n | 'today'\n\nconst isValidRange = (range: unknown): range is [Date, Date] =>\n isArray(range) && range.length === 2 && range.every((item) => isDate(item))\n\nexport const calendarProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: Date,\n },\n /**\n * @description time range, including start time and end time.\n * Start time must be start day of week, end time must be end day of week, the time span cannot exceed two months.\n */\n range: {\n type: definePropType<[Date, Date]>(Array),\n validator: isValidRange,\n },\n} as const)\nexport type CalendarProps = ExtractPropTypes<typeof calendarProps>\n\nexport const calendarEmits = {\n [UPDATE_MODEL_EVENT]: (value: Date) => isDate(value),\n [INPUT_EVENT]: (value: Date) => isDate(value),\n}\nexport type CalendarEmits = typeof calendarEmits\n"],"names":["isArray","isDate","buildProps","definePropType","UPDATE_MODEL_EVENT","INPUT_EVENT"],"mappings":";;;;;;;;;;AAOA,MAAM,YAAY,GAAG,CAAC,KAAK,KAAKA,cAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,KAAKC,aAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAChG,MAAC,aAAa,GAAGC,kBAAU,CAAC;AACxC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,SAAS,EAAE,YAAY;AAC3B,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,CAACC,wBAAkB,GAAG,CAAC,KAAK,KAAKH,aAAM,CAAC,KAAK,CAAC;AAChD,EAAE,CAACI,iBAAW,GAAG,CAAC,KAAK,KAAKJ,aAAM,CAAC,KAAK,CAAC;AACzC;;;;;"}
|
|
@@ -2,27 +2,139 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('
|
|
6
|
-
require('
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var index$2 = require('../../button/index.js');
|
|
7
|
+
require('../../../hooks/index.js');
|
|
8
|
+
var dateTable = require('./date-table2.js');
|
|
9
|
+
var useCalendar = require('./use-calendar.js');
|
|
10
|
+
var calendar = require('./calendar.js');
|
|
11
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
13
|
+
var index$1 = require('../../../hooks/use-locale/index.js');
|
|
10
14
|
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const COMPONENT_NAME = "ElCalendar";
|
|
16
|
+
const __default__ = vue.defineComponent({
|
|
17
|
+
name: COMPONENT_NAME
|
|
18
|
+
});
|
|
19
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
20
|
+
...__default__,
|
|
21
|
+
props: calendar.calendarProps,
|
|
22
|
+
emits: calendar.calendarEmits,
|
|
23
|
+
setup(__props, { expose, emit }) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const ns = index.useNamespace("calendar");
|
|
26
|
+
const {
|
|
27
|
+
calculateValidatedDateRange,
|
|
28
|
+
date,
|
|
29
|
+
pickDay,
|
|
30
|
+
realSelectedDay,
|
|
31
|
+
selectDate,
|
|
32
|
+
validatedRange
|
|
33
|
+
} = useCalendar.useCalendar(props, emit, COMPONENT_NAME);
|
|
34
|
+
const { t } = index$1.useLocale();
|
|
35
|
+
const i18nDate = vue.computed(() => {
|
|
36
|
+
const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
|
|
37
|
+
return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
|
|
38
|
+
});
|
|
39
|
+
expose({
|
|
40
|
+
selectedDay: realSelectedDay,
|
|
41
|
+
pickDay,
|
|
42
|
+
selectDate,
|
|
43
|
+
calculateValidatedDateRange
|
|
44
|
+
});
|
|
45
|
+
return (_ctx, _cache) => {
|
|
46
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
47
|
+
class: vue.normalizeClass(vue.unref(ns).b())
|
|
48
|
+
}, [
|
|
49
|
+
vue.createElementVNode("div", {
|
|
50
|
+
class: vue.normalizeClass(vue.unref(ns).e("header"))
|
|
51
|
+
}, [
|
|
52
|
+
vue.renderSlot(_ctx.$slots, "header", { date: vue.unref(i18nDate) }, () => [
|
|
53
|
+
vue.createElementVNode("div", {
|
|
54
|
+
class: vue.normalizeClass(vue.unref(ns).e("title"))
|
|
55
|
+
}, vue.toDisplayString(vue.unref(i18nDate)), 3),
|
|
56
|
+
vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
57
|
+
key: 0,
|
|
58
|
+
class: vue.normalizeClass(vue.unref(ns).e("button-group"))
|
|
59
|
+
}, [
|
|
60
|
+
vue.createVNode(vue.unref(index$2.ElButtonGroup), null, {
|
|
61
|
+
default: vue.withCtx(() => [
|
|
62
|
+
vue.createVNode(vue.unref(index$2.ElButton), {
|
|
63
|
+
size: "small",
|
|
64
|
+
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(selectDate)("prev-month"))
|
|
65
|
+
}, {
|
|
66
|
+
default: vue.withCtx(() => [
|
|
67
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.prevMonth")), 1)
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
}),
|
|
71
|
+
vue.createVNode(vue.unref(index$2.ElButton), {
|
|
72
|
+
size: "small",
|
|
73
|
+
onClick: _cache[1] || (_cache[1] = ($event) => vue.unref(selectDate)("today"))
|
|
74
|
+
}, {
|
|
75
|
+
default: vue.withCtx(() => [
|
|
76
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.today")), 1)
|
|
77
|
+
]),
|
|
78
|
+
_: 1
|
|
79
|
+
}),
|
|
80
|
+
vue.createVNode(vue.unref(index$2.ElButton), {
|
|
81
|
+
size: "small",
|
|
82
|
+
onClick: _cache[2] || (_cache[2] = ($event) => vue.unref(selectDate)("next-month"))
|
|
83
|
+
}, {
|
|
84
|
+
default: vue.withCtx(() => [
|
|
85
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.nextMonth")), 1)
|
|
86
|
+
]),
|
|
87
|
+
_: 1
|
|
88
|
+
})
|
|
89
|
+
]),
|
|
90
|
+
_: 1
|
|
91
|
+
})
|
|
92
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
|
93
|
+
])
|
|
94
|
+
], 2),
|
|
95
|
+
vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: vue.normalizeClass(vue.unref(ns).e("body"))
|
|
98
|
+
}, [
|
|
99
|
+
vue.createVNode(dateTable["default"], {
|
|
100
|
+
date: vue.unref(date),
|
|
101
|
+
"selected-day": vue.unref(realSelectedDay),
|
|
102
|
+
onPick: vue.unref(pickDay)
|
|
103
|
+
}, vue.createSlots({ _: 2 }, [
|
|
104
|
+
_ctx.$slots["date-cell"] ? {
|
|
105
|
+
name: "date-cell",
|
|
106
|
+
fn: vue.withCtx((data) => [
|
|
107
|
+
vue.renderSlot(_ctx.$slots, "date-cell", vue.normalizeProps(vue.guardReactiveProps(data)))
|
|
108
|
+
])
|
|
109
|
+
} : void 0
|
|
110
|
+
]), 1032, ["date", "selected-day", "onPick"])
|
|
111
|
+
], 2)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
112
|
+
key: 1,
|
|
113
|
+
class: vue.normalizeClass(vue.unref(ns).e("body"))
|
|
114
|
+
}, [
|
|
115
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(validatedRange), (range_, index) => {
|
|
116
|
+
return vue.openBlock(), vue.createBlock(dateTable["default"], {
|
|
117
|
+
key: index,
|
|
118
|
+
date: range_[0],
|
|
119
|
+
"selected-day": vue.unref(realSelectedDay),
|
|
120
|
+
range: range_,
|
|
121
|
+
"hide-header": index !== 0,
|
|
122
|
+
onPick: vue.unref(pickDay)
|
|
123
|
+
}, vue.createSlots({ _: 2 }, [
|
|
124
|
+
_ctx.$slots["date-cell"] ? {
|
|
125
|
+
name: "date-cell",
|
|
126
|
+
fn: vue.withCtx((data) => [
|
|
127
|
+
vue.renderSlot(_ctx.$slots, "date-cell", vue.normalizeProps(vue.guardReactiveProps(data)))
|
|
128
|
+
])
|
|
129
|
+
} : void 0
|
|
130
|
+
]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
|
|
131
|
+
}), 128))
|
|
132
|
+
], 2))
|
|
133
|
+
], 2);
|
|
134
|
+
};
|
|
19
135
|
}
|
|
20
136
|
});
|
|
21
|
-
|
|
22
|
-
[event.UPDATE_MODEL_EVENT]: (value) => shared.isDate(value),
|
|
23
|
-
[event.INPUT_EVENT]: (value) => shared.isDate(value)
|
|
24
|
-
};
|
|
137
|
+
var Calendar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "calendar.vue"]]);
|
|
25
138
|
|
|
26
|
-
exports
|
|
27
|
-
exports.calendarProps = calendarProps;
|
|
139
|
+
exports["default"] = Calendar;
|
|
28
140
|
//# sourceMappingURL=calendar2.js.map
|