@element-plus/nightly 0.0.20260308 → 0.0.20260310
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.full.js +366 -264
- package/dist/index.full.min.js +9 -9
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +366 -264
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.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/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.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-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.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/affix/src/affix.d.ts +1 -1
- package/es/components/affix/src/affix.vue.d.ts +4 -4
- package/es/components/alert/src/alert.d.ts +2 -2
- package/es/components/alert/src/alert.vue.d.ts +2 -2
- package/es/components/anchor/src/anchor.vue.d.ts +2 -2
- package/es/components/autocomplete/src/autocomplete.d.ts +5 -5
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +10 -10
- package/es/components/avatar/src/avatar-group-props.d.ts +1 -1
- package/es/components/avatar/src/avatar-group.d.ts +3 -3
- package/es/components/avatar/src/avatar.d.ts +1 -1
- package/es/components/avatar/src/avatar.vue.d.ts +1 -1
- package/es/components/backtop/src/backtop.vue.d.ts +2 -2
- package/es/components/badge/src/badge.d.ts +1 -1
- package/es/components/badge/src/badge.vue.d.ts +1 -1
- package/es/components/button/src/button-group.vue.d.ts +1 -1
- package/es/components/button/src/button.d.ts +2 -2
- package/es/components/button/src/button.vue.d.ts +5 -5
- package/es/components/calendar/src/calendar.d.ts +1 -1
- package/es/components/calendar/src/calendar.vue.d.ts +1 -1
- package/es/components/calendar/style/css.mjs +1 -1
- package/es/components/calendar/style/index.mjs +1 -1
- package/es/components/card/src/card.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +3 -3
- package/es/components/cascader/src/cascader.d.ts +4 -4
- package/es/components/cascader/src/cascader.vue.d.ts +14 -14
- package/es/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/es/components/check-tag/src/check-tag.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
- package/es/components/checkbox/src/checkbox-group.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
- package/es/components/checkbox/src/checkbox.d.ts +1 -1
- package/es/components/checkbox/src/checkbox.vue.d.ts +5 -5
- package/es/components/checkbox/src/composables/use-checkbox-status.d.ts +2 -2
- package/es/components/checkbox/src/composables/use-checkbox.d.ts +2 -2
- package/es/components/collapse/src/collapse-item.vue.d.ts +1 -1
- package/es/components/collapse/src/collapse.vue.d.ts +2 -2
- package/es/components/color-picker/src/color-picker.d.ts +2 -2
- package/es/components/color-picker/src/color-picker.vue.d.ts +8 -8
- package/es/components/color-picker-panel/src/color-picker-panel.d.ts +1 -1
- package/es/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/es/components/config-provider/src/config-provider-props.d.ts +1 -1
- package/es/components/config-provider/src/config-provider.d.ts +2 -2
- package/es/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/es/components/countdown/src/countdown.vue.d.ts +1 -1
- package/es/components/date-picker/src/date-picker.d.ts +12 -12
- package/es/components/date-picker/src/props.d.ts +2 -2
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +4 -4
- package/es/components/descriptions/src/description-item.d.ts +3 -3
- package/es/components/descriptions/src/description.d.ts +1 -1
- package/es/components/descriptions/src/description.vue.d.ts +2 -2
- package/es/components/dialog/src/dialog.vue.d.ts +6 -6
- package/es/components/divider/src/divider.vue.d.ts +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +8 -8
- package/es/components/dropdown/src/dropdown.d.ts +2 -2
- package/es/components/dropdown/src/dropdown.vue.d.ts +10 -10
- package/es/components/dropdown/style/css.mjs +1 -1
- package/es/components/dropdown/style/index.mjs +1 -1
- package/es/components/form/src/form-item.d.ts +3 -3
- package/es/components/form/src/form-item.vue.d.ts +2 -2
- package/es/components/form/src/form.d.ts +3 -3
- package/es/components/form/src/hooks/use-form-common-props.d.ts +2 -2
- package/es/components/image/src/image.vue.d.ts +9 -9
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/es/components/input/src/input.d.ts +4 -4
- package/es/components/input/src/input.vue.d.ts +16 -16
- package/es/components/input-number/src/input-number.d.ts +3 -3
- package/es/components/input-number/src/input-number.vue.d.ts +9 -9
- package/es/components/input-tag/src/composables/use-input-tag.d.ts +1 -1
- package/es/components/input-tag/src/input-tag.d.ts +4 -4
- package/es/components/input-tag/src/input-tag.vue.d.ts +12 -12
- package/es/components/link/src/link.d.ts +1 -1
- package/es/components/link/src/link.vue.d.ts +1 -1
- package/es/components/mention/src/mention.d.ts +5 -5
- package/es/components/mention/src/mention.vue.d.ts +10 -10
- package/es/components/menu/src/menu.d.ts +1 -1
- package/es/components/menu/src/sub-menu.d.ts +1 -1
- package/es/components/message/src/message.d.ts +2 -2
- package/es/components/message/src/message.vue.d.ts +7 -7
- package/es/components/notification/src/notification.d.ts +2 -2
- package/es/components/notification/src/notification.vue.d.ts +2 -2
- package/es/components/page-header/src/page-header.vue.d.ts +1 -1
- package/es/components/pagination/src/pagination.d.ts +7 -7
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +2 -2
- package/es/components/popover/src/popover.d.ts +2 -2
- package/es/components/popover/src/popover.vue.d.ts +8 -8
- package/es/components/popper/src/composables/use-content.d.ts +3 -3
- package/es/components/popper/src/content.d.ts +4 -4
- package/es/components/popper/src/content.vue.d.ts +11 -11
- package/es/components/progress/src/progress.vue.d.ts +2 -2
- package/es/components/radio/src/radio-button.d.ts +1 -1
- package/es/components/radio/src/radio-button.vue.d.ts +3 -3
- package/es/components/radio/src/radio-group.d.ts +1 -1
- package/es/components/radio/src/radio-group.vue.d.ts +5 -5
- package/es/components/radio/src/radio.d.ts +2 -2
- package/es/components/radio/src/radio.vue.d.ts +5 -5
- package/es/components/rate/src/rate.d.ts +1 -1
- package/es/components/rate/src/rate.vue.d.ts +3 -3
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/result/src/result.vue.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
- package/es/components/row/src/row.d.ts +2 -2
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/es/components/segmented/index.d.ts +97 -97
- package/es/components/segmented/src/segmented.d.ts +1 -1
- package/es/components/segmented/src/segmented.vue.d.ts +4 -4
- package/es/components/select/src/select.d.ts +4 -4
- package/es/components/select/src/select.vue.d.ts +29 -29
- package/es/components/select-v2/src/defaults.d.ts +4 -4
- package/es/components/select-v2/src/select.vue.d.ts +29 -29
- package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/es/components/slider/src/button.vue.d.ts +1 -1
- package/es/components/slider/src/composables/index.d.ts +1 -1
- package/es/components/slider/src/composables/use-marks.mjs +16 -2
- package/es/components/slider/src/composables/use-marks.mjs.map +1 -1
- package/es/components/slider/src/composables/use-slider-button.mjs +57 -15
- package/es/components/slider/src/composables/use-slider-button.mjs.map +1 -1
- package/es/components/slider/src/composables/use-stops.mjs +2 -2
- package/es/components/slider/src/composables/use-stops.mjs.map +1 -1
- package/es/components/slider/src/constants.d.ts +2 -0
- package/es/components/slider/src/constants.mjs.map +1 -1
- package/es/components/slider/src/slider.d.ts +3 -3
- package/es/components/slider/src/slider.mjs +1 -1
- package/es/components/slider/src/slider.mjs.map +1 -1
- package/es/components/slider/src/slider.vue.d.ts +17 -17
- package/es/components/slider/src/slider.vue_vue_type_script_setup_true_lang.mjs +14 -5
- package/es/components/slider/src/slider.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs.map +1 -1
- package/es/components/space/src/space.d.ts +5 -5
- package/es/components/splitter/src/splitter.vue.d.ts +2 -2
- package/es/components/steps/src/item.d.ts +1 -1
- package/es/components/steps/src/item.vue.d.ts +1 -1
- package/es/components/steps/src/steps.d.ts +2 -2
- package/es/components/steps/src/steps.vue.d.ts +1 -1
- package/es/components/switch/src/switch.d.ts +1 -1
- package/es/components/switch/src/switch.vue.d.ts +6 -6
- package/es/components/table/src/table-body/index.d.ts +1 -1
- package/es/components/table/src/table-column/index.d.ts +2 -2
- package/es/components/table/src/table.vue.d.ts +17 -17
- package/es/components/table-v2/src/components/row.d.ts +1 -1
- package/es/components/table-v2/src/table-grid.d.ts +2 -2
- package/es/components/table-v2/src/table-v2.d.ts +3 -3
- package/es/components/tabs/src/tab-nav.d.ts +1 -1
- package/es/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/es/components/tabs/src/tabs.d.ts +7 -7
- package/es/components/tag/src/tag.d.ts +3 -3
- package/es/components/tag/src/tag.vue.d.ts +1 -1
- package/es/components/text/src/text.d.ts +2 -2
- package/es/components/time-picker/src/common/picker.vue.d.ts +16 -16
- package/es/components/time-picker/src/common/props.d.ts +2 -2
- package/es/components/time-picker/src/time-picker.d.ts +12 -12
- package/es/components/time-select/src/time-select.d.ts +1 -1
- package/es/components/time-select/src/time-select.vue.d.ts +9 -9
- package/es/components/timeline/src/timeline-item.d.ts +3 -3
- package/es/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/es/components/tooltip/src/content.d.ts +1 -1
- package/es/components/tooltip/src/content.vue.d.ts +7 -7
- package/es/components/tooltip/src/tooltip.d.ts +2 -2
- package/es/components/tooltip/src/tooltip.vue.d.ts +9 -9
- package/es/components/tooltip/src/tooltip.vue_vue_type_script_setup_true_lang.mjs +1 -0
- package/es/components/tooltip/src/tooltip.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.d.ts +1 -1
- package/es/components/tour/src/content.d.ts +2 -2
- package/es/components/tour/src/step.d.ts +1 -1
- package/es/components/tour/src/tour.d.ts +1 -1
- package/es/components/tour/src/tour.vue.d.ts +5 -5
- package/es/components/transfer/src/transfer-panel.vue.d.ts +1 -1
- package/es/components/transfer/src/transfer.vue.d.ts +3 -3
- package/es/components/tree/src/tree.vue.d.ts +12 -12
- package/es/components/tree-select/src/tree-select.vue.d.ts +36 -36
- package/es/components/tree-v2/src/tree.vue.d.ts +13 -13
- package/es/components/upload/src/upload-content.vue.d.ts +3 -3
- package/es/components/upload/src/upload.vue.d.ts +4 -4
- package/es/components/virtual-list/src/builders/build-grid.d.ts +6 -6
- package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +6 -6
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +6 -6
- package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +6 -6
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +6 -6
- package/es/components/watermark/src/watermark.vue.d.ts +2 -2
- package/es/hooks/use-floating/index.d.ts +4 -4
- package/es/hooks/use-popper/index.d.ts +3 -3
- package/es/hooks/use-size/index.d.ts +3 -3
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/src/affix.d.ts +1 -1
- package/lib/components/affix/src/affix.vue.d.ts +4 -4
- package/lib/components/alert/src/alert.d.ts +2 -2
- package/lib/components/alert/src/alert.vue.d.ts +2 -2
- package/lib/components/anchor/src/anchor.vue.d.ts +2 -2
- package/lib/components/autocomplete/src/autocomplete.d.ts +5 -5
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +10 -10
- package/lib/components/avatar/src/avatar-group-props.d.ts +1 -1
- package/lib/components/avatar/src/avatar-group.d.ts +3 -3
- package/lib/components/avatar/src/avatar.d.ts +1 -1
- package/lib/components/avatar/src/avatar.vue.d.ts +1 -1
- package/lib/components/backtop/src/backtop.vue.d.ts +2 -2
- package/lib/components/badge/src/badge.d.ts +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +1 -1
- package/lib/components/button/src/button-group.vue.d.ts +1 -1
- package/lib/components/button/src/button.d.ts +2 -2
- package/lib/components/button/src/button.vue.d.ts +5 -5
- package/lib/components/calendar/src/calendar.d.ts +1 -1
- package/lib/components/calendar/src/calendar.vue.d.ts +1 -1
- package/lib/components/calendar/style/css.js +1 -1
- package/lib/components/calendar/style/index.js +1 -1
- package/lib/components/card/src/card.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +3 -3
- package/lib/components/cascader/src/cascader.d.ts +4 -4
- package/lib/components/cascader/src/cascader.vue.d.ts +14 -14
- package/lib/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/lib/components/check-tag/src/check-tag.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
- package/lib/components/checkbox/src/checkbox-group.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
- package/lib/components/checkbox/src/checkbox.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox.vue.d.ts +5 -5
- package/lib/components/checkbox/src/composables/use-checkbox-status.d.ts +2 -2
- package/lib/components/checkbox/src/composables/use-checkbox.d.ts +2 -2
- package/lib/components/collapse/src/collapse-item.vue.d.ts +1 -1
- package/lib/components/collapse/src/collapse.vue.d.ts +2 -2
- package/lib/components/color-picker/src/color-picker.d.ts +2 -2
- package/lib/components/color-picker/src/color-picker.vue.d.ts +8 -8
- package/lib/components/color-picker-panel/src/color-picker-panel.d.ts +1 -1
- package/lib/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/lib/components/config-provider/src/config-provider-props.d.ts +1 -1
- package/lib/components/config-provider/src/config-provider.d.ts +2 -2
- package/lib/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/lib/components/countdown/src/countdown.vue.d.ts +1 -1
- package/lib/components/date-picker/src/date-picker.d.ts +12 -12
- package/lib/components/date-picker/src/props.d.ts +2 -2
- package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +4 -4
- package/lib/components/descriptions/src/description-item.d.ts +3 -3
- package/lib/components/descriptions/src/description.d.ts +1 -1
- package/lib/components/descriptions/src/description.vue.d.ts +2 -2
- package/lib/components/dialog/src/dialog.vue.d.ts +6 -6
- package/lib/components/divider/src/divider.vue.d.ts +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +8 -8
- package/lib/components/dropdown/src/dropdown.d.ts +2 -2
- package/lib/components/dropdown/src/dropdown.vue.d.ts +10 -10
- package/lib/components/dropdown/style/css.js +1 -1
- package/lib/components/dropdown/style/index.js +1 -1
- package/lib/components/form/src/form-item.d.ts +3 -3
- package/lib/components/form/src/form-item.vue.d.ts +2 -2
- package/lib/components/form/src/form.d.ts +3 -3
- package/lib/components/form/src/hooks/use-form-common-props.d.ts +2 -2
- package/lib/components/image/src/image.vue.d.ts +9 -9
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/lib/components/input/src/input.d.ts +4 -4
- package/lib/components/input/src/input.vue.d.ts +16 -16
- package/lib/components/input-number/src/input-number.d.ts +3 -3
- package/lib/components/input-number/src/input-number.vue.d.ts +9 -9
- package/lib/components/input-tag/src/composables/use-input-tag.d.ts +1 -1
- package/lib/components/input-tag/src/input-tag.d.ts +4 -4
- package/lib/components/input-tag/src/input-tag.vue.d.ts +12 -12
- package/lib/components/link/src/link.d.ts +1 -1
- package/lib/components/link/src/link.vue.d.ts +1 -1
- package/lib/components/mention/src/mention.d.ts +5 -5
- package/lib/components/mention/src/mention.vue.d.ts +10 -10
- package/lib/components/menu/src/menu.d.ts +1 -1
- package/lib/components/menu/src/sub-menu.d.ts +1 -1
- package/lib/components/message/src/message.d.ts +2 -2
- package/lib/components/message/src/message.vue.d.ts +7 -7
- package/lib/components/notification/src/notification.d.ts +2 -2
- package/lib/components/notification/src/notification.vue.d.ts +2 -2
- package/lib/components/page-header/src/page-header.vue.d.ts +1 -1
- package/lib/components/pagination/src/pagination.d.ts +7 -7
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +2 -2
- package/lib/components/popover/src/popover.d.ts +2 -2
- package/lib/components/popover/src/popover.vue.d.ts +8 -8
- package/lib/components/popper/src/composables/use-content.d.ts +3 -3
- package/lib/components/popper/src/content.d.ts +4 -4
- package/lib/components/popper/src/content.vue.d.ts +11 -11
- package/lib/components/progress/src/progress.vue.d.ts +2 -2
- package/lib/components/radio/src/radio-button.d.ts +1 -1
- package/lib/components/radio/src/radio-button.vue.d.ts +3 -3
- package/lib/components/radio/src/radio-group.d.ts +1 -1
- package/lib/components/radio/src/radio-group.vue.d.ts +5 -5
- package/lib/components/radio/src/radio.d.ts +2 -2
- package/lib/components/radio/src/radio.vue.d.ts +5 -5
- package/lib/components/rate/src/rate.d.ts +1 -1
- package/lib/components/rate/src/rate.vue.d.ts +3 -3
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/result/src/result.vue.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
- package/lib/components/row/src/row.d.ts +2 -2
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/lib/components/segmented/index.d.ts +97 -97
- package/lib/components/segmented/src/segmented.d.ts +1 -1
- package/lib/components/segmented/src/segmented.vue.d.ts +4 -4
- package/lib/components/select/src/select.d.ts +4 -4
- package/lib/components/select/src/select.vue.d.ts +29 -29
- package/lib/components/select-v2/src/defaults.d.ts +4 -4
- package/lib/components/select-v2/src/select.vue.d.ts +29 -29
- package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/lib/components/slider/src/button.vue.d.ts +1 -1
- package/lib/components/slider/src/composables/index.d.ts +1 -1
- package/lib/components/slider/src/composables/use-marks.js +15 -1
- package/lib/components/slider/src/composables/use-marks.js.map +1 -1
- package/lib/components/slider/src/composables/use-slider-button.js +57 -15
- package/lib/components/slider/src/composables/use-slider-button.js.map +1 -1
- package/lib/components/slider/src/composables/use-stops.js +2 -2
- package/lib/components/slider/src/composables/use-stops.js.map +1 -1
- package/lib/components/slider/src/constants.d.ts +2 -0
- package/lib/components/slider/src/constants.js.map +1 -1
- package/lib/components/slider/src/slider.d.ts +3 -3
- package/lib/components/slider/src/slider.js +1 -1
- package/lib/components/slider/src/slider.js.map +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +17 -17
- package/lib/components/slider/src/slider.vue_vue_type_script_setup_true_lang.js +14 -5
- package/lib/components/slider/src/slider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/slider/src/slider2.js.map +1 -1
- package/lib/components/space/src/space.d.ts +5 -5
- package/lib/components/splitter/src/splitter.vue.d.ts +2 -2
- package/lib/components/steps/src/item.d.ts +1 -1
- package/lib/components/steps/src/item.vue.d.ts +1 -1
- package/lib/components/steps/src/steps.d.ts +2 -2
- package/lib/components/steps/src/steps.vue.d.ts +1 -1
- package/lib/components/switch/src/switch.d.ts +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +6 -6
- package/lib/components/table/src/table-body/index.d.ts +1 -1
- package/lib/components/table/src/table-column/index.d.ts +2 -2
- package/lib/components/table/src/table.vue.d.ts +17 -17
- package/lib/components/table-v2/src/components/row.d.ts +1 -1
- package/lib/components/table-v2/src/table-grid.d.ts +2 -2
- package/lib/components/table-v2/src/table-v2.d.ts +3 -3
- package/lib/components/tabs/src/tab-nav.d.ts +1 -1
- package/lib/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/lib/components/tabs/src/tabs.d.ts +7 -7
- package/lib/components/tag/src/tag.d.ts +3 -3
- package/lib/components/tag/src/tag.vue.d.ts +1 -1
- package/lib/components/text/src/text.d.ts +2 -2
- package/lib/components/time-picker/src/common/picker.vue.d.ts +16 -16
- package/lib/components/time-picker/src/common/props.d.ts +2 -2
- package/lib/components/time-picker/src/time-picker.d.ts +12 -12
- package/lib/components/time-select/src/time-select.d.ts +1 -1
- package/lib/components/time-select/src/time-select.vue.d.ts +9 -9
- package/lib/components/timeline/src/timeline-item.d.ts +3 -3
- package/lib/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/lib/components/tooltip/src/content.d.ts +1 -1
- package/lib/components/tooltip/src/content.vue.d.ts +7 -7
- package/lib/components/tooltip/src/tooltip.d.ts +2 -2
- package/lib/components/tooltip/src/tooltip.vue.d.ts +9 -9
- package/lib/components/tooltip/src/tooltip.vue_vue_type_script_setup_true_lang.js +1 -0
- package/lib/components/tooltip/src/tooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip/src/trigger.d.ts +1 -1
- package/lib/components/tour/src/content.d.ts +2 -2
- package/lib/components/tour/src/step.d.ts +1 -1
- package/lib/components/tour/src/tour.d.ts +1 -1
- package/lib/components/tour/src/tour.vue.d.ts +5 -5
- package/lib/components/transfer/src/transfer-panel.vue.d.ts +1 -1
- package/lib/components/transfer/src/transfer.vue.d.ts +3 -3
- package/lib/components/tree/src/tree.vue.d.ts +12 -12
- package/lib/components/tree-select/src/tree-select.vue.d.ts +36 -36
- package/lib/components/tree-v2/src/tree.vue.d.ts +13 -13
- package/lib/components/upload/src/upload-content.vue.d.ts +3 -3
- package/lib/components/upload/src/upload.vue.d.ts +4 -4
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +6 -6
- package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +6 -6
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +6 -6
- package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +6 -6
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +6 -6
- package/lib/components/watermark/src/watermark.vue.d.ts +2 -2
- package/lib/hooks/use-floating/index.d.ts +4 -4
- package/lib/hooks/use-popper/index.d.ts +3 -3
- package/lib/hooks/use-size/index.d.ts +3 -3
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
package/dist/index.full.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Element Plus v0.0.
|
|
1
|
+
/*! Element Plus v0.0.20260310 */
|
|
2
2
|
|
|
3
3
|
import { Comment, Fragment, Teleport, Text, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, effectScope, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onMounted, onScopeDispose, onUnmounted, onUpdated, openBlock, provide, reactive, readonly, ref, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, shallowReactive, shallowRef, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, triggerRef, unref, useAttrs as useAttrs$1, useSlots, vModelCheckbox, vModelRadio, vModelText, vShow, warn, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
4
4
|
|
|
@@ -10456,7 +10456,7 @@ const ElConfigProvider = withInstall(ConfigProvider);
|
|
|
10456
10456
|
|
|
10457
10457
|
//#endregion
|
|
10458
10458
|
//#region ../../packages/element-plus/version.ts
|
|
10459
|
-
const version$1 = "0.0.
|
|
10459
|
+
const version$1 = "0.0.20260310";
|
|
10460
10460
|
|
|
10461
10461
|
//#endregion
|
|
10462
10462
|
//#region ../../packages/element-plus/make-installer.ts
|
|
@@ -13846,6 +13846,7 @@ var tooltip_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
13846
13846
|
});
|
|
13847
13847
|
watch(() => props.disabled, (disabled) => {
|
|
13848
13848
|
if (disabled && open.value) open.value = false;
|
|
13849
|
+
if (!disabled && isBoolean(props.visible)) open.value = props.visible;
|
|
13849
13850
|
});
|
|
13850
13851
|
const isFocusInsideContent = (event) => {
|
|
13851
13852
|
return contentRef.value?.isFocusInsideContent(event);
|
|
@@ -16201,14 +16202,14 @@ const useButton = (props, emit) => {
|
|
|
16201
16202
|
};
|
|
16202
16203
|
|
|
16203
16204
|
//#endregion
|
|
16204
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16205
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/util.js
|
|
16205
16206
|
/**
|
|
16206
16207
|
* Take input from [0, n] and return it as [0, 1]
|
|
16207
16208
|
* @hidden
|
|
16208
16209
|
*/
|
|
16209
16210
|
function bound01(n, max) {
|
|
16210
16211
|
if (isOnePointZero(n)) n = "100%";
|
|
16211
|
-
|
|
16212
|
+
const isPercent = isPercentage(n);
|
|
16212
16213
|
n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
|
|
16213
16214
|
if (isPercent) n = parseInt(String(n * max), 10) / 100;
|
|
16214
16215
|
if (Math.abs(n - max) < 1e-6) return 1;
|
|
@@ -16252,7 +16253,7 @@ function boundAlpha(a) {
|
|
|
16252
16253
|
* @hidden
|
|
16253
16254
|
*/
|
|
16254
16255
|
function convertToPercentage(n) {
|
|
16255
|
-
if (n <= 1) return
|
|
16256
|
+
if (Number(n) <= 1) return `${Number(n) * 100}%`;
|
|
16256
16257
|
return n;
|
|
16257
16258
|
}
|
|
16258
16259
|
/**
|
|
@@ -16264,7 +16265,7 @@ function pad2(c) {
|
|
|
16264
16265
|
}
|
|
16265
16266
|
|
|
16266
16267
|
//#endregion
|
|
16267
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16268
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/conversion.js
|
|
16268
16269
|
/**
|
|
16269
16270
|
* Handle bounds / percentage checking to conform to CSS color spec
|
|
16270
16271
|
* <http://www.w3.org/TR/css3-color/>
|
|
@@ -16287,16 +16288,16 @@ function rgbToHsl(r, g, b) {
|
|
|
16287
16288
|
r = bound01(r, 255);
|
|
16288
16289
|
g = bound01(g, 255);
|
|
16289
16290
|
b = bound01(b, 255);
|
|
16290
|
-
|
|
16291
|
-
|
|
16292
|
-
|
|
16293
|
-
|
|
16294
|
-
|
|
16291
|
+
const max = Math.max(r, g, b);
|
|
16292
|
+
const min = Math.min(r, g, b);
|
|
16293
|
+
let h = 0;
|
|
16294
|
+
let s = 0;
|
|
16295
|
+
const l = (max + min) / 2;
|
|
16295
16296
|
if (max === min) {
|
|
16296
16297
|
s = 0;
|
|
16297
16298
|
h = 0;
|
|
16298
16299
|
} else {
|
|
16299
|
-
|
|
16300
|
+
const d = max - min;
|
|
16300
16301
|
s = l > .5 ? d / (2 - max - min) : d / (max + min);
|
|
16301
16302
|
switch (max) {
|
|
16302
16303
|
case r:
|
|
@@ -16333,9 +16334,9 @@ function hue2rgb(p, q, t) {
|
|
|
16333
16334
|
* *Returns:* { r, g, b } in the set [0, 255]
|
|
16334
16335
|
*/
|
|
16335
16336
|
function hslToRgb(h, s, l) {
|
|
16336
|
-
|
|
16337
|
-
|
|
16338
|
-
|
|
16337
|
+
let r;
|
|
16338
|
+
let g;
|
|
16339
|
+
let b;
|
|
16339
16340
|
h = bound01(h, 360);
|
|
16340
16341
|
s = bound01(s, 100);
|
|
16341
16342
|
l = bound01(l, 100);
|
|
@@ -16344,8 +16345,8 @@ function hslToRgb(h, s, l) {
|
|
|
16344
16345
|
b = l;
|
|
16345
16346
|
r = l;
|
|
16346
16347
|
} else {
|
|
16347
|
-
|
|
16348
|
-
|
|
16348
|
+
const q = l < .5 ? l * (1 + s) : l + s - l * s;
|
|
16349
|
+
const p = 2 * l - q;
|
|
16349
16350
|
r = hue2rgb(p, q, h + 1 / 3);
|
|
16350
16351
|
g = hue2rgb(p, q, h);
|
|
16351
16352
|
b = hue2rgb(p, q, h - 1 / 3);
|
|
@@ -16366,12 +16367,12 @@ function rgbToHsv(r, g, b) {
|
|
|
16366
16367
|
r = bound01(r, 255);
|
|
16367
16368
|
g = bound01(g, 255);
|
|
16368
16369
|
b = bound01(b, 255);
|
|
16369
|
-
|
|
16370
|
-
|
|
16371
|
-
|
|
16372
|
-
|
|
16373
|
-
|
|
16374
|
-
|
|
16370
|
+
const max = Math.max(r, g, b);
|
|
16371
|
+
const min = Math.min(r, g, b);
|
|
16372
|
+
let h = 0;
|
|
16373
|
+
const v = max;
|
|
16374
|
+
const d = max - min;
|
|
16375
|
+
const s = max === 0 ? 0 : d / max;
|
|
16375
16376
|
if (max === min) h = 0;
|
|
16376
16377
|
else {
|
|
16377
16378
|
switch (max) {
|
|
@@ -16404,13 +16405,13 @@ function hsvToRgb(h, s, v) {
|
|
|
16404
16405
|
h = bound01(h, 360) * 6;
|
|
16405
16406
|
s = bound01(s, 100);
|
|
16406
16407
|
v = bound01(v, 100);
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
|
|
16410
|
-
|
|
16411
|
-
|
|
16412
|
-
|
|
16413
|
-
|
|
16408
|
+
const i = Math.floor(h);
|
|
16409
|
+
const f = h - i;
|
|
16410
|
+
const p = v * (1 - s);
|
|
16411
|
+
const q = v * (1 - f * s);
|
|
16412
|
+
const t = v * (1 - (1 - f) * s);
|
|
16413
|
+
const mod = i % 6;
|
|
16414
|
+
const r = [
|
|
16414
16415
|
v,
|
|
16415
16416
|
q,
|
|
16416
16417
|
p,
|
|
@@ -16418,7 +16419,7 @@ function hsvToRgb(h, s, v) {
|
|
|
16418
16419
|
t,
|
|
16419
16420
|
v
|
|
16420
16421
|
][mod];
|
|
16421
|
-
|
|
16422
|
+
const g = [
|
|
16422
16423
|
t,
|
|
16423
16424
|
v,
|
|
16424
16425
|
v,
|
|
@@ -16426,7 +16427,7 @@ function hsvToRgb(h, s, v) {
|
|
|
16426
16427
|
p,
|
|
16427
16428
|
p
|
|
16428
16429
|
][mod];
|
|
16429
|
-
|
|
16430
|
+
const b = [
|
|
16430
16431
|
p,
|
|
16431
16432
|
p,
|
|
16432
16433
|
t,
|
|
@@ -16443,11 +16444,11 @@ function hsvToRgb(h, s, v) {
|
|
|
16443
16444
|
/**
|
|
16444
16445
|
* Converts an RGB color to hex
|
|
16445
16446
|
*
|
|
16446
|
-
* Assumes r, g, and b are contained in the set [0, 255]
|
|
16447
|
-
* Returns a 3 or 6 character hex
|
|
16447
|
+
* *Assumes:* r, g, and b are contained in the set [0, 255]
|
|
16448
|
+
* *Returns:* a 3 or 6 character hex
|
|
16448
16449
|
*/
|
|
16449
16450
|
function rgbToHex(r, g, b, allow3Char) {
|
|
16450
|
-
|
|
16451
|
+
const hex = [
|
|
16451
16452
|
pad2(Math.round(r).toString(16)),
|
|
16452
16453
|
pad2(Math.round(g).toString(16)),
|
|
16453
16454
|
pad2(Math.round(b).toString(16))
|
|
@@ -16458,11 +16459,11 @@ function rgbToHex(r, g, b, allow3Char) {
|
|
|
16458
16459
|
/**
|
|
16459
16460
|
* Converts an RGBA color plus alpha transparency to hex
|
|
16460
16461
|
*
|
|
16461
|
-
* Assumes r, g, b are contained in the set [0, 255] and
|
|
16462
|
-
*
|
|
16462
|
+
* *Assumes:* r, g, b are contained in the set [0, 255] and a in [0, 1]
|
|
16463
|
+
* *Returns:* a 4 or 8 character rgba hex
|
|
16463
16464
|
*/
|
|
16464
16465
|
function rgbaToHex(r, g, b, a, allow4Char) {
|
|
16465
|
-
|
|
16466
|
+
const hex = [
|
|
16466
16467
|
pad2(Math.round(r).toString(16)),
|
|
16467
16468
|
pad2(Math.round(g).toString(16)),
|
|
16468
16469
|
pad2(Math.round(b).toString(16)),
|
|
@@ -16471,6 +16472,43 @@ function rgbaToHex(r, g, b, a, allow4Char) {
|
|
|
16471
16472
|
if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
|
|
16472
16473
|
return hex.join("");
|
|
16473
16474
|
}
|
|
16475
|
+
/**
|
|
16476
|
+
* Converts CMYK to RBG
|
|
16477
|
+
* Assumes c, m, y, k are in the set [0, 100]
|
|
16478
|
+
*/
|
|
16479
|
+
function cmykToRgb(c, m, y, k) {
|
|
16480
|
+
const cConv = c / 100;
|
|
16481
|
+
const mConv = m / 100;
|
|
16482
|
+
const yConv = y / 100;
|
|
16483
|
+
const kConv = k / 100;
|
|
16484
|
+
return {
|
|
16485
|
+
r: 255 * (1 - cConv) * (1 - kConv),
|
|
16486
|
+
g: 255 * (1 - mConv) * (1 - kConv),
|
|
16487
|
+
b: 255 * (1 - yConv) * (1 - kConv)
|
|
16488
|
+
};
|
|
16489
|
+
}
|
|
16490
|
+
function rgbToCmyk(r, g, b) {
|
|
16491
|
+
let c = 1 - r / 255;
|
|
16492
|
+
let m = 1 - g / 255;
|
|
16493
|
+
let y = 1 - b / 255;
|
|
16494
|
+
let k = Math.min(c, m, y);
|
|
16495
|
+
if (k === 1) {
|
|
16496
|
+
c = 0;
|
|
16497
|
+
m = 0;
|
|
16498
|
+
y = 0;
|
|
16499
|
+
} else {
|
|
16500
|
+
c = (c - k) / (1 - k) * 100;
|
|
16501
|
+
m = (m - k) / (1 - k) * 100;
|
|
16502
|
+
y = (y - k) / (1 - k) * 100;
|
|
16503
|
+
}
|
|
16504
|
+
k *= 100;
|
|
16505
|
+
return {
|
|
16506
|
+
c: Math.round(c),
|
|
16507
|
+
m: Math.round(m),
|
|
16508
|
+
y: Math.round(y),
|
|
16509
|
+
k: Math.round(k)
|
|
16510
|
+
};
|
|
16511
|
+
}
|
|
16474
16512
|
/** Converts a decimal to a hex value */
|
|
16475
16513
|
function convertDecimalToHex(d) {
|
|
16476
16514
|
return Math.round(parseFloat(d) * 255).toString(16);
|
|
@@ -16492,11 +16530,11 @@ function numberInputToObject(color) {
|
|
|
16492
16530
|
}
|
|
16493
16531
|
|
|
16494
16532
|
//#endregion
|
|
16495
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16533
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
|
|
16496
16534
|
/**
|
|
16497
16535
|
* @hidden
|
|
16498
16536
|
*/
|
|
16499
|
-
|
|
16537
|
+
const names = {
|
|
16500
16538
|
aliceblue: "#f0f8ff",
|
|
16501
16539
|
antiquewhite: "#faebd7",
|
|
16502
16540
|
aqua: "#00ffff",
|
|
@@ -16648,7 +16686,7 @@ var names = {
|
|
|
16648
16686
|
};
|
|
16649
16687
|
|
|
16650
16688
|
//#endregion
|
|
16651
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16689
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/format-input.js
|
|
16652
16690
|
/**
|
|
16653
16691
|
* Given a string or object, convert that input to RGB
|
|
16654
16692
|
*
|
|
@@ -16665,20 +16703,21 @@ var names = {
|
|
|
16665
16703
|
* "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
|
16666
16704
|
* "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
|
16667
16705
|
* "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
|
16706
|
+
* "cmyk(0, 20, 0, 0)" or "cmyk 0 20 0 0"
|
|
16668
16707
|
* ```
|
|
16669
16708
|
*/
|
|
16670
16709
|
function inputToRGB(color) {
|
|
16671
|
-
|
|
16710
|
+
let rgb = {
|
|
16672
16711
|
r: 0,
|
|
16673
16712
|
g: 0,
|
|
16674
16713
|
b: 0
|
|
16675
16714
|
};
|
|
16676
|
-
|
|
16677
|
-
|
|
16678
|
-
|
|
16679
|
-
|
|
16680
|
-
|
|
16681
|
-
|
|
16715
|
+
let a = 1;
|
|
16716
|
+
let s = null;
|
|
16717
|
+
let v = null;
|
|
16718
|
+
let l = null;
|
|
16719
|
+
let ok = false;
|
|
16720
|
+
let format = false;
|
|
16682
16721
|
if (typeof color === "string") color = stringInputToObject(color);
|
|
16683
16722
|
if (typeof color === "object") {
|
|
16684
16723
|
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
@@ -16697,6 +16736,10 @@ function inputToRGB(color) {
|
|
|
16697
16736
|
rgb = hslToRgb(color.h, s, l);
|
|
16698
16737
|
ok = true;
|
|
16699
16738
|
format = "hsl";
|
|
16739
|
+
} else if (isValidCSSUnit(color.c) && isValidCSSUnit(color.m) && isValidCSSUnit(color.y) && isValidCSSUnit(color.k)) {
|
|
16740
|
+
rgb = cmykToRgb(color.c, color.m, color.y, color.k);
|
|
16741
|
+
ok = true;
|
|
16742
|
+
format = "cmyk";
|
|
16700
16743
|
}
|
|
16701
16744
|
if (Object.prototype.hasOwnProperty.call(color, "a")) a = color.a;
|
|
16702
16745
|
}
|
|
@@ -16710,10 +16753,10 @@ function inputToRGB(color) {
|
|
|
16710
16753
|
a
|
|
16711
16754
|
};
|
|
16712
16755
|
}
|
|
16713
|
-
|
|
16714
|
-
|
|
16715
|
-
|
|
16716
|
-
|
|
16756
|
+
const CSS_UNIT = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)";
|
|
16757
|
+
const PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?";
|
|
16758
|
+
const PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?";
|
|
16759
|
+
const matchers = {
|
|
16717
16760
|
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
16718
16761
|
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
|
16719
16762
|
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
|
@@ -16721,6 +16764,7 @@ var matchers = {
|
|
|
16721
16764
|
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
|
16722
16765
|
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
|
16723
16766
|
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
|
16767
|
+
cmyk: new RegExp("cmyk" + PERMISSIVE_MATCH4),
|
|
16724
16768
|
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
16725
16769
|
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
16726
16770
|
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
@@ -16728,12 +16772,12 @@ var matchers = {
|
|
|
16728
16772
|
};
|
|
16729
16773
|
/**
|
|
16730
16774
|
* Permissive string parsing. Take in a number of formats, and output an object
|
|
16731
|
-
* based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
|
|
16775
|
+
* based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` or `{c, m, y, k}` or `{c, m, y, k, a}`
|
|
16732
16776
|
*/
|
|
16733
16777
|
function stringInputToObject(color) {
|
|
16734
16778
|
color = color.trim().toLowerCase();
|
|
16735
16779
|
if (color.length === 0) return false;
|
|
16736
|
-
|
|
16780
|
+
let named = false;
|
|
16737
16781
|
if (names[color]) {
|
|
16738
16782
|
color = names[color];
|
|
16739
16783
|
named = true;
|
|
@@ -16744,7 +16788,7 @@ function stringInputToObject(color) {
|
|
|
16744
16788
|
a: 0,
|
|
16745
16789
|
format: "name"
|
|
16746
16790
|
};
|
|
16747
|
-
|
|
16791
|
+
let match = matchers.rgb.exec(color);
|
|
16748
16792
|
if (match) return {
|
|
16749
16793
|
r: match[1],
|
|
16750
16794
|
g: match[2],
|
|
@@ -16783,6 +16827,13 @@ function stringInputToObject(color) {
|
|
|
16783
16827
|
v: match[3],
|
|
16784
16828
|
a: match[4]
|
|
16785
16829
|
};
|
|
16830
|
+
match = matchers.cmyk.exec(color);
|
|
16831
|
+
if (match) return {
|
|
16832
|
+
c: match[1],
|
|
16833
|
+
m: match[2],
|
|
16834
|
+
y: match[3],
|
|
16835
|
+
k: match[4]
|
|
16836
|
+
};
|
|
16786
16837
|
match = matchers.hex8.exec(color);
|
|
16787
16838
|
if (match) return {
|
|
16788
16839
|
r: parseIntFromHex(match[1]),
|
|
@@ -16820,57 +16871,55 @@ function stringInputToObject(color) {
|
|
|
16820
16871
|
* (see `matchers` above for definition).
|
|
16821
16872
|
*/
|
|
16822
16873
|
function isValidCSSUnit(color) {
|
|
16823
|
-
return
|
|
16874
|
+
if (typeof color === "number") return !Number.isNaN(color);
|
|
16875
|
+
return matchers.CSS_UNIT.test(color);
|
|
16824
16876
|
}
|
|
16825
16877
|
|
|
16826
16878
|
//#endregion
|
|
16827
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16828
|
-
var TinyColor =
|
|
16829
|
-
|
|
16830
|
-
if (color === void 0) color = "";
|
|
16831
|
-
if (opts === void 0) opts = {};
|
|
16832
|
-
var _a;
|
|
16879
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
16880
|
+
var TinyColor = class TinyColor {
|
|
16881
|
+
constructor(color = "", opts = {}) {
|
|
16833
16882
|
if (color instanceof TinyColor) return color;
|
|
16834
16883
|
if (typeof color === "number") color = numberInputToObject(color);
|
|
16835
16884
|
this.originalInput = color;
|
|
16836
|
-
|
|
16885
|
+
const rgb = inputToRGB(color);
|
|
16837
16886
|
this.originalInput = color;
|
|
16838
16887
|
this.r = rgb.r;
|
|
16839
16888
|
this.g = rgb.g;
|
|
16840
16889
|
this.b = rgb.b;
|
|
16841
16890
|
this.a = rgb.a;
|
|
16842
16891
|
this.roundA = Math.round(100 * this.a) / 100;
|
|
16843
|
-
this.format =
|
|
16892
|
+
this.format = opts.format ?? rgb.format;
|
|
16844
16893
|
this.gradientType = opts.gradientType;
|
|
16845
16894
|
if (this.r < 1) this.r = Math.round(this.r);
|
|
16846
16895
|
if (this.g < 1) this.g = Math.round(this.g);
|
|
16847
16896
|
if (this.b < 1) this.b = Math.round(this.b);
|
|
16848
16897
|
this.isValid = rgb.ok;
|
|
16849
16898
|
}
|
|
16850
|
-
|
|
16899
|
+
isDark() {
|
|
16851
16900
|
return this.getBrightness() < 128;
|
|
16852
|
-
}
|
|
16853
|
-
|
|
16901
|
+
}
|
|
16902
|
+
isLight() {
|
|
16854
16903
|
return !this.isDark();
|
|
16855
|
-
}
|
|
16904
|
+
}
|
|
16856
16905
|
/**
|
|
16857
16906
|
* Returns the perceived brightness of the color, from 0-255.
|
|
16858
16907
|
*/
|
|
16859
|
-
|
|
16860
|
-
|
|
16908
|
+
getBrightness() {
|
|
16909
|
+
const rgb = this.toRgb();
|
|
16861
16910
|
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
|
|
16862
|
-
}
|
|
16911
|
+
}
|
|
16863
16912
|
/**
|
|
16864
16913
|
* Returns the perceived luminance of a color, from 0-1.
|
|
16865
16914
|
*/
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
|
|
16869
|
-
|
|
16870
|
-
|
|
16871
|
-
|
|
16872
|
-
|
|
16873
|
-
|
|
16915
|
+
getLuminance() {
|
|
16916
|
+
const rgb = this.toRgb();
|
|
16917
|
+
let R;
|
|
16918
|
+
let G;
|
|
16919
|
+
let B;
|
|
16920
|
+
const RsRGB = rgb.r / 255;
|
|
16921
|
+
const GsRGB = rgb.g / 255;
|
|
16922
|
+
const BsRGB = rgb.b / 255;
|
|
16874
16923
|
if (RsRGB <= .03928) R = RsRGB / 12.92;
|
|
16875
16924
|
else R = Math.pow((RsRGB + .055) / 1.055, 2.4);
|
|
16876
16925
|
if (GsRGB <= .03928) G = GsRGB / 12.92;
|
|
@@ -16878,177 +16927,173 @@ var TinyColor = function() {
|
|
|
16878
16927
|
if (BsRGB <= .03928) B = BsRGB / 12.92;
|
|
16879
16928
|
else B = Math.pow((BsRGB + .055) / 1.055, 2.4);
|
|
16880
16929
|
return .2126 * R + .7152 * G + .0722 * B;
|
|
16881
|
-
}
|
|
16930
|
+
}
|
|
16882
16931
|
/**
|
|
16883
16932
|
* Returns the alpha value of a color, from 0-1.
|
|
16884
16933
|
*/
|
|
16885
|
-
|
|
16934
|
+
getAlpha() {
|
|
16886
16935
|
return this.a;
|
|
16887
|
-
}
|
|
16936
|
+
}
|
|
16888
16937
|
/**
|
|
16889
16938
|
* Sets the alpha value on the current color.
|
|
16890
16939
|
*
|
|
16891
16940
|
* @param alpha - The new alpha value. The accepted range is 0-1.
|
|
16892
16941
|
*/
|
|
16893
|
-
|
|
16942
|
+
setAlpha(alpha) {
|
|
16894
16943
|
this.a = boundAlpha(alpha);
|
|
16895
16944
|
this.roundA = Math.round(100 * this.a) / 100;
|
|
16896
16945
|
return this;
|
|
16897
|
-
}
|
|
16946
|
+
}
|
|
16898
16947
|
/**
|
|
16899
16948
|
* Returns whether the color is monochrome.
|
|
16900
16949
|
*/
|
|
16901
|
-
|
|
16902
|
-
|
|
16903
|
-
|
|
16950
|
+
isMonochrome() {
|
|
16951
|
+
const { s } = this.toHsl();
|
|
16952
|
+
return s === 0;
|
|
16953
|
+
}
|
|
16904
16954
|
/**
|
|
16905
16955
|
* Returns the object as a HSVA object.
|
|
16906
16956
|
*/
|
|
16907
|
-
|
|
16908
|
-
|
|
16957
|
+
toHsv() {
|
|
16958
|
+
const hsv = rgbToHsv(this.r, this.g, this.b);
|
|
16909
16959
|
return {
|
|
16910
16960
|
h: hsv.h * 360,
|
|
16911
16961
|
s: hsv.s,
|
|
16912
16962
|
v: hsv.v,
|
|
16913
16963
|
a: this.a
|
|
16914
16964
|
};
|
|
16915
|
-
}
|
|
16965
|
+
}
|
|
16916
16966
|
/**
|
|
16917
16967
|
* Returns the hsva values interpolated into a string with the following format:
|
|
16918
16968
|
* "hsva(xxx, xxx, xxx, xx)".
|
|
16919
16969
|
*/
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
return this.a === 1 ?
|
|
16926
|
-
}
|
|
16970
|
+
toHsvString() {
|
|
16971
|
+
const hsv = rgbToHsv(this.r, this.g, this.b);
|
|
16972
|
+
const h = Math.round(hsv.h * 360);
|
|
16973
|
+
const s = Math.round(hsv.s * 100);
|
|
16974
|
+
const v = Math.round(hsv.v * 100);
|
|
16975
|
+
return this.a === 1 ? `hsv(${h}, ${s}%, ${v}%)` : `hsva(${h}, ${s}%, ${v}%, ${this.roundA})`;
|
|
16976
|
+
}
|
|
16927
16977
|
/**
|
|
16928
16978
|
* Returns the object as a HSLA object.
|
|
16929
16979
|
*/
|
|
16930
|
-
|
|
16931
|
-
|
|
16980
|
+
toHsl() {
|
|
16981
|
+
const hsl = rgbToHsl(this.r, this.g, this.b);
|
|
16932
16982
|
return {
|
|
16933
16983
|
h: hsl.h * 360,
|
|
16934
16984
|
s: hsl.s,
|
|
16935
16985
|
l: hsl.l,
|
|
16936
16986
|
a: this.a
|
|
16937
16987
|
};
|
|
16938
|
-
}
|
|
16988
|
+
}
|
|
16939
16989
|
/**
|
|
16940
16990
|
* Returns the hsla values interpolated into a string with the following format:
|
|
16941
16991
|
* "hsla(xxx, xxx, xxx, xx)".
|
|
16942
16992
|
*/
|
|
16943
|
-
|
|
16944
|
-
|
|
16945
|
-
|
|
16946
|
-
|
|
16947
|
-
|
|
16948
|
-
return this.a === 1 ?
|
|
16949
|
-
}
|
|
16993
|
+
toHslString() {
|
|
16994
|
+
const hsl = rgbToHsl(this.r, this.g, this.b);
|
|
16995
|
+
const h = Math.round(hsl.h * 360);
|
|
16996
|
+
const s = Math.round(hsl.s * 100);
|
|
16997
|
+
const l = Math.round(hsl.l * 100);
|
|
16998
|
+
return this.a === 1 ? `hsl(${h}, ${s}%, ${l}%)` : `hsla(${h}, ${s}%, ${l}%, ${this.roundA})`;
|
|
16999
|
+
}
|
|
16950
17000
|
/**
|
|
16951
17001
|
* Returns the hex value of the color.
|
|
16952
17002
|
* @param allow3Char will shorten hex value to 3 char if possible
|
|
16953
17003
|
*/
|
|
16954
|
-
|
|
16955
|
-
if (allow3Char === void 0) allow3Char = false;
|
|
17004
|
+
toHex(allow3Char = false) {
|
|
16956
17005
|
return rgbToHex(this.r, this.g, this.b, allow3Char);
|
|
16957
|
-
}
|
|
17006
|
+
}
|
|
16958
17007
|
/**
|
|
16959
17008
|
* Returns the hex value of the color -with a # prefixed.
|
|
16960
17009
|
* @param allow3Char will shorten hex value to 3 char if possible
|
|
16961
17010
|
*/
|
|
16962
|
-
|
|
16963
|
-
if (allow3Char === void 0) allow3Char = false;
|
|
17011
|
+
toHexString(allow3Char = false) {
|
|
16964
17012
|
return "#" + this.toHex(allow3Char);
|
|
16965
|
-
}
|
|
17013
|
+
}
|
|
16966
17014
|
/**
|
|
16967
17015
|
* Returns the hex 8 value of the color.
|
|
16968
17016
|
* @param allow4Char will shorten hex value to 4 char if possible
|
|
16969
17017
|
*/
|
|
16970
|
-
|
|
16971
|
-
if (allow4Char === void 0) allow4Char = false;
|
|
17018
|
+
toHex8(allow4Char = false) {
|
|
16972
17019
|
return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
|
|
16973
|
-
}
|
|
17020
|
+
}
|
|
16974
17021
|
/**
|
|
16975
17022
|
* Returns the hex 8 value of the color -with a # prefixed.
|
|
16976
17023
|
* @param allow4Char will shorten hex value to 4 char if possible
|
|
16977
17024
|
*/
|
|
16978
|
-
|
|
16979
|
-
if (allow4Char === void 0) allow4Char = false;
|
|
17025
|
+
toHex8String(allow4Char = false) {
|
|
16980
17026
|
return "#" + this.toHex8(allow4Char);
|
|
16981
|
-
}
|
|
17027
|
+
}
|
|
16982
17028
|
/**
|
|
16983
17029
|
* Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
|
|
16984
17030
|
* @param allowShortChar will shorten hex value to 3 or 4 char if possible
|
|
16985
17031
|
*/
|
|
16986
|
-
|
|
16987
|
-
if (allowShortChar === void 0) allowShortChar = false;
|
|
17032
|
+
toHexShortString(allowShortChar = false) {
|
|
16988
17033
|
return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
|
|
16989
|
-
}
|
|
17034
|
+
}
|
|
16990
17035
|
/**
|
|
16991
17036
|
* Returns the object as a RGBA object.
|
|
16992
17037
|
*/
|
|
16993
|
-
|
|
17038
|
+
toRgb() {
|
|
16994
17039
|
return {
|
|
16995
17040
|
r: Math.round(this.r),
|
|
16996
17041
|
g: Math.round(this.g),
|
|
16997
17042
|
b: Math.round(this.b),
|
|
16998
17043
|
a: this.a
|
|
16999
17044
|
};
|
|
17000
|
-
}
|
|
17045
|
+
}
|
|
17001
17046
|
/**
|
|
17002
17047
|
* Returns the RGBA values interpolated into a string with the following format:
|
|
17003
17048
|
* "RGBA(xxx, xxx, xxx, xx)".
|
|
17004
17049
|
*/
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
return this.a === 1 ?
|
|
17010
|
-
}
|
|
17050
|
+
toRgbString() {
|
|
17051
|
+
const r = Math.round(this.r);
|
|
17052
|
+
const g = Math.round(this.g);
|
|
17053
|
+
const b = Math.round(this.b);
|
|
17054
|
+
return this.a === 1 ? `rgb(${r}, ${g}, ${b})` : `rgba(${r}, ${g}, ${b}, ${this.roundA})`;
|
|
17055
|
+
}
|
|
17011
17056
|
/**
|
|
17012
17057
|
* Returns the object as a RGBA object.
|
|
17013
17058
|
*/
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
return "".concat(Math.round(bound01(x, 255) * 100), "%");
|
|
17017
|
-
};
|
|
17059
|
+
toPercentageRgb() {
|
|
17060
|
+
const fmt = (x) => `${Math.round(bound01(x, 255) * 100)}%`;
|
|
17018
17061
|
return {
|
|
17019
17062
|
r: fmt(this.r),
|
|
17020
17063
|
g: fmt(this.g),
|
|
17021
17064
|
b: fmt(this.b),
|
|
17022
17065
|
a: this.a
|
|
17023
17066
|
};
|
|
17024
|
-
}
|
|
17067
|
+
}
|
|
17025
17068
|
/**
|
|
17026
17069
|
* Returns the RGBA relative values interpolated into a string
|
|
17027
17070
|
*/
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
|
|
17071
|
+
toPercentageRgbString() {
|
|
17072
|
+
const rnd = (x) => Math.round(bound01(x, 255) * 100);
|
|
17073
|
+
return this.a === 1 ? `rgb(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%)` : `rgba(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%, ${this.roundA})`;
|
|
17074
|
+
}
|
|
17075
|
+
toCmyk() {
|
|
17076
|
+
return { ...rgbToCmyk(this.r, this.g, this.b) };
|
|
17077
|
+
}
|
|
17078
|
+
toCmykString() {
|
|
17079
|
+
const { c, m, y, k } = rgbToCmyk(this.r, this.g, this.b);
|
|
17080
|
+
return `cmyk(${c}, ${m}, ${y}, ${k})`;
|
|
17081
|
+
}
|
|
17034
17082
|
/**
|
|
17035
17083
|
* The 'real' name of the color -if there is one.
|
|
17036
17084
|
*/
|
|
17037
|
-
|
|
17085
|
+
toName() {
|
|
17038
17086
|
if (this.a === 0) return "transparent";
|
|
17039
17087
|
if (this.a < 1) return false;
|
|
17040
|
-
|
|
17041
|
-
for (
|
|
17042
|
-
var _b = _a[_i], key = _b[0];
|
|
17043
|
-
if (hex === _b[1]) return key;
|
|
17044
|
-
}
|
|
17088
|
+
const hex = "#" + rgbToHex(this.r, this.g, this.b, false);
|
|
17089
|
+
for (const [key, value] of Object.entries(names)) if (hex === value) return key;
|
|
17045
17090
|
return false;
|
|
17046
|
-
}
|
|
17047
|
-
|
|
17048
|
-
|
|
17049
|
-
format = format
|
|
17050
|
-
|
|
17051
|
-
|
|
17091
|
+
}
|
|
17092
|
+
toString(format) {
|
|
17093
|
+
const formatSet = Boolean(format);
|
|
17094
|
+
format = format ?? this.format;
|
|
17095
|
+
let formattedString = false;
|
|
17096
|
+
const hasAlpha = this.a < 1 && this.a >= 0;
|
|
17052
17097
|
if (!formatSet && hasAlpha && (format.startsWith("hex") || format === "name")) {
|
|
17053
17098
|
if (format === "name" && this.a === 0) return this.toName();
|
|
17054
17099
|
return this.toRgbString();
|
|
@@ -17062,151 +17107,141 @@ var TinyColor = function() {
|
|
|
17062
17107
|
if (format === "name") formattedString = this.toName();
|
|
17063
17108
|
if (format === "hsl") formattedString = this.toHslString();
|
|
17064
17109
|
if (format === "hsv") formattedString = this.toHsvString();
|
|
17110
|
+
if (format === "cmyk") formattedString = this.toCmykString();
|
|
17065
17111
|
return formattedString || this.toHexString();
|
|
17066
|
-
}
|
|
17067
|
-
|
|
17112
|
+
}
|
|
17113
|
+
toNumber() {
|
|
17068
17114
|
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
|
|
17069
|
-
}
|
|
17070
|
-
|
|
17115
|
+
}
|
|
17116
|
+
clone() {
|
|
17071
17117
|
return new TinyColor(this.toString());
|
|
17072
|
-
}
|
|
17118
|
+
}
|
|
17073
17119
|
/**
|
|
17074
17120
|
* Lighten the color a given amount. Providing 100 will always return white.
|
|
17075
17121
|
* @param amount - valid between 1-100
|
|
17076
17122
|
*/
|
|
17077
|
-
|
|
17078
|
-
|
|
17079
|
-
var hsl = this.toHsl();
|
|
17123
|
+
lighten(amount = 10) {
|
|
17124
|
+
const hsl = this.toHsl();
|
|
17080
17125
|
hsl.l += amount / 100;
|
|
17081
17126
|
hsl.l = clamp01(hsl.l);
|
|
17082
17127
|
return new TinyColor(hsl);
|
|
17083
|
-
}
|
|
17128
|
+
}
|
|
17084
17129
|
/**
|
|
17085
17130
|
* Brighten the color a given amount, from 0 to 100.
|
|
17086
17131
|
* @param amount - valid between 1-100
|
|
17087
17132
|
*/
|
|
17088
|
-
|
|
17089
|
-
|
|
17090
|
-
var rgb = this.toRgb();
|
|
17133
|
+
brighten(amount = 10) {
|
|
17134
|
+
const rgb = this.toRgb();
|
|
17091
17135
|
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
|
|
17092
17136
|
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
|
|
17093
17137
|
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
|
|
17094
17138
|
return new TinyColor(rgb);
|
|
17095
|
-
}
|
|
17139
|
+
}
|
|
17096
17140
|
/**
|
|
17097
17141
|
* Darken the color a given amount, from 0 to 100.
|
|
17098
17142
|
* Providing 100 will always return black.
|
|
17099
17143
|
* @param amount - valid between 1-100
|
|
17100
17144
|
*/
|
|
17101
|
-
|
|
17102
|
-
|
|
17103
|
-
var hsl = this.toHsl();
|
|
17145
|
+
darken(amount = 10) {
|
|
17146
|
+
const hsl = this.toHsl();
|
|
17104
17147
|
hsl.l -= amount / 100;
|
|
17105
17148
|
hsl.l = clamp01(hsl.l);
|
|
17106
17149
|
return new TinyColor(hsl);
|
|
17107
|
-
}
|
|
17150
|
+
}
|
|
17108
17151
|
/**
|
|
17109
17152
|
* Mix the color with pure white, from 0 to 100.
|
|
17110
17153
|
* Providing 0 will do nothing, providing 100 will always return white.
|
|
17111
17154
|
* @param amount - valid between 1-100
|
|
17112
17155
|
*/
|
|
17113
|
-
|
|
17114
|
-
if (amount === void 0) amount = 10;
|
|
17156
|
+
tint(amount = 10) {
|
|
17115
17157
|
return this.mix("white", amount);
|
|
17116
|
-
}
|
|
17158
|
+
}
|
|
17117
17159
|
/**
|
|
17118
17160
|
* Mix the color with pure black, from 0 to 100.
|
|
17119
17161
|
* Providing 0 will do nothing, providing 100 will always return black.
|
|
17120
17162
|
* @param amount - valid between 1-100
|
|
17121
17163
|
*/
|
|
17122
|
-
|
|
17123
|
-
if (amount === void 0) amount = 10;
|
|
17164
|
+
shade(amount = 10) {
|
|
17124
17165
|
return this.mix("black", amount);
|
|
17125
|
-
}
|
|
17166
|
+
}
|
|
17126
17167
|
/**
|
|
17127
17168
|
* Desaturate the color a given amount, from 0 to 100.
|
|
17128
17169
|
* Providing 100 will is the same as calling greyscale
|
|
17129
17170
|
* @param amount - valid between 1-100
|
|
17130
17171
|
*/
|
|
17131
|
-
|
|
17132
|
-
|
|
17133
|
-
var hsl = this.toHsl();
|
|
17172
|
+
desaturate(amount = 10) {
|
|
17173
|
+
const hsl = this.toHsl();
|
|
17134
17174
|
hsl.s -= amount / 100;
|
|
17135
17175
|
hsl.s = clamp01(hsl.s);
|
|
17136
17176
|
return new TinyColor(hsl);
|
|
17137
|
-
}
|
|
17177
|
+
}
|
|
17138
17178
|
/**
|
|
17139
17179
|
* Saturate the color a given amount, from 0 to 100.
|
|
17140
17180
|
* @param amount - valid between 1-100
|
|
17141
17181
|
*/
|
|
17142
|
-
|
|
17143
|
-
|
|
17144
|
-
var hsl = this.toHsl();
|
|
17182
|
+
saturate(amount = 10) {
|
|
17183
|
+
const hsl = this.toHsl();
|
|
17145
17184
|
hsl.s += amount / 100;
|
|
17146
17185
|
hsl.s = clamp01(hsl.s);
|
|
17147
17186
|
return new TinyColor(hsl);
|
|
17148
|
-
}
|
|
17187
|
+
}
|
|
17149
17188
|
/**
|
|
17150
17189
|
* Completely desaturates a color into greyscale.
|
|
17151
17190
|
* Same as calling `desaturate(100)`
|
|
17152
17191
|
*/
|
|
17153
|
-
|
|
17192
|
+
greyscale() {
|
|
17154
17193
|
return this.desaturate(100);
|
|
17155
|
-
}
|
|
17194
|
+
}
|
|
17156
17195
|
/**
|
|
17157
17196
|
* Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
|
|
17158
17197
|
* Values outside of this range will be wrapped into this range.
|
|
17159
17198
|
*/
|
|
17160
|
-
|
|
17161
|
-
|
|
17162
|
-
|
|
17199
|
+
spin(amount) {
|
|
17200
|
+
const hsl = this.toHsl();
|
|
17201
|
+
const hue = (hsl.h + amount) % 360;
|
|
17163
17202
|
hsl.h = hue < 0 ? 360 + hue : hue;
|
|
17164
17203
|
return new TinyColor(hsl);
|
|
17165
|
-
}
|
|
17204
|
+
}
|
|
17166
17205
|
/**
|
|
17167
17206
|
* Mix the current color a given amount with another color, from 0 to 100.
|
|
17168
17207
|
* 0 means no mixing (return current color).
|
|
17169
17208
|
*/
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
var p = amount / 100;
|
|
17209
|
+
mix(color, amount = 50) {
|
|
17210
|
+
const rgb1 = this.toRgb();
|
|
17211
|
+
const rgb2 = new TinyColor(color).toRgb();
|
|
17212
|
+
const p = amount / 100;
|
|
17175
17213
|
return new TinyColor({
|
|
17176
17214
|
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
17177
17215
|
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
17178
17216
|
b: (rgb2.b - rgb1.b) * p + rgb1.b,
|
|
17179
17217
|
a: (rgb2.a - rgb1.a) * p + rgb1.a
|
|
17180
17218
|
});
|
|
17181
|
-
}
|
|
17182
|
-
|
|
17183
|
-
|
|
17184
|
-
|
|
17185
|
-
|
|
17186
|
-
var part = 360 / slices;
|
|
17187
|
-
var ret = [this];
|
|
17219
|
+
}
|
|
17220
|
+
analogous(results = 6, slices = 30) {
|
|
17221
|
+
const hsl = this.toHsl();
|
|
17222
|
+
const part = 360 / slices;
|
|
17223
|
+
const ret = [this];
|
|
17188
17224
|
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
|
|
17189
17225
|
hsl.h = (hsl.h + part) % 360;
|
|
17190
17226
|
ret.push(new TinyColor(hsl));
|
|
17191
17227
|
}
|
|
17192
17228
|
return ret;
|
|
17193
|
-
}
|
|
17229
|
+
}
|
|
17194
17230
|
/**
|
|
17195
17231
|
* taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
|
|
17196
17232
|
*/
|
|
17197
|
-
|
|
17198
|
-
|
|
17233
|
+
complement() {
|
|
17234
|
+
const hsl = this.toHsl();
|
|
17199
17235
|
hsl.h = (hsl.h + 180) % 360;
|
|
17200
17236
|
return new TinyColor(hsl);
|
|
17201
|
-
}
|
|
17202
|
-
|
|
17203
|
-
|
|
17204
|
-
|
|
17205
|
-
|
|
17206
|
-
|
|
17207
|
-
|
|
17208
|
-
|
|
17209
|
-
var modification = 1 / results;
|
|
17237
|
+
}
|
|
17238
|
+
monochromatic(results = 6) {
|
|
17239
|
+
const hsv = this.toHsv();
|
|
17240
|
+
const { h } = hsv;
|
|
17241
|
+
const { s } = hsv;
|
|
17242
|
+
let { v } = hsv;
|
|
17243
|
+
const res = [];
|
|
17244
|
+
const modification = 1 / results;
|
|
17210
17245
|
while (results--) {
|
|
17211
17246
|
res.push(new TinyColor({
|
|
17212
17247
|
h,
|
|
@@ -17216,10 +17251,10 @@ var TinyColor = function() {
|
|
|
17216
17251
|
v = (v + modification) % 1;
|
|
17217
17252
|
}
|
|
17218
17253
|
return res;
|
|
17219
|
-
}
|
|
17220
|
-
|
|
17221
|
-
|
|
17222
|
-
|
|
17254
|
+
}
|
|
17255
|
+
splitcomplement() {
|
|
17256
|
+
const hsl = this.toHsl();
|
|
17257
|
+
const { h } = hsl;
|
|
17223
17258
|
return [
|
|
17224
17259
|
this,
|
|
17225
17260
|
new TinyColor({
|
|
@@ -17233,57 +17268,62 @@ var TinyColor = function() {
|
|
|
17233
17268
|
l: hsl.l
|
|
17234
17269
|
})
|
|
17235
17270
|
];
|
|
17236
|
-
}
|
|
17271
|
+
}
|
|
17237
17272
|
/**
|
|
17238
17273
|
* Compute how the color would appear on a background
|
|
17239
17274
|
*/
|
|
17240
|
-
|
|
17241
|
-
|
|
17242
|
-
|
|
17243
|
-
|
|
17275
|
+
onBackground(background) {
|
|
17276
|
+
const fg = this.toRgb();
|
|
17277
|
+
const bg = new TinyColor(background).toRgb();
|
|
17278
|
+
const alpha = fg.a + bg.a * (1 - fg.a);
|
|
17244
17279
|
return new TinyColor({
|
|
17245
17280
|
r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
|
|
17246
17281
|
g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
|
|
17247
17282
|
b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
|
|
17248
17283
|
a: alpha
|
|
17249
17284
|
});
|
|
17250
|
-
}
|
|
17285
|
+
}
|
|
17251
17286
|
/**
|
|
17252
17287
|
* Alias for `polyad(3)`
|
|
17253
17288
|
*/
|
|
17254
|
-
|
|
17289
|
+
triad() {
|
|
17255
17290
|
return this.polyad(3);
|
|
17256
|
-
}
|
|
17291
|
+
}
|
|
17257
17292
|
/**
|
|
17258
17293
|
* Alias for `polyad(4)`
|
|
17259
17294
|
*/
|
|
17260
|
-
|
|
17295
|
+
tetrad() {
|
|
17261
17296
|
return this.polyad(4);
|
|
17262
|
-
}
|
|
17297
|
+
}
|
|
17263
17298
|
/**
|
|
17264
17299
|
* Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
|
|
17265
17300
|
* monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
|
|
17266
17301
|
*/
|
|
17267
|
-
|
|
17268
|
-
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
for (
|
|
17302
|
+
polyad(n) {
|
|
17303
|
+
const hsl = this.toHsl();
|
|
17304
|
+
const { h } = hsl;
|
|
17305
|
+
const result = [this];
|
|
17306
|
+
const increment = 360 / n;
|
|
17307
|
+
for (let i = 1; i < n; i++) result.push(new TinyColor({
|
|
17273
17308
|
h: (h + i * increment) % 360,
|
|
17274
17309
|
s: hsl.s,
|
|
17275
17310
|
l: hsl.l
|
|
17276
17311
|
}));
|
|
17277
17312
|
return result;
|
|
17278
|
-
}
|
|
17313
|
+
}
|
|
17279
17314
|
/**
|
|
17280
17315
|
* compare color vs current color
|
|
17281
17316
|
*/
|
|
17282
|
-
|
|
17283
|
-
|
|
17284
|
-
|
|
17285
|
-
|
|
17286
|
-
|
|
17317
|
+
equals(color) {
|
|
17318
|
+
const comparedColor = new TinyColor(color);
|
|
17319
|
+
/**
|
|
17320
|
+
* RGB and CMYK do not have the same color gamut, so a CMYK conversion will never be 100%.
|
|
17321
|
+
* This means we need to compare CMYK to CMYK to ensure accuracy of the equals function.
|
|
17322
|
+
*/
|
|
17323
|
+
if (this.format === "cmyk" || comparedColor.format === "cmyk") return this.toCmykString() === comparedColor.toCmykString();
|
|
17324
|
+
return this.toRgbString() === comparedColor.toRgbString();
|
|
17325
|
+
}
|
|
17326
|
+
};
|
|
17287
17327
|
|
|
17288
17328
|
//#endregion
|
|
17289
17329
|
//#region ../../packages/components/button/src/button-custom.ts
|
|
@@ -41276,7 +41316,7 @@ const sliderProps = buildProps({
|
|
|
41276
41316
|
default: 100
|
|
41277
41317
|
},
|
|
41278
41318
|
step: {
|
|
41279
|
-
type: Number,
|
|
41319
|
+
type: definePropType([Number, String]),
|
|
41280
41320
|
default: 1
|
|
41281
41321
|
},
|
|
41282
41322
|
showInput: Boolean,
|
|
@@ -41370,7 +41410,7 @@ const useLifecycle = (props, initData, resetSize) => {
|
|
|
41370
41410
|
//#endregion
|
|
41371
41411
|
//#region ../../packages/components/slider/src/composables/use-marks.ts
|
|
41372
41412
|
const useMarks = (props) => {
|
|
41373
|
-
|
|
41413
|
+
const markList = computed(() => {
|
|
41374
41414
|
if (!props.marks) return [];
|
|
41375
41415
|
return Object.keys(props.marks).map(Number.parseFloat).sort((a, b) => a - b).filter((point) => point <= props.max && point >= props.min).map((point) => ({
|
|
41376
41416
|
point,
|
|
@@ -41378,6 +41418,19 @@ const useMarks = (props) => {
|
|
|
41378
41418
|
mark: props.marks[point]
|
|
41379
41419
|
}));
|
|
41380
41420
|
});
|
|
41421
|
+
watchEffect(() => {
|
|
41422
|
+
if (props.step === "mark" && !props.marks) /* @__PURE__ */ debugWarn("ElSlider", "marks prop must be provided when step is mark");
|
|
41423
|
+
if (props.marks) {
|
|
41424
|
+
const keys = Object.keys(props.marks);
|
|
41425
|
+
const validPoints = markList.value.map((m) => m.point);
|
|
41426
|
+
const invalidKeys = keys.filter((key) => {
|
|
41427
|
+
const parsed = Number.parseFloat(key);
|
|
41428
|
+
return Number.isNaN(parsed) || !validPoints.includes(parsed);
|
|
41429
|
+
});
|
|
41430
|
+
if (invalidKeys.length > 0) /* @__PURE__ */ debugWarn("ElSlider", `Some marks keys are invalid (not a number or out of [min, max]): [${invalidKeys.map((k) => `'${k}'`).join(", ")}] and will be ignored.`);
|
|
41431
|
+
}
|
|
41432
|
+
});
|
|
41433
|
+
return markList;
|
|
41381
41434
|
};
|
|
41382
41435
|
|
|
41383
41436
|
//#endregion
|
|
@@ -41521,7 +41574,7 @@ const useTooltip = (props, formatTooltip, showTooltip) => {
|
|
|
41521
41574
|
};
|
|
41522
41575
|
};
|
|
41523
41576
|
const useSliderButton = (props, initData, emit) => {
|
|
41524
|
-
const { disabled, min, max, step, showTooltip, persistent, precision, sliderSize, formatTooltip, emitChange, resetSize, updateDragging } = inject(sliderContextKey);
|
|
41577
|
+
const { disabled, min, max, step, showTooltip, persistent, precision, sliderSize, formatTooltip, emitChange, resetSize, updateDragging, markList } = inject(sliderContextKey);
|
|
41525
41578
|
const { tooltip, tooltipVisible, formatValue, displayTooltip, hideTooltip } = useTooltip(props, formatTooltip, showTooltip);
|
|
41526
41579
|
const button = ref();
|
|
41527
41580
|
const currentPosition = computed(() => {
|
|
@@ -41530,6 +41583,9 @@ const useSliderButton = (props, initData, emit) => {
|
|
|
41530
41583
|
const wrapperStyle = computed(() => {
|
|
41531
41584
|
return props.vertical ? { bottom: currentPosition.value } : { left: currentPosition.value };
|
|
41532
41585
|
});
|
|
41586
|
+
const shouldMoveToMark = computed(() => {
|
|
41587
|
+
return step.value === "mark" && markList.value.length > 0;
|
|
41588
|
+
});
|
|
41533
41589
|
const handleMouseEnter = () => {
|
|
41534
41590
|
initData.hovering = true;
|
|
41535
41591
|
displayTooltip();
|
|
@@ -41555,17 +41611,49 @@ const useSliderButton = (props, initData, emit) => {
|
|
|
41555
41611
|
setPosition(initData.newPosition);
|
|
41556
41612
|
emitChange();
|
|
41557
41613
|
};
|
|
41614
|
+
const moveToMark = (amount) => {
|
|
41615
|
+
if (disabled.value || !markList.value.length) return;
|
|
41616
|
+
const current = props.modelValue;
|
|
41617
|
+
const epsilon = Number.EPSILON;
|
|
41618
|
+
const stride = Math.abs(amount);
|
|
41619
|
+
let target;
|
|
41620
|
+
if (amount > 0) {
|
|
41621
|
+
const startIndex = markList.value.findIndex((m) => m.point > current + epsilon);
|
|
41622
|
+
if (startIndex !== -1) {
|
|
41623
|
+
const targetIndex = Math.min(startIndex + stride - 1, markList.value.length - 1);
|
|
41624
|
+
target = markList.value[targetIndex].point;
|
|
41625
|
+
}
|
|
41626
|
+
} else {
|
|
41627
|
+
let startIndex = -1;
|
|
41628
|
+
for (let i = markList.value.length - 1; i >= 0; i--) if (markList.value[i].point < current - epsilon) {
|
|
41629
|
+
startIndex = i;
|
|
41630
|
+
break;
|
|
41631
|
+
}
|
|
41632
|
+
if (startIndex !== -1) {
|
|
41633
|
+
const targetIndex = Math.max(startIndex - (stride - 1), 0);
|
|
41634
|
+
target = markList.value[targetIndex].point;
|
|
41635
|
+
}
|
|
41636
|
+
}
|
|
41637
|
+
if (target !== void 0 && target !== current) {
|
|
41638
|
+
setPosition((target - min.value) / (max.value - min.value) * 100);
|
|
41639
|
+
emitChange();
|
|
41640
|
+
}
|
|
41641
|
+
};
|
|
41558
41642
|
const onLeftKeyDown = () => {
|
|
41559
|
-
|
|
41643
|
+
if (shouldMoveToMark.value) moveToMark(-1);
|
|
41644
|
+
else if (isNumber(step.value)) incrementPosition(-step.value);
|
|
41560
41645
|
};
|
|
41561
41646
|
const onRightKeyDown = () => {
|
|
41562
|
-
|
|
41647
|
+
if (shouldMoveToMark.value) moveToMark(1);
|
|
41648
|
+
else if (isNumber(step.value)) incrementPosition(step.value);
|
|
41563
41649
|
};
|
|
41564
41650
|
const onPageDownKeyDown = () => {
|
|
41565
|
-
|
|
41651
|
+
if (shouldMoveToMark.value) moveToMark(-4);
|
|
41652
|
+
else if (isNumber(step.value)) incrementPosition(-step.value * 4);
|
|
41566
41653
|
};
|
|
41567
41654
|
const onPageUpKeyDown = () => {
|
|
41568
|
-
|
|
41655
|
+
if (shouldMoveToMark.value) moveToMark(4);
|
|
41656
|
+
else if (isNumber(step.value)) incrementPosition(step.value * 4);
|
|
41569
41657
|
};
|
|
41570
41658
|
const onHomeKeyDown = () => {
|
|
41571
41659
|
if (disabled.value) return;
|
|
@@ -41667,17 +41755,23 @@ const useSliderButton = (props, initData, emit) => {
|
|
|
41667
41755
|
const setPosition = async (newPosition) => {
|
|
41668
41756
|
if (newPosition === null || Number.isNaN(+newPosition)) return;
|
|
41669
41757
|
newPosition = clamp$1(newPosition, 0, 100);
|
|
41670
|
-
const fullSteps = Math.floor((max.value - min.value) / step.value);
|
|
41671
|
-
const fullRangePercentage = fullSteps * step.value / (max.value - min.value) * 100;
|
|
41672
|
-
const threshold = fullRangePercentage + (100 - fullRangePercentage) / 2;
|
|
41673
41758
|
let value;
|
|
41674
|
-
if (
|
|
41675
|
-
|
|
41676
|
-
|
|
41677
|
-
|
|
41678
|
-
|
|
41679
|
-
|
|
41680
|
-
|
|
41759
|
+
if (step.value === "mark") if (markList.value.length === 0) value = newPosition <= 50 ? min.value : max.value;
|
|
41760
|
+
else value = markList.value.reduce((prev, curr) => {
|
|
41761
|
+
return Math.abs(curr.position - newPosition) < Math.abs(prev.position - newPosition) ? curr : prev;
|
|
41762
|
+
}).point;
|
|
41763
|
+
else {
|
|
41764
|
+
const fullSteps = Math.floor((max.value - min.value) / step.value);
|
|
41765
|
+
const fullRangePercentage = fullSteps * step.value / (max.value - min.value) * 100;
|
|
41766
|
+
const threshold = fullRangePercentage + (100 - fullRangePercentage) / 2;
|
|
41767
|
+
if (newPosition < fullRangePercentage) {
|
|
41768
|
+
const valueBetween = fullRangePercentage / fullSteps;
|
|
41769
|
+
const steps = Math.round(newPosition / valueBetween);
|
|
41770
|
+
value = min.value + steps * step.value;
|
|
41771
|
+
} else if (newPosition < threshold) value = min.value + fullSteps * step.value;
|
|
41772
|
+
else value = max.value;
|
|
41773
|
+
value = Number.parseFloat(value.toFixed(precision.value));
|
|
41774
|
+
}
|
|
41681
41775
|
if (value !== props.modelValue) emit(UPDATE_MODEL_EVENT, value);
|
|
41682
41776
|
if (!initData.dragging && props.modelValue !== initData.oldValue) initData.oldValue = props.modelValue;
|
|
41683
41777
|
await nextTick();
|
|
@@ -41710,8 +41804,8 @@ const useSliderButton = (props, initData, emit) => {
|
|
|
41710
41804
|
const useStops = (props, initData, minValue, maxValue) => {
|
|
41711
41805
|
const stops = computed(() => {
|
|
41712
41806
|
if (!props.showStops || props.min > props.max) return [];
|
|
41713
|
-
if (props.step === 0) {
|
|
41714
|
-
/* @__PURE__ */ debugWarn("ElSlider", "step should not be 0.");
|
|
41807
|
+
if (props.step === "mark" || props.step === 0) {
|
|
41808
|
+
if (props.step === 0) /* @__PURE__ */ debugWarn("ElSlider", "step should not be 0.");
|
|
41715
41809
|
return [];
|
|
41716
41810
|
}
|
|
41717
41811
|
const stopCount = Math.ceil((props.max - props.min) / props.step);
|
|
@@ -41937,6 +42031,9 @@ var slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
41937
42031
|
const { inputId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: elFormItem });
|
|
41938
42032
|
const sliderWrapperSize = useFormSize();
|
|
41939
42033
|
const sliderInputSize = computed(() => props.inputSize || sliderWrapperSize.value);
|
|
42034
|
+
const renderInput = computed(() => {
|
|
42035
|
+
return props.showInput && !props.range && props.step !== "mark";
|
|
42036
|
+
});
|
|
41940
42037
|
const groupLabel = computed(() => {
|
|
41941
42038
|
return props.ariaLabel || t("el.slider.defaultLabel", {
|
|
41942
42039
|
min: props.min,
|
|
@@ -41960,15 +42057,19 @@ var slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
41960
42057
|
ns.b(),
|
|
41961
42058
|
ns.m(sliderWrapperSize.value),
|
|
41962
42059
|
ns.is("vertical", props.vertical),
|
|
41963
|
-
{ [ns.m("with-input")]:
|
|
42060
|
+
{ [ns.m("with-input")]: renderInput.value }
|
|
41964
42061
|
]);
|
|
41965
42062
|
const markList = useMarks(props);
|
|
41966
42063
|
useWatch(props, initData, minValue, maxValue, emit, elFormItem);
|
|
42064
|
+
const sliderInputStep = computed(() => {
|
|
42065
|
+
return isNumber(props.step) ? props.step : 1;
|
|
42066
|
+
});
|
|
41967
42067
|
const precision = computed(() => {
|
|
42068
|
+
const stepValue = isNumber(props.step) ? props.step : 1;
|
|
41968
42069
|
const precisions = [
|
|
41969
42070
|
props.min,
|
|
41970
42071
|
props.max,
|
|
41971
|
-
|
|
42072
|
+
stepValue
|
|
41972
42073
|
].map((item) => {
|
|
41973
42074
|
const decimal = `${item}`.split(".")[1];
|
|
41974
42075
|
return decimal ? decimal.length : 0;
|
|
@@ -41987,6 +42088,7 @@ var slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
41987
42088
|
sliderSize,
|
|
41988
42089
|
disabled: sliderDisabled,
|
|
41989
42090
|
precision,
|
|
42091
|
+
markList,
|
|
41990
42092
|
emitChange,
|
|
41991
42093
|
resetSize,
|
|
41992
42094
|
updateDragging
|
|
@@ -42006,7 +42108,7 @@ var slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
42006
42108
|
ref: slider,
|
|
42007
42109
|
class: normalizeClass([
|
|
42008
42110
|
unref(ns).e("runway"),
|
|
42009
|
-
{ "show-input":
|
|
42111
|
+
{ "show-input": renderInput.value },
|
|
42010
42112
|
unref(ns).is("disabled", unref(sliderDisabled))
|
|
42011
42113
|
]),
|
|
42012
42114
|
style: normalizeStyle(unref(runwayStyle)),
|
|
@@ -42107,12 +42209,12 @@ var slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
42107
42209
|
"onMousedown"
|
|
42108
42210
|
]);
|
|
42109
42211
|
}), 128))], 2)], 64)) : createCommentVNode("v-if", true)
|
|
42110
|
-
], 38),
|
|
42212
|
+
], 38), renderInput.value ? (openBlock(), createBlock(unref(ElInputNumber), {
|
|
42111
42213
|
key: 0,
|
|
42112
42214
|
ref: "input",
|
|
42113
42215
|
"model-value": unref(firstValue),
|
|
42114
42216
|
class: normalizeClass(unref(ns).e("input")),
|
|
42115
|
-
step:
|
|
42217
|
+
step: sliderInputStep.value,
|
|
42116
42218
|
disabled: unref(sliderDisabled),
|
|
42117
42219
|
controls: _ctx.showInputControls,
|
|
42118
42220
|
min: _ctx.min,
|