@element-plus/nightly 0.0.20220104 → 0.0.20220108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +655 -617
- package/dist/index.full.min.js +8 -8
- 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 +653 -614
- package/es/components/cascader/index.d.ts +4 -0
- package/es/components/cascader/src/index.vue.d.ts +2 -0
- package/es/components/cascader-panel/src/index.vue_vue_type_script_lang.mjs +5 -4
- package/es/components/cascader-panel/src/index.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.vue_vue_type_template_id_97c48f5c_lang.mjs.map +1 -1
- package/es/components/cascader-panel/src/menu.vue.d.ts +1 -0
- package/es/components/cascader-panel/src/menu.vue_vue_type_script_lang.mjs +6 -0
- package/es/components/cascader-panel/src/menu.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/cascader-panel/src/menu.vue_vue_type_template_id_9c79e4e2_lang.mjs +19 -2
- package/es/components/cascader-panel/src/menu.vue_vue_type_template_id_9c79e4e2_lang.mjs.map +1 -1
- package/es/components/cascader-panel/src/types.d.ts +1 -0
- package/es/components/cascader-panel/src/types.mjs.map +1 -1
- package/es/components/checkbox/index.d.ts +6 -6
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +2 -2
- package/es/components/checkbox/src/checkbox.vue.d.ts +2 -2
- package/es/components/config-provider/index.d.ts +6 -2
- package/es/components/config-provider/index.mjs +1 -1
- package/es/components/config-provider/src/config-provider.d.ts +13 -5
- package/es/components/config-provider/src/config-provider.mjs +12 -5
- package/es/components/config-provider/src/config-provider.mjs.map +1 -1
- package/es/components/date-picker/index.d.ts +4 -4
- package/es/components/date-picker/src/date-picker-com/basic-cell-render.mjs +1 -1
- package/es/components/date-picker/src/date-picker-com/basic-cell-render.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker.d.ts +2 -2
- package/es/components/form/index.d.ts +1 -0
- package/es/components/form/src/form.vue.d.ts +1 -0
- package/es/components/form/src/form.vue_vue_type_script_lang.mjs +14 -0
- package/es/components/form/src/form.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/form/src/form.vue_vue_type_template_id_602d6cf6_lang.mjs +1 -4
- package/es/components/form/src/form.vue_vue_type_template_id_602d6cf6_lang.mjs.map +1 -1
- package/es/components/index.mjs +2 -2
- package/es/components/input/index.d.ts +1 -0
- package/es/components/input/src/input.vue.d.ts +1 -0
- package/es/components/input/src/input.vue_vue_type_script_lang.mjs +1 -0
- package/es/components/input/src/input.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/input/src/input.vue_vue_type_template_id_3290dcb6_lang.mjs +1 -1
- package/es/components/input/src/input.vue_vue_type_template_id_3290dcb6_lang.mjs.map +1 -1
- package/es/components/input-number/index.d.ts +5 -1
- package/es/components/input-number/src/input-number.vue.d.ts +5 -1
- package/es/components/input-number/src/input-number.vue_vue_type_script_lang.mjs +15 -1
- package/es/components/input-number/src/input-number.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/input-number/src/input-number.vue_vue_type_template_id_dec60af6_lang.mjs +5 -4
- package/es/components/input-number/src/input-number.vue_vue_type_template_id_dec60af6_lang.mjs.map +1 -1
- package/es/components/message/src/message-method.mjs +5 -1
- package/es/components/message/src/message-method.mjs.map +1 -1
- package/es/components/message/src/message.d.ts +3 -0
- package/es/components/message/src/message.mjs.map +1 -1
- package/es/components/message/src/message.vue.d.ts +2 -2
- package/es/components/message-box/src/index.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/message-box/src/index.vue_vue_type_template_id_7035e868_lang.mjs +1 -0
- package/es/components/message-box/src/index.vue_vue_type_template_id_7035e868_lang.mjs.map +1 -1
- package/es/components/notification/src/notification.vue.d.ts +4 -4
- package/es/components/popper/src/content.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.mjs +1 -0
- package/es/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.mjs.map +1 -1
- package/es/components/radio/index.d.ts +6 -6
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-button.mjs +11 -5
- package/es/components/radio/src/radio-button.mjs.map +1 -1
- package/es/components/radio/src/radio-button.vue.d.ts +2 -2
- package/es/components/radio/src/radio-button.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/radio/src/radio-button2.mjs +5 -11
- package/es/components/radio/src/radio-button2.mjs.map +1 -1
- package/es/components/radio/src/radio.vue.d.ts +2 -2
- package/es/components/rate/index.d.ts +7 -1
- package/es/components/rate/src/rate.d.ts +2 -0
- package/es/components/rate/src/rate.mjs +5 -0
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate.vue.d.ts +7 -1
- package/es/components/rate/src/rate.vue_vue_type_script_lang.mjs +6 -0
- package/es/components/rate/src/rate.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.mjs +3 -3
- package/es/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.mjs.map +1 -1
- package/es/components/select/index.d.ts +1 -1
- package/es/components/select/src/select.vue.d.ts +1 -1
- package/es/components/select-v2/index.d.ts +2 -2
- package/es/components/select-v2/src/select.vue.d.ts +1 -1
- package/es/components/slider/index.d.ts +22 -6
- package/es/components/slider/src/index.vue.d.ts +11 -3
- package/es/components/slider/src/index.vue_vue_type_script_lang.mjs +21 -2
- package/es/components/slider/src/index.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/slider/src/index.vue_vue_type_template_id_24c42d04_lang.mjs +19 -19
- package/es/components/slider/src/index.vue_vue_type_template_id_24c42d04_lang.mjs.map +1 -1
- package/es/components/switch/index.d.ts +7 -2
- package/es/components/switch/src/switch.d.ts +2 -0
- package/es/components/switch/src/switch.mjs +5 -0
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch.vue.d.ts +7 -2
- package/es/components/switch/src/switch.vue_vue_type_script_lang.mjs +10 -1
- package/es/components/switch/src/switch.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.mjs +1 -1
- package/es/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.mjs.map +1 -1
- package/es/components/table/index.d.ts +9 -0
- package/es/components/table/src/table/style-helper.d.ts +7 -0
- package/es/components/table/src/table/style-helper.mjs +20 -17
- package/es/components/table/src/table/style-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/index.mjs +5 -3
- package/es/components/table/src/table-body/index.mjs.map +1 -1
- package/es/components/table/src/table-body/styles-helper.d.ts +0 -1
- package/es/components/table/src/table-body/styles-helper.mjs +10 -17
- package/es/components/table/src/table-body/styles-helper.mjs.map +1 -1
- package/es/components/table/src/table-column/defaults.d.ts +1 -0
- package/es/components/table/src/table-column/defaults.mjs.map +1 -1
- package/es/components/table/src/table-column/index.mjs +1 -0
- package/es/components/table/src/table-column/index.mjs.map +1 -1
- package/es/components/table/src/table-footer/index.d.ts +4 -2
- package/es/components/table/src/table-footer/index.mjs +33 -18
- package/es/components/table/src/table-footer/index.mjs.map +1 -1
- package/es/components/table/src/table-footer/style-helper.d.ts +4 -2
- package/es/components/table/src/table-footer/style-helper.mjs +28 -31
- package/es/components/table/src/table-footer/style-helper.mjs.map +1 -1
- package/es/components/table/src/table-header/index.d.ts +3 -2
- package/es/components/table/src/table-header/index.mjs +89 -51
- package/es/components/table/src/table-header/index.mjs.map +1 -1
- package/es/components/table/src/table-header/style.helper.d.ts +1 -1
- package/es/components/table/src/table-header/style.helper.mjs +14 -24
- package/es/components/table/src/table-header/style.helper.mjs.map +1 -1
- package/es/components/table/src/table-header/utils-helper.mjs +1 -0
- package/es/components/table/src/table-header/utils-helper.mjs.map +1 -1
- package/es/components/table/src/table-layout.d.ts +1 -0
- package/es/components/table/src/table-layout.mjs +8 -3
- package/es/components/table/src/table-layout.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +9 -0
- package/es/components/table/src/table.vue_vue_type_script_lang.mjs +12 -2
- package/es/components/table/src/table.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/table/src/table.vue_vue_type_template_id_4a1660ad_lang.mjs +62 -213
- package/es/components/table/src/table.vue_vue_type_template_id_4a1660ad_lang.mjs.map +1 -1
- package/es/components/table/src/util.d.ts +16 -2
- package/es/components/table/src/util.mjs +99 -6
- package/es/components/table/src/util.mjs.map +1 -1
- package/es/components/tabs/index.d.ts +4 -4
- package/es/components/tabs/src/tab-pane.vue.d.ts +2 -2
- package/es/components/time-picker/index.d.ts +4 -4
- package/es/components/time-picker/src/common/picker.vue.d.ts +2 -2
- package/es/components/time-picker/src/time-picker.d.ts +2 -2
- package/es/components/transfer/src/transfer-panel.vue.d.ts +1 -2
- package/es/components/transfer/src/transfer-panel.vue_vue_type_script_lang.mjs +2 -13
- package/es/components/transfer/src/transfer-panel.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel.vue_vue_type_template_id_1a7d1f9c_lang.mjs +5 -18
- package/es/components/transfer/src/transfer-panel.vue_vue_type_template_id_1a7d1f9c_lang.mjs.map +1 -1
- package/es/defaults.d.ts +3 -1
- package/es/hooks/index.mjs +1 -1
- package/es/hooks/use-global-config/index.d.ts +3 -1
- package/es/hooks/use-global-config/index.mjs +3 -2
- package/es/hooks/use-global-config/index.mjs.map +1 -1
- package/es/hooks/use-id/index.mjs +2 -2
- package/es/hooks/use-id/index.mjs.map +1 -1
- package/es/hooks/use-locale/index.d.ts +2 -253
- package/es/hooks/use-locale/index.mjs +9 -29
- package/es/hooks/use-locale/index.mjs.map +1 -1
- package/es/hooks/use-popper-container/index.mjs +2 -2
- package/es/hooks/use-popper-container/index.mjs.map +1 -1
- package/es/index.d.ts +4 -1
- package/es/index.mjs +4 -3
- package/es/index.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/cascader/index.d.ts +4 -0
- package/lib/components/cascader/src/index.vue.d.ts +2 -0
- package/lib/components/cascader-panel/src/index.vue_vue_type_script_lang.js +5 -4
- package/lib/components/cascader-panel/src/index.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/cascader-panel/src/index.vue_vue_type_template_id_97c48f5c_lang.js.map +1 -1
- package/lib/components/cascader-panel/src/menu.vue.d.ts +1 -0
- package/lib/components/cascader-panel/src/menu.vue_vue_type_script_lang.js +10 -4
- package/lib/components/cascader-panel/src/menu.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/cascader-panel/src/menu.vue_vue_type_template_id_9c79e4e2_lang.js +18 -1
- package/lib/components/cascader-panel/src/menu.vue_vue_type_template_id_9c79e4e2_lang.js.map +1 -1
- package/lib/components/cascader-panel/src/types.d.ts +1 -0
- package/lib/components/cascader-panel/src/types.js.map +1 -1
- package/lib/components/checkbox/index.d.ts +6 -6
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +2 -2
- package/lib/components/checkbox/src/checkbox.vue.d.ts +2 -2
- package/lib/components/config-provider/index.d.ts +6 -2
- package/lib/components/config-provider/index.js +1 -0
- package/lib/components/config-provider/index.js.map +1 -1
- package/lib/components/config-provider/src/config-provider.d.ts +13 -5
- package/lib/components/config-provider/src/config-provider.js +13 -5
- package/lib/components/config-provider/src/config-provider.js.map +1 -1
- package/lib/components/date-picker/index.d.ts +4 -4
- package/lib/components/date-picker/src/date-picker-com/basic-cell-render.js +1 -1
- package/lib/components/date-picker/src/date-picker-com/basic-cell-render.js.map +1 -1
- package/lib/components/date-picker/src/date-picker.d.ts +2 -2
- package/lib/components/form/index.d.ts +1 -0
- package/lib/components/form/src/form.vue.d.ts +1 -0
- package/lib/components/form/src/form.vue_vue_type_script_lang.js +14 -0
- package/lib/components/form/src/form.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/form/src/form.vue_vue_type_template_id_602d6cf6_lang.js +1 -4
- package/lib/components/form/src/form.vue_vue_type_template_id_602d6cf6_lang.js.map +1 -1
- package/lib/components/index.js +2 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/index.d.ts +1 -0
- package/lib/components/input/src/input.vue.d.ts +1 -0
- package/lib/components/input/src/input.vue_vue_type_script_lang.js +1 -0
- package/lib/components/input/src/input.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/input/src/input.vue_vue_type_template_id_3290dcb6_lang.js +1 -1
- package/lib/components/input/src/input.vue_vue_type_template_id_3290dcb6_lang.js.map +1 -1
- package/lib/components/input-number/index.d.ts +5 -1
- package/lib/components/input-number/src/input-number.vue.d.ts +5 -1
- package/lib/components/input-number/src/input-number.vue_vue_type_script_lang.js +18 -4
- package/lib/components/input-number/src/input-number.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/input-number/src/input-number.vue_vue_type_template_id_dec60af6_lang.js +5 -4
- package/lib/components/input-number/src/input-number.vue_vue_type_template_id_dec60af6_lang.js.map +1 -1
- package/lib/components/message/src/message-method.js +5 -1
- package/lib/components/message/src/message-method.js.map +1 -1
- package/lib/components/message/src/message.d.ts +3 -0
- package/lib/components/message/src/message.js.map +1 -1
- package/lib/components/message/src/message.vue.d.ts +2 -2
- package/lib/components/message-box/src/index.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/message-box/src/index.vue_vue_type_template_id_7035e868_lang.js +1 -0
- package/lib/components/message-box/src/index.vue_vue_type_template_id_7035e868_lang.js.map +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +4 -4
- package/lib/components/popper/src/content.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.js +1 -0
- package/lib/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.js.map +1 -1
- package/lib/components/radio/index.d.ts +6 -6
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-button.js +10 -5
- package/lib/components/radio/src/radio-button.js.map +1 -1
- package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
- package/lib/components/radio/src/radio-button.vue_vue_type_script_lang.js +1 -1
- package/lib/components/radio/src/radio-button2.js +5 -10
- package/lib/components/radio/src/radio-button2.js.map +1 -1
- package/lib/components/radio/src/radio.vue.d.ts +2 -2
- package/lib/components/rate/index.d.ts +7 -1
- package/lib/components/rate/src/rate.d.ts +2 -0
- package/lib/components/rate/src/rate.js +5 -0
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate.vue.d.ts +7 -1
- package/lib/components/rate/src/rate.vue_vue_type_script_lang.js +6 -0
- package/lib/components/rate/src/rate.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.js +2 -2
- package/lib/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.js.map +1 -1
- package/lib/components/select/index.d.ts +1 -1
- package/lib/components/select/src/select.vue.d.ts +1 -1
- package/lib/components/select-v2/index.d.ts +2 -2
- package/lib/components/select-v2/src/select.vue.d.ts +1 -1
- package/lib/components/slider/index.d.ts +22 -6
- package/lib/components/slider/src/index.vue.d.ts +11 -3
- package/lib/components/slider/src/index.vue_vue_type_script_lang.js +21 -2
- package/lib/components/slider/src/index.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/slider/src/index.vue_vue_type_template_id_24c42d04_lang.js +18 -18
- package/lib/components/slider/src/index.vue_vue_type_template_id_24c42d04_lang.js.map +1 -1
- package/lib/components/switch/index.d.ts +7 -2
- package/lib/components/switch/src/switch.d.ts +2 -0
- package/lib/components/switch/src/switch.js +5 -0
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +7 -2
- package/lib/components/switch/src/switch.vue_vue_type_script_lang.js +9 -0
- package/lib/components/switch/src/switch.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.js +1 -1
- package/lib/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.js.map +1 -1
- package/lib/components/table/index.d.ts +9 -0
- package/lib/components/table/src/table/style-helper.d.ts +7 -0
- package/lib/components/table/src/table/style-helper.js +20 -21
- package/lib/components/table/src/table/style-helper.js.map +1 -1
- package/lib/components/table/src/table-body/index.js +5 -3
- package/lib/components/table/src/table-body/index.js.map +1 -1
- package/lib/components/table/src/table-body/styles-helper.d.ts +0 -1
- package/lib/components/table/src/table-body/styles-helper.js +10 -17
- package/lib/components/table/src/table-body/styles-helper.js.map +1 -1
- package/lib/components/table/src/table-column/defaults.d.ts +1 -0
- package/lib/components/table/src/table-column/defaults.js.map +1 -1
- package/lib/components/table/src/table-column/index.js +1 -0
- package/lib/components/table/src/table-column/index.js.map +1 -1
- package/lib/components/table/src/table-footer/index.d.ts +4 -2
- package/lib/components/table/src/table-footer/index.js +32 -17
- package/lib/components/table/src/table-footer/index.js.map +1 -1
- package/lib/components/table/src/table-footer/style-helper.d.ts +4 -2
- package/lib/components/table/src/table-footer/style-helper.js +28 -31
- package/lib/components/table/src/table-footer/style-helper.js.map +1 -1
- package/lib/components/table/src/table-header/index.d.ts +3 -2
- package/lib/components/table/src/table-header/index.js +89 -51
- package/lib/components/table/src/table-header/index.js.map +1 -1
- package/lib/components/table/src/table-header/style.helper.d.ts +1 -1
- package/lib/components/table/src/table-header/style.helper.js +14 -24
- package/lib/components/table/src/table-header/style.helper.js.map +1 -1
- package/lib/components/table/src/table-header/utils-helper.js +1 -0
- package/lib/components/table/src/table-header/utils-helper.js.map +1 -1
- package/lib/components/table/src/table-layout.d.ts +1 -0
- package/lib/components/table/src/table-layout.js +8 -3
- package/lib/components/table/src/table-layout.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +9 -0
- package/lib/components/table/src/table.vue_vue_type_script_lang.js +12 -2
- package/lib/components/table/src/table.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/table/src/table.vue_vue_type_template_id_4a1660ad_lang.js +62 -213
- package/lib/components/table/src/table.vue_vue_type_template_id_4a1660ad_lang.js.map +1 -1
- package/lib/components/table/src/util.d.ts +16 -2
- package/lib/components/table/src/util.js +104 -5
- package/lib/components/table/src/util.js.map +1 -1
- package/lib/components/tabs/index.d.ts +4 -4
- package/lib/components/tabs/src/tab-pane.vue.d.ts +2 -2
- package/lib/components/time-picker/index.d.ts +4 -4
- package/lib/components/time-picker/src/common/picker.vue.d.ts +2 -2
- package/lib/components/time-picker/src/time-picker.d.ts +2 -2
- package/lib/components/transfer/src/transfer-panel.vue.d.ts +1 -2
- package/lib/components/transfer/src/transfer-panel.vue_vue_type_script_lang.js +3 -14
- package/lib/components/transfer/src/transfer-panel.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel.vue_vue_type_template_id_1a7d1f9c_lang.js +4 -17
- package/lib/components/transfer/src/transfer-panel.vue_vue_type_template_id_1a7d1f9c_lang.js.map +1 -1
- package/lib/defaults.d.ts +3 -1
- package/lib/hooks/index.js +1 -4
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-global-config/index.d.ts +3 -1
- package/lib/hooks/use-global-config/index.js +3 -2
- package/lib/hooks/use-global-config/index.js.map +1 -1
- package/lib/hooks/use-id/index.js +2 -2
- package/lib/hooks/use-id/index.js.map +1 -1
- package/lib/hooks/use-locale/index.d.ts +2 -253
- package/lib/hooks/use-locale/index.js +8 -31
- package/lib/hooks/use-locale/index.js.map +1 -1
- package/lib/hooks/use-popper-container/index.js +2 -2
- package/lib/hooks/use-popper-container/index.js.map +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-chalk/el-cascader.css +1 -1
- package/theme-chalk/el-checkbox.css +1 -1
- package/theme-chalk/el-date-picker.css +1 -1
- package/theme-chalk/el-form.css +1 -1
- package/theme-chalk/el-pagination.css +1 -1
- package/theme-chalk/el-radio.css +1 -1
- package/theme-chalk/el-rate.css +1 -1
- package/theme-chalk/el-select-v2.css +1 -1
- package/theme-chalk/el-slider.css +1 -1
- package/theme-chalk/el-switch.css +1 -1
- package/theme-chalk/el-table.css +1 -1
- package/theme-chalk/el-tag.css +1 -1
- package/theme-chalk/el-time-picker.css +1 -1
- package/theme-chalk/el-time-select.css +1 -1
- package/theme-chalk/el-transfer.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/cascader.scss +4 -0
- package/theme-chalk/src/checkbox.scss +40 -6
- package/theme-chalk/src/common/var.scss +2 -4
- package/theme-chalk/src/date-picker/picker-panel.scss +1 -1
- package/theme-chalk/src/date-picker/picker.scss +1 -0
- package/theme-chalk/src/form.scss +101 -24
- package/theme-chalk/src/pagination.scss +0 -3
- package/theme-chalk/src/radio.scss +21 -0
- package/theme-chalk/src/rate.scss +19 -2
- package/theme-chalk/src/select-v2.scss +2 -3
- package/theme-chalk/src/slider.scss +28 -77
- package/theme-chalk/src/switch.scss +43 -4
- package/theme-chalk/src/table.scss +176 -124
- package/theme-chalk/src/tag.scss +3 -3
- package/theme-chalk/src/transfer.scss +27 -31
- package/web-types.json +1 -1
- package/es/utils/isServer.d.ts +0 -2
- package/es/utils/isServer.mjs +0 -4
- package/es/utils/isServer.mjs.map +0 -1
- package/lib/utils/isServer.d.ts +0 -2
- package/lib/utils/isServer.js +0 -8
- package/lib/utils/isServer.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button2.js","sources":[
|
|
1
|
+
{"version":3,"file":"radio-button2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -27,9 +27,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
27
|
} & {
|
|
28
28
|
size: import("../../../utils/props").BuildPropType<StringConstructor, "" | "small" | "default" | "large", never>;
|
|
29
29
|
disabled: boolean;
|
|
30
|
-
name: string;
|
|
31
30
|
modelValue: import("../../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown>;
|
|
32
31
|
label: import("../../../utils/props").BuildPropType<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
32
|
+
name: string;
|
|
33
33
|
border: boolean;
|
|
34
34
|
} & {}> & {
|
|
35
35
|
onChange?: ((val: string | number | boolean) => any) | undefined;
|
|
@@ -37,9 +37,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
37
37
|
}, {
|
|
38
38
|
size: import("../../../utils/props").BuildPropType<StringConstructor, "" | "small" | "default" | "large", never>;
|
|
39
39
|
disabled: boolean;
|
|
40
|
-
name: string;
|
|
41
40
|
modelValue: import("../../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown>;
|
|
42
41
|
label: import("../../../utils/props").BuildPropType<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
42
|
+
name: string;
|
|
43
43
|
border: boolean;
|
|
44
44
|
}>;
|
|
45
45
|
export default _default;
|
|
@@ -16,6 +16,7 @@ export declare const ElRate: import("../../utils/types").SFCWithInstall<import("
|
|
|
16
16
|
readonly textColor: import("../../utils/props").BuildPropReturn<StringConstructor, "#1f2d3d", unknown, unknown, unknown>;
|
|
17
17
|
readonly texts: import("../../utils/props").BuildPropReturn<import("../../utils/props").PropWrapper<string[]>, () => ["Extremely bad", "Disappointed", "Fair", "Satisfied", "Surprise"], unknown, unknown, unknown>;
|
|
18
18
|
readonly scoreTemplate: import("../../utils/props").BuildPropReturn<StringConstructor, "{value}", unknown, unknown, unknown>;
|
|
19
|
+
readonly size: import("../../utils/props").BuildPropReturn<(new (...args: any[]) => import("../../utils/types").ComponentSize & {}) | (() => import("../../utils/types").ComponentSize) | ((new (...args: any[]) => import("../../utils/types").ComponentSize & {}) | (() => import("../../utils/types").ComponentSize))[], unknown, unknown, unknown, unknown>;
|
|
19
20
|
}, {
|
|
20
21
|
hoverIndex: import("vue").Ref<number>;
|
|
21
22
|
currentValue: import("vue").Ref<number>;
|
|
@@ -43,6 +44,7 @@ export declare const ElRate: import("../../utils/types").SFCWithInstall<import("
|
|
|
43
44
|
};
|
|
44
45
|
}>;
|
|
45
46
|
iconComponents: import("vue").ComputedRef<any[]>;
|
|
47
|
+
rateKls: import("vue").ComputedRef<string[]>;
|
|
46
48
|
showDecimalIcon: (item: number) => boolean;
|
|
47
49
|
getIconStyle: (item: number) => {
|
|
48
50
|
color: string | {
|
|
@@ -75,6 +77,7 @@ export declare const ElRate: import("../../utils/types").SFCWithInstall<import("
|
|
|
75
77
|
readonly textColor?: unknown;
|
|
76
78
|
readonly texts?: unknown;
|
|
77
79
|
readonly scoreTemplate?: unknown;
|
|
80
|
+
readonly size?: unknown;
|
|
78
81
|
} & {
|
|
79
82
|
disabled: import("../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
80
83
|
modelValue: number;
|
|
@@ -93,10 +96,13 @@ export declare const ElRate: import("../../utils/types").SFCWithInstall<import("
|
|
|
93
96
|
showScore: import("../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
94
97
|
texts: string[];
|
|
95
98
|
scoreTemplate: string;
|
|
96
|
-
} & {
|
|
99
|
+
} & {
|
|
100
|
+
size?: import("../../utils/props").BuildPropType<(new (...args: any[]) => import("../../utils/types").ComponentSize & {}) | (() => import("../../utils/types").ComponentSize) | ((new (...args: any[]) => import("../../utils/types").ComponentSize & {}) | (() => import("../../utils/types").ComponentSize))[], unknown, unknown> | undefined;
|
|
101
|
+
}> & {
|
|
97
102
|
onChange?: ((value: number) => any) | undefined;
|
|
98
103
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
99
104
|
}, {
|
|
105
|
+
size: import("../../utils/props").BuildPropType<(new (...args: any[]) => import("../../utils/types").ComponentSize & {}) | (() => import("../../utils/types").ComponentSize) | ((new (...args: any[]) => import("../../utils/types").ComponentSize & {}) | (() => import("../../utils/types").ComponentSize))[], unknown, unknown>;
|
|
100
106
|
disabled: import("../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
101
107
|
modelValue: number;
|
|
102
108
|
textColor: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComponentSize } from 'element-plus/es/utils/types';
|
|
1
2
|
import type { Component, ExtractPropTypes } from 'vue';
|
|
2
3
|
export declare const rateProps: {
|
|
3
4
|
readonly modelValue: import("element-plus/es/utils/props").BuildPropReturn<NumberConstructor, 0, unknown, unknown, unknown>;
|
|
@@ -17,6 +18,7 @@ export declare const rateProps: {
|
|
|
17
18
|
readonly textColor: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "#1f2d3d", unknown, unknown, unknown>;
|
|
18
19
|
readonly texts: import("element-plus/es/utils/props").BuildPropReturn<import("element-plus/es/utils/props").PropWrapper<string[]>, () => ["Extremely bad", "Disappointed", "Fair", "Satisfied", "Surprise"], unknown, unknown, unknown>;
|
|
19
20
|
readonly scoreTemplate: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "{value}", unknown, unknown, unknown>;
|
|
21
|
+
readonly size: import("element-plus/es/utils/props").BuildPropReturn<(new (...args: any[]) => ComponentSize & {}) | (() => ComponentSize) | ((new (...args: any[]) => ComponentSize & {}) | (() => ComponentSize))[], unknown, unknown, unknown, unknown>;
|
|
20
22
|
};
|
|
21
23
|
export declare type RateProps = ExtractPropTypes<typeof rateProps>;
|
|
22
24
|
export declare const rateEmits: {
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var iconsVue = require('@element-plus/icons-vue');
|
|
6
6
|
var constants = require('../../../utils/constants.js');
|
|
7
7
|
var props = require('../../../utils/props.js');
|
|
8
|
+
var validators = require('../../../utils/validators.js');
|
|
8
9
|
|
|
9
10
|
const rateProps = props.buildProps({
|
|
10
11
|
modelValue: {
|
|
@@ -80,6 +81,10 @@ const rateProps = props.buildProps({
|
|
|
80
81
|
scoreTemplate: {
|
|
81
82
|
type: String,
|
|
82
83
|
default: "{value}"
|
|
84
|
+
},
|
|
85
|
+
size: {
|
|
86
|
+
type: String,
|
|
87
|
+
validator: validators.isValidComponentSize
|
|
83
88
|
}
|
|
84
89
|
});
|
|
85
90
|
const rateEmits = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate.js","sources":["../../../../../../packages/components/rate/src/rate.ts"],"sourcesContent":["import { Star, StarFilled } from '@element-plus/icons-vue'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { buildProps, definePropType, mutable } from '@element-plus/utils/props'\nimport type { Component, ExtractPropTypes } from 'vue'\n\nexport const rateProps = buildProps({\n modelValue: {\n type: Number,\n default: 0,\n },\n lowThreshold: {\n type: Number,\n default: 2,\n },\n highThreshold: {\n type: Number,\n default: 4,\n },\n max: {\n type: Number,\n default: 5,\n },\n colors: {\n type: definePropType<string[] | Record<number, string>>([Array, Object]),\n default: () => mutable(['#F7BA2A', '#F7BA2A', '#F7BA2A'] as const),\n },\n voidColor: {\n type: String,\n default: '#C6D1DE',\n },\n disabledVoidColor: {\n type: String,\n default: '#EFF2F7',\n },\n icons: {\n type: definePropType<\n Array<string | Component> | Record<number, string | Component>\n >([Array, Object]),\n default: () => [StarFilled, StarFilled, StarFilled],\n },\n voidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => Star,\n },\n disabledvoidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => StarFilled,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n allowHalf: {\n type: Boolean,\n default: false,\n },\n showText: {\n type: Boolean,\n default: false,\n },\n showScore: {\n type: Boolean,\n default: false,\n },\n textColor: {\n type: String,\n default: '#1f2d3d',\n },\n texts: {\n type: definePropType<string[]>([Array]),\n default: () =>\n mutable([\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ] as const),\n },\n scoreTemplate: {\n type: String,\n default: '{value}',\n },\n} as const)\n\nexport type RateProps = ExtractPropTypes<typeof rateProps>\n\nexport const rateEmits = {\n change: (value: number) => typeof value === 'number',\n [UPDATE_MODEL_EVENT]: (value: number) => typeof value === 'number',\n}\nexport type RateEmits = typeof rateEmits\n"],"names":["buildProps","definePropType","mutable","StarFilled","Star","UPDATE_MODEL_EVENT"],"mappings":"
|
|
1
|
+
{"version":3,"file":"rate.js","sources":["../../../../../../packages/components/rate/src/rate.ts"],"sourcesContent":["import { Star, StarFilled } from '@element-plus/icons-vue'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { buildProps, definePropType, mutable } from '@element-plus/utils/props'\nimport { isValidComponentSize } from '@element-plus/utils/validators'\nimport type { ComponentSize } from '@element-plus/utils/types'\nimport type { Component, ExtractPropTypes, PropType } from 'vue'\n\nexport const rateProps = buildProps({\n modelValue: {\n type: Number,\n default: 0,\n },\n lowThreshold: {\n type: Number,\n default: 2,\n },\n highThreshold: {\n type: Number,\n default: 4,\n },\n max: {\n type: Number,\n default: 5,\n },\n colors: {\n type: definePropType<string[] | Record<number, string>>([Array, Object]),\n default: () => mutable(['#F7BA2A', '#F7BA2A', '#F7BA2A'] as const),\n },\n voidColor: {\n type: String,\n default: '#C6D1DE',\n },\n disabledVoidColor: {\n type: String,\n default: '#EFF2F7',\n },\n icons: {\n type: definePropType<\n Array<string | Component> | Record<number, string | Component>\n >([Array, Object]),\n default: () => [StarFilled, StarFilled, StarFilled],\n },\n voidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => Star,\n },\n disabledvoidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => StarFilled,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n allowHalf: {\n type: Boolean,\n default: false,\n },\n showText: {\n type: Boolean,\n default: false,\n },\n showScore: {\n type: Boolean,\n default: false,\n },\n textColor: {\n type: String,\n default: '#1f2d3d',\n },\n texts: {\n type: definePropType<string[]>([Array]),\n default: () =>\n mutable([\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ] as const),\n },\n scoreTemplate: {\n type: String,\n default: '{value}',\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n} as const)\n\nexport type RateProps = ExtractPropTypes<typeof rateProps>\n\nexport const rateEmits = {\n change: (value: number) => typeof value === 'number',\n [UPDATE_MODEL_EVENT]: (value: number) => typeof value === 'number',\n}\nexport type RateEmits = typeof rateEmits\n"],"names":["buildProps","definePropType","mutable","StarFilled","Star","isValidComponentSize","UPDATE_MODEL_EVENT"],"mappings":"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"}
|
|
@@ -16,6 +16,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
16
|
readonly textColor: import("../../../utils/props").BuildPropReturn<StringConstructor, "#1f2d3d", unknown, unknown, unknown>;
|
|
17
17
|
readonly texts: import("../../../utils/props").BuildPropReturn<import("../../../utils/props").PropWrapper<string[]>, () => ["Extremely bad", "Disappointed", "Fair", "Satisfied", "Surprise"], unknown, unknown, unknown>;
|
|
18
18
|
readonly scoreTemplate: import("../../../utils/props").BuildPropReturn<StringConstructor, "{value}", unknown, unknown, unknown>;
|
|
19
|
+
readonly size: import("../../../utils/props").BuildPropReturn<(new (...args: any[]) => import("../../../utils/types").ComponentSize & {}) | (() => import("../../../utils/types").ComponentSize) | ((new (...args: any[]) => import("../../../utils/types").ComponentSize & {}) | (() => import("../../../utils/types").ComponentSize))[], unknown, unknown, unknown, unknown>;
|
|
19
20
|
}, {
|
|
20
21
|
hoverIndex: import("vue").Ref<number>;
|
|
21
22
|
currentValue: import("vue").Ref<number>;
|
|
@@ -43,6 +44,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
44
|
};
|
|
44
45
|
}>;
|
|
45
46
|
iconComponents: import("vue").ComputedRef<any[]>;
|
|
47
|
+
rateKls: import("vue").ComputedRef<string[]>;
|
|
46
48
|
showDecimalIcon: (item: number) => boolean;
|
|
47
49
|
getIconStyle: (item: number) => {
|
|
48
50
|
color: string | {
|
|
@@ -75,6 +77,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
75
77
|
readonly textColor?: unknown;
|
|
76
78
|
readonly texts?: unknown;
|
|
77
79
|
readonly scoreTemplate?: unknown;
|
|
80
|
+
readonly size?: unknown;
|
|
78
81
|
} & {
|
|
79
82
|
disabled: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
80
83
|
modelValue: number;
|
|
@@ -93,10 +96,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
93
96
|
showScore: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
94
97
|
texts: string[];
|
|
95
98
|
scoreTemplate: string;
|
|
96
|
-
} & {
|
|
99
|
+
} & {
|
|
100
|
+
size?: import("../../../utils/props").BuildPropType<(new (...args: any[]) => import("../../../utils/types").ComponentSize & {}) | (() => import("../../../utils/types").ComponentSize) | ((new (...args: any[]) => import("../../../utils/types").ComponentSize & {}) | (() => import("../../../utils/types").ComponentSize))[], unknown, unknown> | undefined;
|
|
101
|
+
}> & {
|
|
97
102
|
onChange?: ((value: number) => any) | undefined;
|
|
98
103
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
99
104
|
}, {
|
|
105
|
+
size: import("../../../utils/props").BuildPropType<(new (...args: any[]) => import("../../../utils/types").ComponentSize & {}) | (() => import("../../../utils/types").ComponentSize) | ((new (...args: any[]) => import("../../../utils/types").ComponentSize & {}) | (() => import("../../../utils/types").ComponentSize))[], unknown, unknown>;
|
|
100
106
|
disabled: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
101
107
|
modelValue: number;
|
|
102
108
|
textColor: string;
|
|
@@ -10,8 +10,10 @@ var aria = require('../../../utils/aria.js');
|
|
|
10
10
|
var constants = require('../../../utils/constants.js');
|
|
11
11
|
var index = require('../../icon/index.js');
|
|
12
12
|
var iconsVue = require('@element-plus/icons-vue');
|
|
13
|
+
require('../../../hooks/index.js');
|
|
13
14
|
var rate = require('./rate.js');
|
|
14
15
|
var form = require('../../../tokens/form.js');
|
|
16
|
+
var index$1 = require('../../../hooks/use-common-props/index.js');
|
|
15
17
|
|
|
16
18
|
function getValueFromMap(value, map) {
|
|
17
19
|
const isExcludedObject = (val) => shared.isObject(val);
|
|
@@ -34,9 +36,12 @@ var script = vue.defineComponent({
|
|
|
34
36
|
emits: rate.rateEmits,
|
|
35
37
|
setup(props, { emit }) {
|
|
36
38
|
const elForm = vue.inject(form.elFormKey, {});
|
|
39
|
+
const rateSize = index$1.useSize();
|
|
37
40
|
const currentValue = vue.ref(props.modelValue);
|
|
38
41
|
const hoverIndex = vue.ref(-1);
|
|
39
42
|
const pointerAtLeftHalf = vue.ref(true);
|
|
43
|
+
const prefix = "el-rate";
|
|
44
|
+
const rateKls = vue.computed(() => [prefix, `${prefix}--${rateSize.value}`]);
|
|
40
45
|
const rateDisabled = vue.computed(() => props.disabled || elForm.disabled);
|
|
41
46
|
const text = vue.computed(() => {
|
|
42
47
|
let result = "";
|
|
@@ -184,6 +189,7 @@ var script = vue.defineComponent({
|
|
|
184
189
|
decimalStyle,
|
|
185
190
|
decimalIconComponent,
|
|
186
191
|
iconComponents,
|
|
192
|
+
rateKls,
|
|
187
193
|
showDecimalIcon,
|
|
188
194
|
getIconStyle,
|
|
189
195
|
selectValue,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate.vue_vue_type_script_lang.js","sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n class=\"el-rate\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n let target = event.target as HTMLElement\n if (hasClass(target, 'el-rate__item')) {\n target = target.querySelector('.el-rate__icon')!\n }\n if (target.clientWidth === 0 || hasClass(target, 'el-rate__decimal')) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElIcon","StarFilled","rateProps","inject","elFormKey","ref","computed","EVENT_CODE"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"rate.vue_vue_type_script_lang.js","sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { useSize } from '@element-plus/hooks'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const rateSize = useSize()\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const prefix = 'el-rate'\n const rateKls = computed(() => [prefix, `${prefix}--${rateSize.value}`])\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n let target = event.target as HTMLElement\n if (hasClass(target, 'el-rate__item')) {\n target = target.querySelector('.el-rate__icon')!\n }\n if (target.clientWidth === 0 || hasClass(target, 'el-rate__decimal')) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n rateKls,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElIcon","StarFilled","rateProps","inject","elFormKey","useSize","ref","computed","isArray","UPDATE_MODEL_EVENT","EVENT_CODE"],"mappings":"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"}
|
|
@@ -9,7 +9,7 @@ const _hoisted_2 = ["onMousemove", "onClick"];
|
|
|
9
9
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
10
10
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
11
11
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
12
|
-
class:
|
|
12
|
+
class: vue.normalizeClass(_ctx.rateKls),
|
|
13
13
|
role: "slider",
|
|
14
14
|
"aria-valuenow": _ctx.currentValue,
|
|
15
15
|
"aria-valuetext": _ctx.text,
|
|
@@ -53,7 +53,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
53
53
|
class: "el-rate__text",
|
|
54
54
|
style: vue.normalizeStyle({ color: _ctx.textColor })
|
|
55
55
|
}, vue.toDisplayString(_ctx.text), 5)) : vue.createCommentVNode("v-if", true)
|
|
56
|
-
],
|
|
56
|
+
], 42, _hoisted_1);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
exports.render = render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate.vue_vue_type_template_id_38c42df6_lang.js","sources":["../../../../../../packages/components/rate/src/rate.vue?vue&type=template&id=38c42df6&lang.js"],"sourcesContent":["<template>\n <div\n class=\"
|
|
1
|
+
{"version":3,"file":"rate.vue_vue_type_template_id_38c42df6_lang.js","sources":["../../../../../../packages/components/rate/src/rate.vue?vue&type=template&id=38c42df6&lang.js"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { useSize } from '@element-plus/hooks'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const rateSize = useSize()\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const prefix = 'el-rate'\n const rateKls = computed(() => [prefix, `${prefix}--${rateSize.value}`])\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n let target = event.target as HTMLElement\n if (hasClass(target, 'el-rate__item')) {\n target = target.querySelector('.el-rate__icon')!\n }\n if (target.clientWidth === 0 || hasClass(target, 'el-rate__decimal')) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n rateKls,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":["_openBlock","_createVNode"],"mappings":";;;;;;;;;;;;;;IAEK,uBAAO;IACR;IACC,eAAa,EAAE;IACf;IACD,iBAAc;;;aAGNA,gDAAE;;;;QAIP;QACD;QACC;;QAEAC,eAAU;eACL,gCAAa,KAAK;;;UAGrB;;;;;;;;;;;;;;;;;;;;;;KAeG;;;;;"}
|
|
@@ -844,8 +844,8 @@ export declare const ElSelect: import("../../utils/types").SFCWithInstall<import
|
|
|
844
844
|
tagType: string;
|
|
845
845
|
} & {
|
|
846
846
|
size?: import("../../utils/types").ComponentSize | undefined;
|
|
847
|
-
name?: string | undefined;
|
|
848
847
|
modelValue?: string | number | boolean | unknown[] | Record<string, any> | undefined;
|
|
848
|
+
name?: string | undefined;
|
|
849
849
|
id?: string | undefined;
|
|
850
850
|
placeholder?: string | undefined;
|
|
851
851
|
filterMethod?: Function | undefined;
|
|
@@ -847,8 +847,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
847
847
|
tagType: string;
|
|
848
848
|
} & {
|
|
849
849
|
size?: ComponentSize | undefined;
|
|
850
|
-
name?: string | undefined;
|
|
851
850
|
modelValue?: string | number | boolean | unknown[] | Record<string, any> | undefined;
|
|
851
|
+
name?: string | undefined;
|
|
852
852
|
id?: string | undefined;
|
|
853
853
|
placeholder?: string | undefined;
|
|
854
854
|
filterMethod?: Function | undefined;
|
|
@@ -877,9 +877,9 @@ declare const _Select: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
877
877
|
scrollbarAlwaysOn: boolean;
|
|
878
878
|
} & {
|
|
879
879
|
size?: import("element-plus/es/utils/types").ComponentSize | undefined;
|
|
880
|
-
name?: string | undefined;
|
|
881
880
|
modelValue?: any;
|
|
882
881
|
label?: string | undefined;
|
|
882
|
+
name?: string | undefined;
|
|
883
883
|
id?: string | undefined;
|
|
884
884
|
placeholder?: string | undefined;
|
|
885
885
|
options?: import("./src/select.types").OptionType<any>[] | undefined;
|
|
@@ -1800,9 +1800,9 @@ export declare const ElSelectV2: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1800
1800
|
scrollbarAlwaysOn: boolean;
|
|
1801
1801
|
} & {
|
|
1802
1802
|
size?: import("element-plus/es/utils/types").ComponentSize | undefined;
|
|
1803
|
-
name?: string | undefined;
|
|
1804
1803
|
modelValue?: any;
|
|
1805
1804
|
label?: string | undefined;
|
|
1805
|
+
name?: string | undefined;
|
|
1806
1806
|
id?: string | undefined;
|
|
1807
1807
|
placeholder?: string | undefined;
|
|
1808
1808
|
options?: import("./src/select.types").OptionType<any>[] | undefined;
|
|
@@ -876,9 +876,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
876
876
|
scrollbarAlwaysOn: boolean;
|
|
877
877
|
} & {
|
|
878
878
|
size?: import("../../../utils/types").ComponentSize | undefined;
|
|
879
|
-
name?: string | undefined;
|
|
880
879
|
modelValue?: any;
|
|
881
880
|
label?: string | undefined;
|
|
881
|
+
name?: string | undefined;
|
|
882
882
|
id?: string | undefined;
|
|
883
883
|
placeholder?: string | undefined;
|
|
884
884
|
options?: import("./select.types").OptionType<any>[] | undefined;
|
|
@@ -24,9 +24,13 @@ declare const _Slider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
24
24
|
type: BooleanConstructor;
|
|
25
25
|
default: boolean;
|
|
26
26
|
};
|
|
27
|
+
size: {
|
|
28
|
+
type: import("vue").PropType<import("element-plus/es/utils/types").ComponentSize>;
|
|
29
|
+
validator: (val: string) => boolean;
|
|
30
|
+
};
|
|
27
31
|
inputSize: {
|
|
28
32
|
type: import("vue").PropType<import("element-plus/es/utils/types").ComponentSize>;
|
|
29
|
-
|
|
33
|
+
validator: (val: string) => boolean;
|
|
30
34
|
};
|
|
31
35
|
showStops: {
|
|
32
36
|
type: BooleanConstructor;
|
|
@@ -89,6 +93,9 @@ declare const _Slider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
89
93
|
stops: import("vue").ComputedRef<number[]>;
|
|
90
94
|
markList: import("vue").ComputedRef<import("./src/slider.type").Mark[]>;
|
|
91
95
|
sliderWrapper: import("vue").Ref<import("element-plus/es/utils/types").Nullable<HTMLElement>>;
|
|
96
|
+
sliderWrapperSize: import("vue").ComputedRef<import("element-plus/es/utils/types").ComponentSize>;
|
|
97
|
+
sliderInputSize: import("vue").ComputedRef<import("element-plus/es/utils/types").ComponentSize>;
|
|
98
|
+
sliderKls: import("vue").ComputedRef<string[]>;
|
|
92
99
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue" | "change")[], "input" | "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
93
100
|
modelValue?: unknown;
|
|
94
101
|
min?: unknown;
|
|
@@ -96,6 +103,7 @@ declare const _Slider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
96
103
|
step?: unknown;
|
|
97
104
|
showInput?: unknown;
|
|
98
105
|
showInputControls?: unknown;
|
|
106
|
+
size?: unknown;
|
|
99
107
|
inputSize?: unknown;
|
|
100
108
|
showStops?: unknown;
|
|
101
109
|
showTooltip?: unknown;
|
|
@@ -114,7 +122,6 @@ declare const _Slider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
114
122
|
height: string;
|
|
115
123
|
vertical: boolean;
|
|
116
124
|
range: boolean;
|
|
117
|
-
inputSize: import("element-plus/es/utils/types").ComponentSize;
|
|
118
125
|
debounce: number;
|
|
119
126
|
max: number;
|
|
120
127
|
min: number;
|
|
@@ -124,7 +131,9 @@ declare const _Slider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
124
131
|
showInputControls: boolean;
|
|
125
132
|
showStops: boolean;
|
|
126
133
|
} & {
|
|
134
|
+
size?: import("element-plus/es/utils/types").ComponentSize | undefined;
|
|
127
135
|
label?: string | undefined;
|
|
136
|
+
inputSize?: import("element-plus/es/utils/types").ComponentSize | undefined;
|
|
128
137
|
tooltipClass?: string | undefined;
|
|
129
138
|
formatTooltip?: ((val: number) => string | number) | undefined;
|
|
130
139
|
marks?: Record<string, any> | undefined;
|
|
@@ -139,7 +148,6 @@ declare const _Slider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
139
148
|
height: string;
|
|
140
149
|
vertical: boolean;
|
|
141
150
|
range: boolean;
|
|
142
|
-
inputSize: import("element-plus/es/utils/types").ComponentSize;
|
|
143
151
|
debounce: number;
|
|
144
152
|
max: number;
|
|
145
153
|
min: number;
|
|
@@ -177,9 +185,13 @@ export declare const ElSlider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
177
185
|
type: BooleanConstructor;
|
|
178
186
|
default: boolean;
|
|
179
187
|
};
|
|
188
|
+
size: {
|
|
189
|
+
type: import("vue").PropType<import("element-plus/es/utils/types").ComponentSize>;
|
|
190
|
+
validator: (val: string) => boolean;
|
|
191
|
+
};
|
|
180
192
|
inputSize: {
|
|
181
193
|
type: import("vue").PropType<import("element-plus/es/utils/types").ComponentSize>;
|
|
182
|
-
|
|
194
|
+
validator: (val: string) => boolean;
|
|
183
195
|
};
|
|
184
196
|
showStops: {
|
|
185
197
|
type: BooleanConstructor;
|
|
@@ -242,6 +254,9 @@ export declare const ElSlider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
242
254
|
stops: import("vue").ComputedRef<number[]>;
|
|
243
255
|
markList: import("vue").ComputedRef<import("./src/slider.type").Mark[]>;
|
|
244
256
|
sliderWrapper: import("vue").Ref<import("element-plus/es/utils/types").Nullable<HTMLElement>>;
|
|
257
|
+
sliderWrapperSize: import("vue").ComputedRef<import("element-plus/es/utils/types").ComponentSize>;
|
|
258
|
+
sliderInputSize: import("vue").ComputedRef<import("element-plus/es/utils/types").ComponentSize>;
|
|
259
|
+
sliderKls: import("vue").ComputedRef<string[]>;
|
|
245
260
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue" | "change")[], "input" | "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
246
261
|
modelValue?: unknown;
|
|
247
262
|
min?: unknown;
|
|
@@ -249,6 +264,7 @@ export declare const ElSlider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
249
264
|
step?: unknown;
|
|
250
265
|
showInput?: unknown;
|
|
251
266
|
showInputControls?: unknown;
|
|
267
|
+
size?: unknown;
|
|
252
268
|
inputSize?: unknown;
|
|
253
269
|
showStops?: unknown;
|
|
254
270
|
showTooltip?: unknown;
|
|
@@ -267,7 +283,6 @@ export declare const ElSlider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
267
283
|
height: string;
|
|
268
284
|
vertical: boolean;
|
|
269
285
|
range: boolean;
|
|
270
|
-
inputSize: import("element-plus/es/utils/types").ComponentSize;
|
|
271
286
|
debounce: number;
|
|
272
287
|
max: number;
|
|
273
288
|
min: number;
|
|
@@ -277,7 +292,9 @@ export declare const ElSlider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
277
292
|
showInputControls: boolean;
|
|
278
293
|
showStops: boolean;
|
|
279
294
|
} & {
|
|
295
|
+
size?: import("element-plus/es/utils/types").ComponentSize | undefined;
|
|
280
296
|
label?: string | undefined;
|
|
297
|
+
inputSize?: import("element-plus/es/utils/types").ComponentSize | undefined;
|
|
281
298
|
tooltipClass?: string | undefined;
|
|
282
299
|
formatTooltip?: ((val: number) => string | number) | undefined;
|
|
283
300
|
marks?: Record<string, any> | undefined;
|
|
@@ -292,7 +309,6 @@ export declare const ElSlider: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
292
309
|
height: string;
|
|
293
310
|
vertical: boolean;
|
|
294
311
|
range: boolean;
|
|
295
|
-
inputSize: import("element-plus/es/utils/types").ComponentSize;
|
|
296
312
|
debounce: number;
|
|
297
313
|
max: number;
|
|
298
314
|
min: number;
|
|
@@ -25,9 +25,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
25
25
|
type: BooleanConstructor;
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
|
+
size: {
|
|
29
|
+
type: PropType<ComponentSize>;
|
|
30
|
+
validator: (val: string) => boolean;
|
|
31
|
+
};
|
|
28
32
|
inputSize: {
|
|
29
33
|
type: PropType<ComponentSize>;
|
|
30
|
-
|
|
34
|
+
validator: (val: string) => boolean;
|
|
31
35
|
};
|
|
32
36
|
showStops: {
|
|
33
37
|
type: BooleanConstructor;
|
|
@@ -90,6 +94,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
90
94
|
stops: import("vue").ComputedRef<number[]>;
|
|
91
95
|
markList: import("vue").ComputedRef<import("./slider.type").Mark[]>;
|
|
92
96
|
sliderWrapper: Ref<Nullable<HTMLElement>>;
|
|
97
|
+
sliderWrapperSize: import("vue").ComputedRef<ComponentSize>;
|
|
98
|
+
sliderInputSize: import("vue").ComputedRef<ComponentSize>;
|
|
99
|
+
sliderKls: import("vue").ComputedRef<string[]>;
|
|
93
100
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue" | "change")[], "input" | "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
94
101
|
modelValue?: unknown;
|
|
95
102
|
min?: unknown;
|
|
@@ -97,6 +104,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
97
104
|
step?: unknown;
|
|
98
105
|
showInput?: unknown;
|
|
99
106
|
showInputControls?: unknown;
|
|
107
|
+
size?: unknown;
|
|
100
108
|
inputSize?: unknown;
|
|
101
109
|
showStops?: unknown;
|
|
102
110
|
showTooltip?: unknown;
|
|
@@ -115,7 +123,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
115
123
|
height: string;
|
|
116
124
|
vertical: boolean;
|
|
117
125
|
range: boolean;
|
|
118
|
-
inputSize: ComponentSize;
|
|
119
126
|
debounce: number;
|
|
120
127
|
max: number;
|
|
121
128
|
min: number;
|
|
@@ -125,7 +132,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
125
132
|
showInputControls: boolean;
|
|
126
133
|
showStops: boolean;
|
|
127
134
|
} & {
|
|
135
|
+
size?: ComponentSize | undefined;
|
|
128
136
|
label?: string | undefined;
|
|
137
|
+
inputSize?: ComponentSize | undefined;
|
|
129
138
|
tooltipClass?: string | undefined;
|
|
130
139
|
formatTooltip?: ((val: number) => number | string) | undefined;
|
|
131
140
|
marks?: Record<string, any> | undefined;
|
|
@@ -140,7 +149,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
140
149
|
height: string;
|
|
141
150
|
vertical: boolean;
|
|
142
151
|
range: boolean;
|
|
143
|
-
inputSize: ComponentSize;
|
|
144
152
|
debounce: number;
|
|
145
153
|
max: number;
|
|
146
154
|
min: number;
|
|
@@ -7,6 +7,8 @@ var index = require('../../input-number/index.js');
|
|
|
7
7
|
var constants = require('../../../utils/constants.js');
|
|
8
8
|
var dom = require('../../../utils/dom.js');
|
|
9
9
|
var error = require('../../../utils/error.js');
|
|
10
|
+
var validators = require('../../../utils/validators.js');
|
|
11
|
+
require('../../../hooks/index.js');
|
|
10
12
|
require('./button.js');
|
|
11
13
|
require('./marker.js');
|
|
12
14
|
var useMarks = require('./useMarks.js');
|
|
@@ -14,6 +16,7 @@ var useSlide = require('./useSlide.js');
|
|
|
14
16
|
var useStops = require('./useStops.js');
|
|
15
17
|
var button_vue_vue_type_script_lang = require('./button.vue_vue_type_script_lang.js');
|
|
16
18
|
var marker_vue_vue_type_script_lang = require('./marker.vue_vue_type_script_lang.js');
|
|
19
|
+
var index$1 = require('../../../hooks/use-common-props/index.js');
|
|
17
20
|
|
|
18
21
|
var script = vue.defineComponent({
|
|
19
22
|
name: "ElSlider",
|
|
@@ -47,9 +50,13 @@ var script = vue.defineComponent({
|
|
|
47
50
|
type: Boolean,
|
|
48
51
|
default: true
|
|
49
52
|
},
|
|
53
|
+
size: {
|
|
54
|
+
type: String,
|
|
55
|
+
validator: validators.isValidComponentSize
|
|
56
|
+
},
|
|
50
57
|
inputSize: {
|
|
51
58
|
type: String,
|
|
52
|
-
|
|
59
|
+
validator: validators.isValidComponentSize
|
|
53
60
|
},
|
|
54
61
|
showStops: {
|
|
55
62
|
type: Boolean,
|
|
@@ -119,6 +126,15 @@ var script = vue.defineComponent({
|
|
|
119
126
|
setSecondValue
|
|
120
127
|
} = useSlide.useSlide(props, initData, emit);
|
|
121
128
|
const { stops, getStopStyle } = useStops.useStops(props, initData, minValue, maxValue);
|
|
129
|
+
const sliderWrapperSize = index$1.useSize();
|
|
130
|
+
const sliderInputSize = vue.computed(() => props.inputSize || sliderWrapperSize.value);
|
|
131
|
+
const prefix = "el-slider";
|
|
132
|
+
const sliderKls = vue.computed(() => [
|
|
133
|
+
prefix,
|
|
134
|
+
`${prefix}--${sliderWrapperSize.value}`,
|
|
135
|
+
props.vertical ? "is-vertical" : "",
|
|
136
|
+
props.showInput ? "el-slider--with-input" : ""
|
|
137
|
+
]);
|
|
122
138
|
const markList = useMarks.useMarks(props);
|
|
123
139
|
useWatch(props, initData, minValue, maxValue, emit, elFormItem);
|
|
124
140
|
const precision = vue.computed(() => {
|
|
@@ -161,7 +177,10 @@ var script = vue.defineComponent({
|
|
|
161
177
|
setSecondValue,
|
|
162
178
|
stops,
|
|
163
179
|
markList,
|
|
164
|
-
sliderWrapper
|
|
180
|
+
sliderWrapper,
|
|
181
|
+
sliderWrapperSize,
|
|
182
|
+
sliderInputSize,
|
|
183
|
+
sliderKls
|
|
165
184
|
};
|
|
166
185
|
}
|
|
167
186
|
});
|