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,360 @@
|
|
|
1
|
+
import { defineComponent, h, ref, Ref, nextTick, onBeforeUnmount, onMounted, reactive, watch, PropType } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import globalConfigStore from '../../ui/src/globalStore'
|
|
4
|
+
import { useSize } from '../../hooks/size'
|
|
5
|
+
import { getLastZIndex, nextZIndex, formatText } from '../../ui/src/utils'
|
|
6
|
+
import { getAbsolutePos, getDomNode } from '../../ui/src/dom'
|
|
7
|
+
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
|
+
|
|
9
|
+
import { VxeTooltipPropTypes, VxeTooltipConstructor, VxeTooltipEmits, TooltipReactData, TooltipMethods, TooltipPrivateRef } from '../../../types'
|
|
10
|
+
|
|
11
|
+
export default defineComponent({
|
|
12
|
+
name: 'VxeTooltip',
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: Boolean,
|
|
15
|
+
size: { type: String as PropType<VxeTooltipPropTypes.Size>, default: () => globalConfigStore.tooltip.size || globalConfigStore.size },
|
|
16
|
+
trigger: { type: String as PropType<VxeTooltipPropTypes.Trigger>, default: () => globalConfigStore.tooltip.trigger || 'hover' },
|
|
17
|
+
theme: { type: String as PropType<VxeTooltipPropTypes.Theme>, default: () => globalConfigStore.tooltip.theme || 'dark' },
|
|
18
|
+
content: { type: [String, Number] as PropType<VxeTooltipPropTypes.Content>, default: null },
|
|
19
|
+
useHTML: Boolean as PropType<VxeTooltipPropTypes.UseHTML>,
|
|
20
|
+
zIndex: [String, Number] as PropType<VxeTooltipPropTypes.ZIndex>,
|
|
21
|
+
popupClassName: [String, Function] as PropType<VxeTooltipPropTypes.PopupClassName>,
|
|
22
|
+
isArrow: { type: Boolean as PropType<VxeTooltipPropTypes.IsArrow>, default: true },
|
|
23
|
+
enterable: Boolean as PropType<VxeTooltipPropTypes.Enterable>,
|
|
24
|
+
enterDelay: { type: Number as PropType<VxeTooltipPropTypes.EnterDelay>, default: () => globalConfigStore.tooltip.enterDelay },
|
|
25
|
+
leaveDelay: { type: Number as PropType<VxeTooltipPropTypes.LeaveDelay>, default: () => globalConfigStore.tooltip.leaveDelay }
|
|
26
|
+
},
|
|
27
|
+
emits: [
|
|
28
|
+
'update:modelValue'
|
|
29
|
+
] as VxeTooltipEmits,
|
|
30
|
+
setup (props, context) {
|
|
31
|
+
const { slots, emit } = context
|
|
32
|
+
|
|
33
|
+
const xID = XEUtils.uniqueId()
|
|
34
|
+
|
|
35
|
+
const computeSize = useSize(props)
|
|
36
|
+
|
|
37
|
+
const reactData = reactive<TooltipReactData>({
|
|
38
|
+
target: null,
|
|
39
|
+
isUpdate: false,
|
|
40
|
+
visible: false,
|
|
41
|
+
tipContent: '',
|
|
42
|
+
tipActive: false,
|
|
43
|
+
tipTarget: null,
|
|
44
|
+
tipZindex: 0,
|
|
45
|
+
tipStore: {
|
|
46
|
+
style: {},
|
|
47
|
+
placement: '',
|
|
48
|
+
arrowStyle: {}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const refElem = ref() as Ref<HTMLDivElement>
|
|
53
|
+
|
|
54
|
+
const refMaps: TooltipPrivateRef = {
|
|
55
|
+
refElem
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const $xetooltip = {
|
|
59
|
+
xID,
|
|
60
|
+
props,
|
|
61
|
+
context,
|
|
62
|
+
reactData,
|
|
63
|
+
getRefMaps: () => refMaps
|
|
64
|
+
} as unknown as VxeTooltipConstructor
|
|
65
|
+
|
|
66
|
+
let tooltipMethods = {} as TooltipMethods
|
|
67
|
+
|
|
68
|
+
const updateTipStyle = () => {
|
|
69
|
+
const { tipTarget, tipStore } = reactData
|
|
70
|
+
if (tipTarget) {
|
|
71
|
+
const { scrollTop, scrollLeft, visibleWidth } = getDomNode()
|
|
72
|
+
const { top, left } = getAbsolutePos(tipTarget)
|
|
73
|
+
const el = refElem.value
|
|
74
|
+
const marginSize = 6
|
|
75
|
+
const offsetHeight = el.offsetHeight
|
|
76
|
+
const offsetWidth = el.offsetWidth
|
|
77
|
+
let tipLeft = left
|
|
78
|
+
let tipTop = top - offsetHeight - marginSize
|
|
79
|
+
tipLeft = Math.max(marginSize, left + Math.floor((tipTarget.offsetWidth - offsetWidth) / 2))
|
|
80
|
+
if (tipLeft + offsetWidth + marginSize > scrollLeft + visibleWidth) {
|
|
81
|
+
tipLeft = scrollLeft + visibleWidth - offsetWidth - marginSize
|
|
82
|
+
}
|
|
83
|
+
if (top - offsetHeight < scrollTop + marginSize) {
|
|
84
|
+
tipStore.placement = 'bottom'
|
|
85
|
+
tipTop = top + tipTarget.offsetHeight + marginSize
|
|
86
|
+
}
|
|
87
|
+
tipStore.style.top = `${tipTop}px`
|
|
88
|
+
tipStore.style.left = `${tipLeft}px`
|
|
89
|
+
tipStore.arrowStyle.left = `${left - tipLeft + tipTarget.offsetWidth / 2}px`
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const updateValue = (value: VxeTooltipPropTypes.ModelValue) => {
|
|
94
|
+
if (value !== reactData.visible) {
|
|
95
|
+
reactData.visible = value
|
|
96
|
+
reactData.isUpdate = true
|
|
97
|
+
emit('update:modelValue', value)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const updateZindex = () => {
|
|
102
|
+
if (reactData.tipZindex < getLastZIndex()) {
|
|
103
|
+
reactData.tipZindex = nextZIndex()
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const clickEvent = () => {
|
|
108
|
+
if (reactData.visible) {
|
|
109
|
+
tooltipMethods.close()
|
|
110
|
+
} else {
|
|
111
|
+
tooltipMethods.open()
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const targetMouseenterEvent = () => {
|
|
116
|
+
tooltipMethods.open()
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const targetMouseleaveEvent = () => {
|
|
120
|
+
const { trigger, enterable, leaveDelay } = props
|
|
121
|
+
reactData.tipActive = false
|
|
122
|
+
if (enterable && trigger === 'hover') {
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
if (!reactData.tipActive) {
|
|
125
|
+
tooltipMethods.close()
|
|
126
|
+
}
|
|
127
|
+
}, leaveDelay)
|
|
128
|
+
} else {
|
|
129
|
+
tooltipMethods.close()
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const wrapperMouseenterEvent = () => {
|
|
134
|
+
reactData.tipActive = true
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const wrapperMouseleaveEvent = () => {
|
|
138
|
+
const { trigger, enterable, leaveDelay } = props
|
|
139
|
+
reactData.tipActive = false
|
|
140
|
+
if (enterable && trigger === 'hover') {
|
|
141
|
+
setTimeout(() => {
|
|
142
|
+
if (!reactData.tipActive) {
|
|
143
|
+
tooltipMethods.close()
|
|
144
|
+
}
|
|
145
|
+
}, leaveDelay)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const showTip = () => {
|
|
150
|
+
const { tipStore } = reactData
|
|
151
|
+
const el = refElem.value
|
|
152
|
+
if (el) {
|
|
153
|
+
const parentNode = el.parentNode
|
|
154
|
+
if (!parentNode) {
|
|
155
|
+
document.body.appendChild(el)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
updateValue(true)
|
|
159
|
+
updateZindex()
|
|
160
|
+
tipStore.placement = 'top'
|
|
161
|
+
tipStore.style = { width: 'auto', left: 0, top: 0, zIndex: props.zIndex || reactData.tipZindex }
|
|
162
|
+
tipStore.arrowStyle = { left: '50%' }
|
|
163
|
+
return tooltipMethods.updatePlacement()
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const showDelayTip = XEUtils.debounce(() => {
|
|
167
|
+
if (reactData.tipActive) {
|
|
168
|
+
showTip()
|
|
169
|
+
}
|
|
170
|
+
}, props.enterDelay, { leading: false, trailing: true })
|
|
171
|
+
|
|
172
|
+
tooltipMethods = {
|
|
173
|
+
dispatchEvent (type, params, evnt) {
|
|
174
|
+
emit(type, Object.assign({ $tooltip: $xetooltip, $event: evnt }, params))
|
|
175
|
+
},
|
|
176
|
+
open (target?: HTMLElement, content?: VxeTooltipPropTypes.Content) {
|
|
177
|
+
return tooltipMethods.toVisible(target || reactData.target as HTMLElement, content)
|
|
178
|
+
},
|
|
179
|
+
close () {
|
|
180
|
+
reactData.tipTarget = null
|
|
181
|
+
reactData.tipActive = false
|
|
182
|
+
Object.assign(reactData.tipStore, {
|
|
183
|
+
style: {},
|
|
184
|
+
placement: '',
|
|
185
|
+
arrowStyle: null
|
|
186
|
+
})
|
|
187
|
+
updateValue(false)
|
|
188
|
+
return nextTick()
|
|
189
|
+
},
|
|
190
|
+
toVisible (target: HTMLElement, content?: VxeTooltipPropTypes.Content) {
|
|
191
|
+
if (target) {
|
|
192
|
+
const { trigger, enterDelay } = props
|
|
193
|
+
reactData.tipActive = true
|
|
194
|
+
reactData.tipTarget = target
|
|
195
|
+
if (content) {
|
|
196
|
+
reactData.tipContent = content
|
|
197
|
+
}
|
|
198
|
+
if (enterDelay && trigger === 'hover') {
|
|
199
|
+
showDelayTip()
|
|
200
|
+
} else {
|
|
201
|
+
return showTip()
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return nextTick()
|
|
205
|
+
},
|
|
206
|
+
updatePlacement () {
|
|
207
|
+
return nextTick().then(() => {
|
|
208
|
+
const { tipTarget } = reactData
|
|
209
|
+
const el = refElem.value
|
|
210
|
+
if (tipTarget && el) {
|
|
211
|
+
updateTipStyle()
|
|
212
|
+
return nextTick().then(updateTipStyle)
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
},
|
|
216
|
+
isActived () {
|
|
217
|
+
return reactData.tipActive
|
|
218
|
+
},
|
|
219
|
+
setActived (actived) {
|
|
220
|
+
reactData.tipActive = !!actived
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
Object.assign($xetooltip, tooltipMethods)
|
|
225
|
+
|
|
226
|
+
watch(() => props.content, () => {
|
|
227
|
+
reactData.tipContent = props.content
|
|
228
|
+
})
|
|
229
|
+
|
|
230
|
+
watch(() => props.modelValue, () => {
|
|
231
|
+
if (!reactData.isUpdate) {
|
|
232
|
+
if (props.modelValue) {
|
|
233
|
+
tooltipMethods.open()
|
|
234
|
+
} else {
|
|
235
|
+
tooltipMethods.close()
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
reactData.isUpdate = false
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
onMounted(() => {
|
|
242
|
+
nextTick(() => {
|
|
243
|
+
const { trigger, content, modelValue } = props
|
|
244
|
+
const wrapperElem = refElem.value
|
|
245
|
+
if (wrapperElem) {
|
|
246
|
+
const parentNode = wrapperElem.parentNode
|
|
247
|
+
if (parentNode) {
|
|
248
|
+
reactData.tipContent = content
|
|
249
|
+
reactData.tipZindex = nextZIndex()
|
|
250
|
+
XEUtils.arrayEach(wrapperElem.children, (elem, index) => {
|
|
251
|
+
if (index > 1) {
|
|
252
|
+
parentNode.insertBefore(elem, wrapperElem)
|
|
253
|
+
if (!reactData.target) {
|
|
254
|
+
reactData.target = elem as HTMLElement
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
})
|
|
258
|
+
parentNode.removeChild(wrapperElem)
|
|
259
|
+
const { target } = reactData
|
|
260
|
+
if (target) {
|
|
261
|
+
if (trigger === 'hover') {
|
|
262
|
+
target.onmouseenter = targetMouseenterEvent
|
|
263
|
+
target.onmouseleave = targetMouseleaveEvent
|
|
264
|
+
} else if (trigger === 'click') {
|
|
265
|
+
target.onclick = clickEvent
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (modelValue) {
|
|
269
|
+
tooltipMethods.open()
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
})
|
|
275
|
+
|
|
276
|
+
onBeforeUnmount(() => {
|
|
277
|
+
const { trigger } = props
|
|
278
|
+
const { target } = reactData
|
|
279
|
+
const wrapperElem = refElem.value
|
|
280
|
+
if (target) {
|
|
281
|
+
if (trigger === 'hover') {
|
|
282
|
+
target.onmouseenter = null
|
|
283
|
+
target.onmouseleave = null
|
|
284
|
+
} else if (trigger === 'click') {
|
|
285
|
+
target.onclick = null
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (wrapperElem) {
|
|
289
|
+
const parentNode = wrapperElem.parentNode
|
|
290
|
+
if (parentNode) {
|
|
291
|
+
parentNode.removeChild(wrapperElem)
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
})
|
|
295
|
+
|
|
296
|
+
const renderContent = () => {
|
|
297
|
+
const { useHTML } = props
|
|
298
|
+
const { tipContent } = reactData
|
|
299
|
+
const contentSlot = slots.content
|
|
300
|
+
if (contentSlot) {
|
|
301
|
+
return h('div', {
|
|
302
|
+
key: 1,
|
|
303
|
+
class: 'vxe-table--tooltip-content'
|
|
304
|
+
}, getSlotVNs(contentSlot({})))
|
|
305
|
+
}
|
|
306
|
+
if (useHTML) {
|
|
307
|
+
return h('div', {
|
|
308
|
+
key: 2,
|
|
309
|
+
class: 'vxe-table--tooltip-content',
|
|
310
|
+
innerHTML: tipContent
|
|
311
|
+
})
|
|
312
|
+
}
|
|
313
|
+
return h('div', {
|
|
314
|
+
key: 3,
|
|
315
|
+
class: 'vxe-table--tooltip-content'
|
|
316
|
+
}, formatText(tipContent))
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const renderVN = () => {
|
|
320
|
+
const { popupClassName, theme, isArrow, enterable } = props
|
|
321
|
+
const { tipActive, visible, tipStore } = reactData
|
|
322
|
+
const defaultSlot = slots.default
|
|
323
|
+
const vSize = computeSize.value
|
|
324
|
+
let ons
|
|
325
|
+
if (enterable) {
|
|
326
|
+
ons = {
|
|
327
|
+
onMouseenter: wrapperMouseenterEvent,
|
|
328
|
+
onMouseleave: wrapperMouseleaveEvent
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return h('div', {
|
|
332
|
+
ref: refElem,
|
|
333
|
+
class: ['vxe-table--tooltip-wrapper', `theme--${theme}`, popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $tooltip: $xetooltip }) : popupClassName) : '', {
|
|
334
|
+
[`size--${vSize}`]: vSize,
|
|
335
|
+
[`placement--${tipStore.placement}`]: tipStore.placement,
|
|
336
|
+
'is--enterable': enterable,
|
|
337
|
+
'is--visible': visible,
|
|
338
|
+
'is--arrow': isArrow,
|
|
339
|
+
'is--active': tipActive
|
|
340
|
+
}],
|
|
341
|
+
style: tipStore.style,
|
|
342
|
+
...ons
|
|
343
|
+
}, [
|
|
344
|
+
renderContent(),
|
|
345
|
+
h('div', {
|
|
346
|
+
class: 'vxe-table--tooltip-arrow',
|
|
347
|
+
style: tipStore.arrowStyle
|
|
348
|
+
}),
|
|
349
|
+
...(defaultSlot ? getSlotVNs(defaultSlot({})) : [])
|
|
350
|
+
])
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
$xetooltip.renderVN = renderVN
|
|
354
|
+
|
|
355
|
+
return $xetooltip
|
|
356
|
+
},
|
|
357
|
+
render () {
|
|
358
|
+
return this.renderVN()
|
|
359
|
+
}
|
|
360
|
+
})
|
package/packages/ui/src/core.ts
CHANGED
|
@@ -3,6 +3,9 @@ import DomZIndex from 'dom-zindex'
|
|
|
3
3
|
import globalConfigStore from './globalStore'
|
|
4
4
|
import iconConfigStore from './iconStore'
|
|
5
5
|
import setTheme from './theme'
|
|
6
|
+
import { getI18n } from './i18n'
|
|
7
|
+
import { renderer } from './renderer'
|
|
8
|
+
import { validators } from './validators'
|
|
6
9
|
|
|
7
10
|
import { VxeUIExport, VxeGlobalConfig } from '../../../types'
|
|
8
11
|
|
|
@@ -43,9 +46,18 @@ const VxeCore: VxeUIExport = {
|
|
|
43
46
|
setConfig,
|
|
44
47
|
getConfig,
|
|
45
48
|
setIcon,
|
|
46
|
-
getIcon
|
|
49
|
+
getIcon,
|
|
50
|
+
getI18n,
|
|
51
|
+
renderer,
|
|
52
|
+
validators,
|
|
53
|
+
|
|
54
|
+
modal: null as any
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
setTheme()
|
|
50
58
|
|
|
59
|
+
export * from './i18n'
|
|
60
|
+
export * from './renderer'
|
|
61
|
+
export * from './validators'
|
|
62
|
+
|
|
51
63
|
export default VxeCore
|
package/packages/ui/src/dom.ts
CHANGED
|
@@ -101,3 +101,26 @@ export function getAbsolutePos (elem: any) {
|
|
|
101
101
|
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
|
|
102
102
|
return { boundingTop, top: scrollTop + boundingTop, boundingLeft, left: scrollLeft + boundingLeft, visibleHeight, visibleWidth }
|
|
103
103
|
}
|
|
104
|
+
|
|
105
|
+
const scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded'
|
|
106
|
+
const scrollIntoView = 'scrollIntoView'
|
|
107
|
+
|
|
108
|
+
export function scrollToView (elem: any) {
|
|
109
|
+
if (elem) {
|
|
110
|
+
if (elem[scrollIntoViewIfNeeded]) {
|
|
111
|
+
elem[scrollIntoViewIfNeeded]()
|
|
112
|
+
} else if (elem[scrollIntoView]) {
|
|
113
|
+
elem[scrollIntoView]()
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function triggerEvent (targetElem: Element, type: string) {
|
|
119
|
+
if (targetElem) {
|
|
120
|
+
targetElem.dispatchEvent(new Event(type))
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function isNodeElement (elem: any): elem is HTMLElement {
|
|
125
|
+
return elem && elem.nodeType === 1
|
|
126
|
+
}
|
|
@@ -1,11 +1,128 @@
|
|
|
1
1
|
import { VxeGlobalConfig } from '../../../types'
|
|
2
2
|
|
|
3
|
-
const globalConfigStore: VxeGlobalConfig = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const globalConfigStore: Required<VxeGlobalConfig> = {
|
|
4
|
+
size: '',
|
|
5
|
+
theme: '',
|
|
6
|
+
version: 1,
|
|
7
|
+
zIndex: 999,
|
|
8
|
+
emptyCell: ' ',
|
|
9
|
+
loadingText: '',
|
|
10
|
+
|
|
11
|
+
i18n: (key: string) => key,
|
|
12
|
+
|
|
13
|
+
tooltip: {
|
|
14
|
+
// size: null,
|
|
15
|
+
trigger: 'hover',
|
|
16
|
+
theme: 'dark',
|
|
17
|
+
enterDelay: 500,
|
|
18
|
+
leaveDelay: 300
|
|
19
|
+
},
|
|
20
|
+
pager: {
|
|
21
|
+
// size: null,
|
|
22
|
+
// autoHidden: false,
|
|
23
|
+
// perfect: true,
|
|
24
|
+
// pageSize: 10,
|
|
25
|
+
// pagerCount: 7,
|
|
26
|
+
// pageSizes: [10, 15, 20, 50, 100],
|
|
27
|
+
// layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
|
|
28
|
+
},
|
|
29
|
+
form: {
|
|
30
|
+
// preventSubmit: false,
|
|
31
|
+
// size: null,
|
|
32
|
+
// colon: false,
|
|
33
|
+
validConfig: {
|
|
34
|
+
showMessage: true,
|
|
35
|
+
autoPos: true
|
|
36
|
+
},
|
|
37
|
+
tooltipConfig: {
|
|
38
|
+
enterable: true
|
|
39
|
+
},
|
|
40
|
+
titleAsterisk: true
|
|
41
|
+
},
|
|
42
|
+
input: {
|
|
43
|
+
// size: null,
|
|
44
|
+
// transfer: false
|
|
45
|
+
// parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
|
|
46
|
+
// labelFormat: '',
|
|
47
|
+
// valueFormat: '',
|
|
48
|
+
startDate: new Date(1900, 0, 1),
|
|
49
|
+
endDate: new Date(2100, 0, 1),
|
|
50
|
+
startDay: 1,
|
|
51
|
+
selectDay: 1,
|
|
52
|
+
digits: 2,
|
|
53
|
+
controls: true
|
|
54
|
+
},
|
|
55
|
+
textarea: {
|
|
56
|
+
// size: null,
|
|
57
|
+
// autosize: {
|
|
58
|
+
// minRows: 1,
|
|
59
|
+
// maxRows: 10
|
|
60
|
+
// }
|
|
61
|
+
},
|
|
62
|
+
select: {
|
|
63
|
+
// size: null,
|
|
64
|
+
// transfer: false,
|
|
65
|
+
// optionConfig: {
|
|
66
|
+
// keyField: '_X_OPTION_KEY'
|
|
67
|
+
// },
|
|
68
|
+
multiCharOverflow: 8
|
|
69
|
+
},
|
|
70
|
+
button: {
|
|
71
|
+
// size: null,
|
|
72
|
+
// transfer: false
|
|
73
|
+
},
|
|
74
|
+
buttonGroup: {
|
|
75
|
+
// size: null
|
|
76
|
+
},
|
|
77
|
+
radio: {
|
|
78
|
+
// size: null,
|
|
79
|
+
strict: true
|
|
80
|
+
},
|
|
81
|
+
radioButton: {
|
|
82
|
+
// size: null,
|
|
83
|
+
strict: true
|
|
84
|
+
},
|
|
85
|
+
radioGroup: {
|
|
86
|
+
// size: null,
|
|
87
|
+
strict: true
|
|
88
|
+
},
|
|
89
|
+
checkbox: {
|
|
90
|
+
// size: null
|
|
91
|
+
},
|
|
92
|
+
checkboxGroup: {
|
|
93
|
+
// size: null
|
|
94
|
+
},
|
|
95
|
+
switch: {
|
|
96
|
+
// size: null
|
|
97
|
+
},
|
|
98
|
+
modal: {
|
|
99
|
+
// size: null,
|
|
100
|
+
top: 15,
|
|
101
|
+
showHeader: true,
|
|
102
|
+
minWidth: 340,
|
|
103
|
+
minHeight: 140,
|
|
104
|
+
lockView: true,
|
|
105
|
+
mask: true,
|
|
106
|
+
duration: 3000,
|
|
107
|
+
marginSize: 0,
|
|
108
|
+
dblclickZoom: true,
|
|
109
|
+
showTitleOverflow: true,
|
|
110
|
+
animat: true,
|
|
111
|
+
showClose: true,
|
|
112
|
+
draggable: true,
|
|
113
|
+
// storage: false,
|
|
114
|
+
storageKey: 'VXE_MODAL_POSITION'
|
|
115
|
+
},
|
|
116
|
+
list: {
|
|
117
|
+
// size: null,
|
|
118
|
+
scrollY: {
|
|
119
|
+
enabled: true,
|
|
120
|
+
gt: 100
|
|
121
|
+
// oSize: 0
|
|
122
|
+
}
|
|
7
123
|
},
|
|
8
|
-
|
|
124
|
+
breadcrumb: {},
|
|
125
|
+
formDesign: {}
|
|
9
126
|
}
|
|
10
127
|
|
|
11
128
|
export default globalConfigStore
|
package/packages/ui/src/log.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getI18n } from './i18n'
|
|
2
2
|
|
|
3
3
|
export function getLog (message: string, params?: any) {
|
|
4
|
-
return `[vxe-table v${process.env.VUE_APP_VXE_TABLE_VERSION}] ${
|
|
4
|
+
return `[vxe-table v${process.env.VUE_APP_VXE_TABLE_VERSION}] ${getI18n(message, params)}`
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
function outLog (type: 'log' | 'warn' | 'error') {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { h } from 'vue'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
import { warnLog } from './log'
|
|
4
|
+
|
|
5
|
+
import { VxeGlobalRenderer, RendererOptions } from '../../../types'
|
|
6
|
+
|
|
7
|
+
const renderMap: Record<string, RendererOptions> = {
|
|
8
|
+
input: {
|
|
9
|
+
formDesignWidgetName: '输入框',
|
|
10
|
+
formDesignWidgetIcon: 'vxe-icon-feedback',
|
|
11
|
+
renderFormDesignWidgetView () {
|
|
12
|
+
return h('input', {
|
|
13
|
+
modelValue: ''
|
|
14
|
+
})
|
|
15
|
+
},
|
|
16
|
+
formDesignWidgetSettingFormData () {
|
|
17
|
+
return {}
|
|
18
|
+
},
|
|
19
|
+
formDesignWidgetSettingFormItems () {
|
|
20
|
+
return [
|
|
21
|
+
{ title: 'inout', field: 'dd', itemRender: { name: 'input' } }
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
textarea: {
|
|
26
|
+
formDesignWidgetName: '文本域',
|
|
27
|
+
formDesignWidgetIcon: 'vxe-icon-feedback',
|
|
28
|
+
renderFormDesignWidgetView () {
|
|
29
|
+
return h('textarea', {
|
|
30
|
+
modelValue: ''
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 全局渲染器
|
|
38
|
+
*/
|
|
39
|
+
export const renderer: VxeGlobalRenderer = {
|
|
40
|
+
mixin (opts) {
|
|
41
|
+
XEUtils.each(opts, (options, name) => renderer.add(name, options))
|
|
42
|
+
return renderer
|
|
43
|
+
},
|
|
44
|
+
get (name: string) {
|
|
45
|
+
return renderMap[name] || null
|
|
46
|
+
},
|
|
47
|
+
add (name, options) {
|
|
48
|
+
if (name && options) {
|
|
49
|
+
const renders: any = renderMap[name]
|
|
50
|
+
if (renders) {
|
|
51
|
+
// 检测是否覆盖
|
|
52
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
53
|
+
XEUtils.each(options, (val, key) => {
|
|
54
|
+
if (!XEUtils.eqNull(renders[key]) && renders[key] !== val) {
|
|
55
|
+
warnLog('vxe.error.coverProp', [`Renderer.${name}`, key])
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
Object.assign(renders, options)
|
|
61
|
+
} else {
|
|
62
|
+
renderMap[name] = options
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return renderer
|
|
66
|
+
},
|
|
67
|
+
delete (name) {
|
|
68
|
+
delete renderMap[name]
|
|
69
|
+
return renderer
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { warnLog } from '../../ui/src/log'
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 创建数据仓库
|
|
6
|
+
*/
|
|
7
|
+
export class Store {
|
|
8
|
+
private store: any = {}
|
|
9
|
+
|
|
10
|
+
mixin (options: any): Store {
|
|
11
|
+
XEUtils.each(options, (item, key) => {
|
|
12
|
+
this.add(key, item)
|
|
13
|
+
})
|
|
14
|
+
return this
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
has (name: string): boolean {
|
|
18
|
+
return !!this.get(name)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get (name: string): any {
|
|
22
|
+
return this.store[name]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
add (name: string, options: any): Store {
|
|
26
|
+
const conf = this.store[name]
|
|
27
|
+
// 检测是否覆盖
|
|
28
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
29
|
+
const confKeys = XEUtils.keys(conf)
|
|
30
|
+
XEUtils.each(options, (item, key) => {
|
|
31
|
+
if (confKeys.includes(key)) {
|
|
32
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
this.store[name] = conf ? XEUtils.merge(conf, options) : options
|
|
37
|
+
return this
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
delete (name: string): void {
|
|
41
|
+
delete this.store[name]
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
forEach (callback: any): void {
|
|
45
|
+
XEUtils.objectEach(this.store, callback)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default Store
|