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,349 @@
|
|
|
1
|
+
import { defineComponent, h, Teleport, ref, Ref, onUnmounted, reactive, nextTick, PropType, watch, createCommentVNode } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import globalConfigStore from '../../ui/src/globalStore'
|
|
4
|
+
import { useSize } from '../../hooks/size'
|
|
5
|
+
import { getAbsolutePos, getEventTargetNode } from '../../ui/src/dom'
|
|
6
|
+
import { getLastZIndex, nextZIndex } from '../../ui/src/utils'
|
|
7
|
+
import { GlobalEvent } from '../../ui/src/event'
|
|
8
|
+
|
|
9
|
+
import { VxeComponentStyle, VxePulldownConstructor, VxePulldownPropTypes, VxePulldownEmits, PulldownReactData, PulldownMethods, PulldownPrivateRef, VxePulldownMethods } from '../../../types'
|
|
10
|
+
|
|
11
|
+
export default defineComponent({
|
|
12
|
+
name: 'VxePulldown',
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: Boolean as PropType<VxePulldownPropTypes.ModelValue>,
|
|
15
|
+
disabled: Boolean as PropType<VxePulldownPropTypes.Disabled>,
|
|
16
|
+
placement: String as PropType<VxePulldownPropTypes.Placement>,
|
|
17
|
+
size: { type: String as PropType<VxePulldownPropTypes.Size>, default: () => globalConfigStore.size },
|
|
18
|
+
className: [String, Function] as PropType<VxePulldownPropTypes.ClassName>,
|
|
19
|
+
popupClassName: [String, Function] as PropType<VxePulldownPropTypes.PopupClassName>,
|
|
20
|
+
destroyOnClose: Boolean as PropType<VxePulldownPropTypes.DestroyOnClose>,
|
|
21
|
+
transfer: Boolean as PropType<VxePulldownPropTypes.Transfer>
|
|
22
|
+
},
|
|
23
|
+
emits: [
|
|
24
|
+
'update:modelValue',
|
|
25
|
+
'hide-panel'
|
|
26
|
+
] as VxePulldownEmits,
|
|
27
|
+
setup (props, context) {
|
|
28
|
+
const { slots, emit } = context
|
|
29
|
+
|
|
30
|
+
const xID = XEUtils.uniqueId()
|
|
31
|
+
|
|
32
|
+
const computeSize = useSize(props)
|
|
33
|
+
|
|
34
|
+
const reactData = reactive<PulldownReactData>({
|
|
35
|
+
inited: false,
|
|
36
|
+
panelIndex: 0,
|
|
37
|
+
panelStyle: null,
|
|
38
|
+
panelPlacement: null,
|
|
39
|
+
visiblePanel: false,
|
|
40
|
+
animatVisible: false,
|
|
41
|
+
isActivated: false
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const refElem = ref() as Ref<HTMLDivElement>
|
|
45
|
+
const refPulldowContent = ref() as Ref<HTMLDivElement>
|
|
46
|
+
const refPulldowPnanel = ref() as Ref<HTMLDivElement>
|
|
47
|
+
|
|
48
|
+
const refMaps: PulldownPrivateRef = {
|
|
49
|
+
refElem
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const $xepulldown = {
|
|
53
|
+
xID,
|
|
54
|
+
props,
|
|
55
|
+
context,
|
|
56
|
+
reactData,
|
|
57
|
+
getRefMaps: () => refMaps
|
|
58
|
+
} as unknown as VxePulldownConstructor & VxePulldownMethods
|
|
59
|
+
|
|
60
|
+
let pulldownMethods = {} as PulldownMethods
|
|
61
|
+
|
|
62
|
+
const updateZindex = () => {
|
|
63
|
+
if (reactData.panelIndex < getLastZIndex()) {
|
|
64
|
+
reactData.panelIndex = nextZIndex()
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const isPanelVisible = () => {
|
|
69
|
+
return reactData.visiblePanel
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 手动更新位置
|
|
74
|
+
*/
|
|
75
|
+
const updatePlacement = () => {
|
|
76
|
+
return nextTick().then(() => {
|
|
77
|
+
const { transfer, placement } = props
|
|
78
|
+
const { panelIndex, visiblePanel } = reactData
|
|
79
|
+
if (visiblePanel) {
|
|
80
|
+
const targetElem = refPulldowContent.value
|
|
81
|
+
const panelElem = refPulldowPnanel.value
|
|
82
|
+
if (panelElem && targetElem) {
|
|
83
|
+
const targetHeight = targetElem.offsetHeight
|
|
84
|
+
const targetWidth = targetElem.offsetWidth
|
|
85
|
+
const panelHeight = panelElem.offsetHeight
|
|
86
|
+
const panelWidth = panelElem.offsetWidth
|
|
87
|
+
const marginSize = 5
|
|
88
|
+
const panelStyle: VxeComponentStyle = {
|
|
89
|
+
zIndex: panelIndex
|
|
90
|
+
}
|
|
91
|
+
const { boundingTop, boundingLeft, visibleHeight, visibleWidth } = getAbsolutePos(targetElem)
|
|
92
|
+
let panelPlacement = 'bottom'
|
|
93
|
+
if (transfer) {
|
|
94
|
+
let left = boundingLeft
|
|
95
|
+
let top = boundingTop + targetHeight
|
|
96
|
+
if (placement === 'top') {
|
|
97
|
+
panelPlacement = 'top'
|
|
98
|
+
top = boundingTop - panelHeight
|
|
99
|
+
} else if (!placement) {
|
|
100
|
+
// 如果下面不够放,则向上
|
|
101
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
102
|
+
panelPlacement = 'top'
|
|
103
|
+
top = boundingTop - panelHeight
|
|
104
|
+
}
|
|
105
|
+
// 如果上面不够放,则向下(优先)
|
|
106
|
+
if (top < marginSize) {
|
|
107
|
+
panelPlacement = 'bottom'
|
|
108
|
+
top = boundingTop + targetHeight
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// 如果溢出右边
|
|
112
|
+
if (left + panelWidth + marginSize > visibleWidth) {
|
|
113
|
+
left -= left + panelWidth + marginSize - visibleWidth
|
|
114
|
+
}
|
|
115
|
+
// 如果溢出左边
|
|
116
|
+
if (left < marginSize) {
|
|
117
|
+
left = marginSize
|
|
118
|
+
}
|
|
119
|
+
Object.assign(panelStyle, {
|
|
120
|
+
left: `${left}px`,
|
|
121
|
+
top: `${top}px`,
|
|
122
|
+
minWidth: `${targetWidth}px`
|
|
123
|
+
})
|
|
124
|
+
} else {
|
|
125
|
+
if (placement === 'top') {
|
|
126
|
+
panelPlacement = 'top'
|
|
127
|
+
panelStyle.bottom = `${targetHeight}px`
|
|
128
|
+
} else if (!placement) {
|
|
129
|
+
// 如果下面不够放,则向上
|
|
130
|
+
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
131
|
+
// 如果上面不够放,则向下(优先)
|
|
132
|
+
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
133
|
+
panelPlacement = 'top'
|
|
134
|
+
panelStyle.bottom = `${targetHeight}px`
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
reactData.panelStyle = panelStyle
|
|
140
|
+
reactData.panelPlacement = panelPlacement
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return nextTick()
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
let hidePanelTimeout: number
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* 显示下拉面板
|
|
151
|
+
*/
|
|
152
|
+
const showPanel = (): Promise<void> => {
|
|
153
|
+
if (!reactData.inited) {
|
|
154
|
+
reactData.inited = true
|
|
155
|
+
}
|
|
156
|
+
return new Promise(resolve => {
|
|
157
|
+
if (!props.disabled) {
|
|
158
|
+
clearTimeout(hidePanelTimeout)
|
|
159
|
+
reactData.isActivated = true
|
|
160
|
+
reactData.animatVisible = true
|
|
161
|
+
setTimeout(() => {
|
|
162
|
+
reactData.visiblePanel = true
|
|
163
|
+
emit('update:modelValue', true)
|
|
164
|
+
updatePlacement()
|
|
165
|
+
setTimeout(() => {
|
|
166
|
+
resolve(updatePlacement())
|
|
167
|
+
}, 40)
|
|
168
|
+
}, 10)
|
|
169
|
+
updateZindex()
|
|
170
|
+
} else {
|
|
171
|
+
nextTick(() => {
|
|
172
|
+
resolve()
|
|
173
|
+
})
|
|
174
|
+
}
|
|
175
|
+
})
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* 隐藏下拉面板
|
|
180
|
+
*/
|
|
181
|
+
const hidePanel = (): Promise<void> => {
|
|
182
|
+
reactData.visiblePanel = false
|
|
183
|
+
emit('update:modelValue', false)
|
|
184
|
+
return new Promise(resolve => {
|
|
185
|
+
if (reactData.animatVisible) {
|
|
186
|
+
hidePanelTimeout = window.setTimeout(() => {
|
|
187
|
+
reactData.animatVisible = false
|
|
188
|
+
nextTick(() => {
|
|
189
|
+
resolve()
|
|
190
|
+
})
|
|
191
|
+
}, 350)
|
|
192
|
+
} else {
|
|
193
|
+
nextTick(() => {
|
|
194
|
+
resolve()
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 切换下拉面板
|
|
202
|
+
*/
|
|
203
|
+
const togglePanel = () => {
|
|
204
|
+
if (reactData.visiblePanel) {
|
|
205
|
+
return hidePanel()
|
|
206
|
+
}
|
|
207
|
+
return showPanel()
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const handleGlobalMousewheelEvent = (evnt: Event) => {
|
|
211
|
+
const { disabled } = props
|
|
212
|
+
const { visiblePanel } = reactData
|
|
213
|
+
const panelElem = refPulldowPnanel.value
|
|
214
|
+
if (!disabled) {
|
|
215
|
+
if (visiblePanel) {
|
|
216
|
+
if (getEventTargetNode(evnt, panelElem).flag) {
|
|
217
|
+
updatePlacement()
|
|
218
|
+
} else {
|
|
219
|
+
hidePanel()
|
|
220
|
+
pulldownMethods.dispatchEvent('hide-panel', {}, evnt)
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const handleGlobalMousedownEvent = (evnt: Event) => {
|
|
227
|
+
const { disabled } = props
|
|
228
|
+
const { visiblePanel } = reactData
|
|
229
|
+
const el = refElem.value
|
|
230
|
+
const panelElem = refPulldowPnanel.value
|
|
231
|
+
if (!disabled) {
|
|
232
|
+
reactData.isActivated = getEventTargetNode(evnt, el).flag || getEventTargetNode(evnt, panelElem).flag
|
|
233
|
+
if (visiblePanel && !reactData.isActivated) {
|
|
234
|
+
hidePanel()
|
|
235
|
+
pulldownMethods.dispatchEvent('hide-panel', {}, evnt)
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const handleGlobalBlurEvent = (evnt: Event) => {
|
|
241
|
+
if (reactData.visiblePanel) {
|
|
242
|
+
reactData.isActivated = false
|
|
243
|
+
hidePanel()
|
|
244
|
+
pulldownMethods.dispatchEvent('hide-panel', {}, evnt)
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
pulldownMethods = {
|
|
249
|
+
dispatchEvent (type, params, evnt) {
|
|
250
|
+
emit(type, Object.assign({ $pulldown: $xepulldown, $event: evnt }, params))
|
|
251
|
+
},
|
|
252
|
+
isPanelVisible,
|
|
253
|
+
togglePanel,
|
|
254
|
+
showPanel,
|
|
255
|
+
hidePanel
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
Object.assign($xepulldown, pulldownMethods)
|
|
259
|
+
|
|
260
|
+
watch(() => props.modelValue, (value) => {
|
|
261
|
+
if (value) {
|
|
262
|
+
showPanel()
|
|
263
|
+
} else {
|
|
264
|
+
hidePanel()
|
|
265
|
+
}
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
nextTick(() => {
|
|
269
|
+
GlobalEvent.on($xepulldown, 'mousewheel', handleGlobalMousewheelEvent)
|
|
270
|
+
GlobalEvent.on($xepulldown, 'mousedown', handleGlobalMousedownEvent)
|
|
271
|
+
GlobalEvent.on($xepulldown, 'blur', handleGlobalBlurEvent)
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
onUnmounted(() => {
|
|
275
|
+
GlobalEvent.off($xepulldown, 'mousewheel')
|
|
276
|
+
GlobalEvent.off($xepulldown, 'mousedown')
|
|
277
|
+
GlobalEvent.off($xepulldown, 'blur')
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
const renderVN = () => {
|
|
281
|
+
const { className, popupClassName, destroyOnClose, transfer, disabled } = props
|
|
282
|
+
const { inited, isActivated, animatVisible, visiblePanel, panelStyle, panelPlacement } = reactData
|
|
283
|
+
const vSize = computeSize.value
|
|
284
|
+
const defaultSlot = slots.default
|
|
285
|
+
const headerSlot = slots.header
|
|
286
|
+
const footerSlot = slots.footer
|
|
287
|
+
const dropdownSlot = slots.dropdown
|
|
288
|
+
return h('div', {
|
|
289
|
+
ref: refElem,
|
|
290
|
+
class: ['vxe-pulldown', className ? (XEUtils.isFunction(className) ? className({ $pulldown: $xepulldown }) : className) : '', {
|
|
291
|
+
[`size--${vSize}`]: vSize,
|
|
292
|
+
'is--visivle': visiblePanel,
|
|
293
|
+
'is--disabled': disabled,
|
|
294
|
+
'is--active': isActivated
|
|
295
|
+
}]
|
|
296
|
+
}, [
|
|
297
|
+
h('div', {
|
|
298
|
+
ref: refPulldowContent,
|
|
299
|
+
class: 'vxe-pulldown--content'
|
|
300
|
+
}, defaultSlot ? defaultSlot({ $pulldown: $xepulldown }) : []),
|
|
301
|
+
h(Teleport, {
|
|
302
|
+
to: 'body',
|
|
303
|
+
disabled: transfer ? !inited : true
|
|
304
|
+
}, [
|
|
305
|
+
h('div', {
|
|
306
|
+
ref: refPulldowPnanel,
|
|
307
|
+
class: ['vxe-table--ignore-clear vxe-pulldown--panel', popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $pulldown: $xepulldown }) : popupClassName) : '', {
|
|
308
|
+
[`size--${vSize}`]: vSize,
|
|
309
|
+
'is--transfer': transfer,
|
|
310
|
+
'animat--leave': animatVisible,
|
|
311
|
+
'animat--enter': visiblePanel
|
|
312
|
+
}],
|
|
313
|
+
placement: panelPlacement,
|
|
314
|
+
style: panelStyle
|
|
315
|
+
}, dropdownSlot
|
|
316
|
+
? [
|
|
317
|
+
h('div', {
|
|
318
|
+
class: 'vxe-pulldown--panel-wrapper'
|
|
319
|
+
}, !inited || (destroyOnClose && !visiblePanel && !animatVisible)
|
|
320
|
+
? []
|
|
321
|
+
: [
|
|
322
|
+
headerSlot
|
|
323
|
+
? h('div', {
|
|
324
|
+
class: 'vxe-pulldown--panel-header'
|
|
325
|
+
}, headerSlot({ $pulldown: $xepulldown }))
|
|
326
|
+
: createCommentVNode(),
|
|
327
|
+
h('div', {
|
|
328
|
+
class: 'vxe-pulldown--panel-body'
|
|
329
|
+
}, dropdownSlot({ $pulldown: $xepulldown })),
|
|
330
|
+
footerSlot
|
|
331
|
+
? h('div', {
|
|
332
|
+
class: 'vxe-pulldown--panel-footer'
|
|
333
|
+
}, footerSlot({ $pulldown: $xepulldown }))
|
|
334
|
+
: createCommentVNode()
|
|
335
|
+
])
|
|
336
|
+
]
|
|
337
|
+
: [])
|
|
338
|
+
])
|
|
339
|
+
])
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
$xepulldown.renderVN = renderVN
|
|
343
|
+
|
|
344
|
+
return $xepulldown
|
|
345
|
+
},
|
|
346
|
+
render () {
|
|
347
|
+
return this.renderVN()
|
|
348
|
+
}
|
|
349
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeRadioComponent from './src/radio'
|
|
3
|
+
import { dynamicApp } from '../dynamics'
|
|
4
|
+
|
|
5
|
+
export const VxeRadio = Object.assign(VxeRadioComponent, {
|
|
6
|
+
install: function (app: App) {
|
|
7
|
+
app.component(VxeRadioComponent.name, VxeRadioComponent)
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export const Radio = VxeRadio
|
|
12
|
+
|
|
13
|
+
dynamicApp.component(VxeRadioComponent.name, VxeRadioComponent)
|
|
14
|
+
|
|
15
|
+
export default VxeRadio
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { defineComponent, h, computed, inject, PropType } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import { getFuncText } from '../../ui/src/utils'
|
|
4
|
+
import globalConfigStore from '../../ui/src/globalStore'
|
|
5
|
+
import { useSize } from '../../hooks/size'
|
|
6
|
+
|
|
7
|
+
import { VxeRadioButtonPropTypes, VxeRadioGroupConstructor, VxeRadioButtonConstructor, VxeRadioButtonEmits, VxeRadioGroupPrivateMethods, RadioButtonMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'VxeRadioButton',
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: [String, Number, Boolean] as PropType<VxeRadioButtonPropTypes.ModelValue>,
|
|
13
|
+
label: { type: [String, Number, Boolean] as PropType<VxeRadioButtonPropTypes.Label>, default: null },
|
|
14
|
+
title: [String, Number] as PropType<VxeRadioButtonPropTypes.Title>,
|
|
15
|
+
content: [String, Number] as PropType<VxeRadioButtonPropTypes.Content>,
|
|
16
|
+
disabled: Boolean as PropType<VxeRadioButtonPropTypes.Disabled>,
|
|
17
|
+
strict: { type: Boolean as PropType<VxeRadioButtonPropTypes.Strict>, default: () => globalConfigStore.radioButton.strict },
|
|
18
|
+
size: { type: String as PropType<VxeRadioButtonPropTypes.Size>, default: () => globalConfigStore.radioButton.size || globalConfigStore.size }
|
|
19
|
+
},
|
|
20
|
+
emits: [
|
|
21
|
+
'update:modelValue',
|
|
22
|
+
'change'
|
|
23
|
+
] as VxeRadioButtonEmits,
|
|
24
|
+
setup (props, context) {
|
|
25
|
+
const { slots, emit } = context
|
|
26
|
+
const $xeform = inject<VxeFormConstructor & VxeFormPrivateMethods | null>('$xeForm', null)
|
|
27
|
+
const $xeformiteminfo = inject<VxeFormDefines.ProvideItemInfo | null>('$xeFormItemInfo', null)
|
|
28
|
+
|
|
29
|
+
const xID = XEUtils.uniqueId()
|
|
30
|
+
|
|
31
|
+
const computeSize = useSize(props)
|
|
32
|
+
|
|
33
|
+
const $xeradiobutton = {
|
|
34
|
+
xID,
|
|
35
|
+
props,
|
|
36
|
+
context
|
|
37
|
+
} as unknown as VxeRadioButtonConstructor
|
|
38
|
+
|
|
39
|
+
let radioButtonMethods = {} as RadioButtonMethods
|
|
40
|
+
|
|
41
|
+
const $xeradiogroup = inject('$xeradiogroup', null as (VxeRadioGroupConstructor & VxeRadioGroupPrivateMethods) | null)
|
|
42
|
+
|
|
43
|
+
const computeDisabled = computed(() => {
|
|
44
|
+
return props.disabled || ($xeradiogroup && $xeradiogroup.props.disabled)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const computeName = computed(() => {
|
|
48
|
+
return $xeradiogroup ? $xeradiogroup.name : null
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const computeStrict = computed(() => {
|
|
52
|
+
return $xeradiogroup ? $xeradiogroup.props.strict : props.strict
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const computeChecked = computed(() => {
|
|
56
|
+
const { modelValue, label } = props
|
|
57
|
+
return $xeradiogroup ? $xeradiogroup.props.modelValue === label : modelValue === label
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
radioButtonMethods = {
|
|
61
|
+
dispatchEvent (type, params, evnt) {
|
|
62
|
+
emit(type, Object.assign({ $radioButton: $xeradiobutton, $event: evnt }, params))
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
Object.assign($xeradiobutton, radioButtonMethods)
|
|
67
|
+
|
|
68
|
+
const handleValue = (label: VxeRadioButtonPropTypes.Label, evnt: Event) => {
|
|
69
|
+
if ($xeradiogroup) {
|
|
70
|
+
$xeradiogroup.handleChecked({ label }, evnt)
|
|
71
|
+
} else {
|
|
72
|
+
emit('update:modelValue', label)
|
|
73
|
+
radioButtonMethods.dispatchEvent('change', { label }, evnt)
|
|
74
|
+
// 自动更新校验状态
|
|
75
|
+
if ($xeform && $xeformiteminfo) {
|
|
76
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, label)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const changeEvent = (evnt: Event) => {
|
|
82
|
+
const isDisabled = computeDisabled.value
|
|
83
|
+
if (!isDisabled) {
|
|
84
|
+
handleValue(props.label, evnt)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const clickEvent = (evnt: Event) => {
|
|
89
|
+
const isDisabled = computeDisabled.value
|
|
90
|
+
const isStrict = computeStrict.value
|
|
91
|
+
if (!isDisabled && !isStrict) {
|
|
92
|
+
if (props.label === ($xeradiogroup ? $xeradiogroup.props.modelValue : props.modelValue)) {
|
|
93
|
+
handleValue(null, evnt)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const renderVN = () => {
|
|
99
|
+
const vSize = computeSize.value
|
|
100
|
+
const isDisabled = computeDisabled.value
|
|
101
|
+
const name = computeName.value
|
|
102
|
+
const checked = computeChecked.value
|
|
103
|
+
return h('label', {
|
|
104
|
+
class: ['vxe-radio', 'vxe-radio-button', {
|
|
105
|
+
[`size--${vSize}`]: vSize,
|
|
106
|
+
'is--disabled': isDisabled
|
|
107
|
+
}],
|
|
108
|
+
title: props.title
|
|
109
|
+
}, [
|
|
110
|
+
h('input', {
|
|
111
|
+
class: 'vxe-radio--input',
|
|
112
|
+
type: 'radio',
|
|
113
|
+
name,
|
|
114
|
+
checked,
|
|
115
|
+
disabled: isDisabled,
|
|
116
|
+
onChange: changeEvent,
|
|
117
|
+
onClick: clickEvent
|
|
118
|
+
}),
|
|
119
|
+
h('span', {
|
|
120
|
+
class: 'vxe-radio--label'
|
|
121
|
+
}, slots.default ? slots.default({}) : getFuncText(props.content))
|
|
122
|
+
])
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
Object.assign($xeradiobutton, {
|
|
126
|
+
renderVN,
|
|
127
|
+
dispatchEvent
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
return renderVN
|
|
131
|
+
}
|
|
132
|
+
})
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { defineComponent, h, provide, PropType, inject, computed } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import globalConfigStore from '../../ui/src/globalStore'
|
|
4
|
+
import VxeRadioComponent from './radio'
|
|
5
|
+
import VxeRadioButtonComponent from './button'
|
|
6
|
+
import { useSize } from '../../hooks/size'
|
|
7
|
+
|
|
8
|
+
import { VxeRadioGroupPropTypes, VxeRadioGroupConstructor, VxeRadioGroupEmits, VxeRadioGroupPrivateMethods, RadioGroupPrivateMethods, RadioGroupMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
|
|
9
|
+
|
|
10
|
+
export default defineComponent({
|
|
11
|
+
name: 'VxeRadioGroup',
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: [String, Number, Boolean] as PropType<VxeRadioGroupPropTypes.ModelValue>,
|
|
14
|
+
disabled: Boolean as PropType<VxeRadioGroupPropTypes.Disabled>,
|
|
15
|
+
type: String as PropType<VxeRadioGroupPropTypes.Type>,
|
|
16
|
+
options: Array as PropType<VxeRadioGroupPropTypes.Options>,
|
|
17
|
+
optionProps: Object as PropType<VxeRadioGroupPropTypes.OptionProps>,
|
|
18
|
+
strict: { type: Boolean as PropType<VxeRadioGroupPropTypes.Strict>, default: () => globalConfigStore.radioGroup.strict },
|
|
19
|
+
size: { type: String as PropType<VxeRadioGroupPropTypes.Size>, default: () => globalConfigStore.radioGroup.size || globalConfigStore.size }
|
|
20
|
+
},
|
|
21
|
+
emits: [
|
|
22
|
+
'update:modelValue',
|
|
23
|
+
'change'
|
|
24
|
+
] as VxeRadioGroupEmits,
|
|
25
|
+
setup (props, context) {
|
|
26
|
+
const { slots, emit } = context
|
|
27
|
+
const $xeform = inject<VxeFormConstructor & VxeFormPrivateMethods | null>('$xeForm', null)
|
|
28
|
+
const $xeformiteminfo = inject<VxeFormDefines.ProvideItemInfo | null>('$xeFormItemInfo', null)
|
|
29
|
+
|
|
30
|
+
const xID = XEUtils.uniqueId()
|
|
31
|
+
|
|
32
|
+
const $xeradiogroup = {
|
|
33
|
+
xID,
|
|
34
|
+
props,
|
|
35
|
+
context,
|
|
36
|
+
name: XEUtils.uniqueId('xegroup_')
|
|
37
|
+
} as unknown as VxeRadioGroupConstructor & VxeRadioGroupPrivateMethods
|
|
38
|
+
|
|
39
|
+
const computePropsOpts = computed(() => {
|
|
40
|
+
return props.optionProps || {}
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const computeLabelField = computed(() => {
|
|
44
|
+
const propsOpts = computePropsOpts.value
|
|
45
|
+
return propsOpts.label || 'label'
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const computeValueField = computed(() => {
|
|
49
|
+
const propsOpts = computePropsOpts.value
|
|
50
|
+
return propsOpts.value || 'value'
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const computeDisabledField = computed(() => {
|
|
54
|
+
const propsOpts = computePropsOpts.value
|
|
55
|
+
return propsOpts.disabled || 'disabled'
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
let radioGroupMethods = {} as RadioGroupMethods
|
|
59
|
+
|
|
60
|
+
useSize(props)
|
|
61
|
+
|
|
62
|
+
const radioGroupPrivateMethods: RadioGroupPrivateMethods = {
|
|
63
|
+
handleChecked (params, evnt) {
|
|
64
|
+
emit('update:modelValue', params.label)
|
|
65
|
+
radioGroupMethods.dispatchEvent('change', params)
|
|
66
|
+
// 自动更新校验状态
|
|
67
|
+
if ($xeform && $xeformiteminfo) {
|
|
68
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, params.label)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
radioGroupMethods = {
|
|
74
|
+
dispatchEvent (type, params, evnt) {
|
|
75
|
+
emit(type, Object.assign({ $radioGroup: $xeradiogroup, $event: evnt }, params))
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const renderVN = () => {
|
|
80
|
+
const { options, type } = props
|
|
81
|
+
const defaultSlot = slots.default
|
|
82
|
+
const valueField = computeValueField.value as 'value'
|
|
83
|
+
const labelField = computeLabelField.value as 'label'
|
|
84
|
+
const disabledField = computeDisabledField.value as 'disabled'
|
|
85
|
+
const btnComp = type === 'button' ? VxeRadioButtonComponent : VxeRadioComponent
|
|
86
|
+
return h('div', {
|
|
87
|
+
class: 'vxe-radio-group'
|
|
88
|
+
}, defaultSlot
|
|
89
|
+
? defaultSlot({})
|
|
90
|
+
: (options
|
|
91
|
+
? options.map(item => {
|
|
92
|
+
return h(btnComp, {
|
|
93
|
+
label: item[valueField],
|
|
94
|
+
content: item[labelField],
|
|
95
|
+
disabled: item[disabledField]
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
: []))
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
Object.assign($xeradiogroup, radioGroupPrivateMethods, {
|
|
102
|
+
renderVN,
|
|
103
|
+
dispatchEvent
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
provide('$xeradiogroup', $xeradiogroup)
|
|
107
|
+
|
|
108
|
+
return renderVN
|
|
109
|
+
}
|
|
110
|
+
})
|