vxe-pc-ui 3.0.0 → 3.0.2
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/README.md +23 -25
- package/es/button/src/button.js +3 -0
- package/es/calendar/index.js +12 -0
- package/es/calendar/src/calendar.js +1227 -0
- package/es/calendar/style.css +247 -0
- package/es/calendar/style.min.css +1 -0
- package/es/carousel/index.js +12 -0
- package/es/carousel/src/carousel-item.js +100 -0
- package/es/carousel/src/carousel.js +418 -0
- package/es/carousel/src/util.js +17 -0
- package/es/carousel/style.css +185 -0
- package/es/carousel/style.min.css +1 -0
- package/es/carousel-item/index.js +12 -0
- package/es/carousel-item/style.css +0 -0
- package/es/carousel-item/style.min.css +0 -0
- package/es/checkbox/index.js +12 -0
- package/es/checkbox/src/checkbox.js +164 -0
- package/es/checkbox/src/group.js +159 -0
- package/es/checkbox/style.css +117 -0
- package/es/checkbox/style.min.css +1 -0
- package/es/checkbox-group/index.js +12 -0
- package/es/checkbox-group/style.css +0 -0
- package/es/checkbox-group/style.min.css +0 -0
- package/es/collapse/index.js +12 -0
- package/es/collapse/src/collapse-pane.js +39 -0
- package/es/collapse/src/collapse.js +39 -0
- package/es/collapse/style.css +0 -0
- package/es/collapse/style.min.css +0 -0
- package/es/collapse-pane/index.js +12 -0
- package/es/collapse-pane/style.css +0 -0
- package/es/collapse-pane/style.min.css +0 -0
- package/es/components.js +66 -66
- package/es/date-picker/src/date-picker.js +20 -13
- package/es/drawer/src/drawer.js +17 -12
- package/es/form/index.js +13 -0
- package/es/form/render/index.js +461 -0
- package/es/form/src/form-config-item.js +201 -0
- package/es/form/src/form-gather.js +87 -0
- package/es/form/src/form-item.js +291 -0
- package/es/form/src/form.js +762 -0
- package/es/form/src/itemInfo.js +43 -0
- package/es/form/src/render.js +78 -0
- package/es/form/src/util.js +66 -0
- package/es/form/style.css +470 -0
- package/es/form/style.min.css +1 -0
- package/es/form-gather/index.js +12 -0
- package/es/form-gather/style.css +0 -0
- package/es/form-gather/style.min.css +0 -0
- package/es/form-item/index.js +12 -0
- package/es/form-item/style.css +0 -0
- package/es/form-item/style.min.css +0 -0
- package/es/icon/style.css +1 -1
- package/es/icon-picker/index.js +12 -0
- package/es/icon-picker/src/icon-picker.js +672 -0
- package/es/icon-picker/style.css +207 -0
- package/es/icon-picker/style.min.css +1 -0
- package/es/image/src/preview.js +1 -2
- package/es/input/index.js +12 -0
- package/es/input/src/input.js +2896 -0
- package/es/input/style.css +941 -0
- package/es/input/style.min.css +1 -0
- package/es/layout-footer/src/layout-footer.js +2 -1
- package/es/layout-header/src/layout-header.js +2 -1
- package/es/list/index.js +12 -0
- package/es/list/src/list.js +373 -0
- package/es/list/style.css +28 -0
- package/es/list/style.min.css +1 -0
- package/es/loading/src/loading.js +5 -0
- package/es/menu/src/menu.js +6 -2
- package/es/modal/src/modal.js +7 -4
- package/es/number-input/src/number-input.js +11 -7
- package/es/optgroup/index.js +12 -0
- package/es/optgroup/style.css +0 -0
- package/es/optgroup/style.min.css +0 -0
- package/es/option/index.js +12 -0
- package/es/option/style.css +0 -0
- package/es/option/style.min.css +0 -0
- package/es/pager/index.js +12 -0
- package/es/pager/src/pager.js +687 -0
- package/es/pager/style.css +303 -0
- package/es/pager/style.min.css +1 -0
- package/es/password-input/index.js +12 -0
- package/es/password-input/src/password-input.js +392 -0
- package/es/password-input/style.css +604 -0
- package/es/password-input/style.min.css +1 -0
- package/es/pulldown/src/pulldown.js +11 -3
- package/es/radio/src/button.js +6 -2
- package/es/radio/src/group.js +6 -2
- package/es/radio/src/radio.js +6 -2
- package/es/select/index.js +12 -0
- package/es/select/src/optgroup.js +90 -0
- package/es/select/src/option-info.js +16 -0
- package/es/select/src/option.js +86 -0
- package/es/select/src/select.js +1284 -0
- package/es/select/src/util.js +36 -0
- package/es/select/style.css +207 -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/src/switch.js +6 -2
- package/es/tab-pane/index.js +12 -0
- package/es/tab-pane/style.css +0 -0
- package/es/tab-pane/style.min.css +0 -0
- package/es/tabs/index.js +12 -0
- package/es/tabs/src/tab-pane.js +119 -0
- package/es/tabs/src/tabs.js +598 -0
- package/es/tabs/src/util.js +17 -0
- package/es/tabs/style.css +342 -0
- package/es/tabs/style.min.css +1 -0
- package/es/textarea/src/textarea.js +9 -5
- package/es/tooltip/src/tooltip.js +6 -1
- package/es/tree/index.js +12 -0
- package/es/tree/src/tree.js +1216 -0
- package/es/tree/style.css +219 -0
- package/es/tree/style.min.css +1 -0
- package/es/tree-select/index.js +12 -0
- package/es/tree-select/src/tree-select.js +685 -0
- package/es/tree-select/style.css +129 -0
- package/es/tree-select/style.min.css +1 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/vn.js +1 -1
- package/es/upload/src/upload.js +9 -5
- package/es/vxe-calendar/index.js +3 -0
- package/es/vxe-calendar/style.css +247 -0
- package/es/vxe-calendar/style.min.css +1 -0
- package/es/vxe-carousel/index.js +3 -0
- package/es/vxe-carousel/style.css +185 -0
- package/es/vxe-carousel/style.min.css +1 -0
- package/es/vxe-carousel-item/index.js +3 -0
- package/es/vxe-carousel-item/style.css +0 -0
- package/es/vxe-carousel-item/style.min.css +0 -0
- package/es/vxe-checkbox/index.js +3 -0
- package/es/vxe-checkbox/style.css +117 -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-collapse/index.js +3 -0
- package/es/vxe-collapse/style.css +0 -0
- package/es/vxe-collapse/style.min.css +0 -0
- package/es/vxe-collapse-pane/index.js +3 -0
- package/es/vxe-collapse-pane/style.css +0 -0
- package/es/vxe-collapse-pane/style.min.css +0 -0
- package/es/vxe-form/index.js +3 -0
- package/es/vxe-form/style.css +470 -0
- package/es/vxe-form/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-picker/index.js +3 -0
- package/es/vxe-icon-picker/style.css +207 -0
- package/es/vxe-icon-picker/style.min.css +1 -0
- package/es/vxe-input/index.js +3 -0
- package/es/vxe-input/style.css +941 -0
- package/es/vxe-input/style.min.css +1 -0
- package/es/vxe-list/index.js +3 -0
- package/es/vxe-list/style.css +28 -0
- package/es/vxe-list/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 +303 -0
- package/es/vxe-pager/style.min.css +1 -0
- package/es/vxe-password-input/index.js +3 -0
- package/es/vxe-password-input/style.css +604 -0
- package/es/vxe-password-input/style.min.css +1 -0
- package/es/vxe-select/index.js +3 -0
- package/es/vxe-select/style.css +207 -0
- package/es/vxe-select/style.min.css +1 -0
- package/es/vxe-tab-pane/index.js +3 -0
- package/es/vxe-tab-pane/style.css +0 -0
- package/es/vxe-tab-pane/style.min.css +0 -0
- package/es/vxe-tabs/index.js +3 -0
- package/es/vxe-tabs/style.css +342 -0
- package/es/vxe-tabs/style.min.css +1 -0
- package/es/vxe-tree/index.js +3 -0
- package/es/vxe-tree/style.css +219 -0
- package/es/vxe-tree/style.min.css +1 -0
- package/es/vxe-tree-select/index.js +3 -0
- package/es/vxe-tree-select/style.css +129 -0
- package/es/vxe-tree-select/style.min.css +1 -0
- package/lib/button/src/button.js +3 -0
- package/lib/button/src/button.min.js +1 -1
- package/lib/calendar/index.js +19 -0
- package/lib/calendar/index.min.js +1 -0
- package/lib/calendar/src/calendar.js +1286 -0
- package/lib/calendar/src/calendar.min.js +1 -0
- package/lib/calendar/style/index.js +1 -0
- package/lib/calendar/style/style.css +247 -0
- package/lib/calendar/style/style.min.css +1 -0
- package/lib/carousel/index.js +19 -0
- package/lib/carousel/index.min.js +1 -0
- package/lib/carousel/src/carousel-item.js +107 -0
- package/lib/carousel/src/carousel-item.min.js +1 -0
- package/lib/carousel/src/carousel.js +437 -0
- package/lib/carousel/src/carousel.min.js +1 -0
- package/lib/carousel/src/util.js +27 -0
- package/lib/carousel/src/util.min.js +1 -0
- package/lib/carousel/style/index.js +1 -0
- package/lib/carousel/style/style.css +185 -0
- package/lib/carousel/style/style.min.css +1 -0
- package/lib/carousel-item/index.js +19 -0
- package/lib/carousel-item/index.min.js +1 -0
- package/lib/carousel-item/style/index.js +1 -0
- package/lib/carousel-item/style/style.css +0 -0
- package/lib/carousel-item/style/style.min.css +0 -0
- package/lib/checkbox/index.js +19 -0
- package/lib/checkbox/index.min.js +1 -0
- package/lib/checkbox/src/checkbox.js +174 -0
- package/lib/checkbox/src/checkbox.min.js +1 -0
- package/lib/checkbox/src/group.js +169 -0
- package/lib/checkbox/src/group.min.js +1 -0
- package/lib/checkbox/style/index.js +1 -0
- package/lib/checkbox/style/style.css +117 -0
- package/lib/checkbox/style/style.min.css +1 -0
- package/lib/checkbox-group/index.js +19 -0
- package/lib/checkbox-group/index.min.js +1 -0
- package/lib/checkbox-group/style/index.js +1 -0
- package/lib/checkbox-group/style/style.css +0 -0
- package/lib/checkbox-group/style/style.min.css +0 -0
- package/lib/collapse/index.js +19 -0
- package/lib/collapse/index.min.js +1 -0
- package/lib/collapse/src/collapse-pane.js +48 -0
- package/lib/collapse/src/collapse-pane.min.js +1 -0
- package/lib/collapse/src/collapse.js +48 -0
- package/lib/collapse/src/collapse.min.js +1 -0
- package/lib/collapse/style/index.js +1 -0
- package/lib/collapse/style/style.css +0 -0
- package/lib/collapse/style/style.min.css +0 -0
- package/lib/collapse-pane/index.js +19 -0
- package/lib/collapse-pane/index.min.js +1 -0
- package/lib/collapse-pane/style/index.js +1 -0
- package/lib/collapse-pane/style/style.css +0 -0
- package/lib/collapse-pane/style/style.min.css +0 -0
- package/lib/components.js +271 -97
- package/lib/components.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +20 -13
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/drawer/src/drawer.js +17 -12
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/form/index.js +20 -0
- package/lib/form/index.min.js +1 -0
- package/lib/form/render/index.js +509 -0
- package/lib/form/render/index.min.js +1 -0
- package/lib/form/src/form-config-item.js +210 -0
- package/lib/form/src/form-config-item.min.js +1 -0
- package/lib/form/src/form-gather.js +99 -0
- package/lib/form/src/form-gather.min.js +1 -0
- package/lib/form/src/form-item.js +299 -0
- package/lib/form/src/form-item.min.js +1 -0
- package/lib/form/src/form.js +856 -0
- package/lib/form/src/form.min.js +1 -0
- package/lib/form/src/itemInfo.js +60 -0
- package/lib/form/src/itemInfo.min.js +1 -0
- package/lib/form/src/render.js +94 -0
- package/lib/form/src/render.min.js +1 -0
- package/lib/form/src/util.js +93 -0
- package/lib/form/src/util.min.js +1 -0
- package/lib/form/style/index.js +1 -0
- package/lib/form/style/style.css +470 -0
- package/lib/form/style/style.min.css +1 -0
- package/lib/form-gather/index.js +19 -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 +19 -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 +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/icon-picker/index.js +19 -0
- package/lib/icon-picker/index.min.js +1 -0
- package/lib/icon-picker/src/icon-picker.js +650 -0
- package/lib/icon-picker/src/icon-picker.min.js +1 -0
- package/lib/icon-picker/style/index.js +1 -0
- package/lib/icon-picker/style/style.css +207 -0
- package/lib/icon-picker/style/style.min.css +1 -0
- package/lib/image/src/preview.js +1 -2
- package/lib/image/src/preview.min.js +1 -1
- package/lib/index.umd.js +23171 -8764
- package/lib/index.umd.min.js +1 -1
- package/lib/input/index.js +19 -0
- package/lib/input/index.min.js +1 -0
- package/lib/input/src/input.js +2901 -0
- package/lib/input/src/input.min.js +1 -0
- package/lib/input/style/index.js +1 -0
- package/lib/input/style/style.css +941 -0
- package/lib/input/style/style.min.css +1 -0
- package/lib/layout-footer/src/layout-footer.js +2 -1
- package/lib/layout-header/src/layout-header.js +2 -1
- package/lib/list/index.js +19 -0
- package/lib/list/index.min.js +1 -0
- package/lib/list/src/list.js +415 -0
- package/lib/list/src/list.min.js +1 -0
- package/lib/list/style/index.js +1 -0
- package/lib/list/style/style.css +28 -0
- package/lib/list/style/style.min.css +1 -0
- package/lib/loading/src/loading.js +5 -0
- package/lib/loading/src/loading.min.js +1 -1
- package/lib/menu/src/menu.js +6 -2
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/modal/src/modal.js +7 -4
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/number-input/src/number-input.js +11 -7
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/optgroup/index.js +19 -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 +19 -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 +19 -0
- package/lib/pager/index.min.js +1 -0
- package/lib/pager/src/pager.js +714 -0
- package/lib/pager/src/pager.min.js +1 -0
- package/lib/pager/style/index.js +1 -0
- package/lib/pager/style/style.css +303 -0
- package/lib/pager/style/style.min.css +1 -0
- package/lib/password-input/index.js +19 -0
- package/lib/password-input/index.min.js +1 -0
- package/lib/password-input/src/password-input.js +402 -0
- package/lib/password-input/src/password-input.min.js +1 -0
- package/lib/password-input/style/index.js +1 -0
- package/lib/password-input/style/style.css +604 -0
- package/lib/password-input/style/style.min.css +1 -0
- package/lib/pulldown/src/pulldown.js +11 -3
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/radio/src/button.js +6 -2
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/group.js +6 -2
- package/lib/radio/src/group.min.js +1 -1
- package/lib/radio/src/radio.js +6 -2
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/select/index.js +19 -0
- package/lib/select/index.min.js +1 -0
- package/lib/select/src/optgroup.js +97 -0
- package/lib/select/src/optgroup.min.js +1 -0
- package/lib/select/src/option-info.js +33 -0
- package/lib/select/src/option-info.min.js +1 -0
- package/lib/select/src/option.js +93 -0
- package/lib/select/src/option.min.js +1 -0
- package/lib/select/src/select.js +1330 -0
- package/lib/select/src/select.min.js +1 -0
- package/lib/select/src/util.js +51 -0
- package/lib/select/src/util.min.js +1 -0
- package/lib/select/style/index.js +1 -0
- package/lib/select/style/style.css +207 -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/src/switch.js +6 -2
- package/lib/switch/src/switch.min.js +1 -1
- package/lib/tab-pane/index.js +19 -0
- package/lib/tab-pane/index.min.js +1 -0
- package/lib/tab-pane/style/index.js +1 -0
- package/lib/tab-pane/style/style.css +0 -0
- package/lib/tab-pane/style/style.min.css +0 -0
- package/lib/tabs/index.js +19 -0
- package/lib/tabs/index.min.js +1 -0
- package/lib/tabs/src/tab-pane.js +128 -0
- package/lib/tabs/src/tab-pane.min.js +1 -0
- package/lib/tabs/src/tabs.js +635 -0
- package/lib/tabs/src/tabs.min.js +1 -0
- package/lib/tabs/src/util.js +29 -0
- package/lib/tabs/src/util.min.js +1 -0
- package/lib/tabs/style/index.js +1 -0
- package/lib/tabs/style/style.css +342 -0
- package/lib/tabs/style/style.min.css +1 -0
- package/lib/textarea/src/textarea.js +9 -5
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +6 -1
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tree/index.js +19 -0
- package/lib/tree/index.min.js +1 -0
- package/lib/tree/src/tree.js +1324 -0
- package/lib/tree/src/tree.min.js +1 -0
- package/lib/tree/style/index.js +1 -0
- package/lib/tree/style/style.css +219 -0
- package/lib/tree/style/style.min.css +1 -0
- package/lib/tree-select/index.js +19 -0
- package/lib/tree-select/index.min.js +1 -0
- package/lib/tree-select/src/tree-select.js +695 -0
- package/lib/tree-select/src/tree-select.min.js +1 -0
- package/lib/tree-select/style/index.js +1 -0
- package/lib/tree-select/style/style.css +129 -0
- package/lib/tree-select/style/style.min.css +1 -0
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/vn.js +1 -1
- package/lib/ui/src/vn.min.js +1 -1
- package/lib/upload/src/upload.js +9 -5
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/vxe-calendar/index.js +23 -0
- package/lib/vxe-calendar/index.min.js +1 -0
- package/lib/vxe-calendar/style/index.js +1 -0
- package/lib/vxe-calendar/style/style.css +247 -0
- package/lib/vxe-calendar/style/style.min.css +1 -0
- package/lib/vxe-carousel/index.js +23 -0
- package/lib/vxe-carousel/index.min.js +1 -0
- package/lib/vxe-carousel/style/index.js +1 -0
- package/lib/vxe-carousel/style/style.css +185 -0
- package/lib/vxe-carousel/style/style.min.css +1 -0
- package/lib/vxe-carousel-item/index.js +23 -0
- package/lib/vxe-carousel-item/index.min.js +1 -0
- package/lib/vxe-carousel-item/style/index.js +1 -0
- package/lib/vxe-carousel-item/style/style.css +0 -0
- package/lib/vxe-carousel-item/style/style.min.css +0 -0
- package/lib/vxe-checkbox/index.js +23 -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 +117 -0
- package/lib/vxe-checkbox/style/style.min.css +1 -0
- package/lib/vxe-checkbox-group/index.js +23 -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-collapse/index.js +23 -0
- package/lib/vxe-collapse/index.min.js +1 -0
- package/lib/vxe-collapse/style/index.js +1 -0
- package/lib/vxe-collapse/style/style.css +0 -0
- package/lib/vxe-collapse/style/style.min.css +0 -0
- package/lib/vxe-collapse-pane/index.js +23 -0
- package/lib/vxe-collapse-pane/index.min.js +1 -0
- package/lib/vxe-collapse-pane/style/index.js +1 -0
- package/lib/vxe-collapse-pane/style/style.css +0 -0
- package/lib/vxe-collapse-pane/style/style.min.css +0 -0
- package/lib/vxe-form/index.js +23 -0
- 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 +470 -0
- package/lib/vxe-form/style/style.min.css +1 -0
- package/lib/vxe-form-gather/index.js +23 -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 +23 -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-picker/index.js +23 -0
- package/lib/vxe-icon-picker/index.min.js +1 -0
- package/lib/vxe-icon-picker/style/index.js +1 -0
- package/lib/vxe-icon-picker/style/style.css +207 -0
- package/lib/vxe-icon-picker/style/style.min.css +1 -0
- package/lib/vxe-input/index.js +23 -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 +941 -0
- package/lib/vxe-input/style/style.min.css +1 -0
- package/lib/vxe-list/index.js +23 -0
- package/lib/vxe-list/index.min.js +1 -0
- package/lib/vxe-list/style/index.js +1 -0
- package/lib/vxe-list/style/style.css +28 -0
- package/lib/vxe-list/style/style.min.css +1 -0
- package/lib/vxe-optgroup/index.js +23 -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 +23 -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 +23 -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 +303 -0
- package/lib/vxe-pager/style/style.min.css +1 -0
- package/lib/vxe-password-input/index.js +23 -0
- package/lib/vxe-password-input/index.min.js +1 -0
- package/lib/vxe-password-input/style/index.js +1 -0
- package/lib/vxe-password-input/style/style.css +604 -0
- package/lib/vxe-password-input/style/style.min.css +1 -0
- package/lib/vxe-select/index.js +23 -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 +207 -0
- package/lib/vxe-select/style/style.min.css +1 -0
- package/lib/vxe-tab-pane/index.js +23 -0
- package/lib/vxe-tab-pane/index.min.js +1 -0
- package/lib/vxe-tab-pane/style/index.js +1 -0
- package/lib/vxe-tab-pane/style/style.css +0 -0
- package/lib/vxe-tab-pane/style/style.min.css +0 -0
- package/lib/vxe-tabs/index.js +23 -0
- package/lib/vxe-tabs/index.min.js +1 -0
- package/lib/vxe-tabs/style/index.js +1 -0
- package/lib/vxe-tabs/style/style.css +342 -0
- package/lib/vxe-tabs/style/style.min.css +1 -0
- package/lib/vxe-tree/index.js +23 -0
- package/lib/vxe-tree/index.min.js +1 -0
- package/lib/vxe-tree/style/index.js +1 -0
- package/lib/vxe-tree/style/style.css +219 -0
- package/lib/vxe-tree/style/style.min.css +1 -0
- package/lib/vxe-tree-select/index.js +23 -0
- package/lib/vxe-tree-select/index.min.js +1 -0
- package/lib/vxe-tree-select/style/index.js +1 -0
- package/lib/vxe-tree-select/style/style.css +129 -0
- package/lib/vxe-tree-select/style/style.min.css +1 -0
- package/package.json +1 -1
- package/packages/button/src/button.ts +3 -0
- package/packages/calendar/index.ts +16 -0
- package/packages/calendar/src/calendar.ts +1281 -0
- package/packages/carousel/index.ts +16 -0
- package/packages/carousel/src/carousel-item.ts +114 -0
- package/packages/carousel/src/carousel.ts +449 -0
- package/packages/carousel/src/util.ts +21 -0
- package/packages/carousel-item/index.ts +16 -0
- package/packages/checkbox/index.ts +16 -0
- package/packages/checkbox/src/checkbox.ts +182 -0
- package/packages/checkbox/src/group.ts +184 -0
- package/packages/checkbox-group/index.ts +16 -0
- package/packages/collapse/index.ts +16 -0
- package/packages/collapse/src/collapse-pane.ts +47 -0
- package/packages/collapse/src/collapse.ts +47 -0
- package/packages/collapse-pane/index.ts +16 -0
- package/packages/components.ts +66 -66
- package/packages/date-picker/src/date-picker.ts +21 -13
- package/packages/drawer/src/drawer.ts +18 -12
- package/packages/form/index.ts +17 -0
- package/packages/form/render/index.ts +499 -0
- package/packages/form/src/form-config-item.ts +219 -0
- package/packages/form/src/form-gather.ts +104 -0
- package/packages/form/src/form-item.ts +322 -0
- package/packages/form/src/form.ts +809 -0
- package/packages/form/src/itemInfo.ts +47 -0
- package/packages/form/src/render.ts +98 -0
- package/packages/form/src/util.ts +80 -0
- package/packages/form-gather/index.ts +16 -0
- package/packages/form-item/index.ts +16 -0
- package/packages/icon-picker/index.ts +16 -0
- package/packages/icon-picker/src/icon-picker.ts +716 -0
- package/packages/image/src/preview.ts +1 -2
- package/packages/input/index.ts +16 -0
- package/packages/input/src/input.ts +3000 -0
- package/packages/layout-footer/src/layout-footer.ts +5 -3
- package/packages/layout-header/src/layout-header.ts +2 -1
- package/packages/list/index.ts +16 -0
- package/packages/list/src/list.ts +403 -0
- package/packages/loading/src/loading.ts +6 -0
- package/packages/menu/src/menu.ts +7 -2
- package/packages/modal/src/modal.ts +8 -4
- package/packages/number-input/src/number-input.ts +12 -7
- package/packages/optgroup/index.ts +16 -0
- package/packages/option/index.ts +16 -0
- package/packages/pager/index.ts +16 -0
- package/packages/pager/src/pager.ts +743 -0
- package/packages/password-input/index.ts +16 -0
- package/packages/password-input/src/password-input.ts +432 -0
- package/packages/pulldown/src/pulldown.ts +12 -3
- package/packages/radio/src/button.ts +7 -2
- package/packages/radio/src/group.ts +7 -2
- package/packages/radio/src/radio.ts +7 -2
- package/packages/select/index.ts +16 -0
- package/packages/select/src/optgroup.ts +107 -0
- package/packages/select/src/option-info.ts +20 -0
- package/packages/select/src/option.ts +103 -0
- package/packages/select/src/select.ts +1341 -0
- package/packages/select/src/util.ts +47 -0
- package/packages/switch/src/switch.ts +7 -2
- package/packages/tab-pane/index.ts +16 -0
- package/packages/tabs/index.ts +16 -0
- package/packages/tabs/src/tab-pane.ts +136 -0
- package/packages/tabs/src/tabs.ts +636 -0
- package/packages/tabs/src/util.ts +21 -0
- package/packages/textarea/src/textarea.ts +10 -5
- package/packages/tooltip/src/tooltip.ts +7 -1
- package/packages/tree/index.ts +16 -0
- package/packages/tree/src/tree.ts +1292 -0
- package/packages/tree-select/index.ts +16 -0
- package/packages/tree-select/src/tree-select.ts +743 -0
- package/packages/ui/src/vn.ts +1 -1
- package/packages/upload/src/upload.ts +10 -5
- package/types/components/calendar.d.ts +6 -0
- package/types/components/carousel.d.ts +5 -0
- package/types/components/colgroup.d.ts +1 -0
- package/types/components/column.d.ts +1 -0
- package/types/components/drawer.d.ts +11 -10
- package/types/components/form-item.d.ts +1 -1
- package/types/components/form.d.ts +8 -1
- package/types/components/icon-picker.d.ts +4 -0
- package/types/components/input.d.ts +9 -1
- package/types/components/list.d.ts +1 -0
- package/types/components/optgroup.d.ts +10 -4
- package/types/components/table.d.ts +43 -4
- package/types/components/tabs.d.ts +4 -0
- package/types/components/toolbar.d.ts +5 -0
- package/types/components/tree-select.d.ts +4 -0
- package/types/ui/index.d.ts +0 -5
- package/types/ui/renderer.d.ts +37 -36
- package/types/handles/form-design.d.ts +0 -4
- package/types/handles/index.d.ts +0 -3
- package/types/handles/list-design.d.ts +0 -4
- package/types/handles/table.d.ts +0 -4
- /package/es/icon/style/{iconfont.1725630285930.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/es/icon/style/{iconfont.1725630285930.woff → iconfont.1725869586078.woff} +0 -0
- /package/es/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725869586078.woff2} +0 -0
- /package/es/{iconfont.1725630285930.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/es/{iconfont.1725630285930.woff → iconfont.1725869586078.woff} +0 -0
- /package/es/{iconfont.1725630285930.woff2 → iconfont.1725869586078.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1725630285930.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1725630285930.woff → iconfont.1725869586078.woff} +0 -0
- /package/lib/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725869586078.woff2} +0 -0
- /package/lib/{iconfont.1725630285930.ttf → iconfont.1725869586078.ttf} +0 -0
- /package/lib/{iconfont.1725630285930.woff → iconfont.1725869586078.woff} +0 -0
- /package/lib/{iconfont.1725630285930.woff2 → iconfont.1725869586078.woff2} +0 -0
|
@@ -0,0 +1,650 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _comp = require("../../ui/src/comp");
|
|
8
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
|
+
var _ui = require("../../ui");
|
|
10
|
+
var _dom = require("../../ui/src/dom");
|
|
11
|
+
var _utils = require("../../ui/src/utils");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
18
|
+
name: 'VxeIconPicker',
|
|
19
|
+
mixins: [_ui.globalMixins.sizeMixin],
|
|
20
|
+
model: {
|
|
21
|
+
prop: 'value',
|
|
22
|
+
event: 'modelValue'
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
value: String,
|
|
26
|
+
placeholder: String,
|
|
27
|
+
clearable: Boolean,
|
|
28
|
+
size: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: function _default() {
|
|
31
|
+
return (0, _ui.getConfig)().iconPicker.size || (0, _ui.getConfig)().size;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
className: [String, Function],
|
|
35
|
+
popupClassName: [String, Function],
|
|
36
|
+
showIconTitle: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: function _default() {
|
|
39
|
+
return (0, _ui.getConfig)().iconPicker.showIconTitle;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
readonly: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: null
|
|
45
|
+
},
|
|
46
|
+
disabled: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: null
|
|
49
|
+
},
|
|
50
|
+
icons: Array,
|
|
51
|
+
placement: String,
|
|
52
|
+
transfer: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: null
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
inject: {
|
|
58
|
+
$xeModal: {
|
|
59
|
+
default: null
|
|
60
|
+
},
|
|
61
|
+
$xeDrawer: {
|
|
62
|
+
default: null
|
|
63
|
+
},
|
|
64
|
+
$xeTable: {
|
|
65
|
+
default: null
|
|
66
|
+
},
|
|
67
|
+
$xeForm: {
|
|
68
|
+
default: null
|
|
69
|
+
},
|
|
70
|
+
formItemInfo: {
|
|
71
|
+
from: 'xeFormItemInfo',
|
|
72
|
+
default: null
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
provide: function provide() {
|
|
76
|
+
var $xeIconPicker = this;
|
|
77
|
+
return {
|
|
78
|
+
$xeIconPicker: $xeIconPicker
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
data: function data() {
|
|
82
|
+
var reactData = {
|
|
83
|
+
initialized: false,
|
|
84
|
+
selectIcon: '',
|
|
85
|
+
panelIndex: 0,
|
|
86
|
+
panelStyle: {},
|
|
87
|
+
panelPlacement: null,
|
|
88
|
+
visiblePanel: false,
|
|
89
|
+
isAniVisible: false,
|
|
90
|
+
isActivated: false
|
|
91
|
+
};
|
|
92
|
+
var internalData = {
|
|
93
|
+
hpTimeout: undefined
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
xID: _xeUtils.default.uniqueId(),
|
|
97
|
+
reactData: reactData,
|
|
98
|
+
internalData: internalData
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
computed: Object.assign(Object.assign({}, {}), {
|
|
102
|
+
computeFormReadonly: function computeFormReadonly() {
|
|
103
|
+
var $xeIconPicker = this;
|
|
104
|
+
var props = $xeIconPicker;
|
|
105
|
+
var $xeForm = $xeIconPicker.$xeForm;
|
|
106
|
+
var readonly = props.readonly;
|
|
107
|
+
if (readonly === null) {
|
|
108
|
+
if ($xeForm) {
|
|
109
|
+
return $xeForm.readonly;
|
|
110
|
+
}
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
return readonly;
|
|
114
|
+
},
|
|
115
|
+
computeIsDisabled: function computeIsDisabled() {
|
|
116
|
+
var $xeIconPicker = this;
|
|
117
|
+
var props = $xeIconPicker;
|
|
118
|
+
var $xeForm = $xeIconPicker.$xeForm;
|
|
119
|
+
var disabled = props.disabled;
|
|
120
|
+
if (disabled === null) {
|
|
121
|
+
if ($xeForm) {
|
|
122
|
+
return $xeForm.disabled;
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
return disabled;
|
|
127
|
+
},
|
|
128
|
+
computeBtnTransfer: function computeBtnTransfer() {
|
|
129
|
+
var $xeIconPicker = this;
|
|
130
|
+
var props = $xeIconPicker;
|
|
131
|
+
var $xeTable = $xeIconPicker.$xeTable;
|
|
132
|
+
var $xeModal = $xeIconPicker.$xeModal;
|
|
133
|
+
var $xeDrawer = $xeIconPicker.$xeDrawer;
|
|
134
|
+
var $xeForm = $xeIconPicker.$xeForm;
|
|
135
|
+
var transfer = props.transfer;
|
|
136
|
+
if (transfer === null) {
|
|
137
|
+
var globalTransfer = (0, _ui.getConfig)().iconPicker.transfer;
|
|
138
|
+
if (_xeUtils.default.isBoolean(globalTransfer)) {
|
|
139
|
+
return globalTransfer;
|
|
140
|
+
}
|
|
141
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return transfer;
|
|
146
|
+
},
|
|
147
|
+
computeInpPlaceholder: function computeInpPlaceholder() {
|
|
148
|
+
var $xeIconPicker = this;
|
|
149
|
+
var props = $xeIconPicker;
|
|
150
|
+
var placeholder = props.placeholder;
|
|
151
|
+
if (placeholder) {
|
|
152
|
+
return (0, _utils.getFuncText)(placeholder);
|
|
153
|
+
}
|
|
154
|
+
var globalPlaceholder = (0, _ui.getConfig)().select.placeholder;
|
|
155
|
+
if (globalPlaceholder) {
|
|
156
|
+
return (0, _utils.getFuncText)(globalPlaceholder);
|
|
157
|
+
}
|
|
158
|
+
return (0, _ui.getI18n)('vxe.base.pleaseSelect');
|
|
159
|
+
},
|
|
160
|
+
computeIconList: function computeIconList() {
|
|
161
|
+
var $xeIconPicker = this;
|
|
162
|
+
var props = $xeIconPicker;
|
|
163
|
+
var icons = props.icons;
|
|
164
|
+
if (!icons || !icons.length) {
|
|
165
|
+
icons = (0, _ui.getConfig)().iconPicker.icons || [];
|
|
166
|
+
}
|
|
167
|
+
return icons.map(function (name) {
|
|
168
|
+
return {
|
|
169
|
+
title: name,
|
|
170
|
+
icon: "vxe-icon-".concat(name)
|
|
171
|
+
};
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
computeIconGroupList: function computeIconGroupList() {
|
|
175
|
+
var $xeIconPicker = this;
|
|
176
|
+
var iconList = $xeIconPicker.computeIconList;
|
|
177
|
+
return _xeUtils.default.chunk(iconList, 4);
|
|
178
|
+
}
|
|
179
|
+
}),
|
|
180
|
+
methods: {
|
|
181
|
+
//
|
|
182
|
+
// Method
|
|
183
|
+
//
|
|
184
|
+
dispatchEvent: function dispatchEvent(type, params, evnt) {
|
|
185
|
+
var $xeIconPicker = this;
|
|
186
|
+
$xeIconPicker.$emit(type, (0, _ui.createEvent)(evnt, {
|
|
187
|
+
$iconPicker: $xeIconPicker
|
|
188
|
+
}, params));
|
|
189
|
+
},
|
|
190
|
+
emitModel: function emitModel(value) {
|
|
191
|
+
var $xeDrawer = this;
|
|
192
|
+
$xeDrawer.$emit('modelValue', value);
|
|
193
|
+
},
|
|
194
|
+
isPanelVisible: function isPanelVisible() {
|
|
195
|
+
var $xeIconPicker = this;
|
|
196
|
+
var reactData = $xeIconPicker.reactData;
|
|
197
|
+
return reactData.visiblePanel;
|
|
198
|
+
},
|
|
199
|
+
togglePanel: function togglePanel() {
|
|
200
|
+
var $xeIconPicker = this;
|
|
201
|
+
var reactData = $xeIconPicker.reactData;
|
|
202
|
+
if (reactData.visiblePanel) {
|
|
203
|
+
$xeIconPicker.hideOptionPanel();
|
|
204
|
+
} else {
|
|
205
|
+
$xeIconPicker.showOptionPanel();
|
|
206
|
+
}
|
|
207
|
+
return $xeIconPicker.$nextTick();
|
|
208
|
+
},
|
|
209
|
+
hidePanel: function hidePanel() {
|
|
210
|
+
var $xeIconPicker = this;
|
|
211
|
+
var reactData = $xeIconPicker.reactData;
|
|
212
|
+
if (reactData.visiblePanel) {
|
|
213
|
+
$xeIconPicker.hideOptionPanel();
|
|
214
|
+
}
|
|
215
|
+
return $xeIconPicker.$nextTick();
|
|
216
|
+
},
|
|
217
|
+
showPanel: function showPanel() {
|
|
218
|
+
var $xeIconPicker = this;
|
|
219
|
+
var reactData = $xeIconPicker.reactData;
|
|
220
|
+
if (!reactData.visiblePanel) {
|
|
221
|
+
$xeIconPicker.showOptionPanel();
|
|
222
|
+
}
|
|
223
|
+
return $xeIconPicker.$nextTick();
|
|
224
|
+
},
|
|
225
|
+
focus: function focus() {
|
|
226
|
+
var $xeIconPicker = this;
|
|
227
|
+
var reactData = $xeIconPicker.reactData;
|
|
228
|
+
var $input = $xeIconPicker.$refs.refInput;
|
|
229
|
+
reactData.isActivated = true;
|
|
230
|
+
$input.blur();
|
|
231
|
+
return $xeIconPicker.$nextTick();
|
|
232
|
+
},
|
|
233
|
+
blur: function blur() {
|
|
234
|
+
var $xeIconPicker = this;
|
|
235
|
+
var reactData = $xeIconPicker.reactData;
|
|
236
|
+
var $input = $xeIconPicker.$refs.refInput;
|
|
237
|
+
$input.blur();
|
|
238
|
+
reactData.isActivated = false;
|
|
239
|
+
return $xeIconPicker.$nextTick();
|
|
240
|
+
},
|
|
241
|
+
updateZindex: function updateZindex() {
|
|
242
|
+
var $xeIconPicker = this;
|
|
243
|
+
var reactData = $xeIconPicker.reactData;
|
|
244
|
+
if (reactData.panelIndex < (0, _utils.getLastZIndex)()) {
|
|
245
|
+
reactData.panelIndex = (0, _utils.nextZIndex)();
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
updatePlacement: function updatePlacement() {
|
|
249
|
+
var $xeIconPicker = this;
|
|
250
|
+
var props = $xeIconPicker;
|
|
251
|
+
var reactData = $xeIconPicker.reactData;
|
|
252
|
+
return $xeIconPicker.$nextTick().then(function () {
|
|
253
|
+
var placement = props.placement;
|
|
254
|
+
var panelIndex = reactData.panelIndex;
|
|
255
|
+
var el = $xeIconPicker.$refs.refElem;
|
|
256
|
+
var panelElem = $xeIconPicker.$refs.refOptionPanel;
|
|
257
|
+
var btnTransfer = $xeIconPicker.computeBtnTransfer;
|
|
258
|
+
if (panelElem && el) {
|
|
259
|
+
var targetHeight = el.offsetHeight;
|
|
260
|
+
var targetWidth = el.offsetWidth;
|
|
261
|
+
var panelHeight = panelElem.offsetHeight;
|
|
262
|
+
var panelWidth = panelElem.offsetWidth;
|
|
263
|
+
var marginSize = 5;
|
|
264
|
+
var panelStyle = {
|
|
265
|
+
zIndex: panelIndex
|
|
266
|
+
};
|
|
267
|
+
var _getAbsolutePos = (0, _dom.getAbsolutePos)(el),
|
|
268
|
+
boundingTop = _getAbsolutePos.boundingTop,
|
|
269
|
+
boundingLeft = _getAbsolutePos.boundingLeft,
|
|
270
|
+
visibleHeight = _getAbsolutePos.visibleHeight,
|
|
271
|
+
visibleWidth = _getAbsolutePos.visibleWidth;
|
|
272
|
+
var panelPlacement = 'bottom';
|
|
273
|
+
if (btnTransfer) {
|
|
274
|
+
var left = boundingLeft;
|
|
275
|
+
var top = boundingTop + targetHeight;
|
|
276
|
+
if (placement === 'top') {
|
|
277
|
+
panelPlacement = 'top';
|
|
278
|
+
top = boundingTop - panelHeight;
|
|
279
|
+
} else if (!placement) {
|
|
280
|
+
// 如果下面不够放,则向上
|
|
281
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
282
|
+
panelPlacement = 'top';
|
|
283
|
+
top = boundingTop - panelHeight;
|
|
284
|
+
}
|
|
285
|
+
// 如果上面不够放,则向下(优先)
|
|
286
|
+
if (top < marginSize) {
|
|
287
|
+
panelPlacement = 'bottom';
|
|
288
|
+
top = boundingTop + targetHeight;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
// 如果溢出右边
|
|
292
|
+
if (left + panelWidth + marginSize > visibleWidth) {
|
|
293
|
+
left -= left + panelWidth + marginSize - visibleWidth;
|
|
294
|
+
}
|
|
295
|
+
// 如果溢出左边
|
|
296
|
+
if (left < marginSize) {
|
|
297
|
+
left = marginSize;
|
|
298
|
+
}
|
|
299
|
+
Object.assign(panelStyle, {
|
|
300
|
+
left: "".concat(left, "px"),
|
|
301
|
+
top: "".concat(top, "px"),
|
|
302
|
+
minWidth: "".concat(targetWidth, "px")
|
|
303
|
+
});
|
|
304
|
+
} else {
|
|
305
|
+
if (placement === 'top') {
|
|
306
|
+
panelPlacement = 'top';
|
|
307
|
+
panelStyle.bottom = "".concat(targetHeight, "px");
|
|
308
|
+
} else if (!placement) {
|
|
309
|
+
// 如果下面不够放,则向上
|
|
310
|
+
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
311
|
+
// 如果上面不够放,则向下(优先)
|
|
312
|
+
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
313
|
+
panelPlacement = 'top';
|
|
314
|
+
panelStyle.bottom = "".concat(targetHeight, "px");
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
reactData.panelStyle = panelStyle;
|
|
320
|
+
reactData.panelPlacement = panelPlacement;
|
|
321
|
+
return $xeIconPicker.$nextTick();
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
},
|
|
325
|
+
showOptionPanel: function showOptionPanel() {
|
|
326
|
+
var $xeIconPicker = this;
|
|
327
|
+
var reactData = $xeIconPicker.reactData;
|
|
328
|
+
var internalData = $xeIconPicker.internalData;
|
|
329
|
+
var hpTimeout = internalData.hpTimeout;
|
|
330
|
+
var isDisabled = $xeIconPicker.computeIsDisabled;
|
|
331
|
+
if (!isDisabled) {
|
|
332
|
+
if (hpTimeout) {
|
|
333
|
+
clearTimeout(hpTimeout);
|
|
334
|
+
internalData.hpTimeout = undefined;
|
|
335
|
+
}
|
|
336
|
+
var btnTransfer = $xeIconPicker.computeBtnTransfer;
|
|
337
|
+
var panelElem = $xeIconPicker.$refs.refOptionPanel;
|
|
338
|
+
if (!reactData.initialized) {
|
|
339
|
+
reactData.initialized = true;
|
|
340
|
+
if (btnTransfer) {
|
|
341
|
+
if (panelElem) {
|
|
342
|
+
document.body.appendChild(panelElem);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
reactData.isActivated = true;
|
|
347
|
+
reactData.isAniVisible = true;
|
|
348
|
+
setTimeout(function () {
|
|
349
|
+
reactData.visiblePanel = true;
|
|
350
|
+
}, 10);
|
|
351
|
+
$xeIconPicker.updateZindex();
|
|
352
|
+
$xeIconPicker.updatePlacement();
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
hideOptionPanel: function hideOptionPanel() {
|
|
356
|
+
var $xeIconPicker = this;
|
|
357
|
+
var reactData = $xeIconPicker.reactData;
|
|
358
|
+
var internalData = $xeIconPicker.internalData;
|
|
359
|
+
reactData.visiblePanel = false;
|
|
360
|
+
internalData.hpTimeout = window.setTimeout(function () {
|
|
361
|
+
reactData.isAniVisible = false;
|
|
362
|
+
}, 350);
|
|
363
|
+
},
|
|
364
|
+
changeEvent: function changeEvent(evnt, selectValue) {
|
|
365
|
+
var $xeIconPicker = this;
|
|
366
|
+
var props = $xeIconPicker;
|
|
367
|
+
var reactData = $xeIconPicker.reactData;
|
|
368
|
+
var $xeForm = $xeIconPicker.$xeForm;
|
|
369
|
+
var formItemInfo = $xeIconPicker.formItemInfo;
|
|
370
|
+
reactData.selectIcon = selectValue;
|
|
371
|
+
if (selectValue !== props.value) {
|
|
372
|
+
$xeIconPicker.emitModel(selectValue);
|
|
373
|
+
$xeIconPicker.dispatchEvent('change', {
|
|
374
|
+
value: selectValue
|
|
375
|
+
}, evnt);
|
|
376
|
+
// 自动更新校验状态
|
|
377
|
+
if ($xeForm && formItemInfo) {
|
|
378
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, selectValue);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
focusEvent: function focusEvent() {
|
|
383
|
+
var $xeIconPicker = this;
|
|
384
|
+
var reactData = $xeIconPicker.reactData;
|
|
385
|
+
var isDisabled = $xeIconPicker.computeIsDisabled;
|
|
386
|
+
if (!isDisabled) {
|
|
387
|
+
if (!reactData.visiblePanel) {
|
|
388
|
+
$xeIconPicker.showOptionPanel();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
blurEvent: function blurEvent() {
|
|
393
|
+
var $xeIconPicker = this;
|
|
394
|
+
var reactData = $xeIconPicker.reactData;
|
|
395
|
+
reactData.isActivated = false;
|
|
396
|
+
},
|
|
397
|
+
clearValueEvent: function clearValueEvent(evnt, selectValue) {
|
|
398
|
+
var $xeIconPicker = this;
|
|
399
|
+
$xeIconPicker.changeEvent(evnt, selectValue);
|
|
400
|
+
$xeIconPicker.dispatchEvent('clear', {
|
|
401
|
+
value: selectValue
|
|
402
|
+
}, evnt);
|
|
403
|
+
},
|
|
404
|
+
clearEvent: function clearEvent(params, evnt) {
|
|
405
|
+
var $xeIconPicker = this;
|
|
406
|
+
$xeIconPicker.clearValueEvent(evnt, null);
|
|
407
|
+
$xeIconPicker.hideOptionPanel();
|
|
408
|
+
},
|
|
409
|
+
togglePanelEvent: function togglePanelEvent(evnt) {
|
|
410
|
+
var $xeIconPicker = this;
|
|
411
|
+
var reactData = $xeIconPicker.reactData;
|
|
412
|
+
evnt.preventDefault();
|
|
413
|
+
if (reactData.visiblePanel) {
|
|
414
|
+
$xeIconPicker.hideOptionPanel();
|
|
415
|
+
} else {
|
|
416
|
+
$xeIconPicker.showOptionPanel();
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
clickEvent: function clickEvent(evnt) {
|
|
420
|
+
var $xeIconPicker = this;
|
|
421
|
+
$xeIconPicker.togglePanelEvent(evnt);
|
|
422
|
+
$xeIconPicker.dispatchEvent('click', {}, evnt);
|
|
423
|
+
},
|
|
424
|
+
handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
|
|
425
|
+
var $xeIconPicker = this;
|
|
426
|
+
var reactData = $xeIconPicker.reactData;
|
|
427
|
+
var visiblePanel = reactData.visiblePanel;
|
|
428
|
+
var isDisabled = $xeIconPicker.computeIsDisabled;
|
|
429
|
+
if (!isDisabled) {
|
|
430
|
+
if (visiblePanel) {
|
|
431
|
+
var panelElem = $xeIconPicker.$refs.refOptionPanel;
|
|
432
|
+
if ((0, _dom.getEventTargetNode)(evnt, panelElem).flag) {
|
|
433
|
+
$xeIconPicker.updatePlacement();
|
|
434
|
+
} else {
|
|
435
|
+
$xeIconPicker.hideOptionPanel();
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
|
|
441
|
+
var $xeIconPicker = this;
|
|
442
|
+
var reactData = $xeIconPicker.reactData;
|
|
443
|
+
var visiblePanel = reactData.visiblePanel;
|
|
444
|
+
var isDisabled = $xeIconPicker.computeIsDisabled;
|
|
445
|
+
if (!isDisabled) {
|
|
446
|
+
var el = $xeIconPicker.$refs.refElem;
|
|
447
|
+
var panelElem = $xeIconPicker.$refs.refOptionPanel;
|
|
448
|
+
reactData.isActivated = (0, _dom.getEventTargetNode)(evnt, el).flag || (0, _dom.getEventTargetNode)(evnt, panelElem).flag;
|
|
449
|
+
if (visiblePanel && !reactData.isActivated) {
|
|
450
|
+
$xeIconPicker.hideOptionPanel();
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
|
|
455
|
+
var $xeIconPicker = this;
|
|
456
|
+
var props = $xeIconPicker;
|
|
457
|
+
var reactData = $xeIconPicker.reactData;
|
|
458
|
+
var clearable = props.clearable;
|
|
459
|
+
var visiblePanel = reactData.visiblePanel;
|
|
460
|
+
var isDisabled = $xeIconPicker.computeIsDisabled;
|
|
461
|
+
if (!isDisabled) {
|
|
462
|
+
var isTab = _ui.globalEvents.hasKey(evnt, _ui.GLOBAL_EVENT_KEYS.TAB);
|
|
463
|
+
var isEnter = _ui.globalEvents.hasKey(evnt, _ui.GLOBAL_EVENT_KEYS.ENTER);
|
|
464
|
+
var isEsc = _ui.globalEvents.hasKey(evnt, _ui.GLOBAL_EVENT_KEYS.ESCAPE);
|
|
465
|
+
var isUpArrow = _ui.globalEvents.hasKey(evnt, _ui.GLOBAL_EVENT_KEYS.ARROW_UP);
|
|
466
|
+
var isDwArrow = _ui.globalEvents.hasKey(evnt, _ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);
|
|
467
|
+
var isDel = _ui.globalEvents.hasKey(evnt, _ui.GLOBAL_EVENT_KEYS.DELETE);
|
|
468
|
+
var isSpacebar = _ui.globalEvents.hasKey(evnt, _ui.GLOBAL_EVENT_KEYS.SPACEBAR);
|
|
469
|
+
if (isTab) {
|
|
470
|
+
reactData.isActivated = false;
|
|
471
|
+
}
|
|
472
|
+
if (visiblePanel) {
|
|
473
|
+
if (isEsc || isTab) {
|
|
474
|
+
$xeIconPicker.hideOptionPanel();
|
|
475
|
+
} else if (isEnter) {
|
|
476
|
+
evnt.preventDefault();
|
|
477
|
+
evnt.stopPropagation();
|
|
478
|
+
// changeOptionEvent(evnt, currentValue, currentOption)
|
|
479
|
+
} else if (isUpArrow || isDwArrow) {
|
|
480
|
+
evnt.preventDefault();
|
|
481
|
+
// let { firstOption, offsetOption } = findOffsetOption(currentValue, isUpArrow)
|
|
482
|
+
// if (!offsetOption && !findVisibleOption(currentValue)) {
|
|
483
|
+
// offsetOption = firstOption
|
|
484
|
+
// }
|
|
485
|
+
// setCurrentOption(offsetOption)
|
|
486
|
+
// scrollToOption(offsetOption, isDwArrow)
|
|
487
|
+
} else if (isSpacebar) {
|
|
488
|
+
evnt.preventDefault();
|
|
489
|
+
}
|
|
490
|
+
} else if ((isUpArrow || isDwArrow || isEnter || isSpacebar) && reactData.isActivated) {
|
|
491
|
+
evnt.preventDefault();
|
|
492
|
+
$xeIconPicker.showOptionPanel();
|
|
493
|
+
}
|
|
494
|
+
if (reactData.isActivated) {
|
|
495
|
+
if (isDel && clearable) {
|
|
496
|
+
$xeIconPicker.clearValueEvent(evnt, null);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
handleGlobalBlurEvent: function handleGlobalBlurEvent() {
|
|
502
|
+
var $xeIconPicker = this;
|
|
503
|
+
$xeIconPicker.hideOptionPanel();
|
|
504
|
+
},
|
|
505
|
+
handleClickIconEvent: function handleClickIconEvent(evnt, item) {
|
|
506
|
+
var $xeIconPicker = this;
|
|
507
|
+
var value = item.icon;
|
|
508
|
+
$xeIconPicker.changeEvent(evnt, value);
|
|
509
|
+
$xeIconPicker.hideOptionPanel();
|
|
510
|
+
},
|
|
511
|
+
//
|
|
512
|
+
// Render
|
|
513
|
+
//
|
|
514
|
+
renderIconWrapper: function renderIconWrapper(h) {
|
|
515
|
+
var $xeIconPicker = this;
|
|
516
|
+
var props = $xeIconPicker;
|
|
517
|
+
var showIconTitle = props.showIconTitle;
|
|
518
|
+
var iconGroupList = $xeIconPicker.computeIconGroupList;
|
|
519
|
+
var isDisabled = $xeIconPicker.computeIsDisabled;
|
|
520
|
+
return h('div', {
|
|
521
|
+
class: 'vxe-ico-picker--list-wrapper'
|
|
522
|
+
}, iconGroupList.map(function (list) {
|
|
523
|
+
return h('div', {
|
|
524
|
+
class: 'vxe-ico-picker--list'
|
|
525
|
+
}, list.map(function (item) {
|
|
526
|
+
return h('div', {
|
|
527
|
+
class: 'vxe-ico-picker--item',
|
|
528
|
+
on: {
|
|
529
|
+
click: function click(evnt) {
|
|
530
|
+
if (!isDisabled) {
|
|
531
|
+
$xeIconPicker.handleClickIconEvent(evnt, item);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}, [h('div', {
|
|
536
|
+
class: 'vxe-ico-picker--item-icon'
|
|
537
|
+
}, [h('i', {
|
|
538
|
+
class: item.icon || ''
|
|
539
|
+
})]), showIconTitle ? h('div', {
|
|
540
|
+
class: 'vxe-ico-picker--item-title'
|
|
541
|
+
}, "".concat(item.title || '')) : (0, _ui.renderEmptyElement)($xeIconPicker)]);
|
|
542
|
+
}));
|
|
543
|
+
}));
|
|
544
|
+
},
|
|
545
|
+
renderVN: function renderVN(h) {
|
|
546
|
+
var $xeIconPicker = this;
|
|
547
|
+
var props = $xeIconPicker;
|
|
548
|
+
var reactData = $xeIconPicker.reactData;
|
|
549
|
+
var className = props.className,
|
|
550
|
+
popupClassName = props.popupClassName,
|
|
551
|
+
clearable = props.clearable;
|
|
552
|
+
var initialized = reactData.initialized,
|
|
553
|
+
isActivated = reactData.isActivated,
|
|
554
|
+
visiblePanel = reactData.visiblePanel,
|
|
555
|
+
selectIcon = reactData.selectIcon;
|
|
556
|
+
var vSize = $xeIconPicker.computeSize;
|
|
557
|
+
var isDisabled = $xeIconPicker.computeIsDisabled;
|
|
558
|
+
var btnTransfer = $xeIconPicker.computeBtnTransfer;
|
|
559
|
+
var formReadonly = $xeIconPicker.computeFormReadonly;
|
|
560
|
+
var inpPlaceholder = $xeIconPicker.computeInpPlaceholder;
|
|
561
|
+
if (formReadonly) {
|
|
562
|
+
return h('div', {
|
|
563
|
+
ref: 'refElem',
|
|
564
|
+
class: ['vxe-ico-picker--readonly', className]
|
|
565
|
+
}, [h('i', {
|
|
566
|
+
class: selectIcon
|
|
567
|
+
})]);
|
|
568
|
+
}
|
|
569
|
+
return h('div', {
|
|
570
|
+
ref: 'refElem',
|
|
571
|
+
class: ['vxe-ico-picker', className ? _xeUtils.default.isFunction(className) ? className({
|
|
572
|
+
$iconPicker: $xeIconPicker
|
|
573
|
+
}) : className : '', _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "size--".concat(vSize), vSize), 'show--clear', clearable && !isDisabled && !!selectIcon), 'is--visible', visiblePanel), 'is--disabled', isDisabled), 'is--active', isActivated)]
|
|
574
|
+
}, [h('div', {
|
|
575
|
+
class: 'vxe-ico-picker--inner',
|
|
576
|
+
on: {
|
|
577
|
+
click: $xeIconPicker.clickEvent
|
|
578
|
+
}
|
|
579
|
+
}, [h('input', {
|
|
580
|
+
ref: 'refInput',
|
|
581
|
+
class: 'vxe-ico-picker--input',
|
|
582
|
+
on: {
|
|
583
|
+
focus: $xeIconPicker.focusEvent,
|
|
584
|
+
blur: $xeIconPicker.blurEvent
|
|
585
|
+
}
|
|
586
|
+
}), selectIcon ? h('div', {
|
|
587
|
+
class: 'vxe-ico-picker--icon'
|
|
588
|
+
}, [h('i', {
|
|
589
|
+
class: selectIcon
|
|
590
|
+
})]) : h('div', {
|
|
591
|
+
class: 'vxe-ico-picker--placeholder'
|
|
592
|
+
}, inpPlaceholder), h('div', {
|
|
593
|
+
class: 'vxe-ico-picker--suffix'
|
|
594
|
+
}, [h('div', {
|
|
595
|
+
class: 'vxe-ico-picker--clear-icon',
|
|
596
|
+
on: {
|
|
597
|
+
click: $xeIconPicker.clearEvent
|
|
598
|
+
}
|
|
599
|
+
}, [h('i', {
|
|
600
|
+
class: (0, _ui.getIcon)().INPUT_CLEAR
|
|
601
|
+
})]), h('div', {
|
|
602
|
+
class: 'vxe-ico-picker--suffix-icon'
|
|
603
|
+
}, [h('i', {
|
|
604
|
+
class: visiblePanel ? (0, _ui.getIcon)().ICON_PICKER_OPEN : (0, _ui.getIcon)().ICON_PICKER_CLOSE
|
|
605
|
+
})])])]), h('div', {
|
|
606
|
+
ref: 'refOptionPanel',
|
|
607
|
+
class: ['vxe-table--ignore-clear vxe-ico-picker--panel', popupClassName ? _xeUtils.default.isFunction(popupClassName) ? popupClassName({
|
|
608
|
+
$iconPicker: $xeIconPicker
|
|
609
|
+
}) : popupClassName : '', _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "size--".concat(vSize), vSize), 'is--transfer', btnTransfer), 'ani--leave', reactData.isAniVisible), 'ani--enter', visiblePanel)],
|
|
610
|
+
attrs: {
|
|
611
|
+
placement: reactData.panelPlacement
|
|
612
|
+
},
|
|
613
|
+
style: reactData.panelStyle
|
|
614
|
+
}, initialized ? [initialized ? h('div', {
|
|
615
|
+
class: 'vxe-ico-picker--panel-wrapper'
|
|
616
|
+
}, [$xeIconPicker.renderIconWrapper(h)]) : (0, _ui.renderEmptyElement)($xeIconPicker)] : [])]);
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
watch: {
|
|
620
|
+
value: function value(val) {
|
|
621
|
+
var $xeIconPicker = this;
|
|
622
|
+
var reactData = $xeIconPicker.reactData;
|
|
623
|
+
reactData.selectIcon = "".concat(val || '');
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
created: function created() {
|
|
627
|
+
var $xeIconPicker = this;
|
|
628
|
+
var props = $xeIconPicker;
|
|
629
|
+
var reactData = $xeIconPicker.reactData;
|
|
630
|
+
reactData.selectIcon = "".concat(props.value || '');
|
|
631
|
+
_ui.globalEvents.on($xeIconPicker, 'mousewheel', $xeIconPicker.handleGlobalMousewheelEvent);
|
|
632
|
+
_ui.globalEvents.on($xeIconPicker, 'mousedown', $xeIconPicker.handleGlobalMousedownEvent);
|
|
633
|
+
_ui.globalEvents.on($xeIconPicker, 'keydown', $xeIconPicker.handleGlobalKeydownEvent);
|
|
634
|
+
_ui.globalEvents.on($xeIconPicker, 'blur', $xeIconPicker.handleGlobalBlurEvent);
|
|
635
|
+
},
|
|
636
|
+
beforeDestroy: function beforeDestroy() {
|
|
637
|
+
var $xeIconPicker = this;
|
|
638
|
+
var panelElem = $xeIconPicker.$refs.refOptionPanel;
|
|
639
|
+
if (panelElem && panelElem.parentNode) {
|
|
640
|
+
panelElem.parentNode.removeChild(panelElem);
|
|
641
|
+
}
|
|
642
|
+
_ui.globalEvents.off($xeIconPicker, 'mousewheel');
|
|
643
|
+
_ui.globalEvents.off($xeIconPicker, 'mousedown');
|
|
644
|
+
_ui.globalEvents.off($xeIconPicker, 'keydown');
|
|
645
|
+
_ui.globalEvents.off($xeIconPicker, 'blur');
|
|
646
|
+
},
|
|
647
|
+
render: function render(h) {
|
|
648
|
+
return this.renderVN(h);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeIconPicker",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:String,placeholder:String,clearable:Boolean,size:{type:String,default:function(){return(0,_ui.getConfig)().iconPicker.size||(0,_ui.getConfig)().size}},className:[String,Function],popupClassName:[String,Function],showIconTitle:{type:Boolean,default:function(){return(0,_ui.getConfig)().iconPicker.showIconTitle}},readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},icons:Array,placement:String,transfer:{type:Boolean,default:null}},inject:{$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},provide:function(){return{$xeIconPicker:this}},data:function(){var e={hpTimeout:void 0};return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,selectIcon:"",panelIndex:0,panelStyle:{},panelPlacement:null,visiblePanel:!1,isAniVisible:!1,isActivated:!1},internalData:e}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeBtnTransfer:function(){var e=this,t=e.$xeTable,i=e.$xeModal,n=e.$xeDrawer,o=e.$xeForm,e=e.transfer;if(null===e){var a=(0,_ui.getConfig)().iconPicker.transfer;if(_xeUtils.default.isBoolean(a))return a;if(t||i||n||o)return!0}return e},computeInpPlaceholder:function(){var e=this.placeholder;return(e=e||(0,_ui.getConfig)().select.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseSelect")},computeIconList:function(){var e=this.icons;return(e=e&&e.length?e:(0,_ui.getConfig)().iconPicker.icons||[]).map(function(e){return{title:e,icon:"vxe-icon-".concat(e)}})},computeIconGroupList:function(){var e=this.computeIconList;return _xeUtils.default.chunk(e,4)}}),methods:{dispatchEvent:function(e,t,i){this.$emit(e,(0,_ui.createEvent)(i,{$iconPicker:this},t))},emitModel:function(e){this.$emit("modelValue",e)},isPanelVisible:function(){return this.reactData.visiblePanel},togglePanel:function(){return this.reactData.visiblePanel?this.hideOptionPanel():this.showOptionPanel(),this.$nextTick()},hidePanel:function(){return this.reactData.visiblePanel&&this.hideOptionPanel(),this.$nextTick()},showPanel:function(){return this.reactData.visiblePanel||this.showOptionPanel(),this.$nextTick()},focus:function(){var e=this.reactData,t=this.$refs.refInput;return e.isActivated=!0,t.blur(),this.$nextTick()},blur:function(){var e=this.reactData;return this.$refs.refInput.blur(),e.isActivated=!1,this.$nextTick()},updateZindex:function(){var e=this.reactData;e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){var p=this,d=p,v=p.reactData;return p.$nextTick().then(function(){var e,t,i,n,o,a,l,r=d.placement,c=v.panelIndex,s=p.$refs.refElem,u=p.$refs.refOptionPanel,f=p.computeBtnTransfer;if(u&&s)return e=s.offsetHeight,t=s.offsetWidth,i=u.offsetHeight,u=u.offsetWidth,c={zIndex:c},n=(s=(0,_dom.getAbsolutePos)(s)).boundingTop,o=s.visibleHeight,a=s.visibleWidth,l="bottom",f?(f=n+e,"top"===r?(l="top",f=n-i):r||(o<f+i+5&&(l="top",f=n-i),f<5&&(l="bottom",f=n+e)),a<(s=s.boundingLeft)+u+5&&(s-=s+u+5-a),s<5&&(s=5),Object.assign(c,{left:"".concat(s,"px"),top:"".concat(f,"px"),minWidth:"".concat(t,"px")})):"top"===r?(l="top",c.bottom="".concat(e,"px")):r||o<n+e+i&&5<n-e-i&&(l="top",c.bottom="".concat(e,"px")),v.panelStyle=c,v.panelPlacement=l,p.$nextTick()})},showOptionPanel:function(){var e=this,t=e.reactData,i=e.internalData,n=i.hpTimeout;e.computeIsDisabled||(n&&(clearTimeout(n),i.hpTimeout=void 0),n=e.computeBtnTransfer,i=e.$refs.refOptionPanel,t.initialized||(t.initialized=!0,n&&i&&document.body.appendChild(i)),t.isActivated=!0,t.isAniVisible=!0,setTimeout(function(){t.visiblePanel=!0},10),e.updateZindex(),e.updatePlacement())},hideOptionPanel:function(){var e=this.reactData,t=this.internalData;e.visiblePanel=!1,t.hpTimeout=window.setTimeout(function(){e.isAniVisible=!1},350)},changeEvent:function(e,t){var i=this,n=i,o=i.reactData,a=i.$xeForm,l=i.formItemInfo;(o.selectIcon=t)!==n.value&&(i.emitModel(t),i.dispatchEvent("change",{value:t},e),a)&&l&&a.triggerItemEvent(e,l.itemConfig.field,t)},focusEvent:function(){var e=this.reactData;this.computeIsDisabled||e.visiblePanel||this.showOptionPanel()},blurEvent:function(){this.reactData.isActivated=!1},clearValueEvent:function(e,t){this.changeEvent(e,t),this.dispatchEvent("clear",{value:t},e)},clearEvent:function(e,t){this.clearValueEvent(t,null),this.hideOptionPanel()},togglePanelEvent:function(e){var t=this.reactData;e.preventDefault(),t.visiblePanel?this.hideOptionPanel():this.showOptionPanel()},clickEvent:function(e){this.togglePanelEvent(e),this.dispatchEvent("click",{},e)},handleGlobalMousewheelEvent:function(e){var t=this,i=t.reactData.visiblePanel;t.computeIsDisabled||i&&(i=t.$refs.refOptionPanel,(0,_dom.getEventTargetNode)(e,i).flag?t.updatePlacement():t.hideOptionPanel())},handleGlobalMousedownEvent:function(e){var t,i,n=this,o=n.reactData,a=o.visiblePanel;n.computeIsDisabled||(t=n.$refs.refElem,i=n.$refs.refOptionPanel,o.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,i).flag,a&&!o.isActivated&&n.hideOptionPanel())},handleGlobalKeydownEvent:function(e){var t,i,n,o,a,l,r,c=this,s=c.reactData,u=c.clearable,f=s.visiblePanel;c.computeIsDisabled||(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.TAB),i=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ENTER),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),o=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),a=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN),l=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.DELETE),r=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.SPACEBAR),t&&(s.isActivated=!1),f?n||t?c.hideOptionPanel():i?(e.preventDefault(),e.stopPropagation()):(o||a||r)&&e.preventDefault():(o||a||i||r)&&s.isActivated&&(e.preventDefault(),c.showOptionPanel()),s.isActivated&&l&&u&&c.clearValueEvent(e,null))},handleGlobalBlurEvent:function(){this.hideOptionPanel()},handleClickIconEvent:function(e,t){t=t.icon;this.changeEvent(e,t),this.hideOptionPanel()},renderIconWrapper:function(i){var n=this,o=n.showIconTitle,e=n.computeIconGroupList,a=n.computeIsDisabled;return i("div",{class:"vxe-ico-picker--list-wrapper"},e.map(function(e){return i("div",{class:"vxe-ico-picker--list"},e.map(function(t){return i("div",{class:"vxe-ico-picker--item",on:{click:function(e){a||n.handleClickIconEvent(e,t)}}},[i("div",{class:"vxe-ico-picker--item-icon"},[i("i",{class:t.icon||""})]),o?i("div",{class:"vxe-ico-picker--item-title"},"".concat(t.title||"")):(0,_ui.renderEmptyElement)(n)])}))}))},renderVN:function(e){var t=this,i=t.reactData,n=t.className,o=t.popupClassName,a=t.clearable,l=i.initialized,r=i.isActivated,c=i.visiblePanel,s=i.selectIcon,u=t.computeSize,f=t.computeIsDisabled,p=t.computeBtnTransfer,d=t.computeInpPlaceholder;return t.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-ico-picker--readonly",n]},[e("i",{class:s})]):e("div",{ref:"refElem",class:["vxe-ico-picker",n?_xeUtils.default.isFunction(n)?n({$iconPicker:t}):n:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(u),u),"show--clear",a&&!f&&!!s),"is--visible",c),"is--disabled",f),"is--active",r)]},[e("div",{class:"vxe-ico-picker--inner",on:{click:t.clickEvent}},[e("input",{ref:"refInput",class:"vxe-ico-picker--input",on:{focus:t.focusEvent,blur:t.blurEvent}}),s?e("div",{class:"vxe-ico-picker--icon"},[e("i",{class:s})]):e("div",{class:"vxe-ico-picker--placeholder"},d),e("div",{class:"vxe-ico-picker--suffix"},[e("div",{class:"vxe-ico-picker--clear-icon",on:{click:t.clearEvent}},[e("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]),e("div",{class:"vxe-ico-picker--suffix-icon"},[e("i",{class:c?(0,_ui.getIcon)().ICON_PICKER_OPEN:(0,_ui.getIcon)().ICON_PICKER_CLOSE})])])]),e("div",{ref:"refOptionPanel",class:["vxe-table--ignore-clear vxe-ico-picker--panel",o?_xeUtils.default.isFunction(o)?o({$iconPicker:t}):o:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(u),u),"is--transfer",p),"ani--leave",i.isAniVisible),"ani--enter",c)],attrs:{placement:i.panelPlacement},style:i.panelStyle},l?[l?e("div",{class:"vxe-ico-picker--panel-wrapper"},[t.renderIconWrapper(e)]):(0,_ui.renderEmptyElement)(t)]:[])])}},watch:{value:function(e){this.reactData.selectIcon="".concat(e||"")}},created:function(){var e=this;e.reactData.selectIcon="".concat(e.value||""),_ui.globalEvents.on(e,"mousewheel",e.handleGlobalMousewheelEvent),_ui.globalEvents.on(e,"mousedown",e.handleGlobalMousedownEvent),_ui.globalEvents.on(e,"keydown",e.handleGlobalKeydownEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent)},beforeDestroy:function(){var e=this,t=e.$refs.refOptionPanel;t&&t.parentNode&&t.parentNode.removeChild(t),_ui.globalEvents.off(e,"mousewheel"),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"keydown"),_ui.globalEvents.off(e,"blur")},render:function(e){return this.renderVN(e)}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./style.css')
|