vxe-pc-ui 3.0.0 → 3.0.1
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/button/src/button.js +3 -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 +159 -0
- package/es/checkbox/src/group.js +154 -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/components.js +39 -39
- package/es/date-picker/src/date-picker.js +3 -0
- package/es/icon/style.css +1 -1
- package/es/icon-picker/index.js +12 -0
- package/es/icon-picker/src/icon-picker.js +668 -0
- package/es/icon-picker/style.css +207 -0
- package/es/icon-picker/style.min.css +1 -0
- package/es/input/index.js +12 -0
- package/es/input/src/input.js +2892 -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/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/password-input/index.js +12 -0
- package/es/password-input/src/password-input.js +388 -0
- package/es/password-input/style.css +604 -0
- package/es/password-input/style.min.css +1 -0
- package/es/pulldown/src/pulldown.js +5 -1
- 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 +1269 -0
- package/es/select/src/util.js +35 -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/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 +593 -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/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- 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-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-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-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/lib/button/src/button.js +3 -0
- package/lib/button/src/button.min.js +1 -1
- 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 +169 -0
- package/lib/checkbox/src/checkbox.min.js +1 -0
- package/lib/checkbox/src/group.js +164 -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/components.js +159 -60
- package/lib/components.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +3 -0
- package/lib/date-picker/src/date-picker.min.js +1 -1
- 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 +646 -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/index.umd.js +15870 -7738
- 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 +2897 -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/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/password-input/index.js +19 -0
- package/lib/password-input/index.min.js +1 -0
- package/lib/password-input/src/password-input.js +398 -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 +5 -1
- package/lib/pulldown/src/pulldown.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 +1315 -0
- package/lib/select/src/select.min.js +1 -0
- package/lib/select/src/util.js +50 -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/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 +630 -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/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/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-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-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-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/package.json +1 -1
- package/packages/button/src/button.ts +3 -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 +176 -0
- package/packages/checkbox/src/group.ts +178 -0
- package/packages/checkbox-group/index.ts +16 -0
- package/packages/components.ts +39 -39
- package/packages/date-picker/src/date-picker.ts +3 -0
- package/packages/icon-picker/index.ts +16 -0
- package/packages/icon-picker/src/icon-picker.ts +711 -0
- package/packages/input/index.ts +16 -0
- package/packages/input/src/input.ts +2995 -0
- package/packages/layout-footer/src/layout-footer.ts +4 -3
- package/packages/layout-header/src/layout-header.ts +2 -1
- 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 +427 -0
- package/packages/pulldown/src/pulldown.ts +5 -1
- 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 +1325 -0
- package/packages/select/src/util.ts +46 -0
- 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 +630 -0
- package/packages/tabs/src/util.ts +21 -0
- package/types/components/carousel.d.ts +5 -0
- package/types/components/icon-picker.d.ts +4 -0
- package/types/components/input.d.ts +9 -1
- package/types/components/optgroup.d.ts +10 -4
- package/types/components/tabs.d.ts +4 -0
- /package/es/icon/style/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
- /package/es/icon/style/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
- /package/es/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
- /package/es/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
- /package/es/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
- /package/es/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
- /package/lib/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
- /package/lib/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
- /package/lib/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
- /package/lib/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { defineVxeComponent } from '../../ui/src/comp';
|
|
2
|
+
import XEUtils from 'xe-utils';
|
|
3
|
+
import { getConfig, getIcon, getI18n, createEvent, globalMixins, renderEmptyElement } from '../../ui';
|
|
4
|
+
import { getFuncText } from '../../ui/src/utils';
|
|
5
|
+
import { getSlotVNs } from '../..//ui/src/vn';
|
|
6
|
+
export default defineVxeComponent({
|
|
7
|
+
name: 'VxePasswordInput',
|
|
8
|
+
mixins: [
|
|
9
|
+
globalMixins.sizeMixin
|
|
10
|
+
],
|
|
11
|
+
model: {
|
|
12
|
+
prop: 'value',
|
|
13
|
+
event: 'modelValue'
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
value: String,
|
|
17
|
+
name: String,
|
|
18
|
+
clearable: { type: Boolean, default: () => getConfig().passwordInput.clearable },
|
|
19
|
+
readonly: Boolean,
|
|
20
|
+
disabled: Boolean,
|
|
21
|
+
maxLength: [String, Number],
|
|
22
|
+
placeholder: String,
|
|
23
|
+
autoComplete: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'off'
|
|
26
|
+
},
|
|
27
|
+
className: String,
|
|
28
|
+
size: { type: String, default: () => getConfig().passwordInput.size || getConfig().size },
|
|
29
|
+
prefixIcon: String,
|
|
30
|
+
suffixIcon: String,
|
|
31
|
+
// 已废弃
|
|
32
|
+
autocomplete: String
|
|
33
|
+
},
|
|
34
|
+
inject: {
|
|
35
|
+
$xeForm: {
|
|
36
|
+
default: null
|
|
37
|
+
},
|
|
38
|
+
formItemInfo: {
|
|
39
|
+
from: 'xeFormItemInfo',
|
|
40
|
+
default: null
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
data() {
|
|
44
|
+
const xID = XEUtils.uniqueId();
|
|
45
|
+
const reactData = {
|
|
46
|
+
showPwd: false,
|
|
47
|
+
isActivated: false,
|
|
48
|
+
inputValue: ''
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
xID,
|
|
52
|
+
reactData
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
computed: Object.assign(Object.assign({}, {}), { computeIsClearable() {
|
|
56
|
+
const $xePasswordInput = this;
|
|
57
|
+
const props = $xePasswordInput;
|
|
58
|
+
return props.clearable;
|
|
59
|
+
},
|
|
60
|
+
computeInpReadonly() {
|
|
61
|
+
const $xePasswordInput = this;
|
|
62
|
+
const props = $xePasswordInput;
|
|
63
|
+
const { readonly } = props;
|
|
64
|
+
return readonly;
|
|
65
|
+
},
|
|
66
|
+
computeInpPlaceholder() {
|
|
67
|
+
const $xePasswordInput = this;
|
|
68
|
+
const props = $xePasswordInput;
|
|
69
|
+
const { placeholder } = props;
|
|
70
|
+
if (placeholder) {
|
|
71
|
+
return getFuncText(placeholder);
|
|
72
|
+
}
|
|
73
|
+
const globalPlaceholder = getConfig().passwordInput.placeholder;
|
|
74
|
+
if (globalPlaceholder) {
|
|
75
|
+
return getFuncText(globalPlaceholder);
|
|
76
|
+
}
|
|
77
|
+
return getI18n('vxe.base.pleaseInput');
|
|
78
|
+
},
|
|
79
|
+
computeInputType() {
|
|
80
|
+
const $xePasswordInput = this;
|
|
81
|
+
const reactData = $xePasswordInput.reactData;
|
|
82
|
+
const { showPwd } = reactData;
|
|
83
|
+
if (showPwd) {
|
|
84
|
+
return 'text';
|
|
85
|
+
}
|
|
86
|
+
return 'password';
|
|
87
|
+
} }),
|
|
88
|
+
methods: {
|
|
89
|
+
//
|
|
90
|
+
// Method
|
|
91
|
+
//
|
|
92
|
+
dispatchEvent(type, params, evnt) {
|
|
93
|
+
const $xePasswordInput = this;
|
|
94
|
+
$xePasswordInput.$emit(type, createEvent(evnt, { $passwordInput: $xePasswordInput }, params));
|
|
95
|
+
},
|
|
96
|
+
focus() {
|
|
97
|
+
const $xePasswordInput = this;
|
|
98
|
+
const reactData = $xePasswordInput.reactData;
|
|
99
|
+
const inputElem = $xePasswordInput.$refs.refInputTarget;
|
|
100
|
+
reactData.isActivated = true;
|
|
101
|
+
inputElem.focus();
|
|
102
|
+
return $xePasswordInput.$nextTick();
|
|
103
|
+
},
|
|
104
|
+
blur() {
|
|
105
|
+
const $xePasswordInput = this;
|
|
106
|
+
const reactData = $xePasswordInput.reactData;
|
|
107
|
+
const inputElem = $xePasswordInput.$refs.refInputTarget;
|
|
108
|
+
inputElem.blur();
|
|
109
|
+
reactData.isActivated = false;
|
|
110
|
+
return $xePasswordInput.$nextTick();
|
|
111
|
+
},
|
|
112
|
+
select() {
|
|
113
|
+
const $xePasswordInput = this;
|
|
114
|
+
const reactData = $xePasswordInput.reactData;
|
|
115
|
+
const inputElem = $xePasswordInput.$refs.refInputTarget;
|
|
116
|
+
inputElem.select();
|
|
117
|
+
reactData.isActivated = false;
|
|
118
|
+
return $xePasswordInput.$nextTick();
|
|
119
|
+
},
|
|
120
|
+
triggerEvent(evnt) {
|
|
121
|
+
const $xePasswordInput = this;
|
|
122
|
+
const reactData = $xePasswordInput.reactData;
|
|
123
|
+
const { inputValue } = reactData;
|
|
124
|
+
$xePasswordInput.dispatchEvent(evnt.type, { value: inputValue }, evnt);
|
|
125
|
+
},
|
|
126
|
+
emitInputEvent(value, evnt) {
|
|
127
|
+
const $xePasswordInput = this;
|
|
128
|
+
const reactData = $xePasswordInput.reactData;
|
|
129
|
+
reactData.inputValue = value;
|
|
130
|
+
$xePasswordInput.dispatchEvent('input', { value }, evnt);
|
|
131
|
+
},
|
|
132
|
+
inputEvent(evnt) {
|
|
133
|
+
const $xePasswordInput = this;
|
|
134
|
+
const inputElem = evnt.target;
|
|
135
|
+
const value = inputElem.value;
|
|
136
|
+
$xePasswordInput.emitInputEvent(value, evnt);
|
|
137
|
+
},
|
|
138
|
+
emitModel(value, evnt) {
|
|
139
|
+
const $xePasswordInput = this;
|
|
140
|
+
const props = $xePasswordInput;
|
|
141
|
+
const reactData = $xePasswordInput.reactData;
|
|
142
|
+
const $xeForm = $xePasswordInput.$xeForm;
|
|
143
|
+
const formItemInfo = $xePasswordInput.formItemInfo;
|
|
144
|
+
reactData.inputValue = value;
|
|
145
|
+
$xePasswordInput.$emit('modelValue', value);
|
|
146
|
+
$xePasswordInput.dispatchEvent('input', { value }, evnt);
|
|
147
|
+
if (XEUtils.toValueString(props.value) !== value) {
|
|
148
|
+
$xePasswordInput.dispatchEvent('change', { value }, evnt);
|
|
149
|
+
// 自动更新校验状态
|
|
150
|
+
if ($xeForm && formItemInfo) {
|
|
151
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
changeEvent(evnt) {
|
|
156
|
+
const $xePasswordInput = this;
|
|
157
|
+
const reactData = $xePasswordInput.reactData;
|
|
158
|
+
const $xeForm = $xePasswordInput.$xeForm;
|
|
159
|
+
const formItemInfo = $xePasswordInput.formItemInfo;
|
|
160
|
+
$xePasswordInput.triggerEvent(evnt);
|
|
161
|
+
const { inputValue } = reactData;
|
|
162
|
+
// 自动更新校验状态
|
|
163
|
+
if ($xeForm && formItemInfo) {
|
|
164
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, inputValue);
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
focusEvent(evnt) {
|
|
168
|
+
const $xePasswordInput = this;
|
|
169
|
+
const reactData = $xePasswordInput.reactData;
|
|
170
|
+
reactData.isActivated = true;
|
|
171
|
+
$xePasswordInput.triggerEvent(evnt);
|
|
172
|
+
},
|
|
173
|
+
blurEvent(evnt) {
|
|
174
|
+
const $xePasswordInput = this;
|
|
175
|
+
const reactData = $xePasswordInput.reactData;
|
|
176
|
+
const { inputValue } = reactData;
|
|
177
|
+
$xePasswordInput.dispatchEvent('blur', { value: inputValue }, evnt);
|
|
178
|
+
},
|
|
179
|
+
passwordToggleEvent(evnt) {
|
|
180
|
+
const $xePasswordInput = this;
|
|
181
|
+
const props = $xePasswordInput;
|
|
182
|
+
const reactData = $xePasswordInput.reactData;
|
|
183
|
+
const { readonly, disabled } = props;
|
|
184
|
+
const { showPwd } = reactData;
|
|
185
|
+
if (!disabled && !readonly) {
|
|
186
|
+
reactData.showPwd = !showPwd;
|
|
187
|
+
}
|
|
188
|
+
$xePasswordInput.dispatchEvent('toggle-visible', { visible: reactData.showPwd }, evnt);
|
|
189
|
+
},
|
|
190
|
+
clickEvent(evnt) {
|
|
191
|
+
const $xePasswordInput = this;
|
|
192
|
+
$xePasswordInput.triggerEvent(evnt);
|
|
193
|
+
},
|
|
194
|
+
clearValueEvent(evnt, value) {
|
|
195
|
+
const $xePasswordInput = this;
|
|
196
|
+
$xePasswordInput.focus();
|
|
197
|
+
$xePasswordInput.emitModel('', evnt);
|
|
198
|
+
$xePasswordInput.dispatchEvent('clear', { value }, evnt);
|
|
199
|
+
},
|
|
200
|
+
clickSuffixEvent(evnt) {
|
|
201
|
+
const $xePasswordInput = this;
|
|
202
|
+
const props = $xePasswordInput;
|
|
203
|
+
const reactData = $xePasswordInput.reactData;
|
|
204
|
+
const { disabled } = props;
|
|
205
|
+
if (!disabled) {
|
|
206
|
+
const { inputValue } = reactData;
|
|
207
|
+
$xePasswordInput.dispatchEvent('suffix-click', { value: inputValue }, evnt);
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
clickPrefixEvent(evnt) {
|
|
211
|
+
const $xePasswordInput = this;
|
|
212
|
+
const props = $xePasswordInput;
|
|
213
|
+
const reactData = $xePasswordInput.reactData;
|
|
214
|
+
const { disabled } = props;
|
|
215
|
+
if (!disabled) {
|
|
216
|
+
const { inputValue } = reactData;
|
|
217
|
+
$xePasswordInput.dispatchEvent('prefix-click', { value: inputValue }, evnt);
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
//
|
|
221
|
+
// Render
|
|
222
|
+
//
|
|
223
|
+
renderPasswordIcon(h) {
|
|
224
|
+
const $xePasswordInput = this;
|
|
225
|
+
const reactData = $xePasswordInput.reactData;
|
|
226
|
+
const { showPwd } = reactData;
|
|
227
|
+
return h('div', {
|
|
228
|
+
class: 'password-input--control-icon',
|
|
229
|
+
on: {
|
|
230
|
+
click: $xePasswordInput.passwordToggleEvent
|
|
231
|
+
}
|
|
232
|
+
}, [
|
|
233
|
+
h('i', {
|
|
234
|
+
class: ['password-input--password-icon', showPwd ? getIcon().PASSWORD_INPUT_SHOW_PWD : getIcon().PASSWORD_INPUT_HIDE_PWD]
|
|
235
|
+
})
|
|
236
|
+
]);
|
|
237
|
+
},
|
|
238
|
+
renderPrefixIcon(h) {
|
|
239
|
+
const $xePasswordInput = this;
|
|
240
|
+
const props = $xePasswordInput;
|
|
241
|
+
const slots = $xePasswordInput.$scopedSlots;
|
|
242
|
+
const { prefixIcon } = props;
|
|
243
|
+
const prefixSlot = slots.prefix;
|
|
244
|
+
return prefixSlot || prefixIcon
|
|
245
|
+
? h('div', {
|
|
246
|
+
class: 'password-input--prefix',
|
|
247
|
+
on: {
|
|
248
|
+
click: $xePasswordInput.clickPrefixEvent
|
|
249
|
+
}
|
|
250
|
+
}, [
|
|
251
|
+
h('div', {
|
|
252
|
+
class: 'password-input--prefix-icon'
|
|
253
|
+
}, prefixSlot
|
|
254
|
+
? getSlotVNs(prefixSlot({}))
|
|
255
|
+
: [
|
|
256
|
+
h('i', {
|
|
257
|
+
class: prefixIcon
|
|
258
|
+
})
|
|
259
|
+
])
|
|
260
|
+
])
|
|
261
|
+
: null;
|
|
262
|
+
},
|
|
263
|
+
renderSuffixIcon(h) {
|
|
264
|
+
const $xePasswordInput = this;
|
|
265
|
+
const props = $xePasswordInput;
|
|
266
|
+
const slots = $xePasswordInput.$scopedSlots;
|
|
267
|
+
const reactData = $xePasswordInput.reactData;
|
|
268
|
+
const { disabled, suffixIcon } = props;
|
|
269
|
+
const { inputValue } = reactData;
|
|
270
|
+
const suffixSlot = slots.suffix;
|
|
271
|
+
const isClearable = $xePasswordInput.computeIsClearable;
|
|
272
|
+
return isClearable || suffixSlot || suffixIcon
|
|
273
|
+
? h('div', {
|
|
274
|
+
class: ['password-input--suffix', {
|
|
275
|
+
'is--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
|
|
276
|
+
}]
|
|
277
|
+
}, [
|
|
278
|
+
isClearable
|
|
279
|
+
? h('div', {
|
|
280
|
+
class: 'password-input--clear-icon',
|
|
281
|
+
on: {
|
|
282
|
+
click: $xePasswordInput.clearValueEvent
|
|
283
|
+
}
|
|
284
|
+
}, [
|
|
285
|
+
h('i', {
|
|
286
|
+
class: getIcon().INPUT_CLEAR
|
|
287
|
+
})
|
|
288
|
+
])
|
|
289
|
+
: renderEmptyElement($xePasswordInput),
|
|
290
|
+
$xePasswordInput.renderExtraSuffixIcon(h),
|
|
291
|
+
suffixSlot || suffixIcon
|
|
292
|
+
? h('div', {
|
|
293
|
+
class: 'password-input--suffix-icon',
|
|
294
|
+
on: {
|
|
295
|
+
click: $xePasswordInput.clickSuffixEvent
|
|
296
|
+
}
|
|
297
|
+
}, suffixSlot
|
|
298
|
+
? getSlotVNs(suffixSlot({}))
|
|
299
|
+
: [
|
|
300
|
+
h('i', {
|
|
301
|
+
class: suffixIcon
|
|
302
|
+
})
|
|
303
|
+
])
|
|
304
|
+
: renderEmptyElement($xePasswordInput)
|
|
305
|
+
])
|
|
306
|
+
: null;
|
|
307
|
+
},
|
|
308
|
+
renderExtraSuffixIcon(h) {
|
|
309
|
+
const $xePasswordInput = this;
|
|
310
|
+
return $xePasswordInput.renderPasswordIcon(h);
|
|
311
|
+
},
|
|
312
|
+
renderVN(h) {
|
|
313
|
+
const $xePasswordInput = this;
|
|
314
|
+
const props = $xePasswordInput;
|
|
315
|
+
const reactData = $xePasswordInput.reactData;
|
|
316
|
+
const { className, name, disabled, readonly, autocomplete, autoComplete, maxLength } = props;
|
|
317
|
+
const { inputValue, isActivated } = reactData;
|
|
318
|
+
const vSize = $xePasswordInput.computeSize;
|
|
319
|
+
const inpReadonly = $xePasswordInput.computeInpReadonly;
|
|
320
|
+
const inputType = $xePasswordInput.computeInputType;
|
|
321
|
+
const inpPlaceholder = $xePasswordInput.computeInpPlaceholder;
|
|
322
|
+
const isClearable = $xePasswordInput.computeIsClearable;
|
|
323
|
+
const prefix = $xePasswordInput.renderPrefixIcon(h);
|
|
324
|
+
const suffix = $xePasswordInput.renderSuffixIcon(h);
|
|
325
|
+
return h('div', {
|
|
326
|
+
ref: 'refElem',
|
|
327
|
+
class: ['password-input', className, {
|
|
328
|
+
[`size--${vSize}`]: vSize,
|
|
329
|
+
'is--prefix': !!prefix,
|
|
330
|
+
'is--suffix': !!suffix,
|
|
331
|
+
'is--readonly': readonly,
|
|
332
|
+
'is--disabled': disabled,
|
|
333
|
+
'is--active': isActivated,
|
|
334
|
+
'show--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
|
|
335
|
+
}],
|
|
336
|
+
attrs: {
|
|
337
|
+
spellcheck: false
|
|
338
|
+
}
|
|
339
|
+
}, [
|
|
340
|
+
prefix || renderEmptyElement($xePasswordInput),
|
|
341
|
+
h('div', {
|
|
342
|
+
class: 'password-input--wrapper'
|
|
343
|
+
}, [
|
|
344
|
+
h('input', {
|
|
345
|
+
ref: 'refInputTarget',
|
|
346
|
+
class: 'password-input--inner',
|
|
347
|
+
domProps: {
|
|
348
|
+
value: inputValue
|
|
349
|
+
},
|
|
350
|
+
attrs: {
|
|
351
|
+
name,
|
|
352
|
+
type: inputType,
|
|
353
|
+
placeholder: inpPlaceholder,
|
|
354
|
+
readonly: inpReadonly,
|
|
355
|
+
disabled,
|
|
356
|
+
autocomplete: autocomplete || autoComplete,
|
|
357
|
+
maxlength: maxLength
|
|
358
|
+
},
|
|
359
|
+
on: {
|
|
360
|
+
click: $xePasswordInput.clickEvent,
|
|
361
|
+
input: $xePasswordInput.inputEvent,
|
|
362
|
+
change: $xePasswordInput.changeEvent,
|
|
363
|
+
focus: $xePasswordInput.focusEvent,
|
|
364
|
+
blur: $xePasswordInput.blurEvent
|
|
365
|
+
}
|
|
366
|
+
})
|
|
367
|
+
]),
|
|
368
|
+
suffix || renderEmptyElement($xePasswordInput)
|
|
369
|
+
]);
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
watch: {
|
|
373
|
+
value(val) {
|
|
374
|
+
const $xePasswordInput = this;
|
|
375
|
+
const reactData = $xePasswordInput.reactData;
|
|
376
|
+
reactData.inputValue = val;
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
created() {
|
|
380
|
+
const $xePasswordInput = this;
|
|
381
|
+
const props = $xePasswordInput;
|
|
382
|
+
const reactData = $xePasswordInput.reactData;
|
|
383
|
+
reactData.inputValue = props.value;
|
|
384
|
+
},
|
|
385
|
+
render(h) {
|
|
386
|
+
return this.renderVN(h);
|
|
387
|
+
}
|
|
388
|
+
});
|