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,1064 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.msgQueue = exports.default = exports.allActivedModals = void 0;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
|
+
var _size = require("../../hooks/size");
|
|
10
|
+
var _dom = require("../../ui/src/dom");
|
|
11
|
+
var _utils = require("../../ui/src/utils");
|
|
12
|
+
var _log = require("../../ui/src/log");
|
|
13
|
+
var _event = require("../../ui/src/event");
|
|
14
|
+
var _globalStore = _interopRequireDefault(require("../../ui/src/globalStore"));
|
|
15
|
+
var _iconStore = _interopRequireDefault(require("../../ui/src/iconStore"));
|
|
16
|
+
var _button = _interopRequireDefault(require("../../button/src/button"));
|
|
17
|
+
var _index = _interopRequireDefault(require("../../loading/index"));
|
|
18
|
+
var _vn = require("../../ui/src/vn");
|
|
19
|
+
var _i18n = require("../../ui/src/i18n");
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
const allActivedModals = exports.allActivedModals = [];
|
|
22
|
+
const msgQueue = exports.msgQueue = [];
|
|
23
|
+
var _default = exports.default = (0, _vue.defineComponent)({
|
|
24
|
+
name: 'VxeModal',
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: Boolean,
|
|
27
|
+
id: String,
|
|
28
|
+
type: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: 'modal'
|
|
31
|
+
},
|
|
32
|
+
loading: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: null
|
|
35
|
+
},
|
|
36
|
+
status: String,
|
|
37
|
+
iconStatus: String,
|
|
38
|
+
className: String,
|
|
39
|
+
top: {
|
|
40
|
+
type: [Number, String],
|
|
41
|
+
default: () => _globalStore.default.modal.top
|
|
42
|
+
},
|
|
43
|
+
position: [String, Object],
|
|
44
|
+
title: String,
|
|
45
|
+
duration: {
|
|
46
|
+
type: [Number, String],
|
|
47
|
+
default: () => _globalStore.default.modal.duration
|
|
48
|
+
},
|
|
49
|
+
message: [Number, String],
|
|
50
|
+
content: [Number, String],
|
|
51
|
+
cancelButtonText: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: () => _globalStore.default.modal.cancelButtonText
|
|
54
|
+
},
|
|
55
|
+
confirmButtonText: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: () => _globalStore.default.modal.confirmButtonText
|
|
58
|
+
},
|
|
59
|
+
lockView: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: () => _globalStore.default.modal.lockView
|
|
62
|
+
},
|
|
63
|
+
lockScroll: Boolean,
|
|
64
|
+
mask: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: () => _globalStore.default.modal.mask
|
|
67
|
+
},
|
|
68
|
+
maskClosable: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: () => _globalStore.default.modal.maskClosable
|
|
71
|
+
},
|
|
72
|
+
escClosable: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: () => _globalStore.default.modal.escClosable
|
|
75
|
+
},
|
|
76
|
+
resize: Boolean,
|
|
77
|
+
showHeader: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: () => _globalStore.default.modal.showHeader
|
|
80
|
+
},
|
|
81
|
+
showFooter: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: () => _globalStore.default.modal.showFooter
|
|
84
|
+
},
|
|
85
|
+
showZoom: Boolean,
|
|
86
|
+
showClose: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: () => _globalStore.default.modal.showClose
|
|
89
|
+
},
|
|
90
|
+
dblclickZoom: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: () => _globalStore.default.modal.dblclickZoom
|
|
93
|
+
},
|
|
94
|
+
width: [Number, String],
|
|
95
|
+
height: [Number, String],
|
|
96
|
+
minWidth: {
|
|
97
|
+
type: [Number, String],
|
|
98
|
+
default: () => _globalStore.default.modal.minWidth
|
|
99
|
+
},
|
|
100
|
+
minHeight: {
|
|
101
|
+
type: [Number, String],
|
|
102
|
+
default: () => _globalStore.default.modal.minHeight
|
|
103
|
+
},
|
|
104
|
+
zIndex: Number,
|
|
105
|
+
marginSize: {
|
|
106
|
+
type: [Number, String],
|
|
107
|
+
default: () => _globalStore.default.modal.marginSize
|
|
108
|
+
},
|
|
109
|
+
fullscreen: Boolean,
|
|
110
|
+
draggable: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: () => _globalStore.default.modal.draggable
|
|
113
|
+
},
|
|
114
|
+
remember: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: () => _globalStore.default.modal.remember
|
|
117
|
+
},
|
|
118
|
+
destroyOnClose: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: () => _globalStore.default.modal.destroyOnClose
|
|
121
|
+
},
|
|
122
|
+
showTitleOverflow: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: () => _globalStore.default.modal.showTitleOverflow
|
|
125
|
+
},
|
|
126
|
+
transfer: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: () => _globalStore.default.modal.transfer
|
|
129
|
+
},
|
|
130
|
+
storage: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: () => _globalStore.default.modal.storage
|
|
133
|
+
},
|
|
134
|
+
storageKey: {
|
|
135
|
+
type: String,
|
|
136
|
+
default: () => _globalStore.default.modal.storageKey
|
|
137
|
+
},
|
|
138
|
+
animat: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: () => _globalStore.default.modal.animat
|
|
141
|
+
},
|
|
142
|
+
size: {
|
|
143
|
+
type: String,
|
|
144
|
+
default: () => _globalStore.default.modal.size || _globalStore.default.size
|
|
145
|
+
},
|
|
146
|
+
beforeHideMethod: {
|
|
147
|
+
type: Function,
|
|
148
|
+
default: () => _globalStore.default.modal.beforeHideMethod
|
|
149
|
+
},
|
|
150
|
+
slots: Object
|
|
151
|
+
},
|
|
152
|
+
emits: ['update:modelValue', 'show', 'hide', 'before-hide', 'close', 'confirm', 'cancel', 'zoom'],
|
|
153
|
+
setup(props, context) {
|
|
154
|
+
const {
|
|
155
|
+
slots,
|
|
156
|
+
emit
|
|
157
|
+
} = context;
|
|
158
|
+
const xID = _xeUtils.default.uniqueId();
|
|
159
|
+
const computeSize = (0, _size.useSize)(props);
|
|
160
|
+
const reactData = (0, _vue.reactive)({
|
|
161
|
+
inited: false,
|
|
162
|
+
visible: false,
|
|
163
|
+
contentVisible: false,
|
|
164
|
+
modalTop: 0,
|
|
165
|
+
modalZindex: 0,
|
|
166
|
+
zoomLocat: null,
|
|
167
|
+
firstOpen: true
|
|
168
|
+
});
|
|
169
|
+
const refElem = (0, _vue.ref)();
|
|
170
|
+
const refModalBox = (0, _vue.ref)();
|
|
171
|
+
const refConfirmBtn = (0, _vue.ref)();
|
|
172
|
+
const refCancelBtn = (0, _vue.ref)();
|
|
173
|
+
const refMaps = {
|
|
174
|
+
refElem
|
|
175
|
+
};
|
|
176
|
+
const $xemodal = {
|
|
177
|
+
xID,
|
|
178
|
+
props,
|
|
179
|
+
context,
|
|
180
|
+
reactData,
|
|
181
|
+
getRefMaps: () => refMaps
|
|
182
|
+
};
|
|
183
|
+
let modalMethods = {};
|
|
184
|
+
const computeIsMsg = (0, _vue.computed)(() => {
|
|
185
|
+
return props.type === 'message';
|
|
186
|
+
});
|
|
187
|
+
const getBox = () => {
|
|
188
|
+
const boxElem = refModalBox.value;
|
|
189
|
+
return boxElem;
|
|
190
|
+
};
|
|
191
|
+
const recalculate = () => {
|
|
192
|
+
const {
|
|
193
|
+
width,
|
|
194
|
+
height
|
|
195
|
+
} = props;
|
|
196
|
+
const boxElem = getBox();
|
|
197
|
+
boxElem.style.width = `${width ? isNaN(width) ? width : `${width}px` : ''}`;
|
|
198
|
+
boxElem.style.height = `${height ? isNaN(height) ? height : `${height}px` : ''}`;
|
|
199
|
+
return (0, _vue.nextTick)();
|
|
200
|
+
};
|
|
201
|
+
const updateZindex = () => {
|
|
202
|
+
const {
|
|
203
|
+
zIndex
|
|
204
|
+
} = props;
|
|
205
|
+
const {
|
|
206
|
+
modalZindex
|
|
207
|
+
} = reactData;
|
|
208
|
+
if (zIndex) {
|
|
209
|
+
reactData.modalZindex = zIndex;
|
|
210
|
+
} else if (modalZindex < (0, _utils.getLastZIndex)()) {
|
|
211
|
+
reactData.modalZindex = (0, _utils.nextZIndex)();
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const updatePosition = () => {
|
|
215
|
+
return (0, _vue.nextTick)().then(() => {
|
|
216
|
+
const {
|
|
217
|
+
position
|
|
218
|
+
} = props;
|
|
219
|
+
const marginSize = _xeUtils.default.toNumber(props.marginSize);
|
|
220
|
+
const boxElem = getBox();
|
|
221
|
+
const clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
|
|
222
|
+
const clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
|
223
|
+
const isPosCenter = position === 'center';
|
|
224
|
+
const {
|
|
225
|
+
top,
|
|
226
|
+
left
|
|
227
|
+
} = _xeUtils.default.isString(position) ? {
|
|
228
|
+
top: position,
|
|
229
|
+
left: position
|
|
230
|
+
} : Object.assign({}, position);
|
|
231
|
+
const topCenter = isPosCenter || top === 'center';
|
|
232
|
+
const leftCenter = isPosCenter || left === 'center';
|
|
233
|
+
let posTop = '';
|
|
234
|
+
let posLeft = '';
|
|
235
|
+
if (left && !leftCenter) {
|
|
236
|
+
posLeft = isNaN(left) ? left : `${left}px`;
|
|
237
|
+
} else {
|
|
238
|
+
posLeft = `${Math.max(marginSize, clientVisibleWidth / 2 - boxElem.offsetWidth / 2)}px`;
|
|
239
|
+
}
|
|
240
|
+
if (top && !topCenter) {
|
|
241
|
+
posTop = isNaN(top) ? top : `${top}px`;
|
|
242
|
+
} else {
|
|
243
|
+
posTop = `${Math.max(marginSize, clientVisibleHeight / 2 - boxElem.offsetHeight / 2)}px`;
|
|
244
|
+
}
|
|
245
|
+
boxElem.style.top = posTop;
|
|
246
|
+
boxElem.style.left = posLeft;
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
const updateStyle = () => {
|
|
250
|
+
(0, _vue.nextTick)(() => {
|
|
251
|
+
let offsetTop = 0;
|
|
252
|
+
msgQueue.forEach(comp => {
|
|
253
|
+
const boxElem = comp.getBox();
|
|
254
|
+
offsetTop += _xeUtils.default.toNumber(comp.props.top);
|
|
255
|
+
comp.reactData.modalTop = offsetTop;
|
|
256
|
+
offsetTop += boxElem.clientHeight;
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
const removeMsgQueue = () => {
|
|
261
|
+
if (msgQueue.indexOf($xemodal) > -1) {
|
|
262
|
+
_xeUtils.default.remove(msgQueue, comp => comp === $xemodal);
|
|
263
|
+
}
|
|
264
|
+
updateStyle();
|
|
265
|
+
};
|
|
266
|
+
const closeModal = type => {
|
|
267
|
+
const {
|
|
268
|
+
remember,
|
|
269
|
+
beforeHideMethod
|
|
270
|
+
} = props;
|
|
271
|
+
const {
|
|
272
|
+
visible
|
|
273
|
+
} = reactData;
|
|
274
|
+
const isMsg = computeIsMsg.value;
|
|
275
|
+
const params = {
|
|
276
|
+
type
|
|
277
|
+
};
|
|
278
|
+
if (visible) {
|
|
279
|
+
Promise.resolve(beforeHideMethod ? beforeHideMethod(params) : null).then(rest => {
|
|
280
|
+
if (!_xeUtils.default.isError(rest)) {
|
|
281
|
+
if (isMsg) {
|
|
282
|
+
removeMsgQueue();
|
|
283
|
+
}
|
|
284
|
+
reactData.contentVisible = false;
|
|
285
|
+
if (!remember) {
|
|
286
|
+
reactData.zoomLocat = null;
|
|
287
|
+
}
|
|
288
|
+
_xeUtils.default.remove(allActivedModals, item => item === $xemodal);
|
|
289
|
+
modalMethods.dispatchEvent('before-hide', params);
|
|
290
|
+
setTimeout(() => {
|
|
291
|
+
reactData.visible = false;
|
|
292
|
+
emit('update:modelValue', false);
|
|
293
|
+
modalMethods.dispatchEvent('hide', params);
|
|
294
|
+
}, 200);
|
|
295
|
+
}
|
|
296
|
+
}).catch(e => e);
|
|
297
|
+
}
|
|
298
|
+
return (0, _vue.nextTick)();
|
|
299
|
+
};
|
|
300
|
+
const closeEvent = evnt => {
|
|
301
|
+
const type = 'close';
|
|
302
|
+
modalMethods.dispatchEvent(type, {
|
|
303
|
+
type
|
|
304
|
+
}, evnt);
|
|
305
|
+
closeModal(type);
|
|
306
|
+
};
|
|
307
|
+
const confirmEvent = evnt => {
|
|
308
|
+
const type = 'confirm';
|
|
309
|
+
modalMethods.dispatchEvent(type, {
|
|
310
|
+
type
|
|
311
|
+
}, evnt);
|
|
312
|
+
closeModal(type);
|
|
313
|
+
};
|
|
314
|
+
const cancelEvent = evnt => {
|
|
315
|
+
const type = 'cancel';
|
|
316
|
+
modalMethods.dispatchEvent(type, {
|
|
317
|
+
type
|
|
318
|
+
}, evnt);
|
|
319
|
+
closeModal(type);
|
|
320
|
+
};
|
|
321
|
+
const getStorageMap = key => {
|
|
322
|
+
const version = _globalStore.default.version;
|
|
323
|
+
const rest = _xeUtils.default.toStringJSON(localStorage.getItem(key) || '');
|
|
324
|
+
return rest && rest._v === version ? rest : {
|
|
325
|
+
_v: version
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
const hasPosStorage = () => {
|
|
329
|
+
const {
|
|
330
|
+
id,
|
|
331
|
+
remember,
|
|
332
|
+
storage,
|
|
333
|
+
storageKey
|
|
334
|
+
} = props;
|
|
335
|
+
return !!(id && remember && storage && getStorageMap(storageKey)[id]);
|
|
336
|
+
};
|
|
337
|
+
const restorePosStorage = () => {
|
|
338
|
+
const {
|
|
339
|
+
id,
|
|
340
|
+
remember,
|
|
341
|
+
storage,
|
|
342
|
+
storageKey
|
|
343
|
+
} = props;
|
|
344
|
+
if (id && remember && storage) {
|
|
345
|
+
const posStorage = getStorageMap(storageKey)[id];
|
|
346
|
+
if (posStorage) {
|
|
347
|
+
const boxElem = getBox();
|
|
348
|
+
const [left, top, width, height, zoomLeft, zoomTop, zoomWidth, zoomHeight] = posStorage.split(',');
|
|
349
|
+
if (left) {
|
|
350
|
+
boxElem.style.left = `${left}px`;
|
|
351
|
+
}
|
|
352
|
+
if (top) {
|
|
353
|
+
boxElem.style.top = `${top}px`;
|
|
354
|
+
}
|
|
355
|
+
if (width) {
|
|
356
|
+
boxElem.style.width = `${width}px`;
|
|
357
|
+
}
|
|
358
|
+
if (height) {
|
|
359
|
+
boxElem.style.height = `${height}px`;
|
|
360
|
+
}
|
|
361
|
+
if (zoomLeft && zoomTop) {
|
|
362
|
+
reactData.zoomLocat = {
|
|
363
|
+
left: zoomLeft,
|
|
364
|
+
top: zoomTop,
|
|
365
|
+
width: zoomWidth,
|
|
366
|
+
height: zoomHeight
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
const addMsgQueue = () => {
|
|
373
|
+
if (msgQueue.indexOf($xemodal) === -1) {
|
|
374
|
+
msgQueue.push($xemodal);
|
|
375
|
+
}
|
|
376
|
+
updateStyle();
|
|
377
|
+
};
|
|
378
|
+
const savePosStorage = () => {
|
|
379
|
+
const {
|
|
380
|
+
id,
|
|
381
|
+
remember,
|
|
382
|
+
storage,
|
|
383
|
+
storageKey
|
|
384
|
+
} = props;
|
|
385
|
+
const {
|
|
386
|
+
zoomLocat
|
|
387
|
+
} = reactData;
|
|
388
|
+
if (id && remember && storage) {
|
|
389
|
+
const boxElem = getBox();
|
|
390
|
+
const posStorageMap = getStorageMap(storageKey);
|
|
391
|
+
posStorageMap[id] = [boxElem.style.left, boxElem.style.top, boxElem.style.width, boxElem.style.height].concat(zoomLocat ? [zoomLocat.left, zoomLocat.top, zoomLocat.width, zoomLocat.height] : []).map(val => val ? _xeUtils.default.toNumber(val) : '').join(',');
|
|
392
|
+
localStorage.setItem(storageKey, _xeUtils.default.toJSONString(posStorageMap));
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
const maximize = () => {
|
|
396
|
+
return (0, _vue.nextTick)().then(() => {
|
|
397
|
+
if (!reactData.zoomLocat) {
|
|
398
|
+
const marginSize = Math.max(0, _xeUtils.default.toNumber(props.marginSize));
|
|
399
|
+
const boxElem = getBox();
|
|
400
|
+
const {
|
|
401
|
+
visibleHeight,
|
|
402
|
+
visibleWidth
|
|
403
|
+
} = (0, _dom.getDomNode)();
|
|
404
|
+
reactData.zoomLocat = {
|
|
405
|
+
top: boxElem.offsetTop,
|
|
406
|
+
left: boxElem.offsetLeft,
|
|
407
|
+
width: boxElem.offsetWidth + (boxElem.style.width ? 0 : 1),
|
|
408
|
+
height: boxElem.offsetHeight + (boxElem.style.height ? 0 : 1)
|
|
409
|
+
};
|
|
410
|
+
Object.assign(boxElem.style, {
|
|
411
|
+
top: `${marginSize}px`,
|
|
412
|
+
left: `${marginSize}px`,
|
|
413
|
+
width: `${visibleWidth - marginSize * 2}px`,
|
|
414
|
+
height: `${visibleHeight - marginSize * 2}px`
|
|
415
|
+
});
|
|
416
|
+
savePosStorage();
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
};
|
|
420
|
+
const openModal = () => {
|
|
421
|
+
const {
|
|
422
|
+
duration,
|
|
423
|
+
remember,
|
|
424
|
+
showFooter
|
|
425
|
+
} = props;
|
|
426
|
+
const {
|
|
427
|
+
inited,
|
|
428
|
+
visible
|
|
429
|
+
} = reactData;
|
|
430
|
+
const isMsg = computeIsMsg.value;
|
|
431
|
+
if (!inited) {
|
|
432
|
+
reactData.inited = true;
|
|
433
|
+
}
|
|
434
|
+
if (!visible) {
|
|
435
|
+
if (!remember) {
|
|
436
|
+
recalculate();
|
|
437
|
+
}
|
|
438
|
+
reactData.visible = true;
|
|
439
|
+
reactData.contentVisible = false;
|
|
440
|
+
updateZindex();
|
|
441
|
+
allActivedModals.push($xemodal);
|
|
442
|
+
setTimeout(() => {
|
|
443
|
+
reactData.contentVisible = true;
|
|
444
|
+
(0, _vue.nextTick)(() => {
|
|
445
|
+
if (showFooter) {
|
|
446
|
+
const confirmBtn = refConfirmBtn.value;
|
|
447
|
+
const cancelBtn = refCancelBtn.value;
|
|
448
|
+
const operBtn = confirmBtn || cancelBtn;
|
|
449
|
+
if (operBtn) {
|
|
450
|
+
operBtn.focus();
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const type = '';
|
|
454
|
+
const params = {
|
|
455
|
+
type
|
|
456
|
+
};
|
|
457
|
+
emit('update:modelValue', true);
|
|
458
|
+
modalMethods.dispatchEvent('show', params);
|
|
459
|
+
});
|
|
460
|
+
}, 10);
|
|
461
|
+
if (isMsg) {
|
|
462
|
+
addMsgQueue();
|
|
463
|
+
if (duration !== -1) {
|
|
464
|
+
setTimeout(() => closeModal('close'), _xeUtils.default.toNumber(duration));
|
|
465
|
+
}
|
|
466
|
+
} else {
|
|
467
|
+
(0, _vue.nextTick)(() => {
|
|
468
|
+
const {
|
|
469
|
+
fullscreen
|
|
470
|
+
} = props;
|
|
471
|
+
const {
|
|
472
|
+
firstOpen
|
|
473
|
+
} = reactData;
|
|
474
|
+
if (!remember || firstOpen) {
|
|
475
|
+
updatePosition().then(() => {
|
|
476
|
+
setTimeout(() => updatePosition(), 20);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
if (firstOpen) {
|
|
480
|
+
reactData.firstOpen = false;
|
|
481
|
+
if (hasPosStorage()) {
|
|
482
|
+
restorePosStorage();
|
|
483
|
+
} else if (fullscreen) {
|
|
484
|
+
(0, _vue.nextTick)(() => maximize());
|
|
485
|
+
}
|
|
486
|
+
} else {
|
|
487
|
+
if (fullscreen) {
|
|
488
|
+
(0, _vue.nextTick)(() => maximize());
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return (0, _vue.nextTick)();
|
|
495
|
+
};
|
|
496
|
+
const selfClickEvent = evnt => {
|
|
497
|
+
const el = refElem.value;
|
|
498
|
+
if (props.maskClosable && evnt.target === el) {
|
|
499
|
+
const type = 'mask';
|
|
500
|
+
closeModal(type);
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
const handleGlobalKeydownEvent = evnt => {
|
|
504
|
+
const isEsc = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ESCAPE);
|
|
505
|
+
if (isEsc) {
|
|
506
|
+
const lastModal = _xeUtils.default.max(allActivedModals, item => item.reactData.modalZindex);
|
|
507
|
+
// 多个时,只关掉最上层的窗口
|
|
508
|
+
if (lastModal) {
|
|
509
|
+
setTimeout(() => {
|
|
510
|
+
if (lastModal === $xemodal && lastModal.props.escClosable) {
|
|
511
|
+
closeModal('exit');
|
|
512
|
+
}
|
|
513
|
+
}, 10);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
const isMaximized = () => {
|
|
518
|
+
return !!reactData.zoomLocat;
|
|
519
|
+
};
|
|
520
|
+
const revert = () => {
|
|
521
|
+
return (0, _vue.nextTick)().then(() => {
|
|
522
|
+
const {
|
|
523
|
+
zoomLocat
|
|
524
|
+
} = reactData;
|
|
525
|
+
if (zoomLocat) {
|
|
526
|
+
const boxElem = getBox();
|
|
527
|
+
reactData.zoomLocat = null;
|
|
528
|
+
Object.assign(boxElem.style, {
|
|
529
|
+
top: `${zoomLocat.top}px`,
|
|
530
|
+
left: `${zoomLocat.left}px`,
|
|
531
|
+
width: `${zoomLocat.width}px`,
|
|
532
|
+
height: `${zoomLocat.height}px`
|
|
533
|
+
});
|
|
534
|
+
savePosStorage();
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
};
|
|
538
|
+
const zoom = () => {
|
|
539
|
+
if (reactData.zoomLocat) {
|
|
540
|
+
return revert().then(() => isMaximized());
|
|
541
|
+
}
|
|
542
|
+
return maximize().then(() => isMaximized());
|
|
543
|
+
};
|
|
544
|
+
const toggleZoomEvent = evnt => {
|
|
545
|
+
const {
|
|
546
|
+
zoomLocat
|
|
547
|
+
} = reactData;
|
|
548
|
+
const params = {
|
|
549
|
+
type: zoomLocat ? 'revert' : 'max'
|
|
550
|
+
};
|
|
551
|
+
return zoom().then(() => {
|
|
552
|
+
modalMethods.dispatchEvent('zoom', params, evnt);
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
const getPosition = () => {
|
|
556
|
+
const isMsg = computeIsMsg.value;
|
|
557
|
+
if (!isMsg) {
|
|
558
|
+
const boxElem = getBox();
|
|
559
|
+
if (boxElem) {
|
|
560
|
+
return {
|
|
561
|
+
top: boxElem.offsetTop,
|
|
562
|
+
left: boxElem.offsetLeft
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return null;
|
|
567
|
+
};
|
|
568
|
+
const setPosition = (top, left) => {
|
|
569
|
+
const isMsg = computeIsMsg.value;
|
|
570
|
+
if (!isMsg) {
|
|
571
|
+
const boxElem = getBox();
|
|
572
|
+
if (_xeUtils.default.isNumber(top)) {
|
|
573
|
+
boxElem.style.top = `${top}px`;
|
|
574
|
+
}
|
|
575
|
+
if (_xeUtils.default.isNumber(left)) {
|
|
576
|
+
boxElem.style.left = `${left}px`;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
return (0, _vue.nextTick)();
|
|
580
|
+
};
|
|
581
|
+
const boxMousedownEvent = () => {
|
|
582
|
+
const {
|
|
583
|
+
modalZindex
|
|
584
|
+
} = reactData;
|
|
585
|
+
if (allActivedModals.some(comp => comp.reactData.visible && comp.reactData.modalZindex > modalZindex)) {
|
|
586
|
+
updateZindex();
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
const mousedownEvent = evnt => {
|
|
590
|
+
const {
|
|
591
|
+
remember,
|
|
592
|
+
storage
|
|
593
|
+
} = props;
|
|
594
|
+
const {
|
|
595
|
+
zoomLocat
|
|
596
|
+
} = reactData;
|
|
597
|
+
const marginSize = _xeUtils.default.toNumber(props.marginSize);
|
|
598
|
+
const boxElem = getBox();
|
|
599
|
+
if (!zoomLocat && evnt.button === 0 && !(0, _dom.getEventTargetNode)(evnt, boxElem, 'trigger--btn').flag) {
|
|
600
|
+
evnt.preventDefault();
|
|
601
|
+
const domMousemove = document.onmousemove;
|
|
602
|
+
const domMouseup = document.onmouseup;
|
|
603
|
+
const disX = evnt.clientX - boxElem.offsetLeft;
|
|
604
|
+
const disY = evnt.clientY - boxElem.offsetTop;
|
|
605
|
+
const {
|
|
606
|
+
visibleHeight,
|
|
607
|
+
visibleWidth
|
|
608
|
+
} = (0, _dom.getDomNode)();
|
|
609
|
+
document.onmousemove = evnt => {
|
|
610
|
+
evnt.preventDefault();
|
|
611
|
+
const offsetWidth = boxElem.offsetWidth;
|
|
612
|
+
const offsetHeight = boxElem.offsetHeight;
|
|
613
|
+
const minX = marginSize;
|
|
614
|
+
const maxX = visibleWidth - offsetWidth - marginSize - 1;
|
|
615
|
+
const minY = marginSize;
|
|
616
|
+
const maxY = visibleHeight - offsetHeight - marginSize - 1;
|
|
617
|
+
let left = evnt.clientX - disX;
|
|
618
|
+
let top = evnt.clientY - disY;
|
|
619
|
+
if (left > maxX) {
|
|
620
|
+
left = maxX;
|
|
621
|
+
}
|
|
622
|
+
if (left < minX) {
|
|
623
|
+
left = minX;
|
|
624
|
+
}
|
|
625
|
+
if (top > maxY) {
|
|
626
|
+
top = maxY;
|
|
627
|
+
}
|
|
628
|
+
if (top < minY) {
|
|
629
|
+
top = minY;
|
|
630
|
+
}
|
|
631
|
+
boxElem.style.left = `${left}px`;
|
|
632
|
+
boxElem.style.top = `${top}px`;
|
|
633
|
+
boxElem.className = boxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
|
|
634
|
+
};
|
|
635
|
+
document.onmouseup = () => {
|
|
636
|
+
document.onmousemove = domMousemove;
|
|
637
|
+
document.onmouseup = domMouseup;
|
|
638
|
+
if (remember && storage) {
|
|
639
|
+
(0, _vue.nextTick)(() => {
|
|
640
|
+
savePosStorage();
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
setTimeout(() => {
|
|
644
|
+
boxElem.className = boxElem.className.replace(/\s?is--drag/, '');
|
|
645
|
+
}, 50);
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
const dragEvent = evnt => {
|
|
650
|
+
evnt.preventDefault();
|
|
651
|
+
const {
|
|
652
|
+
remember,
|
|
653
|
+
storage
|
|
654
|
+
} = props;
|
|
655
|
+
const {
|
|
656
|
+
visibleHeight,
|
|
657
|
+
visibleWidth
|
|
658
|
+
} = (0, _dom.getDomNode)();
|
|
659
|
+
const marginSize = _xeUtils.default.toNumber(props.marginSize);
|
|
660
|
+
const targetElem = evnt.target;
|
|
661
|
+
const type = targetElem.getAttribute('type');
|
|
662
|
+
const minWidth = _xeUtils.default.toNumber(props.minWidth);
|
|
663
|
+
const minHeight = _xeUtils.default.toNumber(props.minHeight);
|
|
664
|
+
const maxWidth = visibleWidth;
|
|
665
|
+
const maxHeight = visibleHeight;
|
|
666
|
+
const boxElem = getBox();
|
|
667
|
+
const domMousemove = document.onmousemove;
|
|
668
|
+
const domMouseup = document.onmouseup;
|
|
669
|
+
const clientWidth = boxElem.clientWidth;
|
|
670
|
+
const clientHeight = boxElem.clientHeight;
|
|
671
|
+
const disX = evnt.clientX;
|
|
672
|
+
const disY = evnt.clientY;
|
|
673
|
+
const offsetTop = boxElem.offsetTop;
|
|
674
|
+
const offsetLeft = boxElem.offsetLeft;
|
|
675
|
+
const params = {
|
|
676
|
+
type: 'resize'
|
|
677
|
+
};
|
|
678
|
+
document.onmousemove = evnt => {
|
|
679
|
+
evnt.preventDefault();
|
|
680
|
+
let dragLeft;
|
|
681
|
+
let dragTop;
|
|
682
|
+
let width;
|
|
683
|
+
let height;
|
|
684
|
+
switch (type) {
|
|
685
|
+
case 'wl':
|
|
686
|
+
dragLeft = disX - evnt.clientX;
|
|
687
|
+
width = dragLeft + clientWidth;
|
|
688
|
+
if (offsetLeft - dragLeft > marginSize) {
|
|
689
|
+
if (width > minWidth) {
|
|
690
|
+
boxElem.style.width = `${width < maxWidth ? width : maxWidth}px`;
|
|
691
|
+
boxElem.style.left = `${offsetLeft - dragLeft}px`;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
break;
|
|
695
|
+
case 'swst':
|
|
696
|
+
dragLeft = disX - evnt.clientX;
|
|
697
|
+
dragTop = disY - evnt.clientY;
|
|
698
|
+
width = dragLeft + clientWidth;
|
|
699
|
+
height = dragTop + clientHeight;
|
|
700
|
+
if (offsetLeft - dragLeft > marginSize) {
|
|
701
|
+
if (width > minWidth) {
|
|
702
|
+
boxElem.style.width = `${width < maxWidth ? width : maxWidth}px`;
|
|
703
|
+
boxElem.style.left = `${offsetLeft - dragLeft}px`;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
if (offsetTop - dragTop > marginSize) {
|
|
707
|
+
if (height > minHeight) {
|
|
708
|
+
boxElem.style.height = `${height < maxHeight ? height : maxHeight}px`;
|
|
709
|
+
boxElem.style.top = `${offsetTop - dragTop}px`;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
break;
|
|
713
|
+
case 'swlb':
|
|
714
|
+
dragLeft = disX - evnt.clientX;
|
|
715
|
+
dragTop = evnt.clientY - disY;
|
|
716
|
+
width = dragLeft + clientWidth;
|
|
717
|
+
height = dragTop + clientHeight;
|
|
718
|
+
if (offsetLeft - dragLeft > marginSize) {
|
|
719
|
+
if (width > minWidth) {
|
|
720
|
+
boxElem.style.width = `${width < maxWidth ? width : maxWidth}px`;
|
|
721
|
+
boxElem.style.left = `${offsetLeft - dragLeft}px`;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if (offsetTop + height + marginSize < visibleHeight) {
|
|
725
|
+
if (height > minHeight) {
|
|
726
|
+
boxElem.style.height = `${height < maxHeight ? height : maxHeight}px`;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
break;
|
|
730
|
+
case 'st':
|
|
731
|
+
dragTop = disY - evnt.clientY;
|
|
732
|
+
height = clientHeight + dragTop;
|
|
733
|
+
if (offsetTop - dragTop > marginSize) {
|
|
734
|
+
if (height > minHeight) {
|
|
735
|
+
boxElem.style.height = `${height < maxHeight ? height : maxHeight}px`;
|
|
736
|
+
boxElem.style.top = `${offsetTop - dragTop}px`;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
break;
|
|
740
|
+
case 'wr':
|
|
741
|
+
dragLeft = evnt.clientX - disX;
|
|
742
|
+
width = dragLeft + clientWidth;
|
|
743
|
+
if (offsetLeft + width + marginSize < visibleWidth) {
|
|
744
|
+
if (width > minWidth) {
|
|
745
|
+
boxElem.style.width = `${width < maxWidth ? width : maxWidth}px`;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
break;
|
|
749
|
+
case 'sest':
|
|
750
|
+
dragLeft = evnt.clientX - disX;
|
|
751
|
+
dragTop = disY - evnt.clientY;
|
|
752
|
+
width = dragLeft + clientWidth;
|
|
753
|
+
height = dragTop + clientHeight;
|
|
754
|
+
if (offsetLeft + width + marginSize < visibleWidth) {
|
|
755
|
+
if (width > minWidth) {
|
|
756
|
+
boxElem.style.width = `${width < maxWidth ? width : maxWidth}px`;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
if (offsetTop - dragTop > marginSize) {
|
|
760
|
+
if (height > minHeight) {
|
|
761
|
+
boxElem.style.height = `${height < maxHeight ? height : maxHeight}px`;
|
|
762
|
+
boxElem.style.top = `${offsetTop - dragTop}px`;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
break;
|
|
766
|
+
case 'selb':
|
|
767
|
+
dragLeft = evnt.clientX - disX;
|
|
768
|
+
dragTop = evnt.clientY - disY;
|
|
769
|
+
width = dragLeft + clientWidth;
|
|
770
|
+
height = dragTop + clientHeight;
|
|
771
|
+
if (offsetLeft + width + marginSize < visibleWidth) {
|
|
772
|
+
if (width > minWidth) {
|
|
773
|
+
boxElem.style.width = `${width < maxWidth ? width : maxWidth}px`;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
if (offsetTop + height + marginSize < visibleHeight) {
|
|
777
|
+
if (height > minHeight) {
|
|
778
|
+
boxElem.style.height = `${height < maxHeight ? height : maxHeight}px`;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
break;
|
|
782
|
+
case 'sb':
|
|
783
|
+
dragTop = evnt.clientY - disY;
|
|
784
|
+
height = dragTop + clientHeight;
|
|
785
|
+
if (offsetTop + height + marginSize < visibleHeight) {
|
|
786
|
+
if (height > minHeight) {
|
|
787
|
+
boxElem.style.height = `${height < maxHeight ? height : maxHeight}px`;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
break;
|
|
791
|
+
}
|
|
792
|
+
boxElem.className = boxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
|
|
793
|
+
if (remember && storage) {
|
|
794
|
+
savePosStorage();
|
|
795
|
+
}
|
|
796
|
+
modalMethods.dispatchEvent('zoom', params, evnt);
|
|
797
|
+
};
|
|
798
|
+
document.onmouseup = () => {
|
|
799
|
+
reactData.zoomLocat = null;
|
|
800
|
+
document.onmousemove = domMousemove;
|
|
801
|
+
document.onmouseup = domMouseup;
|
|
802
|
+
setTimeout(() => {
|
|
803
|
+
boxElem.className = boxElem.className.replace(/\s?is--drag/, '');
|
|
804
|
+
}, 50);
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
const renderTitles = () => {
|
|
808
|
+
const {
|
|
809
|
+
slots: propSlots = {},
|
|
810
|
+
showClose,
|
|
811
|
+
showZoom,
|
|
812
|
+
title
|
|
813
|
+
} = props;
|
|
814
|
+
const {
|
|
815
|
+
zoomLocat
|
|
816
|
+
} = reactData;
|
|
817
|
+
const titleSlot = slots.title || propSlots.title;
|
|
818
|
+
const cornerSlot = slots.corner || propSlots.corner;
|
|
819
|
+
const titVNs = [(0, _vue.h)('div', {
|
|
820
|
+
class: 'vxe-modal--header-title'
|
|
821
|
+
}, titleSlot ? (0, _vn.getSlotVNs)(titleSlot({
|
|
822
|
+
$modal: $xemodal
|
|
823
|
+
})) : title ? (0, _utils.getFuncText)(title) : (0, _i18n.getI18n)('vxe.alert.title'))];
|
|
824
|
+
const rightVNs = [];
|
|
825
|
+
if (cornerSlot) {
|
|
826
|
+
rightVNs.push((0, _vue.h)('span', {
|
|
827
|
+
class: 'vxe-modal--corner-wrapper'
|
|
828
|
+
}, (0, _vn.getSlotVNs)(cornerSlot({
|
|
829
|
+
$modal: $xemodal
|
|
830
|
+
}))));
|
|
831
|
+
}
|
|
832
|
+
if (showZoom) {
|
|
833
|
+
rightVNs.push((0, _vue.h)('i', {
|
|
834
|
+
class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? _iconStore.default.MODAL_ZOOM_OUT : _iconStore.default.MODAL_ZOOM_IN],
|
|
835
|
+
title: (0, _i18n.getI18n)(`vxe.modal.zoom${zoomLocat ? 'Out' : 'In'}`),
|
|
836
|
+
onClick: toggleZoomEvent
|
|
837
|
+
}));
|
|
838
|
+
}
|
|
839
|
+
if (showClose) {
|
|
840
|
+
rightVNs.push((0, _vue.h)('i', {
|
|
841
|
+
class: ['vxe-modal--close-btn', 'trigger--btn', _iconStore.default.MODAL_CLOSE],
|
|
842
|
+
title: (0, _i18n.getI18n)('vxe.modal.close'),
|
|
843
|
+
onClick: closeEvent
|
|
844
|
+
}));
|
|
845
|
+
}
|
|
846
|
+
titVNs.push((0, _vue.h)('div', {
|
|
847
|
+
class: 'vxe-modal--header-right'
|
|
848
|
+
}, rightVNs));
|
|
849
|
+
return titVNs;
|
|
850
|
+
};
|
|
851
|
+
const renderHeaders = () => {
|
|
852
|
+
const {
|
|
853
|
+
slots: propSlots = {},
|
|
854
|
+
showZoom,
|
|
855
|
+
draggable
|
|
856
|
+
} = props;
|
|
857
|
+
const isMsg = computeIsMsg.value;
|
|
858
|
+
const headerSlot = slots.header || propSlots.header;
|
|
859
|
+
const headVNs = [];
|
|
860
|
+
if (props.showHeader) {
|
|
861
|
+
const headerOns = {};
|
|
862
|
+
if (draggable) {
|
|
863
|
+
headerOns.onMousedown = mousedownEvent;
|
|
864
|
+
}
|
|
865
|
+
if (showZoom && props.dblclickZoom && props.type === 'modal') {
|
|
866
|
+
headerOns.onDblclick = toggleZoomEvent;
|
|
867
|
+
}
|
|
868
|
+
headVNs.push((0, _vue.h)('div', {
|
|
869
|
+
class: ['vxe-modal--header', {
|
|
870
|
+
'is--draggable': draggable,
|
|
871
|
+
'is--ellipsis': !isMsg && props.showTitleOverflow
|
|
872
|
+
}],
|
|
873
|
+
...headerOns
|
|
874
|
+
}, headerSlot ? !reactData.inited || props.destroyOnClose && !reactData.visible ? [] : (0, _vn.getSlotVNs)(headerSlot({
|
|
875
|
+
$modal: $xemodal
|
|
876
|
+
})) : renderTitles()));
|
|
877
|
+
}
|
|
878
|
+
return headVNs;
|
|
879
|
+
};
|
|
880
|
+
const renderBodys = () => {
|
|
881
|
+
const {
|
|
882
|
+
slots: propSlots = {},
|
|
883
|
+
status,
|
|
884
|
+
message
|
|
885
|
+
} = props;
|
|
886
|
+
const content = props.content || message;
|
|
887
|
+
const isMsg = computeIsMsg.value;
|
|
888
|
+
const defaultSlot = slots.default || propSlots.default;
|
|
889
|
+
const contVNs = [];
|
|
890
|
+
if (status) {
|
|
891
|
+
contVNs.push((0, _vue.h)('div', {
|
|
892
|
+
class: 'vxe-modal--status-wrapper'
|
|
893
|
+
}, [(0, _vue.h)('i', {
|
|
894
|
+
class: ['vxe-modal--status-icon', props.iconStatus || _iconStore.default[`MODAL_${status}`.toLocaleUpperCase()]]
|
|
895
|
+
})]));
|
|
896
|
+
}
|
|
897
|
+
contVNs.push((0, _vue.h)('div', {
|
|
898
|
+
class: 'vxe-modal--content'
|
|
899
|
+
}, defaultSlot ? !reactData.inited || props.destroyOnClose && !reactData.visible ? [] : (0, _vn.getSlotVNs)(defaultSlot({
|
|
900
|
+
$modal: $xemodal
|
|
901
|
+
})) : (0, _utils.getFuncText)(content)));
|
|
902
|
+
if (!isMsg) {
|
|
903
|
+
/**
|
|
904
|
+
* 加载中
|
|
905
|
+
*/
|
|
906
|
+
contVNs.push((0, _vue.h)(_index.default, {
|
|
907
|
+
class: 'vxe-modal--loading',
|
|
908
|
+
modelValue: props.loading
|
|
909
|
+
}));
|
|
910
|
+
}
|
|
911
|
+
return [(0, _vue.h)('div', {
|
|
912
|
+
class: 'vxe-modal--body'
|
|
913
|
+
}, contVNs)];
|
|
914
|
+
};
|
|
915
|
+
const renderBtns = () => {
|
|
916
|
+
const {
|
|
917
|
+
type
|
|
918
|
+
} = props;
|
|
919
|
+
const btnVNs = [];
|
|
920
|
+
if (type === 'confirm') {
|
|
921
|
+
btnVNs.push((0, _vue.h)(_button.default, {
|
|
922
|
+
ref: refCancelBtn,
|
|
923
|
+
content: props.cancelButtonText || (0, _i18n.getI18n)('vxe.button.cancel'),
|
|
924
|
+
onClick: cancelEvent
|
|
925
|
+
}));
|
|
926
|
+
}
|
|
927
|
+
btnVNs.push((0, _vue.h)(_button.default, {
|
|
928
|
+
ref: refConfirmBtn,
|
|
929
|
+
status: 'primary',
|
|
930
|
+
content: props.confirmButtonText || (0, _i18n.getI18n)('vxe.button.confirm'),
|
|
931
|
+
onClick: confirmEvent
|
|
932
|
+
}));
|
|
933
|
+
return btnVNs;
|
|
934
|
+
};
|
|
935
|
+
const renderFooters = () => {
|
|
936
|
+
const {
|
|
937
|
+
slots: propSlots = {}
|
|
938
|
+
} = props;
|
|
939
|
+
const isMsg = computeIsMsg.value;
|
|
940
|
+
const footerSlot = slots.footer || propSlots.footer;
|
|
941
|
+
const footVNs = [];
|
|
942
|
+
if (props.showFooter) {
|
|
943
|
+
footVNs.push((0, _vue.h)('div', {
|
|
944
|
+
class: 'vxe-modal--footer'
|
|
945
|
+
}, footerSlot ? !reactData.inited || props.destroyOnClose && !reactData.visible ? [] : (0, _vn.getSlotVNs)(footerSlot({
|
|
946
|
+
$modal: $xemodal
|
|
947
|
+
})) : renderBtns()));
|
|
948
|
+
}
|
|
949
|
+
if (!isMsg && props.resize) {
|
|
950
|
+
footVNs.push((0, _vue.h)('span', {
|
|
951
|
+
class: 'vxe-modal--resize'
|
|
952
|
+
}, ['wl', 'wr', 'swst', 'sest', 'st', 'swlb', 'selb', 'sb'].map(type => {
|
|
953
|
+
return (0, _vue.h)('span', {
|
|
954
|
+
class: `${type}-resize`,
|
|
955
|
+
type: type,
|
|
956
|
+
onMousedown: dragEvent
|
|
957
|
+
});
|
|
958
|
+
})));
|
|
959
|
+
}
|
|
960
|
+
return footVNs;
|
|
961
|
+
};
|
|
962
|
+
modalMethods = {
|
|
963
|
+
dispatchEvent(type, params, evnt) {
|
|
964
|
+
emit(type, Object.assign({
|
|
965
|
+
$modal: $xemodal,
|
|
966
|
+
$event: evnt
|
|
967
|
+
}, params));
|
|
968
|
+
},
|
|
969
|
+
open: openModal,
|
|
970
|
+
close() {
|
|
971
|
+
return closeModal('close');
|
|
972
|
+
},
|
|
973
|
+
getBox,
|
|
974
|
+
getPosition,
|
|
975
|
+
setPosition,
|
|
976
|
+
isMaximized,
|
|
977
|
+
zoom,
|
|
978
|
+
maximize,
|
|
979
|
+
revert
|
|
980
|
+
};
|
|
981
|
+
Object.assign($xemodal, modalMethods);
|
|
982
|
+
(0, _vue.watch)(() => props.width, recalculate);
|
|
983
|
+
(0, _vue.watch)(() => props.height, recalculate);
|
|
984
|
+
(0, _vue.watch)(() => props.modelValue, value => {
|
|
985
|
+
if (value) {
|
|
986
|
+
openModal();
|
|
987
|
+
} else {
|
|
988
|
+
closeModal('model');
|
|
989
|
+
}
|
|
990
|
+
});
|
|
991
|
+
(0, _vue.onMounted)(() => {
|
|
992
|
+
(0, _vue.nextTick)(() => {
|
|
993
|
+
if (props.storage && !props.id) {
|
|
994
|
+
(0, _log.errLog)('vxe.error.reqProp', ['modal.id']);
|
|
995
|
+
}
|
|
996
|
+
if (props.modelValue) {
|
|
997
|
+
openModal();
|
|
998
|
+
}
|
|
999
|
+
recalculate();
|
|
1000
|
+
});
|
|
1001
|
+
if (props.escClosable) {
|
|
1002
|
+
_event.GlobalEvent.on($xemodal, 'keydown', handleGlobalKeydownEvent);
|
|
1003
|
+
}
|
|
1004
|
+
});
|
|
1005
|
+
(0, _vue.onUnmounted)(() => {
|
|
1006
|
+
_event.GlobalEvent.off($xemodal, 'keydown');
|
|
1007
|
+
removeMsgQueue();
|
|
1008
|
+
});
|
|
1009
|
+
const renderVN = () => {
|
|
1010
|
+
const {
|
|
1011
|
+
className,
|
|
1012
|
+
type,
|
|
1013
|
+
animat,
|
|
1014
|
+
loading,
|
|
1015
|
+
status,
|
|
1016
|
+
lockScroll,
|
|
1017
|
+
lockView,
|
|
1018
|
+
mask,
|
|
1019
|
+
resize
|
|
1020
|
+
} = props;
|
|
1021
|
+
const {
|
|
1022
|
+
inited,
|
|
1023
|
+
zoomLocat,
|
|
1024
|
+
modalTop,
|
|
1025
|
+
contentVisible,
|
|
1026
|
+
visible
|
|
1027
|
+
} = reactData;
|
|
1028
|
+
const vSize = computeSize.value;
|
|
1029
|
+
return (0, _vue.h)(_vue.Teleport, {
|
|
1030
|
+
to: 'body',
|
|
1031
|
+
disabled: props.transfer ? !inited : true
|
|
1032
|
+
}, [(0, _vue.h)('div', {
|
|
1033
|
+
ref: refElem,
|
|
1034
|
+
class: ['vxe-modal--wrapper', `type--${type}`, className || '', {
|
|
1035
|
+
[`size--${vSize}`]: vSize,
|
|
1036
|
+
[`status--${status}`]: status,
|
|
1037
|
+
'is--animat': animat,
|
|
1038
|
+
'lock--scroll': lockScroll,
|
|
1039
|
+
'lock--view': lockView,
|
|
1040
|
+
'is--resize': resize,
|
|
1041
|
+
'is--mask': mask,
|
|
1042
|
+
'is--maximize': zoomLocat,
|
|
1043
|
+
'is--visible': contentVisible,
|
|
1044
|
+
'is--active': visible,
|
|
1045
|
+
'is--loading': loading
|
|
1046
|
+
}],
|
|
1047
|
+
style: {
|
|
1048
|
+
zIndex: reactData.modalZindex,
|
|
1049
|
+
top: modalTop ? `${modalTop}px` : null
|
|
1050
|
+
},
|
|
1051
|
+
onClick: selfClickEvent
|
|
1052
|
+
}, [(0, _vue.h)('div', {
|
|
1053
|
+
ref: refModalBox,
|
|
1054
|
+
class: 'vxe-modal--box',
|
|
1055
|
+
onMousedown: boxMousedownEvent
|
|
1056
|
+
}, renderHeaders().concat(renderBodys(), renderFooters()))])]);
|
|
1057
|
+
};
|
|
1058
|
+
$xemodal.renderVN = renderVN;
|
|
1059
|
+
return $xemodal;
|
|
1060
|
+
},
|
|
1061
|
+
render() {
|
|
1062
|
+
return this.renderVN();
|
|
1063
|
+
}
|
|
1064
|
+
});
|