vxe-pc-ui 0.0.2 → 0.1.0
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/es/anchor/src/anchor.js +1 -1
- package/es/anchor-link/index.js +1 -1
- package/es/{button-group → button}/src/button-group.js +2 -2
- package/es/button/src/button.js +3 -3
- package/es/button/style.css +17 -17
- package/es/button/style.min.css +1 -1
- package/es/button-group/index.js +1 -1
- package/es/checkbox/index.js +10 -0
- package/es/checkbox/src/checkbox.js +116 -0
- package/es/checkbox/src/group.js +108 -0
- package/es/checkbox/style.css +107 -0
- package/es/checkbox/style.min.css +1 -0
- package/es/checkbox-group/index.js +10 -0
- package/es/col/index.js +1 -1
- package/es/components.js +98 -35
- package/es/dynamics/index.js +27 -0
- package/es/form/index.js +8 -0
- package/es/form/src/form-config-item.js +178 -0
- package/es/form/src/form-gather.js +47 -0
- package/es/form/src/form-item.js +228 -0
- package/es/form/src/form.js +665 -0
- package/es/form/src/itemInfo.js +39 -0
- package/es/form/src/render.js +68 -0
- package/es/form/src/util.js +65 -0
- package/es/form/style.css +321 -0
- package/es/form/style.min.css +1 -0
- package/es/form-design/index.js +8 -0
- package/es/form-design/src/form-design.js +79 -0
- package/es/form-design/src/setting.js +12 -0
- package/es/form-design/src/util.js +8 -0
- package/es/form-design/src/view.js +113 -0
- package/es/form-design/src/widget.js +104 -0
- package/es/form-design/style.css +97 -0
- package/es/form-design/style.min.css +1 -0
- package/es/form-gather/index.js +8 -0
- package/es/form-item/index.js +8 -0
- package/es/icon/style.css +540 -1
- package/es/icon/style.min.css +1 -1
- package/es/input/index.js +10 -0
- package/es/input/src/date.js +41 -0
- package/es/input/src/input.js +2333 -0
- package/es/input/src/number.js +10 -0
- package/es/input/style.css +1000 -0
- package/es/input/style.min.css +1 -0
- package/es/layout-aside/style.css +1 -0
- package/es/layout-aside/style.min.css +1 -1
- package/es/layout-body/style.css +1 -0
- package/es/layout-body/style.min.css +1 -1
- package/es/layout-footer/style.css +1 -0
- package/es/layout-footer/style.min.css +1 -1
- package/es/layout-header/style.css +1 -0
- package/es/layout-header/style.min.css +1 -1
- package/es/list-design/index.js +8 -0
- package/es/{design/src/design.js → list-design/src/list-design.js} +7 -7
- package/es/loading/index.js +8 -0
- package/es/loading/src/loading.js +53 -0
- package/es/loading/style.css +75 -0
- package/es/loading/style.min.css +1 -0
- package/es/modal/index.js +96 -0
- package/es/modal/src/modal.js +876 -0
- package/es/modal/style.css +323 -0
- package/es/modal/style.min.css +1 -0
- package/es/optgroup/index.js +10 -0
- package/es/optgroup/style.css +0 -0
- package/es/optgroup/style.min.css +0 -0
- package/es/option/index.js +10 -0
- package/es/option/style.css +0 -0
- package/es/option/style.min.css +0 -0
- package/es/pager/index.js +10 -0
- package/es/pager/src/pager.js +539 -0
- package/es/pager/style.css +319 -0
- package/es/pager/style.min.css +1 -0
- package/es/pulldown/index.js +10 -0
- package/es/pulldown/src/pulldown.js +328 -0
- package/es/pulldown/style.css +57 -0
- package/es/pulldown/style.min.css +1 -0
- package/es/radio/index.js +10 -0
- package/es/radio/src/button.js +113 -0
- package/es/radio/src/group.js +93 -0
- package/es/radio/src/radio.js +118 -0
- package/es/radio/style.css +143 -0
- package/es/radio/style.min.css +1 -0
- package/es/radio-button/index.js +10 -0
- package/es/radio-button/style.css +0 -0
- package/es/radio-button/style.min.css +0 -0
- package/es/radio-group/index.js +10 -0
- package/es/radio-group/style.css +0 -0
- package/es/radio-group/style.min.css +0 -0
- package/es/select/index.js +10 -0
- package/es/select/src/optgroup.js +31 -0
- package/es/select/src/option.js +31 -0
- package/es/select/src/optionInfo.js +16 -0
- package/es/select/src/select.js +992 -0
- package/es/select/src/util.js +36 -0
- package/es/select/style.css +201 -0
- package/es/select/style.min.css +1 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/switch/index.js +10 -0
- package/es/switch/src/switch.js +151 -0
- package/es/switch/style.css +97 -0
- package/es/switch/style.min.css +1 -0
- package/es/textarea/index.js +10 -0
- package/es/textarea/src/textarea.js +245 -0
- package/es/textarea/style.css +102 -0
- package/es/textarea/style.min.css +1 -0
- package/es/tooltip/index.js +8 -0
- package/es/tooltip/src/tooltip.js +336 -0
- package/es/tooltip/style.css +103 -0
- package/es/tooltip/style.min.css +1 -0
- package/es/ui/src/core.js +12 -2
- package/es/ui/src/dom.js +20 -0
- package/es/ui/src/globalStore.js +119 -4
- package/es/ui/src/i18n.js +7 -0
- package/es/ui/src/log.js +2 -2
- package/es/ui/src/renderer.js +67 -0
- package/es/ui/src/store.js +41 -0
- package/es/ui/src/utils.js +10 -0
- package/es/ui/src/validators.js +5 -0
- package/es/ui/src/vn.js +10 -0
- package/es/vxe-button/style.css +17 -17
- package/es/vxe-button/style.min.css +1 -1
- package/es/vxe-checkbox/index.js +3 -0
- package/es/vxe-checkbox/style.css +107 -0
- package/es/vxe-checkbox/style.min.css +1 -0
- package/es/vxe-checkbox-group/index.js +3 -0
- package/es/vxe-checkbox-group/style.css +0 -0
- package/es/vxe-checkbox-group/style.min.css +0 -0
- package/es/vxe-form/index.js +3 -0
- package/es/vxe-form/style.css +321 -0
- package/es/vxe-form/style.min.css +1 -0
- package/es/vxe-form-design/index.js +3 -0
- package/es/vxe-form-design/style.css +97 -0
- package/es/vxe-form-design/style.min.css +1 -0
- package/es/vxe-form-gather/index.js +3 -0
- package/es/vxe-form-gather/style.css +0 -0
- package/es/vxe-form-gather/style.min.css +0 -0
- package/es/vxe-form-item/index.js +3 -0
- package/es/vxe-form-item/style.css +0 -0
- package/es/vxe-form-item/style.min.css +0 -0
- package/es/vxe-icon/style.css +540 -1
- package/es/vxe-icon/style.min.css +1 -1
- package/es/vxe-input/index.js +3 -0
- package/es/vxe-input/style.css +1000 -0
- package/es/vxe-input/style.min.css +1 -0
- package/es/vxe-layout-aside/style.css +1 -0
- package/es/vxe-layout-aside/style.min.css +1 -1
- package/es/vxe-layout-body/style.css +1 -0
- package/es/vxe-layout-body/style.min.css +1 -1
- package/es/vxe-layout-footer/style.css +1 -0
- package/es/vxe-layout-footer/style.min.css +1 -1
- package/es/vxe-layout-header/style.css +1 -0
- package/es/vxe-layout-header/style.min.css +1 -1
- package/es/vxe-list-design/index.js +3 -0
- package/es/vxe-list-design/style.css +0 -0
- package/es/vxe-list-design/style.min.css +0 -0
- package/es/vxe-loading/index.js +3 -0
- package/es/vxe-loading/style.css +75 -0
- package/es/vxe-loading/style.min.css +1 -0
- package/es/vxe-modal/index.js +3 -0
- package/es/vxe-modal/style.css +323 -0
- package/es/vxe-modal/style.min.css +1 -0
- package/es/vxe-optgroup/index.js +3 -0
- package/es/vxe-optgroup/style.css +0 -0
- package/es/vxe-optgroup/style.min.css +0 -0
- package/es/vxe-option/index.js +3 -0
- package/es/vxe-option/style.css +0 -0
- package/es/vxe-option/style.min.css +0 -0
- package/es/vxe-pager/index.js +3 -0
- package/es/vxe-pager/style.css +319 -0
- package/es/vxe-pager/style.min.css +1 -0
- package/es/vxe-pulldown/index.js +3 -0
- package/es/vxe-pulldown/style.css +57 -0
- package/es/vxe-pulldown/style.min.css +1 -0
- package/es/vxe-radio/index.js +3 -0
- package/es/vxe-radio/style.css +143 -0
- package/es/vxe-radio/style.min.css +1 -0
- package/es/vxe-radio-button/index.js +3 -0
- package/es/vxe-radio-button/style.css +0 -0
- package/es/vxe-radio-button/style.min.css +0 -0
- package/es/vxe-radio-group/index.js +3 -0
- package/es/vxe-radio-group/style.css +0 -0
- package/es/vxe-radio-group/style.min.css +0 -0
- package/es/vxe-select/index.js +3 -0
- package/es/vxe-select/style.css +201 -0
- package/es/vxe-select/style.min.css +1 -0
- package/es/vxe-switch/index.js +3 -0
- package/es/vxe-switch/style.css +97 -0
- package/es/vxe-switch/style.min.css +1 -0
- package/es/vxe-textarea/index.js +3 -0
- package/es/vxe-textarea/style.css +102 -0
- package/es/vxe-textarea/style.min.css +1 -0
- package/es/vxe-tooltip/index.js +3 -0
- package/es/vxe-tooltip/style.css +103 -0
- package/es/vxe-tooltip/style.min.css +1 -0
- package/lib/anchor/src/anchor.js +1 -1
- package/lib/anchor/src/anchor.min.js +1 -1
- package/lib/anchor-link/index.js +1 -1
- package/lib/anchor-link/index.min.js +1 -1
- package/lib/{button-group → button}/src/button-group.js +2 -2
- package/lib/button/src/button-group.min.js +1 -0
- package/lib/button/src/button.js +3 -3
- package/lib/button/src/button.min.js +1 -1
- package/lib/button/style/style.css +17 -17
- package/lib/button/style/style.min.css +1 -1
- package/lib/button-group/index.js +1 -1
- package/lib/button-group/index.min.js +1 -1
- package/lib/checkbox/index.js +17 -0
- package/lib/checkbox/index.min.js +1 -0
- package/lib/checkbox/src/checkbox.js +144 -0
- package/lib/checkbox/src/checkbox.min.js +1 -0
- package/lib/checkbox/src/group.js +129 -0
- package/lib/checkbox/src/group.min.js +1 -0
- package/lib/checkbox/style/style.css +107 -0
- package/lib/checkbox/style/style.min.css +1 -0
- package/lib/checkbox-group/index.js +17 -0
- package/lib/checkbox-group/index.min.js +1 -0
- package/lib/checkbox-group/style/style.css +0 -0
- package/lib/checkbox-group/style/style.min.css +0 -0
- package/lib/col/index.js +1 -1
- package/lib/col/index.min.js +1 -1
- package/lib/components.js +290 -63
- package/lib/components.min.js +1 -1
- package/lib/dynamics/index.js +36 -0
- package/lib/dynamics/index.min.js +1 -0
- package/lib/form/index.js +15 -0
- package/lib/form/index.min.js +1 -0
- package/lib/form/src/form-config-item.js +192 -0
- package/lib/form/src/form-config-item.min.js +1 -0
- package/lib/form/src/form-gather.js +57 -0
- package/lib/form/src/form-gather.min.js +1 -0
- package/lib/form/src/form-item.js +247 -0
- package/lib/form/src/form-item.min.js +1 -0
- package/lib/form/src/form.js +768 -0
- package/lib/form/src/form.min.js +1 -0
- package/lib/form/src/itemInfo.js +47 -0
- package/lib/form/src/itemInfo.min.js +1 -0
- package/lib/form/src/render.js +84 -0
- package/lib/form/src/render.min.js +1 -0
- package/lib/form/src/util.js +108 -0
- package/lib/form/src/util.min.js +1 -0
- package/lib/form/style/index.js +1 -0
- package/lib/form/style/style.css +321 -0
- package/lib/form/style/style.min.css +1 -0
- package/lib/form-design/index.js +15 -0
- package/lib/form-design/index.min.js +1 -0
- package/lib/form-design/src/form-design.js +87 -0
- package/lib/form-design/src/form-design.min.js +1 -0
- package/lib/form-design/src/setting.js +18 -0
- package/lib/form-design/src/setting.min.js +1 -0
- package/lib/form-design/src/util.js +17 -0
- package/lib/form-design/src/util.min.js +1 -0
- package/lib/form-design/src/view.js +147 -0
- package/lib/form-design/src/view.min.js +1 -0
- package/lib/form-design/src/widget.js +114 -0
- package/lib/form-design/src/widget.min.js +1 -0
- package/lib/form-design/style/index.js +1 -0
- package/lib/form-design/style/style.css +97 -0
- package/lib/form-design/style/style.min.css +1 -0
- package/lib/form-gather/index.js +15 -0
- package/lib/form-gather/index.min.js +1 -0
- package/lib/form-gather/style/index.js +1 -0
- package/lib/form-gather/style/style.css +0 -0
- package/lib/form-gather/style/style.min.css +0 -0
- package/lib/form-item/index.js +15 -0
- package/lib/form-item/index.min.js +1 -0
- package/lib/form-item/style/index.js +1 -0
- package/lib/form-item/style/style.css +0 -0
- package/lib/form-item/style/style.min.css +0 -0
- package/lib/icon/style/style.css +540 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +10741 -782
- package/lib/index.umd.min.js +1 -1
- package/lib/input/index.js +17 -0
- package/lib/input/index.min.js +1 -0
- package/lib/input/src/date.js +46 -0
- package/lib/input/src/date.min.js +1 -0
- package/lib/input/src/input.js +2546 -0
- package/lib/input/src/input.min.js +1 -0
- package/lib/input/src/number.js +18 -0
- package/lib/input/src/number.min.js +1 -0
- package/lib/input/style/index.js +1 -0
- package/lib/input/style/style.css +1000 -0
- package/lib/input/style/style.min.css +1 -0
- package/lib/layout-aside/style/style.css +1 -0
- package/lib/layout-aside/style/style.min.css +1 -1
- package/lib/layout-body/style/style.css +1 -0
- package/lib/layout-body/style/style.min.css +1 -1
- package/lib/layout-footer/style/style.css +1 -0
- package/lib/layout-footer/style/style.min.css +1 -1
- package/lib/layout-header/style/style.css +1 -0
- package/lib/layout-header/style/style.min.css +1 -1
- package/lib/list-design/index.js +15 -0
- package/lib/list-design/index.min.js +1 -0
- package/lib/{design/src/design.js → list-design/src/list-design.js} +7 -7
- package/lib/list-design/src/list-design.min.js +1 -0
- package/lib/list-design/style/index.js +1 -0
- package/lib/list-design/style/style.css +0 -0
- package/lib/list-design/style/style.min.css +0 -0
- package/lib/loading/index.js +15 -0
- package/lib/loading/index.min.js +1 -0
- package/lib/loading/src/loading.js +49 -0
- package/lib/loading/src/loading.min.js +1 -0
- package/lib/loading/style/index.js +1 -0
- package/lib/loading/style/style.css +75 -0
- package/lib/loading/style/style.min.css +1 -0
- package/lib/modal/index.js +110 -0
- package/lib/modal/index.min.js +1 -0
- package/lib/modal/src/modal.js +1064 -0
- package/lib/modal/src/modal.min.js +1 -0
- package/lib/modal/style/index.js +1 -0
- package/lib/modal/style/style.css +323 -0
- package/lib/modal/style/style.min.css +1 -0
- package/lib/optgroup/index.js +17 -0
- package/lib/optgroup/index.min.js +1 -0
- package/lib/optgroup/style/index.js +1 -0
- package/lib/optgroup/style/style.css +0 -0
- package/lib/optgroup/style/style.min.css +0 -0
- package/lib/option/index.js +17 -0
- package/lib/option/index.min.js +1 -0
- package/lib/option/style/index.js +1 -0
- package/lib/option/style/style.css +0 -0
- package/lib/option/style/style.min.css +0 -0
- package/lib/pager/index.js +17 -0
- package/lib/pager/index.min.js +1 -0
- package/lib/pager/src/pager.js +593 -0
- package/lib/pager/src/pager.min.js +1 -0
- package/lib/pager/style/index.js +1 -0
- package/lib/pager/style/style.css +319 -0
- package/lib/pager/style/style.min.css +1 -0
- package/lib/pulldown/index.js +17 -0
- package/lib/pulldown/index.min.js +1 -0
- package/lib/pulldown/src/pulldown.js +359 -0
- package/lib/pulldown/src/pulldown.min.js +1 -0
- package/lib/pulldown/style/index.js +1 -0
- package/lib/pulldown/style/style.css +57 -0
- package/lib/pulldown/style/style.min.css +1 -0
- package/lib/radio/index.js +17 -0
- package/lib/radio/index.min.js +1 -0
- package/lib/radio/src/button.js +135 -0
- package/lib/radio/src/button.min.js +1 -0
- package/lib/radio/src/group.js +108 -0
- package/lib/radio/src/group.min.js +1 -0
- package/lib/radio/src/radio.js +139 -0
- package/lib/radio/src/radio.min.js +1 -0
- package/lib/radio/style/index.js +1 -0
- package/lib/radio/style/style.css +143 -0
- package/lib/radio/style/style.min.css +1 -0
- package/lib/radio-button/index.js +17 -0
- package/lib/radio-button/index.min.js +1 -0
- package/lib/radio-button/style/index.js +1 -0
- package/lib/radio-button/style/style.css +0 -0
- package/lib/radio-button/style/style.min.css +0 -0
- package/lib/radio-group/index.js +17 -0
- package/lib/radio-group/index.min.js +1 -0
- package/lib/radio-group/style/index.js +1 -0
- package/lib/radio-group/style/style.css +0 -0
- package/lib/radio-group/style/style.min.css +0 -0
- package/lib/select/index.js +17 -0
- package/lib/select/index.min.js +1 -0
- package/lib/select/src/optgroup.js +47 -0
- package/lib/select/src/optgroup.min.js +1 -0
- package/lib/select/src/option.js +45 -0
- package/lib/select/src/option.min.js +1 -0
- package/lib/select/src/optionInfo.js +24 -0
- package/lib/select/src/optionInfo.min.js +1 -0
- package/lib/select/src/select.js +1104 -0
- package/lib/select/src/select.min.js +1 -0
- package/lib/select/src/util.js +57 -0
- package/lib/select/src/util.min.js +1 -0
- package/lib/select/style/index.js +1 -0
- package/lib/select/style/style.css +201 -0
- package/lib/select/style/style.min.css +1 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/switch/index.js +17 -0
- package/lib/switch/index.min.js +1 -0
- package/lib/switch/src/switch.js +161 -0
- package/lib/switch/src/switch.min.js +1 -0
- package/lib/switch/style/index.js +1 -0
- package/lib/switch/style/style.css +97 -0
- package/lib/switch/style/style.min.css +1 -0
- package/lib/textarea/index.js +17 -0
- package/lib/textarea/index.min.js +1 -0
- package/lib/textarea/src/textarea.js +298 -0
- package/lib/textarea/src/textarea.min.js +1 -0
- package/lib/textarea/style/index.js +1 -0
- package/lib/textarea/style/style.css +102 -0
- package/lib/textarea/style/style.min.css +1 -0
- package/lib/tooltip/index.js +15 -0
- package/lib/tooltip/index.min.js +1 -0
- package/lib/tooltip/src/tooltip.js +418 -0
- package/lib/tooltip/src/tooltip.min.js +1 -0
- package/lib/tooltip/style/index.js +1 -0
- package/lib/tooltip/style/style.css +103 -0
- package/lib/tooltip/style/style.min.css +1 -0
- package/lib/ui/src/core.js +49 -2
- package/lib/ui/src/core.min.js +1 -1
- package/lib/ui/src/dom.js +22 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/globalStore.js +119 -4
- package/lib/ui/src/globalStore.min.js +1 -1
- package/lib/ui/src/i18n.js +14 -0
- package/lib/ui/src/i18n.min.js +1 -0
- package/lib/ui/src/log.js +2 -3
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/renderer.js +77 -0
- package/lib/ui/src/renderer.min.js +1 -0
- package/lib/ui/src/store.js +49 -0
- package/lib/ui/src/store.min.js +1 -0
- package/lib/ui/src/utils.js +12 -0
- package/lib/ui/src/utils.min.js +1 -1
- package/lib/ui/src/validators.js +14 -0
- package/lib/ui/src/validators.min.js +1 -0
- package/lib/ui/src/vn.js +18 -0
- package/lib/ui/src/vn.min.js +1 -0
- package/lib/vxe-button/style/style.css +17 -17
- package/lib/vxe-button/style/style.min.css +1 -1
- package/lib/vxe-checkbox/index.js +22 -0
- package/lib/vxe-checkbox/index.min.js +1 -0
- package/lib/vxe-checkbox/style/index.js +1 -0
- package/lib/vxe-checkbox/style/style.css +107 -0
- package/lib/vxe-checkbox/style/style.min.css +1 -0
- package/lib/vxe-checkbox-group/index.js +22 -0
- package/lib/vxe-checkbox-group/index.min.js +1 -0
- package/lib/vxe-checkbox-group/style/index.js +1 -0
- package/lib/vxe-checkbox-group/style/style.css +0 -0
- package/lib/vxe-checkbox-group/style/style.min.css +0 -0
- package/lib/{vxe-design → vxe-form}/index.js +5 -5
- package/lib/vxe-form/index.min.js +1 -0
- package/lib/vxe-form/style/index.js +1 -0
- package/lib/vxe-form/style/style.css +321 -0
- package/lib/vxe-form/style/style.min.css +1 -0
- package/lib/vxe-form-design/index.js +22 -0
- package/lib/vxe-form-design/index.min.js +1 -0
- package/lib/vxe-form-design/style/index.js +1 -0
- package/lib/vxe-form-design/style/style.css +97 -0
- package/lib/vxe-form-design/style/style.min.css +1 -0
- package/lib/vxe-form-gather/index.js +22 -0
- package/lib/vxe-form-gather/index.min.js +1 -0
- package/lib/vxe-form-gather/style/index.js +1 -0
- package/lib/vxe-form-gather/style/style.css +0 -0
- package/lib/vxe-form-gather/style/style.min.css +0 -0
- package/lib/vxe-form-item/index.js +22 -0
- package/lib/vxe-form-item/index.min.js +1 -0
- package/lib/vxe-form-item/style/index.js +1 -0
- package/lib/vxe-form-item/style/style.css +0 -0
- package/lib/vxe-form-item/style/style.min.css +0 -0
- package/lib/vxe-icon/style/style.css +540 -1
- package/lib/vxe-icon/style/style.min.css +1 -1
- package/lib/vxe-input/index.js +22 -0
- package/lib/vxe-input/index.min.js +1 -0
- package/lib/vxe-input/style/index.js +1 -0
- package/lib/vxe-input/style/style.css +1000 -0
- package/lib/vxe-input/style/style.min.css +1 -0
- package/lib/vxe-layout-aside/style/style.css +1 -0
- package/lib/vxe-layout-aside/style/style.min.css +1 -1
- package/lib/vxe-layout-body/style/style.css +1 -0
- package/lib/vxe-layout-body/style/style.min.css +1 -1
- package/lib/vxe-layout-footer/style/style.css +1 -0
- package/lib/vxe-layout-footer/style/style.min.css +1 -1
- package/lib/vxe-layout-header/style/style.css +1 -0
- package/lib/vxe-layout-header/style/style.min.css +1 -1
- package/lib/vxe-list-design/index.js +22 -0
- package/lib/vxe-list-design/index.min.js +1 -0
- package/lib/vxe-list-design/style/index.js +1 -0
- package/lib/vxe-list-design/style/style.css +0 -0
- package/lib/vxe-list-design/style/style.min.css +0 -0
- package/lib/vxe-loading/index.js +22 -0
- package/lib/vxe-loading/index.min.js +1 -0
- package/lib/vxe-loading/style/index.js +1 -0
- package/lib/vxe-loading/style/style.css +75 -0
- package/lib/vxe-loading/style/style.min.css +1 -0
- package/lib/vxe-modal/index.js +22 -0
- package/lib/vxe-modal/index.min.js +1 -0
- package/lib/vxe-modal/style/index.js +1 -0
- package/lib/vxe-modal/style/style.css +323 -0
- package/lib/vxe-modal/style/style.min.css +1 -0
- package/lib/vxe-optgroup/index.js +22 -0
- package/lib/vxe-optgroup/index.min.js +1 -0
- package/lib/vxe-optgroup/style/index.js +1 -0
- package/lib/vxe-optgroup/style/style.css +0 -0
- package/lib/vxe-optgroup/style/style.min.css +0 -0
- package/lib/vxe-option/index.js +22 -0
- package/lib/vxe-option/index.min.js +1 -0
- package/lib/vxe-option/style/index.js +1 -0
- package/lib/vxe-option/style/style.css +0 -0
- package/lib/vxe-option/style/style.min.css +0 -0
- package/lib/vxe-pager/index.js +22 -0
- package/lib/vxe-pager/index.min.js +1 -0
- package/lib/vxe-pager/style/index.js +1 -0
- package/lib/vxe-pager/style/style.css +319 -0
- package/lib/vxe-pager/style/style.min.css +1 -0
- package/lib/vxe-pulldown/index.js +22 -0
- package/lib/vxe-pulldown/index.min.js +1 -0
- package/lib/vxe-pulldown/style/index.js +1 -0
- package/lib/vxe-pulldown/style/style.css +57 -0
- package/lib/vxe-pulldown/style/style.min.css +1 -0
- package/lib/vxe-radio/index.js +22 -0
- package/lib/vxe-radio/index.min.js +1 -0
- package/lib/vxe-radio/style/index.js +1 -0
- package/lib/vxe-radio/style/style.css +143 -0
- package/lib/vxe-radio/style/style.min.css +1 -0
- package/lib/vxe-radio-button/index.js +22 -0
- package/lib/vxe-radio-button/index.min.js +1 -0
- package/lib/vxe-radio-button/style/index.js +1 -0
- package/lib/vxe-radio-button/style/style.css +0 -0
- package/lib/vxe-radio-button/style/style.min.css +0 -0
- package/lib/vxe-radio-group/index.js +22 -0
- package/lib/vxe-radio-group/index.min.js +1 -0
- package/lib/vxe-radio-group/style/index.js +1 -0
- package/lib/vxe-radio-group/style/style.css +0 -0
- package/lib/vxe-radio-group/style/style.min.css +0 -0
- package/lib/vxe-select/index.js +22 -0
- package/lib/vxe-select/index.min.js +1 -0
- package/lib/vxe-select/style/index.js +1 -0
- package/lib/vxe-select/style/style.css +201 -0
- package/lib/vxe-select/style/style.min.css +1 -0
- package/lib/vxe-switch/index.js +22 -0
- package/lib/vxe-switch/index.min.js +1 -0
- package/lib/vxe-switch/style/index.js +1 -0
- package/lib/vxe-switch/style/style.css +97 -0
- package/lib/vxe-switch/style/style.min.css +1 -0
- package/lib/vxe-textarea/index.js +22 -0
- package/lib/vxe-textarea/index.min.js +1 -0
- package/lib/vxe-textarea/style/index.js +1 -0
- package/lib/vxe-textarea/style/style.css +102 -0
- package/lib/vxe-textarea/style/style.min.css +1 -0
- package/lib/vxe-tooltip/index.js +22 -0
- package/lib/vxe-tooltip/index.min.js +1 -0
- package/lib/vxe-tooltip/style/index.js +1 -0
- package/lib/vxe-tooltip/style/style.css +103 -0
- package/lib/vxe-tooltip/style/style.min.css +1 -0
- package/package.json +1 -1
- package/packages/anchor/src/anchor.ts +1 -1
- package/packages/anchor-link/index.ts +1 -1
- package/packages/{button-group → button}/src/button-group.ts +2 -2
- package/packages/button/src/button.ts +3 -3
- package/packages/button-group/index.ts +1 -1
- package/packages/checkbox/index.ts +15 -0
- package/packages/checkbox/src/checkbox.ts +131 -0
- package/packages/checkbox/src/group.ts +127 -0
- package/packages/checkbox-group/index.ts +15 -0
- package/packages/col/index.ts +1 -1
- package/packages/components.ts +100 -35
- package/packages/dynamics/index.ts +34 -0
- package/packages/form/index.ts +11 -0
- package/packages/form/src/form-config-item.ts +193 -0
- package/packages/form/src/form-gather.ts +60 -0
- package/packages/form/src/form-item.ts +253 -0
- package/packages/form/src/form.ts +716 -0
- package/packages/form/src/itemInfo.ts +43 -0
- package/packages/form/src/render.ts +83 -0
- package/packages/form/src/util.ts +79 -0
- package/packages/form-design/index.ts +11 -0
- package/packages/form-design/src/form-design.ts +99 -0
- package/packages/form-design/src/setting.ts +13 -0
- package/packages/form-design/src/util.ts +10 -0
- package/packages/form-design/src/view.ts +125 -0
- package/packages/form-design/src/widget.ts +117 -0
- package/packages/form-gather/index.ts +11 -0
- package/packages/form-item/index.ts +11 -0
- package/packages/icon/src/icon.ts +1 -1
- package/packages/input/index.ts +15 -0
- package/packages/input/src/date.ts +42 -0
- package/packages/input/src/input.ts +2480 -0
- package/packages/input/src/number.ts +12 -0
- package/packages/list-design/index.ts +11 -0
- package/packages/list-design/src/list-design.ts +55 -0
- package/packages/loading/index.ts +11 -0
- package/packages/loading/src/loading.ts +56 -0
- package/packages/modal/index.ts +110 -0
- package/packages/modal/src/modal.ts +950 -0
- package/packages/optgroup/index.ts +15 -0
- package/packages/option/index.ts +15 -0
- package/packages/pager/index.ts +15 -0
- package/packages/pager/src/pager.ts +595 -0
- package/packages/pulldown/index.ts +15 -0
- package/packages/pulldown/src/pulldown.ts +349 -0
- package/packages/radio/index.ts +15 -0
- package/packages/radio/src/button.ts +132 -0
- package/packages/radio/src/group.ts +110 -0
- package/packages/radio/src/radio.ts +137 -0
- package/packages/radio-button/index.ts +15 -0
- package/packages/radio-group/index.ts +15 -0
- package/packages/select/index.ts +15 -0
- package/packages/select/src/optgroup.ts +39 -0
- package/packages/select/src/option.ts +38 -0
- package/packages/select/src/optionInfo.ts +20 -0
- package/packages/select/src/select.ts +1034 -0
- package/packages/select/src/util.ts +47 -0
- package/packages/switch/index.ts +15 -0
- package/packages/switch/src/switch.ts +171 -0
- package/packages/textarea/index.ts +15 -0
- package/packages/textarea/src/textarea.ts +273 -0
- package/packages/tooltip/index.ts +11 -0
- package/packages/tooltip/src/tooltip.ts +360 -0
- package/packages/ui/src/core.ts +13 -1
- package/packages/ui/src/dom.ts +23 -0
- package/packages/ui/src/globalStore.ts +122 -5
- package/packages/ui/src/i18n.ts +8 -0
- package/packages/ui/src/log.ts +2 -2
- package/packages/ui/src/renderer.ts +71 -0
- package/packages/ui/src/store.ts +49 -0
- package/packages/ui/src/utils.ts +12 -0
- package/packages/ui/src/validators.ts +9 -0
- package/packages/ui/src/vn.ts +14 -0
- package/styles/all.scss +30 -10
- package/styles/base/common.scss +13 -0
- package/styles/components/button.scss +8 -8
- package/styles/components/checkbox-group.scss +0 -0
- package/styles/components/checkbox.scss +91 -0
- package/styles/components/form-design.scss +93 -0
- package/styles/components/form-gather.scss +0 -0
- package/styles/components/form-item.scss +0 -0
- package/styles/components/form.scss +339 -0
- package/styles/components/icon.scss +3 -1
- package/styles/components/input.scss +911 -0
- package/styles/components/layout-aside.scss +1 -0
- package/styles/components/layout-body.scss +1 -0
- package/styles/components/layout-footer.scss +1 -0
- package/styles/components/layout-header.scss +1 -0
- package/styles/components/list-design.scss +0 -0
- package/styles/components/list.scss +26 -0
- package/styles/components/loading.scss +84 -0
- package/styles/components/modal.scss +383 -0
- package/styles/components/old-icon.scss +712 -0
- package/styles/components/optgroup.scss +0 -0
- package/styles/components/option.scss +0 -0
- package/styles/components/pager.scss +287 -0
- package/styles/components/pulldown.scss +55 -0
- package/styles/components/radio-button.scss +0 -0
- package/styles/components/radio-group.scss +0 -0
- package/styles/components/radio.scss +149 -0
- package/styles/components/select.scss +226 -0
- package/styles/components/switch.scss +113 -0
- package/styles/components/textarea.scss +102 -0
- package/styles/components/tooltip.scss +124 -0
- package/styles/helpers/mixin.scss +12 -12
- package/styles/theme/base.scss +143 -6
- package/types/all.d.ts +66 -33
- package/types/{component → components}/anchor-link.d.ts +17 -2
- package/types/{component → components}/anchor.d.ts +10 -2
- package/types/{component → components}/breadcrumb-item.d.ts +12 -1
- package/types/{component → components}/breadcrumb.d.ts +10 -2
- package/types/{component → components}/button-group.d.ts +11 -3
- package/types/{component → components}/button.d.ts +14 -3
- package/types/components/checkbox-group.d.ts +112 -0
- package/types/components/checkbox.d.ts +119 -0
- package/types/{component → components}/col.d.ts +9 -1
- package/types/components/form-design.d.ts +88 -0
- package/types/components/form-gather.d.ts +75 -0
- package/types/components/form-item.d.ts +231 -0
- package/types/components/form.d.ts +349 -0
- package/types/{component → components}/icon.d.ts +7 -2
- package/types/components/input.d.ts +375 -0
- package/types/{component → components}/layout-aside.d.ts +10 -2
- package/types/{component → components}/layout-body.d.ts +10 -2
- package/types/{component → components}/layout-container.d.ts +10 -2
- package/types/{component → components}/layout-footer.d.ts +10 -2
- package/types/{component → components}/layout-header.d.ts +7 -1
- package/types/components/list-design.d.ts +67 -0
- package/types/components/loading.d.ts +66 -0
- package/types/components/modal.d.ts +381 -0
- package/types/components/optgroup.d.ts +80 -0
- package/types/components/option.d.ts +99 -0
- package/types/components/pager.d.ts +208 -0
- package/types/components/pulldown.d.ts +134 -0
- package/types/components/radio-button.d.ts +99 -0
- package/types/components/radio-group.d.ts +107 -0
- package/types/components/radio.d.ts +119 -0
- package/types/{component → components}/row.d.ts +10 -2
- package/types/components/select.d.ts +274 -0
- package/types/components/switch.d.ts +118 -0
- package/types/components/textarea.d.ts +212 -0
- package/types/components/tooltip.d.ts +122 -0
- package/types/ui/global-config.d.ts +43 -6
- package/types/ui/global-icon.d.ts +80 -10
- package/types/ui/index.d.ts +25 -2
- package/types/ui/renderer.d.ts +239 -0
- package/types/ui/validators.d.ts +26 -0
- package/es/design/index.js +0 -8
- package/es/vxe-design/index.js +0 -3
- package/lib/button-group/src/button-group.min.js +0 -1
- package/lib/design/index.js +0 -15
- package/lib/design/index.min.js +0 -1
- package/lib/design/src/design.min.js +0 -1
- package/lib/vxe-design/index.min.js +0 -1
- package/packages/design/index.ts +0 -11
- package/packages/design/src/design.ts +0 -55
- package/styles/components/design.scss +0 -1
- package/types/component/design.d.ts +0 -63
- /package/es/{anchor-link → anchor}/src/anchor-link.js +0 -0
- /package/es/{anchor-link → anchor}/src/util.js +0 -0
- /package/es/{design → checkbox-group}/style.css +0 -0
- /package/es/{design → checkbox-group}/style.min.css +0 -0
- /package/es/{vxe-design → form-gather}/style.css +0 -0
- /package/es/{vxe-design → form-gather}/style.min.css +0 -0
- /package/{lib/design/style → es/form-item}/style.css +0 -0
- /package/{lib/design/style → es/form-item}/style.min.css +0 -0
- /package/{lib/vxe-design/style → es/list-design}/style.css +0 -0
- /package/{lib/vxe-design/style → es/list-design}/style.min.css +0 -0
- /package/es/{col → row}/src/col.js +0 -0
- /package/lib/{anchor-link → anchor}/src/anchor-link.js +0 -0
- /package/lib/{anchor-link → anchor}/src/anchor-link.min.js +0 -0
- /package/lib/{anchor-link → anchor}/src/util.js +0 -0
- /package/lib/{anchor-link → anchor}/src/util.min.js +0 -0
- /package/lib/{vxe-design → checkbox}/style/index.js +0 -0
- /package/lib/{design → checkbox-group}/style/index.js +0 -0
- /package/lib/{col → row}/src/col.js +0 -0
- /package/lib/{col → row}/src/col.min.js +0 -0
- /package/packages/{anchor-link → anchor}/src/anchor-link.ts +0 -0
- /package/packages/{anchor-link → anchor}/src/util.ts +0 -0
- /package/packages/{col → row}/src/col.ts +0 -0
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
import { defineComponent, h, ref, Ref, provide, computed, inject, reactive, watch, nextTick, PropType, onMounted } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import globalConfigStore from '../../ui/src/globalStore'
|
|
4
|
+
import { renderer } from '../../ui/src/renderer'
|
|
5
|
+
import { validators } from '../../ui/src/validators'
|
|
6
|
+
import { getFuncText, isEnableConf, eqEmptyValue } from '../../ui/src/utils'
|
|
7
|
+
import { errLog, warnLog } from '../../ui/src/log'
|
|
8
|
+
import { scrollToView } from '../../ui/src/dom'
|
|
9
|
+
import { createItem, handleFieldOrItem, isHiddenItem, isActivetem } from './util'
|
|
10
|
+
import { useSize } from '../../hooks/size'
|
|
11
|
+
import VxeTooltipComponent from '../../tooltip'
|
|
12
|
+
import VxeFormConfigItem from './form-config-item'
|
|
13
|
+
import VxeLoading from '../../loading/index'
|
|
14
|
+
import { getSlotVNs } from '../../ui/src/vn'
|
|
15
|
+
|
|
16
|
+
import { VxeFormConstructor, VxeFormPropTypes, VxeFormEmits, FormReactData, FormMethods, FormPrivateRef, VxeFormPrivateMethods, VxeFormDefines, VxeFormItemPropTypes, VxeTooltipInstance, FormInternalData, VxeFormPrivateComputed } from '../../../types'
|
|
17
|
+
|
|
18
|
+
class Rule {
|
|
19
|
+
constructor (rule: any) {
|
|
20
|
+
Object.assign(this, {
|
|
21
|
+
$options: rule,
|
|
22
|
+
required: rule.required,
|
|
23
|
+
min: rule.min,
|
|
24
|
+
max: rule.min,
|
|
25
|
+
type: rule.type,
|
|
26
|
+
pattern: rule.pattern,
|
|
27
|
+
validator: rule.validator,
|
|
28
|
+
trigger: rule.trigger,
|
|
29
|
+
maxWidth: rule.maxWidth
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get content () {
|
|
34
|
+
return getFuncText(this.$options.content || this.$options.message)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
get message () {
|
|
38
|
+
return this.content
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[key: string]: any
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const validErrorRuleValue = (rule: VxeFormDefines.FormRule, val: any) => {
|
|
45
|
+
const { type, min, max, pattern } = rule
|
|
46
|
+
const isNumType = type === 'number'
|
|
47
|
+
const numVal = isNumType ? XEUtils.toNumber(val) : XEUtils.getSize(val)
|
|
48
|
+
// 判断数值
|
|
49
|
+
if (isNumType && isNaN(val)) {
|
|
50
|
+
return true
|
|
51
|
+
}
|
|
52
|
+
// 如果存在 min,判断最小值
|
|
53
|
+
if (!XEUtils.eqNull(min) && numVal < XEUtils.toNumber(min)) {
|
|
54
|
+
return true
|
|
55
|
+
}
|
|
56
|
+
// 如果存在 max,判断最大值
|
|
57
|
+
if (!XEUtils.eqNull(max) && numVal > XEUtils.toNumber(max)) {
|
|
58
|
+
return true
|
|
59
|
+
}
|
|
60
|
+
// 如果存在 pattern,正则校验
|
|
61
|
+
if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
|
|
62
|
+
return true
|
|
63
|
+
}
|
|
64
|
+
return false
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function getResetValue (value: any, resetValue: any) {
|
|
68
|
+
if (XEUtils.isArray(value)) {
|
|
69
|
+
resetValue = []
|
|
70
|
+
}
|
|
71
|
+
return resetValue
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default defineComponent({
|
|
75
|
+
name: 'VxeForm',
|
|
76
|
+
props: {
|
|
77
|
+
collapseStatus: { type: Boolean as PropType<VxeFormPropTypes.CollapseStatus>, default: true },
|
|
78
|
+
loading: Boolean as PropType<VxeFormPropTypes.Loading>,
|
|
79
|
+
data: Object as PropType<VxeFormPropTypes.Data>,
|
|
80
|
+
size: { type: String as PropType<VxeFormPropTypes.Size>, default: () => globalConfigStore.form.size || globalConfigStore.size },
|
|
81
|
+
span: { type: [String, Number] as PropType<VxeFormPropTypes.Span>, default: () => globalConfigStore.form.span },
|
|
82
|
+
align: { type: String as PropType<VxeFormPropTypes.Align>, default: () => globalConfigStore.form.align },
|
|
83
|
+
titleAlign: { type: String as PropType<VxeFormPropTypes.TitleAlign>, default: () => globalConfigStore.form.titleAlign },
|
|
84
|
+
titleWidth: { type: [String, Number] as PropType<VxeFormPropTypes.TitleWidth>, default: () => globalConfigStore.form.titleWidth },
|
|
85
|
+
titleColon: { type: Boolean as PropType<VxeFormPropTypes.TitleColon>, default: () => globalConfigStore.form.titleColon },
|
|
86
|
+
titleAsterisk: { type: Boolean as PropType<VxeFormPropTypes.TitleAsterisk>, default: () => globalConfigStore.form.titleAsterisk },
|
|
87
|
+
titleOverflow: { type: [Boolean, String] as PropType<VxeFormPropTypes.TitleOverflow>, default: null },
|
|
88
|
+
vertical: {
|
|
89
|
+
type: Boolean as PropType<VxeFormPropTypes.Vertical>,
|
|
90
|
+
default: null
|
|
91
|
+
},
|
|
92
|
+
className: [String, Function] as PropType<VxeFormPropTypes.ClassName>,
|
|
93
|
+
readonly: Boolean as PropType<VxeFormPropTypes.Readonly>,
|
|
94
|
+
items: Array as PropType<VxeFormPropTypes.Items>,
|
|
95
|
+
rules: Object as PropType<VxeFormPropTypes.Rules>,
|
|
96
|
+
preventSubmit: { type: Boolean as PropType<VxeFormPropTypes.PreventSubmit>, default: () => globalConfigStore.form.preventSubmit },
|
|
97
|
+
validConfig: Object as PropType<VxeFormPropTypes.ValidConfig>,
|
|
98
|
+
tooltipConfig: Object as PropType<VxeFormPropTypes.TooltipConfig>,
|
|
99
|
+
customLayout: { type: Boolean as PropType<VxeFormPropTypes.CustomLayout>, default: () => globalConfigStore.form.customLayout }
|
|
100
|
+
},
|
|
101
|
+
emits: [
|
|
102
|
+
'update:collapseStatus',
|
|
103
|
+
'collapse',
|
|
104
|
+
'toggle-collapse',
|
|
105
|
+
'submit',
|
|
106
|
+
'submit-invalid',
|
|
107
|
+
'reset'
|
|
108
|
+
] as VxeFormEmits,
|
|
109
|
+
setup (props, context) {
|
|
110
|
+
const { slots, emit } = context
|
|
111
|
+
|
|
112
|
+
const xID = XEUtils.uniqueId()
|
|
113
|
+
|
|
114
|
+
const computeSize = useSize(props)
|
|
115
|
+
|
|
116
|
+
const reactData = reactive<FormReactData>({
|
|
117
|
+
collapseAll: props.collapseStatus,
|
|
118
|
+
staticItems: [],
|
|
119
|
+
formItems: []
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
const internalData = reactive<FormInternalData>({
|
|
123
|
+
tooltipTimeout: null,
|
|
124
|
+
tooltipStore: {
|
|
125
|
+
item: null,
|
|
126
|
+
visible: false
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
const $xegrid = inject<any>('$xegrid', null)
|
|
131
|
+
|
|
132
|
+
const refElem = ref<HTMLFormElement>()
|
|
133
|
+
const refTooltip = ref() as Ref<VxeTooltipInstance>
|
|
134
|
+
|
|
135
|
+
let formMethods = {} as FormMethods
|
|
136
|
+
|
|
137
|
+
const computeValidOpts = computed(() => {
|
|
138
|
+
return Object.assign({}, globalConfigStore.form.validConfig, props.validConfig)
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
const computeTooltipOpts = computed(() => {
|
|
142
|
+
return Object.assign({}, globalConfigStore.tooltip, globalConfigStore.form.tooltipConfig, props.tooltipConfig)
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
const refMaps: FormPrivateRef = {
|
|
146
|
+
refElem
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const computeMaps: VxeFormPrivateComputed = {
|
|
150
|
+
computeSize,
|
|
151
|
+
computeValidOpts,
|
|
152
|
+
computeTooltipOpts
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const $xeform = {
|
|
156
|
+
xID,
|
|
157
|
+
props,
|
|
158
|
+
context,
|
|
159
|
+
reactData,
|
|
160
|
+
|
|
161
|
+
xegrid: $xegrid,
|
|
162
|
+
getRefMaps: () => refMaps,
|
|
163
|
+
getComputeMaps: () => computeMaps
|
|
164
|
+
} as unknown as VxeFormConstructor & VxeFormPrivateMethods
|
|
165
|
+
|
|
166
|
+
const callSlot = (slotFunc: ((params: any) => any) | string | null, params: any) => {
|
|
167
|
+
if (slotFunc) {
|
|
168
|
+
if (XEUtils.isString(slotFunc)) {
|
|
169
|
+
slotFunc = slots[slotFunc] || null
|
|
170
|
+
}
|
|
171
|
+
if (XEUtils.isFunction(slotFunc)) {
|
|
172
|
+
return getSlotVNs(slotFunc(params))
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return []
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const loadItem = (list: VxeFormPropTypes.Items) => {
|
|
179
|
+
if (list.length) {
|
|
180
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
181
|
+
list.forEach((item) => {
|
|
182
|
+
if (item.slots) {
|
|
183
|
+
XEUtils.each(item.slots, (func) => {
|
|
184
|
+
if (!XEUtils.isFunction(func)) {
|
|
185
|
+
if (!slots[func]) {
|
|
186
|
+
errLog('vxe.error.notSlot', [func])
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
reactData.staticItems = XEUtils.mapTree(list, item => createItem($xeform, item), { children: 'children' })
|
|
194
|
+
}
|
|
195
|
+
return nextTick()
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const getItems = () => {
|
|
199
|
+
const itemList: VxeFormDefines.ItemInfo[] = []
|
|
200
|
+
XEUtils.eachTree(reactData.formItems, item => {
|
|
201
|
+
itemList.push(item)
|
|
202
|
+
}, { children: 'children' })
|
|
203
|
+
return itemList
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const getItemByField = (field: string) => {
|
|
207
|
+
const rest = XEUtils.findTree(reactData.formItems, item => item.field === field, { children: 'children' })
|
|
208
|
+
return rest ? rest.item : null
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const getCollapseStatus = () => {
|
|
212
|
+
return reactData.collapseAll
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const toggleCollapse = () => {
|
|
216
|
+
const status = !getCollapseStatus()
|
|
217
|
+
reactData.collapseAll = status
|
|
218
|
+
emit('update:collapseStatus', status)
|
|
219
|
+
return nextTick()
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const toggleCollapseEvent = (evnt: Event) => {
|
|
223
|
+
toggleCollapse()
|
|
224
|
+
const status = getCollapseStatus()
|
|
225
|
+
formMethods.dispatchEvent('toggle-collapse', { status, collapse: status, data: props.data }, evnt)
|
|
226
|
+
formMethods.dispatchEvent('collapse', { status, collapse: status, data: props.data }, evnt)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const clearValidate = (fieldOrItem?: VxeFormItemPropTypes.Field | VxeFormItemPropTypes.Field[] | VxeFormDefines.ItemInfo | VxeFormDefines.ItemInfo[]) => {
|
|
230
|
+
if (fieldOrItem) {
|
|
231
|
+
let fields: any = fieldOrItem
|
|
232
|
+
if (!XEUtils.isArray(fieldOrItem)) {
|
|
233
|
+
fields = [fieldOrItem]
|
|
234
|
+
}
|
|
235
|
+
fields.forEach((field: any) => {
|
|
236
|
+
if (field) {
|
|
237
|
+
const item = handleFieldOrItem($xeform, field)
|
|
238
|
+
if (item) {
|
|
239
|
+
item.showError = false
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
})
|
|
243
|
+
} else {
|
|
244
|
+
getItems().forEach((item) => {
|
|
245
|
+
item.showError = false
|
|
246
|
+
})
|
|
247
|
+
}
|
|
248
|
+
return nextTick()
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const reset = () => {
|
|
252
|
+
const { data } = props
|
|
253
|
+
const itemList = getItems()
|
|
254
|
+
if (data) {
|
|
255
|
+
itemList.forEach((item) => {
|
|
256
|
+
const { field, resetValue, itemRender } = item
|
|
257
|
+
if (isEnableConf(itemRender)) {
|
|
258
|
+
const compConf = renderer.get(itemRender.name)
|
|
259
|
+
if (compConf && compConf.itemResetMethod) {
|
|
260
|
+
compConf.itemResetMethod({ data, field, property: field, item, $form: $xeform, $grid: $xeform.xegrid })
|
|
261
|
+
} else if (field) {
|
|
262
|
+
XEUtils.set(data, field, resetValue === null ? getResetValue(XEUtils.get(data, field), undefined) : XEUtils.clone(resetValue, true))
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
})
|
|
266
|
+
}
|
|
267
|
+
return clearValidate()
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const resetEvent = (evnt: Event) => {
|
|
271
|
+
evnt.preventDefault()
|
|
272
|
+
reset()
|
|
273
|
+
formMethods.dispatchEvent('reset', { data: props.data }, evnt)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const handleFocus = (fields: string[]) => {
|
|
277
|
+
const el = refElem.value
|
|
278
|
+
if (el) {
|
|
279
|
+
for (let i = 0; i < fields.length; i++) {
|
|
280
|
+
const property = fields[i]
|
|
281
|
+
const item = getItemByField(property)
|
|
282
|
+
if (item && isEnableConf(item.itemRender)) {
|
|
283
|
+
const { itemRender } = item
|
|
284
|
+
const compConf = renderer.get(itemRender.name)
|
|
285
|
+
let inputElem: HTMLInputElement | null = null
|
|
286
|
+
// 定位到第一个
|
|
287
|
+
if (!i) {
|
|
288
|
+
scrollToView(el.querySelector(`.${item.id}`))
|
|
289
|
+
}
|
|
290
|
+
// 如果指定了聚焦 class
|
|
291
|
+
if (itemRender.autofocus) {
|
|
292
|
+
inputElem = el.querySelector(`.${item.id} ${itemRender.autofocus}`) as HTMLInputElement
|
|
293
|
+
}
|
|
294
|
+
// 渲染器的聚焦处理
|
|
295
|
+
if (!inputElem && compConf && compConf.autofocus) {
|
|
296
|
+
inputElem = el.querySelector(`.${item.id} ${compConf.autofocus}`) as HTMLInputElement
|
|
297
|
+
}
|
|
298
|
+
if (inputElem) {
|
|
299
|
+
inputElem.focus()
|
|
300
|
+
break
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* 校验数据
|
|
309
|
+
* 按表格行、列顺序依次校验(同步或异步)
|
|
310
|
+
* 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
|
|
311
|
+
* 如果校验失败则,触发回调或者 Promise<(ErrMap 校验不通过列的信息)>
|
|
312
|
+
* 如果是传回调方式这返回一个 (ErrMap 校验不通过列的信息)
|
|
313
|
+
*
|
|
314
|
+
* rule 配置:
|
|
315
|
+
* required=Boolean 是否必填
|
|
316
|
+
* min=Number 最小长度
|
|
317
|
+
* max=Number 最大长度
|
|
318
|
+
* validator=Function({ itemValue, rule, rules, data, property }) 自定义校验,接收一个 Promise
|
|
319
|
+
* trigger=change 触发方式
|
|
320
|
+
*/
|
|
321
|
+
const validItemRules = (validType: string, fields: string | string[], val?: any): Promise<VxeFormDefines.ValidateErrorMapParams | undefined> => {
|
|
322
|
+
const { data, rules: formRules } = props
|
|
323
|
+
const errorMaps: VxeFormDefines.ValidateErrorMapParams = {}
|
|
324
|
+
if (!XEUtils.isArray(fields)) {
|
|
325
|
+
fields = [fields]
|
|
326
|
+
}
|
|
327
|
+
return Promise.all(
|
|
328
|
+
fields.map((property) => {
|
|
329
|
+
const errorRules: Rule[] = []
|
|
330
|
+
const syncVailds: Promise<any>[] = []
|
|
331
|
+
if (property && formRules) {
|
|
332
|
+
const rules = XEUtils.get(formRules, property)
|
|
333
|
+
if (rules) {
|
|
334
|
+
const itemValue = XEUtils.isUndefined(val) ? XEUtils.get(data, property) : val
|
|
335
|
+
rules.forEach((rule) => {
|
|
336
|
+
const { type, trigger, required, validator } = rule
|
|
337
|
+
if (validType === 'all' || !trigger || validType === trigger) {
|
|
338
|
+
if (validator) {
|
|
339
|
+
const validParams = {
|
|
340
|
+
itemValue,
|
|
341
|
+
rule,
|
|
342
|
+
rules,
|
|
343
|
+
data,
|
|
344
|
+
field: property,
|
|
345
|
+
property,
|
|
346
|
+
$form: $xeform
|
|
347
|
+
}
|
|
348
|
+
let customValid: any
|
|
349
|
+
if (XEUtils.isString(validator)) {
|
|
350
|
+
const gvItem = validators.get(validator)
|
|
351
|
+
if (gvItem) {
|
|
352
|
+
if (gvItem.itemValidatorMethod) {
|
|
353
|
+
customValid = gvItem.itemValidatorMethod(validParams)
|
|
354
|
+
} else {
|
|
355
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
356
|
+
warnLog('vxe.error.notValidators', [validator])
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
} else {
|
|
360
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
361
|
+
errLog('vxe.error.notValidators', [validator])
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
} else {
|
|
365
|
+
customValid = validator(validParams)
|
|
366
|
+
}
|
|
367
|
+
if (customValid) {
|
|
368
|
+
if (XEUtils.isError(customValid)) {
|
|
369
|
+
errorRules.push(new Rule({ type: 'custom', trigger, content: customValid.message, rule: new Rule(rule) }))
|
|
370
|
+
} else if (customValid.catch) {
|
|
371
|
+
// 如果为异步校验(注:异步校验是并发无序的)
|
|
372
|
+
syncVailds.push(
|
|
373
|
+
customValid.catch((e: any) => {
|
|
374
|
+
errorRules.push(new Rule({ type: 'custom', trigger, content: e ? e.message : (rule.content || rule.message), rule: new Rule(rule) }))
|
|
375
|
+
})
|
|
376
|
+
)
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
} else {
|
|
380
|
+
const isArrType = type === 'array'
|
|
381
|
+
const isArrVal = XEUtils.isArray(itemValue)
|
|
382
|
+
let hasEmpty = true
|
|
383
|
+
if (isArrType || isArrVal) {
|
|
384
|
+
hasEmpty = !isArrVal || !itemValue.length
|
|
385
|
+
} else if (XEUtils.isString(itemValue)) {
|
|
386
|
+
hasEmpty = eqEmptyValue(itemValue.trim())
|
|
387
|
+
} else {
|
|
388
|
+
hasEmpty = eqEmptyValue(itemValue)
|
|
389
|
+
}
|
|
390
|
+
if (required ? (hasEmpty || validErrorRuleValue(rule, itemValue)) : (!hasEmpty && validErrorRuleValue(rule, itemValue))) {
|
|
391
|
+
errorRules.push(new Rule(rule))
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
})
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return Promise.all(syncVailds).then(() => {
|
|
399
|
+
if (errorRules.length) {
|
|
400
|
+
errorMaps[property] = errorRules.map(rule => {
|
|
401
|
+
return {
|
|
402
|
+
$form: $xeform,
|
|
403
|
+
rule,
|
|
404
|
+
data,
|
|
405
|
+
field: property,
|
|
406
|
+
property
|
|
407
|
+
}
|
|
408
|
+
})
|
|
409
|
+
}
|
|
410
|
+
})
|
|
411
|
+
})
|
|
412
|
+
).then(() => {
|
|
413
|
+
if (!XEUtils.isEmpty(errorMaps)) {
|
|
414
|
+
return Promise.reject(errorMaps)
|
|
415
|
+
}
|
|
416
|
+
})
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
let showErrTime: number
|
|
420
|
+
|
|
421
|
+
const beginValidate = (itemList: VxeFormDefines.ItemInfo[], type?: string, callback?: any): Promise<any> => {
|
|
422
|
+
const { data, rules: formRules } = props
|
|
423
|
+
const validOpts = computeValidOpts.value
|
|
424
|
+
const validRest: any = {}
|
|
425
|
+
const validFields: string[] = []
|
|
426
|
+
const itemValids: any[] = []
|
|
427
|
+
clearTimeout(showErrTime)
|
|
428
|
+
if (data && formRules) {
|
|
429
|
+
itemList.forEach((item) => {
|
|
430
|
+
const { field } = item
|
|
431
|
+
if (field && !isHiddenItem($xeform, item) && isActivetem($xeform, item)) {
|
|
432
|
+
itemValids.push(
|
|
433
|
+
validItemRules(type || 'all', field).then(() => {
|
|
434
|
+
item.errRule = null
|
|
435
|
+
}).catch((errorMaps: VxeFormDefines.ValidateErrorMapParams) => {
|
|
436
|
+
const rest = errorMaps[field]
|
|
437
|
+
if (!validRest[field]) {
|
|
438
|
+
validRest[field] = []
|
|
439
|
+
}
|
|
440
|
+
validRest[field].push(rest)
|
|
441
|
+
validFields.push(field)
|
|
442
|
+
item.errRule = rest[0].rule
|
|
443
|
+
return Promise.reject(rest)
|
|
444
|
+
})
|
|
445
|
+
)
|
|
446
|
+
}
|
|
447
|
+
})
|
|
448
|
+
return Promise.all(itemValids).then(() => {
|
|
449
|
+
if (callback) {
|
|
450
|
+
callback()
|
|
451
|
+
}
|
|
452
|
+
}).catch(() => {
|
|
453
|
+
return new Promise<void>((resolve) => {
|
|
454
|
+
showErrTime = window.setTimeout(() => {
|
|
455
|
+
itemList.forEach((item) => {
|
|
456
|
+
if (item.errRule) {
|
|
457
|
+
item.showError = true
|
|
458
|
+
}
|
|
459
|
+
})
|
|
460
|
+
}, 20)
|
|
461
|
+
if (validOpts.autoPos !== false) {
|
|
462
|
+
nextTick(() => {
|
|
463
|
+
handleFocus(validFields)
|
|
464
|
+
})
|
|
465
|
+
}
|
|
466
|
+
if (callback) {
|
|
467
|
+
callback(validRest)
|
|
468
|
+
resolve()
|
|
469
|
+
} else {
|
|
470
|
+
resolve(validRest)
|
|
471
|
+
}
|
|
472
|
+
})
|
|
473
|
+
})
|
|
474
|
+
}
|
|
475
|
+
if (callback) {
|
|
476
|
+
callback()
|
|
477
|
+
}
|
|
478
|
+
return Promise.resolve()
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
const validate = (callback: any) => {
|
|
482
|
+
clearValidate()
|
|
483
|
+
return beginValidate(getItems(), '', callback)
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const validateField = (fieldOrItem: VxeFormItemPropTypes.Field | VxeFormItemPropTypes.Field[] | VxeFormDefines.ItemInfo | VxeFormDefines.ItemInfo[], callback: any) => {
|
|
487
|
+
let fields: any[] = []
|
|
488
|
+
if (XEUtils.isArray(fieldOrItem)) {
|
|
489
|
+
fields = fieldOrItem
|
|
490
|
+
} else {
|
|
491
|
+
fields = [fieldOrItem]
|
|
492
|
+
}
|
|
493
|
+
return beginValidate(fields.map(field => handleFieldOrItem($xeform, field) as VxeFormDefines.ItemInfo), '', callback)
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const submitEvent = (evnt: Event) => {
|
|
497
|
+
evnt.preventDefault()
|
|
498
|
+
if (!props.preventSubmit) {
|
|
499
|
+
clearValidate()
|
|
500
|
+
beginValidate(getItems()).then((errMap) => {
|
|
501
|
+
if (errMap) {
|
|
502
|
+
formMethods.dispatchEvent('submit-invalid', { data: props.data, errMap }, evnt)
|
|
503
|
+
} else {
|
|
504
|
+
formMethods.dispatchEvent('submit', { data: props.data }, evnt)
|
|
505
|
+
}
|
|
506
|
+
})
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
const closeTooltip = () => {
|
|
511
|
+
const { tooltipStore } = internalData
|
|
512
|
+
const $tooltip = refTooltip.value
|
|
513
|
+
if (tooltipStore.visible) {
|
|
514
|
+
Object.assign(tooltipStore, {
|
|
515
|
+
item: null,
|
|
516
|
+
visible: false
|
|
517
|
+
})
|
|
518
|
+
if ($tooltip) {
|
|
519
|
+
$tooltip.close()
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return nextTick()
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
const triggerTitleTipEvent = (evnt: MouseEvent, params: {
|
|
526
|
+
item: VxeFormDefines.ItemInfo;
|
|
527
|
+
}) => {
|
|
528
|
+
const { item } = params
|
|
529
|
+
const { tooltipStore } = internalData
|
|
530
|
+
const $tooltip = refTooltip.value
|
|
531
|
+
const overflowElem = (evnt.currentTarget as HTMLDivElement).children[0]
|
|
532
|
+
const content = (overflowElem.textContent || '').trim()
|
|
533
|
+
const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth
|
|
534
|
+
clearTimeout(internalData.tooltipTimeout)
|
|
535
|
+
if (tooltipStore.item !== item) {
|
|
536
|
+
closeTooltip()
|
|
537
|
+
}
|
|
538
|
+
if (content && isCellOverflow) {
|
|
539
|
+
Object.assign(tooltipStore, {
|
|
540
|
+
item,
|
|
541
|
+
visible: true
|
|
542
|
+
})
|
|
543
|
+
if ($tooltip) {
|
|
544
|
+
$tooltip.open(overflowElem, content)
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const handleTitleTipLeaveEvent = () => {
|
|
550
|
+
const tooltipOpts = computeTooltipOpts.value
|
|
551
|
+
let $tooltip = refTooltip.value
|
|
552
|
+
if ($tooltip) {
|
|
553
|
+
$tooltip.setActived(false)
|
|
554
|
+
}
|
|
555
|
+
if (tooltipOpts.enterable) {
|
|
556
|
+
internalData.tooltipTimeout = setTimeout(() => {
|
|
557
|
+
$tooltip = refTooltip.value
|
|
558
|
+
if ($tooltip && !$tooltip.isActived()) {
|
|
559
|
+
closeTooltip()
|
|
560
|
+
}
|
|
561
|
+
}, tooltipOpts.leaveDelay)
|
|
562
|
+
} else {
|
|
563
|
+
closeTooltip()
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
const triggerItemEvent = (evnt: Event, field: string, itemValue?: any) => {
|
|
568
|
+
if (field) {
|
|
569
|
+
return validItemRules(evnt ? (['blur'].includes(evnt.type) ? 'blur' : 'change') : 'all', field, itemValue)
|
|
570
|
+
.then(() => {
|
|
571
|
+
clearValidate(field)
|
|
572
|
+
})
|
|
573
|
+
.catch((errorMaps: VxeFormDefines.ValidateErrorMapParams) => {
|
|
574
|
+
const rest = errorMaps[field]
|
|
575
|
+
const item = getItemByField(field)
|
|
576
|
+
if (rest && item) {
|
|
577
|
+
item.showError = true
|
|
578
|
+
item.errRule = rest[0].rule
|
|
579
|
+
}
|
|
580
|
+
})
|
|
581
|
+
}
|
|
582
|
+
return nextTick()
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* 更新项状态
|
|
587
|
+
* 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
|
|
588
|
+
* 如果单元格配置了校验规则,则会进行校验
|
|
589
|
+
*/
|
|
590
|
+
const updateStatus = (scope: any, itemValue?: any) => {
|
|
591
|
+
const { field } = scope
|
|
592
|
+
return triggerItemEvent(new Event('change'), field, itemValue)
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
formMethods = {
|
|
596
|
+
dispatchEvent (type, params, evnt) {
|
|
597
|
+
emit(type, Object.assign({ $form: $xeform, $grid: $xegrid, $event: evnt }, params))
|
|
598
|
+
},
|
|
599
|
+
reset,
|
|
600
|
+
validate,
|
|
601
|
+
validateField,
|
|
602
|
+
clearValidate,
|
|
603
|
+
updateStatus,
|
|
604
|
+
toggleCollapse,
|
|
605
|
+
getItems,
|
|
606
|
+
getItemByField,
|
|
607
|
+
closeTooltip
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
const formPrivateMethods: VxeFormPrivateMethods = {
|
|
611
|
+
callSlot,
|
|
612
|
+
triggerItemEvent,
|
|
613
|
+
toggleCollapseEvent,
|
|
614
|
+
triggerTitleTipEvent,
|
|
615
|
+
handleTitleTipLeaveEvent
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
Object.assign($xeform, formMethods, formPrivateMethods)
|
|
619
|
+
|
|
620
|
+
const staticItemFlag = ref(0)
|
|
621
|
+
watch(() => reactData.staticItems.length, () => {
|
|
622
|
+
staticItemFlag.value++
|
|
623
|
+
})
|
|
624
|
+
watch(() => reactData.staticItems, () => {
|
|
625
|
+
staticItemFlag.value++
|
|
626
|
+
})
|
|
627
|
+
watch(staticItemFlag, () => {
|
|
628
|
+
reactData.formItems = reactData.staticItems
|
|
629
|
+
})
|
|
630
|
+
|
|
631
|
+
const itemFlag = ref(0)
|
|
632
|
+
watch(() => props.items ? props.items.length : -1, () => {
|
|
633
|
+
itemFlag.value++
|
|
634
|
+
})
|
|
635
|
+
watch(() => props.items, () => {
|
|
636
|
+
itemFlag.value++
|
|
637
|
+
})
|
|
638
|
+
watch(itemFlag, () => {
|
|
639
|
+
loadItem(props.items || [])
|
|
640
|
+
})
|
|
641
|
+
|
|
642
|
+
watch(() => props.collapseStatus, (value) => {
|
|
643
|
+
reactData.collapseAll = !!value
|
|
644
|
+
})
|
|
645
|
+
|
|
646
|
+
onMounted(() => {
|
|
647
|
+
nextTick(() => {
|
|
648
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
649
|
+
if (props.customLayout && props.items) {
|
|
650
|
+
errLog('vxe.error.errConflicts', ['custom-layout', 'items'])
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
loadItem(props.items || [])
|
|
654
|
+
})
|
|
655
|
+
})
|
|
656
|
+
|
|
657
|
+
const renderVN = () => {
|
|
658
|
+
const { loading, className, data, customLayout } = props
|
|
659
|
+
const { formItems } = reactData
|
|
660
|
+
// const formItems: any[] = []
|
|
661
|
+
const vSize = computeSize.value
|
|
662
|
+
const tooltipOpts = computeTooltipOpts.value
|
|
663
|
+
const defaultSlot = slots.default
|
|
664
|
+
return h('form', {
|
|
665
|
+
ref: refElem,
|
|
666
|
+
class: ['vxe-form', className ? (XEUtils.isFunction(className) ? className({ items: formItems, data, $form: $xeform }) : className) : '', {
|
|
667
|
+
[`size--${vSize}`]: vSize,
|
|
668
|
+
'is--loading': loading
|
|
669
|
+
}],
|
|
670
|
+
onSubmit: submitEvent,
|
|
671
|
+
onReset: resetEvent
|
|
672
|
+
}, [
|
|
673
|
+
h('div', {
|
|
674
|
+
class: 'vxe-form--wrapper vxe-row'
|
|
675
|
+
}, customLayout
|
|
676
|
+
? (defaultSlot ? defaultSlot({}) : [])
|
|
677
|
+
: formItems.map((item, index) => {
|
|
678
|
+
return h(VxeFormConfigItem, {
|
|
679
|
+
key: index,
|
|
680
|
+
itemConfig: item
|
|
681
|
+
})
|
|
682
|
+
})),
|
|
683
|
+
h('div', {
|
|
684
|
+
class: 'vxe-form-slots',
|
|
685
|
+
ref: 'hideItem'
|
|
686
|
+
}, customLayout ? [] : (defaultSlot ? defaultSlot({}) : [])),
|
|
687
|
+
/**
|
|
688
|
+
* 加载中
|
|
689
|
+
*/
|
|
690
|
+
h(VxeLoading, {
|
|
691
|
+
class: 'vxe-form--loading',
|
|
692
|
+
modelValue: loading
|
|
693
|
+
}),
|
|
694
|
+
/**
|
|
695
|
+
* 工具提示
|
|
696
|
+
*/
|
|
697
|
+
h(VxeTooltipComponent, {
|
|
698
|
+
ref: refTooltip,
|
|
699
|
+
...tooltipOpts
|
|
700
|
+
})
|
|
701
|
+
])
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
$xeform.renderVN = renderVN
|
|
705
|
+
|
|
706
|
+
provide('$xeForm', $xeform)
|
|
707
|
+
provide('$xeformgather', null)
|
|
708
|
+
provide('$xeformitem', null)
|
|
709
|
+
provide('$xeFormItemInfo', null)
|
|
710
|
+
|
|
711
|
+
return $xeform
|
|
712
|
+
},
|
|
713
|
+
render () {
|
|
714
|
+
return this.renderVN()
|
|
715
|
+
}
|
|
716
|
+
})
|