@element-plus/nightly 0.0.20241117 → 0.0.20241119
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +0 -5
- package/dist/index.full.js +8 -6
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +6 -6
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +8 -6
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/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/ms.js +191 -0
- package/dist/locale/ms.min.js +2 -0
- package/dist/locale/ms.min.js.map +1 -0
- package/dist/locale/ms.min.mjs +2 -0
- package/dist/locale/ms.min.mjs.map +1 -0
- package/dist/locale/ms.mjs +183 -0
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/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/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +43 -66
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +66 -43
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +392 -45
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +45 -392
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +13 -13
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +50 -25
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +25 -50
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.d.ts +4 -4
- package/es/components/notification/src/notification.mjs +68 -145
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification.vue.d.ts +12 -12
- package/es/components/notification/src/notification2.mjs +145 -64
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +4 -6
- package/es/components/notification/src/notify.mjs.map +1 -1
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +102 -17
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +17 -102
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/trigger.mjs +31 -132
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs +132 -31
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/progress/index.mjs +2 -2
- package/es/components/progress/src/progress.mjs +53 -208
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +208 -53
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +63 -29
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +29 -63
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/scrollbar/index.mjs +1 -1
- package/es/components/scrollbar/src/bar2.mjs +1 -1
- package/es/components/scrollbar/src/thumb.mjs +130 -11
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +11 -130
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/select/index.mjs +1 -1
- package/es/components/select/src/select.mjs +112 -421
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/select2.mjs +421 -112
- package/es/components/select/src/select2.mjs.map +1 -1
- package/es/components/slider/index.mjs +2 -2
- package/es/components/slider/src/button.mjs +91 -21
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +21 -91
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider.mjs +90 -240
- package/es/components/slider/src/slider.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +240 -90
- package/es/components/slider/src/slider2.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker-range-trigger.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.mjs +1 -1
- package/es/components/tooltip/src/trigger2.mjs +1 -1
- package/es/components/tour/index.mjs +1 -1
- package/es/components/tour/src/content.mjs +44 -68
- package/es/components/tour/src/content.mjs.map +1 -1
- package/es/components/tour/src/content2.mjs +68 -44
- package/es/components/tour/src/content2.mjs.map +1 -1
- package/es/components/tour/src/step.mjs +1 -1
- package/es/components/tour/src/tour.mjs +1 -1
- package/es/components/tour/src/tour2.mjs +1 -1
- package/es/components/upload/index.mjs +2 -2
- package/es/components/upload/src/upload-content.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +126 -98
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +98 -126
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/index.mjs +13 -13
- package/es/locale/lang/ms.d.ts +180 -0
- package/es/locale/lang/ms.mjs +182 -0
- package/es/locale/lang/ms.mjs.map +1 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +43 -66
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +66 -43
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +392 -46
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +46 -392
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +13 -13
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +50 -26
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +26 -50
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.d.ts +4 -4
- package/lib/components/notification/src/notification.js +69 -144
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +12 -12
- package/lib/components/notification/src/notification2.js +144 -65
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +3 -5
- package/lib/components/notification/src/notify.js.map +1 -1
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +102 -18
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +18 -102
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/trigger.js +32 -132
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger2.js +132 -32
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/progress/index.js +2 -2
- package/lib/components/progress/src/progress.js +53 -208
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/progress/src/progress2.js +208 -53
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +63 -31
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +31 -63
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/scrollbar/index.js +1 -1
- package/lib/components/scrollbar/src/bar2.js +1 -1
- package/lib/components/scrollbar/src/thumb.js +130 -11
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +11 -130
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/select/index.js +1 -1
- package/lib/components/select/src/select.js +112 -421
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/select2.js +421 -112
- package/lib/components/select/src/select2.js.map +1 -1
- package/lib/components/slider/index.js +2 -2
- package/lib/components/slider/src/button.js +91 -22
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +22 -91
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider.js +91 -240
- package/lib/components/slider/src/slider.js.map +1 -1
- package/lib/components/slider/src/slider2.js +240 -91
- package/lib/components/slider/src/slider2.js.map +1 -1
- package/lib/components/time-picker/src/common/picker-range-trigger.js.map +1 -1
- package/lib/components/tooltip/src/trigger.js +1 -1
- package/lib/components/tooltip/src/trigger2.js +1 -1
- package/lib/components/tour/index.js +1 -1
- package/lib/components/tour/src/content.js +47 -68
- package/lib/components/tour/src/content.js.map +1 -1
- package/lib/components/tour/src/content2.js +68 -47
- package/lib/components/tour/src/content2.js.map +1 -1
- package/lib/components/tour/src/step.js +1 -1
- package/lib/components/tour/src/tour.js +1 -1
- package/lib/components/tour/src/tour2.js +1 -1
- package/lib/components/upload/index.js +2 -2
- package/lib/components/upload/src/upload-content.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +126 -101
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +101 -126
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/index.js +13 -13
- package/lib/locale/lang/ms.d.ts +180 -0
- package/lib/locale/lang/ms.js +186 -0
- package/lib/locale/lang/ms.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
@@ -1,26 +1,96 @@
|
|
1
|
-
import {
|
2
|
-
import '
|
3
|
-
import '../../../
|
4
|
-
import
|
5
|
-
import {
|
6
|
-
import
|
1
|
+
import { defineComponent, reactive, toRefs, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createVNode, withCtx, createElementVNode, toDisplayString } from 'vue';
|
2
|
+
import { ElTooltip } from '../../tooltip/index.mjs';
|
3
|
+
import '../../../hooks/index.mjs';
|
4
|
+
import './composables/index.mjs';
|
5
|
+
import { sliderButtonProps, sliderButtonEmits } from './button2.mjs';
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
8
|
+
import { useSliderButton } from './composables/use-slider-button.mjs';
|
7
9
|
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
const __default__ = defineComponent({
|
11
|
+
name: "ElSliderButton"
|
12
|
+
});
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
14
|
+
...__default__,
|
15
|
+
props: sliderButtonProps,
|
16
|
+
emits: sliderButtonEmits,
|
17
|
+
setup(__props, { expose, emit }) {
|
18
|
+
const props = __props;
|
19
|
+
const ns = useNamespace("slider");
|
20
|
+
const initData = reactive({
|
21
|
+
hovering: false,
|
22
|
+
dragging: false,
|
23
|
+
isClick: false,
|
24
|
+
startX: 0,
|
25
|
+
currentX: 0,
|
26
|
+
startY: 0,
|
27
|
+
currentY: 0,
|
28
|
+
startPosition: 0,
|
29
|
+
newPosition: 0,
|
30
|
+
oldValue: props.modelValue
|
31
|
+
});
|
32
|
+
const {
|
33
|
+
disabled,
|
34
|
+
button,
|
35
|
+
tooltip,
|
36
|
+
showTooltip,
|
37
|
+
tooltipVisible,
|
38
|
+
wrapperStyle,
|
39
|
+
formatValue,
|
40
|
+
handleMouseEnter,
|
41
|
+
handleMouseLeave,
|
42
|
+
onButtonDown,
|
43
|
+
onKeyDown,
|
44
|
+
setPosition
|
45
|
+
} = useSliderButton(props, initData, emit);
|
46
|
+
const { hovering, dragging } = toRefs(initData);
|
47
|
+
expose({
|
48
|
+
onButtonDown,
|
49
|
+
onKeyDown,
|
50
|
+
setPosition,
|
51
|
+
hovering,
|
52
|
+
dragging
|
53
|
+
});
|
54
|
+
return (_ctx, _cache) => {
|
55
|
+
return openBlock(), createElementBlock("div", {
|
56
|
+
ref_key: "button",
|
57
|
+
ref: button,
|
58
|
+
class: normalizeClass([unref(ns).e("button-wrapper"), { hover: unref(hovering), dragging: unref(dragging) }]),
|
59
|
+
style: normalizeStyle(unref(wrapperStyle)),
|
60
|
+
tabindex: unref(disabled) ? -1 : 0,
|
61
|
+
onMouseenter: unref(handleMouseEnter),
|
62
|
+
onMouseleave: unref(handleMouseLeave),
|
63
|
+
onMousedown: unref(onButtonDown),
|
64
|
+
onFocus: unref(handleMouseEnter),
|
65
|
+
onBlur: unref(handleMouseLeave),
|
66
|
+
onKeydown: unref(onKeyDown)
|
67
|
+
}, [
|
68
|
+
createVNode(unref(ElTooltip), {
|
69
|
+
ref_key: "tooltip",
|
70
|
+
ref: tooltip,
|
71
|
+
visible: unref(tooltipVisible),
|
72
|
+
placement: _ctx.placement,
|
73
|
+
"fallback-placements": ["top", "bottom", "right", "left"],
|
74
|
+
"stop-popper-mouse-event": false,
|
75
|
+
"popper-class": _ctx.tooltipClass,
|
76
|
+
disabled: !unref(showTooltip),
|
77
|
+
persistent: unref(showTooltip)
|
78
|
+
}, {
|
79
|
+
content: withCtx(() => [
|
80
|
+
createElementVNode("span", null, toDisplayString(unref(formatValue)), 1)
|
81
|
+
]),
|
82
|
+
default: withCtx(() => [
|
83
|
+
createElementVNode("div", {
|
84
|
+
class: normalizeClass([unref(ns).e("button"), { hover: unref(hovering), dragging: unref(dragging) }])
|
85
|
+
}, null, 2)
|
86
|
+
]),
|
87
|
+
_: 1
|
88
|
+
}, 8, ["visible", "placement", "popper-class", "disabled", "persistent"])
|
89
|
+
], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"]);
|
90
|
+
};
|
19
91
|
}
|
20
92
|
});
|
21
|
-
|
22
|
-
[UPDATE_MODEL_EVENT]: (value) => isNumber(value)
|
23
|
-
};
|
93
|
+
var SliderButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "button.vue"]]);
|
24
94
|
|
25
|
-
export {
|
95
|
+
export { SliderButton as default };
|
26
96
|
//# sourceMappingURL=button.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"button.mjs","sources":["../../../../../../packages/components/slider/src/button.
|
1
|
+
{"version":3,"file":"button.mjs","sources":["../../../../../../packages/components/slider/src/button.vue"],"sourcesContent":["<template>\n <div\n ref=\"button\"\n :class=\"[ns.e('button-wrapper'), { hover: hovering, dragging }]\"\n :style=\"wrapperStyle\"\n :tabindex=\"disabled ? -1 : 0\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n @mousedown=\"onButtonDown\"\n @focus=\"handleMouseEnter\"\n @blur=\"handleMouseLeave\"\n @keydown=\"onKeyDown\"\n >\n <el-tooltip\n ref=\"tooltip\"\n :visible=\"tooltipVisible\"\n :placement=\"placement\"\n :fallback-placements=\"['top', 'bottom', 'right', 'left']\"\n :stop-popper-mouse-event=\"false\"\n :popper-class=\"tooltipClass\"\n :disabled=\"!showTooltip\"\n :persistent=\"showTooltip\"\n >\n <template #content>\n <span>{{ formatValue }}</span>\n </template>\n <div :class=\"[ns.e('button'), { hover: hovering, dragging }]\" />\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { reactive, toRefs } from 'vue'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useSliderButton } from './composables'\nimport { sliderButtonEmits, sliderButtonProps } from './button'\nimport type { SliderButtonInitData } from './button'\n\ndefineOptions({\n name: 'ElSliderButton',\n})\n\nconst props = defineProps(sliderButtonProps)\nconst emit = defineEmits(sliderButtonEmits)\n\nconst ns = useNamespace('slider')\n\nconst initData = reactive<SliderButtonInitData>({\n hovering: false,\n dragging: false,\n isClick: false,\n startX: 0,\n currentX: 0,\n startY: 0,\n currentY: 0,\n startPosition: 0,\n newPosition: 0,\n oldValue: props.modelValue,\n})\n\nconst {\n disabled,\n button,\n tooltip,\n showTooltip,\n tooltipVisible,\n wrapperStyle,\n formatValue,\n handleMouseEnter,\n handleMouseLeave,\n onButtonDown,\n onKeyDown,\n setPosition,\n} = useSliderButton(props, initData, emit)\n\nconst { hovering, dragging } = toRefs(initData)\n\ndefineExpose({\n onButtonDown,\n onKeyDown,\n setPosition,\n hovering,\n dragging,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;mCAuCc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAEhC,IAAA,MAAM,WAAW,QAA+B,CAAA;AAAA,MAC9C,QAAU,EAAA,KAAA;AAAA,MACV,QAAU,EAAA,KAAA;AAAA,MACV,OAAS,EAAA,KAAA;AAAA,MACT,MAAQ,EAAA,CAAA;AAAA,MACR,QAAU,EAAA,CAAA;AAAA,MACV,MAAQ,EAAA,CAAA;AAAA,MACR,QAAU,EAAA,CAAA;AAAA,MACV,aAAe,EAAA,CAAA;AAAA,MACf,WAAa,EAAA,CAAA;AAAA,MACb,UAAU,KAAM,CAAA,UAAA;AAAA,KACjB,CAAA,CAAA;AAED,IAAM,MAAA;AAAA,MACJ,QAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,MACA,gBAAA;AAAA,MACA,gBAAA;AAAA,MACA,YAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,KACE,GAAA,eAAA,CAAgB,KAAO,EAAA,QAAA,EAAU,IAAI,CAAA,CAAA;AAEzC,IAAA,MAAM,EAAE,QAAA,EAAU,QAAS,EAAA,GAAI,OAAO,QAAQ,CAAA,CAAA;AAE9C,IAAa,MAAA,CAAA;AAAA,MACX,YAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1,96 +1,26 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
import '../../../
|
4
|
-
import '
|
5
|
-
import {
|
6
|
-
import
|
7
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
8
|
-
import { useSliderButton } from './composables/use-slider-button.mjs';
|
1
|
+
import { placements } from '@popperjs/core';
|
2
|
+
import '../../../utils/index.mjs';
|
3
|
+
import '../../../constants/index.mjs';
|
4
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
5
|
+
import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
|
6
|
+
import { isNumber } from '../../../utils/types.mjs';
|
9
7
|
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
hovering: false,
|
22
|
-
dragging: false,
|
23
|
-
isClick: false,
|
24
|
-
startX: 0,
|
25
|
-
currentX: 0,
|
26
|
-
startY: 0,
|
27
|
-
currentY: 0,
|
28
|
-
startPosition: 0,
|
29
|
-
newPosition: 0,
|
30
|
-
oldValue: props.modelValue
|
31
|
-
});
|
32
|
-
const {
|
33
|
-
disabled,
|
34
|
-
button,
|
35
|
-
tooltip,
|
36
|
-
showTooltip,
|
37
|
-
tooltipVisible,
|
38
|
-
wrapperStyle,
|
39
|
-
formatValue,
|
40
|
-
handleMouseEnter,
|
41
|
-
handleMouseLeave,
|
42
|
-
onButtonDown,
|
43
|
-
onKeyDown,
|
44
|
-
setPosition
|
45
|
-
} = useSliderButton(props, initData, emit);
|
46
|
-
const { hovering, dragging } = toRefs(initData);
|
47
|
-
expose({
|
48
|
-
onButtonDown,
|
49
|
-
onKeyDown,
|
50
|
-
setPosition,
|
51
|
-
hovering,
|
52
|
-
dragging
|
53
|
-
});
|
54
|
-
return (_ctx, _cache) => {
|
55
|
-
return openBlock(), createElementBlock("div", {
|
56
|
-
ref_key: "button",
|
57
|
-
ref: button,
|
58
|
-
class: normalizeClass([unref(ns).e("button-wrapper"), { hover: unref(hovering), dragging: unref(dragging) }]),
|
59
|
-
style: normalizeStyle(unref(wrapperStyle)),
|
60
|
-
tabindex: unref(disabled) ? -1 : 0,
|
61
|
-
onMouseenter: unref(handleMouseEnter),
|
62
|
-
onMouseleave: unref(handleMouseLeave),
|
63
|
-
onMousedown: unref(onButtonDown),
|
64
|
-
onFocus: unref(handleMouseEnter),
|
65
|
-
onBlur: unref(handleMouseLeave),
|
66
|
-
onKeydown: unref(onKeyDown)
|
67
|
-
}, [
|
68
|
-
createVNode(unref(ElTooltip), {
|
69
|
-
ref_key: "tooltip",
|
70
|
-
ref: tooltip,
|
71
|
-
visible: unref(tooltipVisible),
|
72
|
-
placement: _ctx.placement,
|
73
|
-
"fallback-placements": ["top", "bottom", "right", "left"],
|
74
|
-
"stop-popper-mouse-event": false,
|
75
|
-
"popper-class": _ctx.tooltipClass,
|
76
|
-
disabled: !unref(showTooltip),
|
77
|
-
persistent: unref(showTooltip)
|
78
|
-
}, {
|
79
|
-
content: withCtx(() => [
|
80
|
-
createElementVNode("span", null, toDisplayString(unref(formatValue)), 1)
|
81
|
-
]),
|
82
|
-
default: withCtx(() => [
|
83
|
-
createElementVNode("div", {
|
84
|
-
class: normalizeClass([unref(ns).e("button"), { hover: unref(hovering), dragging: unref(dragging) }])
|
85
|
-
}, null, 2)
|
86
|
-
]),
|
87
|
-
_: 1
|
88
|
-
}, 8, ["visible", "placement", "popper-class", "disabled", "persistent"])
|
89
|
-
], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"]);
|
90
|
-
};
|
8
|
+
const sliderButtonProps = buildProps({
|
9
|
+
modelValue: {
|
10
|
+
type: Number,
|
11
|
+
default: 0
|
12
|
+
},
|
13
|
+
vertical: Boolean,
|
14
|
+
tooltipClass: String,
|
15
|
+
placement: {
|
16
|
+
type: String,
|
17
|
+
values: placements,
|
18
|
+
default: "top"
|
91
19
|
}
|
92
20
|
});
|
93
|
-
|
21
|
+
const sliderButtonEmits = {
|
22
|
+
[UPDATE_MODEL_EVENT]: (value) => isNumber(value)
|
23
|
+
};
|
94
24
|
|
95
|
-
export {
|
25
|
+
export { sliderButtonEmits, sliderButtonProps };
|
96
26
|
//# sourceMappingURL=button2.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"button2.mjs","sources":["../../../../../../packages/components/slider/src/button.
|
1
|
+
{"version":3,"file":"button2.mjs","sources":["../../../../../../packages/components/slider/src/button.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport { buildProps, isNumber } from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport type { ComponentPublicInstance, ExtractPropTypes, Ref } from 'vue'\nimport type Button from './button.vue'\n\nexport const sliderButtonProps = buildProps({\n modelValue: {\n type: Number,\n default: 0,\n },\n vertical: Boolean,\n tooltipClass: String,\n placement: {\n type: String,\n values: placements,\n default: 'top',\n },\n} as const)\nexport type SliderButtonProps = ExtractPropTypes<typeof sliderButtonProps>\n\nexport const sliderButtonEmits = {\n [UPDATE_MODEL_EVENT]: (value: number) => isNumber(value),\n}\nexport type SliderButtonEmits = typeof sliderButtonEmits\n\nexport type SliderButtonInstance = ComponentPublicInstance<typeof Button>\n\nexport type ButtonRefs = Record<\n 'firstButton' | 'secondButton',\n Ref<SliderButtonInstance | undefined>\n>\n\nexport interface SliderButtonInitData {\n hovering: boolean\n dragging: boolean\n isClick: boolean\n startX: number\n currentX: number\n startY: number\n currentY: number\n startPosition: number\n newPosition: number\n oldValue: number\n}\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,YAAY,EAAE,MAAM;AACtB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,iBAAiB,GAAG;AACjC,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClD;;;;"}
|
@@ -1,245 +1,95 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import '../../form/index.mjs';
|
1
|
+
import { placements } from '@popperjs/core';
|
2
|
+
import '../../../utils/index.mjs';
|
3
|
+
import '../../../constants/index.mjs';
|
5
4
|
import '../../../hooks/index.mjs';
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import '
|
11
|
-
import
|
12
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
13
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
14
|
-
import { useSlide } from './composables/use-slide.mjs';
|
15
|
-
import { useStops } from './composables/use-stops.mjs';
|
16
|
-
import { useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
|
17
|
-
import { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';
|
18
|
-
import { useMarks } from './composables/use-marks.mjs';
|
19
|
-
import { useWatch } from './composables/use-watch.mjs';
|
20
|
-
import { useLifecycle } from './composables/use-lifecycle.mjs';
|
5
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
6
|
+
import { useSizeProp } from '../../../hooks/use-size/index.mjs';
|
7
|
+
import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
|
8
|
+
import { isNumber } from '../../../utils/types.mjs';
|
9
|
+
import { isArray } from '@vue/shared';
|
10
|
+
import { UPDATE_MODEL_EVENT, INPUT_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
|
21
11
|
|
22
|
-
const
|
23
|
-
|
12
|
+
const sliderProps = buildProps({
|
13
|
+
modelValue: {
|
14
|
+
type: definePropType([Number, Array]),
|
15
|
+
default: 0
|
16
|
+
},
|
17
|
+
id: {
|
18
|
+
type: String,
|
19
|
+
default: void 0
|
20
|
+
},
|
21
|
+
min: {
|
22
|
+
type: Number,
|
23
|
+
default: 0
|
24
|
+
},
|
25
|
+
max: {
|
26
|
+
type: Number,
|
27
|
+
default: 100
|
28
|
+
},
|
29
|
+
step: {
|
30
|
+
type: Number,
|
31
|
+
default: 1
|
32
|
+
},
|
33
|
+
showInput: Boolean,
|
34
|
+
showInputControls: {
|
35
|
+
type: Boolean,
|
36
|
+
default: true
|
37
|
+
},
|
38
|
+
size: useSizeProp,
|
39
|
+
inputSize: useSizeProp,
|
40
|
+
showStops: Boolean,
|
41
|
+
showTooltip: {
|
42
|
+
type: Boolean,
|
43
|
+
default: true
|
44
|
+
},
|
45
|
+
formatTooltip: {
|
46
|
+
type: definePropType(Function),
|
47
|
+
default: void 0
|
48
|
+
},
|
49
|
+
disabled: Boolean,
|
50
|
+
range: Boolean,
|
51
|
+
vertical: Boolean,
|
52
|
+
height: String,
|
53
|
+
debounce: {
|
54
|
+
type: Number,
|
55
|
+
default: 300
|
56
|
+
},
|
57
|
+
rangeStartLabel: {
|
58
|
+
type: String,
|
59
|
+
default: void 0
|
60
|
+
},
|
61
|
+
rangeEndLabel: {
|
62
|
+
type: String,
|
63
|
+
default: void 0
|
64
|
+
},
|
65
|
+
formatValueText: {
|
66
|
+
type: definePropType(Function),
|
67
|
+
default: void 0
|
68
|
+
},
|
69
|
+
tooltipClass: {
|
70
|
+
type: String,
|
71
|
+
default: void 0
|
72
|
+
},
|
73
|
+
placement: {
|
74
|
+
type: String,
|
75
|
+
values: placements,
|
76
|
+
default: "top"
|
77
|
+
},
|
78
|
+
marks: {
|
79
|
+
type: definePropType(Object)
|
80
|
+
},
|
81
|
+
validateEvent: {
|
82
|
+
type: Boolean,
|
83
|
+
default: true
|
84
|
+
},
|
85
|
+
...useAriaProps(["ariaLabel"])
|
24
86
|
});
|
25
|
-
const
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
const ns = useNamespace("slider");
|
32
|
-
const { t } = useLocale();
|
33
|
-
const initData = reactive({
|
34
|
-
firstValue: 0,
|
35
|
-
secondValue: 0,
|
36
|
-
oldValue: 0,
|
37
|
-
dragging: false,
|
38
|
-
sliderSize: 1
|
39
|
-
});
|
40
|
-
const {
|
41
|
-
elFormItem,
|
42
|
-
slider,
|
43
|
-
firstButton,
|
44
|
-
secondButton,
|
45
|
-
sliderDisabled,
|
46
|
-
minValue,
|
47
|
-
maxValue,
|
48
|
-
runwayStyle,
|
49
|
-
barStyle,
|
50
|
-
resetSize,
|
51
|
-
emitChange,
|
52
|
-
onSliderWrapperPrevent,
|
53
|
-
onSliderClick,
|
54
|
-
onSliderDown,
|
55
|
-
onSliderMarkerDown,
|
56
|
-
setFirstValue,
|
57
|
-
setSecondValue
|
58
|
-
} = useSlide(props, initData, emit);
|
59
|
-
const { stops, getStopStyle } = useStops(props, initData, minValue, maxValue);
|
60
|
-
const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
|
61
|
-
formItemContext: elFormItem
|
62
|
-
});
|
63
|
-
const sliderWrapperSize = useFormSize();
|
64
|
-
const sliderInputSize = computed(() => props.inputSize || sliderWrapperSize.value);
|
65
|
-
const groupLabel = computed(() => {
|
66
|
-
return props.ariaLabel || t("el.slider.defaultLabel", {
|
67
|
-
min: props.min,
|
68
|
-
max: props.max
|
69
|
-
});
|
70
|
-
});
|
71
|
-
const firstButtonLabel = computed(() => {
|
72
|
-
if (props.range) {
|
73
|
-
return props.rangeStartLabel || t("el.slider.defaultRangeStartLabel");
|
74
|
-
} else {
|
75
|
-
return groupLabel.value;
|
76
|
-
}
|
77
|
-
});
|
78
|
-
const firstValueText = computed(() => {
|
79
|
-
return props.formatValueText ? props.formatValueText(firstValue.value) : `${firstValue.value}`;
|
80
|
-
});
|
81
|
-
const secondButtonLabel = computed(() => {
|
82
|
-
return props.rangeEndLabel || t("el.slider.defaultRangeEndLabel");
|
83
|
-
});
|
84
|
-
const secondValueText = computed(() => {
|
85
|
-
return props.formatValueText ? props.formatValueText(secondValue.value) : `${secondValue.value}`;
|
86
|
-
});
|
87
|
-
const sliderKls = computed(() => [
|
88
|
-
ns.b(),
|
89
|
-
ns.m(sliderWrapperSize.value),
|
90
|
-
ns.is("vertical", props.vertical),
|
91
|
-
{ [ns.m("with-input")]: props.showInput }
|
92
|
-
]);
|
93
|
-
const markList = useMarks(props);
|
94
|
-
useWatch(props, initData, minValue, maxValue, emit, elFormItem);
|
95
|
-
const precision = computed(() => {
|
96
|
-
const precisions = [props.min, props.max, props.step].map((item) => {
|
97
|
-
const decimal = `${item}`.split(".")[1];
|
98
|
-
return decimal ? decimal.length : 0;
|
99
|
-
});
|
100
|
-
return Math.max.apply(null, precisions);
|
101
|
-
});
|
102
|
-
const { sliderWrapper } = useLifecycle(props, initData, resetSize);
|
103
|
-
const { firstValue, secondValue, sliderSize } = toRefs(initData);
|
104
|
-
const updateDragging = (val) => {
|
105
|
-
initData.dragging = val;
|
106
|
-
};
|
107
|
-
useEventListener(sliderWrapper, "touchstart", onSliderWrapperPrevent, {
|
108
|
-
passive: false
|
109
|
-
});
|
110
|
-
useEventListener(sliderWrapper, "touchmove", onSliderWrapperPrevent, {
|
111
|
-
passive: false
|
112
|
-
});
|
113
|
-
provide(sliderContextKey, {
|
114
|
-
...toRefs(props),
|
115
|
-
sliderSize,
|
116
|
-
disabled: sliderDisabled,
|
117
|
-
precision,
|
118
|
-
emitChange,
|
119
|
-
resetSize,
|
120
|
-
updateDragging
|
121
|
-
});
|
122
|
-
expose({
|
123
|
-
onSliderClick
|
124
|
-
});
|
125
|
-
return (_ctx, _cache) => {
|
126
|
-
var _a, _b;
|
127
|
-
return openBlock(), createElementBlock("div", {
|
128
|
-
id: _ctx.range ? unref(inputId) : void 0,
|
129
|
-
ref_key: "sliderWrapper",
|
130
|
-
ref: sliderWrapper,
|
131
|
-
class: normalizeClass(unref(sliderKls)),
|
132
|
-
role: _ctx.range ? "group" : void 0,
|
133
|
-
"aria-label": _ctx.range && !unref(isLabeledByFormItem) ? unref(groupLabel) : void 0,
|
134
|
-
"aria-labelledby": _ctx.range && unref(isLabeledByFormItem) ? (_a = unref(elFormItem)) == null ? void 0 : _a.labelId : void 0
|
135
|
-
}, [
|
136
|
-
createElementVNode("div", {
|
137
|
-
ref_key: "slider",
|
138
|
-
ref: slider,
|
139
|
-
class: normalizeClass([
|
140
|
-
unref(ns).e("runway"),
|
141
|
-
{ "show-input": _ctx.showInput && !_ctx.range },
|
142
|
-
unref(ns).is("disabled", unref(sliderDisabled))
|
143
|
-
]),
|
144
|
-
style: normalizeStyle(unref(runwayStyle)),
|
145
|
-
onMousedown: unref(onSliderDown),
|
146
|
-
onTouchstartPassive: unref(onSliderDown)
|
147
|
-
}, [
|
148
|
-
createElementVNode("div", {
|
149
|
-
class: normalizeClass(unref(ns).e("bar")),
|
150
|
-
style: normalizeStyle(unref(barStyle))
|
151
|
-
}, null, 6),
|
152
|
-
createVNode(SliderButton, {
|
153
|
-
id: !_ctx.range ? unref(inputId) : void 0,
|
154
|
-
ref_key: "firstButton",
|
155
|
-
ref: firstButton,
|
156
|
-
"model-value": unref(firstValue),
|
157
|
-
vertical: _ctx.vertical,
|
158
|
-
"tooltip-class": _ctx.tooltipClass,
|
159
|
-
placement: _ctx.placement,
|
160
|
-
role: "slider",
|
161
|
-
"aria-label": _ctx.range || !unref(isLabeledByFormItem) ? unref(firstButtonLabel) : void 0,
|
162
|
-
"aria-labelledby": !_ctx.range && unref(isLabeledByFormItem) ? (_b = unref(elFormItem)) == null ? void 0 : _b.labelId : void 0,
|
163
|
-
"aria-valuemin": _ctx.min,
|
164
|
-
"aria-valuemax": _ctx.range ? unref(secondValue) : _ctx.max,
|
165
|
-
"aria-valuenow": unref(firstValue),
|
166
|
-
"aria-valuetext": unref(firstValueText),
|
167
|
-
"aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
|
168
|
-
"aria-disabled": unref(sliderDisabled),
|
169
|
-
"onUpdate:modelValue": unref(setFirstValue)
|
170
|
-
}, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]),
|
171
|
-
_ctx.range ? (openBlock(), createBlock(SliderButton, {
|
172
|
-
key: 0,
|
173
|
-
ref_key: "secondButton",
|
174
|
-
ref: secondButton,
|
175
|
-
"model-value": unref(secondValue),
|
176
|
-
vertical: _ctx.vertical,
|
177
|
-
"tooltip-class": _ctx.tooltipClass,
|
178
|
-
placement: _ctx.placement,
|
179
|
-
role: "slider",
|
180
|
-
"aria-label": unref(secondButtonLabel),
|
181
|
-
"aria-valuemin": unref(firstValue),
|
182
|
-
"aria-valuemax": _ctx.max,
|
183
|
-
"aria-valuenow": unref(secondValue),
|
184
|
-
"aria-valuetext": unref(secondValueText),
|
185
|
-
"aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
|
186
|
-
"aria-disabled": unref(sliderDisabled),
|
187
|
-
"onUpdate:modelValue": unref(setSecondValue)
|
188
|
-
}, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : createCommentVNode("v-if", true),
|
189
|
-
_ctx.showStops ? (openBlock(), createElementBlock("div", { key: 1 }, [
|
190
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(stops), (item, key) => {
|
191
|
-
return openBlock(), createElementBlock("div", {
|
192
|
-
key,
|
193
|
-
class: normalizeClass(unref(ns).e("stop")),
|
194
|
-
style: normalizeStyle(unref(getStopStyle)(item))
|
195
|
-
}, null, 6);
|
196
|
-
}), 128))
|
197
|
-
])) : createCommentVNode("v-if", true),
|
198
|
-
unref(markList).length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
199
|
-
createElementVNode("div", null, [
|
200
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => {
|
201
|
-
return openBlock(), createElementBlock("div", {
|
202
|
-
key,
|
203
|
-
style: normalizeStyle(unref(getStopStyle)(item.position)),
|
204
|
-
class: normalizeClass([unref(ns).e("stop"), unref(ns).e("marks-stop")])
|
205
|
-
}, null, 6);
|
206
|
-
}), 128))
|
207
|
-
]),
|
208
|
-
createElementVNode("div", {
|
209
|
-
class: normalizeClass(unref(ns).e("marks"))
|
210
|
-
}, [
|
211
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => {
|
212
|
-
return openBlock(), createBlock(unref(SliderMarker), {
|
213
|
-
key,
|
214
|
-
mark: item.mark,
|
215
|
-
style: normalizeStyle(unref(getStopStyle)(item.position)),
|
216
|
-
onMousedown: withModifiers(($event) => unref(onSliderMarkerDown)(item.position), ["stop"])
|
217
|
-
}, null, 8, ["mark", "style", "onMousedown"]);
|
218
|
-
}), 128))
|
219
|
-
], 2)
|
220
|
-
], 64)) : createCommentVNode("v-if", true)
|
221
|
-
], 46, ["onMousedown", "onTouchstartPassive"]),
|
222
|
-
_ctx.showInput && !_ctx.range ? (openBlock(), createBlock(unref(ElInputNumber), {
|
223
|
-
key: 0,
|
224
|
-
ref: "input",
|
225
|
-
"model-value": unref(firstValue),
|
226
|
-
class: normalizeClass(unref(ns).e("input")),
|
227
|
-
step: _ctx.step,
|
228
|
-
disabled: unref(sliderDisabled),
|
229
|
-
controls: _ctx.showInputControls,
|
230
|
-
min: _ctx.min,
|
231
|
-
max: _ctx.max,
|
232
|
-
precision: unref(precision),
|
233
|
-
debounce: _ctx.debounce,
|
234
|
-
size: unref(sliderInputSize),
|
235
|
-
"onUpdate:modelValue": unref(setFirstValue),
|
236
|
-
onChange: unref(emitChange)
|
237
|
-
}, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : createCommentVNode("v-if", true)
|
238
|
-
], 10, ["id", "role", "aria-label", "aria-labelledby"]);
|
239
|
-
};
|
240
|
-
}
|
241
|
-
});
|
242
|
-
var Slider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "slider.vue"]]);
|
87
|
+
const isValidValue = (value) => isNumber(value) || isArray(value) && value.every(isNumber);
|
88
|
+
const sliderEmits = {
|
89
|
+
[UPDATE_MODEL_EVENT]: isValidValue,
|
90
|
+
[INPUT_EVENT]: isValidValue,
|
91
|
+
[CHANGE_EVENT]: isValidValue
|
92
|
+
};
|
243
93
|
|
244
|
-
export {
|
94
|
+
export { sliderEmits, sliderProps };
|
245
95
|
//# sourceMappingURL=slider.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slider.mjs","sources":["../../../../../../packages/components/slider/src/slider.vue"],"sourcesContent":["<template>\n <div\n :id=\"range ? inputId : undefined\"\n ref=\"sliderWrapper\"\n :class=\"sliderKls\"\n :role=\"range ? 'group' : undefined\"\n :aria-label=\"range && !isLabeledByFormItem ? groupLabel : undefined\"\n :aria-labelledby=\"\n range && isLabeledByFormItem ? elFormItem?.labelId : undefined\n \"\n >\n <div\n ref=\"slider\"\n :class=\"[\n ns.e('runway'),\n { 'show-input': showInput && !range },\n ns.is('disabled', sliderDisabled),\n ]\"\n :style=\"runwayStyle\"\n @mousedown=\"onSliderDown\"\n @touchstart.passive=\"onSliderDown\"\n >\n <div :class=\"ns.e('bar')\" :style=\"barStyle\" />\n <slider-button\n :id=\"!range ? inputId : undefined\"\n ref=\"firstButton\"\n :model-value=\"firstValue\"\n :vertical=\"vertical\"\n :tooltip-class=\"tooltipClass\"\n :placement=\"placement\"\n role=\"slider\"\n :aria-label=\"\n range || !isLabeledByFormItem ? firstButtonLabel : undefined\n \"\n :aria-labelledby=\"\n !range && isLabeledByFormItem ? elFormItem?.labelId : undefined\n \"\n :aria-valuemin=\"min\"\n :aria-valuemax=\"range ? secondValue : max\"\n :aria-valuenow=\"firstValue\"\n :aria-valuetext=\"firstValueText\"\n :aria-orientation=\"vertical ? 'vertical' : 'horizontal'\"\n :aria-disabled=\"sliderDisabled\"\n @update:model-value=\"setFirstValue\"\n />\n <slider-button\n v-if=\"range\"\n ref=\"secondButton\"\n :model-value=\"secondValue\"\n :vertical=\"vertical\"\n :tooltip-class=\"tooltipClass\"\n :placement=\"placement\"\n role=\"slider\"\n :aria-label=\"secondButtonLabel\"\n :aria-valuemin=\"firstValue\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"secondValue\"\n :aria-valuetext=\"secondValueText\"\n :aria-orientation=\"vertical ? 'vertical' : 'horizontal'\"\n :aria-disabled=\"sliderDisabled\"\n @update:model-value=\"setSecondValue\"\n />\n <div v-if=\"showStops\">\n <div\n v-for=\"(item, key) in stops\"\n :key=\"key\"\n :class=\"ns.e('stop')\"\n :style=\"getStopStyle(item)\"\n />\n </div>\n <template v-if=\"markList.length > 0\">\n <div>\n <div\n v-for=\"(item, key) in markList\"\n :key=\"key\"\n :style=\"getStopStyle(item.position)\"\n :class=\"[ns.e('stop'), ns.e('marks-stop')]\"\n />\n </div>\n <div :class=\"ns.e('marks')\">\n <slider-marker\n v-for=\"(item, key) in markList\"\n :key=\"key\"\n :mark=\"item.mark\"\n :style=\"getStopStyle(item.position)\"\n @mousedown.stop=\"onSliderMarkerDown(item.position)\"\n />\n </div>\n </template>\n </div>\n <el-input-number\n v-if=\"showInput && !range\"\n ref=\"input\"\n :model-value=\"firstValue\"\n :class=\"ns.e('input')\"\n :step=\"step\"\n :disabled=\"sliderDisabled\"\n :controls=\"showInputControls\"\n :min=\"min\"\n :max=\"max\"\n :precision=\"precision\"\n :debounce=\"debounce\"\n :size=\"sliderInputSize\"\n @update:model-value=\"setFirstValue\"\n @change=\"emitChange\"\n />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, reactive, toRefs } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport ElInputNumber from '@element-plus/components/input-number'\nimport { useFormItemInputId, useFormSize } from '@element-plus/components/form'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { sliderContextKey } from './constants'\nimport { sliderEmits, sliderProps } from './slider'\nimport SliderButton from './button.vue'\nimport SliderMarker from './marker'\nimport {\n useLifecycle,\n useMarks,\n useSlide,\n useStops,\n useWatch,\n} from './composables'\nimport type { SliderInitData } from './slider'\n\ndefineOptions({\n name: 'ElSlider',\n})\n\nconst props = defineProps(sliderProps)\nconst emit = defineEmits(sliderEmits)\n\nconst ns = useNamespace('slider')\nconst { t } = useLocale()\n\nconst initData = reactive<SliderInitData>({\n firstValue: 0,\n secondValue: 0,\n oldValue: 0,\n dragging: false,\n sliderSize: 1,\n})\n\nconst {\n elFormItem,\n slider,\n firstButton,\n secondButton,\n sliderDisabled,\n minValue,\n maxValue,\n runwayStyle,\n barStyle,\n resetSize,\n emitChange,\n onSliderWrapperPrevent,\n onSliderClick,\n onSliderDown,\n onSliderMarkerDown,\n setFirstValue,\n setSecondValue,\n} = useSlide(props, initData, emit)\n\nconst { stops, getStopStyle } = useStops(props, initData, minValue, maxValue)\n\nconst { inputId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\n\nconst sliderWrapperSize = useFormSize()\nconst sliderInputSize = computed(\n () => props.inputSize || sliderWrapperSize.value\n)\n\nconst groupLabel = computed<string>(() => {\n return (\n props.ariaLabel ||\n t('el.slider.defaultLabel', {\n min: props.min,\n max: props.max,\n })\n )\n})\n\nconst firstButtonLabel = computed<string>(() => {\n if (props.range) {\n return props.rangeStartLabel || t('el.slider.defaultRangeStartLabel')\n } else {\n return groupLabel.value\n }\n})\n\nconst firstValueText = computed<string>(() => {\n return props.formatValueText\n ? props.formatValueText(firstValue.value)\n : `${firstValue.value}`\n})\n\nconst secondButtonLabel = computed<string>(() => {\n return props.rangeEndLabel || t('el.slider.defaultRangeEndLabel')\n})\n\nconst secondValueText = computed<string>(() => {\n return props.formatValueText\n ? props.formatValueText(secondValue.value)\n : `${secondValue.value}`\n})\n\nconst sliderKls = computed(() => [\n ns.b(),\n ns.m(sliderWrapperSize.value),\n ns.is('vertical', props.vertical),\n { [ns.m('with-input')]: props.showInput },\n])\n\nconst markList = useMarks(props)\n\nuseWatch(props, initData, minValue, maxValue, emit, elFormItem!)\n\nconst precision = computed(() => {\n const precisions = [props.min, props.max, props.step].map((item) => {\n const decimal = `${item}`.split('.')[1]\n return decimal ? decimal.length : 0\n })\n return Math.max.apply(null, precisions)\n})\n\nconst { sliderWrapper } = useLifecycle(props, initData, resetSize)\n\nconst { firstValue, secondValue, sliderSize } = toRefs(initData)\n\nconst updateDragging = (val: boolean) => {\n initData.dragging = val\n}\n\nuseEventListener(sliderWrapper, 'touchstart', onSliderWrapperPrevent, {\n passive: false,\n})\nuseEventListener(sliderWrapper, 'touchmove', onSliderWrapperPrevent, {\n passive: false,\n})\n\nprovide(sliderContextKey, {\n ...toRefs(props),\n sliderSize,\n disabled: sliderDisabled,\n precision,\n emitChange,\n resetSize,\n updateDragging,\n})\n\ndefineExpose({\n onSliderClick,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;mCAgIc,CAAA;AAAA,EACZ,IAAM,EAAA,UAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAChC,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AAExB,IAAA,MAAM,WAAW,QAAyB,CAAA;AAAA,MACxC,UAAY,EAAA,CAAA;AAAA,MACZ,WAAa,EAAA,CAAA;AAAA,MACb,QAAU,EAAA,CAAA;AAAA,MACV,QAAU,EAAA,KAAA;AAAA,MACV,UAAY,EAAA,CAAA;AAAA,KACb,CAAA,CAAA;AAED,IAAM,MAAA;AAAA,MACJ,UAAA;AAAA,MACA,MAAA;AAAA,MACA,WAAA;AAAA,MACA,YAAA;AAAA,MACA,cAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA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,OAAA,IAAA,CAAA,GAAA,CAAA,YAA2B,UAAA,CAAA,CAAA;AAAA,KAAA,CACpC,CAAC;AACD,IAAA,MAAA,EAAA,aAAsB,EAAA,GAAA,YAAgB,CAAA,KAAA,EAAA,QAAA,EAAA,SAAA,CAAA,CAAA;AAAA,IACxC,MAAC,EAAA,UAAA,EAAA,WAAA,EAAA,UAAA,EAAA,GAAA,MAAA,CAAA,QAAA,CAAA,CAAA;AAED,IAAA,MAAM,cAAgB,GAAA,CAAA,GAAiB,KAAA;AAEvC,MAAA,QAAoB,CAAA,QAAA,GAAA,GAAA,CAAA;AAEpB,KAAM,CAAA;AACJ,IAAA,gBAAoB,CAAA,aAAA,EAAA,YAAA,EAAA,sBAAA,EAAA;AAAA,MACtB,OAAA,EAAA,KAAA;AAEA,KAAiB,CAAA,CAAA;AAAqD,IAAA,gBAC3D,CAAA,aAAA,EAAA,WAAA,EAAA,sBAAA,EAAA;AAAA,MACV,OAAA,EAAA,KAAA;AACD,KAAiB,CAAA,CAAA;AAAoD,IAAA,OAC1D,CAAA,gBAAA,EAAA;AAAA,MACV,GAAA,MAAA,CAAA,KAAA,CAAA;AAED,MAAA,UAA0B;AAAA,MACxB,UAAU,cAAK;AAAA,MACf,SAAA;AAAA,MACA,UAAU;AAAA,MACV,SAAA;AAAA,MACA,cAAA;AAAA,KACA,CAAA,CAAA;AAAA,IACA,MAAA,CAAA;AAAA,MACD,aAAA;AAED,KAAa,CAAA,CAAA;AAAA,IACX,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACD,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"slider.mjs","sources":["../../../../../../packages/components/slider/src/slider.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport {\n buildProps,\n definePropType,\n isArray,\n isNumber,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { SliderMarkerProps } from './marker'\nimport type Slider from './slider.vue'\n\ntype SliderMarks = Record<number, string | SliderMarkerProps['mark']>\n\nexport interface SliderInitData {\n firstValue: number\n secondValue: number\n oldValue?: Arrayable<number>\n dragging: boolean\n sliderSize: number\n}\n\nexport const sliderProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<Arrayable<number>>([Number, Array]),\n default: 0,\n },\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description minimum value\n */\n min: {\n type: Number,\n default: 0,\n },\n /**\n * @description maximum value\n */\n max: {\n type: Number,\n default: 100,\n },\n /**\n * @description step size\n */\n step: {\n type: Number,\n default: 1,\n },\n /**\n * @description whether to display an input box, works when `range` is false\n */\n showInput: Boolean,\n /**\n * @description whether to display control buttons when `show-input` is true\n */\n showInputControls: {\n type: Boolean,\n default: true,\n },\n /**\n * @description size of the slider wrapper, will not work in vertical mode\n */\n size: useSizeProp,\n /**\n * @description size of the input box, when set `size`, the default is the value of `size`\n */\n inputSize: useSizeProp,\n /**\n * @description whether to display breakpoints\n */\n showStops: Boolean,\n /**\n * @description whether to display tooltip value\n */\n showTooltip: {\n type: Boolean,\n default: true,\n },\n /**\n * @description format to display tooltip value\n */\n formatTooltip: {\n type: definePropType<(val: number) => number | string>(Function),\n default: undefined,\n },\n /**\n * @description whether Slider is disabled\n */\n disabled: Boolean,\n /**\n * @description whether to select a range\n */\n range: Boolean,\n /**\n * @description vertical mode\n */\n vertical: Boolean,\n /**\n * @description slider height, required in vertical mode\n */\n height: String,\n /**\n * @description debounce delay when typing, in milliseconds, works when `show-input` is true\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @description when `range` is true, screen reader label for the start of the range\n */\n rangeStartLabel: {\n type: String,\n default: undefined,\n },\n /**\n * @description when `range` is true, screen reader label for the end of the range\n */\n rangeEndLabel: {\n type: String,\n default: undefined,\n },\n /**\n * @description format to display the `aria-valuenow` attribute for screen readers\n */\n formatValueText: {\n type: definePropType<(val: number) => string>(Function),\n default: undefined,\n },\n /**\n * @description custom class name for the tooltip\n */\n tooltipClass: {\n type: String,\n default: undefined,\n },\n /**\n * @description position of Tooltip\n */\n placement: {\n type: String,\n values: placements,\n default: 'top',\n },\n /**\n * @description marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style\n */\n marks: {\n type: definePropType<SliderMarks>(Object),\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n ...useAriaProps(['ariaLabel']),\n} as const)\nexport type SliderProps = ExtractPropTypes<typeof sliderProps>\n\nconst isValidValue = (value: Arrayable<number>) =>\n isNumber(value) || (isArray(value) && value.every(isNumber))\nexport const sliderEmits = {\n [UPDATE_MODEL_EVENT]: isValidValue,\n [INPUT_EVENT]: isValidValue,\n [CHANGE_EVENT]: isValidValue,\n}\nexport type SliderEmits = typeof sliderEmits\n\nexport type SliderInstance = InstanceType<typeof Slider>\n"],"names":[],"mappings":";;;;;;;;;;;AAaY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAA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