@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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Element Plus v0.0.
|
|
1
|
+
/*! Element Plus v0.0.20260310 */
|
|
2
2
|
|
|
3
3
|
(function(global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -10462,7 +10462,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
10462
10462
|
|
|
10463
10463
|
//#endregion
|
|
10464
10464
|
//#region ../../packages/element-plus/version.ts
|
|
10465
|
-
const version$1 = "0.0.
|
|
10465
|
+
const version$1 = "0.0.20260310";
|
|
10466
10466
|
|
|
10467
10467
|
//#endregion
|
|
10468
10468
|
//#region ../../packages/element-plus/make-installer.ts
|
|
@@ -13852,6 +13852,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
13852
13852
|
});
|
|
13853
13853
|
(0, vue.watch)(() => props.disabled, (disabled) => {
|
|
13854
13854
|
if (disabled && open.value) open.value = false;
|
|
13855
|
+
if (!disabled && isBoolean(props.visible)) open.value = props.visible;
|
|
13855
13856
|
});
|
|
13856
13857
|
const isFocusInsideContent = (event) => {
|
|
13857
13858
|
return contentRef.value?.isFocusInsideContent(event);
|
|
@@ -16207,14 +16208,14 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16207
16208
|
};
|
|
16208
16209
|
|
|
16209
16210
|
//#endregion
|
|
16210
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16211
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/util.js
|
|
16211
16212
|
/**
|
|
16212
16213
|
* Take input from [0, n] and return it as [0, 1]
|
|
16213
16214
|
* @hidden
|
|
16214
16215
|
*/
|
|
16215
16216
|
function bound01(n, max) {
|
|
16216
16217
|
if (isOnePointZero(n)) n = "100%";
|
|
16217
|
-
|
|
16218
|
+
const isPercent = isPercentage(n);
|
|
16218
16219
|
n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
|
|
16219
16220
|
if (isPercent) n = parseInt(String(n * max), 10) / 100;
|
|
16220
16221
|
if (Math.abs(n - max) < 1e-6) return 1;
|
|
@@ -16258,7 +16259,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16258
16259
|
* @hidden
|
|
16259
16260
|
*/
|
|
16260
16261
|
function convertToPercentage(n) {
|
|
16261
|
-
if (n <= 1) return
|
|
16262
|
+
if (Number(n) <= 1) return `${Number(n) * 100}%`;
|
|
16262
16263
|
return n;
|
|
16263
16264
|
}
|
|
16264
16265
|
/**
|
|
@@ -16270,7 +16271,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16270
16271
|
}
|
|
16271
16272
|
|
|
16272
16273
|
//#endregion
|
|
16273
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16274
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/conversion.js
|
|
16274
16275
|
/**
|
|
16275
16276
|
* Handle bounds / percentage checking to conform to CSS color spec
|
|
16276
16277
|
* <http://www.w3.org/TR/css3-color/>
|
|
@@ -16293,16 +16294,16 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16293
16294
|
r = bound01(r, 255);
|
|
16294
16295
|
g = bound01(g, 255);
|
|
16295
16296
|
b = bound01(b, 255);
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16297
|
+
const max = Math.max(r, g, b);
|
|
16298
|
+
const min = Math.min(r, g, b);
|
|
16299
|
+
let h = 0;
|
|
16300
|
+
let s = 0;
|
|
16301
|
+
const l = (max + min) / 2;
|
|
16301
16302
|
if (max === min) {
|
|
16302
16303
|
s = 0;
|
|
16303
16304
|
h = 0;
|
|
16304
16305
|
} else {
|
|
16305
|
-
|
|
16306
|
+
const d = max - min;
|
|
16306
16307
|
s = l > .5 ? d / (2 - max - min) : d / (max + min);
|
|
16307
16308
|
switch (max) {
|
|
16308
16309
|
case r:
|
|
@@ -16339,9 +16340,9 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16339
16340
|
* *Returns:* { r, g, b } in the set [0, 255]
|
|
16340
16341
|
*/
|
|
16341
16342
|
function hslToRgb(h, s, l) {
|
|
16342
|
-
|
|
16343
|
-
|
|
16344
|
-
|
|
16343
|
+
let r;
|
|
16344
|
+
let g;
|
|
16345
|
+
let b;
|
|
16345
16346
|
h = bound01(h, 360);
|
|
16346
16347
|
s = bound01(s, 100);
|
|
16347
16348
|
l = bound01(l, 100);
|
|
@@ -16350,8 +16351,8 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16350
16351
|
b = l;
|
|
16351
16352
|
r = l;
|
|
16352
16353
|
} else {
|
|
16353
|
-
|
|
16354
|
-
|
|
16354
|
+
const q = l < .5 ? l * (1 + s) : l + s - l * s;
|
|
16355
|
+
const p = 2 * l - q;
|
|
16355
16356
|
r = hue2rgb(p, q, h + 1 / 3);
|
|
16356
16357
|
g = hue2rgb(p, q, h);
|
|
16357
16358
|
b = hue2rgb(p, q, h - 1 / 3);
|
|
@@ -16372,12 +16373,12 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16372
16373
|
r = bound01(r, 255);
|
|
16373
16374
|
g = bound01(g, 255);
|
|
16374
16375
|
b = bound01(b, 255);
|
|
16375
|
-
|
|
16376
|
-
|
|
16377
|
-
|
|
16378
|
-
|
|
16379
|
-
|
|
16380
|
-
|
|
16376
|
+
const max = Math.max(r, g, b);
|
|
16377
|
+
const min = Math.min(r, g, b);
|
|
16378
|
+
let h = 0;
|
|
16379
|
+
const v = max;
|
|
16380
|
+
const d = max - min;
|
|
16381
|
+
const s = max === 0 ? 0 : d / max;
|
|
16381
16382
|
if (max === min) h = 0;
|
|
16382
16383
|
else {
|
|
16383
16384
|
switch (max) {
|
|
@@ -16410,13 +16411,13 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16410
16411
|
h = bound01(h, 360) * 6;
|
|
16411
16412
|
s = bound01(s, 100);
|
|
16412
16413
|
v = bound01(v, 100);
|
|
16413
|
-
|
|
16414
|
-
|
|
16415
|
-
|
|
16416
|
-
|
|
16417
|
-
|
|
16418
|
-
|
|
16419
|
-
|
|
16414
|
+
const i = Math.floor(h);
|
|
16415
|
+
const f = h - i;
|
|
16416
|
+
const p = v * (1 - s);
|
|
16417
|
+
const q = v * (1 - f * s);
|
|
16418
|
+
const t = v * (1 - (1 - f) * s);
|
|
16419
|
+
const mod = i % 6;
|
|
16420
|
+
const r = [
|
|
16420
16421
|
v,
|
|
16421
16422
|
q,
|
|
16422
16423
|
p,
|
|
@@ -16424,7 +16425,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16424
16425
|
t,
|
|
16425
16426
|
v
|
|
16426
16427
|
][mod];
|
|
16427
|
-
|
|
16428
|
+
const g = [
|
|
16428
16429
|
t,
|
|
16429
16430
|
v,
|
|
16430
16431
|
v,
|
|
@@ -16432,7 +16433,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16432
16433
|
p,
|
|
16433
16434
|
p
|
|
16434
16435
|
][mod];
|
|
16435
|
-
|
|
16436
|
+
const b = [
|
|
16436
16437
|
p,
|
|
16437
16438
|
p,
|
|
16438
16439
|
t,
|
|
@@ -16449,11 +16450,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16449
16450
|
/**
|
|
16450
16451
|
* Converts an RGB color to hex
|
|
16451
16452
|
*
|
|
16452
|
-
* Assumes r, g, and b are contained in the set [0, 255]
|
|
16453
|
-
* Returns a 3 or 6 character hex
|
|
16453
|
+
* *Assumes:* r, g, and b are contained in the set [0, 255]
|
|
16454
|
+
* *Returns:* a 3 or 6 character hex
|
|
16454
16455
|
*/
|
|
16455
16456
|
function rgbToHex(r, g, b, allow3Char) {
|
|
16456
|
-
|
|
16457
|
+
const hex = [
|
|
16457
16458
|
pad2(Math.round(r).toString(16)),
|
|
16458
16459
|
pad2(Math.round(g).toString(16)),
|
|
16459
16460
|
pad2(Math.round(b).toString(16))
|
|
@@ -16464,11 +16465,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16464
16465
|
/**
|
|
16465
16466
|
* Converts an RGBA color plus alpha transparency to hex
|
|
16466
16467
|
*
|
|
16467
|
-
* Assumes r, g, b are contained in the set [0, 255] and
|
|
16468
|
-
*
|
|
16468
|
+
* *Assumes:* r, g, b are contained in the set [0, 255] and a in [0, 1]
|
|
16469
|
+
* *Returns:* a 4 or 8 character rgba hex
|
|
16469
16470
|
*/
|
|
16470
16471
|
function rgbaToHex(r, g, b, a, allow4Char) {
|
|
16471
|
-
|
|
16472
|
+
const hex = [
|
|
16472
16473
|
pad2(Math.round(r).toString(16)),
|
|
16473
16474
|
pad2(Math.round(g).toString(16)),
|
|
16474
16475
|
pad2(Math.round(b).toString(16)),
|
|
@@ -16477,6 +16478,43 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16477
16478
|
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);
|
|
16478
16479
|
return hex.join("");
|
|
16479
16480
|
}
|
|
16481
|
+
/**
|
|
16482
|
+
* Converts CMYK to RBG
|
|
16483
|
+
* Assumes c, m, y, k are in the set [0, 100]
|
|
16484
|
+
*/
|
|
16485
|
+
function cmykToRgb(c, m, y, k) {
|
|
16486
|
+
const cConv = c / 100;
|
|
16487
|
+
const mConv = m / 100;
|
|
16488
|
+
const yConv = y / 100;
|
|
16489
|
+
const kConv = k / 100;
|
|
16490
|
+
return {
|
|
16491
|
+
r: 255 * (1 - cConv) * (1 - kConv),
|
|
16492
|
+
g: 255 * (1 - mConv) * (1 - kConv),
|
|
16493
|
+
b: 255 * (1 - yConv) * (1 - kConv)
|
|
16494
|
+
};
|
|
16495
|
+
}
|
|
16496
|
+
function rgbToCmyk(r, g, b) {
|
|
16497
|
+
let c = 1 - r / 255;
|
|
16498
|
+
let m = 1 - g / 255;
|
|
16499
|
+
let y = 1 - b / 255;
|
|
16500
|
+
let k = Math.min(c, m, y);
|
|
16501
|
+
if (k === 1) {
|
|
16502
|
+
c = 0;
|
|
16503
|
+
m = 0;
|
|
16504
|
+
y = 0;
|
|
16505
|
+
} else {
|
|
16506
|
+
c = (c - k) / (1 - k) * 100;
|
|
16507
|
+
m = (m - k) / (1 - k) * 100;
|
|
16508
|
+
y = (y - k) / (1 - k) * 100;
|
|
16509
|
+
}
|
|
16510
|
+
k *= 100;
|
|
16511
|
+
return {
|
|
16512
|
+
c: Math.round(c),
|
|
16513
|
+
m: Math.round(m),
|
|
16514
|
+
y: Math.round(y),
|
|
16515
|
+
k: Math.round(k)
|
|
16516
|
+
};
|
|
16517
|
+
}
|
|
16480
16518
|
/** Converts a decimal to a hex value */
|
|
16481
16519
|
function convertDecimalToHex(d) {
|
|
16482
16520
|
return Math.round(parseFloat(d) * 255).toString(16);
|
|
@@ -16498,11 +16536,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16498
16536
|
}
|
|
16499
16537
|
|
|
16500
16538
|
//#endregion
|
|
16501
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16539
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
|
|
16502
16540
|
/**
|
|
16503
16541
|
* @hidden
|
|
16504
16542
|
*/
|
|
16505
|
-
|
|
16543
|
+
const names = {
|
|
16506
16544
|
aliceblue: "#f0f8ff",
|
|
16507
16545
|
antiquewhite: "#faebd7",
|
|
16508
16546
|
aqua: "#00ffff",
|
|
@@ -16654,7 +16692,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16654
16692
|
};
|
|
16655
16693
|
|
|
16656
16694
|
//#endregion
|
|
16657
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16695
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/format-input.js
|
|
16658
16696
|
/**
|
|
16659
16697
|
* Given a string or object, convert that input to RGB
|
|
16660
16698
|
*
|
|
@@ -16671,20 +16709,21 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16671
16709
|
* "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
|
16672
16710
|
* "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
|
16673
16711
|
* "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
|
16712
|
+
* "cmyk(0, 20, 0, 0)" or "cmyk 0 20 0 0"
|
|
16674
16713
|
* ```
|
|
16675
16714
|
*/
|
|
16676
16715
|
function inputToRGB(color) {
|
|
16677
|
-
|
|
16716
|
+
let rgb = {
|
|
16678
16717
|
r: 0,
|
|
16679
16718
|
g: 0,
|
|
16680
16719
|
b: 0
|
|
16681
16720
|
};
|
|
16682
|
-
|
|
16683
|
-
|
|
16684
|
-
|
|
16685
|
-
|
|
16686
|
-
|
|
16687
|
-
|
|
16721
|
+
let a = 1;
|
|
16722
|
+
let s = null;
|
|
16723
|
+
let v = null;
|
|
16724
|
+
let l = null;
|
|
16725
|
+
let ok = false;
|
|
16726
|
+
let format = false;
|
|
16688
16727
|
if (typeof color === "string") color = stringInputToObject(color);
|
|
16689
16728
|
if (typeof color === "object") {
|
|
16690
16729
|
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
@@ -16703,6 +16742,10 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16703
16742
|
rgb = hslToRgb(color.h, s, l);
|
|
16704
16743
|
ok = true;
|
|
16705
16744
|
format = "hsl";
|
|
16745
|
+
} else if (isValidCSSUnit(color.c) && isValidCSSUnit(color.m) && isValidCSSUnit(color.y) && isValidCSSUnit(color.k)) {
|
|
16746
|
+
rgb = cmykToRgb(color.c, color.m, color.y, color.k);
|
|
16747
|
+
ok = true;
|
|
16748
|
+
format = "cmyk";
|
|
16706
16749
|
}
|
|
16707
16750
|
if (Object.prototype.hasOwnProperty.call(color, "a")) a = color.a;
|
|
16708
16751
|
}
|
|
@@ -16716,10 +16759,10 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16716
16759
|
a
|
|
16717
16760
|
};
|
|
16718
16761
|
}
|
|
16719
|
-
|
|
16720
|
-
|
|
16721
|
-
|
|
16722
|
-
|
|
16762
|
+
const CSS_UNIT = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)";
|
|
16763
|
+
const PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?";
|
|
16764
|
+
const PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?";
|
|
16765
|
+
const matchers = {
|
|
16723
16766
|
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
16724
16767
|
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
|
16725
16768
|
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
|
@@ -16727,6 +16770,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16727
16770
|
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
|
16728
16771
|
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
|
16729
16772
|
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
|
16773
|
+
cmyk: new RegExp("cmyk" + PERMISSIVE_MATCH4),
|
|
16730
16774
|
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
16731
16775
|
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
16732
16776
|
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
@@ -16734,12 +16778,12 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16734
16778
|
};
|
|
16735
16779
|
/**
|
|
16736
16780
|
* Permissive string parsing. Take in a number of formats, and output an object
|
|
16737
|
-
* based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
|
|
16781
|
+
* 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}`
|
|
16738
16782
|
*/
|
|
16739
16783
|
function stringInputToObject(color) {
|
|
16740
16784
|
color = color.trim().toLowerCase();
|
|
16741
16785
|
if (color.length === 0) return false;
|
|
16742
|
-
|
|
16786
|
+
let named = false;
|
|
16743
16787
|
if (names[color]) {
|
|
16744
16788
|
color = names[color];
|
|
16745
16789
|
named = true;
|
|
@@ -16750,7 +16794,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16750
16794
|
a: 0,
|
|
16751
16795
|
format: "name"
|
|
16752
16796
|
};
|
|
16753
|
-
|
|
16797
|
+
let match = matchers.rgb.exec(color);
|
|
16754
16798
|
if (match) return {
|
|
16755
16799
|
r: match[1],
|
|
16756
16800
|
g: match[2],
|
|
@@ -16789,6 +16833,13 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16789
16833
|
v: match[3],
|
|
16790
16834
|
a: match[4]
|
|
16791
16835
|
};
|
|
16836
|
+
match = matchers.cmyk.exec(color);
|
|
16837
|
+
if (match) return {
|
|
16838
|
+
c: match[1],
|
|
16839
|
+
m: match[2],
|
|
16840
|
+
y: match[3],
|
|
16841
|
+
k: match[4]
|
|
16842
|
+
};
|
|
16792
16843
|
match = matchers.hex8.exec(color);
|
|
16793
16844
|
if (match) return {
|
|
16794
16845
|
r: parseIntFromHex(match[1]),
|
|
@@ -16826,57 +16877,55 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16826
16877
|
* (see `matchers` above for definition).
|
|
16827
16878
|
*/
|
|
16828
16879
|
function isValidCSSUnit(color) {
|
|
16829
|
-
return
|
|
16880
|
+
if (typeof color === "number") return !Number.isNaN(color);
|
|
16881
|
+
return matchers.CSS_UNIT.test(color);
|
|
16830
16882
|
}
|
|
16831
16883
|
|
|
16832
16884
|
//#endregion
|
|
16833
|
-
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@
|
|
16834
|
-
var TinyColor =
|
|
16835
|
-
|
|
16836
|
-
if (color === void 0) color = "";
|
|
16837
|
-
if (opts === void 0) opts = {};
|
|
16838
|
-
var _a;
|
|
16885
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
16886
|
+
var TinyColor = class TinyColor {
|
|
16887
|
+
constructor(color = "", opts = {}) {
|
|
16839
16888
|
if (color instanceof TinyColor) return color;
|
|
16840
16889
|
if (typeof color === "number") color = numberInputToObject(color);
|
|
16841
16890
|
this.originalInput = color;
|
|
16842
|
-
|
|
16891
|
+
const rgb = inputToRGB(color);
|
|
16843
16892
|
this.originalInput = color;
|
|
16844
16893
|
this.r = rgb.r;
|
|
16845
16894
|
this.g = rgb.g;
|
|
16846
16895
|
this.b = rgb.b;
|
|
16847
16896
|
this.a = rgb.a;
|
|
16848
16897
|
this.roundA = Math.round(100 * this.a) / 100;
|
|
16849
|
-
this.format =
|
|
16898
|
+
this.format = opts.format ?? rgb.format;
|
|
16850
16899
|
this.gradientType = opts.gradientType;
|
|
16851
16900
|
if (this.r < 1) this.r = Math.round(this.r);
|
|
16852
16901
|
if (this.g < 1) this.g = Math.round(this.g);
|
|
16853
16902
|
if (this.b < 1) this.b = Math.round(this.b);
|
|
16854
16903
|
this.isValid = rgb.ok;
|
|
16855
16904
|
}
|
|
16856
|
-
|
|
16905
|
+
isDark() {
|
|
16857
16906
|
return this.getBrightness() < 128;
|
|
16858
|
-
}
|
|
16859
|
-
|
|
16907
|
+
}
|
|
16908
|
+
isLight() {
|
|
16860
16909
|
return !this.isDark();
|
|
16861
|
-
}
|
|
16910
|
+
}
|
|
16862
16911
|
/**
|
|
16863
16912
|
* Returns the perceived brightness of the color, from 0-255.
|
|
16864
16913
|
*/
|
|
16865
|
-
|
|
16866
|
-
|
|
16914
|
+
getBrightness() {
|
|
16915
|
+
const rgb = this.toRgb();
|
|
16867
16916
|
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
|
|
16868
|
-
}
|
|
16917
|
+
}
|
|
16869
16918
|
/**
|
|
16870
16919
|
* Returns the perceived luminance of a color, from 0-1.
|
|
16871
16920
|
*/
|
|
16872
|
-
|
|
16873
|
-
|
|
16874
|
-
|
|
16875
|
-
|
|
16876
|
-
|
|
16877
|
-
|
|
16878
|
-
|
|
16879
|
-
|
|
16921
|
+
getLuminance() {
|
|
16922
|
+
const rgb = this.toRgb();
|
|
16923
|
+
let R;
|
|
16924
|
+
let G;
|
|
16925
|
+
let B;
|
|
16926
|
+
const RsRGB = rgb.r / 255;
|
|
16927
|
+
const GsRGB = rgb.g / 255;
|
|
16928
|
+
const BsRGB = rgb.b / 255;
|
|
16880
16929
|
if (RsRGB <= .03928) R = RsRGB / 12.92;
|
|
16881
16930
|
else R = Math.pow((RsRGB + .055) / 1.055, 2.4);
|
|
16882
16931
|
if (GsRGB <= .03928) G = GsRGB / 12.92;
|
|
@@ -16884,177 +16933,173 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
16884
16933
|
if (BsRGB <= .03928) B = BsRGB / 12.92;
|
|
16885
16934
|
else B = Math.pow((BsRGB + .055) / 1.055, 2.4);
|
|
16886
16935
|
return .2126 * R + .7152 * G + .0722 * B;
|
|
16887
|
-
}
|
|
16936
|
+
}
|
|
16888
16937
|
/**
|
|
16889
16938
|
* Returns the alpha value of a color, from 0-1.
|
|
16890
16939
|
*/
|
|
16891
|
-
|
|
16940
|
+
getAlpha() {
|
|
16892
16941
|
return this.a;
|
|
16893
|
-
}
|
|
16942
|
+
}
|
|
16894
16943
|
/**
|
|
16895
16944
|
* Sets the alpha value on the current color.
|
|
16896
16945
|
*
|
|
16897
16946
|
* @param alpha - The new alpha value. The accepted range is 0-1.
|
|
16898
16947
|
*/
|
|
16899
|
-
|
|
16948
|
+
setAlpha(alpha) {
|
|
16900
16949
|
this.a = boundAlpha(alpha);
|
|
16901
16950
|
this.roundA = Math.round(100 * this.a) / 100;
|
|
16902
16951
|
return this;
|
|
16903
|
-
}
|
|
16952
|
+
}
|
|
16904
16953
|
/**
|
|
16905
16954
|
* Returns whether the color is monochrome.
|
|
16906
16955
|
*/
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
16956
|
+
isMonochrome() {
|
|
16957
|
+
const { s } = this.toHsl();
|
|
16958
|
+
return s === 0;
|
|
16959
|
+
}
|
|
16910
16960
|
/**
|
|
16911
16961
|
* Returns the object as a HSVA object.
|
|
16912
16962
|
*/
|
|
16913
|
-
|
|
16914
|
-
|
|
16963
|
+
toHsv() {
|
|
16964
|
+
const hsv = rgbToHsv(this.r, this.g, this.b);
|
|
16915
16965
|
return {
|
|
16916
16966
|
h: hsv.h * 360,
|
|
16917
16967
|
s: hsv.s,
|
|
16918
16968
|
v: hsv.v,
|
|
16919
16969
|
a: this.a
|
|
16920
16970
|
};
|
|
16921
|
-
}
|
|
16971
|
+
}
|
|
16922
16972
|
/**
|
|
16923
16973
|
* Returns the hsva values interpolated into a string with the following format:
|
|
16924
16974
|
* "hsva(xxx, xxx, xxx, xx)".
|
|
16925
16975
|
*/
|
|
16926
|
-
|
|
16927
|
-
|
|
16928
|
-
|
|
16929
|
-
|
|
16930
|
-
|
|
16931
|
-
return this.a === 1 ?
|
|
16932
|
-
}
|
|
16976
|
+
toHsvString() {
|
|
16977
|
+
const hsv = rgbToHsv(this.r, this.g, this.b);
|
|
16978
|
+
const h = Math.round(hsv.h * 360);
|
|
16979
|
+
const s = Math.round(hsv.s * 100);
|
|
16980
|
+
const v = Math.round(hsv.v * 100);
|
|
16981
|
+
return this.a === 1 ? `hsv(${h}, ${s}%, ${v}%)` : `hsva(${h}, ${s}%, ${v}%, ${this.roundA})`;
|
|
16982
|
+
}
|
|
16933
16983
|
/**
|
|
16934
16984
|
* Returns the object as a HSLA object.
|
|
16935
16985
|
*/
|
|
16936
|
-
|
|
16937
|
-
|
|
16986
|
+
toHsl() {
|
|
16987
|
+
const hsl = rgbToHsl(this.r, this.g, this.b);
|
|
16938
16988
|
return {
|
|
16939
16989
|
h: hsl.h * 360,
|
|
16940
16990
|
s: hsl.s,
|
|
16941
16991
|
l: hsl.l,
|
|
16942
16992
|
a: this.a
|
|
16943
16993
|
};
|
|
16944
|
-
}
|
|
16994
|
+
}
|
|
16945
16995
|
/**
|
|
16946
16996
|
* Returns the hsla values interpolated into a string with the following format:
|
|
16947
16997
|
* "hsla(xxx, xxx, xxx, xx)".
|
|
16948
16998
|
*/
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
return this.a === 1 ?
|
|
16955
|
-
}
|
|
16999
|
+
toHslString() {
|
|
17000
|
+
const hsl = rgbToHsl(this.r, this.g, this.b);
|
|
17001
|
+
const h = Math.round(hsl.h * 360);
|
|
17002
|
+
const s = Math.round(hsl.s * 100);
|
|
17003
|
+
const l = Math.round(hsl.l * 100);
|
|
17004
|
+
return this.a === 1 ? `hsl(${h}, ${s}%, ${l}%)` : `hsla(${h}, ${s}%, ${l}%, ${this.roundA})`;
|
|
17005
|
+
}
|
|
16956
17006
|
/**
|
|
16957
17007
|
* Returns the hex value of the color.
|
|
16958
17008
|
* @param allow3Char will shorten hex value to 3 char if possible
|
|
16959
17009
|
*/
|
|
16960
|
-
|
|
16961
|
-
if (allow3Char === void 0) allow3Char = false;
|
|
17010
|
+
toHex(allow3Char = false) {
|
|
16962
17011
|
return rgbToHex(this.r, this.g, this.b, allow3Char);
|
|
16963
|
-
}
|
|
17012
|
+
}
|
|
16964
17013
|
/**
|
|
16965
17014
|
* Returns the hex value of the color -with a # prefixed.
|
|
16966
17015
|
* @param allow3Char will shorten hex value to 3 char if possible
|
|
16967
17016
|
*/
|
|
16968
|
-
|
|
16969
|
-
if (allow3Char === void 0) allow3Char = false;
|
|
17017
|
+
toHexString(allow3Char = false) {
|
|
16970
17018
|
return "#" + this.toHex(allow3Char);
|
|
16971
|
-
}
|
|
17019
|
+
}
|
|
16972
17020
|
/**
|
|
16973
17021
|
* Returns the hex 8 value of the color.
|
|
16974
17022
|
* @param allow4Char will shorten hex value to 4 char if possible
|
|
16975
17023
|
*/
|
|
16976
|
-
|
|
16977
|
-
if (allow4Char === void 0) allow4Char = false;
|
|
17024
|
+
toHex8(allow4Char = false) {
|
|
16978
17025
|
return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
|
|
16979
|
-
}
|
|
17026
|
+
}
|
|
16980
17027
|
/**
|
|
16981
17028
|
* Returns the hex 8 value of the color -with a # prefixed.
|
|
16982
17029
|
* @param allow4Char will shorten hex value to 4 char if possible
|
|
16983
17030
|
*/
|
|
16984
|
-
|
|
16985
|
-
if (allow4Char === void 0) allow4Char = false;
|
|
17031
|
+
toHex8String(allow4Char = false) {
|
|
16986
17032
|
return "#" + this.toHex8(allow4Char);
|
|
16987
|
-
}
|
|
17033
|
+
}
|
|
16988
17034
|
/**
|
|
16989
17035
|
* Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
|
|
16990
17036
|
* @param allowShortChar will shorten hex value to 3 or 4 char if possible
|
|
16991
17037
|
*/
|
|
16992
|
-
|
|
16993
|
-
if (allowShortChar === void 0) allowShortChar = false;
|
|
17038
|
+
toHexShortString(allowShortChar = false) {
|
|
16994
17039
|
return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
|
|
16995
|
-
}
|
|
17040
|
+
}
|
|
16996
17041
|
/**
|
|
16997
17042
|
* Returns the object as a RGBA object.
|
|
16998
17043
|
*/
|
|
16999
|
-
|
|
17044
|
+
toRgb() {
|
|
17000
17045
|
return {
|
|
17001
17046
|
r: Math.round(this.r),
|
|
17002
17047
|
g: Math.round(this.g),
|
|
17003
17048
|
b: Math.round(this.b),
|
|
17004
17049
|
a: this.a
|
|
17005
17050
|
};
|
|
17006
|
-
}
|
|
17051
|
+
}
|
|
17007
17052
|
/**
|
|
17008
17053
|
* Returns the RGBA values interpolated into a string with the following format:
|
|
17009
17054
|
* "RGBA(xxx, xxx, xxx, xx)".
|
|
17010
17055
|
*/
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
return this.a === 1 ?
|
|
17016
|
-
}
|
|
17056
|
+
toRgbString() {
|
|
17057
|
+
const r = Math.round(this.r);
|
|
17058
|
+
const g = Math.round(this.g);
|
|
17059
|
+
const b = Math.round(this.b);
|
|
17060
|
+
return this.a === 1 ? `rgb(${r}, ${g}, ${b})` : `rgba(${r}, ${g}, ${b}, ${this.roundA})`;
|
|
17061
|
+
}
|
|
17017
17062
|
/**
|
|
17018
17063
|
* Returns the object as a RGBA object.
|
|
17019
17064
|
*/
|
|
17020
|
-
|
|
17021
|
-
|
|
17022
|
-
return "".concat(Math.round(bound01(x, 255) * 100), "%");
|
|
17023
|
-
};
|
|
17065
|
+
toPercentageRgb() {
|
|
17066
|
+
const fmt = (x) => `${Math.round(bound01(x, 255) * 100)}%`;
|
|
17024
17067
|
return {
|
|
17025
17068
|
r: fmt(this.r),
|
|
17026
17069
|
g: fmt(this.g),
|
|
17027
17070
|
b: fmt(this.b),
|
|
17028
17071
|
a: this.a
|
|
17029
17072
|
};
|
|
17030
|
-
}
|
|
17073
|
+
}
|
|
17031
17074
|
/**
|
|
17032
17075
|
* Returns the RGBA relative values interpolated into a string
|
|
17033
17076
|
*/
|
|
17034
|
-
|
|
17035
|
-
|
|
17036
|
-
|
|
17037
|
-
|
|
17038
|
-
|
|
17039
|
-
|
|
17077
|
+
toPercentageRgbString() {
|
|
17078
|
+
const rnd = (x) => Math.round(bound01(x, 255) * 100);
|
|
17079
|
+
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})`;
|
|
17080
|
+
}
|
|
17081
|
+
toCmyk() {
|
|
17082
|
+
return { ...rgbToCmyk(this.r, this.g, this.b) };
|
|
17083
|
+
}
|
|
17084
|
+
toCmykString() {
|
|
17085
|
+
const { c, m, y, k } = rgbToCmyk(this.r, this.g, this.b);
|
|
17086
|
+
return `cmyk(${c}, ${m}, ${y}, ${k})`;
|
|
17087
|
+
}
|
|
17040
17088
|
/**
|
|
17041
17089
|
* The 'real' name of the color -if there is one.
|
|
17042
17090
|
*/
|
|
17043
|
-
|
|
17091
|
+
toName() {
|
|
17044
17092
|
if (this.a === 0) return "transparent";
|
|
17045
17093
|
if (this.a < 1) return false;
|
|
17046
|
-
|
|
17047
|
-
for (
|
|
17048
|
-
var _b = _a[_i], key = _b[0];
|
|
17049
|
-
if (hex === _b[1]) return key;
|
|
17050
|
-
}
|
|
17094
|
+
const hex = "#" + rgbToHex(this.r, this.g, this.b, false);
|
|
17095
|
+
for (const [key, value] of Object.entries(names)) if (hex === value) return key;
|
|
17051
17096
|
return false;
|
|
17052
|
-
}
|
|
17053
|
-
|
|
17054
|
-
|
|
17055
|
-
format = format
|
|
17056
|
-
|
|
17057
|
-
|
|
17097
|
+
}
|
|
17098
|
+
toString(format) {
|
|
17099
|
+
const formatSet = Boolean(format);
|
|
17100
|
+
format = format ?? this.format;
|
|
17101
|
+
let formattedString = false;
|
|
17102
|
+
const hasAlpha = this.a < 1 && this.a >= 0;
|
|
17058
17103
|
if (!formatSet && hasAlpha && (format.startsWith("hex") || format === "name")) {
|
|
17059
17104
|
if (format === "name" && this.a === 0) return this.toName();
|
|
17060
17105
|
return this.toRgbString();
|
|
@@ -17068,151 +17113,141 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
17068
17113
|
if (format === "name") formattedString = this.toName();
|
|
17069
17114
|
if (format === "hsl") formattedString = this.toHslString();
|
|
17070
17115
|
if (format === "hsv") formattedString = this.toHsvString();
|
|
17116
|
+
if (format === "cmyk") formattedString = this.toCmykString();
|
|
17071
17117
|
return formattedString || this.toHexString();
|
|
17072
|
-
}
|
|
17073
|
-
|
|
17118
|
+
}
|
|
17119
|
+
toNumber() {
|
|
17074
17120
|
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
|
|
17075
|
-
}
|
|
17076
|
-
|
|
17121
|
+
}
|
|
17122
|
+
clone() {
|
|
17077
17123
|
return new TinyColor(this.toString());
|
|
17078
|
-
}
|
|
17124
|
+
}
|
|
17079
17125
|
/**
|
|
17080
17126
|
* Lighten the color a given amount. Providing 100 will always return white.
|
|
17081
17127
|
* @param amount - valid between 1-100
|
|
17082
17128
|
*/
|
|
17083
|
-
|
|
17084
|
-
|
|
17085
|
-
var hsl = this.toHsl();
|
|
17129
|
+
lighten(amount = 10) {
|
|
17130
|
+
const hsl = this.toHsl();
|
|
17086
17131
|
hsl.l += amount / 100;
|
|
17087
17132
|
hsl.l = clamp01(hsl.l);
|
|
17088
17133
|
return new TinyColor(hsl);
|
|
17089
|
-
}
|
|
17134
|
+
}
|
|
17090
17135
|
/**
|
|
17091
17136
|
* Brighten the color a given amount, from 0 to 100.
|
|
17092
17137
|
* @param amount - valid between 1-100
|
|
17093
17138
|
*/
|
|
17094
|
-
|
|
17095
|
-
|
|
17096
|
-
var rgb = this.toRgb();
|
|
17139
|
+
brighten(amount = 10) {
|
|
17140
|
+
const rgb = this.toRgb();
|
|
17097
17141
|
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
|
|
17098
17142
|
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
|
|
17099
17143
|
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
|
|
17100
17144
|
return new TinyColor(rgb);
|
|
17101
|
-
}
|
|
17145
|
+
}
|
|
17102
17146
|
/**
|
|
17103
17147
|
* Darken the color a given amount, from 0 to 100.
|
|
17104
17148
|
* Providing 100 will always return black.
|
|
17105
17149
|
* @param amount - valid between 1-100
|
|
17106
17150
|
*/
|
|
17107
|
-
|
|
17108
|
-
|
|
17109
|
-
var hsl = this.toHsl();
|
|
17151
|
+
darken(amount = 10) {
|
|
17152
|
+
const hsl = this.toHsl();
|
|
17110
17153
|
hsl.l -= amount / 100;
|
|
17111
17154
|
hsl.l = clamp01(hsl.l);
|
|
17112
17155
|
return new TinyColor(hsl);
|
|
17113
|
-
}
|
|
17156
|
+
}
|
|
17114
17157
|
/**
|
|
17115
17158
|
* Mix the color with pure white, from 0 to 100.
|
|
17116
17159
|
* Providing 0 will do nothing, providing 100 will always return white.
|
|
17117
17160
|
* @param amount - valid between 1-100
|
|
17118
17161
|
*/
|
|
17119
|
-
|
|
17120
|
-
if (amount === void 0) amount = 10;
|
|
17162
|
+
tint(amount = 10) {
|
|
17121
17163
|
return this.mix("white", amount);
|
|
17122
|
-
}
|
|
17164
|
+
}
|
|
17123
17165
|
/**
|
|
17124
17166
|
* Mix the color with pure black, from 0 to 100.
|
|
17125
17167
|
* Providing 0 will do nothing, providing 100 will always return black.
|
|
17126
17168
|
* @param amount - valid between 1-100
|
|
17127
17169
|
*/
|
|
17128
|
-
|
|
17129
|
-
if (amount === void 0) amount = 10;
|
|
17170
|
+
shade(amount = 10) {
|
|
17130
17171
|
return this.mix("black", amount);
|
|
17131
|
-
}
|
|
17172
|
+
}
|
|
17132
17173
|
/**
|
|
17133
17174
|
* Desaturate the color a given amount, from 0 to 100.
|
|
17134
17175
|
* Providing 100 will is the same as calling greyscale
|
|
17135
17176
|
* @param amount - valid between 1-100
|
|
17136
17177
|
*/
|
|
17137
|
-
|
|
17138
|
-
|
|
17139
|
-
var hsl = this.toHsl();
|
|
17178
|
+
desaturate(amount = 10) {
|
|
17179
|
+
const hsl = this.toHsl();
|
|
17140
17180
|
hsl.s -= amount / 100;
|
|
17141
17181
|
hsl.s = clamp01(hsl.s);
|
|
17142
17182
|
return new TinyColor(hsl);
|
|
17143
|
-
}
|
|
17183
|
+
}
|
|
17144
17184
|
/**
|
|
17145
17185
|
* Saturate the color a given amount, from 0 to 100.
|
|
17146
17186
|
* @param amount - valid between 1-100
|
|
17147
17187
|
*/
|
|
17148
|
-
|
|
17149
|
-
|
|
17150
|
-
var hsl = this.toHsl();
|
|
17188
|
+
saturate(amount = 10) {
|
|
17189
|
+
const hsl = this.toHsl();
|
|
17151
17190
|
hsl.s += amount / 100;
|
|
17152
17191
|
hsl.s = clamp01(hsl.s);
|
|
17153
17192
|
return new TinyColor(hsl);
|
|
17154
|
-
}
|
|
17193
|
+
}
|
|
17155
17194
|
/**
|
|
17156
17195
|
* Completely desaturates a color into greyscale.
|
|
17157
17196
|
* Same as calling `desaturate(100)`
|
|
17158
17197
|
*/
|
|
17159
|
-
|
|
17198
|
+
greyscale() {
|
|
17160
17199
|
return this.desaturate(100);
|
|
17161
|
-
}
|
|
17200
|
+
}
|
|
17162
17201
|
/**
|
|
17163
17202
|
* Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
|
|
17164
17203
|
* Values outside of this range will be wrapped into this range.
|
|
17165
17204
|
*/
|
|
17166
|
-
|
|
17167
|
-
|
|
17168
|
-
|
|
17205
|
+
spin(amount) {
|
|
17206
|
+
const hsl = this.toHsl();
|
|
17207
|
+
const hue = (hsl.h + amount) % 360;
|
|
17169
17208
|
hsl.h = hue < 0 ? 360 + hue : hue;
|
|
17170
17209
|
return new TinyColor(hsl);
|
|
17171
|
-
}
|
|
17210
|
+
}
|
|
17172
17211
|
/**
|
|
17173
17212
|
* Mix the current color a given amount with another color, from 0 to 100.
|
|
17174
17213
|
* 0 means no mixing (return current color).
|
|
17175
17214
|
*/
|
|
17176
|
-
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17180
|
-
var p = amount / 100;
|
|
17215
|
+
mix(color, amount = 50) {
|
|
17216
|
+
const rgb1 = this.toRgb();
|
|
17217
|
+
const rgb2 = new TinyColor(color).toRgb();
|
|
17218
|
+
const p = amount / 100;
|
|
17181
17219
|
return new TinyColor({
|
|
17182
17220
|
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
17183
17221
|
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
17184
17222
|
b: (rgb2.b - rgb1.b) * p + rgb1.b,
|
|
17185
17223
|
a: (rgb2.a - rgb1.a) * p + rgb1.a
|
|
17186
17224
|
});
|
|
17187
|
-
}
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
var part = 360 / slices;
|
|
17193
|
-
var ret = [this];
|
|
17225
|
+
}
|
|
17226
|
+
analogous(results = 6, slices = 30) {
|
|
17227
|
+
const hsl = this.toHsl();
|
|
17228
|
+
const part = 360 / slices;
|
|
17229
|
+
const ret = [this];
|
|
17194
17230
|
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
|
|
17195
17231
|
hsl.h = (hsl.h + part) % 360;
|
|
17196
17232
|
ret.push(new TinyColor(hsl));
|
|
17197
17233
|
}
|
|
17198
17234
|
return ret;
|
|
17199
|
-
}
|
|
17235
|
+
}
|
|
17200
17236
|
/**
|
|
17201
17237
|
* taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
|
|
17202
17238
|
*/
|
|
17203
|
-
|
|
17204
|
-
|
|
17239
|
+
complement() {
|
|
17240
|
+
const hsl = this.toHsl();
|
|
17205
17241
|
hsl.h = (hsl.h + 180) % 360;
|
|
17206
17242
|
return new TinyColor(hsl);
|
|
17207
|
-
}
|
|
17208
|
-
|
|
17209
|
-
|
|
17210
|
-
|
|
17211
|
-
|
|
17212
|
-
|
|
17213
|
-
|
|
17214
|
-
|
|
17215
|
-
var modification = 1 / results;
|
|
17243
|
+
}
|
|
17244
|
+
monochromatic(results = 6) {
|
|
17245
|
+
const hsv = this.toHsv();
|
|
17246
|
+
const { h } = hsv;
|
|
17247
|
+
const { s } = hsv;
|
|
17248
|
+
let { v } = hsv;
|
|
17249
|
+
const res = [];
|
|
17250
|
+
const modification = 1 / results;
|
|
17216
17251
|
while (results--) {
|
|
17217
17252
|
res.push(new TinyColor({
|
|
17218
17253
|
h,
|
|
@@ -17222,10 +17257,10 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
17222
17257
|
v = (v + modification) % 1;
|
|
17223
17258
|
}
|
|
17224
17259
|
return res;
|
|
17225
|
-
}
|
|
17226
|
-
|
|
17227
|
-
|
|
17228
|
-
|
|
17260
|
+
}
|
|
17261
|
+
splitcomplement() {
|
|
17262
|
+
const hsl = this.toHsl();
|
|
17263
|
+
const { h } = hsl;
|
|
17229
17264
|
return [
|
|
17230
17265
|
this,
|
|
17231
17266
|
new TinyColor({
|
|
@@ -17239,57 +17274,62 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
17239
17274
|
l: hsl.l
|
|
17240
17275
|
})
|
|
17241
17276
|
];
|
|
17242
|
-
}
|
|
17277
|
+
}
|
|
17243
17278
|
/**
|
|
17244
17279
|
* Compute how the color would appear on a background
|
|
17245
17280
|
*/
|
|
17246
|
-
|
|
17247
|
-
|
|
17248
|
-
|
|
17249
|
-
|
|
17281
|
+
onBackground(background) {
|
|
17282
|
+
const fg = this.toRgb();
|
|
17283
|
+
const bg = new TinyColor(background).toRgb();
|
|
17284
|
+
const alpha = fg.a + bg.a * (1 - fg.a);
|
|
17250
17285
|
return new TinyColor({
|
|
17251
17286
|
r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
|
|
17252
17287
|
g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
|
|
17253
17288
|
b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
|
|
17254
17289
|
a: alpha
|
|
17255
17290
|
});
|
|
17256
|
-
}
|
|
17291
|
+
}
|
|
17257
17292
|
/**
|
|
17258
17293
|
* Alias for `polyad(3)`
|
|
17259
17294
|
*/
|
|
17260
|
-
|
|
17295
|
+
triad() {
|
|
17261
17296
|
return this.polyad(3);
|
|
17262
|
-
}
|
|
17297
|
+
}
|
|
17263
17298
|
/**
|
|
17264
17299
|
* Alias for `polyad(4)`
|
|
17265
17300
|
*/
|
|
17266
|
-
|
|
17301
|
+
tetrad() {
|
|
17267
17302
|
return this.polyad(4);
|
|
17268
|
-
}
|
|
17303
|
+
}
|
|
17269
17304
|
/**
|
|
17270
17305
|
* Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
|
|
17271
17306
|
* monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
|
|
17272
17307
|
*/
|
|
17273
|
-
|
|
17274
|
-
|
|
17275
|
-
|
|
17276
|
-
|
|
17277
|
-
|
|
17278
|
-
for (
|
|
17308
|
+
polyad(n) {
|
|
17309
|
+
const hsl = this.toHsl();
|
|
17310
|
+
const { h } = hsl;
|
|
17311
|
+
const result = [this];
|
|
17312
|
+
const increment = 360 / n;
|
|
17313
|
+
for (let i = 1; i < n; i++) result.push(new TinyColor({
|
|
17279
17314
|
h: (h + i * increment) % 360,
|
|
17280
17315
|
s: hsl.s,
|
|
17281
17316
|
l: hsl.l
|
|
17282
17317
|
}));
|
|
17283
17318
|
return result;
|
|
17284
|
-
}
|
|
17319
|
+
}
|
|
17285
17320
|
/**
|
|
17286
17321
|
* compare color vs current color
|
|
17287
17322
|
*/
|
|
17288
|
-
|
|
17289
|
-
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
|
|
17323
|
+
equals(color) {
|
|
17324
|
+
const comparedColor = new TinyColor(color);
|
|
17325
|
+
/**
|
|
17326
|
+
* RGB and CMYK do not have the same color gamut, so a CMYK conversion will never be 100%.
|
|
17327
|
+
* This means we need to compare CMYK to CMYK to ensure accuracy of the equals function.
|
|
17328
|
+
*/
|
|
17329
|
+
if (this.format === "cmyk" || comparedColor.format === "cmyk") return this.toCmykString() === comparedColor.toCmykString();
|
|
17330
|
+
return this.toRgbString() === comparedColor.toRgbString();
|
|
17331
|
+
}
|
|
17332
|
+
};
|
|
17293
17333
|
|
|
17294
17334
|
//#endregion
|
|
17295
17335
|
//#region ../../packages/components/button/src/button-custom.ts
|
|
@@ -41282,7 +41322,7 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41282
41322
|
default: 100
|
|
41283
41323
|
},
|
|
41284
41324
|
step: {
|
|
41285
|
-
type: Number,
|
|
41325
|
+
type: definePropType([Number, String]),
|
|
41286
41326
|
default: 1
|
|
41287
41327
|
},
|
|
41288
41328
|
showInput: Boolean,
|
|
@@ -41376,7 +41416,7 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41376
41416
|
//#endregion
|
|
41377
41417
|
//#region ../../packages/components/slider/src/composables/use-marks.ts
|
|
41378
41418
|
const useMarks = (props) => {
|
|
41379
|
-
|
|
41419
|
+
const markList = (0, vue.computed)(() => {
|
|
41380
41420
|
if (!props.marks) return [];
|
|
41381
41421
|
return Object.keys(props.marks).map(Number.parseFloat).sort((a, b) => a - b).filter((point) => point <= props.max && point >= props.min).map((point) => ({
|
|
41382
41422
|
point,
|
|
@@ -41384,6 +41424,19 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41384
41424
|
mark: props.marks[point]
|
|
41385
41425
|
}));
|
|
41386
41426
|
});
|
|
41427
|
+
(0, vue.watchEffect)(() => {
|
|
41428
|
+
if (props.step === "mark" && !props.marks) /* @__PURE__ */ debugWarn("ElSlider", "marks prop must be provided when step is mark");
|
|
41429
|
+
if (props.marks) {
|
|
41430
|
+
const keys = Object.keys(props.marks);
|
|
41431
|
+
const validPoints = markList.value.map((m) => m.point);
|
|
41432
|
+
const invalidKeys = keys.filter((key) => {
|
|
41433
|
+
const parsed = Number.parseFloat(key);
|
|
41434
|
+
return Number.isNaN(parsed) || !validPoints.includes(parsed);
|
|
41435
|
+
});
|
|
41436
|
+
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.`);
|
|
41437
|
+
}
|
|
41438
|
+
});
|
|
41439
|
+
return markList;
|
|
41387
41440
|
};
|
|
41388
41441
|
|
|
41389
41442
|
//#endregion
|
|
@@ -41527,7 +41580,7 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41527
41580
|
};
|
|
41528
41581
|
};
|
|
41529
41582
|
const useSliderButton = (props, initData, emit) => {
|
|
41530
|
-
const { disabled, min, max, step, showTooltip, persistent, precision, sliderSize, formatTooltip, emitChange, resetSize, updateDragging } = (0, vue.inject)(sliderContextKey);
|
|
41583
|
+
const { disabled, min, max, step, showTooltip, persistent, precision, sliderSize, formatTooltip, emitChange, resetSize, updateDragging, markList } = (0, vue.inject)(sliderContextKey);
|
|
41531
41584
|
const { tooltip, tooltipVisible, formatValue, displayTooltip, hideTooltip } = useTooltip(props, formatTooltip, showTooltip);
|
|
41532
41585
|
const button = (0, vue.ref)();
|
|
41533
41586
|
const currentPosition = (0, vue.computed)(() => {
|
|
@@ -41536,6 +41589,9 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41536
41589
|
const wrapperStyle = (0, vue.computed)(() => {
|
|
41537
41590
|
return props.vertical ? { bottom: currentPosition.value } : { left: currentPosition.value };
|
|
41538
41591
|
});
|
|
41592
|
+
const shouldMoveToMark = (0, vue.computed)(() => {
|
|
41593
|
+
return step.value === "mark" && markList.value.length > 0;
|
|
41594
|
+
});
|
|
41539
41595
|
const handleMouseEnter = () => {
|
|
41540
41596
|
initData.hovering = true;
|
|
41541
41597
|
displayTooltip();
|
|
@@ -41561,17 +41617,49 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41561
41617
|
setPosition(initData.newPosition);
|
|
41562
41618
|
emitChange();
|
|
41563
41619
|
};
|
|
41620
|
+
const moveToMark = (amount) => {
|
|
41621
|
+
if (disabled.value || !markList.value.length) return;
|
|
41622
|
+
const current = props.modelValue;
|
|
41623
|
+
const epsilon = Number.EPSILON;
|
|
41624
|
+
const stride = Math.abs(amount);
|
|
41625
|
+
let target;
|
|
41626
|
+
if (amount > 0) {
|
|
41627
|
+
const startIndex = markList.value.findIndex((m) => m.point > current + epsilon);
|
|
41628
|
+
if (startIndex !== -1) {
|
|
41629
|
+
const targetIndex = Math.min(startIndex + stride - 1, markList.value.length - 1);
|
|
41630
|
+
target = markList.value[targetIndex].point;
|
|
41631
|
+
}
|
|
41632
|
+
} else {
|
|
41633
|
+
let startIndex = -1;
|
|
41634
|
+
for (let i = markList.value.length - 1; i >= 0; i--) if (markList.value[i].point < current - epsilon) {
|
|
41635
|
+
startIndex = i;
|
|
41636
|
+
break;
|
|
41637
|
+
}
|
|
41638
|
+
if (startIndex !== -1) {
|
|
41639
|
+
const targetIndex = Math.max(startIndex - (stride - 1), 0);
|
|
41640
|
+
target = markList.value[targetIndex].point;
|
|
41641
|
+
}
|
|
41642
|
+
}
|
|
41643
|
+
if (target !== void 0 && target !== current) {
|
|
41644
|
+
setPosition((target - min.value) / (max.value - min.value) * 100);
|
|
41645
|
+
emitChange();
|
|
41646
|
+
}
|
|
41647
|
+
};
|
|
41564
41648
|
const onLeftKeyDown = () => {
|
|
41565
|
-
|
|
41649
|
+
if (shouldMoveToMark.value) moveToMark(-1);
|
|
41650
|
+
else if (isNumber(step.value)) incrementPosition(-step.value);
|
|
41566
41651
|
};
|
|
41567
41652
|
const onRightKeyDown = () => {
|
|
41568
|
-
|
|
41653
|
+
if (shouldMoveToMark.value) moveToMark(1);
|
|
41654
|
+
else if (isNumber(step.value)) incrementPosition(step.value);
|
|
41569
41655
|
};
|
|
41570
41656
|
const onPageDownKeyDown = () => {
|
|
41571
|
-
|
|
41657
|
+
if (shouldMoveToMark.value) moveToMark(-4);
|
|
41658
|
+
else if (isNumber(step.value)) incrementPosition(-step.value * 4);
|
|
41572
41659
|
};
|
|
41573
41660
|
const onPageUpKeyDown = () => {
|
|
41574
|
-
|
|
41661
|
+
if (shouldMoveToMark.value) moveToMark(4);
|
|
41662
|
+
else if (isNumber(step.value)) incrementPosition(step.value * 4);
|
|
41575
41663
|
};
|
|
41576
41664
|
const onHomeKeyDown = () => {
|
|
41577
41665
|
if (disabled.value) return;
|
|
@@ -41673,17 +41761,23 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41673
41761
|
const setPosition = async (newPosition) => {
|
|
41674
41762
|
if (newPosition === null || Number.isNaN(+newPosition)) return;
|
|
41675
41763
|
newPosition = clamp$1(newPosition, 0, 100);
|
|
41676
|
-
const fullSteps = Math.floor((max.value - min.value) / step.value);
|
|
41677
|
-
const fullRangePercentage = fullSteps * step.value / (max.value - min.value) * 100;
|
|
41678
|
-
const threshold = fullRangePercentage + (100 - fullRangePercentage) / 2;
|
|
41679
41764
|
let value;
|
|
41680
|
-
if (
|
|
41681
|
-
|
|
41682
|
-
|
|
41683
|
-
|
|
41684
|
-
|
|
41685
|
-
|
|
41686
|
-
|
|
41765
|
+
if (step.value === "mark") if (markList.value.length === 0) value = newPosition <= 50 ? min.value : max.value;
|
|
41766
|
+
else value = markList.value.reduce((prev, curr) => {
|
|
41767
|
+
return Math.abs(curr.position - newPosition) < Math.abs(prev.position - newPosition) ? curr : prev;
|
|
41768
|
+
}).point;
|
|
41769
|
+
else {
|
|
41770
|
+
const fullSteps = Math.floor((max.value - min.value) / step.value);
|
|
41771
|
+
const fullRangePercentage = fullSteps * step.value / (max.value - min.value) * 100;
|
|
41772
|
+
const threshold = fullRangePercentage + (100 - fullRangePercentage) / 2;
|
|
41773
|
+
if (newPosition < fullRangePercentage) {
|
|
41774
|
+
const valueBetween = fullRangePercentage / fullSteps;
|
|
41775
|
+
const steps = Math.round(newPosition / valueBetween);
|
|
41776
|
+
value = min.value + steps * step.value;
|
|
41777
|
+
} else if (newPosition < threshold) value = min.value + fullSteps * step.value;
|
|
41778
|
+
else value = max.value;
|
|
41779
|
+
value = Number.parseFloat(value.toFixed(precision.value));
|
|
41780
|
+
}
|
|
41687
41781
|
if (value !== props.modelValue) emit(UPDATE_MODEL_EVENT, value);
|
|
41688
41782
|
if (!initData.dragging && props.modelValue !== initData.oldValue) initData.oldValue = props.modelValue;
|
|
41689
41783
|
await (0, vue.nextTick)();
|
|
@@ -41716,8 +41810,8 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41716
41810
|
const useStops = (props, initData, minValue, maxValue) => {
|
|
41717
41811
|
const stops = (0, vue.computed)(() => {
|
|
41718
41812
|
if (!props.showStops || props.min > props.max) return [];
|
|
41719
|
-
if (props.step === 0) {
|
|
41720
|
-
/* @__PURE__ */ debugWarn("ElSlider", "step should not be 0.");
|
|
41813
|
+
if (props.step === "mark" || props.step === 0) {
|
|
41814
|
+
if (props.step === 0) /* @__PURE__ */ debugWarn("ElSlider", "step should not be 0.");
|
|
41721
41815
|
return [];
|
|
41722
41816
|
}
|
|
41723
41817
|
const stopCount = Math.ceil((props.max - props.min) / props.step);
|
|
@@ -41943,6 +42037,9 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41943
42037
|
const { inputId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: elFormItem });
|
|
41944
42038
|
const sliderWrapperSize = useFormSize();
|
|
41945
42039
|
const sliderInputSize = (0, vue.computed)(() => props.inputSize || sliderWrapperSize.value);
|
|
42040
|
+
const renderInput = (0, vue.computed)(() => {
|
|
42041
|
+
return props.showInput && !props.range && props.step !== "mark";
|
|
42042
|
+
});
|
|
41946
42043
|
const groupLabel = (0, vue.computed)(() => {
|
|
41947
42044
|
return props.ariaLabel || t("el.slider.defaultLabel", {
|
|
41948
42045
|
min: props.min,
|
|
@@ -41966,15 +42063,19 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41966
42063
|
ns.b(),
|
|
41967
42064
|
ns.m(sliderWrapperSize.value),
|
|
41968
42065
|
ns.is("vertical", props.vertical),
|
|
41969
|
-
{ [ns.m("with-input")]:
|
|
42066
|
+
{ [ns.m("with-input")]: renderInput.value }
|
|
41970
42067
|
]);
|
|
41971
42068
|
const markList = useMarks(props);
|
|
41972
42069
|
useWatch(props, initData, minValue, maxValue, emit, elFormItem);
|
|
42070
|
+
const sliderInputStep = (0, vue.computed)(() => {
|
|
42071
|
+
return isNumber(props.step) ? props.step : 1;
|
|
42072
|
+
});
|
|
41973
42073
|
const precision = (0, vue.computed)(() => {
|
|
42074
|
+
const stepValue = isNumber(props.step) ? props.step : 1;
|
|
41974
42075
|
const precisions = [
|
|
41975
42076
|
props.min,
|
|
41976
42077
|
props.max,
|
|
41977
|
-
|
|
42078
|
+
stepValue
|
|
41978
42079
|
].map((item) => {
|
|
41979
42080
|
const decimal = `${item}`.split(".")[1];
|
|
41980
42081
|
return decimal ? decimal.length : 0;
|
|
@@ -41993,6 +42094,7 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
41993
42094
|
sliderSize,
|
|
41994
42095
|
disabled: sliderDisabled,
|
|
41995
42096
|
precision,
|
|
42097
|
+
markList,
|
|
41996
42098
|
emitChange,
|
|
41997
42099
|
resetSize,
|
|
41998
42100
|
updateDragging
|
|
@@ -42012,7 +42114,7 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
42012
42114
|
ref: slider,
|
|
42013
42115
|
class: (0, vue.normalizeClass)([
|
|
42014
42116
|
(0, vue.unref)(ns).e("runway"),
|
|
42015
|
-
{ "show-input":
|
|
42117
|
+
{ "show-input": renderInput.value },
|
|
42016
42118
|
(0, vue.unref)(ns).is("disabled", (0, vue.unref)(sliderDisabled))
|
|
42017
42119
|
]),
|
|
42018
42120
|
style: (0, vue.normalizeStyle)((0, vue.unref)(runwayStyle)),
|
|
@@ -42113,12 +42215,12 @@ var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
|
|
|
42113
42215
|
"onMousedown"
|
|
42114
42216
|
]);
|
|
42115
42217
|
}), 128))], 2)], 64)) : (0, vue.createCommentVNode)("v-if", true)
|
|
42116
|
-
], 38),
|
|
42218
|
+
], 38), renderInput.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElInputNumber), {
|
|
42117
42219
|
key: 0,
|
|
42118
42220
|
ref: "input",
|
|
42119
42221
|
"model-value": (0, vue.unref)(firstValue),
|
|
42120
42222
|
class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("input")),
|
|
42121
|
-
step:
|
|
42223
|
+
step: sliderInputStep.value,
|
|
42122
42224
|
disabled: (0, vue.unref)(sliderDisabled),
|
|
42123
42225
|
controls: _ctx.showInputControls,
|
|
42124
42226
|
min: _ctx.min,
|