@element-plus/nightly 0.0.20220117 → 0.0.20220118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +2196 -3407
- package/dist/index.full.min.js +8 -10
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -10
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2189 -3403
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/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/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/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/alert/index.d.ts +5 -5
- package/es/components/alert/src/alert.d.ts +1 -1
- package/es/components/alert/src/alert.vue.d.ts +5 -5
- package/es/components/avatar/index.d.ts +1 -1
- package/es/components/avatar/src/avatar.d.ts +3 -1
- package/es/components/avatar/src/avatar.mjs +1 -1
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar.vue.d.ts +1 -1
- package/es/components/avatar/src/avatar.vue_vue_type_script_lang.mjs +13 -8
- package/es/components/avatar/src/avatar.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/avatar/src/avatar.vue_vue_type_template_id_46e3f365_lang.mjs.map +1 -1
- package/es/components/button/index.d.ts +6 -0
- package/es/components/button/src/button-group.vue.d.ts +2 -0
- package/es/components/button/src/button.vue.d.ts +2 -0
- package/es/components/card/index.d.ts +13 -1
- package/es/components/card/src/card.d.ts +2 -0
- package/es/components/card/src/card.mjs.map +1 -1
- package/es/components/card/src/card.vue.d.ts +13 -1
- package/es/components/card/src/card.vue_vue_type_script_lang.mjs +9 -1
- package/es/components/card/src/card.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/card/src/card.vue_vue_type_template_id_7a6bdf05_lang.mjs +8 -9
- package/es/components/card/src/card.vue_vue_type_template_id_7a6bdf05_lang.mjs.map +1 -1
- package/es/components/cascader/index.d.ts +38 -34
- package/es/components/cascader/src/index.vue.d.ts +19 -17
- package/es/components/check-tag/index.d.ts +21 -9
- package/es/components/check-tag/index.mjs +3 -2
- package/es/components/check-tag/index.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag.d.ts +12 -0
- package/es/components/check-tag/src/check-tag.mjs +16 -0
- package/es/components/check-tag/src/check-tag.mjs.map +1 -0
- package/es/components/check-tag/src/check-tag.vue.d.ts +29 -0
- package/es/components/check-tag/src/check-tag.vue_vue_type_script_lang.mjs +25 -0
- package/es/components/check-tag/src/check-tag.vue_vue_type_script_lang.mjs.map +1 -0
- package/es/components/check-tag/src/{index.vue_vue_type_template_id_58558910_lang.mjs → check-tag.vue_vue_type_template_id_d949910a_lang.mjs} +2 -5
- package/es/components/check-tag/src/check-tag.vue_vue_type_template_id_d949910a_lang.mjs.map +1 -0
- package/es/components/check-tag/src/check-tag2.mjs +7 -0
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -0
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_script_lang.mjs +10 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_template_id_78e07aa7_lang.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_script_lang.mjs +12 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_template_id_62b45ab2_lang.mjs.map +1 -1
- package/es/components/descriptions/index.d.ts +4 -4
- package/es/components/descriptions/src/index.vue.d.ts +4 -4
- package/es/components/divider/index.d.ts +14 -1
- package/es/components/divider/src/divider.d.ts +2 -0
- package/es/components/divider/src/divider.mjs.map +1 -1
- package/es/components/divider/src/divider.vue.d.ts +15 -1
- package/es/components/divider/src/divider.vue_vue_type_script_lang.mjs +16 -2
- package/es/components/divider/src/divider.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/divider/src/divider.vue_vue_type_template_id_6ddd3543_lang.mjs +3 -3
- package/es/components/divider/src/divider.vue_vue_type_template_id_6ddd3543_lang.mjs.map +1 -1
- package/es/components/dropdown/index.d.ts +13 -11
- package/es/components/dropdown/src/dropdown.vue.d.ts +13 -11
- package/es/components/empty/index.d.ts +11 -0
- package/es/components/empty/src/empty.d.ts +2 -0
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/empty/src/empty.vue.d.ts +11 -0
- package/es/components/empty/src/empty.vue_vue_type_script_lang.mjs +3 -0
- package/es/components/empty/src/empty.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/empty/src/empty.vue_vue_type_template_id_10d211eb_lang.mjs +20 -19
- package/es/components/empty/src/empty.vue_vue_type_template_id_10d211eb_lang.mjs.map +1 -1
- package/es/components/icon/index.d.ts +11 -0
- package/es/components/icon/src/icon.d.ts +2 -0
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon.vue.d.ts +11 -0
- package/es/components/icon/src/icon.vue_vue_type_script_lang.mjs +14 -15
- package/es/components/icon/src/icon.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/icon/src/icon.vue_vue_type_template_id_89b755b6_lang.mjs +1 -1
- package/es/components/icon/src/icon.vue_vue_type_template_id_89b755b6_lang.mjs.map +1 -1
- package/es/components/image/src/image.vue_vue_type_script_lang.mjs +14 -3
- package/es/components/image/src/image.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/image/src/image.vue_vue_type_template_id_34467287_lang.mjs.map +1 -1
- package/es/components/index.mjs +2 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/input-number/src/input-number.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/input-number/src/input-number.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/input-number/src/input-number.vue_vue_type_template_id_dec60af6_lang.mjs.map +1 -1
- package/es/components/link/index.d.ts +11 -0
- package/es/components/link/src/link.d.ts +2 -0
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link.vue.d.ts +11 -0
- package/es/components/link/src/link.vue_vue_type_script_lang.mjs +4 -0
- package/es/components/link/src/link.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/link/src/link.vue_vue_type_template_id_6a422645_lang.mjs +7 -8
- package/es/components/link/src/link.vue_vue_type_template_id_6a422645_lang.mjs.map +1 -1
- package/es/components/menu/index.d.ts +2 -2
- package/es/components/menu/src/menu.d.ts +2 -2
- package/es/components/pagination/index.d.ts +2 -2
- package/es/components/pagination/src/pagination.d.ts +2 -2
- package/es/components/popover/index.d.ts +32 -26
- package/es/components/popover/src/index.vue.d.ts +16 -13
- package/es/components/popover/src/index.vue_vue_type_script_lang.mjs +6 -1
- package/es/components/popover/src/index.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/popover/src/index.vue_vue_type_template_id_15486cf0_lang.mjs.map +1 -1
- package/es/components/rate/index.d.ts +11 -0
- package/es/components/rate/src/rate.d.ts +2 -0
- package/es/components/rate/src/rate.mjs +1 -1
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate.vue.d.ts +11 -0
- package/es/components/rate/src/rate.vue_vue_type_script_lang.mjs +7 -5
- package/es/components/rate/src/rate.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.mjs +7 -7
- package/es/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.mjs.map +1 -1
- package/es/components/result/index.d.ts +11 -0
- package/es/components/result/src/result.d.ts +2 -0
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result.vue.d.ts +11 -0
- package/es/components/result/src/result.vue_vue_type_script_lang.mjs +4 -0
- package/es/components/result/src/result.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/result/src/result.vue_vue_type_template_id_263c10e5_lang.mjs +24 -25
- package/es/components/result/src/result.vue_vue_type_template_id_263c10e5_lang.mjs.map +1 -1
- package/es/components/row/index.d.ts +3 -3
- package/es/components/row/src/row.d.ts +7 -6
- package/es/components/row/src/row.mjs +9 -6
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/scrollbar/index.d.ts +2 -2
- package/es/components/scrollbar/src/bar.vue_vue_type_script_lang.mjs +11 -4
- package/es/components/scrollbar/src/bar.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/scrollbar/src/bar.vue_vue_type_template_id_2f63f10a_lang.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
- package/es/components/select/index.d.ts +15 -13
- package/es/components/select/src/select.vue.d.ts +15 -13
- package/es/components/select/src/useSelect.d.ts +13 -11
- package/es/components/select-v2/index.d.ts +38 -28
- package/es/components/select-v2/src/defaults.d.ts +4 -1
- package/es/components/select-v2/src/defaults.mjs +4 -1
- package/es/components/select-v2/src/defaults.mjs.map +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +19 -14
- package/es/components/select-v2/src/useSelect.d.ts +13 -11
- package/es/components/select-v2/src/useSelect.mjs +1 -1
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/space/index.d.ts +2 -2
- package/es/components/space/src/space.d.ts +2 -2
- package/es/components/steps/index.d.ts +2 -2
- package/es/components/steps/src/index.vue.d.ts +2 -2
- package/es/components/switch/index.d.ts +11 -0
- package/es/components/switch/src/switch.vue.d.ts +11 -0
- package/es/components/switch/src/switch.vue_vue_type_script_lang.mjs +5 -3
- package/es/components/switch/src/switch.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.mjs +21 -21
- package/es/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.mjs.map +1 -1
- package/es/components/table/index.d.ts +2 -2
- package/es/components/table/src/filter-panel.vue.d.ts +13 -11
- package/es/components/table/src/store/index.mjs +1 -1
- package/es/components/table/src/store/index.mjs.map +1 -1
- package/es/components/table/src/store/watcher.mjs +0 -5
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +2 -2
- package/es/components/table/src/util.mjs +1 -1
- package/es/components/table/src/util.mjs.map +1 -1
- package/es/components/tag/index.d.ts +3 -3
- package/es/components/tag/src/tag.d.ts +1 -1
- package/es/components/tag/src/tag.vue.d.ts +3 -3
- package/es/components/time-picker/src/common/picker.vue.d.ts +16 -12
- package/es/components/time-picker/src/common/picker.vue_vue_type_script_lang.mjs +12 -1
- package/es/components/time-picker/src/common/picker.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.mjs +5 -4
- package/es/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.mjs.map +1 -1
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -1
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_lang.mjs +10 -10
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_template_id_4fb3c576_lang.mjs +1 -1
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_template_id_4fb3c576_lang.mjs.map +1 -1
- package/es/components/timeline/index.d.ts +78 -106
- package/es/components/timeline/index.mjs +7 -7
- package/es/components/timeline/index.mjs.map +1 -1
- package/es/components/timeline/src/timeline-item.d.ts +15 -0
- package/es/components/timeline/src/timeline-item.mjs +43 -0
- package/es/components/timeline/src/timeline-item.mjs.map +1 -0
- package/es/components/timeline/src/timeline-item.vue.d.ts +54 -0
- package/es/components/timeline/src/timeline-item.vue_vue_type_script_lang.mjs +22 -0
- package/es/components/timeline/src/timeline-item.vue_vue_type_script_lang.mjs.map +1 -0
- package/es/components/timeline/src/timeline-item.vue_vue_type_template_id_1db6c36b_lang.mjs +60 -0
- package/es/components/timeline/src/timeline-item.vue_vue_type_template_id_1db6c36b_lang.mjs.map +1 -0
- package/es/components/timeline/src/timeline-item2.mjs +7 -0
- package/es/components/timeline/src/timeline-item2.mjs.map +1 -0
- package/es/components/timeline/src/{index.vue.d.ts → timeline.d.ts} +3 -2
- package/es/components/timeline/src/timeline.mjs +17 -0
- package/es/components/timeline/src/timeline.mjs.map +1 -0
- package/es/components/tooltip/index.d.ts +5 -4
- package/es/components/tooltip/src/content.vue.d.ts +4 -4
- package/es/components/tooltip/src/tooltip.vue.d.ts +5 -4
- package/es/components/tooltip/src/tooltip.vue_vue_type_script_lang.mjs +1 -0
- package/es/components/tooltip/src/tooltip.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.vue_vue_type_template_id_694d1617_lang.mjs.map +1 -1
- package/es/components/virtual-list/src/builders/build-list.d.ts +2 -2
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +2 -2
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +2 -2
- package/es/hooks/use-namespace/index.d.ts +2 -0
- package/es/hooks/use-namespace/index.mjs +16 -11
- package/es/hooks/use-namespace/index.mjs.map +1 -1
- package/es/index.mjs +2 -0
- 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/lib/components/alert/index.d.ts +5 -5
- package/lib/components/alert/src/alert.d.ts +1 -1
- package/lib/components/alert/src/alert.vue.d.ts +5 -5
- package/lib/components/avatar/index.d.ts +1 -1
- package/lib/components/avatar/src/avatar.d.ts +3 -1
- package/lib/components/avatar/src/avatar.js +1 -1
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar.vue.d.ts +1 -1
- package/lib/components/avatar/src/avatar.vue_vue_type_script_lang.js +13 -8
- package/lib/components/avatar/src/avatar.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/avatar/src/avatar.vue_vue_type_template_id_46e3f365_lang.js.map +1 -1
- package/lib/components/button/index.d.ts +6 -0
- package/lib/components/button/src/button-group.vue.d.ts +2 -0
- package/lib/components/button/src/button.vue.d.ts +2 -0
- package/lib/components/card/index.d.ts +13 -1
- package/lib/components/card/src/card.d.ts +2 -0
- package/lib/components/card/src/card.js.map +1 -1
- package/lib/components/card/src/card.vue.d.ts +13 -1
- package/lib/components/card/src/card.vue_vue_type_script_lang.js +9 -1
- package/lib/components/card/src/card.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/card/src/card.vue_vue_type_template_id_7a6bdf05_lang.js +8 -9
- package/lib/components/card/src/card.vue_vue_type_template_id_7a6bdf05_lang.js.map +1 -1
- package/lib/components/cascader/index.d.ts +38 -34
- package/lib/components/cascader/src/index.vue.d.ts +19 -17
- package/lib/components/check-tag/index.d.ts +21 -9
- package/lib/components/check-tag/index.js +6 -3
- package/lib/components/check-tag/index.js.map +1 -1
- package/lib/components/check-tag/src/check-tag.d.ts +12 -0
- package/lib/components/check-tag/src/check-tag.js +21 -0
- package/lib/components/check-tag/src/check-tag.js.map +1 -0
- package/lib/components/check-tag/src/check-tag.vue.d.ts +29 -0
- package/lib/components/check-tag/src/{index.vue_vue_type_script_lang.js → check-tag.vue_vue_type_script_lang.js} +8 -10
- package/lib/components/check-tag/src/check-tag.vue_vue_type_script_lang.js.map +1 -0
- package/lib/components/check-tag/src/{index.vue_vue_type_template_id_58558910_lang.js → check-tag.vue_vue_type_template_id_d949910a_lang.js} +2 -5
- package/lib/components/check-tag/src/check-tag.vue_vue_type_template_id_d949910a_lang.js.map +1 -0
- package/lib/components/check-tag/src/check-tag2.js +12 -0
- package/lib/components/check-tag/src/check-tag2.js.map +1 -0
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_script_lang.js +10 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_template_id_78e07aa7_lang.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_script_lang.js +12 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_template_id_62b45ab2_lang.js.map +1 -1
- package/lib/components/descriptions/index.d.ts +4 -4
- package/lib/components/descriptions/src/index.vue.d.ts +4 -4
- package/lib/components/divider/index.d.ts +14 -1
- package/lib/components/divider/src/divider.d.ts +2 -0
- package/lib/components/divider/src/divider.js.map +1 -1
- package/lib/components/divider/src/divider.vue.d.ts +15 -1
- package/lib/components/divider/src/divider.vue_vue_type_script_lang.js +15 -1
- package/lib/components/divider/src/divider.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/divider/src/divider.vue_vue_type_template_id_6ddd3543_lang.js +3 -3
- package/lib/components/divider/src/divider.vue_vue_type_template_id_6ddd3543_lang.js.map +1 -1
- package/lib/components/dropdown/index.d.ts +13 -11
- package/lib/components/dropdown/src/dropdown.vue.d.ts +13 -11
- package/lib/components/empty/index.d.ts +11 -0
- package/lib/components/empty/src/empty.d.ts +2 -0
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/empty/src/empty.vue.d.ts +11 -0
- package/lib/components/empty/src/empty.vue_vue_type_script_lang.js +3 -0
- package/lib/components/empty/src/empty.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/empty/src/empty.vue_vue_type_template_id_10d211eb_lang.js +19 -18
- package/lib/components/empty/src/empty.vue_vue_type_template_id_10d211eb_lang.js.map +1 -1
- package/lib/components/icon/index.d.ts +11 -0
- package/lib/components/icon/src/icon.d.ts +2 -0
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon.vue.d.ts +11 -0
- package/lib/components/icon/src/icon.vue_vue_type_script_lang.js +13 -14
- package/lib/components/icon/src/icon.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/icon/src/icon.vue_vue_type_template_id_89b755b6_lang.js +1 -1
- package/lib/components/icon/src/icon.vue_vue_type_template_id_89b755b6_lang.js.map +1 -1
- package/lib/components/image/src/image.vue_vue_type_script_lang.js +14 -3
- package/lib/components/image/src/image.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/image/src/image.vue_vue_type_template_id_34467287_lang.js.map +1 -1
- package/lib/components/index.js +5 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/input-number/src/input-number.vue_vue_type_script_lang.js +1 -1
- package/lib/components/input-number/src/input-number.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/input-number/src/input-number.vue_vue_type_template_id_dec60af6_lang.js.map +1 -1
- package/lib/components/link/index.d.ts +11 -0
- package/lib/components/link/src/link.d.ts +2 -0
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link.vue.d.ts +11 -0
- package/lib/components/link/src/link.vue_vue_type_script_lang.js +4 -0
- package/lib/components/link/src/link.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/link/src/link.vue_vue_type_template_id_6a422645_lang.js +7 -8
- package/lib/components/link/src/link.vue_vue_type_template_id_6a422645_lang.js.map +1 -1
- package/lib/components/menu/index.d.ts +2 -2
- package/lib/components/menu/src/menu.d.ts +2 -2
- package/lib/components/pagination/index.d.ts +2 -2
- package/lib/components/pagination/src/pagination.d.ts +2 -2
- package/lib/components/popover/index.d.ts +32 -26
- package/lib/components/popover/src/index.vue.d.ts +16 -13
- package/lib/components/popover/src/index.vue_vue_type_script_lang.js +6 -1
- package/lib/components/popover/src/index.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/popover/src/index.vue_vue_type_template_id_15486cf0_lang.js.map +1 -1
- package/lib/components/rate/index.d.ts +11 -0
- package/lib/components/rate/src/rate.d.ts +2 -0
- package/lib/components/rate/src/rate.js +1 -1
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate.vue.d.ts +11 -0
- package/lib/components/rate/src/rate.vue_vue_type_script_lang.js +7 -5
- package/lib/components/rate/src/rate.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.js +7 -7
- package/lib/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.js.map +1 -1
- package/lib/components/result/index.d.ts +11 -0
- package/lib/components/result/src/result.d.ts +2 -0
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result.vue.d.ts +11 -0
- package/lib/components/result/src/result.vue_vue_type_script_lang.js +4 -0
- package/lib/components/result/src/result.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/result/src/result.vue_vue_type_template_id_263c10e5_lang.js +23 -24
- package/lib/components/result/src/result.vue_vue_type_template_id_263c10e5_lang.js.map +1 -1
- package/lib/components/row/index.d.ts +3 -3
- package/lib/components/row/src/row.d.ts +7 -6
- package/lib/components/row/src/row.js +9 -6
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/scrollbar/index.d.ts +2 -2
- package/lib/components/scrollbar/src/bar.vue_vue_type_script_lang.js +10 -3
- package/lib/components/scrollbar/src/bar.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/scrollbar/src/bar.vue_vue_type_template_id_2f63f10a_lang.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
- package/lib/components/select/index.d.ts +15 -13
- package/lib/components/select/src/select.vue.d.ts +15 -13
- package/lib/components/select/src/useSelect.d.ts +13 -11
- package/lib/components/select-v2/index.d.ts +38 -28
- package/lib/components/select-v2/src/defaults.d.ts +4 -1
- package/lib/components/select-v2/src/defaults.js +4 -1
- package/lib/components/select-v2/src/defaults.js.map +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +19 -14
- package/lib/components/select-v2/src/useSelect.d.ts +13 -11
- package/lib/components/select-v2/src/useSelect.js +1 -1
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/space/index.d.ts +2 -2
- package/lib/components/space/src/space.d.ts +2 -2
- package/lib/components/steps/index.d.ts +2 -2
- package/lib/components/steps/src/index.vue.d.ts +2 -2
- package/lib/components/switch/index.d.ts +11 -0
- package/lib/components/switch/src/switch.vue.d.ts +11 -0
- package/lib/components/switch/src/switch.vue_vue_type_script_lang.js +5 -3
- package/lib/components/switch/src/switch.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.js +21 -21
- package/lib/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.js.map +1 -1
- package/lib/components/table/index.d.ts +2 -2
- package/lib/components/table/src/filter-panel.vue.d.ts +13 -11
- package/lib/components/table/src/store/index.js +1 -1
- package/lib/components/table/src/store/index.js.map +1 -1
- package/lib/components/table/src/store/watcher.js +0 -5
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +2 -2
- package/lib/components/table/src/util.js +1 -1
- package/lib/components/table/src/util.js.map +1 -1
- package/lib/components/tag/index.d.ts +3 -3
- package/lib/components/tag/src/tag.d.ts +1 -1
- package/lib/components/tag/src/tag.vue.d.ts +3 -3
- package/lib/components/time-picker/src/common/picker.vue.d.ts +16 -12
- package/lib/components/time-picker/src/common/picker.vue_vue_type_script_lang.js +12 -1
- package/lib/components/time-picker/src/common/picker.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.js +5 -4
- package/lib/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.js.map +1 -1
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -1
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_lang.js +10 -10
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_template_id_4fb3c576_lang.js +1 -1
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_template_id_4fb3c576_lang.js.map +1 -1
- package/lib/components/timeline/index.d.ts +78 -106
- package/lib/components/timeline/index.js +8 -7
- package/lib/components/timeline/index.js.map +1 -1
- package/lib/components/timeline/src/timeline-item.d.ts +15 -0
- package/lib/components/timeline/src/timeline-item.js +47 -0
- package/lib/components/timeline/src/timeline-item.js.map +1 -0
- package/lib/components/timeline/src/timeline-item.vue.d.ts +54 -0
- package/lib/components/timeline/src/timeline-item.vue_vue_type_script_lang.js +26 -0
- package/lib/components/timeline/src/timeline-item.vue_vue_type_script_lang.js.map +1 -0
- package/lib/components/timeline/src/timeline-item.vue_vue_type_template_id_1db6c36b_lang.js +64 -0
- package/lib/components/timeline/src/timeline-item.vue_vue_type_template_id_1db6c36b_lang.js.map +1 -0
- package/lib/components/timeline/src/timeline-item2.js +12 -0
- package/lib/components/timeline/src/timeline-item2.js.map +1 -0
- package/lib/components/timeline/src/{index.vue.d.ts → timeline.d.ts} +3 -2
- package/lib/components/timeline/src/timeline.js +21 -0
- package/lib/components/timeline/src/timeline.js.map +1 -0
- package/lib/components/tooltip/index.d.ts +5 -4
- package/lib/components/tooltip/src/content.vue.d.ts +4 -4
- package/lib/components/tooltip/src/tooltip.vue.d.ts +5 -4
- package/lib/components/tooltip/src/tooltip.vue_vue_type_script_lang.js +1 -0
- package/lib/components/tooltip/src/tooltip.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.vue_vue_type_template_id_694d1617_lang.js.map +1 -1
- package/lib/components/virtual-list/src/builders/build-list.d.ts +2 -2
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +2 -2
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +2 -2
- package/lib/hooks/use-namespace/index.d.ts +2 -0
- package/lib/hooks/use-namespace/index.js +16 -15
- package/lib/hooks/use-namespace/index.js.map +1 -1
- package/lib/index.js +5 -0
- 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-popper.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/popper.scss +1 -1
- package/web-types.json +1 -1
- package/es/components/check-tag/src/index.mjs +0 -7
- package/es/components/check-tag/src/index.mjs.map +0 -1
- package/es/components/check-tag/src/index.vue.d.ts +0 -26
- package/es/components/check-tag/src/index.vue_vue_type_script_lang.mjs +0 -26
- package/es/components/check-tag/src/index.vue_vue_type_script_lang.mjs.map +0 -1
- package/es/components/check-tag/src/index.vue_vue_type_template_id_58558910_lang.mjs.map +0 -1
- package/es/components/timeline/src/index.mjs +0 -5
- package/es/components/timeline/src/index.mjs.map +0 -1
- package/es/components/timeline/src/index.vue_vue_type_script_lang.mjs +0 -17
- package/es/components/timeline/src/index.vue_vue_type_script_lang.mjs.map +0 -1
- package/es/components/timeline/src/item.mjs +0 -7
- package/es/components/timeline/src/item.mjs.map +0 -1
- package/es/components/timeline/src/item.vue.d.ts +0 -70
- package/es/components/timeline/src/item.vue_vue_type_script_lang.mjs +0 -53
- package/es/components/timeline/src/item.vue_vue_type_script_lang.mjs.map +0 -1
- package/es/components/timeline/src/item.vue_vue_type_template_id_174d5b12_lang.mjs +0 -59
- package/es/components/timeline/src/item.vue_vue_type_template_id_174d5b12_lang.mjs.map +0 -1
- package/lib/components/check-tag/src/index.js +0 -13
- package/lib/components/check-tag/src/index.js.map +0 -1
- package/lib/components/check-tag/src/index.vue.d.ts +0 -26
- package/lib/components/check-tag/src/index.vue_vue_type_script_lang.js.map +0 -1
- package/lib/components/check-tag/src/index.vue_vue_type_template_id_58558910_lang.js.map +0 -1
- package/lib/components/timeline/src/index.js +0 -10
- package/lib/components/timeline/src/index.js.map +0 -1
- package/lib/components/timeline/src/index.vue_vue_type_script_lang.js +0 -21
- package/lib/components/timeline/src/index.vue_vue_type_script_lang.js.map +0 -1
- package/lib/components/timeline/src/item.js +0 -12
- package/lib/components/timeline/src/item.js.map +0 -1
- package/lib/components/timeline/src/item.vue.d.ts +0 -70
- package/lib/components/timeline/src/item.vue_vue_type_script_lang.js +0 -57
- package/lib/components/timeline/src/item.vue_vue_type_script_lang.js.map +0 -1
- package/lib/components/timeline/src/item.vue_vue_type_template_id_174d5b12_lang.js +0 -63
- package/lib/components/timeline/src/item.vue_vue_type_template_id_174d5b12_lang.js.map +0 -1
|
@@ -10,6 +10,7 @@ import '../../../hooks/index.mjs';
|
|
|
10
10
|
import { rateProps, rateEmits } from './rate.mjs';
|
|
11
11
|
import { elFormKey } from '../../../tokens/form.mjs';
|
|
12
12
|
import { useSize } from '../../../hooks/use-common-props/index.mjs';
|
|
13
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
13
14
|
|
|
14
15
|
function getValueFromMap(value, map) {
|
|
15
16
|
const isExcludedObject = (val) => isObject(val);
|
|
@@ -33,11 +34,11 @@ var script = defineComponent({
|
|
|
33
34
|
setup(props, { emit }) {
|
|
34
35
|
const elForm = inject(elFormKey, {});
|
|
35
36
|
const rateSize = useSize();
|
|
37
|
+
const ns = useNamespace("rate");
|
|
36
38
|
const currentValue = ref(props.modelValue);
|
|
37
39
|
const hoverIndex = ref(-1);
|
|
38
40
|
const pointerAtLeftHalf = ref(true);
|
|
39
|
-
const
|
|
40
|
-
const rateKls = computed(() => [prefix, `${prefix}--${rateSize.value}`]);
|
|
41
|
+
const rateKls = computed(() => [ns.b(), ns.m(rateSize.value)]);
|
|
41
42
|
const rateDisabled = computed(() => props.disabled || elForm.disabled);
|
|
42
43
|
const text = computed(() => {
|
|
43
44
|
let result = "";
|
|
@@ -147,10 +148,10 @@ var script = defineComponent({
|
|
|
147
148
|
}
|
|
148
149
|
if (props.allowHalf) {
|
|
149
150
|
let target = event.target;
|
|
150
|
-
if (hasClass(target, "
|
|
151
|
-
target = target.querySelector(
|
|
151
|
+
if (hasClass(target, ns.e("item"))) {
|
|
152
|
+
target = target.querySelector(`.${ns.e("icon")}`);
|
|
152
153
|
}
|
|
153
|
-
if (target.clientWidth === 0 || hasClass(target, "
|
|
154
|
+
if (target.clientWidth === 0 || hasClass(target, ns.e("decimal"))) {
|
|
154
155
|
target = target.parentNode;
|
|
155
156
|
}
|
|
156
157
|
pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth;
|
|
@@ -178,6 +179,7 @@ var script = defineComponent({
|
|
|
178
179
|
emit(UPDATE_MODEL_EVENT, 0);
|
|
179
180
|
}
|
|
180
181
|
return {
|
|
182
|
+
ns,
|
|
181
183
|
hoverIndex,
|
|
182
184
|
currentValue,
|
|
183
185
|
rateDisabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate.vue_vue_type_script_lang.mjs","sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { useSize } from '@element-plus/hooks'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const rateSize = useSize()\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const prefix = 'el-rate'\n const rateKls = computed(() => [prefix, `${prefix}--${rateSize.value}`])\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n let target = event.target as HTMLElement\n if (hasClass(target, 'el-rate__item')) {\n target = target.querySelector('.el-rate__icon')!\n }\n if (target.clientWidth === 0 || hasClass(target, 'el-rate__decimal')) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n rateKls,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"rate.vue_vue_type_script_lang.mjs","sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[ns.e('icon'), { hover: hoverIndex === item }]\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n :class=\"[ns.e('icon'), ns.e('decimal')]\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n :class=\"ns.e('text')\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { useNamespace, useSize } from '@element-plus/hooks'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n const rateSize = useSize()\n const ns = useNamespace('rate')\n\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const rateKls = computed(() => [ns.b(), ns.m(rateSize.value)])\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n // TODO: use cache via computed https://github.com/element-plus/element-plus/pull/5456#discussion_r786472092\n let target = event.target as HTMLElement\n if (hasClass(target, ns.e('item'))) {\n target = target.querySelector(`.${ns.e('icon')}`)!\n }\n if (target.clientWidth === 0 || hasClass(target, ns.e('decimal'))) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n ns,\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n rateKls,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqDA,SAAS,eAAe,CAAC,UAAU;AACnC,EAAE,sBAAsB,GAAG,CAAC,gBAAgB;AAC5C,EAAE,MAAM,WAAW,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG;;AAExD,IAAI,MAAM,QAAQ,GAAG;IACjB,OAAO;GACR,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE;AAC1B,EAAE;EACA,OAAO,gBAAgB;;aAEV,eAAe,CAAC;;EAE7B,UAAU,EAAE;IACV,MAAM;IACN,UAAU;QACN;;OAED,EAAE,SAAS;;OAEX,CAAC,OAAO,EAAE,QAAQ;IACrB,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,OAAO,EAAE,CAAC;AAC/B;;AAEA,IAAI,MAAM,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM,IAAI;MACR;;cAEQ,GAAG;OACV,MAAM,IAAI;;OAEV;MACD,OAAO,MAAM,CAAC;KACf,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,QAAQ,CAAC;;MAE5B,CAAC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;MACrC,CAAC,KAAK,CAAC,aAAa,GAAG;MACvB,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;;IAE9B,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,eAAe,CAAC;;MAEjD,IAAI,KAAK,GAAG,EAAE,CAAC;MACf,IAAI,YAAY,CAAC,OAAO;QACtB,KAAK,IAAI,EAAE;OACZ,MAAM,IAAI,KAAK,CAAC;QACf,KAAK,QAAQ,CAAC;;aAET;QACL;QACA,KAAK;QACL;MACF;UACI;;MAEJ,CAAC,KAAK,CAAC,aAAa,GAAG;aAChB,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE;;OAEtB;MACD,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC;QACjB;8BACsB,WAAW,CAAC,MAAM;uBACzB,GAAG,SAAS,MAAM,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;yBAC3C,GAAG,QAAQ,CAAC;UAC3B;YACE,MAAM,GAAG;;MAEf,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;MAC5B,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC;;KAEnD,CAAC,CAAC;aACM;MACP,MAAM,gBAAgB;YAChB,iBAAiB,GAAG,KAAK,CAAC;MAChC,OAAO,gBAAgB;;;MAGvB;aACO;QACL,KAAK;;KAER;IACD,SAAS,YAAY,KAAK,EAAE;MAC1B,IAAI,YAAY,CAAC;QACf;;eAEO,CAAC,SAAS,IAAI;+BACE,EAAE;iBAChB,CAAC,UAAU;;;;QAIpB,IAAI,CAAC;;UAEH,IAAI,CAAC,QAAQ,EAAE,MAAM;SACtB;;KAEJ;aACQ,SAAS,CAAC;;QAEf,OAAO;OACR;;MAED,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI;MACnB,IAAI,IAAI,KAAK,UAAU,CAAC,EAAE,IAAI;QAC5B,IAAI,KAAK,CAAC,SAAS,EAAE;UACnB,aAAa,IAAI,GAAG,CAAC;SACtB,MAAM;UACL;;;QAGF,CAAC,CAAC,cAAc,EAAE,CAAC;OACpB,MAAM,IAAI,IAAI,KAAK;QAClB,IAAI,KAAK,CAAC,SAAS;UACjB,aAAa,IAAI,IAAI;SACtB,MAAM;UACL,aAAa,IAAI,CAAC,CAAC;SACpB;QACD,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,cAAc,EAAE,CAAC;;mBAER,GAAG;MAChB,aAAa,GAAG,aAAa,GAAG,KAAK,CAAC,GAAG;;;MAGzC,OAAO,aAAa,CAAC;;aAEd,eAAe,CAAC;UACnB,YAAY,CAAC;QACf;;MAEF;;;UAGI,MAAM,GAAG,MAAM,CAAC,cAAc;SAC/B;QACD,IAAI;;SAEH;QACD,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC;QAC3C,YAAY,CAAC,KAAK,GAAG,iBAAiB,CAAC;aAClC;QACL;;gBAEQ,CAAC,KAAK,GAAG,KAAK,CAAC;;aAElB,iBAAiB;;;;;QAKtB,kBAAkB,KAAK,GAAG,KAAK;OAChC;;MAED;;SAEG,CAAC,WAAW,CAAC;MAChB,aAAa,KAAK,GAAG,GAAG,CAAC;uBACR,CAAC,KAAK;;QAErB,OAAO;UACL,CAAC;;WAEA;QACH;MACF,UAAU;kBACE;kBACA;UACR;kBACQ;;oBAEE;aACP;MACP;MACA,YAAY;MACZ,WAAW;MACX,SAAS;MACT,eAAe;MACf,iBAAiB;;;;;;;"}
|
|
@@ -17,14 +17,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
17
17
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.max, (item, key) => {
|
|
18
18
|
return openBlock(), createElementBlock("span", {
|
|
19
19
|
key,
|
|
20
|
-
class: "
|
|
20
|
+
class: normalizeClass(_ctx.ns.e("item")),
|
|
21
21
|
style: normalizeStyle({ cursor: _ctx.rateDisabled ? "auto" : "pointer" }),
|
|
22
22
|
onMousemove: ($event) => _ctx.setCurrentValue(item, $event),
|
|
23
23
|
onMouseleave: _cache[0] || (_cache[0] = (...args) => _ctx.resetCurrentValue && _ctx.resetCurrentValue(...args)),
|
|
24
24
|
onClick: ($event) => _ctx.selectValue(item)
|
|
25
25
|
}, [
|
|
26
26
|
createVNode(_component_el_icon, {
|
|
27
|
-
class: normalizeClass([
|
|
27
|
+
class: normalizeClass([_ctx.ns.e("icon"), { hover: _ctx.hoverIndex === item }]),
|
|
28
28
|
style: normalizeStyle(_ctx.getIconStyle(item))
|
|
29
29
|
}, {
|
|
30
30
|
default: withCtx(() => [
|
|
@@ -32,23 +32,23 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
32
32
|
_ctx.showDecimalIcon(item) ? (openBlock(), createBlock(_component_el_icon, {
|
|
33
33
|
key: 0,
|
|
34
34
|
style: normalizeStyle(_ctx.decimalStyle),
|
|
35
|
-
class: "
|
|
35
|
+
class: normalizeClass([_ctx.ns.e("icon"), _ctx.ns.e("decimal")])
|
|
36
36
|
}, {
|
|
37
37
|
default: withCtx(() => [
|
|
38
38
|
(openBlock(), createBlock(resolveDynamicComponent(_ctx.decimalIconComponent)))
|
|
39
39
|
]),
|
|
40
40
|
_: 1
|
|
41
|
-
}, 8, ["style"])) : createCommentVNode("v-if", true)
|
|
41
|
+
}, 8, ["style", "class"])) : createCommentVNode("v-if", true)
|
|
42
42
|
]),
|
|
43
43
|
_: 2
|
|
44
44
|
}, 1032, ["class", "style"])
|
|
45
|
-
],
|
|
45
|
+
], 46, _hoisted_2);
|
|
46
46
|
}), 128)),
|
|
47
47
|
_ctx.showText || _ctx.showScore ? (openBlock(), createElementBlock("span", {
|
|
48
48
|
key: 0,
|
|
49
|
-
class: "
|
|
49
|
+
class: normalizeClass(_ctx.ns.e("text")),
|
|
50
50
|
style: normalizeStyle({ color: _ctx.textColor })
|
|
51
|
-
}, toDisplayString(_ctx.text),
|
|
51
|
+
}, toDisplayString(_ctx.text), 7)) : createCommentVNode("v-if", true)
|
|
52
52
|
], 42, _hoisted_1);
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate.vue_vue_type_template_id_38c42df6_lang.mjs","sources":["../../../../../../packages/components/rate/src/rate.vue?vue&type=template&id=38c42df6&lang.js"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"
|
|
1
|
+
{"version":3,"file":"rate.vue_vue_type_template_id_38c42df6_lang.mjs","sources":["../../../../../../packages/components/rate/src/rate.vue?vue&type=template&id=38c42df6&lang.js"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[ns.e('icon'), { hover: hoverIndex === item }]\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n :class=\"[ns.e('icon'), ns.e('decimal')]\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n :class=\"ns.e('text')\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { useNamespace, useSize } from '@element-plus/hooks'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n const rateSize = useSize()\n const ns = useNamespace('rate')\n\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const rateKls = computed(() => [ns.b(), ns.m(rateSize.value)])\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n // TODO: use cache via computed https://github.com/element-plus/element-plus/pull/5456#discussion_r786472092\n let target = event.target as HTMLElement\n if (hasClass(target, ns.e('item'))) {\n target = target.querySelector(`.${ns.e('icon')}`)!\n }\n if (target.clientWidth === 0 || hasClass(target, ns.e('decimal'))) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n ns,\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n rateKls,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":["_openBlock","_createVNode"],"mappings":";;;;;;;;;;IAEK,uBAAO;IACR;IACC,eAAa,EAAE;IACf;IACD,iBAAc;;;aAGNA,wCAAE;;;;QAIP;QACA,uBAAO;QACP;;QAEAC,WAAU;eACL,4BAAa;;;UAGhB,uBAAQ;;;;;qCAKmB;;;;;;oCAI1B;;;;;;;;;;;KAKE;;;;;"}
|
|
@@ -3,6 +3,17 @@ export declare const ElResult: import("../../utils/types").SFCWithInstall<import
|
|
|
3
3
|
readonly subTitle: import("../../utils/props").BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
4
4
|
readonly icon: import("../../utils/props").BuildPropReturn<unknown, "info", unknown, "success" | "warning" | "info" | "error", unknown>;
|
|
5
5
|
}, {
|
|
6
|
+
ns: {
|
|
7
|
+
namespace: import("vue").ComputedRef<string>;
|
|
8
|
+
b: (blockSuffix?: string) => string;
|
|
9
|
+
e: (element?: string | undefined) => string;
|
|
10
|
+
m: (modifier?: string | undefined) => string;
|
|
11
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
12
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
13
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
14
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
15
|
+
is: (name: string, state?: boolean) => string;
|
|
16
|
+
};
|
|
6
17
|
resultIcon: import("vue").ComputedRef<{
|
|
7
18
|
class: "icon-success" | "icon-warning" | "icon-error" | "icon-info";
|
|
8
19
|
component: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Component, ExtractPropTypes } from 'vue';
|
|
2
|
+
import type Result from './result.vue';
|
|
2
3
|
export declare const IconMap: {
|
|
3
4
|
readonly success: "icon-success";
|
|
4
5
|
readonly warning: "icon-warning";
|
|
@@ -12,3 +13,4 @@ export declare const resultProps: {
|
|
|
12
13
|
readonly icon: import("element-plus/es/utils/props").BuildPropReturn<unknown, "info", unknown, "success" | "warning" | "info" | "error", unknown>;
|
|
13
14
|
};
|
|
14
15
|
export declare type ResultProps = ExtractPropTypes<typeof resultProps>;
|
|
16
|
+
export declare type ResultInstance = InstanceType<typeof Result>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.mjs","sources":["../../../../../../packages/components/result/src/result.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils/props'\nimport {\n WarningFilled,\n CircleCheckFilled,\n CircleCloseFilled,\n InfoFilled,\n} from '@element-plus/icons-vue'\nimport type { Component, ExtractPropTypes } from 'vue'\n\nexport const IconMap = {\n success: 'icon-success',\n warning: 'icon-warning',\n error: 'icon-error',\n info: 'icon-info',\n} as const\n\nexport const IconComponentMap: Record<\n typeof IconMap[keyof typeof IconMap],\n Component\n> = {\n [IconMap.success]: CircleCheckFilled,\n [IconMap.warning]: WarningFilled,\n [IconMap.error]: CircleCloseFilled,\n [IconMap.info]: InfoFilled,\n}\n\nexport const resultProps = buildProps({\n title: {\n type: String,\n default: '',\n },\n subTitle: {\n type: String,\n default: '',\n },\n icon: {\n values: ['success', 'warning', 'info', 'error'],\n default: 'info',\n },\n} as const)\n\nexport type ResultProps = ExtractPropTypes<typeof resultProps>\n"],"names":[],"mappings":";;;AAOY,MAAC,OAAO,GAAG;AACvB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,KAAK,EAAE,YAAY;AACrB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE;AACU,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,iBAAiB;AACtC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,aAAa;AAClC,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,iBAAiB;AACpC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,UAAU;AAC5B,EAAE;AACU,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AACnD,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"result.mjs","sources":["../../../../../../packages/components/result/src/result.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils/props'\nimport {\n WarningFilled,\n CircleCheckFilled,\n CircleCloseFilled,\n InfoFilled,\n} from '@element-plus/icons-vue'\nimport type { Component, ExtractPropTypes } from 'vue'\nimport type Result from './result.vue'\n\nexport const IconMap = {\n success: 'icon-success',\n warning: 'icon-warning',\n error: 'icon-error',\n info: 'icon-info',\n} as const\n\nexport const IconComponentMap: Record<\n typeof IconMap[keyof typeof IconMap],\n Component\n> = {\n [IconMap.success]: CircleCheckFilled,\n [IconMap.warning]: WarningFilled,\n [IconMap.error]: CircleCloseFilled,\n [IconMap.info]: InfoFilled,\n}\n\nexport const resultProps = buildProps({\n title: {\n type: String,\n default: '',\n },\n subTitle: {\n type: String,\n default: '',\n },\n icon: {\n values: ['success', 'warning', 'info', 'error'],\n default: 'info',\n },\n} as const)\n\nexport type ResultProps = ExtractPropTypes<typeof resultProps>\n\nexport type ResultInstance = InstanceType<typeof Result>\n"],"names":[],"mappings":";;;AAOY,MAAC,OAAO,GAAG;AACvB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,KAAK,EAAE,YAAY;AACrB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE;AACU,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,iBAAiB;AACtC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,aAAa;AAClC,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,iBAAiB;AACpC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,UAAU;AAC5B,EAAE;AACU,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AACnD,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -3,6 +3,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3
3
|
readonly subTitle: import("../../../utils/props").BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
4
4
|
readonly icon: import("../../../utils/props").BuildPropReturn<unknown, "info", unknown, "success" | "warning" | "info" | "error", unknown>;
|
|
5
5
|
}, {
|
|
6
|
+
ns: {
|
|
7
|
+
namespace: import("vue").ComputedRef<string>;
|
|
8
|
+
b: (blockSuffix?: string) => string;
|
|
9
|
+
e: (element?: string | undefined) => string;
|
|
10
|
+
m: (modifier?: string | undefined) => string;
|
|
11
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
12
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
13
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
14
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
15
|
+
is: (name: string, state?: boolean) => string;
|
|
16
|
+
};
|
|
6
17
|
resultIcon: import("vue").ComputedRef<{
|
|
7
18
|
class: "icon-success" | "icon-warning" | "icon-error" | "icon-info";
|
|
8
19
|
component: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { defineComponent, computed } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
2
3
|
import { resultProps, IconMap, IconComponentMap } from './result.mjs';
|
|
4
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
3
5
|
|
|
4
6
|
var script = defineComponent({
|
|
5
7
|
name: "ElResult",
|
|
6
8
|
props: resultProps,
|
|
7
9
|
setup(props) {
|
|
10
|
+
const ns = useNamespace("result");
|
|
8
11
|
const resultIcon = computed(() => {
|
|
9
12
|
const icon = props.icon;
|
|
10
13
|
const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info";
|
|
@@ -15,6 +18,7 @@ var script = defineComponent({
|
|
|
15
18
|
};
|
|
16
19
|
});
|
|
17
20
|
return {
|
|
21
|
+
ns,
|
|
18
22
|
resultIcon
|
|
19
23
|
};
|
|
20
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.vue_vue_type_script_lang.mjs","sources":["../../../../../../packages/components/result/src/result.vue"],"sourcesContent":["<template>\n <div class=\"
|
|
1
|
+
{"version":3,"file":"result.vue_vue_type_script_lang.mjs","sources":["../../../../../../packages/components/result/src/result.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('icon')\">\n <slot name=\"icon\">\n <component\n :is=\"resultIcon.component\"\n v-if=\"resultIcon.component\"\n :class=\"resultIcon.class\"\n />\n </slot>\n </div>\n <div v-if=\"title || $slots.title\" :class=\"ns.e('title')\">\n <slot name=\"title\">\n <p>{{ title }}</p>\n </slot>\n </div>\n <div v-if=\"subTitle || $slots.subTitle\" :class=\"ns.e('subtitle')\">\n <slot name=\"subTitle\">\n <p>{{ subTitle }}</p>\n </slot>\n </div>\n <div v-if=\"$slots.extra\" :class=\"ns.e('extra')\">\n <slot name=\"extra\"></slot>\n </div>\n </div>\n</template>\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { resultProps, IconComponentMap, IconMap } from './result'\n\nexport default defineComponent({\n name: 'ElResult',\n props: resultProps,\n setup(props) {\n const ns = useNamespace('result')\n\n const resultIcon = computed(() => {\n const icon = props.icon\n const iconClass = icon && IconMap[icon] ? IconMap[icon] : 'icon-info'\n const iconComponent =\n IconComponentMap[iconClass] || IconComponentMap['icon-info']\n\n return {\n class: iconClass,\n component: iconComponent,\n }\n })\n\n return {\n ns,\n resultIcon,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;AA6BA,aAAe,eAAe,CAAC;;AAE/B,EAAE,KAAK,EAAE,WAAW;EAClB,MAAM,KAAK,EAAE;IACX,MAAM,EAAE,GAAG;IACX,MAAM;MACJ,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;;MAExB,MAAM,aAAa,GAAG;MACtB,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE;QACX;;WAEG;QACH;gBACQ;MACV;;;;;;"}
|
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
import { openBlock, createElementBlock, createElementVNode, renderSlot, createBlock, resolveDynamicComponent,
|
|
1
|
+
import { openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, toDisplayString } from 'vue';
|
|
2
2
|
|
|
3
|
-
const _hoisted_1 = { class: "el-result" };
|
|
4
|
-
const _hoisted_2 = { class: "el-result__icon" };
|
|
5
|
-
const _hoisted_3 = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "el-result__title"
|
|
8
|
-
};
|
|
9
|
-
const _hoisted_4 = {
|
|
10
|
-
key: 1,
|
|
11
|
-
class: "el-result__subtitle"
|
|
12
|
-
};
|
|
13
|
-
const _hoisted_5 = {
|
|
14
|
-
key: 2,
|
|
15
|
-
class: "el-result__extra"
|
|
16
|
-
};
|
|
17
3
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18
|
-
return openBlock(), createElementBlock("div",
|
|
19
|
-
|
|
4
|
+
return openBlock(), createElementBlock("div", {
|
|
5
|
+
class: normalizeClass(_ctx.ns.b())
|
|
6
|
+
}, [
|
|
7
|
+
createElementVNode("div", {
|
|
8
|
+
class: normalizeClass(_ctx.ns.e("icon"))
|
|
9
|
+
}, [
|
|
20
10
|
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
21
11
|
_ctx.resultIcon.component ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.resultIcon.component), {
|
|
22
12
|
key: 0,
|
|
23
13
|
class: normalizeClass(_ctx.resultIcon.class)
|
|
24
14
|
}, null, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
25
15
|
])
|
|
26
|
-
]),
|
|
27
|
-
_ctx.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div",
|
|
16
|
+
], 2),
|
|
17
|
+
_ctx.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: normalizeClass(_ctx.ns.e("title"))
|
|
20
|
+
}, [
|
|
28
21
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
29
22
|
createElementVNode("p", null, toDisplayString(_ctx.title), 1)
|
|
30
23
|
])
|
|
31
|
-
])) : createCommentVNode("v-if", true),
|
|
32
|
-
_ctx.subTitle || _ctx.$slots.subTitle ? (openBlock(), createElementBlock("div",
|
|
24
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
25
|
+
_ctx.subTitle || _ctx.$slots.subTitle ? (openBlock(), createElementBlock("div", {
|
|
26
|
+
key: 1,
|
|
27
|
+
class: normalizeClass(_ctx.ns.e("subtitle"))
|
|
28
|
+
}, [
|
|
33
29
|
renderSlot(_ctx.$slots, "subTitle", {}, () => [
|
|
34
30
|
createElementVNode("p", null, toDisplayString(_ctx.subTitle), 1)
|
|
35
31
|
])
|
|
36
|
-
])) : createCommentVNode("v-if", true),
|
|
37
|
-
_ctx.$slots.extra ? (openBlock(), createElementBlock("div",
|
|
32
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
33
|
+
_ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
|
|
34
|
+
key: 2,
|
|
35
|
+
class: normalizeClass(_ctx.ns.e("extra"))
|
|
36
|
+
}, [
|
|
38
37
|
renderSlot(_ctx.$slots, "extra")
|
|
39
|
-
])) : createCommentVNode("v-if", true)
|
|
40
|
-
]);
|
|
38
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
39
|
+
], 2);
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
export { render };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.vue_vue_type_template_id_263c10e5_lang.mjs","sources":["../../../../../../packages/components/result/src/result.vue?vue&type=template&id=263c10e5&lang.js"],"sourcesContent":["<template>\n <div class=\"
|
|
1
|
+
{"version":3,"file":"result.vue_vue_type_template_id_263c10e5_lang.mjs","sources":["../../../../../../packages/components/result/src/result.vue?vue&type=template&id=263c10e5&lang.js"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('icon')\">\n <slot name=\"icon\">\n <component\n :is=\"resultIcon.component\"\n v-if=\"resultIcon.component\"\n :class=\"resultIcon.class\"\n />\n </slot>\n </div>\n <div v-if=\"title || $slots.title\" :class=\"ns.e('title')\">\n <slot name=\"title\">\n <p>{{ title }}</p>\n </slot>\n </div>\n <div v-if=\"subTitle || $slots.subTitle\" :class=\"ns.e('subtitle')\">\n <slot name=\"subTitle\">\n <p>{{ subTitle }}</p>\n </slot>\n </div>\n <div v-if=\"$slots.extra\" :class=\"ns.e('extra')\">\n <slot name=\"extra\"></slot>\n </div>\n </div>\n</template>\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { resultProps, IconComponentMap, IconMap } from './result'\n\nexport default defineComponent({\n name: 'ElResult',\n props: resultProps,\n setup(props) {\n const ns = useNamespace('result')\n\n const resultIcon = computed(() => {\n const icon = props.icon\n const iconClass = icon && IconMap[icon] ? IconMap[icon] : 'icon-info'\n const iconComponent =\n IconComponentMap[iconClass] || IconComponentMap['icon-info']\n\n return {\n class: iconClass,\n component: iconComponent,\n }\n })\n\n return {\n ns,\n resultIcon,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;KAWe;sBAAX;;;;;YAEI;;;;gCAGyB;;;eAAiB;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const ElRow: import("../../utils/types").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
2
|
readonly tag: import("../../utils/props").BuildPropReturn<StringConstructor, "div", unknown, unknown, unknown>;
|
|
3
3
|
readonly gutter: import("../../utils/props").BuildPropReturn<NumberConstructor, 0, unknown, unknown, unknown>;
|
|
4
|
-
readonly justify: import("../../utils/props").BuildPropReturn<StringConstructor, "start", unknown, "
|
|
4
|
+
readonly justify: import("../../utils/props").BuildPropReturn<StringConstructor, "start", unknown, "center" | "space-around" | "space-between" | "end" | "start", unknown>;
|
|
5
5
|
readonly align: import("../../utils/props").BuildPropReturn<StringConstructor, "top", unknown, "top" | "bottom" | "middle", unknown>;
|
|
6
6
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
7
7
|
[key: string]: any;
|
|
@@ -12,12 +12,12 @@ export declare const ElRow: import("../../utils/types").SFCWithInstall<import("v
|
|
|
12
12
|
readonly align?: unknown;
|
|
13
13
|
} & {
|
|
14
14
|
align: import("../../utils/props").BuildPropType<StringConstructor, "top" | "bottom" | "middle", unknown>;
|
|
15
|
-
justify: import("../../utils/props").BuildPropType<StringConstructor, "
|
|
15
|
+
justify: import("../../utils/props").BuildPropType<StringConstructor, "center" | "space-around" | "space-between" | "end" | "start", unknown>;
|
|
16
16
|
tag: string;
|
|
17
17
|
gutter: number;
|
|
18
18
|
} & {}>, {
|
|
19
19
|
align: import("../../utils/props").BuildPropType<StringConstructor, "top" | "bottom" | "middle", unknown>;
|
|
20
|
-
justify: import("../../utils/props").BuildPropType<StringConstructor, "
|
|
20
|
+
justify: import("../../utils/props").BuildPropType<StringConstructor, "center" | "space-around" | "space-between" | "end" | "start", unknown>;
|
|
21
21
|
tag: string;
|
|
22
22
|
gutter: number;
|
|
23
23
|
}>> & Record<string, any>;
|
|
@@ -2,14 +2,14 @@ import type { ExtractPropTypes } from 'vue';
|
|
|
2
2
|
export declare const rowProps: {
|
|
3
3
|
readonly tag: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "div", unknown, unknown, unknown>;
|
|
4
4
|
readonly gutter: import("element-plus/es/utils/props").BuildPropReturn<NumberConstructor, 0, unknown, unknown, unknown>;
|
|
5
|
-
readonly justify: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "start", unknown, "
|
|
5
|
+
readonly justify: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "start", unknown, "center" | "space-around" | "space-between" | "end" | "start", unknown>;
|
|
6
6
|
readonly align: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "top", unknown, "top" | "bottom" | "middle", unknown>;
|
|
7
7
|
};
|
|
8
8
|
export declare type RowProps = ExtractPropTypes<typeof rowProps>;
|
|
9
|
-
declare const
|
|
9
|
+
declare const Row: import("vue").DefineComponent<{
|
|
10
10
|
readonly tag: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "div", unknown, unknown, unknown>;
|
|
11
11
|
readonly gutter: import("element-plus/es/utils/props").BuildPropReturn<NumberConstructor, 0, unknown, unknown, unknown>;
|
|
12
|
-
readonly justify: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "start", unknown, "
|
|
12
|
+
readonly justify: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "start", unknown, "center" | "space-around" | "space-between" | "end" | "start", unknown>;
|
|
13
13
|
readonly align: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "top", unknown, "top" | "bottom" | "middle", unknown>;
|
|
14
14
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
15
15
|
[key: string]: any;
|
|
@@ -20,13 +20,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
20
20
|
readonly align?: unknown;
|
|
21
21
|
} & {
|
|
22
22
|
align: import("element-plus/es/utils/props").BuildPropType<StringConstructor, "top" | "bottom" | "middle", unknown>;
|
|
23
|
-
justify: import("element-plus/es/utils/props").BuildPropType<StringConstructor, "
|
|
23
|
+
justify: import("element-plus/es/utils/props").BuildPropType<StringConstructor, "center" | "space-around" | "space-between" | "end" | "start", unknown>;
|
|
24
24
|
tag: string;
|
|
25
25
|
gutter: number;
|
|
26
26
|
} & {}>, {
|
|
27
27
|
align: import("element-plus/es/utils/props").BuildPropType<StringConstructor, "top" | "bottom" | "middle", unknown>;
|
|
28
|
-
justify: import("element-plus/es/utils/props").BuildPropType<StringConstructor, "
|
|
28
|
+
justify: import("element-plus/es/utils/props").BuildPropType<StringConstructor, "center" | "space-around" | "space-between" | "end" | "start", unknown>;
|
|
29
29
|
tag: string;
|
|
30
30
|
gutter: number;
|
|
31
31
|
}>;
|
|
32
|
-
export default
|
|
32
|
+
export default Row;
|
|
33
|
+
export declare type RowInstance = InstanceType<typeof Row>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed, provide, h } from 'vue';
|
|
2
2
|
import { buildProps } from '../../../utils/props.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
3
5
|
|
|
4
6
|
const rowProps = buildProps({
|
|
5
7
|
tag: {
|
|
@@ -21,30 +23,31 @@ const rowProps = buildProps({
|
|
|
21
23
|
default: "top"
|
|
22
24
|
}
|
|
23
25
|
});
|
|
24
|
-
|
|
26
|
+
const Row = defineComponent({
|
|
25
27
|
name: "ElRow",
|
|
26
28
|
props: rowProps,
|
|
27
29
|
setup(props, { slots }) {
|
|
30
|
+
const ns = useNamespace("row");
|
|
28
31
|
const gutter = computed(() => props.gutter);
|
|
29
32
|
provide("ElRow", {
|
|
30
33
|
gutter
|
|
31
34
|
});
|
|
32
35
|
const style = computed(() => {
|
|
33
|
-
const
|
|
36
|
+
const styles = {
|
|
34
37
|
marginLeft: "",
|
|
35
38
|
marginRight: ""
|
|
36
39
|
};
|
|
37
40
|
if (props.gutter) {
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
styles.marginLeft = `-${props.gutter / 2}px`;
|
|
42
|
+
styles.marginRight = styles.marginLeft;
|
|
40
43
|
}
|
|
41
|
-
return
|
|
44
|
+
return styles;
|
|
42
45
|
});
|
|
43
46
|
return () => {
|
|
44
47
|
var _a;
|
|
45
48
|
return h(props.tag, {
|
|
46
49
|
class: [
|
|
47
|
-
|
|
50
|
+
ns.b(),
|
|
48
51
|
props.justify !== "start" ? `is-justify-${props.justify}` : "",
|
|
49
52
|
props.align !== "top" ? `is-align-${props.align}` : ""
|
|
50
53
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row.mjs","sources":["../../../../../../packages/components/row/src/row.ts"],"sourcesContent":["import { defineComponent, computed, h, provide } from 'vue'\nimport { buildProps } from '@element-plus/utils/props'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const rowProps = buildProps({\n tag: {\n type: String,\n default: 'div',\n },\n gutter: {\n type: Number,\n default: 0,\n },\n justify: {\n type: String,\n values: ['start', 'center', 'end', 'space-around', 'space-between'],\n default: 'start',\n },\n align: {\n type: String,\n values: ['top', 'middle', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type RowProps = ExtractPropTypes<typeof rowProps>\n\
|
|
1
|
+
{"version":3,"file":"row.mjs","sources":["../../../../../../packages/components/row/src/row.ts"],"sourcesContent":["import { defineComponent, computed, h, provide } from 'vue'\nimport { buildProps } from '@element-plus/utils/props'\nimport { useNamespace } from '@element-plus/hooks'\nimport type { ExtractPropTypes, CSSProperties } from 'vue'\n\nexport const rowProps = buildProps({\n tag: {\n type: String,\n default: 'div',\n },\n gutter: {\n type: Number,\n default: 0,\n },\n justify: {\n type: String,\n values: ['start', 'center', 'end', 'space-around', 'space-between'],\n default: 'start',\n },\n align: {\n type: String,\n values: ['top', 'middle', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type RowProps = ExtractPropTypes<typeof rowProps>\n\nconst Row = defineComponent({\n name: 'ElRow',\n props: rowProps,\n\n setup(props, { slots }) {\n const ns = useNamespace('row')\n\n const gutter = computed(() => props.gutter)\n provide('ElRow', {\n gutter,\n })\n\n const style = computed(() => {\n const styles: CSSProperties = {\n marginLeft: '',\n marginRight: '',\n }\n if (props.gutter) {\n styles.marginLeft = `-${props.gutter / 2}px`\n styles.marginRight = styles.marginLeft\n }\n return styles\n })\n\n return () =>\n h(\n props.tag,\n {\n class: [\n ns.b(),\n props.justify !== 'start' ? `is-justify-${props.justify}` : '',\n props.align !== 'top' ? `is-align-${props.align}` : '',\n ],\n style: style.value,\n },\n slots.default?.()\n )\n },\n})\n\nexport default Row\nexport type RowInstance = InstanceType<typeof Row>\n"],"names":[],"mappings":";;;;;AAGY,MAAC,QAAQ,GAAG,UAAU,CAAC;AACnC,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,eAAe,CAAC;AACvE,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC;AACvC,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACE,MAAC,GAAG,GAAG,eAAe,CAAC;AAC5B,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,KAAK,EAAE,QAAQ;AACjB,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE;AAC1B,IAAI,MAAM,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AACnC,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;AAChD,IAAI,OAAO,CAAC,OAAO,EAAE;AACrB,MAAM,MAAM;AACZ,KAAK,CAAC,CAAC;AACP,IAAI,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM;AACjC,MAAM,MAAM,MAAM,GAAG;AACrB,QAAQ,UAAU,EAAE,EAAE;AACtB,QAAQ,WAAW,EAAE,EAAE;AACvB,OAAO,CAAC;AACR,MAAM,IAAI,KAAK,CAAC,MAAM,EAAE;AACxB,QAAQ,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACrD,QAAQ,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/C,OAAO;AACP,MAAM,OAAO,MAAM,CAAC;AACpB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM;AACjB,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;AAC1B,QAAQ,KAAK,EAAE;AACf,UAAU,EAAE,CAAC,CAAC,EAAE;AAChB,UAAU,KAAK,CAAC,OAAO,KAAK,OAAO,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE;AACxE,UAAU,KAAK,CAAC,KAAK,KAAK,KAAK,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE;AAChE,SAAS;AACT,QAAQ,KAAK,EAAE,KAAK,CAAC,KAAK;AAC1B,OAAO,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACjE,KAAK,CAAC;AACN,GAAG;AACH,CAAC;;;;"}
|
|
@@ -44,8 +44,8 @@ export declare const ElScrollbar: import("../../utils/types").SFCWithInstall<imp
|
|
|
44
44
|
readonly minSize?: unknown;
|
|
45
45
|
} & {
|
|
46
46
|
height: import("../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
47
|
-
always: import("../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
48
47
|
maxHeight: import("../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
48
|
+
always: import("../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
49
49
|
native: import("../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
50
50
|
wrapStyle: import("vue").StyleValue;
|
|
51
51
|
wrapClass: import("../../utils/props").BuildPropType<readonly [StringConstructor, ArrayConstructor], unknown, unknown>;
|
|
@@ -61,8 +61,8 @@ export declare const ElScrollbar: import("../../utils/types").SFCWithInstall<imp
|
|
|
61
61
|
}) => any) | undefined;
|
|
62
62
|
}, {
|
|
63
63
|
height: import("../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
64
|
-
always: import("../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
65
64
|
maxHeight: import("../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
65
|
+
always: import("../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
66
66
|
native: import("../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
67
67
|
wrapStyle: import("vue").StyleValue;
|
|
68
68
|
wrapClass: import("../../utils/props").BuildPropType<readonly [StringConstructor, ArrayConstructor], unknown, unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, computed, onBeforeUnmount, toRef } from 'vue';
|
|
2
|
-
import { useEventListener } from '@vueuse/core';
|
|
2
|
+
import { isClient, useEventListener } from '@vueuse/core';
|
|
3
3
|
import '../../../tokens/index.mjs';
|
|
4
4
|
import { throwError } from '../../../utils/error.mjs';
|
|
5
5
|
import { BAR_MAP, renderThumbStyle } from './util.mjs';
|
|
@@ -20,7 +20,7 @@ var script = defineComponent({
|
|
|
20
20
|
const visible = ref(false);
|
|
21
21
|
let cursorDown = false;
|
|
22
22
|
let cursorLeave = false;
|
|
23
|
-
let onselectstartStore = null;
|
|
23
|
+
let onselectstartStore = isClient ? document.onselectstart : null;
|
|
24
24
|
const bar = computed(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
|
|
25
25
|
const thumbStyle = computed(() => renderThumbStyle({
|
|
26
26
|
size: props.size,
|
|
@@ -74,7 +74,7 @@ var script = defineComponent({
|
|
|
74
74
|
barStore.value[bar.value.axis] = 0;
|
|
75
75
|
document.removeEventListener("mousemove", mouseMoveDocumentHandler);
|
|
76
76
|
document.removeEventListener("mouseup", mouseUpDocumentHandler);
|
|
77
|
-
|
|
77
|
+
restoreOnselectstart();
|
|
78
78
|
if (cursorLeave)
|
|
79
79
|
visible.value = false;
|
|
80
80
|
};
|
|
@@ -86,7 +86,14 @@ var script = defineComponent({
|
|
|
86
86
|
cursorLeave = true;
|
|
87
87
|
visible.value = cursorDown;
|
|
88
88
|
};
|
|
89
|
-
onBeforeUnmount(() =>
|
|
89
|
+
onBeforeUnmount(() => {
|
|
90
|
+
restoreOnselectstart();
|
|
91
|
+
document.removeEventListener("mouseup", mouseUpDocumentHandler);
|
|
92
|
+
});
|
|
93
|
+
const restoreOnselectstart = () => {
|
|
94
|
+
if (document.onselectstart !== onselectstartStore)
|
|
95
|
+
document.onselectstart = onselectstartStore;
|
|
96
|
+
};
|
|
90
97
|
useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
|
|
91
98
|
useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
|
|
92
99
|
return {
|