@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
|
@@ -3,54 +3,51 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
+
var util = require('../util.js');
|
|
6
7
|
var mapStateHelper = require('./mapState-helper.js');
|
|
7
8
|
|
|
8
9
|
function useStyle(props) {
|
|
9
10
|
const instance = vue.getCurrentInstance();
|
|
10
11
|
const table = instance.parent;
|
|
11
|
-
const
|
|
12
|
-
const {
|
|
13
|
-
leftFixedLeafCount,
|
|
14
|
-
rightFixedLeafCount,
|
|
15
|
-
columnsCount,
|
|
16
|
-
leftFixedCount,
|
|
17
|
-
rightFixedCount,
|
|
18
|
-
columns
|
|
19
|
-
} = mapStateHelper["default"]();
|
|
12
|
+
const { columns } = mapStateHelper["default"]();
|
|
20
13
|
const hasGutter = vue.computed(() => {
|
|
21
|
-
return !props.fixed &&
|
|
14
|
+
return !props.fixed && table.layout.gutterWidth > 0 && table.layout.height.value && table.layout.bodyScrollHeight.value > table.layout.bodyHeight.value;
|
|
22
15
|
});
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return index < leftFixedCount.value || index >= columnsCount.value - rightFixedCount.value;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const getRowClasses = (column, cellIndex) => {
|
|
39
|
-
const classes = [column.id, column.align, column.labelClassName];
|
|
16
|
+
const gutterWidth = vue.computed(() => {
|
|
17
|
+
return table.layout.gutterWidth;
|
|
18
|
+
});
|
|
19
|
+
const getCellClasses = (columns2, cellIndex, hasGutter2) => {
|
|
20
|
+
const column = columns2[cellIndex];
|
|
21
|
+
const classes = [
|
|
22
|
+
"el-table__cell",
|
|
23
|
+
column.id,
|
|
24
|
+
column.align,
|
|
25
|
+
column.labelClassName,
|
|
26
|
+
...util.getFixedColumnsClass(cellIndex, column.fixed, props.store)
|
|
27
|
+
];
|
|
40
28
|
if (column.className) {
|
|
41
29
|
classes.push(column.className);
|
|
42
30
|
}
|
|
43
|
-
if (isCellHidden(cellIndex, store.states.columns.value, column)) {
|
|
44
|
-
classes.push("is-hidden");
|
|
45
|
-
}
|
|
46
31
|
if (!column.children) {
|
|
47
32
|
classes.push("is-leaf");
|
|
48
33
|
}
|
|
34
|
+
if (hasGutter2 && cellIndex === columns2.length - 1) {
|
|
35
|
+
classes.push("last");
|
|
36
|
+
}
|
|
49
37
|
return classes;
|
|
50
38
|
};
|
|
39
|
+
const getCellStyles = (column, cellIndex, hasGutter2) => {
|
|
40
|
+
const fixedStyle = util.getFixedColumnOffset(cellIndex, column.fixed, props.store);
|
|
41
|
+
util.ensureRightFixedStyle(fixedStyle, hasGutter2);
|
|
42
|
+
util.ensurePosition(fixedStyle, "left");
|
|
43
|
+
util.ensurePosition(fixedStyle, "right");
|
|
44
|
+
return fixedStyle;
|
|
45
|
+
};
|
|
51
46
|
return {
|
|
52
47
|
hasGutter,
|
|
53
|
-
|
|
48
|
+
gutterWidth,
|
|
49
|
+
getCellClasses,
|
|
50
|
+
getCellStyles,
|
|
54
51
|
columns
|
|
55
52
|
};
|
|
56
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-helper.js","sources":["../../../../../../../packages/components/table/src/table-footer/style-helper.ts"],"sourcesContent":["import { computed, getCurrentInstance } from 'vue'\nimport useMapState from './mapState-helper'\
|
|
1
|
+
{"version":3,"file":"style-helper.js","sources":["../../../../../../../packages/components/table/src/table-footer/style-helper.ts"],"sourcesContent":["import { computed, getCurrentInstance } from 'vue'\nimport {\n getFixedColumnOffset,\n getFixedColumnsClass,\n ensurePosition,\n ensureRightFixedStyle,\n} from '../util'\nimport useMapState from './mapState-helper'\nimport type { Table } from '../table/defaults'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { TableFooter } from '.'\n\nfunction useStyle<T>(props: TableFooter<T>) {\n const instance = getCurrentInstance()\n const table = instance.parent as Table<T>\n\n const { columns } = useMapState<T>()\n\n const hasGutter = computed(() => {\n return (\n !props.fixed &&\n table.layout.gutterWidth > 0 &&\n table.layout.height.value &&\n table.layout.bodyScrollHeight.value > table.layout.bodyHeight.value\n )\n })\n\n const gutterWidth = computed(() => {\n return table.layout.gutterWidth\n })\n const getCellClasses = (\n columns: TableColumnCtx<T>[],\n cellIndex: number,\n hasGutter: boolean\n ) => {\n const column = columns[cellIndex]\n const classes = [\n 'el-table__cell',\n column.id,\n column.align,\n column.labelClassName,\n ...getFixedColumnsClass(cellIndex, column.fixed, props.store),\n ]\n if (column.className) {\n classes.push(column.className)\n }\n if (!column.children) {\n classes.push('is-leaf')\n }\n if (hasGutter && cellIndex === columns.length - 1) {\n classes.push('last')\n }\n return classes\n }\n\n const getCellStyles = (\n column: TableColumnCtx<T>,\n cellIndex: number,\n hasGutter: boolean\n ) => {\n const fixedStyle = getFixedColumnOffset(\n cellIndex,\n column.fixed,\n props.store\n )\n ensureRightFixedStyle(fixedStyle, hasGutter)\n ensurePosition(fixedStyle, 'left')\n ensurePosition(fixedStyle, 'right')\n return fixedStyle\n }\n\n return {\n hasGutter,\n gutterWidth,\n getCellClasses,\n getCellStyles,\n columns,\n }\n}\n\nexport default useStyle\n"],"names":["getCurrentInstance","useMapState","computed","getFixedColumnsClass","getFixedColumnOffset","ensureRightFixedStyle","ensurePosition"],"mappings":";;;;;;;;AAQA,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,EAAE,MAAM,QAAQ,GAAGA,sBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;AAChC,EAAE,MAAM,EAAE,OAAO,EAAE,GAAGC,yBAAW,EAAE,CAAC;AACpC,EAAE,MAAM,SAAS,GAAGC,YAAQ,CAAC,MAAM;AACnC,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AAC5J,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,WAAW,GAAGA,YAAQ,CAAC,MAAM;AACrC,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC;AACpC,GAAG,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;AACJ,EAAE,OAAO;AACT,IAAI,SAAS;AACb,IAAI,WAAW;AACf,IAAI,cAAc;AAClB,IAAI,aAAa;AACjB,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -34,14 +34,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
34
34
|
}, {
|
|
35
35
|
columns: any;
|
|
36
36
|
filterPanels: Ref<{}>;
|
|
37
|
-
hasGutter: import("vue").ComputedRef<
|
|
37
|
+
hasGutter: import("vue").ComputedRef<boolean>;
|
|
38
|
+
gutterWidth: import("vue").ComputedRef<number>;
|
|
38
39
|
onColumnsChange: (layout: import("../table-layout").default<unknown>) => void;
|
|
39
40
|
onScrollableChange: (layout: import("../table-layout").default<unknown>) => void;
|
|
40
41
|
columnRows: import("vue").ComputedRef<import("../table-column/defaults").TableColumnCtx<unknown>[]>;
|
|
41
42
|
getHeaderRowClass: (rowIndex: number) => string;
|
|
42
43
|
getHeaderRowStyle: (rowIndex: number) => any;
|
|
43
44
|
getHeaderCellClass: (rowIndex: number, columnIndex: number, row: unknown, column: import("../table-column/defaults").TableColumnCtx<unknown>) => string;
|
|
44
|
-
getHeaderCellStyle: (rowIndex: number, columnIndex: number, row: unknown, column: import("../table-column/defaults").TableColumnCtx<unknown
|
|
45
|
+
getHeaderCellStyle: (rowIndex: number, columnIndex: number, row: unknown, column: import("../table-column/defaults").TableColumnCtx<unknown>, hasGutter: boolean) => any;
|
|
45
46
|
handleHeaderClick: (event: Event, column: import("../table-column/defaults").TableColumnCtx<unknown>) => void;
|
|
46
47
|
handleHeaderContextMenu: (event: Event, column: import("../table-column/defaults").TableColumnCtx<unknown>) => void;
|
|
47
48
|
handleMouseDown: (event: MouseEvent, column: import("../table-column/defaults").TableColumnCtx<unknown>) => void;
|
|
@@ -44,7 +44,10 @@ var TableHeader = vue.defineComponent({
|
|
|
44
44
|
const filterPanels = vue.ref({});
|
|
45
45
|
const { tableLayout, onColumnsChange, onScrollableChange } = layoutObserver["default"](parent);
|
|
46
46
|
const hasGutter = vue.computed(() => {
|
|
47
|
-
return !props.fixed && tableLayout.gutterWidth;
|
|
47
|
+
return !props.fixed && tableLayout.gutterWidth > 0 && tableLayout.bodyScrollHeight.value > tableLayout.bodyHeight.value;
|
|
48
|
+
});
|
|
49
|
+
const gutterWidth = vue.computed(() => {
|
|
50
|
+
return tableLayout.gutterWidth;
|
|
48
51
|
});
|
|
49
52
|
vue.onMounted(() => {
|
|
50
53
|
vue.nextTick(() => {
|
|
@@ -78,6 +81,7 @@ var TableHeader = vue.defineComponent({
|
|
|
78
81
|
columns: storeData.columns,
|
|
79
82
|
filterPanels,
|
|
80
83
|
hasGutter,
|
|
84
|
+
gutterWidth,
|
|
81
85
|
onColumnsChange,
|
|
82
86
|
onScrollableChange,
|
|
83
87
|
columnRows,
|
|
@@ -97,67 +101,101 @@ var TableHeader = vue.defineComponent({
|
|
|
97
101
|
};
|
|
98
102
|
},
|
|
99
103
|
render() {
|
|
104
|
+
const {
|
|
105
|
+
columns,
|
|
106
|
+
isGroup,
|
|
107
|
+
hasGutter,
|
|
108
|
+
columnRows,
|
|
109
|
+
gutterWidth,
|
|
110
|
+
getHeaderCellStyle,
|
|
111
|
+
getHeaderCellClass,
|
|
112
|
+
getHeaderRowClass,
|
|
113
|
+
getHeaderRowStyle,
|
|
114
|
+
handleHeaderClick,
|
|
115
|
+
handleHeaderContextMenu,
|
|
116
|
+
handleMouseDown,
|
|
117
|
+
handleMouseMove,
|
|
118
|
+
handleSortClick,
|
|
119
|
+
handleMouseOut,
|
|
120
|
+
store,
|
|
121
|
+
$parent
|
|
122
|
+
} = this;
|
|
123
|
+
let rowSpan = 1;
|
|
100
124
|
return vue.h("table", {
|
|
101
125
|
border: "0",
|
|
102
126
|
cellpadding: "0",
|
|
103
127
|
cellspacing: "0",
|
|
104
128
|
class: "el-table__header"
|
|
105
129
|
}, [
|
|
106
|
-
hHelper.hColgroup(
|
|
130
|
+
hHelper.hColgroup(columns, hasGutter),
|
|
107
131
|
vue.h("thead", {
|
|
108
|
-
class: { "is-group":
|
|
109
|
-
},
|
|
110
|
-
class:
|
|
132
|
+
class: { "is-group": isGroup, "has-gutter": hasGutter }
|
|
133
|
+
}, columnRows.map((subColumns, rowIndex) => vue.h("tr", {
|
|
134
|
+
class: getHeaderRowClass(rowIndex),
|
|
111
135
|
key: rowIndex,
|
|
112
|
-
style:
|
|
113
|
-
}, subColumns.map((column, cellIndex) =>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
column.filteredValue && column.filteredValue.length > 0 ? "highlight" : "",
|
|
129
|
-
column.labelClassName
|
|
130
|
-
]
|
|
136
|
+
style: getHeaderRowStyle(rowIndex)
|
|
137
|
+
}, subColumns.map((column, cellIndex) => {
|
|
138
|
+
if (column.rowSpan > rowSpan) {
|
|
139
|
+
rowSpan = column.rowSpan;
|
|
140
|
+
}
|
|
141
|
+
return vue.h("th", {
|
|
142
|
+
class: getHeaderCellClass(rowIndex, cellIndex, subColumns, column),
|
|
143
|
+
colspan: column.colSpan,
|
|
144
|
+
key: `${column.id}-thead`,
|
|
145
|
+
rowSpan: column.rowSpan,
|
|
146
|
+
style: getHeaderCellStyle(rowIndex, cellIndex, subColumns, column, hasGutter),
|
|
147
|
+
onClick: ($event) => handleHeaderClick($event, column),
|
|
148
|
+
onContextmenu: ($event) => handleHeaderContextMenu($event, column),
|
|
149
|
+
onMousedown: ($event) => handleMouseDown($event, column),
|
|
150
|
+
onMousemove: ($event) => handleMouseMove($event, column),
|
|
151
|
+
onMouseout: handleMouseOut
|
|
131
152
|
}, [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
column.sortable && vue.h("span", {
|
|
139
|
-
onClick: ($event) => this.handleSortClick($event, column),
|
|
140
|
-
class: "caret-wrapper"
|
|
153
|
+
vue.h("div", {
|
|
154
|
+
class: [
|
|
155
|
+
"cell",
|
|
156
|
+
column.filteredValue && column.filteredValue.length > 0 ? "highlight" : "",
|
|
157
|
+
column.labelClassName
|
|
158
|
+
]
|
|
141
159
|
}, [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
160
|
+
column.renderHeader ? column.renderHeader({
|
|
161
|
+
column,
|
|
162
|
+
$index: cellIndex,
|
|
163
|
+
store,
|
|
164
|
+
_self: $parent
|
|
165
|
+
}) : column.label,
|
|
166
|
+
column.sortable && vue.h("span", {
|
|
167
|
+
onClick: ($event) => handleSortClick($event, column),
|
|
168
|
+
class: "caret-wrapper"
|
|
169
|
+
}, [
|
|
170
|
+
vue.h("i", {
|
|
171
|
+
onClick: ($event) => handleSortClick($event, column, "ascending"),
|
|
172
|
+
class: "sort-caret ascending"
|
|
173
|
+
}),
|
|
174
|
+
vue.h("i", {
|
|
175
|
+
onClick: ($event) => handleSortClick($event, column, "descending"),
|
|
176
|
+
class: "sort-caret descending"
|
|
177
|
+
})
|
|
178
|
+
]),
|
|
179
|
+
column.filterable && vue.h(filterPanel_vue_vue_type_script_lang["default"], {
|
|
180
|
+
store: $parent.store,
|
|
181
|
+
placement: column.filterPlacement || "bottom-start",
|
|
182
|
+
column,
|
|
183
|
+
upDataColumn: (key, value) => {
|
|
184
|
+
column[key] = value;
|
|
185
|
+
}
|
|
149
186
|
})
|
|
150
|
-
])
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
187
|
+
])
|
|
188
|
+
]);
|
|
189
|
+
}).concat(hasGutter && rowIndex === 0 ? [
|
|
190
|
+
vue.h("th", {
|
|
191
|
+
class: "el-table__fixed-right-patch el-table__cell",
|
|
192
|
+
key: `el-table--scrollbar`,
|
|
193
|
+
rowSpan,
|
|
194
|
+
style: {
|
|
195
|
+
width: `${gutterWidth}px`
|
|
196
|
+
}
|
|
197
|
+
}, [])
|
|
198
|
+
] : []))))
|
|
161
199
|
]);
|
|
162
200
|
}
|
|
163
201
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../packages/components/table/src/table-header/index.ts"],"sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n computed,\n onMounted,\n nextTick,\n ref,\n h,\n} from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport FilterPanel from '../filter-panel.vue'\nimport useLayoutObserver from '../layout-observer'\nimport { hColgroup } from '../h-helper'\nimport useEvent from './event-helper'\nimport useStyle from './style.helper'\nimport useUtils from './utils-helper'\n\nimport type { ComponentInternalInstance, Ref, PropType } from 'vue'\nimport type { DefaultRow, Sort, Table } from '../table/defaults'\nimport type { Store } from '../store'\nexport interface TableHeader extends ComponentInternalInstance {\n state: {\n onColumnsChange\n onScrollableChange\n }\n filterPanels: Ref<unknown>\n}\nexport interface TableHeaderProps<T> {\n fixed: string\n store: Store<T>\n border: boolean\n defaultSort: Sort\n}\n\nexport default defineComponent({\n name: 'ElTableHeader',\n components: {\n ElCheckbox,\n },\n props: {\n fixed: {\n type: String,\n default: '',\n },\n store: {\n required: true,\n type: Object as PropType<TableHeaderProps<DefaultRow>['store']>,\n },\n border: Boolean,\n defaultSort: {\n type: Object as PropType<TableHeaderProps<DefaultRow>['defaultSort']>,\n default: () => {\n return {\n prop: '',\n order: '',\n }\n },\n },\n },\n setup(props, { emit }) {\n const instance = getCurrentInstance() as TableHeader\n const parent = instance.parent as Table<unknown>\n const storeData = parent.store.states\n const filterPanels = ref({})\n const { tableLayout, onColumnsChange, onScrollableChange } =\n useLayoutObserver(parent)\n const hasGutter = computed(() => {\n return !props.fixed && tableLayout.gutterWidth\n })\n onMounted(() => {\n nextTick(() => {\n const { prop, order } = props.defaultSort\n const init = true\n parent.store.commit('sort', { prop, order, init })\n })\n })\n const {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n } = useEvent(props as TableHeaderProps<unknown>, emit)\n const {\n getHeaderRowStyle,\n getHeaderRowClass,\n getHeaderCellStyle,\n getHeaderCellClass,\n } = useStyle(props as TableHeaderProps<unknown>)\n const { isGroup, toggleAllSelection, columnRows } = useUtils(\n props as TableHeaderProps<unknown>\n )\n\n instance.state = {\n onColumnsChange,\n onScrollableChange,\n }\n // eslint-disable-next-line\n instance.filterPanels = filterPanels\n\n return {\n columns: storeData.columns,\n filterPanels,\n hasGutter,\n onColumnsChange,\n onScrollableChange,\n columnRows,\n getHeaderRowClass,\n getHeaderRowStyle,\n getHeaderCellClass,\n getHeaderCellStyle,\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n isGroup,\n toggleAllSelection,\n }\n },\n render() {\n return h(\n 'table',\n {\n border: '0',\n cellpadding: '0',\n cellspacing: '0',\n class: 'el-table__header',\n },\n [\n hColgroup(this.columns, this.hasGutter),\n h(\n 'thead',\n {\n class: { 'is-group': this.isGroup, 'has-gutter': this.hasGutter },\n },\n this.columnRows.map((subColumns, rowIndex) =>\n h(\n 'tr',\n {\n class: this.getHeaderRowClass(rowIndex),\n key: rowIndex,\n style: this.getHeaderRowStyle(rowIndex),\n },\n subColumns.map((column, cellIndex) =>\n h(\n 'th',\n {\n class: this.getHeaderCellClass(\n rowIndex,\n cellIndex,\n subColumns,\n column\n ),\n colspan: column.colSpan,\n key: `${column.id}-thead`,\n rowSpan: column.rowSpan,\n style: this.getHeaderCellStyle(\n rowIndex,\n cellIndex,\n subColumns,\n column\n ),\n onClick: ($event) => this.handleHeaderClick($event, column),\n onContextmenu: ($event) =>\n this.handleHeaderContextMenu($event, column),\n onMousedown: ($event) =>\n this.handleMouseDown($event, column),\n onMousemove: ($event) =>\n this.handleMouseMove($event, column),\n onMouseout: this.handleMouseOut,\n },\n [\n h(\n 'div',\n {\n class: [\n 'cell',\n column.filteredValue &&\n column.filteredValue.length > 0\n ? 'highlight'\n : '',\n column.labelClassName,\n ],\n },\n [\n column.renderHeader\n ? column.renderHeader({\n column,\n $index: cellIndex,\n store: this.store,\n _self: this.$parent,\n })\n : column.label,\n column.sortable &&\n h(\n 'span',\n {\n onClick: ($event) =>\n this.handleSortClick($event, column),\n class: 'caret-wrapper',\n },\n [\n h('i', {\n onClick: ($event) =>\n this.handleSortClick(\n $event,\n column,\n 'ascending'\n ),\n class: 'sort-caret ascending',\n }),\n h('i', {\n onClick: ($event) =>\n this.handleSortClick(\n $event,\n column,\n 'descending'\n ),\n class: 'sort-caret descending',\n }),\n ]\n ),\n column.filterable &&\n h(FilterPanel, {\n store: this.$parent.store,\n placement: column.filterPlacement || 'bottom-start',\n column,\n upDataColumn: (key, value) => {\n column[key] = value\n },\n }),\n ]\n ),\n ]\n )\n )\n )\n )\n ),\n ]\n )\n },\n})\n"],"names":["defineComponent","ElCheckbox","getCurrentInstance","ref","useLayoutObserver","computed","onMounted","nextTick","useEvent","useStyle","useUtils","h","hColgroup","FilterPanel"],"mappings":";;;;;;;;;;;;;;AAgBA,kBAAeA,mBAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,eAAe;AACvB,EAAE,UAAU,EAAE;AACd,gBAAIC,gBAAU;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,KAAK,EAAE;AACX,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,EAAE;AACjB,KAAK;AACL,IAAI,KAAK,EAAE;AACX,MAAM,QAAQ,EAAE,IAAI;AACpB,MAAM,IAAI,EAAE,MAAM;AAClB,KAAK;AACL,IAAI,MAAM,EAAE,OAAO;AACnB,IAAI,WAAW,EAAE;AACjB,MAAM,IAAI,EA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,CAAC,eAAe,IAAI,cAAc;AAC/D,YAAY,MAAM;AAClB,YAAY,YAAY,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK;AAC1C,cAAc,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAClC,aAAa;AACb,WAAW,CAAC;AACZ,SAAS,CAAC;AACV,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACZ,KAAK,CAAC,CAAC;AACP,GAAG;AACH,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../packages/components/table/src/table-header/index.ts"],"sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n computed,\n onMounted,\n nextTick,\n ref,\n h,\n} from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport FilterPanel from '../filter-panel.vue'\nimport useLayoutObserver from '../layout-observer'\nimport { hColgroup } from '../h-helper'\nimport useEvent from './event-helper'\nimport useStyle from './style.helper'\nimport useUtils from './utils-helper'\n\nimport type { ComponentInternalInstance, Ref, PropType } from 'vue'\nimport type { DefaultRow, Sort, Table } from '../table/defaults'\nimport type { Store } from '../store'\nexport interface TableHeader extends ComponentInternalInstance {\n state: {\n onColumnsChange\n onScrollableChange\n }\n filterPanels: Ref<unknown>\n}\nexport interface TableHeaderProps<T> {\n fixed: string\n store: Store<T>\n border: boolean\n defaultSort: Sort\n}\n\nexport default defineComponent({\n name: 'ElTableHeader',\n components: {\n ElCheckbox,\n },\n props: {\n fixed: {\n type: String,\n default: '',\n },\n store: {\n required: true,\n type: Object as PropType<TableHeaderProps<DefaultRow>['store']>,\n },\n border: Boolean,\n defaultSort: {\n type: Object as PropType<TableHeaderProps<DefaultRow>['defaultSort']>,\n default: () => {\n return {\n prop: '',\n order: '',\n }\n },\n },\n },\n setup(props, { emit }) {\n const instance = getCurrentInstance() as TableHeader\n const parent = instance.parent as Table<unknown>\n const storeData = parent.store.states\n const filterPanels = ref({})\n const { tableLayout, onColumnsChange, onScrollableChange } =\n useLayoutObserver(parent)\n const hasGutter = computed(() => {\n return (\n !props.fixed &&\n tableLayout.gutterWidth > 0 &&\n tableLayout.bodyScrollHeight.value > tableLayout.bodyHeight.value\n )\n })\n const gutterWidth = computed(() => {\n return tableLayout.gutterWidth\n })\n onMounted(() => {\n nextTick(() => {\n const { prop, order } = props.defaultSort\n const init = true\n parent.store.commit('sort', { prop, order, init })\n })\n })\n const {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n } = useEvent(props as TableHeaderProps<unknown>, emit)\n const {\n getHeaderRowStyle,\n getHeaderRowClass,\n getHeaderCellStyle,\n getHeaderCellClass,\n } = useStyle(props as TableHeaderProps<unknown>)\n const { isGroup, toggleAllSelection, columnRows } = useUtils(\n props as TableHeaderProps<unknown>\n )\n\n instance.state = {\n onColumnsChange,\n onScrollableChange,\n }\n // eslint-disable-next-line\n instance.filterPanels = filterPanels\n\n return {\n columns: storeData.columns,\n filterPanels,\n hasGutter,\n gutterWidth,\n onColumnsChange,\n onScrollableChange,\n columnRows,\n getHeaderRowClass,\n getHeaderRowStyle,\n getHeaderCellClass,\n getHeaderCellStyle,\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n isGroup,\n toggleAllSelection,\n }\n },\n render() {\n const {\n columns,\n isGroup,\n hasGutter,\n columnRows,\n gutterWidth,\n getHeaderCellStyle,\n getHeaderCellClass,\n getHeaderRowClass,\n getHeaderRowStyle,\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleSortClick,\n handleMouseOut,\n store,\n $parent,\n } = this\n let rowSpan = 1\n return h(\n 'table',\n {\n border: '0',\n cellpadding: '0',\n cellspacing: '0',\n class: 'el-table__header',\n },\n [\n hColgroup(columns, hasGutter),\n h(\n 'thead',\n {\n class: { 'is-group': isGroup, 'has-gutter': hasGutter },\n },\n columnRows.map((subColumns, rowIndex) =>\n h(\n 'tr',\n {\n class: getHeaderRowClass(rowIndex),\n key: rowIndex,\n style: getHeaderRowStyle(rowIndex),\n },\n subColumns\n .map((column, cellIndex) => {\n if (column.rowSpan > rowSpan) {\n rowSpan = column.rowSpan\n }\n return h(\n 'th',\n {\n class: getHeaderCellClass(\n rowIndex,\n cellIndex,\n subColumns,\n column\n ),\n colspan: column.colSpan,\n key: `${column.id}-thead`,\n rowSpan: column.rowSpan,\n style: getHeaderCellStyle(\n rowIndex,\n cellIndex,\n subColumns,\n column,\n hasGutter\n ),\n onClick: ($event) => handleHeaderClick($event, column),\n onContextmenu: ($event) =>\n handleHeaderContextMenu($event, column),\n onMousedown: ($event) => handleMouseDown($event, column),\n onMousemove: ($event) => handleMouseMove($event, column),\n onMouseout: handleMouseOut,\n },\n [\n h(\n 'div',\n {\n class: [\n 'cell',\n column.filteredValue &&\n column.filteredValue.length > 0\n ? 'highlight'\n : '',\n column.labelClassName,\n ],\n },\n [\n column.renderHeader\n ? column.renderHeader({\n column,\n $index: cellIndex,\n store,\n _self: $parent,\n })\n : column.label,\n column.sortable &&\n h(\n 'span',\n {\n onClick: ($event) =>\n handleSortClick($event, column),\n class: 'caret-wrapper',\n },\n [\n h('i', {\n onClick: ($event) =>\n handleSortClick(\n $event,\n column,\n 'ascending'\n ),\n class: 'sort-caret ascending',\n }),\n h('i', {\n onClick: ($event) =>\n handleSortClick(\n $event,\n column,\n 'descending'\n ),\n class: 'sort-caret descending',\n }),\n ]\n ),\n column.filterable &&\n h(FilterPanel, {\n store: $parent.store,\n placement:\n column.filterPlacement || 'bottom-start',\n column,\n upDataColumn: (key, value) => {\n column[key] = value\n },\n }),\n ]\n ),\n ]\n )\n })\n .concat(\n hasGutter && rowIndex === 0\n ? [\n h(\n 'th',\n {\n class: 'el-table__fixed-right-patch el-table__cell',\n key: `el-table--scrollbar`,\n rowSpan,\n style: {\n width: `${gutterWidth}px`,\n },\n },\n []\n ),\n ]\n : []\n )\n )\n )\n ),\n ]\n )\n },\n})\n"],"names":["defineComponent","ElCheckbox","getCurrentInstance","ref","useLayoutObserver","computed","onMounted","nextTick","useEvent","useStyle","useUtils","h","hColgroup","FilterPanel"],"mappings":";;;;;;;;;;;;;;AAgBA,kBAAeA,mBAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,eAAe;AACvB,EAAE,UAAU,EAAE;AACd,gBAAIC,gBAAU;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,KAAK,EAAE;AACX,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,EAAE;AACjB,KAAK;AACL,IAAI,KAAK,EAAE;AACX,MAAM,QAAQ,EAAE,IAAI;AACpB,MAAM,IAAI,EAAE,MAAM;AAClB,KAAK;AACL,IAAI,MAAM,EAAE,OAAO;AACnB,IAAI,WAAW,EAAE;AACjB,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,MAAM;AACrB,QAAQ,OAAO;AACf,UAAU,IAAI,EAAE,EAAE;AAClB,UAAU,KAAK,EAAE,EAAE;AACnB,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL,GAAG;AACH,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE;AACzB,IAAI,MAAM,QAAQ,GAAGC,sBAAkB,EAAE,CAAC;AAC1C,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACnC,IAAI,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;AAC1C,IAAI,MAAM,YAAY,GAAGC,OAAG,CAAC,EAAE,CAAC,CAAC;AACjC,IAAI,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,GAAGC,yBAAiB,CAAC,MAAM,CAAC,CAAC;AAC3F,IAAI,MAAM,SAAS,GAAGC,YAAQ,CAAC,MAAM;AACrC,MAAM,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,WA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pC,eAAe;AACf,aAAa,CAAC;AACd,WAAW,CAAC;AACZ,SAAS,CAAC,CAAC;AACX,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,QAAQ,KAAK,CAAC,GAAG;AAC9C,QAAQF,KAAC,CAAC,IAAI,EAAE;AAChB,UAAU,KAAK,EAAE,4CAA4C;AAC7D,UAAU,GAAG,EAAE,CAAC,mBAAmB,CAAC;AACpC,UAAU,OAAO;AACjB,UAAU,KAAK,EAAE;AACjB,YAAY,KAAK,EAAE,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC;AACrC,WAAW;AACX,SAAS,EAAE,EAAE,CAAC;AACd,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAChB,KAAK,CAAC,CAAC;AACP,GAAG;AACH,CAAC,CAAC;;;;"}
|
|
@@ -3,7 +3,7 @@ import type { TableHeaderProps } from '.';
|
|
|
3
3
|
declare function useStyle<T>(props: TableHeaderProps<T>): {
|
|
4
4
|
getHeaderRowStyle: (rowIndex: number) => any;
|
|
5
5
|
getHeaderRowClass: (rowIndex: number) => string;
|
|
6
|
-
getHeaderCellStyle: (rowIndex: number, columnIndex: number, row: T, column: TableColumnCtx<T
|
|
6
|
+
getHeaderCellStyle: (rowIndex: number, columnIndex: number, row: T, column: TableColumnCtx<T>, hasGutter: boolean) => any;
|
|
7
7
|
getHeaderCellClass: (rowIndex: number, columnIndex: number, row: T, column: TableColumnCtx<T>) => string;
|
|
8
8
|
};
|
|
9
9
|
export default useStyle;
|
|
@@ -3,25 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
+
var util = require('../util.js');
|
|
6
7
|
|
|
7
8
|
function useStyle(props) {
|
|
8
9
|
const instance = vue.getCurrentInstance();
|
|
9
10
|
const parent = instance.parent;
|
|
10
|
-
const storeData = parent.store.states;
|
|
11
|
-
const isCellHidden = (index, columns) => {
|
|
12
|
-
let start = 0;
|
|
13
|
-
for (let i = 0; i < index; i++) {
|
|
14
|
-
start += columns[i].colSpan;
|
|
15
|
-
}
|
|
16
|
-
const after = start + columns[index].colSpan - 1;
|
|
17
|
-
if (props.fixed === "left") {
|
|
18
|
-
return after >= storeData.fixedLeafColumnsLength.value;
|
|
19
|
-
} else if (props.fixed === "right") {
|
|
20
|
-
return start < storeData.columns.value.length - storeData.rightFixedLeafColumnsLength.value;
|
|
21
|
-
} else {
|
|
22
|
-
return after < storeData.fixedLeafColumnsLength.value || start >= storeData.columns.value.length - storeData.rightFixedLeafColumnsLength.value;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
11
|
const getHeaderRowStyle = (rowIndex) => {
|
|
26
12
|
const headerRowStyle = parent.props.headerRowStyle;
|
|
27
13
|
if (typeof headerRowStyle === "function") {
|
|
@@ -39,29 +25,33 @@ function useStyle(props) {
|
|
|
39
25
|
}
|
|
40
26
|
return classes.join(" ");
|
|
41
27
|
};
|
|
42
|
-
const getHeaderCellStyle = (rowIndex, columnIndex, row, column) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
const getHeaderCellStyle = (rowIndex, columnIndex, row, column, hasGutter) => {
|
|
29
|
+
var _a;
|
|
30
|
+
let headerCellStyles = (_a = parent.props.headerCellStyle) != null ? _a : {};
|
|
31
|
+
if (typeof headerCellStyles === "function") {
|
|
32
|
+
headerCellStyles = headerCellStyles.call(null, {
|
|
46
33
|
rowIndex,
|
|
47
34
|
columnIndex,
|
|
48
35
|
row,
|
|
49
36
|
column
|
|
50
37
|
});
|
|
51
38
|
}
|
|
52
|
-
|
|
39
|
+
const fixedStyle = util.getFixedColumnOffset(columnIndex, column.fixed, props.store, row);
|
|
40
|
+
util.ensureRightFixedStyle(fixedStyle, hasGutter);
|
|
41
|
+
util.ensurePosition(fixedStyle, "left");
|
|
42
|
+
util.ensurePosition(fixedStyle, "right");
|
|
43
|
+
return Object.assign({}, headerCellStyles, fixedStyle);
|
|
53
44
|
};
|
|
54
45
|
const getHeaderCellClass = (rowIndex, columnIndex, row, column) => {
|
|
46
|
+
const fixedClasses = column.isSubColumn ? [] : util.getFixedColumnsClass(columnIndex, column.fixed, props.store, row);
|
|
55
47
|
const classes = [
|
|
56
48
|
column.id,
|
|
57
49
|
column.order,
|
|
58
50
|
column.headerAlign,
|
|
59
51
|
column.className,
|
|
60
|
-
column.labelClassName
|
|
52
|
+
column.labelClassName,
|
|
53
|
+
...fixedClasses
|
|
61
54
|
];
|
|
62
|
-
if (rowIndex === 0 && isCellHidden(columnIndex, row)) {
|
|
63
|
-
classes.push("is-hidden");
|
|
64
|
-
}
|
|
65
55
|
if (!column.children) {
|
|
66
56
|
classes.push("is-leaf");
|
|
67
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.helper.js","sources":["../../../../../../../packages/components/table/src/table-header/style.helper.ts"],"sourcesContent":["import { getCurrentInstance } from 'vue'\n\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { Table } from '../table/defaults'\nimport type { TableHeaderProps } from '.'\n\nfunction useStyle<T>(props: TableHeaderProps<T>) {\n const instance = getCurrentInstance()\n const parent = instance.parent as Table<T>\n
|
|
1
|
+
{"version":3,"file":"style.helper.js","sources":["../../../../../../../packages/components/table/src/table-header/style.helper.ts"],"sourcesContent":["import { getCurrentInstance } from 'vue'\nimport {\n getFixedColumnsClass,\n getFixedColumnOffset,\n ensurePosition,\n ensureRightFixedStyle,\n} from '../util'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { Table } from '../table/defaults'\nimport type { TableHeaderProps } from '.'\n\nfunction useStyle<T>(props: TableHeaderProps<T>) {\n const instance = getCurrentInstance()\n const parent = instance.parent as Table<T>\n\n const getHeaderRowStyle = (rowIndex: number) => {\n const headerRowStyle = parent.props.headerRowStyle\n if (typeof headerRowStyle === 'function') {\n return headerRowStyle.call(null, { rowIndex })\n }\n return headerRowStyle\n }\n\n const getHeaderRowClass = (rowIndex: number): string => {\n const classes = []\n const headerRowClassName = parent.props.headerRowClassName\n if (typeof headerRowClassName === 'string') {\n classes.push(headerRowClassName)\n } else if (typeof headerRowClassName === 'function') {\n classes.push(headerRowClassName.call(null, { rowIndex }))\n }\n\n return classes.join(' ')\n }\n\n const getHeaderCellStyle = (\n rowIndex: number,\n columnIndex: number,\n row: T,\n column: TableColumnCtx<T>,\n hasGutter: boolean\n ) => {\n let headerCellStyles = parent.props.headerCellStyle ?? {}\n if (typeof headerCellStyles === 'function') {\n headerCellStyles = headerCellStyles.call(null, {\n rowIndex,\n columnIndex,\n row,\n column,\n })\n }\n const fixedStyle = getFixedColumnOffset<T>(\n columnIndex,\n column.fixed,\n props.store,\n row as unknown as TableColumnCtx<T>[]\n )\n ensureRightFixedStyle(fixedStyle, hasGutter)\n ensurePosition(fixedStyle, 'left')\n ensurePosition(fixedStyle, 'right')\n return Object.assign({}, headerCellStyles, fixedStyle)\n }\n\n const getHeaderCellClass = (\n rowIndex: number,\n columnIndex: number,\n row: T,\n column: TableColumnCtx<T>\n ) => {\n const fixedClasses = column.isSubColumn\n ? []\n : getFixedColumnsClass<T>(\n columnIndex,\n column.fixed,\n props.store,\n row as unknown as TableColumnCtx<T>[]\n )\n const classes = [\n column.id,\n column.order,\n column.headerAlign,\n column.className,\n column.labelClassName,\n ...fixedClasses,\n ]\n\n if (!column.children) {\n classes.push('is-leaf')\n }\n\n if (column.sortable) {\n classes.push('is-sortable')\n }\n\n const headerCellClassName = parent.props.headerCellClassName\n if (typeof headerCellClassName === 'string') {\n classes.push(headerCellClassName)\n } else if (typeof headerCellClassName === 'function') {\n classes.push(\n headerCellClassName.call(null, {\n rowIndex,\n columnIndex,\n row,\n column,\n })\n )\n }\n\n classes.push('el-table__cell')\n\n return classes.join(' ')\n }\n\n return {\n getHeaderRowStyle,\n getHeaderRowClass,\n getHeaderCellStyle,\n getHeaderCellClass,\n }\n}\n\nexport default useStyle\n"],"names":["getCurrentInstance","getFixedColumnOffset","ensureRightFixedStyle","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SAAS,CAAC,CAAC;AAC9B,KAAK;AACL,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE;AACzB,MAAM,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAClC,KAAK;AACL,IAAI,MAAM,mBAAmB,GAAG,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC;AACjE,IAAI,IAAI,OAAO,mBAAmB,KAAK,QAAQ,EAAE;AACjD,MAAM,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AACxC,KAAK,MAAM,IAAI,OAAO,mBAAmB,KAAK,UAAU,EAAE;AAC1D,MAAM,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE;AAClD,QAAQ,QAAQ;AAChB,QAAQ,WAAW;AACnB,QAAQ,GAAG;AACX,QAAQ,MAAM;AACd,OAAO,CAAC,CAAC,CAAC;AACV,KAAK;AACL,IAAI,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACnC,IAAI,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7B,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,iBAAiB;AACrB,IAAI,iBAAiB;AACrB,IAAI,kBAAkB;AACtB,IAAI,kBAAkB;AACtB,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-helper.js","sources":["../../../../../../../packages/components/table/src/table-header/utils-helper.ts"],"sourcesContent":["import { getCurrentInstance, computed } from 'vue'\n\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { Table } from '../table/defaults'\nimport type { TableHeaderProps } from '.'\n\nconst getAllColumns = <T>(\n columns: TableColumnCtx<T>[]\n): TableColumnCtx<T>[] => {\n const result = []\n columns.forEach((column) => {\n if (column.children) {\n result.push(column)\n // eslint-disable-next-line prefer-spread\n result.push.apply(result, getAllColumns(column.children))\n } else {\n result.push(column)\n }\n })\n return result\n}\n\nconst convertToRows = <T>(\n originColumns: TableColumnCtx<T>[]\n): TableColumnCtx<T>[] => {\n let maxLevel = 1\n const traverse = (column: TableColumnCtx<T>, parent: TableColumnCtx<T>) => {\n if (parent) {\n column.level = parent.level + 1\n if (maxLevel < column.level) {\n maxLevel = column.level\n }\n }\n if (column.children) {\n let colSpan = 0\n column.children.forEach((subColumn) => {\n traverse(subColumn, column)\n colSpan += subColumn.colSpan\n })\n column.colSpan = colSpan\n } else {\n column.colSpan = 1\n }\n }\n\n originColumns.forEach((column) => {\n column.level = 1\n traverse(column, undefined)\n })\n\n const rows = []\n for (let i = 0; i < maxLevel; i++) {\n rows.push([])\n }\n\n const allColumns = getAllColumns(originColumns)\n\n allColumns.forEach((column) => {\n if (!column.children) {\n column.rowSpan = maxLevel - column.level + 1\n } else {\n column.rowSpan = 1\n }\n rows[column.level - 1].push(column)\n })\n\n return rows\n}\n\nfunction useUtils<T>(props: TableHeaderProps<T>) {\n const instance = getCurrentInstance()\n const parent = instance.parent as Table<T>\n const columnRows = computed(() => {\n return convertToRows(props.store.states.originColumns.value)\n })\n const isGroup = computed(() => {\n const result = columnRows.value.length > 1\n if (result) parent.state.isGroup.value = true\n return result\n })\n const toggleAllSelection = (event: Event) => {\n event.stopPropagation()\n parent.store.commit('toggleAllSelection')\n }\n return {\n isGroup,\n toggleAllSelection,\n columnRows,\n }\n}\n\nexport default useUtils\n"],"names":["getCurrentInstance","computed"],"mappings":";;;;;;AACA,MAAM,aAAa,GAAG,CAAC,OAAO,KAAK;AACnC,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK;AAC9B,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE;AACzB,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1B,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC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,GAAG,CAAC,KAAK,KAAK;AACxC,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;AAC5B,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAC9C,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI,kBAAkB;AACtB,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"utils-helper.js","sources":["../../../../../../../packages/components/table/src/table-header/utils-helper.ts"],"sourcesContent":["import { getCurrentInstance, computed } from 'vue'\n\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { Table } from '../table/defaults'\nimport type { TableHeaderProps } from '.'\n\nconst getAllColumns = <T>(\n columns: TableColumnCtx<T>[]\n): TableColumnCtx<T>[] => {\n const result = []\n columns.forEach((column) => {\n if (column.children) {\n result.push(column)\n // eslint-disable-next-line prefer-spread\n result.push.apply(result, getAllColumns(column.children))\n } else {\n result.push(column)\n }\n })\n return result\n}\n\nconst convertToRows = <T>(\n originColumns: TableColumnCtx<T>[]\n): TableColumnCtx<T>[] => {\n let maxLevel = 1\n const traverse = (column: TableColumnCtx<T>, parent: TableColumnCtx<T>) => {\n if (parent) {\n column.level = parent.level + 1\n if (maxLevel < column.level) {\n maxLevel = column.level\n }\n }\n if (column.children) {\n let colSpan = 0\n column.children.forEach((subColumn) => {\n traverse(subColumn, column)\n colSpan += subColumn.colSpan\n })\n column.colSpan = colSpan\n } else {\n column.colSpan = 1\n }\n }\n\n originColumns.forEach((column) => {\n column.level = 1\n traverse(column, undefined)\n })\n\n const rows = []\n for (let i = 0; i < maxLevel; i++) {\n rows.push([])\n }\n\n const allColumns = getAllColumns(originColumns)\n\n allColumns.forEach((column) => {\n if (!column.children) {\n column.rowSpan = maxLevel - column.level + 1\n } else {\n column.rowSpan = 1\n column.children.forEach((col) => (col.isSubColumn = true))\n }\n rows[column.level - 1].push(column)\n })\n\n return rows\n}\n\nfunction useUtils<T>(props: TableHeaderProps<T>) {\n const instance = getCurrentInstance()\n const parent = instance.parent as Table<T>\n const columnRows = computed(() => {\n return convertToRows(props.store.states.originColumns.value)\n })\n const isGroup = computed(() => {\n const result = columnRows.value.length > 1\n if (result) parent.state.isGroup.value = true\n return result\n })\n const toggleAllSelection = (event: Event) => {\n event.stopPropagation()\n parent.store.commit('toggleAllSelection')\n }\n return {\n isGroup,\n toggleAllSelection,\n columnRows,\n }\n}\n\nexport default useUtils\n"],"names":["getCurrentInstance","computed"],"mappings":";;;;;;AACA,MAAM,aAAa,GAAG,CAAC,OAAO,KAAK;AACnC,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC;AACpB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK;AAC9B,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE;AACzB,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1B,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAChE,KAAK,MAAM;AACX,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1B,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AACF,MAAM,aAAa,GAAG,CAAC,aAAa,KAAK;AACzC,EAAE,IAAI,QAAQ,GAAG,CAAC,CAAC;AACnB,EAAE,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK;AACvC,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC;AACtC,MAAM,IAAI,QAAQ,GAAG,MAAM,CAAC,KAAK,EAAE;AACnC,QAAQ,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;AAChC,OAAO;AACP,KAAK;AACL,IAAI,IAAI,MAA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,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACxC,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AACF,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,EAAE,MAAM,QAAQ,GAAGA,sBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,EAAE,MAAM,UAAU,GAAGC,YAAQ,CAAC,MAAM;AACpC,IAAI,OAAO,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AACjE,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,OAAO,GAAGA,YAAQ,CAAC,MAAM;AACjC,IAAI,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAC/C,IAAI,IAAI,MAAM;AACd,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;AACxC,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,kBAAkB,GAAG,CAAC,KAAK,KAAK;AACxC,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;AAC5B,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAC9C,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI,kBAAkB;AACtB,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -22,6 +22,7 @@ declare class TableLayout<T> {
|
|
|
22
22
|
footerHeight: Ref<null | number>;
|
|
23
23
|
viewportHeight: Ref<null | number>;
|
|
24
24
|
bodyHeight: Ref<null | number>;
|
|
25
|
+
bodyScrollHeight: Ref<number>;
|
|
25
26
|
fixedBodyHeight: Ref<null | number>;
|
|
26
27
|
gutterWidth: number;
|
|
27
28
|
constructor(options: Record<string, any>);
|
|
@@ -28,6 +28,7 @@ class TableLayout {
|
|
|
28
28
|
this.footerHeight = vue.ref(44);
|
|
29
29
|
this.viewportHeight = vue.ref(null);
|
|
30
30
|
this.bodyHeight = vue.ref(null);
|
|
31
|
+
this.bodyScrollHeight = vue.ref(0);
|
|
31
32
|
this.fixedBodyHeight = vue.ref(null);
|
|
32
33
|
this.gutterWidth = scrollbarWidth["default"]();
|
|
33
34
|
for (const name in options) {
|
|
@@ -57,8 +58,7 @@ class TableLayout {
|
|
|
57
58
|
if (this.bodyHeight.value === null) {
|
|
58
59
|
scrollY = false;
|
|
59
60
|
} else {
|
|
60
|
-
|
|
61
|
-
scrollY = body.offsetHeight > this.bodyHeight.value;
|
|
61
|
+
scrollY = bodyWrapper.scrollHeight > this.bodyHeight.value;
|
|
62
62
|
}
|
|
63
63
|
this.scrollY.value = scrollY;
|
|
64
64
|
return prevScrollY !== scrollY;
|
|
@@ -97,9 +97,10 @@ class TableLayout {
|
|
|
97
97
|
return flattenColumns;
|
|
98
98
|
}
|
|
99
99
|
updateElsHeight() {
|
|
100
|
+
var _a;
|
|
100
101
|
if (!this.table.$ready)
|
|
101
102
|
return vue.nextTick(() => this.updateElsHeight());
|
|
102
|
-
const { headerWrapper, appendWrapper, footerWrapper } = this.table.refs;
|
|
103
|
+
const { headerWrapper, appendWrapper, footerWrapper, bodyWrapper } = this.table.refs;
|
|
103
104
|
this.appendHeight.value = appendWrapper ? appendWrapper.offsetHeight : 0;
|
|
104
105
|
if (this.showHeader && !headerWrapper)
|
|
105
106
|
return;
|
|
@@ -112,7 +113,11 @@ class TableLayout {
|
|
|
112
113
|
const tableHeight = this.tableHeight.value = this.table.vnode.el.clientHeight;
|
|
113
114
|
const footerHeight = this.footerHeight.value = footerWrapper ? footerWrapper.offsetHeight : 0;
|
|
114
115
|
if (this.height.value !== null) {
|
|
116
|
+
if (this.bodyHeight.value === null) {
|
|
117
|
+
requestAnimationFrame(() => this.updateElsHeight());
|
|
118
|
+
}
|
|
115
119
|
this.bodyHeight.value = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0);
|
|
120
|
+
this.bodyScrollHeight.value = (_a = bodyWrapper.querySelector(".el-table__body")) == null ? void 0 : _a.scrollHeight;
|
|
116
121
|
}
|
|
117
122
|
this.fixedBodyHeight.value = this.scrollX.value ? this.bodyHeight.value - this.gutterWidth : this.bodyHeight.value;
|
|
118
123
|
this.viewportHeight.value = this.scrollX.value ? tableHeight - this.gutterWidth : tableHeight;
|