element-ps 1.0.4 → 1.0.8
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/dist/index.full.js +282 -215
- package/dist/index.full.min.js +4 -4
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +4 -4
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +283 -216
- package/es/components/alert/index.d.ts +3 -3
- package/es/components/alert/src/alert.d.ts +1 -1
- package/es/components/alert/src/alert.vue.d.ts +3 -3
- package/es/components/autocomplete/index.d.ts +2 -2
- package/es/components/autocomplete/src/index.vue.d.ts +1 -1
- package/es/components/avatar/index.d.ts +3 -3
- package/es/components/avatar/src/avatar.d.ts +1 -1
- package/es/components/avatar/src/avatar.vue.d.ts +3 -3
- package/es/components/badge/index.d.ts +3 -3
- package/es/components/badge/src/badge.d.ts +1 -1
- package/es/components/badge/src/badge.vue.d.ts +3 -3
- package/es/components/button/index.d.ts +33 -29
- package/es/components/button/src/button-group.d.ts +2 -2
- package/es/components/button/src/button-group.vue.d.ts +6 -6
- package/es/components/button/src/button.d.ts +4 -3
- package/es/components/button/src/button.vue.d.ts +21 -17
- package/es/components/cascader/index.d.ts +32 -16
- package/es/components/cascader/src/index.vue.d.ts +16 -8
- package/es/components/checkbox/index.d.ts +27 -27
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
- package/es/components/checkbox/src/checkbox.vue.d.ts +7 -7
- package/es/components/checkbox/src/useCheckbox.d.ts +4 -4
- package/es/components/collapse/index.d.ts +4 -4
- package/es/components/collapse/src/collapse-item.vue.d.ts +2 -2
- package/es/components/color-picker/index.d.ts +2 -2
- package/es/components/color-picker/src/index.vue.d.ts +1 -1
- package/es/components/date-picker/index.d.ts +4 -4
- package/es/components/date-picker/src/date-picker.d.ts +2 -2
- package/es/components/descriptions/index.d.ts +4 -4
- package/es/components/descriptions/src/description-item.d.ts +2 -2
- package/es/components/drawer/index.d.ts +4 -4
- package/es/components/drawer/src/index.vue.d.ts +2 -2
- package/es/components/dropdown/index.d.ts +6 -6
- package/es/components/dropdown/src/dropdown-item.vue.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.vue.d.ts +4 -4
- package/es/components/form/index.d.ts +5 -5
- package/es/components/form/src/form-item.vue.d.ts +1 -1
- package/es/components/form/src/form.vue.d.ts +3 -3
- package/es/components/input/index.d.ts +7 -3
- package/es/components/input/src/input.d.ts +2 -1
- package/es/components/input/src/input.vue.d.ts +7 -3
- package/es/components/input-number/index.d.ts +3 -3
- package/es/components/input-number/src/input-number.d.ts +1 -1
- package/es/components/input-number/src/input-number.vue.d.ts +3 -3
- package/es/components/link/index.d.ts +7 -7
- package/es/components/link/src/link.d.ts +1 -1
- package/es/components/link/src/link.vue.d.ts +7 -7
- package/es/components/page-header/index.d.ts +2 -2
- package/es/components/page-header/src/page-header.vue.d.ts +2 -2
- package/es/components/pagination/index.d.ts +2 -2
- package/es/components/pagination/src/pagination.d.ts +2 -2
- package/es/components/popconfirm/index.d.ts +6 -6
- package/es/components/popconfirm/src/index.vue.d.ts +6 -6
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popover/index.d.ts +8 -8
- package/es/components/popover/src/index.vue.d.ts +4 -4
- package/es/components/popper/index.d.ts +4 -4
- package/es/components/popper/src/index.vue.d.ts +2 -2
- package/es/components/radio/index.d.ts +16 -16
- package/es/components/radio/src/radio-button.vue.d.ts +3 -3
- package/es/components/radio/src/radio-group.vue.d.ts +3 -3
- package/es/components/radio/src/radio.vue.d.ts +4 -4
- package/es/components/rate/index.d.ts +10 -10
- package/es/components/rate/src/index.vue.d.ts +5 -5
- package/es/components/scrollbar/index.d.ts +4 -4
- package/es/components/scrollbar/src/index.vue.d.ts +2 -2
- package/es/components/select/index.d.ts +12 -12
- package/es/components/select/src/option.vue.d.ts +2 -2
- package/es/components/select/src/select.vue.d.ts +8 -8
- package/es/components/select-v2/index.d.ts +10 -10
- package/es/components/select-v2/src/select.vue.d.ts +5 -5
- package/es/components/slider/index.d.ts +4 -4
- package/es/components/slider/src/index.vue.d.ts +2 -2
- package/es/components/space/index.d.ts +3 -3
- package/es/components/space/src/space.d.ts +4 -4
- package/es/components/steps/index.d.ts +1 -1
- package/es/components/steps/src/index.vue.d.ts +1 -1
- package/es/components/table/index.d.ts +11 -11
- package/es/components/table/src/table/defaults.d.ts +4 -4
- package/es/components/table/src/table-column/defaults.d.ts +2 -2
- package/es/components/table/src/table-column/index.d.ts +3 -3
- package/es/components/table/src/table.vue.d.ts +5 -5
- package/es/components/tabs/index.d.ts +4 -4
- package/es/components/tabs/src/tab-pane.vue.d.ts +2 -2
- package/es/components/tag/index.d.ts +6 -6
- package/es/components/tag/src/tag.d.ts +2 -2
- package/es/components/tag/src/tag.vue.d.ts +6 -6
- 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/time-select/index.d.ts +8 -8
- package/es/components/time-select/src/time-select.vue.d.ts +4 -4
- package/es/components/timeline/index.d.ts +4 -4
- package/es/components/timeline/src/item.vue.d.ts +2 -2
- package/es/components/tooltip/index.d.ts +6 -6
- package/es/components/tooltip/src/index.vue.d.ts +3 -3
- package/es/components/tree-v2/index.d.ts +1 -1
- package/es/components/tree-v2/src/tree-node.vue.d.ts +2 -2
- package/es/components/tree-v2/src/tree.vue.d.ts +1 -1
- package/es/components/upload/index.d.ts +4 -4
- package/es/components/upload/src/index.vue.d.ts +2 -2
- package/es/components/upload/src/upload.vue.d.ts +2 -2
- package/es/hooks/use-form-item/index.d.ts +1 -1
- package/es/index.mjs +6 -6
- package/es/packages/components/avatar/index.mjs +2 -2
- package/es/packages/components/avatar/src/avatar.mjs +5 -29
- package/es/packages/components/avatar/src/avatar.mjs.map +1 -1
- package/es/packages/components/avatar/src/avatar.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/avatar/src/avatar2.mjs +29 -5
- package/es/packages/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/packages/components/button/index.mjs +2 -2
- package/es/packages/components/button/src/button-group.mjs +1 -1
- package/es/packages/components/button/src/button.mjs +46 -5
- package/es/packages/components/button/src/button.mjs.map +1 -1
- package/es/packages/components/button/src/button.vue_vue&type=script&lang.mjs +40 -1
- package/es/packages/components/button/src/button.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.mjs +4 -3
- package/es/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.mjs.map +1 -1
- package/es/packages/components/button/src/button2.mjs +5 -45
- package/es/packages/components/button/src/button2.mjs.map +1 -1
- package/es/packages/components/card/index.mjs +2 -2
- package/es/packages/components/card/src/card.mjs +5 -17
- package/es/packages/components/card/src/card.mjs.map +1 -1
- package/es/packages/components/card/src/card.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/card/src/card2.mjs +17 -5
- package/es/packages/components/card/src/card2.mjs.map +1 -1
- package/es/packages/components/dialog/index.mjs +2 -2
- package/es/packages/components/dialog/src/dialog.mjs +79 -5
- package/es/packages/components/dialog/src/dialog.mjs.map +1 -1
- package/es/packages/components/dialog/src/dialog.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/dialog/src/dialog2.mjs +5 -79
- package/es/packages/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/packages/components/drawer/src/index.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/dropdown/index.mjs +1 -1
- package/es/packages/components/dropdown/src/dropdown.mjs +0 -5
- package/es/packages/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/packages/components/dropdown/src/dropdown2.mjs +5 -0
- package/es/packages/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/packages/components/empty/index.mjs +2 -2
- package/es/packages/components/empty/src/empty.mjs +5 -12
- package/es/packages/components/empty/src/empty.mjs.map +1 -1
- package/es/packages/components/empty/src/empty.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/empty/src/empty2.mjs +12 -5
- package/es/packages/components/empty/src/empty2.mjs.map +1 -1
- package/es/packages/components/form/src/form-item.vue_vue&type=script&lang.mjs +1 -5
- package/es/packages/components/form/src/form-item.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs.map +1 -1
- package/es/packages/components/index.mjs +6 -6
- package/es/packages/components/input/src/input.mjs +3 -0
- package/es/packages/components/input/src/input.mjs.map +1 -1
- package/es/packages/components/input/src/input.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/input/src/input.vue_vue&type=template&id=3290dcb6&lang.mjs +26 -24
- package/es/packages/components/input/src/input.vue_vue&type=template&id=3290dcb6&lang.mjs.map +1 -1
- package/es/packages/components/page-header/index.mjs +2 -2
- package/es/packages/components/page-header/src/page-header.mjs +14 -5
- package/es/packages/components/page-header/src/page-header.mjs.map +1 -1
- package/es/packages/components/page-header/src/page-header.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/page-header/src/page-header2.mjs +5 -14
- package/es/packages/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/packages/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/packages/components/tabs/src/tabs.mjs +5 -7
- package/es/packages/components/tabs/src/tabs.mjs.map +1 -1
- package/es/utils/util.d.ts +1 -1
- package/lib/components/alert/index.d.ts +3 -3
- package/lib/components/alert/src/alert.d.ts +1 -1
- package/lib/components/alert/src/alert.vue.d.ts +3 -3
- package/lib/components/autocomplete/index.d.ts +2 -2
- package/lib/components/autocomplete/src/index.vue.d.ts +1 -1
- package/lib/components/avatar/index.d.ts +3 -3
- package/lib/components/avatar/src/avatar.d.ts +1 -1
- package/lib/components/avatar/src/avatar.vue.d.ts +3 -3
- package/lib/components/badge/index.d.ts +3 -3
- package/lib/components/badge/src/badge.d.ts +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +3 -3
- package/lib/components/button/index.d.ts +33 -29
- package/lib/components/button/src/button-group.d.ts +2 -2
- package/lib/components/button/src/button-group.vue.d.ts +6 -6
- package/lib/components/button/src/button.d.ts +4 -3
- package/lib/components/button/src/button.vue.d.ts +21 -17
- package/lib/components/cascader/index.d.ts +32 -16
- package/lib/components/cascader/src/index.vue.d.ts +16 -8
- package/lib/components/checkbox/index.d.ts +27 -27
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
- package/lib/components/checkbox/src/checkbox.vue.d.ts +7 -7
- package/lib/components/checkbox/src/useCheckbox.d.ts +4 -4
- package/lib/components/collapse/index.d.ts +4 -4
- package/lib/components/collapse/src/collapse-item.vue.d.ts +2 -2
- package/lib/components/color-picker/index.d.ts +2 -2
- package/lib/components/color-picker/src/index.vue.d.ts +1 -1
- package/lib/components/date-picker/index.d.ts +4 -4
- package/lib/components/date-picker/src/date-picker.d.ts +2 -2
- package/lib/components/descriptions/index.d.ts +4 -4
- package/lib/components/descriptions/src/description-item.d.ts +2 -2
- package/lib/components/drawer/index.d.ts +4 -4
- package/lib/components/drawer/src/index.vue.d.ts +2 -2
- package/lib/components/dropdown/index.d.ts +6 -6
- package/lib/components/dropdown/src/dropdown-item.vue.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.vue.d.ts +4 -4
- package/lib/components/form/index.d.ts +5 -5
- package/lib/components/form/src/form-item.vue.d.ts +1 -1
- package/lib/components/form/src/form.vue.d.ts +3 -3
- package/lib/components/input/index.d.ts +7 -3
- package/lib/components/input/src/input.d.ts +2 -1
- package/lib/components/input/src/input.vue.d.ts +7 -3
- package/lib/components/input-number/index.d.ts +3 -3
- package/lib/components/input-number/src/input-number.d.ts +1 -1
- package/lib/components/input-number/src/input-number.vue.d.ts +3 -3
- package/lib/components/link/index.d.ts +7 -7
- package/lib/components/link/src/link.d.ts +1 -1
- package/lib/components/link/src/link.vue.d.ts +7 -7
- package/lib/components/page-header/index.d.ts +2 -2
- package/lib/components/page-header/src/page-header.vue.d.ts +2 -2
- package/lib/components/pagination/index.d.ts +2 -2
- package/lib/components/pagination/src/pagination.d.ts +2 -2
- package/lib/components/popconfirm/index.d.ts +6 -6
- package/lib/components/popconfirm/src/index.vue.d.ts +6 -6
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popover/index.d.ts +8 -8
- package/lib/components/popover/src/index.vue.d.ts +4 -4
- package/lib/components/popper/index.d.ts +4 -4
- package/lib/components/popper/src/index.vue.d.ts +2 -2
- package/lib/components/radio/index.d.ts +16 -16
- package/lib/components/radio/src/radio-button.vue.d.ts +3 -3
- package/lib/components/radio/src/radio-group.vue.d.ts +3 -3
- package/lib/components/radio/src/radio.vue.d.ts +4 -4
- package/lib/components/rate/index.d.ts +10 -10
- package/lib/components/rate/src/index.vue.d.ts +5 -5
- package/lib/components/scrollbar/index.d.ts +4 -4
- package/lib/components/scrollbar/src/index.vue.d.ts +2 -2
- package/lib/components/select/index.d.ts +12 -12
- package/lib/components/select/src/option.vue.d.ts +2 -2
- package/lib/components/select/src/select.vue.d.ts +8 -8
- package/lib/components/select-v2/index.d.ts +10 -10
- package/lib/components/select-v2/src/select.vue.d.ts +5 -5
- package/lib/components/slider/index.d.ts +4 -4
- package/lib/components/slider/src/index.vue.d.ts +2 -2
- package/lib/components/space/index.d.ts +3 -3
- package/lib/components/space/src/space.d.ts +4 -4
- package/lib/components/steps/index.d.ts +1 -1
- package/lib/components/steps/src/index.vue.d.ts +1 -1
- package/lib/components/table/index.d.ts +11 -11
- package/lib/components/table/src/table/defaults.d.ts +4 -4
- package/lib/components/table/src/table-column/defaults.d.ts +2 -2
- package/lib/components/table/src/table-column/index.d.ts +3 -3
- package/lib/components/table/src/table.vue.d.ts +5 -5
- package/lib/components/tabs/index.d.ts +4 -4
- package/lib/components/tabs/src/tab-pane.vue.d.ts +2 -2
- package/lib/components/tag/index.d.ts +6 -6
- package/lib/components/tag/src/tag.d.ts +2 -2
- package/lib/components/tag/src/tag.vue.d.ts +6 -6
- 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/time-select/index.d.ts +8 -8
- package/lib/components/time-select/src/time-select.vue.d.ts +4 -4
- package/lib/components/timeline/index.d.ts +4 -4
- package/lib/components/timeline/src/item.vue.d.ts +2 -2
- package/lib/components/tooltip/index.d.ts +6 -6
- package/lib/components/tooltip/src/index.vue.d.ts +3 -3
- package/lib/components/tree-v2/index.d.ts +1 -1
- package/lib/components/tree-v2/src/tree-node.vue.d.ts +2 -2
- package/lib/components/tree-v2/src/tree.vue.d.ts +1 -1
- package/lib/components/upload/index.d.ts +4 -4
- package/lib/components/upload/src/index.vue.d.ts +2 -2
- package/lib/components/upload/src/upload.vue.d.ts +2 -2
- package/lib/hooks/use-form-item/index.d.ts +1 -1
- package/lib/index.js +6 -6
- package/lib/packages/components/avatar/index.js +2 -2
- package/lib/packages/components/avatar/src/avatar.js +5 -28
- package/lib/packages/components/avatar/src/avatar.js.map +1 -1
- package/lib/packages/components/avatar/src/avatar.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/avatar/src/avatar2.js +28 -5
- package/lib/packages/components/avatar/src/avatar2.js.map +1 -1
- package/lib/packages/components/button/index.js +2 -2
- package/lib/packages/components/button/src/button-group.js +1 -1
- package/lib/packages/components/button/src/button.js +49 -5
- package/lib/packages/components/button/src/button.js.map +1 -1
- package/lib/packages/components/button/src/button.vue_vue&type=script&lang.js +40 -1
- package/lib/packages/components/button/src/button.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.js +3 -2
- package/lib/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.js.map +1 -1
- package/lib/packages/components/button/src/button2.js +5 -48
- package/lib/packages/components/button/src/button2.js.map +1 -1
- package/lib/packages/components/card/index.js +2 -2
- package/lib/packages/components/card/src/card.js +5 -16
- package/lib/packages/components/card/src/card.js.map +1 -1
- package/lib/packages/components/card/src/card.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/card/src/card2.js +16 -5
- package/lib/packages/components/card/src/card2.js.map +1 -1
- package/lib/packages/components/dialog/index.js +2 -2
- package/lib/packages/components/dialog/src/dialog.js +78 -5
- package/lib/packages/components/dialog/src/dialog.js.map +1 -1
- package/lib/packages/components/dialog/src/dialog.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/dialog/src/dialog2.js +5 -78
- package/lib/packages/components/dialog/src/dialog2.js.map +1 -1
- package/lib/packages/components/drawer/src/index.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/dropdown/index.js +1 -1
- package/lib/packages/components/dropdown/src/dropdown.js +0 -9
- package/lib/packages/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/packages/components/dropdown/src/dropdown2.js +9 -0
- package/lib/packages/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/packages/components/empty/index.js +2 -2
- package/lib/packages/components/empty/src/empty.js +6 -12
- package/lib/packages/components/empty/src/empty.js.map +1 -1
- package/lib/packages/components/empty/src/empty.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/empty/src/empty2.js +12 -6
- package/lib/packages/components/empty/src/empty2.js.map +1 -1
- package/lib/packages/components/form/src/form-item.vue_vue&type=script&lang.js +0 -4
- package/lib/packages/components/form/src/form-item.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.js.map +1 -1
- package/lib/packages/components/index.js +6 -6
- package/lib/packages/components/input/src/input.js +3 -0
- package/lib/packages/components/input/src/input.js.map +1 -1
- package/lib/packages/components/input/src/input.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/input/src/input.vue_vue&type=template&id=3290dcb6&lang.js +26 -24
- package/lib/packages/components/input/src/input.vue_vue&type=template&id=3290dcb6&lang.js.map +1 -1
- package/lib/packages/components/page-header/index.js +2 -2
- package/lib/packages/components/page-header/src/page-header.js +13 -5
- package/lib/packages/components/page-header/src/page-header.js.map +1 -1
- package/lib/packages/components/page-header/src/page-header.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/page-header/src/page-header2.js +5 -13
- package/lib/packages/components/page-header/src/page-header2.js.map +1 -1
- package/lib/packages/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/packages/components/tabs/src/tabs.js +4 -6
- package/lib/packages/components/tabs/src/tabs.js.map +1 -1
- package/lib/utils/util.d.ts +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,47 +1,7 @@
|
|
|
1
|
-
import '
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import script from './button.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './button.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './button.vue_vue&type=template&id=802c5c76&lang.mjs';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"primary",
|
|
8
|
-
"success",
|
|
9
|
-
"warning",
|
|
10
|
-
"info",
|
|
11
|
-
"danger",
|
|
12
|
-
"text",
|
|
13
|
-
""
|
|
14
|
-
];
|
|
15
|
-
const buttonSize = ["", "large", "medium", "small", "mini"];
|
|
16
|
-
const buttonNativeType = ["button", "submit", "reset"];
|
|
17
|
-
const buttonProps = buildProps({
|
|
18
|
-
...useFormItemProps,
|
|
19
|
-
type: {
|
|
20
|
-
type: String,
|
|
21
|
-
values: buttonType,
|
|
22
|
-
default: ""
|
|
23
|
-
},
|
|
24
|
-
icon: {
|
|
25
|
-
type: definePropType([String, Object]),
|
|
26
|
-
default: ""
|
|
27
|
-
},
|
|
28
|
-
nativeType: {
|
|
29
|
-
type: String,
|
|
30
|
-
values: buttonNativeType,
|
|
31
|
-
default: "button"
|
|
32
|
-
},
|
|
33
|
-
loading: Boolean,
|
|
34
|
-
plain: Boolean,
|
|
35
|
-
autofocus: Boolean,
|
|
36
|
-
round: Boolean,
|
|
37
|
-
circle: Boolean,
|
|
38
|
-
autoInsertSpace: {
|
|
39
|
-
type: Boolean
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const buttonEmits = {
|
|
43
|
-
click: (evt) => evt instanceof MouseEvent
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export { buttonEmits, buttonNativeType, buttonProps, buttonSize, buttonType };
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/button/src/button.vue";
|
|
47
7
|
//# sourceMappingURL=button2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button2.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"button2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/
|
|
3
|
-
export { cardProps } from './src/
|
|
2
|
+
import './src/card.mjs';
|
|
3
|
+
export { cardProps } from './src/card2.mjs';
|
|
4
4
|
import script from './src/card.vue_vue&type=script&lang.mjs';
|
|
5
5
|
|
|
6
6
|
const PsCard = withInstall(script);
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import script from './card.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './card.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './card.vue_vue&type=template&id=7a6bdf05&lang.mjs';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type: String,
|
|
6
|
-
default: ""
|
|
7
|
-
},
|
|
8
|
-
bodyStyle: {
|
|
9
|
-
type: definePropType([String, Object, Array]),
|
|
10
|
-
default: ""
|
|
11
|
-
},
|
|
12
|
-
shadow: {
|
|
13
|
-
type: String,
|
|
14
|
-
default: ""
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export { cardProps };
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/card/src/card.vue";
|
|
19
7
|
//# sourceMappingURL=card.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"card.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { default } from './card.vue_vue&type=script&lang.mjs';
|
|
3
|
-
import { render } from './card.vue_vue&type=template&id=7a6bdf05&lang.mjs';
|
|
1
|
+
import { buildProps, definePropType } from '../../../utils/props.mjs';
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const cardProps = buildProps({
|
|
4
|
+
header: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: ""
|
|
7
|
+
},
|
|
8
|
+
bodyStyle: {
|
|
9
|
+
type: definePropType([String, Object, Array]),
|
|
10
|
+
default: ""
|
|
11
|
+
},
|
|
12
|
+
shadow: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { cardProps };
|
|
7
19
|
//# sourceMappingURL=card2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"card2.mjs","sources":["../../../../../../../packages/components/card/src/card.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-ps/utils/props'\nimport type { ExtractPropTypes } from 'vue'\nimport type { StyleValue } from '@element-ps/utils/types'\n\nexport const cardProps = buildProps({\n header: {\n type: String,\n default: '',\n },\n bodyStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n default: '',\n },\n shadow: {\n type: String,\n default: '',\n },\n} as const)\nexport type CardProps = ExtractPropTypes<typeof cardProps>\n"],"names":[],"mappings":";;MAIa,YAAY,WAAW;AAAA,EAClC,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,IACT,MAAM,eAA2B,CAAC,QAAQ,QAAQ;AAAA,IAClD,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/
|
|
2
|
+
import './src/dialog2.mjs';
|
|
3
3
|
export { useDialog } from './src/use-dialog.mjs';
|
|
4
|
-
export { dialogProps } from './src/
|
|
4
|
+
export { dialogProps } from './src/dialog.mjs';
|
|
5
5
|
import script from './src/dialog.vue_vue&type=script&lang.mjs';
|
|
6
6
|
|
|
7
7
|
const PsDialog = withInstall(script);
|
|
@@ -1,7 +1,81 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { render } from './dialog.vue_vue&type=template&id=02672805&lang.mjs';
|
|
1
|
+
import { isValidWidthUnit } from '../../../utils/validators.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/props.mjs';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const dialogProps = buildProps({
|
|
5
|
+
appendToBody: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: false
|
|
8
|
+
},
|
|
9
|
+
beforeClose: {
|
|
10
|
+
type: definePropType(Function)
|
|
11
|
+
},
|
|
12
|
+
destroyOnClose: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false
|
|
15
|
+
},
|
|
16
|
+
center: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
customClass: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
closeOnClickModal: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true
|
|
27
|
+
},
|
|
28
|
+
closeOnPressEscape: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
31
|
+
},
|
|
32
|
+
fullscreen: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
lockScroll: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
39
|
+
},
|
|
40
|
+
modal: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true
|
|
43
|
+
},
|
|
44
|
+
showClose: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true
|
|
47
|
+
},
|
|
48
|
+
title: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ""
|
|
51
|
+
},
|
|
52
|
+
openDelay: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 0
|
|
55
|
+
},
|
|
56
|
+
closeDelay: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: 0
|
|
59
|
+
},
|
|
60
|
+
top: {
|
|
61
|
+
type: String
|
|
62
|
+
},
|
|
63
|
+
modelValue: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
required: true
|
|
66
|
+
},
|
|
67
|
+
modalClass: String,
|
|
68
|
+
width: {
|
|
69
|
+
type: [String, Number],
|
|
70
|
+
validator: isValidWidthUnit
|
|
71
|
+
},
|
|
72
|
+
zIndex: {
|
|
73
|
+
type: Number
|
|
74
|
+
},
|
|
75
|
+
widget: {
|
|
76
|
+
type: String
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export { dialogProps };
|
|
7
81
|
//# sourceMappingURL=dialog.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dialog.mjs","sources":["../../../../../../../packages/components/dialog/src/dialog.ts"],"sourcesContent":["import { isValidWidthUnit } from '@element-ps/utils/validators'\nimport { buildProps, definePropType } from '@element-ps/utils/props'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const dialogProps = buildProps({\n appendToBody: {\n type: Boolean,\n default: false,\n },\n beforeClose: {\n type: definePropType<(...args: any[]) => void>(Function),\n },\n destroyOnClose: {\n type: Boolean,\n default: false,\n },\n center: {\n type: Boolean,\n default: false,\n },\n customClass: {\n type: String,\n default: '',\n },\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n fullscreen: {\n type: Boolean,\n default: false,\n },\n lockScroll: {\n type: Boolean,\n default: true,\n },\n modal: {\n type: Boolean,\n default: true,\n },\n showClose: {\n type: Boolean,\n default: true,\n },\n title: {\n type: String,\n default: '',\n },\n openDelay: {\n type: Number,\n default: 0,\n },\n closeDelay: {\n type: Number,\n default: 0,\n },\n top: {\n type: String,\n },\n modelValue: {\n type: Boolean,\n required: true,\n },\n modalClass: String,\n width: {\n type: [String, Number],\n validator: isValidWidthUnit,\n },\n zIndex: {\n type: Number,\n },\n widget: {\n type: String,\n },\n} as const)\nexport type DialogProps = ExtractPropTypes<typeof dialogProps>\n"],"names":[],"mappings":";;;MAKa,cAAc,WAAW;AAAA,EACpC,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,aAAa;AAAA,IACX,MAAM,eAAyC;AAAA;AAAA,EAEjD,gBAAgB;AAAA,IACd,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,oBAAoB;AAAA,IAClB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA;AAAA,EAER,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,YAAY;AAAA,EACZ,OAAO;AAAA,IACL,MAAM,CAAC,QAAQ;AAAA,IACf,WAAW;AAAA;AAAA,EAEb,QAAQ;AAAA,IACN,MAAM;AAAA;AAAA,EAER,QAAQ;AAAA,IACN,MAAM;AAAA;AAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref } from 'vue';
|
|
2
2
|
import { PsOverlay } from '../../overlay/index.mjs';
|
|
3
3
|
import '../../../hooks/index.mjs';
|
|
4
|
-
import { dialogProps } from './
|
|
4
|
+
import { dialogProps } from './dialog.mjs';
|
|
5
5
|
import { useDialog } from './use-dialog.mjs';
|
|
6
6
|
import { PsIcon } from '../../icon/index.mjs';
|
|
7
7
|
import { CloseComponents } from '../../../utils/icon.mjs';
|
|
@@ -1,81 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import script from './dialog.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './dialog.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './dialog.vue_vue&type=template&id=02672805&lang.mjs';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type: Boolean,
|
|
7
|
-
default: false
|
|
8
|
-
},
|
|
9
|
-
beforeClose: {
|
|
10
|
-
type: definePropType(Function)
|
|
11
|
-
},
|
|
12
|
-
destroyOnClose: {
|
|
13
|
-
type: Boolean,
|
|
14
|
-
default: false
|
|
15
|
-
},
|
|
16
|
-
center: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
default: false
|
|
19
|
-
},
|
|
20
|
-
customClass: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: ""
|
|
23
|
-
},
|
|
24
|
-
closeOnClickModal: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: true
|
|
27
|
-
},
|
|
28
|
-
closeOnPressEscape: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: true
|
|
31
|
-
},
|
|
32
|
-
fullscreen: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false
|
|
35
|
-
},
|
|
36
|
-
lockScroll: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: true
|
|
39
|
-
},
|
|
40
|
-
modal: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: true
|
|
43
|
-
},
|
|
44
|
-
showClose: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: true
|
|
47
|
-
},
|
|
48
|
-
title: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: ""
|
|
51
|
-
},
|
|
52
|
-
openDelay: {
|
|
53
|
-
type: Number,
|
|
54
|
-
default: 0
|
|
55
|
-
},
|
|
56
|
-
closeDelay: {
|
|
57
|
-
type: Number,
|
|
58
|
-
default: 0
|
|
59
|
-
},
|
|
60
|
-
top: {
|
|
61
|
-
type: String
|
|
62
|
-
},
|
|
63
|
-
modelValue: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
required: true
|
|
66
|
-
},
|
|
67
|
-
modalClass: String,
|
|
68
|
-
width: {
|
|
69
|
-
type: [String, Number],
|
|
70
|
-
validator: isValidWidthUnit
|
|
71
|
-
},
|
|
72
|
-
zIndex: {
|
|
73
|
-
type: Number
|
|
74
|
-
},
|
|
75
|
-
widget: {
|
|
76
|
-
type: String
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
export { dialogProps };
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/dialog/src/dialog.vue";
|
|
81
7
|
//# sourceMappingURL=dialog2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog2.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"dialog2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -3,7 +3,7 @@ import { PsOverlay } from '../../overlay/index.mjs';
|
|
|
3
3
|
import '../../dialog/index.mjs';
|
|
4
4
|
import { PsIcon } from '../../icon/index.mjs';
|
|
5
5
|
import { Close } from '@element-plus/icons';
|
|
6
|
-
import { dialogProps } from '../../dialog/src/
|
|
6
|
+
import { dialogProps } from '../../dialog/src/dialog.mjs';
|
|
7
7
|
import { useDialog } from '../../dialog/src/use-dialog.mjs';
|
|
8
8
|
|
|
9
9
|
var script = defineComponent({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { withInstall, withNoopInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/
|
|
2
|
+
import './src/dropdown2.mjs';
|
|
3
3
|
import './src/dropdown-item.mjs';
|
|
4
4
|
import './src/dropdown-menu.mjs';
|
|
5
5
|
import script from './src/dropdown.vue_vue&type=script&lang.mjs';
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import script from './dropdown.vue_vue&type=script&lang.mjs';
|
|
2
|
-
export { default } from './dropdown.vue_vue&type=script&lang.mjs';
|
|
3
|
-
import { render } from './dropdown.vue_vue&type=template&id=3ed790a5&lang.mjs';
|
|
4
1
|
|
|
5
|
-
script.render = render;
|
|
6
|
-
script.__file = "packages/components/dropdown/src/dropdown.vue";
|
|
7
2
|
//# sourceMappingURL=dropdown.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
import script from './dropdown.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './dropdown.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './dropdown.vue_vue&type=template&id=3ed790a5&lang.mjs';
|
|
1
4
|
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/dropdown/src/dropdown.vue";
|
|
2
7
|
//# sourceMappingURL=dropdown2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"dropdown2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/
|
|
3
|
-
export { emptyProps } from './src/
|
|
2
|
+
import './src/empty.mjs';
|
|
3
|
+
export { emptyProps } from './src/empty2.mjs';
|
|
4
4
|
import script from './src/empty.vue_vue&type=script&lang.mjs';
|
|
5
5
|
|
|
6
6
|
const PsEmpty = withInstall(script);
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
default: ""
|
|
5
|
-
},
|
|
6
|
-
imageSize: Number,
|
|
7
|
-
description: {
|
|
8
|
-
type: String,
|
|
9
|
-
default: ""
|
|
10
|
-
}
|
|
11
|
-
};
|
|
1
|
+
import script from './empty.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './empty.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './empty.vue_vue&type=template&id=10d211eb&lang.mjs';
|
|
12
4
|
|
|
13
|
-
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/empty/src/empty.vue";
|
|
14
7
|
//# sourceMappingURL=empty.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"empty.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed } from 'vue';
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
3
|
import './img-empty.mjs';
|
|
4
|
-
import { emptyProps } from './
|
|
4
|
+
import { emptyProps } from './empty2.mjs';
|
|
5
5
|
import script$1 from './img-empty.vue_vue&type=script&lang.mjs';
|
|
6
6
|
import { useLocaleInject } from '../../../hooks/use-locale/index.mjs';
|
|
7
7
|
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const emptyProps = {
|
|
2
|
+
image: {
|
|
3
|
+
type: String,
|
|
4
|
+
default: ""
|
|
5
|
+
},
|
|
6
|
+
imageSize: Number,
|
|
7
|
+
description: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
}
|
|
11
|
+
};
|
|
4
12
|
|
|
5
|
-
|
|
6
|
-
script.__file = "packages/components/empty/src/empty.vue";
|
|
13
|
+
export { emptyProps };
|
|
7
14
|
//# sourceMappingURL=empty2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"empty2.mjs","sources":["../../../../../../../packages/components/empty/src/empty.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const emptyProps = {\n image: {\n type: String,\n default: '',\n },\n imageSize: Number,\n description: {\n type: String,\n default: '',\n },\n} as const\nexport type EmptyProps = ExtractPropTypes<typeof emptyProps>\n"],"names":[],"mappings":"MAEa,aAAa;AAAA,EACxB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,EACX,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, getCurrentInstance, computed, reactive, toRefs, onMounted,
|
|
1
|
+
import { defineComponent, inject, ref, getCurrentInstance, computed, reactive, toRefs, onMounted, provide } from 'vue';
|
|
2
2
|
import { useGlobalConfig, addUnit, getPropByPath } from '../../../utils/util.mjs';
|
|
3
3
|
import { isValidComponentSize } from '../../../utils/validators.mjs';
|
|
4
4
|
import '../../../tokens/index.mjs';
|
|
@@ -134,14 +134,10 @@ var script = defineComponent({
|
|
|
134
134
|
});
|
|
135
135
|
onMounted(() => {
|
|
136
136
|
if (props.prop) {
|
|
137
|
-
elForm == null ? void 0 : elForm.addField(elFormItem);
|
|
138
137
|
const value = fieldValue.value;
|
|
139
138
|
initialValue = Array.isArray(value) ? [...value] : value;
|
|
140
139
|
}
|
|
141
140
|
});
|
|
142
|
-
onBeforeUnmount(() => {
|
|
143
|
-
elForm == null ? void 0 : elForm.removeField(elFormItem);
|
|
144
|
-
});
|
|
145
141
|
provide(elFormItemKey, elFormItem);
|
|
146
142
|
const formItemClass = computed(() => [
|
|
147
143
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item.vue_vue&type=script&lang.mjs","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\" :widget=\"widget\">\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n
|
|
1
|
+
{"version":3,"file":"form-item.vue_vue&type=script&lang.mjs","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\" :widget=\"widget\">\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":[],"mappings":"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"}
|
package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.mjs","sources":["../../../../../../../packages/components/form/src/form-item.vue?vue&type=template&id=24eda48b&lang.js"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\" :widget=\"widget\">\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n
|
|
1
|
+
{"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.mjs","sources":["../../../../../../../packages/components/form/src/form-item.vue?vue&type=template&id=24eda48b&lang.js"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\" :widget=\"widget\">\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_renderSlot","_createElementVNode"],"mappings":";;;;;;sBACEA;IAAK,KAAI;AAAA,IAAc,uBAAM,gBAAuB;;IAClDC;MACG,iBAAe,gBAAW;MAC1B,cAAY,YAAO;;uBAEpB;QACQ,cAAS,YAAO,sBADxBD;;UAEG,KAAK;UACN,OAAM;AAAA,UACL,sBAAO;UACP,QAAQ;;UAETE;YAAoB,OAAO,aAAQ,YAAO;AAAA,aAA1C;4CACK,aAAQ,YAAO;;;;;;IAIxBC;MAAK,OAAM;AAAA,MAAyB,sBAAO;MAAe,QAAQ;;MAChED;MACAD,0BAAY,MAAK;yBACf;UAAY,uBAAZC;;YAA2C,OAAO;aAAlD;YACEC;cACE,uBAAM;;;+BAQH;;;;;;;;;;;"}
|