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,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
|
+
var _globalStore = _interopRequireDefault(require("../../ui/src/globalStore"));
|
|
10
|
+
var _size = require("../../hooks/size");
|
|
11
|
+
var _utils = require("../../ui/src/utils");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
var _default = exports.default = (0, _vue.defineComponent)({
|
|
14
|
+
name: 'VxeSwitch',
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: [String, Number, Boolean],
|
|
17
|
+
disabled: Boolean,
|
|
18
|
+
size: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: () => _globalStore.default.switch.size || _globalStore.default.size
|
|
21
|
+
},
|
|
22
|
+
openLabel: String,
|
|
23
|
+
closeLabel: String,
|
|
24
|
+
openValue: {
|
|
25
|
+
type: [String, Number, Boolean],
|
|
26
|
+
default: true
|
|
27
|
+
},
|
|
28
|
+
closeValue: {
|
|
29
|
+
type: [String, Number, Boolean],
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
openIcon: String,
|
|
33
|
+
closeIcon: String
|
|
34
|
+
},
|
|
35
|
+
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
|
36
|
+
setup(props, context) {
|
|
37
|
+
const {
|
|
38
|
+
emit
|
|
39
|
+
} = context;
|
|
40
|
+
const $xeform = (0, _vue.inject)('$xeForm', null);
|
|
41
|
+
const $xeformiteminfo = (0, _vue.inject)('$xeFormItemInfo', null);
|
|
42
|
+
const xID = _xeUtils.default.uniqueId();
|
|
43
|
+
const computeSize = (0, _size.useSize)(props);
|
|
44
|
+
const reactData = (0, _vue.reactive)({
|
|
45
|
+
isActivated: false,
|
|
46
|
+
hasAnimat: false,
|
|
47
|
+
offsetLeft: 0
|
|
48
|
+
});
|
|
49
|
+
const $xeswitch = {
|
|
50
|
+
xID,
|
|
51
|
+
props,
|
|
52
|
+
context,
|
|
53
|
+
reactData
|
|
54
|
+
};
|
|
55
|
+
const refButton = (0, _vue.ref)();
|
|
56
|
+
let switchMethods = {};
|
|
57
|
+
const computeOnShowLabel = (0, _vue.computed)(() => {
|
|
58
|
+
return (0, _utils.getFuncText)(props.openLabel);
|
|
59
|
+
});
|
|
60
|
+
const computeOffShowLabel = (0, _vue.computed)(() => {
|
|
61
|
+
return (0, _utils.getFuncText)(props.closeLabel);
|
|
62
|
+
});
|
|
63
|
+
const computeIsChecked = (0, _vue.computed)(() => {
|
|
64
|
+
return props.modelValue === props.openValue;
|
|
65
|
+
});
|
|
66
|
+
let _atimeout;
|
|
67
|
+
const clickEvent = evnt => {
|
|
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', {
|
|
75
|
+
value
|
|
76
|
+
}, evnt);
|
|
77
|
+
// 自动更新校验状态
|
|
78
|
+
if ($xeform && $xeformiteminfo) {
|
|
79
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, value);
|
|
80
|
+
}
|
|
81
|
+
_atimeout = setTimeout(() => {
|
|
82
|
+
reactData.hasAnimat = false;
|
|
83
|
+
}, 400);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const focusEvent = evnt => {
|
|
87
|
+
reactData.isActivated = true;
|
|
88
|
+
switchMethods.dispatchEvent('focus', {
|
|
89
|
+
value: props.modelValue
|
|
90
|
+
}, evnt);
|
|
91
|
+
};
|
|
92
|
+
const blurEvent = evnt => {
|
|
93
|
+
reactData.isActivated = false;
|
|
94
|
+
switchMethods.dispatchEvent('blur', {
|
|
95
|
+
value: props.modelValue
|
|
96
|
+
}, evnt);
|
|
97
|
+
};
|
|
98
|
+
switchMethods = {
|
|
99
|
+
dispatchEvent(type, params, evnt) {
|
|
100
|
+
emit(type, Object.assign({
|
|
101
|
+
$switch: $xeswitch,
|
|
102
|
+
$event: evnt
|
|
103
|
+
}, params));
|
|
104
|
+
},
|
|
105
|
+
focus() {
|
|
106
|
+
const btnElem = refButton.value;
|
|
107
|
+
reactData.isActivated = true;
|
|
108
|
+
btnElem.focus();
|
|
109
|
+
return (0, _vue.nextTick)();
|
|
110
|
+
},
|
|
111
|
+
blur() {
|
|
112
|
+
const btnElem = refButton.value;
|
|
113
|
+
btnElem.blur();
|
|
114
|
+
reactData.isActivated = false;
|
|
115
|
+
return (0, _vue.nextTick)();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
Object.assign($xeswitch, switchMethods);
|
|
119
|
+
const renderVN = () => {
|
|
120
|
+
const {
|
|
121
|
+
disabled,
|
|
122
|
+
openIcon,
|
|
123
|
+
closeIcon
|
|
124
|
+
} = props;
|
|
125
|
+
const isChecked = computeIsChecked.value;
|
|
126
|
+
const vSize = computeSize.value;
|
|
127
|
+
const onShowLabel = computeOnShowLabel.value;
|
|
128
|
+
const offShowLabel = computeOffShowLabel.value;
|
|
129
|
+
return (0, _vue.h)('div', {
|
|
130
|
+
class: ['vxe-switch', isChecked ? 'is--on' : 'is--off', {
|
|
131
|
+
[`size--${vSize}`]: vSize,
|
|
132
|
+
'is--disabled': disabled,
|
|
133
|
+
'is--animat': reactData.hasAnimat
|
|
134
|
+
}]
|
|
135
|
+
}, [(0, _vue.h)('button', {
|
|
136
|
+
ref: refButton,
|
|
137
|
+
class: 'vxe-switch--button',
|
|
138
|
+
type: 'button',
|
|
139
|
+
disabled,
|
|
140
|
+
onClick: clickEvent,
|
|
141
|
+
onFocus: focusEvent,
|
|
142
|
+
onBlur: blurEvent
|
|
143
|
+
}, [(0, _vue.h)('span', {
|
|
144
|
+
class: 'vxe-switch--label vxe-switch--label-on'
|
|
145
|
+
}, [openIcon ? (0, _vue.h)('i', {
|
|
146
|
+
class: ['vxe-switch--label-icon', openIcon]
|
|
147
|
+
}) : (0, _vue.createCommentVNode)(), onShowLabel]), (0, _vue.h)('span', {
|
|
148
|
+
class: 'vxe-switch--label vxe-switch--label-off'
|
|
149
|
+
}, [closeIcon ? (0, _vue.h)('i', {
|
|
150
|
+
class: ['vxe-switch--label-icon', closeIcon]
|
|
151
|
+
}) : (0, _vue.createCommentVNode)(), offShowLabel]), (0, _vue.h)('span', {
|
|
152
|
+
class: 'vxe-switch--icon'
|
|
153
|
+
})])]);
|
|
154
|
+
};
|
|
155
|
+
$xeswitch.renderVN = renderVN;
|
|
156
|
+
return $xeswitch;
|
|
157
|
+
},
|
|
158
|
+
render() {
|
|
159
|
+
return this.renderVN();
|
|
160
|
+
}
|
|
161
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_globalStore=_interopRequireDefault(require("../../ui/src/globalStore")),_size=require("../../hooks/size"),_utils=require("../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_vue.defineComponent)({name:"VxeSwitch",props:{modelValue:[String,Number,Boolean],disabled:Boolean,size:{type:String,default:()=>_globalStore.default.switch.size||_globalStore.default.size},openLabel:String,closeLabel:String,openValue:{type:[String,Number,Boolean],default:!0},closeValue:{type:[String,Number,Boolean],default:!1},openIcon:String,closeIcon:String},emits:["update:modelValue","change","focus","blur"],setup(o,e){const l=e["emit"],u=(0,_vue.inject)("$xeForm",null),a=(0,_vue.inject)("$xeFormItemInfo",null);var t=_xeUtils.default.uniqueId();const n=(0,_size.useSize)(o),r=(0,_vue.reactive)({isActivated:!1,hasAnimat:!1,offsetLeft:0}),i={xID:t,props:o,context:e,reactData:r},c=(0,_vue.ref)();let s={};const v=(0,_vue.computed)(()=>(0,_utils.getFuncText)(o.openLabel)),d=(0,_vue.computed)(()=>(0,_utils.getFuncText)(o.closeLabel)),_=(0,_vue.computed)(()=>o.modelValue===o.openValue);let p;const b=e=>{var t;o.disabled||(t=_.value,clearTimeout(p),t=t?o.closeValue:o.openValue,r.hasAnimat=!0,l("update:modelValue",t),s.dispatchEvent("change",{value:t},e),u&&a&&u.triggerItemEvent(e,a.itemConfig.field,t),p=setTimeout(()=>{r.hasAnimat=!1},400))},f=e=>{r.isActivated=!0,s.dispatchEvent("focus",{value:o.modelValue},e)},m=e=>{r.isActivated=!1,s.dispatchEvent("blur",{value:o.modelValue},e)};s={dispatchEvent(e,t,u){l(e,Object.assign({$switch:i,$event:u},t))},focus(){var e=c.value;return r.isActivated=!0,e.focus(),(0,_vue.nextTick)()},blur(){return c.value.blur(),(r.isActivated=!1,_vue.nextTick)()}},Object.assign(i,s);return i.renderVN=()=>{var{disabled:e,openIcon:t,closeIcon:u}=o,l=_.value,a=n.value,i=v.value,s=d.value;return(0,_vue.h)("div",{class:["vxe-switch",l?"is--on":"is--off",{["size--"+a]:a,"is--disabled":e,"is--animat":r.hasAnimat}]},[(0,_vue.h)("button",{ref:c,class:"vxe-switch--button",type:"button",disabled:e,onClick:b,onFocus:f,onBlur:m},[(0,_vue.h)("span",{class:"vxe-switch--label vxe-switch--label-on"},[t?(0,_vue.h)("i",{class:["vxe-switch--label-icon",t]}):(0,_vue.createCommentVNode)(),i]),(0,_vue.h)("span",{class:"vxe-switch--label vxe-switch--label-off"},[u?(0,_vue.h)("i",{class:["vxe-switch--label-icon",u]}):(0,_vue.createCommentVNode)(),s]),(0,_vue.h)("span",{class:"vxe-switch--icon"})])])},i},render(){return this.renderVN()}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./style.css')
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.vxe-switch {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
color: var(--vxe-font-color);
|
|
4
|
+
vertical-align: middle;
|
|
5
|
+
padding: 0.4em;
|
|
6
|
+
-webkit-user-select: none;
|
|
7
|
+
-moz-user-select: none;
|
|
8
|
+
user-select: none;
|
|
9
|
+
text-align: center;
|
|
10
|
+
}
|
|
11
|
+
.vxe-switch.is--animat .vxe-switch--button {
|
|
12
|
+
transition: border-color 0.3s, background-color 0.3s;
|
|
13
|
+
}
|
|
14
|
+
.vxe-switch.is--animat .vxe-switch--icon {
|
|
15
|
+
transition: all 0.3s;
|
|
16
|
+
}
|
|
17
|
+
.vxe-switch.is--on .vxe-switch--button {
|
|
18
|
+
padding-right: 1.7em;
|
|
19
|
+
background-color: var(--vxe-ui-switch-open-background-color);
|
|
20
|
+
}
|
|
21
|
+
.vxe-switch.is--on .vxe-switch--icon {
|
|
22
|
+
left: 100%;
|
|
23
|
+
transform: translateX(-1.4em);
|
|
24
|
+
}
|
|
25
|
+
.vxe-switch.is--off .vxe-switch--button {
|
|
26
|
+
padding-left: 1.7em;
|
|
27
|
+
background-color: var(--vxe-ui-switch-close-background-color);
|
|
28
|
+
}
|
|
29
|
+
.vxe-switch.is--off .vxe-switch--icon {
|
|
30
|
+
left: 0.2em;
|
|
31
|
+
transform: translateX(0);
|
|
32
|
+
}
|
|
33
|
+
.vxe-switch.is--on .vxe-switch--label-off, .vxe-switch.is--off .vxe-switch--label-on {
|
|
34
|
+
height: 0;
|
|
35
|
+
visibility: hidden;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
}
|
|
38
|
+
.vxe-switch.is--on .vxe-switch--label, .vxe-switch.is--off .vxe-switch--label {
|
|
39
|
+
opacity: 1;
|
|
40
|
+
}
|
|
41
|
+
.vxe-switch:not(.is--disabled) .vxe-switch--button {
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
}
|
|
44
|
+
.vxe-switch:not(.is--disabled) .vxe-switch--button:focus {
|
|
45
|
+
box-shadow: 0 0 0.4em 0 var(--vxe-primary-color);
|
|
46
|
+
}
|
|
47
|
+
.vxe-switch.is--disabled .vxe-switch--button {
|
|
48
|
+
cursor: no-drop;
|
|
49
|
+
}
|
|
50
|
+
.vxe-switch.is--disabled.is--on .vxe-switch--button {
|
|
51
|
+
background-color: var(--vxe-primary-lighten-color);
|
|
52
|
+
}
|
|
53
|
+
.vxe-switch.is--disabled.is--off .vxe-switch--button {
|
|
54
|
+
background-color: var(--vxe-ui-switch-disabled-background-color);
|
|
55
|
+
}
|
|
56
|
+
.vxe-switch .vxe-switch--button {
|
|
57
|
+
display: block;
|
|
58
|
+
position: relative;
|
|
59
|
+
height: 1.6em;
|
|
60
|
+
line-height: 1;
|
|
61
|
+
min-width: 3.2em;
|
|
62
|
+
padding: 0 0.6em;
|
|
63
|
+
border-radius: 1em;
|
|
64
|
+
border: 0;
|
|
65
|
+
outline: 0;
|
|
66
|
+
}
|
|
67
|
+
.vxe-switch .vxe-switch--label {
|
|
68
|
+
opacity: 0;
|
|
69
|
+
display: block;
|
|
70
|
+
color: var(--vxe-ui-switch-font-color);
|
|
71
|
+
font-size: 0.8em;
|
|
72
|
+
}
|
|
73
|
+
.vxe-switch .vxe-switch--icon {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: 0.2em;
|
|
76
|
+
left: 0;
|
|
77
|
+
width: 1.2em;
|
|
78
|
+
height: 1.2em;
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
background-color: var(--vxe-ui-switch-icon-background-color);
|
|
81
|
+
}
|
|
82
|
+
.vxe-switch .vxe-switch--label-icon {
|
|
83
|
+
margin-right: 0.25em;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.vxe-switch {
|
|
87
|
+
font-size: var(--vxe-font-size);
|
|
88
|
+
}
|
|
89
|
+
.vxe-switch.size--medium {
|
|
90
|
+
font-size: var(--vxe-font-size-medium);
|
|
91
|
+
}
|
|
92
|
+
.vxe-switch.size--small {
|
|
93
|
+
font-size: var(--vxe-font-size-small);
|
|
94
|
+
}
|
|
95
|
+
.vxe-switch.size--mini {
|
|
96
|
+
font-size: var(--vxe-font-size-mini);
|
|
97
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vxe-switch{display:inline-block;color:var(--vxe-font-color);vertical-align:middle;padding:.4em;-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.vxe-switch.is--animat .vxe-switch--button{transition:border-color .3s,background-color .3s}.vxe-switch.is--animat .vxe-switch--icon{transition:all .3s}.vxe-switch.is--on .vxe-switch--button{padding-right:1.7em;background-color:var(--vxe-ui-switch-open-background-color)}.vxe-switch.is--on .vxe-switch--icon{left:100%;transform:translateX(-1.4em)}.vxe-switch.is--off .vxe-switch--button{padding-left:1.7em;background-color:var(--vxe-ui-switch-close-background-color)}.vxe-switch.is--off .vxe-switch--icon{left:.2em;transform:translateX(0)}.vxe-switch.is--off .vxe-switch--label-on,.vxe-switch.is--on .vxe-switch--label-off{height:0;visibility:hidden;overflow:hidden}.vxe-switch.is--off .vxe-switch--label,.vxe-switch.is--on .vxe-switch--label{opacity:1}.vxe-switch:not(.is--disabled) .vxe-switch--button{cursor:pointer}.vxe-switch:not(.is--disabled) .vxe-switch--button:focus{box-shadow:0 0 .4em 0 var(--vxe-primary-color)}.vxe-switch.is--disabled .vxe-switch--button{cursor:no-drop}.vxe-switch.is--disabled.is--on .vxe-switch--button{background-color:var(--vxe-primary-lighten-color)}.vxe-switch.is--disabled.is--off .vxe-switch--button{background-color:var(--vxe-ui-switch-disabled-background-color)}.vxe-switch .vxe-switch--button{display:block;position:relative;height:1.6em;line-height:1;min-width:3.2em;padding:0 .6em;border-radius:1em;border:0;outline:0}.vxe-switch .vxe-switch--label{opacity:0;display:block;color:var(--vxe-ui-switch-font-color);font-size:.8em}.vxe-switch .vxe-switch--icon{position:absolute;top:.2em;left:0;width:1.2em;height:1.2em;border-radius:50%;background-color:var(--vxe-ui-switch-icon-background-color)}.vxe-switch .vxe-switch--label-icon{margin-right:.25em}.vxe-switch{font-size:var(--vxe-font-size)}.vxe-switch.size--medium{font-size:var(--vxe-font-size-medium)}.vxe-switch.size--small{font-size:var(--vxe-font-size-small)}.vxe-switch.size--mini{font-size:var(--vxe-font-size-mini)}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.VxeTextarea = exports.Textarea = void 0;
|
|
7
|
+
var _textarea = _interopRequireDefault(require("./src/textarea"));
|
|
8
|
+
var _dynamics = require("../dynamics");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const VxeTextarea = exports.VxeTextarea = Object.assign(_textarea.default, {
|
|
11
|
+
install: function (app) {
|
|
12
|
+
app.component(_textarea.default.name, _textarea.default);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const Textarea = exports.Textarea = VxeTextarea;
|
|
16
|
+
_dynamics.dynamicApp.component(_textarea.default.name, _textarea.default);
|
|
17
|
+
var _default = exports.default = VxeTextarea;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.VxeTextarea=exports.Textarea=void 0;var _textarea=_interopRequireDefault(require("./src/textarea")),_dynamics=require("../dynamics");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const VxeTextarea=exports.VxeTextarea=Object.assign(_textarea.default,{install:function(e){e.component(_textarea.default.name,_textarea.default)}}),Textarea=exports.Textarea=VxeTextarea;_dynamics.dynamicApp.component(_textarea.default.name,_textarea.default);var _default=exports.default=VxeTextarea;
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
|
+
var _globalStore = _interopRequireDefault(require("../../ui/src/globalStore"));
|
|
10
|
+
var _utils = require("../../ui/src/utils");
|
|
11
|
+
var _i18n = require("../../ui/src/i18n");
|
|
12
|
+
var _size = require("../../hooks/size");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
let autoTxtElem;
|
|
15
|
+
var _default = exports.default = (0, _vue.defineComponent)({
|
|
16
|
+
name: 'VxeTextarea',
|
|
17
|
+
props: {
|
|
18
|
+
modelValue: [String, Number],
|
|
19
|
+
className: String,
|
|
20
|
+
immediate: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: true
|
|
23
|
+
},
|
|
24
|
+
name: String,
|
|
25
|
+
readonly: Boolean,
|
|
26
|
+
disabled: Boolean,
|
|
27
|
+
placeholder: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: () => _xeUtils.default.eqNull(_globalStore.default.textarea.placeholder) ? (0, _i18n.getI18n)('vxe.base.pleaseInput') : _globalStore.default.textarea.placeholder
|
|
30
|
+
},
|
|
31
|
+
maxlength: [String, Number],
|
|
32
|
+
rows: {
|
|
33
|
+
type: [String, Number],
|
|
34
|
+
default: 2
|
|
35
|
+
},
|
|
36
|
+
cols: {
|
|
37
|
+
type: [String, Number],
|
|
38
|
+
default: null
|
|
39
|
+
},
|
|
40
|
+
showWordCount: Boolean,
|
|
41
|
+
countMethod: Function,
|
|
42
|
+
autosize: [Boolean, Object],
|
|
43
|
+
form: String,
|
|
44
|
+
resize: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: () => _globalStore.default.textarea.resize
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: () => _globalStore.default.textarea.size || _globalStore.default.size
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
emits: ['update:modelValue', 'input', 'keydown', 'keyup', 'click', 'change', 'focus', 'blur'],
|
|
54
|
+
setup(props, context) {
|
|
55
|
+
const {
|
|
56
|
+
emit
|
|
57
|
+
} = context;
|
|
58
|
+
const $xeform = (0, _vue.inject)('$xeForm', null);
|
|
59
|
+
const $xeformiteminfo = (0, _vue.inject)('$xeFormItemInfo', null);
|
|
60
|
+
const xID = _xeUtils.default.uniqueId();
|
|
61
|
+
const computeSize = (0, _size.useSize)(props);
|
|
62
|
+
const reactData = (0, _vue.reactive)({
|
|
63
|
+
inputValue: props.modelValue
|
|
64
|
+
});
|
|
65
|
+
const refElem = (0, _vue.ref)();
|
|
66
|
+
const refTextarea = (0, _vue.ref)();
|
|
67
|
+
const refMaps = {
|
|
68
|
+
refElem,
|
|
69
|
+
refTextarea
|
|
70
|
+
};
|
|
71
|
+
const $xetextarea = {
|
|
72
|
+
xID,
|
|
73
|
+
props,
|
|
74
|
+
context,
|
|
75
|
+
reactData,
|
|
76
|
+
getRefMaps: () => refMaps
|
|
77
|
+
};
|
|
78
|
+
let textareaMethods = {};
|
|
79
|
+
const computeInputCount = (0, _vue.computed)(() => {
|
|
80
|
+
return _xeUtils.default.getSize(reactData.inputValue);
|
|
81
|
+
});
|
|
82
|
+
const computeIsCountError = (0, _vue.computed)(() => {
|
|
83
|
+
const inputCount = computeInputCount.value;
|
|
84
|
+
return props.maxlength && inputCount > _xeUtils.default.toNumber(props.maxlength);
|
|
85
|
+
});
|
|
86
|
+
const computeSizeOpts = (0, _vue.computed)(() => {
|
|
87
|
+
return Object.assign({
|
|
88
|
+
minRows: 1,
|
|
89
|
+
maxRows: 10
|
|
90
|
+
}, _globalStore.default.textarea.autosize, props.autosize);
|
|
91
|
+
});
|
|
92
|
+
const updateAutoTxt = () => {
|
|
93
|
+
const {
|
|
94
|
+
size,
|
|
95
|
+
autosize
|
|
96
|
+
} = props;
|
|
97
|
+
const {
|
|
98
|
+
inputValue
|
|
99
|
+
} = reactData;
|
|
100
|
+
if (autosize) {
|
|
101
|
+
if (!autoTxtElem) {
|
|
102
|
+
autoTxtElem = document.createElement('div');
|
|
103
|
+
}
|
|
104
|
+
if (!autoTxtElem.parentNode) {
|
|
105
|
+
document.body.appendChild(autoTxtElem);
|
|
106
|
+
}
|
|
107
|
+
const textElem = refTextarea.value;
|
|
108
|
+
const textStyle = getComputedStyle(textElem);
|
|
109
|
+
autoTxtElem.className = ['vxe-textarea--autosize', size ? `size--${size}` : ''].join(' ');
|
|
110
|
+
autoTxtElem.style.width = `${textElem.clientWidth}px`;
|
|
111
|
+
autoTxtElem.style.padding = textStyle.padding;
|
|
112
|
+
autoTxtElem.innerText = ('' + (inputValue || ' ')).replace(/\n$/, '\n ');
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const handleResize = () => {
|
|
116
|
+
if (props.autosize) {
|
|
117
|
+
(0, _vue.nextTick)(() => {
|
|
118
|
+
const sizeOpts = computeSizeOpts.value;
|
|
119
|
+
const {
|
|
120
|
+
minRows,
|
|
121
|
+
maxRows
|
|
122
|
+
} = sizeOpts;
|
|
123
|
+
const textElem = refTextarea.value;
|
|
124
|
+
const sizeHeight = autoTxtElem.clientHeight;
|
|
125
|
+
const textStyle = getComputedStyle(textElem);
|
|
126
|
+
const lineHeight = _xeUtils.default.toNumber(textStyle.lineHeight);
|
|
127
|
+
const paddingTop = _xeUtils.default.toNumber(textStyle.paddingTop);
|
|
128
|
+
const paddingBottom = _xeUtils.default.toNumber(textStyle.paddingBottom);
|
|
129
|
+
const borderTopWidth = _xeUtils.default.toNumber(textStyle.borderTopWidth);
|
|
130
|
+
const borderBottomWidth = _xeUtils.default.toNumber(textStyle.borderBottomWidth);
|
|
131
|
+
const intervalHeight = paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;
|
|
132
|
+
const rowNum = (sizeHeight - intervalHeight) / lineHeight;
|
|
133
|
+
const textRows = rowNum && /[0-9]/.test('' + rowNum) ? rowNum : Math.floor(rowNum) + 1;
|
|
134
|
+
let vaildRows = textRows;
|
|
135
|
+
if (textRows < minRows) {
|
|
136
|
+
vaildRows = minRows;
|
|
137
|
+
} else if (textRows > maxRows) {
|
|
138
|
+
vaildRows = maxRows;
|
|
139
|
+
}
|
|
140
|
+
textElem.style.height = `${vaildRows * lineHeight + intervalHeight}px`;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const triggerEvent = evnt => {
|
|
145
|
+
const value = reactData.inputValue;
|
|
146
|
+
$xetextarea.dispatchEvent(evnt.type, {
|
|
147
|
+
value
|
|
148
|
+
}, evnt);
|
|
149
|
+
};
|
|
150
|
+
const emitUpdate = (value, evnt) => {
|
|
151
|
+
reactData.inputValue = value;
|
|
152
|
+
emit('update:modelValue', value);
|
|
153
|
+
if (_xeUtils.default.toValueString(props.modelValue) !== value) {
|
|
154
|
+
textareaMethods.dispatchEvent('change', {
|
|
155
|
+
value
|
|
156
|
+
}, evnt);
|
|
157
|
+
// 自动更新校验状态
|
|
158
|
+
if ($xeform && $xeformiteminfo) {
|
|
159
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, value);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const inputEvent = evnt => {
|
|
164
|
+
const {
|
|
165
|
+
immediate
|
|
166
|
+
} = props;
|
|
167
|
+
const textElem = evnt.target;
|
|
168
|
+
const value = textElem.value;
|
|
169
|
+
reactData.inputValue = value;
|
|
170
|
+
if (immediate) {
|
|
171
|
+
emitUpdate(value, evnt);
|
|
172
|
+
}
|
|
173
|
+
$xetextarea.dispatchEvent('input', {
|
|
174
|
+
value
|
|
175
|
+
}, evnt);
|
|
176
|
+
handleResize();
|
|
177
|
+
};
|
|
178
|
+
const changeEvent = evnt => {
|
|
179
|
+
const {
|
|
180
|
+
immediate
|
|
181
|
+
} = props;
|
|
182
|
+
if (immediate) {
|
|
183
|
+
triggerEvent(evnt);
|
|
184
|
+
} else {
|
|
185
|
+
emitUpdate(reactData.inputValue, evnt);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
const blurEvent = evnt => {
|
|
189
|
+
const {
|
|
190
|
+
immediate
|
|
191
|
+
} = props;
|
|
192
|
+
const {
|
|
193
|
+
inputValue
|
|
194
|
+
} = reactData;
|
|
195
|
+
if (!immediate) {
|
|
196
|
+
emitUpdate(inputValue, evnt);
|
|
197
|
+
}
|
|
198
|
+
$xetextarea.dispatchEvent('blur', {
|
|
199
|
+
value: inputValue
|
|
200
|
+
}, evnt);
|
|
201
|
+
};
|
|
202
|
+
textareaMethods = {
|
|
203
|
+
dispatchEvent(type, params, evnt) {
|
|
204
|
+
emit(type, Object.assign({
|
|
205
|
+
$textarea: $xetextarea,
|
|
206
|
+
$event: evnt
|
|
207
|
+
}, params));
|
|
208
|
+
},
|
|
209
|
+
focus() {
|
|
210
|
+
const textElem = refTextarea.value;
|
|
211
|
+
textElem.focus();
|
|
212
|
+
return (0, _vue.nextTick)();
|
|
213
|
+
},
|
|
214
|
+
blur() {
|
|
215
|
+
const textElem = refTextarea.value;
|
|
216
|
+
textElem.blur();
|
|
217
|
+
return (0, _vue.nextTick)();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
Object.assign($xetextarea, textareaMethods);
|
|
221
|
+
(0, _vue.watch)(() => props.modelValue, val => {
|
|
222
|
+
reactData.inputValue = val;
|
|
223
|
+
updateAutoTxt();
|
|
224
|
+
});
|
|
225
|
+
(0, _vue.nextTick)(() => {
|
|
226
|
+
const {
|
|
227
|
+
autosize
|
|
228
|
+
} = props;
|
|
229
|
+
if (autosize) {
|
|
230
|
+
updateAutoTxt();
|
|
231
|
+
handleResize();
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
const renderVN = () => {
|
|
235
|
+
const {
|
|
236
|
+
className,
|
|
237
|
+
resize,
|
|
238
|
+
placeholder,
|
|
239
|
+
disabled,
|
|
240
|
+
maxlength,
|
|
241
|
+
autosize,
|
|
242
|
+
showWordCount,
|
|
243
|
+
countMethod,
|
|
244
|
+
rows,
|
|
245
|
+
cols
|
|
246
|
+
} = props;
|
|
247
|
+
const {
|
|
248
|
+
inputValue
|
|
249
|
+
} = reactData;
|
|
250
|
+
const vSize = computeSize.value;
|
|
251
|
+
const isCountError = computeIsCountError.value;
|
|
252
|
+
const inputCount = computeInputCount.value;
|
|
253
|
+
return (0, _vue.h)('div', {
|
|
254
|
+
ref: refElem,
|
|
255
|
+
class: ['vxe-textarea', className, {
|
|
256
|
+
[`size--${vSize}`]: vSize,
|
|
257
|
+
'is--autosize': autosize,
|
|
258
|
+
'is--count': showWordCount,
|
|
259
|
+
'is--disabled': disabled,
|
|
260
|
+
'def--rows': !_xeUtils.default.eqNull(rows),
|
|
261
|
+
'def--cols': !_xeUtils.default.eqNull(cols)
|
|
262
|
+
}]
|
|
263
|
+
}, [(0, _vue.h)('textarea', {
|
|
264
|
+
ref: refTextarea,
|
|
265
|
+
class: 'vxe-textarea--inner',
|
|
266
|
+
value: inputValue,
|
|
267
|
+
name: props.name,
|
|
268
|
+
placeholder: placeholder ? (0, _utils.getFuncText)(placeholder) : null,
|
|
269
|
+
maxlength,
|
|
270
|
+
readonly: props.readonly,
|
|
271
|
+
disabled,
|
|
272
|
+
rows,
|
|
273
|
+
cols,
|
|
274
|
+
style: resize ? {
|
|
275
|
+
resize
|
|
276
|
+
} : null,
|
|
277
|
+
onInput: inputEvent,
|
|
278
|
+
onChange: changeEvent,
|
|
279
|
+
onKeydown: triggerEvent,
|
|
280
|
+
onKeyup: triggerEvent,
|
|
281
|
+
onClick: triggerEvent,
|
|
282
|
+
onFocus: triggerEvent,
|
|
283
|
+
onBlur: blurEvent
|
|
284
|
+
}), showWordCount ? (0, _vue.h)('span', {
|
|
285
|
+
class: ['vxe-textarea--count', {
|
|
286
|
+
'is--error': isCountError
|
|
287
|
+
}]
|
|
288
|
+
}, countMethod ? `${countMethod({
|
|
289
|
+
value: inputValue
|
|
290
|
+
})}` : `${inputCount}${maxlength ? `/${maxlength}` : ''}`) : null]);
|
|
291
|
+
};
|
|
292
|
+
$xetextarea.renderVN = renderVN;
|
|
293
|
+
return $xetextarea;
|
|
294
|
+
},
|
|
295
|
+
render() {
|
|
296
|
+
return this.renderVN();
|
|
297
|
+
}
|
|
298
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_globalStore=_interopRequireDefault(require("../../ui/src/globalStore")),_utils=require("../../ui/src/utils"),_i18n=require("../../ui/src/i18n"),_size=require("../../hooks/size");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let autoTxtElem;var _default=exports.default=(0,_vue.defineComponent)({name:"VxeTextarea",props:{modelValue:[String,Number],className:String,immediate:{type:Boolean,default:!0},name:String,readonly:Boolean,disabled:Boolean,placeholder:{type:String,default:()=>_xeUtils.default.eqNull(_globalStore.default.textarea.placeholder)?(0,_i18n.getI18n)("vxe.base.pleaseInput"):_globalStore.default.textarea.placeholder},maxlength:[String,Number],rows:{type:[String,Number],default:2},cols:{type:[String,Number],default:null},showWordCount:Boolean,countMethod:Function,autosize:[Boolean,Object],form:String,resize:{type:String,default:()=>_globalStore.default.textarea.resize},size:{type:String,default:()=>_globalStore.default.textarea.size||_globalStore.default.size}},emits:["update:modelValue","input","keydown","keyup","click","change","focus","blur"],setup(v,e){const l=e["emit"],a=(0,_vue.inject)("$xeForm",null),u=(0,_vue.inject)("$xeFormItemInfo",null);var t=_xeUtils.default.uniqueId();const x=(0,_size.useSize)(v),_=(0,_vue.reactive)({inputValue:v.modelValue}),f=(0,_vue.ref)(),g=(0,_vue.ref)(),r={refElem:f,refTextarea:g},i={xID:t,props:v,context:e,reactData:_,getRefMaps:()=>r};let o;const h=(0,_vue.computed)(()=>_xeUtils.default.getSize(_.inputValue)),b=(0,_vue.computed)(()=>{var e=h.value;return v.maxlength&&e>_xeUtils.default.toNumber(v.maxlength)}),n=(0,_vue.computed)(()=>Object.assign({minRows:1,maxRows:10},_globalStore.default.textarea.autosize,v.autosize)),s=()=>{var e,{size:t,autosize:a}=v,l=_["inputValue"];a&&((autoTxtElem=autoTxtElem||document.createElement("div")).parentNode||document.body.appendChild(autoTxtElem),a=g.value,e=getComputedStyle(a),autoTxtElem.className=["vxe-textarea--autosize",t?"size--"+t:""].join(" "),autoTxtElem.style.width=a.clientWidth+"px",autoTxtElem.style.padding=e.padding,autoTxtElem.innerText=(""+(l||" ")).replace(/\n$/,"\n "))},d=()=>{v.autosize&&(0,_vue.nextTick)(()=>{var{minRows:e,maxRows:t}=n.value,a=g.value,l=autoTxtElem.clientHeight,u=getComputedStyle(a),r=_xeUtils.default.toNumber(u.lineHeight),u=_xeUtils.default.toNumber(u.paddingTop)+_xeUtils.default.toNumber(u.paddingBottom)+_xeUtils.default.toNumber(u.borderTopWidth)+_xeUtils.default.toNumber(u.borderBottomWidth),l=(l-u)/r,l=l&&/[0-9]/.test(""+l)?l:Math.floor(l)+1;let i=l;l<e?i=e:t<l&&(i=t),a.style.height=i*r+u+"px"})},z=e=>{var t=_.inputValue;i.dispatchEvent(e.type,{value:t},e)},m=(e,t)=>{_.inputValue=e,l("update:modelValue",e),_xeUtils.default.toValueString(v.modelValue)!==e&&(o.dispatchEvent("change",{value:e},t),a)&&u&&a.triggerItemEvent(t,u.itemConfig.field,e)},S=e=>{var t=v["immediate"],a=e.target.value;_.inputValue=a,t&&m(a,e),i.dispatchEvent("input",{value:a},e),d()},y=e=>{var t=v["immediate"];t?z(e):m(_.inputValue,e)},V=e=>{var t=v["immediate"],a=_["inputValue"];t||m(a,e),i.dispatchEvent("blur",{value:a},e)};o={dispatchEvent(e,t,a){l(e,Object.assign({$textarea:i,$event:a},t))},focus(){return g.value.focus(),(0,_vue.nextTick)()},blur(){return g.value.blur(),(0,_vue.nextTick)()}},Object.assign(i,o),(0,_vue.watch)(()=>v.modelValue,e=>{_.inputValue=e,s()}),(0,_vue.nextTick)(()=>{var e=v["autosize"];e&&(s(),d())});return i.renderVN=()=>{var{className:e,resize:t,placeholder:a,disabled:l,maxlength:u,autosize:r,showWordCount:i,countMethod:o,rows:n,cols:s}=v,d=_["inputValue"],m=x.value,p=b.value,c=h.value;return(0,_vue.h)("div",{ref:f,class:["vxe-textarea",e,{["size--"+m]:m,"is--autosize":r,"is--count":i,"is--disabled":l,"def--rows":!_xeUtils.default.eqNull(n),"def--cols":!_xeUtils.default.eqNull(s)}]},[(0,_vue.h)("textarea",{ref:g,class:"vxe-textarea--inner",value:d,name:v.name,placeholder:a?(0,_utils.getFuncText)(a):null,maxlength:u,readonly:v.readonly,disabled:l,rows:n,cols:s,style:t?{resize:t}:null,onInput:S,onChange:y,onKeydown:z,onKeyup:z,onClick:z,onFocus:z,onBlur:V}),i?(0,_vue.h)("span",{class:["vxe-textarea--count",{"is--error":p}]},o?""+o({value:d}):c+(u?"/"+u:"")):null])},i},render(){return this.renderVN()}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./style.css')
|