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,47 @@
|
|
|
1
|
+
import { watch } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import { OptionInfo } from './optionInfo'
|
|
4
|
+
|
|
5
|
+
import { VxeSelectConstructor } from '../../../types'
|
|
6
|
+
|
|
7
|
+
export interface XEOptionProvide {
|
|
8
|
+
option: OptionInfo;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function isOption (option: any) {
|
|
12
|
+
return option instanceof OptionInfo
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createOption ($xeselect: VxeSelectConstructor, _vm: any) {
|
|
16
|
+
return isOption(_vm) ? _vm : new OptionInfo($xeselect, _vm)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function watchOption (props: any, option: OptionInfo) {
|
|
20
|
+
Object.keys(props).forEach(name => {
|
|
21
|
+
watch(() => props[name], (value: any) => {
|
|
22
|
+
option.update(name, value)
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function assemOption ($xeselect: VxeSelectConstructor, el: HTMLDivElement, option: OptionInfo, optgroup?: XEOptionProvide | null) {
|
|
28
|
+
const { reactData } = $xeselect
|
|
29
|
+
const { staticOptions } = reactData
|
|
30
|
+
const parentElem = el.parentNode
|
|
31
|
+
const parentOption = optgroup ? optgroup.option : null
|
|
32
|
+
const parentCols = parentOption ? parentOption.options : staticOptions
|
|
33
|
+
if (parentElem && parentCols) {
|
|
34
|
+
parentCols.splice(XEUtils.arrayIndexOf(parentElem.children, el), 0, option)
|
|
35
|
+
reactData.staticOptions = staticOptions.slice(0)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function destroyOption ($xeselect: VxeSelectConstructor, option: OptionInfo) {
|
|
40
|
+
const { reactData } = $xeselect
|
|
41
|
+
const { staticOptions } = reactData
|
|
42
|
+
const matchObj = XEUtils.findTree(staticOptions, (item) => item.id === option.id, { children: 'options' })
|
|
43
|
+
if (matchObj) {
|
|
44
|
+
matchObj.items.splice(matchObj.index, 1)
|
|
45
|
+
}
|
|
46
|
+
reactData.staticOptions = staticOptions.slice(0)
|
|
47
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeSwitchComponent from './src/switch'
|
|
3
|
+
import { dynamicApp } from '../dynamics'
|
|
4
|
+
|
|
5
|
+
export const VxeSwitch = Object.assign(VxeSwitchComponent, {
|
|
6
|
+
install: function (app: App) {
|
|
7
|
+
app.component(VxeSwitchComponent.name as string, VxeSwitchComponent)
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export const Switch = VxeSwitch
|
|
12
|
+
|
|
13
|
+
dynamicApp.component(VxeSwitchComponent.name as string, VxeSwitchComponent)
|
|
14
|
+
|
|
15
|
+
export default VxeSwitch
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { defineComponent, h, ref, Ref, computed, reactive, nextTick, createCommentVNode, PropType, inject } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import globalConfigStore from '../../ui/src/globalStore'
|
|
4
|
+
import { useSize } from '../../hooks/size'
|
|
5
|
+
import { getFuncText } from '../../ui/src/utils'
|
|
6
|
+
|
|
7
|
+
import { VxeSwitchPropTypes, VxeSwitchConstructor, VxeSwitchEmits, SwitchReactData, SwitchMethods, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'VxeSwitch',
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: [String, Number, Boolean] as PropType<VxeSwitchPropTypes.ModelValue>,
|
|
13
|
+
disabled: Boolean as PropType<VxeSwitchPropTypes.Disabled>,
|
|
14
|
+
size: { type: String as PropType<VxeSwitchPropTypes.Size>, default: () => globalConfigStore.switch.size || globalConfigStore.size },
|
|
15
|
+
openLabel: String as PropType<VxeSwitchPropTypes.OpenLabel>,
|
|
16
|
+
closeLabel: String as PropType<VxeSwitchPropTypes.CloseLabel>,
|
|
17
|
+
openValue: { type: [String, Number, Boolean] as PropType<VxeSwitchPropTypes.OpenValue>, default: true },
|
|
18
|
+
closeValue: { type: [String, Number, Boolean] as PropType<VxeSwitchPropTypes.CloseValue>, default: false },
|
|
19
|
+
openIcon: String as PropType<VxeSwitchPropTypes.OpenIcon>,
|
|
20
|
+
closeIcon: String as PropType<VxeSwitchPropTypes.CloseIcon>
|
|
21
|
+
},
|
|
22
|
+
emits: [
|
|
23
|
+
'update:modelValue',
|
|
24
|
+
'change',
|
|
25
|
+
'focus',
|
|
26
|
+
'blur'
|
|
27
|
+
] as VxeSwitchEmits,
|
|
28
|
+
setup (props, context) {
|
|
29
|
+
const { emit } = context
|
|
30
|
+
const $xeform = inject<VxeFormConstructor & VxeFormPrivateMethods | null>('$xeForm', null)
|
|
31
|
+
const $xeformiteminfo = inject<VxeFormDefines.ProvideItemInfo | null>('$xeFormItemInfo', null)
|
|
32
|
+
|
|
33
|
+
const xID = XEUtils.uniqueId()
|
|
34
|
+
|
|
35
|
+
const computeSize = useSize(props)
|
|
36
|
+
|
|
37
|
+
const reactData = reactive<SwitchReactData>({
|
|
38
|
+
isActivated: false,
|
|
39
|
+
hasAnimat: false,
|
|
40
|
+
offsetLeft: 0
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const $xeswitch = {
|
|
44
|
+
xID,
|
|
45
|
+
props,
|
|
46
|
+
context,
|
|
47
|
+
reactData
|
|
48
|
+
} as unknown as VxeSwitchConstructor
|
|
49
|
+
|
|
50
|
+
const refButton = ref() as Ref<HTMLButtonElement>
|
|
51
|
+
|
|
52
|
+
let switchMethods = {} as SwitchMethods
|
|
53
|
+
|
|
54
|
+
const computeOnShowLabel = computed(() => {
|
|
55
|
+
return getFuncText(props.openLabel)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const computeOffShowLabel = computed(() => {
|
|
59
|
+
return getFuncText(props.closeLabel)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const computeIsChecked = computed(() => {
|
|
63
|
+
return props.modelValue === props.openValue
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
let _atimeout: any
|
|
67
|
+
const clickEvent = (evnt: Event) => {
|
|
68
|
+
if (!props.disabled) {
|
|
69
|
+
const isChecked = computeIsChecked.value
|
|
70
|
+
clearTimeout(_atimeout)
|
|
71
|
+
const value = isChecked ? props.closeValue : props.openValue
|
|
72
|
+
reactData.hasAnimat = true
|
|
73
|
+
emit('update:modelValue', value)
|
|
74
|
+
switchMethods.dispatchEvent('change', { value }, evnt)
|
|
75
|
+
// 自动更新校验状态
|
|
76
|
+
if ($xeform && $xeformiteminfo) {
|
|
77
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, value)
|
|
78
|
+
}
|
|
79
|
+
_atimeout = setTimeout(() => {
|
|
80
|
+
reactData.hasAnimat = false
|
|
81
|
+
}, 400)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const focusEvent = (evnt: Event) => {
|
|
86
|
+
reactData.isActivated = true
|
|
87
|
+
switchMethods.dispatchEvent('focus', { value: props.modelValue }, evnt)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const blurEvent = (evnt: Event) => {
|
|
91
|
+
reactData.isActivated = false
|
|
92
|
+
switchMethods.dispatchEvent('blur', { value: props.modelValue }, evnt)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
switchMethods = {
|
|
96
|
+
dispatchEvent (type, params, evnt) {
|
|
97
|
+
emit(type, Object.assign({ $switch: $xeswitch, $event: evnt }, params))
|
|
98
|
+
},
|
|
99
|
+
focus () {
|
|
100
|
+
const btnElem = refButton.value
|
|
101
|
+
reactData.isActivated = true
|
|
102
|
+
btnElem.focus()
|
|
103
|
+
return nextTick()
|
|
104
|
+
},
|
|
105
|
+
blur () {
|
|
106
|
+
const btnElem = refButton.value
|
|
107
|
+
btnElem.blur()
|
|
108
|
+
reactData.isActivated = false
|
|
109
|
+
return nextTick()
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
Object.assign($xeswitch, switchMethods)
|
|
114
|
+
|
|
115
|
+
const renderVN = () => {
|
|
116
|
+
const { disabled, openIcon, closeIcon } = props
|
|
117
|
+
const isChecked = computeIsChecked.value
|
|
118
|
+
const vSize = computeSize.value
|
|
119
|
+
const onShowLabel = computeOnShowLabel.value
|
|
120
|
+
const offShowLabel = computeOffShowLabel.value
|
|
121
|
+
return h('div', {
|
|
122
|
+
class: ['vxe-switch', isChecked ? 'is--on' : 'is--off', {
|
|
123
|
+
[`size--${vSize}`]: vSize,
|
|
124
|
+
'is--disabled': disabled,
|
|
125
|
+
'is--animat': reactData.hasAnimat
|
|
126
|
+
}]
|
|
127
|
+
}, [
|
|
128
|
+
h('button', {
|
|
129
|
+
ref: refButton,
|
|
130
|
+
class: 'vxe-switch--button',
|
|
131
|
+
type: 'button',
|
|
132
|
+
disabled,
|
|
133
|
+
onClick: clickEvent,
|
|
134
|
+
onFocus: focusEvent,
|
|
135
|
+
onBlur: blurEvent
|
|
136
|
+
}, [
|
|
137
|
+
h('span', {
|
|
138
|
+
class: 'vxe-switch--label vxe-switch--label-on'
|
|
139
|
+
}, [
|
|
140
|
+
openIcon
|
|
141
|
+
? h('i', {
|
|
142
|
+
class: ['vxe-switch--label-icon', openIcon]
|
|
143
|
+
})
|
|
144
|
+
: createCommentVNode(),
|
|
145
|
+
onShowLabel
|
|
146
|
+
]),
|
|
147
|
+
h('span', {
|
|
148
|
+
class: 'vxe-switch--label vxe-switch--label-off'
|
|
149
|
+
}, [
|
|
150
|
+
closeIcon
|
|
151
|
+
? h('i', {
|
|
152
|
+
class: ['vxe-switch--label-icon', closeIcon]
|
|
153
|
+
})
|
|
154
|
+
: createCommentVNode(),
|
|
155
|
+
offShowLabel
|
|
156
|
+
]),
|
|
157
|
+
h('span', {
|
|
158
|
+
class: 'vxe-switch--icon'
|
|
159
|
+
})
|
|
160
|
+
])
|
|
161
|
+
])
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
$xeswitch.renderVN = renderVN
|
|
165
|
+
|
|
166
|
+
return $xeswitch
|
|
167
|
+
},
|
|
168
|
+
render () {
|
|
169
|
+
return this.renderVN()
|
|
170
|
+
}
|
|
171
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeTextareaComponent from './src/textarea'
|
|
3
|
+
import { dynamicApp } from '../dynamics'
|
|
4
|
+
|
|
5
|
+
export const VxeTextarea = Object.assign(VxeTextareaComponent, {
|
|
6
|
+
install: function (app: App) {
|
|
7
|
+
app.component(VxeTextareaComponent.name, VxeTextareaComponent)
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export const Textarea = VxeTextarea
|
|
12
|
+
|
|
13
|
+
dynamicApp.component(VxeTextareaComponent.name, VxeTextareaComponent)
|
|
14
|
+
|
|
15
|
+
export default VxeTextarea
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { defineComponent, h, ref, Ref, computed, nextTick, watch, PropType, reactive, inject } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import globalConfigStore from '../../ui/src/globalStore'
|
|
4
|
+
import { getFuncText } from '../../ui/src/utils'
|
|
5
|
+
import { getI18n } from '../../ui/src/i18n'
|
|
6
|
+
import { useSize } from '../../hooks/size'
|
|
7
|
+
|
|
8
|
+
import { VxeTextareaPropTypes, TextareaReactData, TextareaMethods, VxeTextareaConstructor, VxeTextareaEmits, TextareaPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
|
|
9
|
+
|
|
10
|
+
let autoTxtElem: HTMLDivElement
|
|
11
|
+
|
|
12
|
+
export default defineComponent({
|
|
13
|
+
name: 'VxeTextarea',
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: [String, Number] as PropType<VxeTextareaPropTypes.ModelValue>,
|
|
16
|
+
className: String as PropType<VxeTextareaPropTypes.ClassName>,
|
|
17
|
+
immediate: { type: Boolean as PropType<VxeTextareaPropTypes.Immediate>, default: true },
|
|
18
|
+
name: String as PropType<VxeTextareaPropTypes.Name>,
|
|
19
|
+
readonly: Boolean as PropType<VxeTextareaPropTypes.Readonly>,
|
|
20
|
+
disabled: Boolean as PropType<VxeTextareaPropTypes.Disabled>,
|
|
21
|
+
placeholder: {
|
|
22
|
+
type: String as PropType<VxeTextareaPropTypes.Placeholder>,
|
|
23
|
+
default: () => XEUtils.eqNull(globalConfigStore.textarea.placeholder) ? getI18n('vxe.base.pleaseInput') : globalConfigStore.textarea.placeholder
|
|
24
|
+
},
|
|
25
|
+
maxlength: [String, Number] as PropType<VxeTextareaPropTypes.Maxlength>,
|
|
26
|
+
rows: { type: [String, Number] as PropType<VxeTextareaPropTypes.Rows>, default: 2 },
|
|
27
|
+
cols: { type: [String, Number] as PropType<VxeTextareaPropTypes.Cols>, default: null },
|
|
28
|
+
showWordCount: Boolean as PropType<VxeTextareaPropTypes.ShowWordCount>,
|
|
29
|
+
countMethod: Function as PropType<VxeTextareaPropTypes.CountMethod>,
|
|
30
|
+
autosize: [Boolean, Object] as PropType<VxeTextareaPropTypes.Autosize>,
|
|
31
|
+
form: String as PropType<VxeTextareaPropTypes.Form>,
|
|
32
|
+
resize: { type: String as PropType<VxeTextareaPropTypes.Resize>, default: () => globalConfigStore.textarea.resize },
|
|
33
|
+
size: { type: String as PropType<VxeTextareaPropTypes.Size>, default: () => globalConfigStore.textarea.size || globalConfigStore.size }
|
|
34
|
+
},
|
|
35
|
+
emits: [
|
|
36
|
+
'update:modelValue',
|
|
37
|
+
'input',
|
|
38
|
+
'keydown',
|
|
39
|
+
'keyup',
|
|
40
|
+
'click',
|
|
41
|
+
'change',
|
|
42
|
+
'focus',
|
|
43
|
+
'blur'
|
|
44
|
+
] as VxeTextareaEmits,
|
|
45
|
+
setup (props, context) {
|
|
46
|
+
const { emit } = context
|
|
47
|
+
const $xeform = inject<VxeFormConstructor & VxeFormPrivateMethods | null>('$xeForm', null)
|
|
48
|
+
const $xeformiteminfo = inject<VxeFormDefines.ProvideItemInfo | null>('$xeFormItemInfo', null)
|
|
49
|
+
|
|
50
|
+
const xID = XEUtils.uniqueId()
|
|
51
|
+
|
|
52
|
+
const computeSize = useSize(props)
|
|
53
|
+
|
|
54
|
+
const reactData = reactive<TextareaReactData>({
|
|
55
|
+
inputValue: props.modelValue
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const refElem = ref() as Ref<HTMLDivElement>
|
|
59
|
+
const refTextarea = ref() as Ref<HTMLTextAreaElement>
|
|
60
|
+
|
|
61
|
+
const refMaps: TextareaPrivateRef = {
|
|
62
|
+
refElem,
|
|
63
|
+
refTextarea
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const $xetextarea = {
|
|
67
|
+
xID,
|
|
68
|
+
props,
|
|
69
|
+
context,
|
|
70
|
+
reactData,
|
|
71
|
+
getRefMaps: () => refMaps
|
|
72
|
+
} as unknown as VxeTextareaConstructor
|
|
73
|
+
|
|
74
|
+
let textareaMethods = {} as TextareaMethods
|
|
75
|
+
|
|
76
|
+
const computeInputCount = computed(() => {
|
|
77
|
+
return XEUtils.getSize(reactData.inputValue)
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const computeIsCountError = computed(() => {
|
|
81
|
+
const inputCount = computeInputCount.value
|
|
82
|
+
return props.maxlength && inputCount > XEUtils.toNumber(props.maxlength)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const computeSizeOpts = computed(() => {
|
|
86
|
+
return Object.assign({ minRows: 1, maxRows: 10 }, globalConfigStore.textarea.autosize, props.autosize)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const updateAutoTxt = () => {
|
|
90
|
+
const { size, autosize } = props
|
|
91
|
+
const { inputValue } = reactData
|
|
92
|
+
if (autosize) {
|
|
93
|
+
if (!autoTxtElem) {
|
|
94
|
+
autoTxtElem = document.createElement('div')
|
|
95
|
+
}
|
|
96
|
+
if (!autoTxtElem.parentNode) {
|
|
97
|
+
document.body.appendChild(autoTxtElem)
|
|
98
|
+
}
|
|
99
|
+
const textElem = refTextarea.value
|
|
100
|
+
const textStyle = getComputedStyle(textElem)
|
|
101
|
+
autoTxtElem.className = ['vxe-textarea--autosize', size ? `size--${size}` : ''].join(' ')
|
|
102
|
+
autoTxtElem.style.width = `${textElem.clientWidth}px`
|
|
103
|
+
autoTxtElem.style.padding = textStyle.padding
|
|
104
|
+
autoTxtElem.innerText = ('' + (inputValue || ' ')).replace(/\n$/, '\n ')
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const handleResize = () => {
|
|
109
|
+
if (props.autosize) {
|
|
110
|
+
nextTick(() => {
|
|
111
|
+
const sizeOpts = computeSizeOpts.value
|
|
112
|
+
const { minRows, maxRows } = sizeOpts
|
|
113
|
+
const textElem = refTextarea.value
|
|
114
|
+
const sizeHeight = autoTxtElem.clientHeight
|
|
115
|
+
const textStyle = getComputedStyle(textElem)
|
|
116
|
+
const lineHeight = XEUtils.toNumber(textStyle.lineHeight)
|
|
117
|
+
const paddingTop = XEUtils.toNumber(textStyle.paddingTop)
|
|
118
|
+
const paddingBottom = XEUtils.toNumber(textStyle.paddingBottom)
|
|
119
|
+
const borderTopWidth = XEUtils.toNumber(textStyle.borderTopWidth)
|
|
120
|
+
const borderBottomWidth = XEUtils.toNumber(textStyle.borderBottomWidth)
|
|
121
|
+
const intervalHeight = paddingTop + paddingBottom + borderTopWidth + borderBottomWidth
|
|
122
|
+
const rowNum = (sizeHeight - intervalHeight) / lineHeight
|
|
123
|
+
const textRows = rowNum && /[0-9]/.test('' + rowNum) ? rowNum : Math.floor(rowNum) + 1
|
|
124
|
+
let vaildRows = textRows
|
|
125
|
+
if (textRows < minRows) {
|
|
126
|
+
vaildRows = minRows
|
|
127
|
+
} else if (textRows > maxRows) {
|
|
128
|
+
vaildRows = maxRows
|
|
129
|
+
}
|
|
130
|
+
textElem.style.height = `${(vaildRows * lineHeight) + intervalHeight}px`
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const triggerEvent = (evnt: Event & { type: 'focus' | 'blur' | 'change' }) => {
|
|
136
|
+
const value = reactData.inputValue
|
|
137
|
+
$xetextarea.dispatchEvent(evnt.type, { value }, evnt)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const emitUpdate = (value: string, evnt: Event) => {
|
|
141
|
+
reactData.inputValue = value
|
|
142
|
+
emit('update:modelValue', value)
|
|
143
|
+
if (XEUtils.toValueString(props.modelValue) !== value) {
|
|
144
|
+
textareaMethods.dispatchEvent('change', { value }, evnt)
|
|
145
|
+
// 自动更新校验状态
|
|
146
|
+
if ($xeform && $xeformiteminfo) {
|
|
147
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, value)
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const inputEvent = (evnt: InputEvent) => {
|
|
153
|
+
const { immediate } = props
|
|
154
|
+
const textElem = evnt.target as HTMLTextAreaElement
|
|
155
|
+
const value = textElem.value
|
|
156
|
+
reactData.inputValue = value
|
|
157
|
+
if (immediate) {
|
|
158
|
+
emitUpdate(value, evnt)
|
|
159
|
+
}
|
|
160
|
+
$xetextarea.dispatchEvent('input', { value }, evnt)
|
|
161
|
+
handleResize()
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const changeEvent = (evnt: Event & { type: 'change' }) => {
|
|
165
|
+
const { immediate } = props
|
|
166
|
+
if (immediate) {
|
|
167
|
+
triggerEvent(evnt)
|
|
168
|
+
} else {
|
|
169
|
+
emitUpdate(reactData.inputValue, evnt)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const blurEvent = (evnt: Event & { type: 'blur' }) => {
|
|
174
|
+
const { immediate } = props
|
|
175
|
+
const { inputValue } = reactData
|
|
176
|
+
if (!immediate) {
|
|
177
|
+
emitUpdate(inputValue, evnt)
|
|
178
|
+
}
|
|
179
|
+
$xetextarea.dispatchEvent('blur', { value: inputValue }, evnt)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
textareaMethods = {
|
|
183
|
+
dispatchEvent (type, params, evnt) {
|
|
184
|
+
emit(type, Object.assign({ $textarea: $xetextarea, $event: evnt }, params))
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
focus () {
|
|
188
|
+
const textElem = refTextarea.value
|
|
189
|
+
textElem.focus()
|
|
190
|
+
return nextTick()
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
blur () {
|
|
194
|
+
const textElem = refTextarea.value
|
|
195
|
+
textElem.blur()
|
|
196
|
+
return nextTick()
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
Object.assign($xetextarea, textareaMethods)
|
|
201
|
+
|
|
202
|
+
watch(() => props.modelValue, (val) => {
|
|
203
|
+
reactData.inputValue = val
|
|
204
|
+
updateAutoTxt()
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
nextTick(() => {
|
|
208
|
+
const { autosize } = props
|
|
209
|
+
if (autosize) {
|
|
210
|
+
updateAutoTxt()
|
|
211
|
+
handleResize()
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
const renderVN = () => {
|
|
216
|
+
const { className, resize, placeholder, disabled, maxlength, autosize, showWordCount, countMethod, rows, cols } = props
|
|
217
|
+
const { inputValue } = reactData
|
|
218
|
+
const vSize = computeSize.value
|
|
219
|
+
const isCountError = computeIsCountError.value
|
|
220
|
+
const inputCount = computeInputCount.value
|
|
221
|
+
return h('div', {
|
|
222
|
+
ref: refElem,
|
|
223
|
+
class: ['vxe-textarea', className, {
|
|
224
|
+
[`size--${vSize}`]: vSize,
|
|
225
|
+
'is--autosize': autosize,
|
|
226
|
+
'is--count': showWordCount,
|
|
227
|
+
'is--disabled': disabled,
|
|
228
|
+
'def--rows': !XEUtils.eqNull(rows),
|
|
229
|
+
'def--cols': !XEUtils.eqNull(cols)
|
|
230
|
+
}]
|
|
231
|
+
}, [
|
|
232
|
+
h('textarea', {
|
|
233
|
+
ref: refTextarea,
|
|
234
|
+
class: 'vxe-textarea--inner',
|
|
235
|
+
value: inputValue,
|
|
236
|
+
name: props.name,
|
|
237
|
+
placeholder: placeholder ? getFuncText(placeholder) : null,
|
|
238
|
+
maxlength,
|
|
239
|
+
readonly: props.readonly,
|
|
240
|
+
disabled,
|
|
241
|
+
rows,
|
|
242
|
+
cols,
|
|
243
|
+
style: resize
|
|
244
|
+
? {
|
|
245
|
+
resize
|
|
246
|
+
}
|
|
247
|
+
: null,
|
|
248
|
+
onInput: inputEvent,
|
|
249
|
+
onChange: changeEvent,
|
|
250
|
+
onKeydown: triggerEvent,
|
|
251
|
+
onKeyup: triggerEvent,
|
|
252
|
+
onClick: triggerEvent,
|
|
253
|
+
onFocus: triggerEvent,
|
|
254
|
+
onBlur: blurEvent
|
|
255
|
+
}),
|
|
256
|
+
showWordCount
|
|
257
|
+
? h('span', {
|
|
258
|
+
class: ['vxe-textarea--count', {
|
|
259
|
+
'is--error': isCountError
|
|
260
|
+
}]
|
|
261
|
+
}, countMethod ? `${countMethod({ value: inputValue })}` : `${inputCount}${maxlength ? `/${maxlength}` : ''}`)
|
|
262
|
+
: null
|
|
263
|
+
])
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
$xetextarea.renderVN = renderVN
|
|
267
|
+
|
|
268
|
+
return $xetextarea
|
|
269
|
+
},
|
|
270
|
+
render () {
|
|
271
|
+
return this.renderVN()
|
|
272
|
+
}
|
|
273
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import VxeTooltipComponent from './src/tooltip'
|
|
3
|
+
|
|
4
|
+
const VxeTooltip = Object.assign({}, VxeTooltipComponent, {
|
|
5
|
+
install (app: App) {
|
|
6
|
+
app.component(VxeTooltipComponent.name as string, VxeTooltipComponent)
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const Tooltip = VxeTooltip
|
|
11
|
+
export default VxeTooltip
|