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,43 @@
|
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
|
|
3
|
+
export class ItemInfo {
|
|
4
|
+
constructor ($xeform: any, item: any) {
|
|
5
|
+
Object.assign(this, {
|
|
6
|
+
id: XEUtils.uniqueId('item_'),
|
|
7
|
+
title: item.title,
|
|
8
|
+
field: item.field,
|
|
9
|
+
span: item.span,
|
|
10
|
+
align: item.align,
|
|
11
|
+
titleAlign: item.titleAlign,
|
|
12
|
+
titleWidth: item.titleWidth,
|
|
13
|
+
titleColon: item.titleColon,
|
|
14
|
+
titleAsterisk: item.titleAsterisk,
|
|
15
|
+
titlePrefix: item.titlePrefix,
|
|
16
|
+
titleSuffix: item.titleSuffix,
|
|
17
|
+
titleOverflow: item.titleOverflow,
|
|
18
|
+
showTitle: item.showTitle,
|
|
19
|
+
resetValue: item.resetValue,
|
|
20
|
+
visibleMethod: item.visibleMethod,
|
|
21
|
+
visible: item.visible,
|
|
22
|
+
folding: item.folding,
|
|
23
|
+
collapseNode: item.collapseNode,
|
|
24
|
+
className: item.className,
|
|
25
|
+
contentClassName: item.contentClassName,
|
|
26
|
+
contentStyle: item.contentStyle,
|
|
27
|
+
titleClassName: item.titleClassName,
|
|
28
|
+
titleStyle: item.titleStyle,
|
|
29
|
+
itemRender: item.itemRender,
|
|
30
|
+
// 渲染属性
|
|
31
|
+
showError: false,
|
|
32
|
+
errRule: null,
|
|
33
|
+
slots: item.slots,
|
|
34
|
+
children: []
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
update (name: string, value: any) {
|
|
39
|
+
this[name] = value
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { h } from 'vue'
|
|
2
|
+
import iconConfigStore from '../../ui/src/iconStore'
|
|
3
|
+
import VxeTooltipComponent from '../../tooltip'
|
|
4
|
+
import { renderer } from '../../ui/src/renderer'
|
|
5
|
+
import { getFuncText, isEnableConf } from '../../ui/src/utils'
|
|
6
|
+
import { getSlotVNs } from '../../ui/src/vn'
|
|
7
|
+
|
|
8
|
+
import { VxeFormConstructor, VxeFormDefines, VxeFormItemPropTypes, VxeFormPrivateMethods } from '../../../types'
|
|
9
|
+
|
|
10
|
+
function renderPrefixIcon (titlePrefix: VxeFormItemPropTypes.TitlePrefix) {
|
|
11
|
+
return h('span', {
|
|
12
|
+
class: 'vxe-form--item-title-prefix'
|
|
13
|
+
}, [
|
|
14
|
+
h('i', {
|
|
15
|
+
class: titlePrefix.icon || iconConfigStore.FORM_PREFIX
|
|
16
|
+
})
|
|
17
|
+
])
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function renderSuffixIcon (titleSuffix: VxeFormItemPropTypes.TitleSuffix) {
|
|
21
|
+
return h('span', {
|
|
22
|
+
class: 'vxe-form--item-title-suffix'
|
|
23
|
+
}, [
|
|
24
|
+
h('i', {
|
|
25
|
+
class: titleSuffix.icon || iconConfigStore.FORM_SUFFIX
|
|
26
|
+
})
|
|
27
|
+
])
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function renderTitle ($xeform: VxeFormConstructor & VxeFormPrivateMethods, item: VxeFormDefines.ItemInfo) {
|
|
31
|
+
const { data } = $xeform.props
|
|
32
|
+
const { computeTooltipOpts } = $xeform.getComputeMaps()
|
|
33
|
+
const { slots, field, itemRender, titlePrefix, titleSuffix } = item
|
|
34
|
+
const tooltipOpts = computeTooltipOpts.value
|
|
35
|
+
const compConf = isEnableConf(itemRender) ? renderer.get(itemRender.name) : null
|
|
36
|
+
const params = { data, field, property: field, item, $form: $xeform, $grid: $xeform.xegrid }
|
|
37
|
+
const titleSlot = slots ? slots.title : null
|
|
38
|
+
const contVNs = []
|
|
39
|
+
const titVNs = []
|
|
40
|
+
if (titlePrefix) {
|
|
41
|
+
titVNs.push(
|
|
42
|
+
(titlePrefix.content || titlePrefix.message)
|
|
43
|
+
? h(VxeTooltipComponent, {
|
|
44
|
+
...tooltipOpts,
|
|
45
|
+
...titlePrefix,
|
|
46
|
+
content: getFuncText(titlePrefix.content || titlePrefix.message)
|
|
47
|
+
}, {
|
|
48
|
+
default: () => renderPrefixIcon(titlePrefix)
|
|
49
|
+
})
|
|
50
|
+
: renderPrefixIcon(titlePrefix)
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
titVNs.push(
|
|
54
|
+
h('span', {
|
|
55
|
+
class: 'vxe-form--item-title-label'
|
|
56
|
+
}, compConf && compConf.renderItemTitle ? getSlotVNs(compConf.renderItemTitle(itemRender, params)) : (titleSlot ? $xeform.callSlot(titleSlot, params) : getFuncText(item.title)))
|
|
57
|
+
)
|
|
58
|
+
contVNs.push(
|
|
59
|
+
h('div', {
|
|
60
|
+
class: 'vxe-form--item-title-content'
|
|
61
|
+
}, titVNs)
|
|
62
|
+
)
|
|
63
|
+
const fixVNs = []
|
|
64
|
+
if (titleSuffix) {
|
|
65
|
+
fixVNs.push(
|
|
66
|
+
(titleSuffix.content || titleSuffix.message)
|
|
67
|
+
? h(VxeTooltipComponent, {
|
|
68
|
+
...tooltipOpts,
|
|
69
|
+
...titleSuffix,
|
|
70
|
+
content: getFuncText(titleSuffix.content || titleSuffix.message)
|
|
71
|
+
}, {
|
|
72
|
+
default: () => renderSuffixIcon(titleSuffix)
|
|
73
|
+
})
|
|
74
|
+
: renderSuffixIcon(titleSuffix)
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
contVNs.push(
|
|
78
|
+
h('div', {
|
|
79
|
+
class: 'vxe-form--item-title-postfix'
|
|
80
|
+
}, fixVNs)
|
|
81
|
+
)
|
|
82
|
+
return contVNs
|
|
83
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { watch } from 'vue'
|
|
2
|
+
import { renderer } from '../../ui/src/renderer'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
4
|
+
import { ItemInfo } from './itemInfo'
|
|
5
|
+
import { isEnableConf } from '../../ui/src/utils'
|
|
6
|
+
|
|
7
|
+
import { VxeFormConstructor, VxeFormDefines } from '../../../types'
|
|
8
|
+
|
|
9
|
+
export interface XEFormItemProvide {
|
|
10
|
+
formItem: ItemInfo;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isFormItem (item: any): item is ItemInfo {
|
|
14
|
+
return item instanceof ItemInfo
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function createItem ($xeform: VxeFormConstructor, _vm: any) {
|
|
18
|
+
return isFormItem(_vm) ? _vm : new ItemInfo($xeform, _vm)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function handleFieldOrItem ($xeform: VxeFormConstructor, fieldOrItem: string | VxeFormDefines.ItemInfo) {
|
|
22
|
+
if (fieldOrItem) {
|
|
23
|
+
return XEUtils.isString(fieldOrItem) ? $xeform.getItemByField(fieldOrItem) : fieldOrItem
|
|
24
|
+
}
|
|
25
|
+
return null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function isHiddenItem ($xeform: VxeFormConstructor, formItem: VxeFormDefines.ItemInfo) {
|
|
29
|
+
const { reactData } = $xeform
|
|
30
|
+
const { collapseAll } = reactData
|
|
31
|
+
const { folding, visible } = formItem
|
|
32
|
+
return visible === false || (folding && collapseAll)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function isActivetem ($xeform: VxeFormConstructor, formItem: VxeFormDefines.ItemInfo) {
|
|
36
|
+
let { visibleMethod, itemRender, visible, field } = formItem
|
|
37
|
+
if (visible === false) {
|
|
38
|
+
return visible
|
|
39
|
+
}
|
|
40
|
+
const compConf = isEnableConf(itemRender) ? renderer.get(itemRender.name) : null
|
|
41
|
+
if (!visibleMethod && compConf && compConf.itemVisibleMethod) {
|
|
42
|
+
visibleMethod = compConf.itemVisibleMethod
|
|
43
|
+
}
|
|
44
|
+
if (!visibleMethod) {
|
|
45
|
+
return true
|
|
46
|
+
}
|
|
47
|
+
const { data } = $xeform.props
|
|
48
|
+
return visibleMethod({ data, field, property: field, item: formItem, $form: $xeform, $grid: $xeform.xegrid })
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function watchItem (props: any, formItem: ItemInfo) {
|
|
52
|
+
Object.keys(props).forEach(name => {
|
|
53
|
+
watch(() => props[name], (value: any) => {
|
|
54
|
+
formItem.update(name, value)
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function assemItem ($xeform: VxeFormConstructor, el: HTMLDivElement, formItem: ItemInfo, formGather: XEFormItemProvide | null) {
|
|
60
|
+
const { reactData } = $xeform
|
|
61
|
+
const { staticItems } = reactData
|
|
62
|
+
const parentElem = el.parentNode
|
|
63
|
+
const parentItem = formGather ? formGather.formItem : null
|
|
64
|
+
const parentItems = parentItem ? parentItem.children : staticItems
|
|
65
|
+
if (parentElem) {
|
|
66
|
+
parentItems.splice(XEUtils.arrayIndexOf(parentElem.children, el), 0, formItem)
|
|
67
|
+
reactData.staticItems = staticItems.slice(0)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function destroyItem ($xeform: VxeFormConstructor, formItem: ItemInfo) {
|
|
72
|
+
const { reactData } = $xeform
|
|
73
|
+
const { staticItems } = reactData
|
|
74
|
+
const index = XEUtils.findIndexOf(staticItems, item => item.id === formItem.id)
|
|
75
|
+
if (index > -1) {
|
|
76
|
+
staticItems.splice(index, 1)
|
|
77
|
+
}
|
|
78
|
+
reactData.staticItems = staticItems.slice(0)
|
|
79
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeFormDesignComponent from './src/form-design'
|
|
3
|
+
|
|
4
|
+
const VxeFormDesign = Object.assign({}, VxeFormDesignComponent, {
|
|
5
|
+
install (app: App) {
|
|
6
|
+
app.component(VxeFormDesignComponent.name as string, VxeFormDesignComponent)
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const FormDesign = VxeFormDesign
|
|
11
|
+
export default VxeFormDesign
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { defineComponent, ref, h, PropType, reactive, provide, watch } from 'vue'
|
|
2
|
+
import globalConfigStore from '../../ui/src/globalStore'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
4
|
+
import WidgetComponent from './widget'
|
|
5
|
+
import ViewComponent from './view'
|
|
6
|
+
import SettingComponent from './setting'
|
|
7
|
+
|
|
8
|
+
import { VxeFormDesignDefines, VxeFormDesignPropTypes, FormDesignReactData, FormDesignPrivateRef, VxeFormDesignPrivateComputed, VxeFormDesignConstructor, VxeFormDesignPrivateMethods, FormDesignMethods, FormDesignPrivateMethods } from '../../../types'
|
|
9
|
+
|
|
10
|
+
export default defineComponent({
|
|
11
|
+
name: 'VxeFormDesign',
|
|
12
|
+
props: {
|
|
13
|
+
size: {
|
|
14
|
+
type: String as PropType<VxeFormDesignPropTypes.Size>,
|
|
15
|
+
default: () => globalConfigStore.formDesign.size
|
|
16
|
+
},
|
|
17
|
+
widgets: {
|
|
18
|
+
type: Array as PropType<VxeFormDesignPropTypes.Widgets>,
|
|
19
|
+
default: () => []
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
emits: [],
|
|
23
|
+
setup (props, context) {
|
|
24
|
+
const { emit } = context
|
|
25
|
+
|
|
26
|
+
const xID = XEUtils.uniqueId()
|
|
27
|
+
|
|
28
|
+
const refElem = ref<HTMLDivElement>()
|
|
29
|
+
|
|
30
|
+
const reactData = reactive<FormDesignReactData>({
|
|
31
|
+
widgetConfigs: [],
|
|
32
|
+
widgetObjList: [],
|
|
33
|
+
dragWidget: null,
|
|
34
|
+
sortWidget: null,
|
|
35
|
+
activeWidget: null
|
|
36
|
+
});
|
|
37
|
+
(window as any).reactData = reactData
|
|
38
|
+
const refMaps: FormDesignPrivateRef = {
|
|
39
|
+
refElem
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const computeMaps: VxeFormDesignPrivateComputed = {
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const $xeFormDesign = {
|
|
46
|
+
xID,
|
|
47
|
+
props,
|
|
48
|
+
context,
|
|
49
|
+
reactData,
|
|
50
|
+
|
|
51
|
+
getRefMaps: () => refMaps,
|
|
52
|
+
getComputeMaps: () => computeMaps
|
|
53
|
+
} as unknown as VxeFormDesignConstructor & VxeFormDesignPrivateMethods
|
|
54
|
+
|
|
55
|
+
const formDesignMethods: FormDesignMethods = {
|
|
56
|
+
dispatchEvent (type, params, evnt) {
|
|
57
|
+
emit(type, Object.assign({ $xeFormDesign, $event: evnt }, params))
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const updateWidgetConfigs = () => {
|
|
62
|
+
reactData.widgetConfigs = props.widgets && props.widgets.length ? props.widgets.slice(0) : []
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const formDesignPrivateMethods: FormDesignPrivateMethods = {
|
|
66
|
+
handleClickWidget (evnt: KeyboardEvent, item: VxeFormDesignDefines.WidgetObjItem) {
|
|
67
|
+
reactData.activeWidget = item
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Object.assign($xeFormDesign, formDesignMethods, formDesignPrivateMethods)
|
|
72
|
+
|
|
73
|
+
watch(() => props.widgets, () => {
|
|
74
|
+
updateWidgetConfigs()
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
updateWidgetConfigs()
|
|
78
|
+
|
|
79
|
+
const renderVN = () => {
|
|
80
|
+
return h('div', {
|
|
81
|
+
ref: refElem,
|
|
82
|
+
class: 'vxe-design-form'
|
|
83
|
+
}, [
|
|
84
|
+
h(WidgetComponent),
|
|
85
|
+
h(ViewComponent),
|
|
86
|
+
h(SettingComponent)
|
|
87
|
+
])
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
$xeFormDesign.renderVN = renderVN
|
|
91
|
+
|
|
92
|
+
provide('$xeFormDesign', $xeFormDesign)
|
|
93
|
+
|
|
94
|
+
return $xeFormDesign
|
|
95
|
+
},
|
|
96
|
+
render () {
|
|
97
|
+
return this.renderVN()
|
|
98
|
+
}
|
|
99
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
import { VxeFormDesignDefines } from '../../../types'
|
|
3
|
+
|
|
4
|
+
export function getNewWidgetId (widgetObjList: VxeFormDesignDefines.WidgetObjItem[]) {
|
|
5
|
+
let max = 10000
|
|
6
|
+
XEUtils.eachTree(widgetObjList, item => {
|
|
7
|
+
max = Math.max(max, item.id)
|
|
8
|
+
}, { children: 'children' })
|
|
9
|
+
return max + 1
|
|
10
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { defineComponent, h, inject, TransitionGroup } from 'vue'
|
|
2
|
+
import { renderer } from '../../ui/src/renderer'
|
|
3
|
+
import { getSlotVNs } from '../../ui/src/vn'
|
|
4
|
+
|
|
5
|
+
import { VxeFormDesignConstructor, VxeFormDesignPrivateMethods } from '../../../types'
|
|
6
|
+
import XEUtils from 'xe-utils'
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
props: {},
|
|
10
|
+
emits: [],
|
|
11
|
+
setup () {
|
|
12
|
+
const $xeFormDesign = inject<(VxeFormDesignConstructor & VxeFormDesignPrivateMethods) | null>('$xeFormDesign', null)
|
|
13
|
+
|
|
14
|
+
if (!$xeFormDesign) {
|
|
15
|
+
return
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { reactData } = $xeFormDesign
|
|
19
|
+
|
|
20
|
+
const dragoverEvent = (evnt: DragEvent) => {
|
|
21
|
+
const { widgetObjList, dragWidget } = reactData
|
|
22
|
+
if (dragWidget) {
|
|
23
|
+
evnt.preventDefault()
|
|
24
|
+
const rest = XEUtils.findTree(widgetObjList, item => item.id === dragWidget.id, { children: 'children' })
|
|
25
|
+
if (!rest) {
|
|
26
|
+
reactData.sortWidget = dragWidget
|
|
27
|
+
widgetObjList.push(dragWidget)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const sortDragstartEvent = (evnt: DragEvent) => {
|
|
33
|
+
const { widgetObjList } = reactData
|
|
34
|
+
const divEl = evnt.currentTarget as HTMLDivElement
|
|
35
|
+
const widgetId = Number(divEl.getAttribute('data-widget-id'))
|
|
36
|
+
const currRest = XEUtils.findTree(widgetObjList, item => item.id === widgetId, { children: 'children' })
|
|
37
|
+
if (currRest) {
|
|
38
|
+
reactData.dragWidget = null
|
|
39
|
+
reactData.sortWidget = currRest.item
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const sortDragendEvent = () => {
|
|
44
|
+
reactData.activeWidget = reactData.sortWidget
|
|
45
|
+
reactData.sortWidget = null
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let isDragAnimate = false
|
|
49
|
+
|
|
50
|
+
const sortDragenterEvent = (evnt: DragEvent) => {
|
|
51
|
+
const { widgetObjList, sortWidget } = reactData
|
|
52
|
+
if (isDragAnimate) {
|
|
53
|
+
evnt.preventDefault()
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
if (sortWidget) {
|
|
57
|
+
const divEl = evnt.currentTarget as HTMLDivElement
|
|
58
|
+
evnt.preventDefault()
|
|
59
|
+
const widgetId = Number(divEl.getAttribute('data-widget-id'))
|
|
60
|
+
if (widgetId !== sortWidget.id) {
|
|
61
|
+
const targetRest = XEUtils.findTree(widgetObjList, item => item.id === widgetId, { children: 'children' })
|
|
62
|
+
if (targetRest) {
|
|
63
|
+
const currRest = XEUtils.findTree(widgetObjList, item => item.id === sortWidget.id, { children: 'children' })
|
|
64
|
+
if (currRest) {
|
|
65
|
+
// 控件换位置
|
|
66
|
+
currRest.items.splice(currRest.index, 1)
|
|
67
|
+
targetRest.items.splice(targetRest.index, 0, currRest.item)
|
|
68
|
+
isDragAnimate = true
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
isDragAnimate = false
|
|
71
|
+
}, 150)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const dragoverItemEvent = (evnt: DragEvent) => {
|
|
79
|
+
const { sortWidget, dragWidget } = reactData
|
|
80
|
+
if (sortWidget || dragWidget) {
|
|
81
|
+
evnt.preventDefault()
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return () => {
|
|
86
|
+
const { widgetObjList } = reactData
|
|
87
|
+
return h('div', {
|
|
88
|
+
class: 'vxe-design-form--preview',
|
|
89
|
+
onDragover: dragoverEvent
|
|
90
|
+
}, [
|
|
91
|
+
h(TransitionGroup, {
|
|
92
|
+
class: 'vxe-design-form--preview-list',
|
|
93
|
+
tag: 'div',
|
|
94
|
+
name: 'vxe-design-form--preview-list'
|
|
95
|
+
}, {
|
|
96
|
+
default: () => {
|
|
97
|
+
const { dragWidget, activeWidget, sortWidget } = reactData
|
|
98
|
+
return widgetObjList.map(item => {
|
|
99
|
+
const { name } = item
|
|
100
|
+
const compConf = renderer.get(name) || {}
|
|
101
|
+
const renderFormDesignWidgetView = compConf.renderFormDesignWidgetView
|
|
102
|
+
return h('div', {
|
|
103
|
+
key: item.id,
|
|
104
|
+
'data-widget-id': item.id,
|
|
105
|
+
draggable: true,
|
|
106
|
+
class: ['vxe-design-form--preview-item', {
|
|
107
|
+
'is--active': activeWidget && activeWidget.id === item.id,
|
|
108
|
+
'is--sort': sortWidget && sortWidget.id === item.id,
|
|
109
|
+
'is--drag': dragWidget && dragWidget.id === item.id
|
|
110
|
+
}],
|
|
111
|
+
onDragstart: sortDragstartEvent,
|
|
112
|
+
onDragend: sortDragendEvent,
|
|
113
|
+
onDragenter: sortDragenterEvent,
|
|
114
|
+
onDragover: dragoverItemEvent,
|
|
115
|
+
onClick (evnt: KeyboardEvent) {
|
|
116
|
+
$xeFormDesign.handleClickWidget(evnt, item)
|
|
117
|
+
}
|
|
118
|
+
}, renderFormDesignWidgetView ? getSlotVNs(renderFormDesignWidgetView({}, {})) : [])
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
])
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
})
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { defineComponent, h, inject, VNode } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import { renderer } from '../../ui/src/renderer'
|
|
4
|
+
import { getSlotVNs } from '../../ui/src/vn'
|
|
5
|
+
import { getNewWidgetId } from './util'
|
|
6
|
+
|
|
7
|
+
import { VxeFormDesignPropTypes, VxeFormDesignConstructor, VxeFormDesignPrivateMethods } from '../../../types'
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
props: {},
|
|
11
|
+
emits: [],
|
|
12
|
+
setup () {
|
|
13
|
+
const $xeFormDesign = inject<(VxeFormDesignConstructor & VxeFormDesignPrivateMethods) | null>('$xeFormDesign', null)
|
|
14
|
+
|
|
15
|
+
if (!$xeFormDesign) {
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const { reactData } = $xeFormDesign
|
|
20
|
+
|
|
21
|
+
const dragstartEvent = (evnt: DragEvent) => {
|
|
22
|
+
const { widgetObjList } = reactData
|
|
23
|
+
const divEl = evnt.currentTarget as HTMLDivElement
|
|
24
|
+
const dataTransfer = evnt.dataTransfer
|
|
25
|
+
const widgetName = divEl.getAttribute('data-widget-name') || ''
|
|
26
|
+
const dragWidget = {
|
|
27
|
+
id: getNewWidgetId(widgetObjList),
|
|
28
|
+
name: widgetName
|
|
29
|
+
}
|
|
30
|
+
if (dataTransfer) {
|
|
31
|
+
dataTransfer.setData('text/plain', widgetName)
|
|
32
|
+
}
|
|
33
|
+
reactData.sortWidget = null
|
|
34
|
+
reactData.dragWidget = dragWidget
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const dragendEvent = () => {
|
|
38
|
+
if (reactData.dragWidget) {
|
|
39
|
+
reactData.activeWidget = reactData.dragWidget
|
|
40
|
+
}
|
|
41
|
+
reactData.dragWidget = null
|
|
42
|
+
reactData.sortWidget = null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const cancelDragoverItem = (evnt: DragEvent, group: VxeFormDesignPropTypes.WidgetItem) => {
|
|
46
|
+
const { widgetObjList, dragWidget } = reactData
|
|
47
|
+
if (dragWidget) {
|
|
48
|
+
if (group.children.includes(dragWidget.name)) {
|
|
49
|
+
const rest = XEUtils.findTree(widgetObjList, item => item.id === dragWidget.id, { children: 'children' })
|
|
50
|
+
if (rest) {
|
|
51
|
+
rest.items.splice(rest.index, 1)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const renderWidgetList = (group: VxeFormDesignPropTypes.WidgetItem) => {
|
|
58
|
+
const widgetVNs: VNode[] = []
|
|
59
|
+
if (group.children) {
|
|
60
|
+
group.children.forEach((name, index) => {
|
|
61
|
+
const compConf = renderer.get(name) || {}
|
|
62
|
+
const formDesignWidgetName = compConf.formDesignWidgetName
|
|
63
|
+
const formDesignWidgetIcon = compConf.formDesignWidgetIcon
|
|
64
|
+
const renderFormDesignWidgetItem = compConf.renderFormDesignWidgetItem
|
|
65
|
+
widgetVNs.push(
|
|
66
|
+
h('div', {
|
|
67
|
+
key: index,
|
|
68
|
+
class: 'vxe-design-form--widget-item'
|
|
69
|
+
}, h('div', {
|
|
70
|
+
class: 'vxe-design-form--widget-box',
|
|
71
|
+
'data-widget-name': name,
|
|
72
|
+
draggable: true,
|
|
73
|
+
onDragstart: dragstartEvent,
|
|
74
|
+
onDragend: dragendEvent
|
|
75
|
+
}, renderFormDesignWidgetItem
|
|
76
|
+
? getSlotVNs(renderFormDesignWidgetItem({}, {}))
|
|
77
|
+
: [
|
|
78
|
+
h('i', {
|
|
79
|
+
class: ['vxe-design-form--widget-item-icon', formDesignWidgetIcon]
|
|
80
|
+
}),
|
|
81
|
+
h('span', {
|
|
82
|
+
class: 'vxe-design-form--widget-item-name'
|
|
83
|
+
}, `${formDesignWidgetName || name}`)
|
|
84
|
+
]))
|
|
85
|
+
)
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
return widgetVNs
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const renderWidgetGroups = () => {
|
|
92
|
+
const { widgetConfigs } = reactData
|
|
93
|
+
return widgetConfigs.map((group, gIndex) => {
|
|
94
|
+
return h('div', {
|
|
95
|
+
key: gIndex,
|
|
96
|
+
class: 'vxe-design-form--widget-group'
|
|
97
|
+
}, [
|
|
98
|
+
h('div', {
|
|
99
|
+
class: 'vxe-design-form--widget-title'
|
|
100
|
+
}, `${group.title}`),
|
|
101
|
+
h('div', {
|
|
102
|
+
class: 'vxe-design-form--widget-list',
|
|
103
|
+
onDragover (evnt:DragEvent) {
|
|
104
|
+
cancelDragoverItem(evnt, group)
|
|
105
|
+
}
|
|
106
|
+
}, renderWidgetList(group))
|
|
107
|
+
])
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return () => {
|
|
112
|
+
return h('div', {
|
|
113
|
+
class: 'vxe-design-form--widget'
|
|
114
|
+
}, renderWidgetGroups())
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeFormGatherComponent from '../form/src/form-gather'
|
|
3
|
+
|
|
4
|
+
export const VxeFormGather = Object.assign(VxeFormGatherComponent, {
|
|
5
|
+
install (app: App) {
|
|
6
|
+
app.component(VxeFormGatherComponent.name as string, VxeFormGatherComponent)
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const FormGather = VxeFormGather
|
|
11
|
+
export default VxeFormGather
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeFormItemComponent from '../form/src/form-item'
|
|
3
|
+
|
|
4
|
+
export const VxeFormItem = Object.assign(VxeFormItemComponent, {
|
|
5
|
+
install (app: App) {
|
|
6
|
+
app.component(VxeFormItemComponent.name as string, VxeFormItemComponent)
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const FormItem = VxeFormItem
|
|
11
|
+
export default VxeFormItem
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeInputConstructor from './src/input'
|
|
3
|
+
import { dynamicApp } from '../dynamics'
|
|
4
|
+
|
|
5
|
+
export const VxeInput = Object.assign(VxeInputConstructor, {
|
|
6
|
+
install (app: App) {
|
|
7
|
+
app.component(VxeInputConstructor.name, VxeInputConstructor)
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export const Input = VxeInput
|
|
12
|
+
|
|
13
|
+
dynamicApp.component(VxeInputConstructor.name, VxeInputConstructor)
|
|
14
|
+
|
|
15
|
+
export default VxeInput
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
|
|
3
|
+
import { VxeInputPropTypes } from '../../../types'
|
|
4
|
+
|
|
5
|
+
export function toStringTimeDate (str: VxeInputPropTypes.ModelValue) {
|
|
6
|
+
if (str) {
|
|
7
|
+
const rest = new Date()
|
|
8
|
+
let h = 0
|
|
9
|
+
let m = 0
|
|
10
|
+
let s = 0
|
|
11
|
+
if (XEUtils.isDate(str)) {
|
|
12
|
+
h = str.getHours()
|
|
13
|
+
m = str.getMinutes()
|
|
14
|
+
s = str.getSeconds()
|
|
15
|
+
} else {
|
|
16
|
+
str = XEUtils.toValueString(str)
|
|
17
|
+
const parses = str.match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/)
|
|
18
|
+
if (parses) {
|
|
19
|
+
h = XEUtils.toNumber(parses[1])
|
|
20
|
+
m = XEUtils.toNumber(parses[3])
|
|
21
|
+
s = XEUtils.toNumber(parses[5])
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
rest.setHours(h)
|
|
25
|
+
rest.setMinutes(m)
|
|
26
|
+
rest.setSeconds(s)
|
|
27
|
+
return rest
|
|
28
|
+
}
|
|
29
|
+
return new Date('')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getDateQuarter (date: Date) {
|
|
33
|
+
const month = date.getMonth()
|
|
34
|
+
if (month < 3) {
|
|
35
|
+
return 1
|
|
36
|
+
} else if (month < 6) {
|
|
37
|
+
return 2
|
|
38
|
+
} else if (month < 9) {
|
|
39
|
+
return 3
|
|
40
|
+
}
|
|
41
|
+
return 4
|
|
42
|
+
}
|