@element-plus/nightly 0.0.20241128 → 0.0.20241130
Sign up to get free protection for your applications and to get access to all the features.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +907 -317
- package/dist/index.full.min.js +17 -17
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +14 -14
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +904 -318
- 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 +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/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/component.mjs +2 -0
- package/es/component.mjs.map +1 -1
- package/es/components/alert/index.mjs +2 -2
- package/es/components/alert/src/alert.mjs +36 -95
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +95 -36
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +69 -7
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +7 -69
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content.mjs +87 -26
- package/es/components/dialog/src/dialog-content.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content2.mjs +26 -87
- package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
- package/es/components/dialog/src/dialog.mjs +1 -1
- package/es/components/dialog/src/dialog2.mjs +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +6 -4
- package/es/components/index.mjs.map +1 -1
- package/es/components/input-number/src/input-number2.mjs +2 -1
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/input-tag/index.d.ts +6 -0
- package/es/components/input-tag/index.mjs +8 -0
- package/es/components/input-tag/index.mjs.map +1 -0
- package/es/components/input-tag/src/composables/index.d.ts +4 -0
- package/es/components/input-tag/src/composables/index.mjs +5 -0
- package/es/components/input-tag/src/composables/index.mjs.map +1 -0
- package/es/components/input-tag/src/composables/use-drag-tag.d.ts +15 -0
- package/es/components/input-tag/src/composables/use-drag-tag.mjs +92 -0
- package/es/components/input-tag/src/composables/use-drag-tag.mjs.map +1 -0
- package/es/components/input-tag/src/composables/use-hovering.d.ts +5 -0
- package/es/components/input-tag/src/composables/use-hovering.mjs +19 -0
- package/es/components/input-tag/src/composables/use-hovering.mjs.map +1 -0
- package/es/components/input-tag/src/composables/use-input-tag-dom.d.ts +58 -0
- package/es/components/input-tag/src/composables/use-input-tag-dom.mjs +57 -0
- package/es/components/input-tag/src/composables/use-input-tag-dom.mjs.map +1 -0
- package/es/components/input-tag/src/composables/use-input-tag.d.ts +33 -0
- package/es/components/input-tag/src/composables/use-input-tag.mjs +153 -0
- package/es/components/input-tag/src/composables/use-input-tag.mjs.map +1 -0
- package/es/components/input-tag/src/input-tag.d.ts +60 -0
- package/es/components/input-tag/src/input-tag.mjs +219 -0
- package/es/components/input-tag/src/input-tag.mjs.map +1 -0
- package/es/components/input-tag/src/input-tag.vue.d.ts +142 -0
- package/es/components/input-tag/src/input-tag2.mjs +69 -0
- package/es/components/input-tag/src/input-tag2.mjs.map +1 -0
- package/es/components/input-tag/src/instance.d.ts +2 -0
- package/es/components/input-tag/src/instance.mjs +2 -0
- package/es/components/input-tag/src/instance.mjs.map +1 -0
- package/es/components/input-tag/style/css.d.ts +3 -0
- package/es/components/input-tag/style/css.mjs +4 -0
- package/es/components/input-tag/style/css.mjs.map +1 -0
- package/es/components/input-tag/style/index.d.ts +3 -0
- package/es/components/input-tag/style/index.mjs +4 -0
- package/es/components/input-tag/style/index.mjs.map +1 -0
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item.mjs +14 -96
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +96 -14
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/notification/src/notification.d.ts +12 -6
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +5 -8
- package/es/components/notification/src/notify.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker-range-trigger.mjs +1 -1
- package/es/components/time-picker/src/common/picker-range-trigger.mjs.map +1 -1
- package/es/components/time-picker/src/time-picker-com/panel-time-range.mjs +3 -0
- package/es/components/time-picker/src/time-picker-com/panel-time-range.mjs.map +1 -1
- package/es/components/tour/index.mjs +2 -2
- package/es/components/tour/src/step.mjs +168 -44
- package/es/components/tour/src/step.mjs.map +1 -1
- package/es/components/tour/src/step2.mjs +44 -168
- package/es/components/tour/src/step2.mjs.map +1 -1
- package/es/directives/click-outside/index.mjs +1 -1
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/index.mjs.map +1 -1
- package/es/hooks/use-calc-input-width/index.d.ts +7 -0
- package/es/hooks/use-calc-input-width/index.mjs +24 -0
- package/es/hooks/use-calc-input-width/index.mjs.map +1 -0
- package/es/hooks/use-focus-controller/index.mjs +1 -1
- package/es/hooks/use-lockscreen/index.mjs +1 -1
- package/es/index.mjs +7 -4
- package/es/index.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/global.d.ts +1 -0
- package/lib/component.js +98 -96
- package/lib/component.js.map +1 -1
- package/lib/components/alert/index.js +2 -2
- package/lib/components/alert/src/alert.js +37 -94
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +94 -37
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +69 -7
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +7 -69
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/dialog/src/dialog-content.js +86 -26
- package/lib/components/dialog/src/dialog-content.js.map +1 -1
- package/lib/components/dialog/src/dialog-content2.js +26 -86
- package/lib/components/dialog/src/dialog-content2.js.map +1 -1
- package/lib/components/dialog/src/dialog.js +1 -1
- package/lib/components/dialog/src/dialog2.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +117 -112
- package/lib/components/index.js.map +1 -1
- package/lib/components/input-number/src/input-number2.js +2 -1
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/input-tag/index.d.ts +6 -0
- package/lib/components/input-tag/index.js +15 -0
- package/lib/components/input-tag/index.js.map +1 -0
- package/lib/components/input-tag/src/composables/index.d.ts +4 -0
- package/lib/components/input-tag/src/composables/index.js +16 -0
- package/lib/components/input-tag/src/composables/index.js.map +1 -0
- package/lib/components/input-tag/src/composables/use-drag-tag.d.ts +15 -0
- package/lib/components/input-tag/src/composables/use-drag-tag.js +96 -0
- package/lib/components/input-tag/src/composables/use-drag-tag.js.map +1 -0
- package/lib/components/input-tag/src/composables/use-hovering.d.ts +5 -0
- package/lib/components/input-tag/src/composables/use-hovering.js +23 -0
- package/lib/components/input-tag/src/composables/use-hovering.js.map +1 -0
- package/lib/components/input-tag/src/composables/use-input-tag-dom.d.ts +58 -0
- package/lib/components/input-tag/src/composables/use-input-tag-dom.js +61 -0
- package/lib/components/input-tag/src/composables/use-input-tag-dom.js.map +1 -0
- package/lib/components/input-tag/src/composables/use-input-tag.d.ts +33 -0
- package/lib/components/input-tag/src/composables/use-input-tag.js +157 -0
- package/lib/components/input-tag/src/composables/use-input-tag.js.map +1 -0
- package/lib/components/input-tag/src/input-tag.d.ts +60 -0
- package/lib/components/input-tag/src/input-tag.js +223 -0
- package/lib/components/input-tag/src/input-tag.js.map +1 -0
- package/lib/components/input-tag/src/input-tag.vue.d.ts +142 -0
- package/lib/components/input-tag/src/input-tag2.js +74 -0
- package/lib/components/input-tag/src/input-tag2.js.map +1 -0
- package/lib/components/input-tag/src/instance.d.ts +2 -0
- package/lib/components/input-tag/src/instance.js +3 -0
- package/lib/components/input-tag/src/instance.js.map +1 -0
- package/lib/components/input-tag/style/css.d.ts +3 -0
- package/lib/components/input-tag/style/css.js +7 -0
- package/lib/components/input-tag/style/css.js.map +1 -0
- package/lib/components/input-tag/style/index.d.ts +3 -0
- package/lib/components/input-tag/style/index.js +7 -0
- package/lib/components/input-tag/style/index.js.map +1 -0
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item.js +15 -96
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +96 -15
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/notification/src/notification.d.ts +12 -6
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notify.js +4 -7
- package/lib/components/notification/src/notify.js.map +1 -1
- package/lib/components/time-picker/src/common/picker-range-trigger.js +1 -1
- package/lib/components/time-picker/src/common/picker-range-trigger.js.map +1 -1
- package/lib/components/time-picker/src/time-picker-com/panel-time-range.js +3 -0
- package/lib/components/time-picker/src/time-picker-com/panel-time-range.js.map +1 -1
- package/lib/components/tour/index.js +2 -2
- package/lib/components/tour/src/step.js +167 -44
- package/lib/components/tour/src/step.js.map +1 -1
- package/lib/components/tour/src/step2.js +44 -167
- package/lib/components/tour/src/step2.js.map +1 -1
- package/lib/directives/click-outside/index.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +96 -94
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-calc-input-width/index.d.ts +7 -0
- package/lib/hooks/use-calc-input-width/index.js +28 -0
- package/lib/hooks/use-calc-input-width/index.js.map +1 -0
- package/lib/hooks/use-focus-controller/index.js +1 -1
- package/lib/hooks/use-lockscreen/index.js +1 -1
- package/lib/index.js +223 -216
- package/lib/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-chalk/el-form.css +1 -1
- package/theme-chalk/el-input-tag.css +1 -0
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/common/var.scss +47 -0
- package/theme-chalk/src/form.scss +2 -1
- package/theme-chalk/src/index.scss +1 -0
- package/theme-chalk/src/input-tag.scss +215 -0
- package/web-types.json +1 -1
@@ -18,6 +18,7 @@ var error = require('../../../utils/error.js');
|
|
18
18
|
var useFormCommonProps = require('../../form/src/hooks/use-form-common-props.js');
|
19
19
|
var event = require('../../../constants/event.js');
|
20
20
|
var shared = require('@vue/shared');
|
21
|
+
var browser = require('../../../utils/browser.js');
|
21
22
|
|
22
23
|
const __default__ = vue.defineComponent({
|
23
24
|
name: "ElInputNumber"
|
@@ -201,7 +202,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
201
202
|
const handleBlur = (event) => {
|
202
203
|
var _a, _b;
|
203
204
|
data.userInput = null;
|
204
|
-
if (data.currentValue === null && ((_a = input.value) == null ? void 0 : _a.input)) {
|
205
|
+
if (browser.isFirefox() && data.currentValue === null && ((_a = input.value) == null ? void 0 : _a.input)) {
|
205
206
|
input.value.input.value = "";
|
206
207
|
}
|
207
208
|
emit("blur", event);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input-number2.js","sources":["../../../../../../packages/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.decrease')\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <slot name=\"decrease-icon\">\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </slot>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.increase')\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <slot name=\"increase-icon\">\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </slot>\n </span>\n <el-input\n :id=\"id\"\n ref=\"input\"\n type=\"number\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :readonly=\"readonly\"\n :disabled=\"inputNumberDisabled\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :aria-label=\"ariaLabel\"\n :validate-event=\"false\"\n @keydown.up.prevent=\"increase\"\n @keydown.down.prevent=\"decrease\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n >\n <template v-if=\"$slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"$slots.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n </el-input>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, onUpdated, reactive, ref, watch } from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { ElInput } from '@element-plus/components/input'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormSize,\n} from '@element-plus/components/form'\nimport { vRepeatClick } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport {\n debugWarn,\n isNumber,\n isString,\n isUndefined,\n throwError,\n} from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits, inputNumberProps } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = defineProps(inputNumberProps)\nconst emit = defineEmits(inputNumberEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('input-number')\nconst input = ref<InputInstance>()\n\ninterface Data {\n currentValue: number | null | undefined\n userInput: null | number | string\n}\nconst data = reactive<Data>({\n currentValue: props.modelValue,\n userInput: null,\n})\n\nconst { formItem } = useFormItem()\n\nconst minDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue <= props.min\n)\nconst maxDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue >= props.max\n)\n\nconst numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n})\nconst controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n})\n\nconst inputNumberSize = useFormSize()\nconst inputNumberDisabled = useFormDisabled()\n\nconst displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined | null = data.currentValue\n if (isNil(currentValue)) return ''\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n})\nconst toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n if (pre === 0) return Math.round(num)\n let snum = String(num)\n const pointPos = snum.indexOf('.')\n if (pointPos === -1) return num\n const nums = snum.replace('.', '').split('')\n const datum = nums[pointPos + pre]\n if (!datum) return num\n const length = snum.length\n if (snum.charAt(length - 1) === '5') {\n snum = `${snum.slice(0, Math.max(0, length - 1))}6`\n }\n return Number.parseFloat(Number(snum).toFixed(pre))\n}\nconst getPrecision = (value: number | null | undefined) => {\n if (isNil(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n}\nconst ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst increase = () => {\n if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst decrease = () => {\n if (props.readonly || inputNumberDisabled.value || minDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst verifyValue = (\n value: number | string | null | undefined,\n update?: boolean\n): number | null | undefined => {\n const { max, min, step, precision, stepStrictly, valueOnClear } = props\n if (max < min) {\n throwError('InputNumber', 'min should not be greater than max.')\n }\n let newVal = Number(value)\n if (isNil(value) || Number.isNaN(newVal)) {\n return null\n }\n if (value === '') {\n if (valueOnClear === null) {\n return null\n }\n newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear\n }\n if (stepStrictly) {\n newVal = toPrecision(Math.round(newVal / step) * step, precision)\n if (newVal !== value) {\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n return newVal\n}\nconst setCurrentValue = (\n value: number | string | null | undefined,\n emitChange = true\n) => {\n const oldVal = data.currentValue\n const newVal = verifyValue(value)\n if (!emitChange) {\n emit(UPDATE_MODEL_EVENT, newVal!)\n return\n }\n if (oldVal === newVal && value) return\n data.userInput = null\n emit(UPDATE_MODEL_EVENT, newVal!)\n if (oldVal !== newVal) {\n emit(CHANGE_EVENT, newVal!, oldVal!)\n }\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n const newVal = value === '' ? null : Number(value)\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number(value) : ''\n if ((isNumber(newVal) && !Number.isNaN(newVal)) || value === '') {\n setCurrentValue(newVal)\n }\n setCurrentValueToModelValue()\n data.userInput = null\n}\n\nconst focus = () => {\n input.value?.focus?.()\n}\n\nconst blur = () => {\n input.value?.blur?.()\n}\n\nconst handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n}\n\nconst handleBlur = (event: MouseEvent | FocusEvent) => {\n data.userInput = null\n if (data.currentValue === null && input.value?.input) {\n input.value.input.value = ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n}\n\nconst setCurrentValueToModelValue = () => {\n if (data.currentValue !== props.modelValue) {\n data.currentValue = props.modelValue\n }\n}\nconst handleWheel = (e: WheelEvent) => {\n if (document.activeElement === e.target) e.preventDefault()\n}\n\nwatch(\n () => props.modelValue,\n (value, oldValue) => {\n const newValue = verifyValue(value, true)\n if (data.userInput === null && newValue !== oldValue) {\n data.currentValue = newValue\n }\n },\n { immediate: true }\n)\nonMounted(() => {\n const { min, max, modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n if (Number.isFinite(max)) {\n innerInput.setAttribute('aria-valuemax', String(max))\n } else {\n innerInput.removeAttribute('aria-valuemax')\n }\n if (Number.isFinite(min)) {\n innerInput.setAttribute('aria-valuemin', String(min))\n } else {\n innerInput.removeAttribute('aria-valuemin')\n }\n innerInput.setAttribute(\n 'aria-valuenow',\n data.currentValue || data.currentValue === 0\n ? String(data.currentValue)\n : ''\n )\n innerInput.setAttribute('aria-disabled', String(inputNumberDisabled.value))\n if (!isNumber(modelValue) && modelValue != null) {\n let val: number | null = Number(modelValue)\n if (Number.isNaN(val)) {\n val = null\n }\n emit(UPDATE_MODEL_EVENT, val!)\n }\n innerInput.addEventListener('wheel', handleWheel, { passive: false })\n})\nonUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', `${data.currentValue ?? ''}`)\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"names":["useLocale","useNamespace","ref","reactive","useFormItem","computed","isNumber","debugWarn","useFormSize","useFormDisabled","isNil","isUndefined","INPUT_EVENT","throwError","isString","UPDATE_MODEL_EVENT","CHANGE_EVENT","watch","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;;;uCAqGc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,cAAc,CAAA,CAAA;AACtC,IAAA,MAAM,QAAQC,OAAmB,EAAA,CAAA;AAMjC,IAAA,MAAM,OAAOC,YAAe,CAAA;AAAA,MAC1B,cAAc,KAAM,CAAA,UAAA;AAAA,MACpB,SAAW,EAAA,IAAA;AAAA,KACZ,CAAA,CAAA;AAED,IAAM,MAAA,EAAE,QAAS,EAAA,GAAIC,uBAAY,EAAA,CAAA;AAEjC,IAAA,MAAM,WAAc,GAAAC,YAAA,CAAA,MAAAC,cAAA,CAAA,KAAA,CAAA,UAAA,CAAA,IAAA,KAAA,CAAA,UAAA,IAAA,KAAA,CAAA,GAAA,CAAA,CAAA;AAAA,IAAA,iBACH,GAAAD,mBAAqBC,cAAA,CAAM,gBAAoB,CAAA,IAAA,KAAA,CAAA,UAAA,IAAA,KAAA,CAAA,GAAA,CAAA,CAAA;AAAA,IAChE,MAAA,YAAA,GAAAD,YAAA,CAAA,MAAA;AACA,MAAA,MAAoB,aAAA,GAAA,YAAA,CAAA,KAAA,CAAA,IAAA,CAAA,CAAA;AAAA,MAClB,sBAAe,CAAA,eAAqB,CAAA,EAAA;AAA0B,QAChE,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,EAAA,MAAA,CAAA,mBAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACrB,MAAM,IAAA,CAAAZ,cAAA,CAAA,UAAA,CAAA,IAAA,UAAA,IAAA,IAAA,EAAA;AAAA,QACR,IAAA,GAAA,GAAA,MAAA,CAAA,UAAA,CAAA,CAAA;AACA,QAAA,IAAA;AAA6B,UAC/B,GAAA,GAAA,IAAA,CAAA;AACA,SAAA;AAAoE,QACrE,IAAA,CAAAS,wBAAA,EAAA,GAAA,CAAA,CAAA;AACD,OAAA;AACE,MAAM,UAAA,CAAA,gBAA0B,CAAA,OAAA,EAAA,WAAA,EAAA,EAAA,OAAA,EAAA,KAAA,EAAA,CAAA,CAAA;AAChC,KAAA,CAAA,CAAA;AAAsE,IACxEI,aAAC,CAAA,MAAA;AACD,MAAa,IAAA,EAAA,EAAA,EAAA,CAAA;AAAA,MAAA,MAAA,UAAA,GAAA,CAAA,EAAA,GAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAA,CAAA;AAAA,MAEX,UAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,UAAA,CAAA,YAAA,CAAA,eAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,IAAA,CAAA,YAAA,KAAA,IAAA,GAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,KAAA,CAAA,CAAA;AAAA,IAEA,MAAA,CAAA;AAAA,MACD,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"input-number2.js","sources":["../../../../../../packages/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.decrease')\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <slot name=\"decrease-icon\">\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </slot>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.increase')\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <slot name=\"increase-icon\">\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </slot>\n </span>\n <el-input\n :id=\"id\"\n ref=\"input\"\n type=\"number\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :readonly=\"readonly\"\n :disabled=\"inputNumberDisabled\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :aria-label=\"ariaLabel\"\n :validate-event=\"false\"\n @keydown.up.prevent=\"increase\"\n @keydown.down.prevent=\"decrease\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n >\n <template v-if=\"$slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"$slots.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n </el-input>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, onUpdated, reactive, ref, watch } from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { ElInput } from '@element-plus/components/input'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormSize,\n} from '@element-plus/components/form'\nimport { vRepeatClick } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport {\n debugWarn,\n isFirefox,\n isNumber,\n isString,\n isUndefined,\n throwError,\n} from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits, inputNumberProps } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = defineProps(inputNumberProps)\nconst emit = defineEmits(inputNumberEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('input-number')\nconst input = ref<InputInstance>()\n\ninterface Data {\n currentValue: number | null | undefined\n userInput: null | number | string\n}\nconst data = reactive<Data>({\n currentValue: props.modelValue,\n userInput: null,\n})\n\nconst { formItem } = useFormItem()\n\nconst minDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue <= props.min\n)\nconst maxDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue >= props.max\n)\n\nconst numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n})\nconst controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n})\n\nconst inputNumberSize = useFormSize()\nconst inputNumberDisabled = useFormDisabled()\n\nconst displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined | null = data.currentValue\n if (isNil(currentValue)) return ''\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n})\nconst toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n if (pre === 0) return Math.round(num)\n let snum = String(num)\n const pointPos = snum.indexOf('.')\n if (pointPos === -1) return num\n const nums = snum.replace('.', '').split('')\n const datum = nums[pointPos + pre]\n if (!datum) return num\n const length = snum.length\n if (snum.charAt(length - 1) === '5') {\n snum = `${snum.slice(0, Math.max(0, length - 1))}6`\n }\n return Number.parseFloat(Number(snum).toFixed(pre))\n}\nconst getPrecision = (value: number | null | undefined) => {\n if (isNil(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n}\nconst ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst increase = () => {\n if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst decrease = () => {\n if (props.readonly || inputNumberDisabled.value || minDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst verifyValue = (\n value: number | string | null | undefined,\n update?: boolean\n): number | null | undefined => {\n const { max, min, step, precision, stepStrictly, valueOnClear } = props\n if (max < min) {\n throwError('InputNumber', 'min should not be greater than max.')\n }\n let newVal = Number(value)\n if (isNil(value) || Number.isNaN(newVal)) {\n return null\n }\n if (value === '') {\n if (valueOnClear === null) {\n return null\n }\n newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear\n }\n if (stepStrictly) {\n newVal = toPrecision(Math.round(newVal / step) * step, precision)\n if (newVal !== value) {\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n return newVal\n}\nconst setCurrentValue = (\n value: number | string | null | undefined,\n emitChange = true\n) => {\n const oldVal = data.currentValue\n const newVal = verifyValue(value)\n if (!emitChange) {\n emit(UPDATE_MODEL_EVENT, newVal!)\n return\n }\n if (oldVal === newVal && value) return\n data.userInput = null\n emit(UPDATE_MODEL_EVENT, newVal!)\n if (oldVal !== newVal) {\n emit(CHANGE_EVENT, newVal!, oldVal!)\n }\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n const newVal = value === '' ? null : Number(value)\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number(value) : ''\n if ((isNumber(newVal) && !Number.isNaN(newVal)) || value === '') {\n setCurrentValue(newVal)\n }\n setCurrentValueToModelValue()\n data.userInput = null\n}\n\nconst focus = () => {\n input.value?.focus?.()\n}\n\nconst blur = () => {\n input.value?.blur?.()\n}\n\nconst handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n}\n\nconst handleBlur = (event: MouseEvent | FocusEvent) => {\n data.userInput = null\n // This is a Firefox-specific problem. When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (isFirefox() && data.currentValue === null && input.value?.input) {\n input.value.input.value = ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n}\n\nconst setCurrentValueToModelValue = () => {\n if (data.currentValue !== props.modelValue) {\n data.currentValue = props.modelValue\n }\n}\nconst handleWheel = (e: WheelEvent) => {\n if (document.activeElement === e.target) e.preventDefault()\n}\n\nwatch(\n () => props.modelValue,\n (value, oldValue) => {\n const newValue = verifyValue(value, true)\n if (data.userInput === null && newValue !== oldValue) {\n data.currentValue = newValue\n }\n },\n { immediate: true }\n)\nonMounted(() => {\n const { min, max, modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n if (Number.isFinite(max)) {\n innerInput.setAttribute('aria-valuemax', String(max))\n } else {\n innerInput.removeAttribute('aria-valuemax')\n }\n if (Number.isFinite(min)) {\n innerInput.setAttribute('aria-valuemin', String(min))\n } else {\n innerInput.removeAttribute('aria-valuemin')\n }\n innerInput.setAttribute(\n 'aria-valuenow',\n data.currentValue || data.currentValue === 0\n ? String(data.currentValue)\n : ''\n )\n innerInput.setAttribute('aria-disabled', String(inputNumberDisabled.value))\n if (!isNumber(modelValue) && modelValue != null) {\n let val: number | null = Number(modelValue)\n if (Number.isNaN(val)) {\n val = null\n }\n emit(UPDATE_MODEL_EVENT, val!)\n }\n innerInput.addEventListener('wheel', handleWheel, { passive: false })\n})\nonUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', `${data.currentValue ?? ''}`)\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"names":["useLocale","useNamespace","ref","reactive","useFormItem","computed","isNumber","debugWarn","useFormSize","useFormDisabled","isNil","isUndefined","INPUT_EVENT","throwError","isString","UPDATE_MODEL_EVENT","CHANGE_EVENT","isFirefox","watch","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;;;;uCAsGc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,cAAc,CAAA,CAAA;AACtC,IAAA,MAAM,QAAQC,OAAmB,EAAA,CAAA;AAMjC,IAAA,MAAM,OAAOC,YAAe,CAAA;AAAA,MAC1B,cAAc,KAAM,CAAA,UAA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AAA,GAAA,KAAA,CAAA,GAAA,UAAA,CAAA,YAAA,CAAA,eAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,IAAA,CAAA,YAAA,KAAA,IAAA,GAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,KAAA,CAAA,CAAA;AAAA,IAEA,MAAA,CAAA;AAAA,MACD,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import InputTag from './src/input-tag.vue';
|
2
|
+
import type { SFCWithInstall } from '@element-plus/nightly/es/utils';
|
3
|
+
export declare const ElInputTag: SFCWithInstall<typeof InputTag>;
|
4
|
+
export default ElInputTag;
|
5
|
+
export * from './src/input-tag';
|
6
|
+
export type { InputTagInstance } from './src/instance';
|
@@ -0,0 +1,15 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var inputTag$1 = require('./src/input-tag.js');
|
6
|
+
var inputTag = require('./src/input-tag2.js');
|
7
|
+
var install = require('../../utils/vue/install.js');
|
8
|
+
|
9
|
+
const ElInputTag = install.withInstall(inputTag$1["default"]);
|
10
|
+
|
11
|
+
exports.inputTagEmits = inputTag.inputTagEmits;
|
12
|
+
exports.inputTagProps = inputTag.inputTagProps;
|
13
|
+
exports.ElInputTag = ElInputTag;
|
14
|
+
exports["default"] = ElInputTag;
|
15
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/input-tag/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport InputTag from './src/input-tag.vue'\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElInputTag: SFCWithInstall<typeof InputTag> = withInstall(InputTag)\nexport default ElInputTag\n\nexport * from './src/input-tag'\nexport type { InputTagInstance } from './src/instance'\n"],"names":["withInstall","InputTag"],"mappings":";;;;;;;;AAEY,MAAC,UAAU,GAAGA,mBAAW,CAACC,qBAAQ;;;;;;;"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var useDragTag = require('./use-drag-tag.js');
|
6
|
+
var useHovering = require('./use-hovering.js');
|
7
|
+
var useInputTag = require('./use-input-tag.js');
|
8
|
+
var useInputTagDom = require('./use-input-tag-dom.js');
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
exports.useDragTag = useDragTag.useDragTag;
|
13
|
+
exports.useHovering = useHovering.useHovering;
|
14
|
+
exports.useInputTag = useInputTag.useInputTag;
|
15
|
+
exports.useInputTagDom = useInputTagDom.useInputTagDom;
|
16
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { type ShallowRef } from 'vue';
|
2
|
+
type DropType = 'before' | 'after';
|
3
|
+
interface UseDragTagOptions {
|
4
|
+
wrapperRef: ShallowRef<HTMLElement | undefined>;
|
5
|
+
handleDragged: (draggingIndex: number, dropIndex: number, type: DropType) => void;
|
6
|
+
afterDragged?: () => void;
|
7
|
+
}
|
8
|
+
export declare function useDragTag({ wrapperRef, handleDragged, afterDragged, }: UseDragTagOptions): {
|
9
|
+
dropIndicatorRef: ShallowRef<HTMLElement | undefined>;
|
10
|
+
showDropIndicator: import("vue").Ref<boolean>;
|
11
|
+
handleDragStart: (event: DragEvent, index: number) => void;
|
12
|
+
handleDragOver: (event: DragEvent, index: number) => void;
|
13
|
+
handleDragEnd: (event: DragEvent) => void;
|
14
|
+
};
|
15
|
+
export {};
|
@@ -0,0 +1,96 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var vue = require('vue');
|
6
|
+
var style = require('../../../../utils/dom/style.js');
|
7
|
+
var index = require('../../../../hooks/use-namespace/index.js');
|
8
|
+
var types = require('../../../../utils/types.js');
|
9
|
+
|
10
|
+
function useDragTag({
|
11
|
+
wrapperRef,
|
12
|
+
handleDragged,
|
13
|
+
afterDragged
|
14
|
+
}) {
|
15
|
+
const ns = index.useNamespace("input-tag");
|
16
|
+
const dropIndicatorRef = vue.shallowRef();
|
17
|
+
const showDropIndicator = vue.ref(false);
|
18
|
+
let draggingIndex;
|
19
|
+
let draggingTag;
|
20
|
+
let dropIndex;
|
21
|
+
let dropType;
|
22
|
+
function getTagClassName(index) {
|
23
|
+
return `.${ns.e("inner")} .${ns.namespace.value}-tag:nth-child(${index + 1})`;
|
24
|
+
}
|
25
|
+
function handleDragStart(event, index) {
|
26
|
+
draggingIndex = index;
|
27
|
+
draggingTag = wrapperRef.value.querySelector(getTagClassName(index));
|
28
|
+
if (draggingTag) {
|
29
|
+
draggingTag.style.opacity = "0.5";
|
30
|
+
}
|
31
|
+
event.dataTransfer.effectAllowed = "move";
|
32
|
+
}
|
33
|
+
function handleDragOver(event, index) {
|
34
|
+
dropIndex = index;
|
35
|
+
event.preventDefault();
|
36
|
+
event.dataTransfer.dropEffect = "move";
|
37
|
+
if (types.isUndefined(draggingIndex) || draggingIndex === index) {
|
38
|
+
showDropIndicator.value = false;
|
39
|
+
return;
|
40
|
+
}
|
41
|
+
const dropPosition = wrapperRef.value.querySelector(getTagClassName(index)).getBoundingClientRect();
|
42
|
+
const dropPrev = !(draggingIndex + 1 === index);
|
43
|
+
const dropNext = !(draggingIndex - 1 === index);
|
44
|
+
const distance = event.clientX - dropPosition.left;
|
45
|
+
const prevPercent = dropPrev ? dropNext ? 0.5 : 1 : -1;
|
46
|
+
const nextPercent = dropNext ? dropPrev ? 0.5 : 0 : 1;
|
47
|
+
if (distance <= dropPosition.width * prevPercent) {
|
48
|
+
dropType = "before";
|
49
|
+
} else if (distance > dropPosition.width * nextPercent) {
|
50
|
+
dropType = "after";
|
51
|
+
} else {
|
52
|
+
dropType = void 0;
|
53
|
+
}
|
54
|
+
const innerEl = wrapperRef.value.querySelector(`.${ns.e("inner")}`);
|
55
|
+
const innerPosition = innerEl.getBoundingClientRect();
|
56
|
+
const gap = Number.parseFloat(style.getStyle(innerEl, "gap")) / 2;
|
57
|
+
const indicatorTop = dropPosition.top - innerPosition.top;
|
58
|
+
let indicatorLeft = -9999;
|
59
|
+
if (dropType === "before") {
|
60
|
+
indicatorLeft = Math.max(dropPosition.left - innerPosition.left - gap, Math.floor(-gap / 2));
|
61
|
+
} else if (dropType === "after") {
|
62
|
+
const left = dropPosition.right - innerPosition.left;
|
63
|
+
indicatorLeft = left + (innerPosition.width === left ? Math.floor(gap / 2) : gap);
|
64
|
+
}
|
65
|
+
style.setStyle(dropIndicatorRef.value, {
|
66
|
+
top: `${indicatorTop}px`,
|
67
|
+
left: `${indicatorLeft}px`
|
68
|
+
});
|
69
|
+
showDropIndicator.value = !!dropType;
|
70
|
+
}
|
71
|
+
function handleDragEnd(event) {
|
72
|
+
event.preventDefault();
|
73
|
+
if (draggingTag) {
|
74
|
+
draggingTag.style.opacity = "";
|
75
|
+
}
|
76
|
+
if (dropType && !types.isUndefined(draggingIndex) && !types.isUndefined(dropIndex) && draggingIndex !== dropIndex) {
|
77
|
+
handleDragged(draggingIndex, dropIndex, dropType);
|
78
|
+
}
|
79
|
+
showDropIndicator.value = false;
|
80
|
+
draggingIndex = void 0;
|
81
|
+
draggingTag = null;
|
82
|
+
dropIndex = void 0;
|
83
|
+
dropType = void 0;
|
84
|
+
afterDragged == null ? void 0 : afterDragged();
|
85
|
+
}
|
86
|
+
return {
|
87
|
+
dropIndicatorRef,
|
88
|
+
showDropIndicator,
|
89
|
+
handleDragStart,
|
90
|
+
handleDragOver,
|
91
|
+
handleDragEnd
|
92
|
+
};
|
93
|
+
}
|
94
|
+
|
95
|
+
exports.useDragTag = useDragTag;
|
96
|
+
//# sourceMappingURL=use-drag-tag.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-drag-tag.js","sources":["../../../../../../../packages/components/input-tag/src/composables/use-drag-tag.ts"],"sourcesContent":["import { type ShallowRef, ref, shallowRef } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { getStyle, isUndefined, setStyle } from '@element-plus/utils'\n\ntype DropType = 'before' | 'after'\n\ninterface UseDragTagOptions {\n wrapperRef: ShallowRef<HTMLElement | undefined>\n handleDragged: (\n draggingIndex: number,\n dropIndex: number,\n type: DropType\n ) => void\n afterDragged?: () => void\n}\n\nexport function useDragTag({\n wrapperRef,\n handleDragged,\n afterDragged,\n}: UseDragTagOptions) {\n const ns = useNamespace('input-tag')\n const dropIndicatorRef = shallowRef<HTMLElement>()\n const showDropIndicator = ref(false)\n\n let draggingIndex: number | undefined\n let draggingTag: HTMLElement | null\n let dropIndex: number | undefined\n let dropType: DropType | undefined\n\n function getTagClassName(index: number) {\n return `.${ns.e('inner')} .${ns.namespace.value}-tag:nth-child(${\n index + 1\n })`\n }\n\n function handleDragStart(event: DragEvent, index: number) {\n draggingIndex = index\n draggingTag = wrapperRef.value!.querySelector<HTMLElement>(\n getTagClassName(index)\n )\n\n if (draggingTag) {\n draggingTag.style.opacity = '0.5'\n }\n event.dataTransfer!.effectAllowed = 'move'\n }\n\n function handleDragOver(event: DragEvent, index: number) {\n dropIndex = index\n event.preventDefault()\n event.dataTransfer!.dropEffect = 'move'\n\n if (isUndefined(draggingIndex) || draggingIndex === index) {\n showDropIndicator.value = false\n return\n }\n\n const dropPosition = wrapperRef\n .value!.querySelector<HTMLElement>(getTagClassName(index))!\n .getBoundingClientRect()\n const dropPrev = !(draggingIndex + 1 === index)\n const dropNext = !(draggingIndex - 1 === index)\n const distance = event.clientX - dropPosition.left\n const prevPercent = dropPrev ? (dropNext ? 0.5 : 1) : -1\n const nextPercent = dropNext ? (dropPrev ? 0.5 : 0) : 1\n\n if (distance <= dropPosition.width * prevPercent) {\n dropType = 'before'\n } else if (distance > dropPosition.width * nextPercent) {\n dropType = 'after'\n } else {\n dropType = undefined\n }\n\n const innerEl = wrapperRef.value!.querySelector<HTMLElement>(\n `.${ns.e('inner')}`\n )!\n const innerPosition = innerEl.getBoundingClientRect()\n const gap = Number.parseFloat(getStyle(innerEl, 'gap')) / 2\n\n const indicatorTop = dropPosition.top - innerPosition.top\n let indicatorLeft = -9999\n\n if (dropType === 'before') {\n indicatorLeft = Math.max(\n dropPosition.left - innerPosition.left - gap,\n Math.floor(-gap / 2)\n )\n } else if (dropType === 'after') {\n const left = dropPosition.right - innerPosition.left\n indicatorLeft =\n left + (innerPosition.width === left ? Math.floor(gap / 2) : gap)\n }\n\n setStyle(dropIndicatorRef.value!, {\n top: `${indicatorTop}px`,\n left: `${indicatorLeft}px`,\n })\n showDropIndicator.value = !!dropType\n }\n\n function handleDragEnd(event: DragEvent) {\n event.preventDefault()\n\n if (draggingTag) {\n draggingTag.style.opacity = ''\n }\n\n if (\n dropType &&\n !isUndefined(draggingIndex) &&\n !isUndefined(dropIndex) &&\n draggingIndex !== dropIndex\n ) {\n handleDragged(draggingIndex, dropIndex, dropType)\n }\n\n showDropIndicator.value = false\n draggingIndex = undefined\n draggingTag = null\n dropIndex = undefined\n dropType = undefined\n afterDragged?.()\n }\n\n return {\n dropIndicatorRef,\n showDropIndicator,\n handleDragStart,\n handleDragOver,\n handleDragEnd,\n }\n}\n"],"names":["useNamespace","shallowRef","ref","isUndefined","getStyle","setStyle"],"mappings":";;;;;;;;;AAGO,SAAS,UAAU,CAAC;AAC3B,EAAE,UAAU;AACZ,EAAE,aAAa;AACf,EAAE,YAAY;AACd,CAAC,EAAE;AACH,EAAE,MAAM,EAAE,GAAGA,kBAAY,CAAC,WAAW,CAAC,CAAC;AACvC,EAAE,MAAM,gBAAgB,GAAGC,cAAU,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AAC;AAC3B,IAAI,WAAW,GAAG,IAAI,CAAC;AACvB,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,YAAY,EAAE,CAAC;AACnD,GAAG;AACH,EAAE,OAAO;AACT,IAAI,gBAAgB;AACpB,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,aAAa;AACjB,GAAG,CAAC;AACJ;;;;"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var vue = require('vue');
|
6
|
+
|
7
|
+
function useHovering() {
|
8
|
+
const hovering = vue.ref(false);
|
9
|
+
const handleMouseEnter = () => {
|
10
|
+
hovering.value = true;
|
11
|
+
};
|
12
|
+
const handleMouseLeave = () => {
|
13
|
+
hovering.value = false;
|
14
|
+
};
|
15
|
+
return {
|
16
|
+
hovering,
|
17
|
+
handleMouseEnter,
|
18
|
+
handleMouseLeave
|
19
|
+
};
|
20
|
+
}
|
21
|
+
|
22
|
+
exports.useHovering = useHovering;
|
23
|
+
//# sourceMappingURL=use-hovering.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-hovering.js","sources":["../../../../../../../packages/components/input-tag/src/composables/use-hovering.ts"],"sourcesContent":["import { ref } from 'vue'\n\nexport function useHovering() {\n const hovering = ref(false)\n\n const handleMouseEnter = () => {\n hovering.value = true\n }\n\n const handleMouseLeave = () => {\n hovering.value = false\n }\n\n return {\n hovering,\n handleMouseEnter,\n handleMouseLeave,\n }\n}\n"],"names":["ref"],"mappings":";;;;;;AACO,SAAS,WAAW,GAAG;AAC9B,EAAE,MAAM,QAAQ,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AAC9B,EAAE,MAAM,gBAAgB,GAAG,MAAM;AACjC,IAAI,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;AAC1B,GAAG,CAAC;AACJ,EAAE,MAAM,gBAAgB,GAAG,MAAM;AACjC,IAAI,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,QAAQ;AACZ,IAAI,gBAAgB;AACpB,IAAI,gBAAgB;AACpB,GAAG,CAAC;AACJ;;;;"}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import type { ComputedRef, Ref, StyleValue } from 'vue';
|
2
|
+
import type { ComponentSize } from '@element-plus/nightly/es/constants';
|
3
|
+
import type { InputTagProps } from '../input-tag';
|
4
|
+
interface UseInputTagDomOptions {
|
5
|
+
props: InputTagProps;
|
6
|
+
isFocused: Ref<boolean>;
|
7
|
+
hovering: Ref<boolean>;
|
8
|
+
disabled: ComputedRef<boolean>;
|
9
|
+
inputValue: Ref<string | undefined>;
|
10
|
+
size: ComputedRef<ComponentSize>;
|
11
|
+
validateState: ComputedRef<string>;
|
12
|
+
validateIcon: ComputedRef<boolean>;
|
13
|
+
needStatusIcon: ComputedRef<boolean>;
|
14
|
+
}
|
15
|
+
export declare function useInputTagDom({ props, isFocused, hovering, disabled, inputValue, size, validateState, validateIcon, needStatusIcon, }: UseInputTagDomOptions): {
|
16
|
+
ns: {
|
17
|
+
namespace: ComputedRef<string>;
|
18
|
+
b: (blockSuffix?: string) => string;
|
19
|
+
e: (element?: string) => string;
|
20
|
+
m: (modifier?: string) => string;
|
21
|
+
be: (blockSuffix?: string, element?: string) => string;
|
22
|
+
em: (element?: string, modifier?: string) => string;
|
23
|
+
bm: (blockSuffix?: string, modifier?: string) => string;
|
24
|
+
bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
25
|
+
is: {
|
26
|
+
(name: string, state: boolean | undefined): string;
|
27
|
+
(name: string): string;
|
28
|
+
};
|
29
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
30
|
+
cssVarName: (name: string) => string;
|
31
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
32
|
+
cssVarBlockName: (name: string) => string;
|
33
|
+
};
|
34
|
+
nsInput: {
|
35
|
+
namespace: ComputedRef<string>;
|
36
|
+
b: (blockSuffix?: string) => string;
|
37
|
+
e: (element?: string) => string;
|
38
|
+
m: (modifier?: string) => string;
|
39
|
+
be: (blockSuffix?: string, element?: string) => string;
|
40
|
+
em: (element?: string, modifier?: string) => string;
|
41
|
+
bm: (blockSuffix?: string, modifier?: string) => string;
|
42
|
+
bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
43
|
+
is: {
|
44
|
+
(name: string, state: boolean | undefined): string;
|
45
|
+
(name: string): string;
|
46
|
+
};
|
47
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
48
|
+
cssVarName: (name: string) => string;
|
49
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
50
|
+
cssVarBlockName: (name: string) => string;
|
51
|
+
};
|
52
|
+
containerKls: ComputedRef<unknown[]>;
|
53
|
+
containerStyle: ComputedRef<StyleValue>;
|
54
|
+
innerKls: ComputedRef<string[]>;
|
55
|
+
showClear: ComputedRef<boolean | "" | 0 | undefined>;
|
56
|
+
showSuffix: ComputedRef<boolean | "" | import("vue").Slot>;
|
57
|
+
};
|
58
|
+
export {};
|
@@ -0,0 +1,61 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var vue = require('vue');
|
6
|
+
var index = require('../../../../hooks/use-namespace/index.js');
|
7
|
+
|
8
|
+
function useInputTagDom({
|
9
|
+
props,
|
10
|
+
isFocused,
|
11
|
+
hovering,
|
12
|
+
disabled,
|
13
|
+
inputValue,
|
14
|
+
size,
|
15
|
+
validateState,
|
16
|
+
validateIcon,
|
17
|
+
needStatusIcon
|
18
|
+
}) {
|
19
|
+
const attrs = vue.useAttrs();
|
20
|
+
const slots = vue.useSlots();
|
21
|
+
const ns = index.useNamespace("input-tag");
|
22
|
+
const nsInput = index.useNamespace("input");
|
23
|
+
const containerKls = vue.computed(() => [
|
24
|
+
ns.b(),
|
25
|
+
ns.is("focused", isFocused.value),
|
26
|
+
ns.is("hovering", hovering.value),
|
27
|
+
ns.is("disabled", disabled.value),
|
28
|
+
ns.m(size.value),
|
29
|
+
ns.e("wrapper"),
|
30
|
+
attrs.class
|
31
|
+
]);
|
32
|
+
const containerStyle = vue.computed(() => [attrs.style]);
|
33
|
+
const innerKls = vue.computed(() => {
|
34
|
+
var _a, _b;
|
35
|
+
return [
|
36
|
+
ns.e("inner"),
|
37
|
+
ns.is("draggable", props.draggable),
|
38
|
+
ns.is("left-space", !((_a = props.modelValue) == null ? void 0 : _a.length) && !slots.prefix),
|
39
|
+
ns.is("right-space", !((_b = props.modelValue) == null ? void 0 : _b.length) && !showSuffix.value)
|
40
|
+
];
|
41
|
+
});
|
42
|
+
const showClear = vue.computed(() => {
|
43
|
+
var _a;
|
44
|
+
return props.clearable && !disabled.value && !props.readonly && (((_a = props.modelValue) == null ? void 0 : _a.length) || inputValue.value) && (isFocused.value || hovering.value);
|
45
|
+
});
|
46
|
+
const showSuffix = vue.computed(() => {
|
47
|
+
return slots.suffix || showClear.value || validateState.value && validateIcon.value && needStatusIcon.value;
|
48
|
+
});
|
49
|
+
return {
|
50
|
+
ns,
|
51
|
+
nsInput,
|
52
|
+
containerKls,
|
53
|
+
containerStyle,
|
54
|
+
innerKls,
|
55
|
+
showClear,
|
56
|
+
showSuffix
|
57
|
+
};
|
58
|
+
}
|
59
|
+
|
60
|
+
exports.useInputTagDom = useInputTagDom;
|
61
|
+
//# sourceMappingURL=use-input-tag-dom.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-input-tag-dom.js","sources":["../../../../../../../packages/components/input-tag/src/composables/use-input-tag-dom.ts"],"sourcesContent":["import { computed, useAttrs, useSlots } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport type { ComputedRef, Ref, StyleValue } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { InputTagProps } from '../input-tag'\n\ninterface UseInputTagDomOptions {\n props: InputTagProps\n isFocused: Ref<boolean>\n hovering: Ref<boolean>\n disabled: ComputedRef<boolean>\n inputValue: Ref<string | undefined>\n size: ComputedRef<ComponentSize>\n validateState: ComputedRef<string>\n validateIcon: ComputedRef<boolean>\n needStatusIcon: ComputedRef<boolean>\n}\n\nexport function useInputTagDom({\n props,\n isFocused,\n hovering,\n disabled,\n inputValue,\n size,\n validateState,\n validateIcon,\n needStatusIcon,\n}: UseInputTagDomOptions) {\n const attrs = useAttrs()\n const slots = useSlots()\n const ns = useNamespace('input-tag')\n const nsInput = useNamespace('input')\n\n const containerKls = computed(() => [\n ns.b(),\n ns.is('focused', isFocused.value),\n ns.is('hovering', hovering.value),\n ns.is('disabled', disabled.value),\n ns.m(size.value),\n ns.e('wrapper'),\n attrs.class,\n ])\n const containerStyle = computed<StyleValue>(() => [attrs.style as StyleValue])\n const innerKls = computed(() => [\n ns.e('inner'),\n ns.is('draggable', props.draggable),\n ns.is('left-space', !props.modelValue?.length && !slots.prefix),\n ns.is('right-space', !props.modelValue?.length && !showSuffix.value),\n ])\n const showClear = computed(() => {\n return (\n props.clearable &&\n !disabled.value &&\n !props.readonly &&\n (props.modelValue?.length || inputValue.value) &&\n (isFocused.value || hovering.value)\n )\n })\n const showSuffix = computed(() => {\n return (\n slots.suffix ||\n showClear.value ||\n (validateState.value && validateIcon.value && needStatusIcon.value)\n )\n })\n\n return {\n ns,\n nsInput,\n containerKls,\n containerStyle,\n innerKls,\n showClear,\n showSuffix,\n }\n}\n"],"names":["useAttrs","useSlots","useNamespace","computed"],"mappings":";;;;;;;AAEO,SAAS,cAAc,CAAC;AAC/B,EAAE,KAAK;AACP,EAAE,SAAS;AACX,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,IAAI;AACN,EAAE,aA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KAAK,CAAC,MAAM,CAAC;AACnG,MAAM,EAAE,CAAC,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;AACxG,KAAK,CAAC;AACN,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,SAAS,GAAGA,YAAQ,CAAC,MAAM;AACnC,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,KAAK,CAAC,SAAS,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,KAAK,UAAU,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxL,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,UAAU,GAAGA,YAAQ,CAAC,MAAM;AACpC,IAAI,OAAO,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,IAAI,YAAY,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC;AAChH,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,EAAE;AACN,IAAI,OAAO;AACX,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,QAAQ;AACZ,IAAI,SAAS;AACb,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { type EmitFn } from '@element-plus/nightly/es/utils';
|
2
|
+
import { type FormItemContext } from '@element-plus/nightly/es/components/form';
|
3
|
+
import type { InputTagEmits, InputTagProps } from '../input-tag';
|
4
|
+
interface UseInputTagOptions {
|
5
|
+
props: InputTagProps;
|
6
|
+
emit: EmitFn<InputTagEmits>;
|
7
|
+
formItem?: FormItemContext;
|
8
|
+
}
|
9
|
+
export declare function useInputTag({ props, emit, formItem }: UseInputTagOptions): {
|
10
|
+
inputRef: import("vue").ShallowRef<HTMLInputElement | undefined>;
|
11
|
+
wrapperRef: import("vue").ShallowRef<HTMLElement | undefined>;
|
12
|
+
isFocused: import("vue").Ref<boolean>;
|
13
|
+
isComposing: import("vue").Ref<boolean>;
|
14
|
+
inputValue: import("vue").Ref<string | undefined>;
|
15
|
+
size: import("vue").ComputedRef<"" | "small" | "default" | "large">;
|
16
|
+
tagSize: import("vue").ComputedRef<"default" | "small">;
|
17
|
+
placeholder: import("vue").ComputedRef<string | undefined>;
|
18
|
+
closable: import("vue").ComputedRef<boolean>;
|
19
|
+
disabled: import("vue").ComputedRef<boolean>;
|
20
|
+
inputLimit: import("vue").ComputedRef<boolean>;
|
21
|
+
handleDragged: (draggingIndex: number, dropIndex: number, type: "before" | "after") => void;
|
22
|
+
handleInput: (event: Event) => void;
|
23
|
+
handleKeydown: (event: KeyboardEvent) => void;
|
24
|
+
handleAddTag: () => void;
|
25
|
+
handleRemoveTag: (index: number) => void;
|
26
|
+
handleClear: () => void;
|
27
|
+
handleCompositionStart: (event: CompositionEvent) => void;
|
28
|
+
handleCompositionUpdate: (event: CompositionEvent) => void;
|
29
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
30
|
+
focus: () => void;
|
31
|
+
blur: () => void;
|
32
|
+
};
|
33
|
+
export {};
|