vxe-pc-ui 4.17.0 → 4.17.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/dist/all.esm.js +297 -152
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/date-picker/src/date-picker.js +6 -2
- package/es/date-range-picker/src/date-range-picker.js +6 -2
- package/es/icon/style.css +1 -1
- package/es/input/src/input.js +79 -51
- package/es/number-input/src/number-input.js +31 -23
- package/es/password-input/src/password-input.js +133 -62
- package/es/password-input/style.css +5 -0
- package/es/password-input/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/textarea/src/textarea.js +43 -13
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-password-input/style.css +5 -0
- package/es/vxe-password-input/style.min.css +1 -1
- package/lib/date-picker/src/date-picker.js +6 -1
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +6 -1
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +321 -168
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +83 -53
- package/lib/input/src/input.min.js +1 -1
- package/lib/number-input/src/number-input.js +35 -25
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/password-input/src/password-input.js +140 -71
- package/lib/password-input/src/password-input.min.js +1 -1
- package/lib/password-input/style/style.css +5 -0
- package/lib/password-input/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/textarea/src/textarea.js +46 -13
- package/lib/textarea/src/textarea.min.js +1 -1
- 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-password-input/style/style.css +5 -0
- package/lib/vxe-password-input/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/date-picker/src/date-picker.ts +6 -2
- package/packages/date-range-picker/src/date-range-picker.ts +6 -2
- package/packages/input/src/input.ts +85 -56
- package/packages/number-input/src/number-input.ts +32 -25
- package/packages/password-input/src/password-input.ts +145 -69
- package/packages/textarea/src/textarea.ts +49 -17
- package/styles/components/password-input.scss +4 -0
- package/types/components/date-picker.d.ts +2 -0
- package/types/components/date-range-picker.d.ts +2 -0
- package/types/components/input.d.ts +2 -0
- package/types/components/number-input.d.ts +2 -0
- package/types/components/password-input.d.ts +4 -0
- package/types/components/table-module/edit.d.ts +37 -4
- package/types/components/table.d.ts +9 -2
- package/types/components/textarea.d.ts +2 -0
- package/types/ui/renderer.d.ts +9 -3
- /package/es/icon/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
- /package/es/icon/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
- /package/es/icon/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
- /package/es/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
- /package/es/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
- /package/es/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
- /package/lib/icon/style/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
- /package/lib/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
- /package/lib/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
- /package/lib/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
|
@@ -50,6 +50,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
50
50
|
align: String,
|
|
51
51
|
form: String,
|
|
52
52
|
className: String,
|
|
53
|
+
inputClassName: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: () => (0, _ui.getConfig)().numberInput.inputClassName
|
|
56
|
+
},
|
|
53
57
|
size: {
|
|
54
58
|
type: String,
|
|
55
59
|
default: () => (0, _ui.getConfig)().numberInput.size || (0, _ui.getConfig)().size
|
|
@@ -331,6 +335,12 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
331
335
|
}
|
|
332
336
|
return false;
|
|
333
337
|
});
|
|
338
|
+
const computeInpClassNamevalue = (0, _vue.computed)(() => {
|
|
339
|
+
const {
|
|
340
|
+
inputClassName
|
|
341
|
+
} = props;
|
|
342
|
+
return 'vxe-number-input--input' + (inputClassName ? ' ' + inputClassName : '');
|
|
343
|
+
});
|
|
334
344
|
const refMaps = {
|
|
335
345
|
refElem,
|
|
336
346
|
refInput: refInputTarget
|
|
@@ -347,7 +357,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
347
357
|
getRefMaps: () => refMaps,
|
|
348
358
|
getComputeMaps: () => computeMaps
|
|
349
359
|
};
|
|
350
|
-
|
|
360
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
361
|
+
emit(type, (0, _ui.createEvent)(evnt, {
|
|
362
|
+
$numberInput: $xeNumberInput
|
|
363
|
+
}, params));
|
|
364
|
+
};
|
|
351
365
|
const handleNumberString = val => {
|
|
352
366
|
if (_xeUtils.default.eqNull(val)) {
|
|
353
367
|
return '';
|
|
@@ -382,7 +396,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
382
396
|
const {
|
|
383
397
|
inputValue
|
|
384
398
|
} = reactData;
|
|
385
|
-
|
|
399
|
+
dispatchEvent(evnt.type, {
|
|
386
400
|
value: inputValue
|
|
387
401
|
}, evnt);
|
|
388
402
|
};
|
|
@@ -398,11 +412,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
398
412
|
reactData.inputValue = inputValue || '';
|
|
399
413
|
});
|
|
400
414
|
}
|
|
401
|
-
|
|
415
|
+
dispatchEvent('input', {
|
|
402
416
|
value
|
|
403
417
|
}, evnt);
|
|
404
418
|
if (isChange) {
|
|
405
|
-
|
|
419
|
+
dispatchEvent('change', {
|
|
406
420
|
value
|
|
407
421
|
}, evnt);
|
|
408
422
|
// 自动更新校验状态
|
|
@@ -418,7 +432,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
418
432
|
if (inpImmediate) {
|
|
419
433
|
handleChange(value, inputValue, evnt);
|
|
420
434
|
} else {
|
|
421
|
-
|
|
435
|
+
dispatchEvent('input', {
|
|
422
436
|
value
|
|
423
437
|
}, evnt);
|
|
424
438
|
// 自动更新校验状态
|
|
@@ -437,7 +451,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
437
451
|
if (!inpImmediate) {
|
|
438
452
|
triggerEvent(evnt);
|
|
439
453
|
}
|
|
440
|
-
|
|
454
|
+
dispatchEvent('lazy-change', {
|
|
441
455
|
value: reactData.inputValue
|
|
442
456
|
}, evnt);
|
|
443
457
|
};
|
|
@@ -459,7 +473,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
459
473
|
const {
|
|
460
474
|
inputValue
|
|
461
475
|
} = reactData;
|
|
462
|
-
|
|
476
|
+
dispatchEvent('prefix-click', {
|
|
463
477
|
value: inputValue
|
|
464
478
|
}, evnt);
|
|
465
479
|
}
|
|
@@ -467,10 +481,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
467
481
|
const clearValueEvent = (evnt, value) => {
|
|
468
482
|
focus();
|
|
469
483
|
handleChange(null, '', evnt);
|
|
470
|
-
|
|
484
|
+
dispatchEvent('clear', {
|
|
471
485
|
value
|
|
472
486
|
}, evnt);
|
|
473
|
-
|
|
487
|
+
dispatchEvent('lazy-change', {
|
|
474
488
|
value
|
|
475
489
|
}, evnt);
|
|
476
490
|
};
|
|
@@ -480,7 +494,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
480
494
|
const {
|
|
481
495
|
inputValue
|
|
482
496
|
} = reactData;
|
|
483
|
-
|
|
497
|
+
dispatchEvent('suffix-click', {
|
|
484
498
|
value: inputValue
|
|
485
499
|
}, evnt);
|
|
486
500
|
}
|
|
@@ -608,7 +622,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
608
622
|
afterCheckValue();
|
|
609
623
|
reactData.isFocus = false;
|
|
610
624
|
reactData.isActivated = false;
|
|
611
|
-
|
|
625
|
+
dispatchEvent('blur', {
|
|
612
626
|
value
|
|
613
627
|
}, evnt);
|
|
614
628
|
// 自动更新校验状态
|
|
@@ -647,14 +661,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
647
661
|
numberChange(true, evnt);
|
|
648
662
|
}
|
|
649
663
|
reactData.isActivated = true;
|
|
650
|
-
|
|
664
|
+
dispatchEvent('plus-number', {
|
|
651
665
|
value: reactData.inputValue
|
|
652
666
|
}, evnt);
|
|
653
|
-
|
|
667
|
+
dispatchEvent('lazy-change', {
|
|
654
668
|
value: reactData.inputValue
|
|
655
669
|
}, evnt);
|
|
656
670
|
// 已废弃
|
|
657
|
-
|
|
671
|
+
dispatchEvent('next-number', {
|
|
658
672
|
value: reactData.inputValue
|
|
659
673
|
}, evnt);
|
|
660
674
|
};
|
|
@@ -666,14 +680,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
666
680
|
numberChange(false, evnt);
|
|
667
681
|
}
|
|
668
682
|
reactData.isActivated = true;
|
|
669
|
-
|
|
683
|
+
dispatchEvent('minus-number', {
|
|
670
684
|
value: reactData.inputValue
|
|
671
685
|
}, evnt);
|
|
672
|
-
|
|
686
|
+
dispatchEvent('lazy-change', {
|
|
673
687
|
value: reactData.inputValue
|
|
674
688
|
}, evnt);
|
|
675
689
|
// 已废弃
|
|
676
|
-
|
|
690
|
+
dispatchEvent('prev-number', {
|
|
677
691
|
value: reactData.inputValue
|
|
678
692
|
}, evnt);
|
|
679
693
|
};
|
|
@@ -877,12 +891,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
877
891
|
afterCheckValue();
|
|
878
892
|
}
|
|
879
893
|
};
|
|
880
|
-
const
|
|
881
|
-
emit(type, (0, _ui.createEvent)(evnt, {
|
|
882
|
-
$numberInput: $xeNumberInput
|
|
883
|
-
}, params));
|
|
884
|
-
};
|
|
885
|
-
numberInputMethods = {
|
|
894
|
+
const numberInputMethods = {
|
|
886
895
|
dispatchEvent,
|
|
887
896
|
focus() {
|
|
888
897
|
const inputReadonly = computeInputReadonly.value;
|
|
@@ -973,6 +982,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
973
982
|
const inputReadonly = computeInputReadonly.value;
|
|
974
983
|
const inpMaxLength = computeInpMaxLength.value;
|
|
975
984
|
const inpPlaceholder = computeInpPlaceholder.value;
|
|
985
|
+
const inpClassName = computeInpClassNamevalue.value;
|
|
976
986
|
return (0, _vue.h)('div', {
|
|
977
987
|
key: 'ni',
|
|
978
988
|
class: 'vxe-number-input--input-wrapper'
|
|
@@ -980,10 +990,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
980
990
|
class: 'vxe-number-input--input-inner'
|
|
981
991
|
}, [(0, _vue.h)('input', {
|
|
982
992
|
ref: refInputTarget,
|
|
983
|
-
class:
|
|
984
|
-
value: !isFocus && type === 'amount' ? numLabel : inputValue,
|
|
993
|
+
class: inpClassName,
|
|
985
994
|
name,
|
|
986
995
|
type: 'text',
|
|
996
|
+
value: !isFocus && type === 'amount' ? numLabel : inputValue,
|
|
987
997
|
placeholder: inpPlaceholder,
|
|
988
998
|
maxlength: inpMaxLength,
|
|
989
999
|
readonly: inputReadonly,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_util=require("./util");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeNumberInput",props:{modelValue:[String,Number],immediate:{type:Boolean,default:!0},name:String,type:{type:String,default:"number"},clearable:{type:Boolean,default:()=>(0,_ui.getConfig)().numberInput.clearable},readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},placeholder:String,maxLength:{type:[String,Number],default:()=>(0,_ui.getConfig)().numberInput.maxLength},autoComplete:{type:String,default:"off"},align:String,form:String,className:String,size:{type:String,default:()=>(0,_ui.getConfig)().numberInput.size||(0,_ui.getConfig)().size},min:{type:[String,Number],default:null},max:{type:[String,Number],default:null},step:[String,Number],exponential:{type:Boolean,default:()=>(0,_ui.getConfig)().numberInput.exponential},showCurrency:{type:Boolean,default:()=>(0,_ui.getConfig)().numberInput.showCurrency},currencySymbol:{type:String,default:()=>(0,_ui.getConfig)().numberInput.currencySymbol},controlConfig:Object,roundingMode:{type:String,default:()=>(0,_ui.getConfig)().numberInput.roundingMode},digits:{type:[String,Number],default:null},autoFill:{type:Boolean,default:()=>(0,_ui.getConfig)().numberInput.autoFill},editable:{type:Boolean,default:!0},plusIcon:String,minusIcon:String,prefixIcon:String,prefixConfig:Object,suffixIcon:String,suffixConfig:Object,controls:{type:Boolean,default:null},maxlength:[String,Number],autocomplete:String},emits:["update:modelValue","input","change","keydown","keyup","wheel","click","focus","blur","clear","lazy-change","plus-number","minus-number","prefix-click","suffix-click","prev-number","next-number"],setup(g,e){let{slots:b,emit:i}=e,n=(0,_vue.inject)("$xeForm",null),a=(0,_vue.inject)("xeFormItemInfo",null);var t=_xeUtils.default.uniqueId();let q=(0,_ui.useSize)(g).computeSize,x=(0,_vue.reactive)({isFocus:!1,isActivated:!1,inputValue:""}),r={},y=(0,_vue.ref)(),p=(0,_vue.ref)(),F=(0,_vue.ref)(),E=(0,_vue.computed)(()=>{var e=g.readonly;return null===e?!!n&&n.props.readonly:e}),h=(0,_vue.computed)(()=>{var e=g.disabled;return null===e?!!n&&n.props.disabled:e}),o=(0,_vue.computed)(()=>{var{type:e,digits:t}=g;let u=t;return null===u&&null===(u=(0,_ui.getConfig)().numberInput.digits)&&"amount"===e&&(u=2),_xeUtils.default.toInteger(u)||1}),N=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().numberInput.controlConfig,g.controlConfig)),K=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().numberInput.prefixConfig,g.prefixConfig)),R=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().numberInput.suffixConfig,g.suffixConfig)),s=(0,_vue.computed)(()=>{var e=g.type;return"float"===e||"amount"===e}),D=(0,_vue.computed)(()=>{var e=g.type,t=o.value,u=s.value,l=g.step;return"integer"===e?_xeUtils.default.toInteger(l)||1:u?_xeUtils.default.toNumber(l)||1/Math.pow(10,t):_xeUtils.default.toNumber(l)||1}),V=(0,_vue.computed)(()=>g.clearable),C=(0,_vue.computed)(()=>{var e=g.editable;return E.value||!e}),j=(0,_vue.computed)(()=>{var e=g.placeholder;return(e=e||(0,_ui.getConfig)().numberInput.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseInput")}),d=(0,_vue.computed)(()=>{var{type:e,maxLength:t,maxlength:u,min:l,max:i}=g,n=o.value;return(0,_utils.eqEmptyValue)(l)||(0,_utils.eqEmptyValue)(i)?t||u?_xeUtils.default.toNumber(t||u):16:(""+i).length+("integer"===e?0:n+1)+(0<=_xeUtils.default.toNumber(l)?0:1)}),v=(0,_vue.computed)(()=>{var e=g.immediate;return e}),l=(0,_vue.computed)(()=>{var e=g.type,t=x.inputValue;return"integer"===e?_xeUtils.default.toInteger((0,_util.handleNumber)(t)):_xeUtils.default.toNumber((0,_util.handleNumber)(t))}),U=(0,_vue.computed)(()=>{var{type:t,roundingMode:u,showCurrency:l,currencySymbol:i,autoFill:n}=g,a=x.inputValue,r=o.value;if("amount"!==t)return _xeUtils.default.toString(a);{var t=_xeUtils.default.toNumber(a),a={digits:r};"floor"===u?a.floor=!0:"ceil"===u?a.ceil=!0:a.round=!0;let e=_xeUtils.default.commafy(t,a);return n||([r,u]=e.split("."),u&&(t=u.replace(/0+$/,""),e=t?[r,".",t].join(""):r)),l?""+(i||(0,_ui.getI18n)("vxe.numberInput.currencySymbol")||"")+e:e}}),m=(0,_vue.computed)(()=>{var e=g.min,t=x.inputValue,u=l.value;return!(!t&&0!==t||null===e)&&u<=_xeUtils.default.toNumber(e)}),c=(0,_vue.computed)(()=>{var e=g.max,t=x.inputValue,u=l.value;return!(!t&&0!==t||null===e)&&u>=_xeUtils.default.toNumber(e)}),z={refElem:y,refInput:p},P={computeControlOpts:N},_={xID:t,props:g,context:e,reactData:x,internalData:r,getRefMaps:()=>z,getComputeMaps:()=>P},f={},I=e=>_xeUtils.default.eqNull(e)?"":""+e,S=e=>{var{type:t,exponential:u,roundingMode:l,autoFill:i}=g,n=d.value,a=o.value;let r="";return s.value?(r=(0,_util.toFloatValueFixed)(e,t,a,l),i||(r=I(_xeUtils.default.toNumber(r)))):r=I(e),!u||e!==r&&I(e).toLowerCase()!==_xeUtils.default.toNumber(r).toExponential()?r.slice(0,n):e},A=e=>{var t=x.inputValue;f.dispatchEvent(e.type,{value:t},e)},T=(e,t,u)=>{var e=(0,_utils.eqEmptyValue)(e)?null:Number(e),l=e!==g.modelValue;l&&(r.isUM=!0,i("update:modelValue",e)),x.inputValue!==t&&(0,_vue.nextTick)(()=>{x.inputValue=t||""}),f.dispatchEvent("input",{value:e},u),l&&(f.dispatchEvent("change",{value:e},u),n)&&a&&n.triggerItemEvent(u,a.itemConfig.field,e)},M=(e,t)=>{var u=v.value,l=(0,_utils.eqEmptyValue)(e)?null:_xeUtils.default.toNumber(e);x.inputValue=e,u?T(l,e,t):(f.dispatchEvent("input",{value:l},t),n&&a&&n.triggerItemEvent(t,a.itemConfig.field,l))},Y=e=>{var t=e.target.value;M(t,e)},G=e=>{v.value||A(e),_.dispatchEvent("lazy-change",{value:x.inputValue},e)},W=e=>{var t;C.value||(t=x.inputValue,x.inputValue=(0,_utils.eqEmptyValue)(t)?"":""+_xeUtils.default.toNumber(t),x.isFocus=!0,x.isActivated=!0,A(e))},$=e=>{var t;h.value||(t=x.inputValue,f.dispatchEvent("prefix-click",{value:t},e))},k=(e,t)=>{focus(),T(null,"",e),f.dispatchEvent("clear",{value:t},e),_.dispatchEvent("lazy-change",{value:t},e)},H=e=>{var t;h.value||(t=x.inputValue,f.dispatchEvent("suffix-click",{value:t},e))},J=t=>{var{type:u,roundingMode:l,autoFill:i}=g,n=x.inputValue,a=o.value,r=s.value;if((0,_utils.eqEmptyValue)(t))x.inputValue="";else{let e=""+t;r&&(e=(0,_util.toFloatValueFixed)(t,u,a,l),i||(e=""+_xeUtils.default.toNumber(e))),e!==n&&(x.inputValue=e)}},Q=()=>{var{type:u,roundingMode:l,autoFill:i}=g,n=x.inputValue,a=o.value,e=s.value;if(e&&n){let e="",t=null;n&&(e=(0,_util.toFloatValueFixed)(n,u,a,l),t=_xeUtils.default.toNumber(e),i||(e=""+t)),n!==t?T(t,e,{type:"init"}):x.inputValue=e}},X=e=>null===g.max||""===g.max||_xeUtils.default.toNumber(e)<=_xeUtils.default.toNumber(g.max),Z=e=>null===g.min||""===g.min||_xeUtils.default.toNumber(e)>=_xeUtils.default.toNumber(g.min),w=()=>{var{type:t,min:u,max:l,exponential:i}=g,n=x.inputValue;if(!C.value)if((0,_utils.eqEmptyValue)(n)){let e=null,t=n;!u&&0!==u||(e=_xeUtils.default.toNumber(u),t=""+e),void T(e,""+(t||""),{type:"check"})}else if(n||u||l){let e="integer"===t?_xeUtils.default.toInteger((0,_util.handleNumber)(n)):_xeUtils.default.toNumber((0,_util.handleNumber)(n));Z(e)?X(e)||(e=l):e=u,i&&(t=I(n).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=t);l=S(e);T((0,_utils.eqEmptyValue)(l)?null:Number(l),l,{type:"check"})}},ee=e=>{var t=x.inputValue,u=v.value,l=t?Number(t):null;u||T(l,I(t),e),w(),x.isFocus=!1,x.isActivated=!1,f.dispatchEvent("blur",{value:l},e),n&&a&&n.triggerItemEvent(e,a.itemConfig.field,l)},te=(e,t)=>{var{min:u,max:l,type:i}=g,n=x.inputValue,a=D.value,i="integer"===i?_xeUtils.default.toInteger((0,_util.handleNumber)(n)):_xeUtils.default.toNumber((0,_util.handleNumber)(n)),n=e?_xeUtils.default.add(i,a):_xeUtils.default.subtract(i,a);let r;r=Z(n)?X(n)?n:l:u,M(S(r),t)},L=e=>{var t=h.value,u=E.value,l=c.value;t||u||l||te(!0,e),x.isActivated=!0,f.dispatchEvent("plus-number",{value:x.inputValue},e),_.dispatchEvent("lazy-change",{value:x.inputValue},e),f.dispatchEvent("next-number",{value:x.inputValue},e)},B=e=>{var t=h.value,u=E.value,l=m.value;t||u||l||te(!1,e),x.isActivated=!0,f.dispatchEvent("minus-number",{value:x.inputValue},e),_.dispatchEvent("lazy-change",{value:x.inputValue},e),f.dispatchEvent("prev-number",{value:x.inputValue},e)},ue=e=>{var t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),u=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);(t||u)&&(e.preventDefault(),(t?L:B)(e))},le=e=>{var{type:t,exponential:u,controls:l}=g,i=N.value,n=i.isArrow,a=C.value,r=(0,_dom.hasControlKey)(e),o=e.shiftKey,s=e.altKey,v=e.keyCode,p=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),d=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),m=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);r||o||s||(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.SPACEBAR)||"integer"===t&&110===v||(!u||69!==v)&&65<=v&&v<=90||186<=v&&v<=188||191<=v)&&e.preventDefault(),p?w():(d||m)&&(0,_utils.isEnableConf)(i)&&(!1===l?l:n)&&!a&&ue(e),A(e)},ie=e=>{A(e)},ne=()=>{var e=r.dnTimeout;e&&(clearTimeout(e),r.dnTimeout=void 0)},ae=()=>{var e=r.ainTimeout;e&&(clearTimeout(e),r.ainTimeout=void 0)},re=e=>{u(),r.ainTimeout=setTimeout(()=>{B(e),re(e)},60)},oe=e=>{u(),r.ainTimeout=setTimeout(()=>{L(e),oe(e)},60)},u=()=>{ne(),ae()},se=e=>{r.isMouseDown?r.isMouseDown=!1:(u(),((0,_dom.hasClass)(e.currentTarget,"is--plus")?L:B)(e))},ve=t=>{if(u(),r.isMouseDown=!0,0===t.button){let e=(0,_dom.hasClass)(t.currentTarget,"is--plus");(e?L:B)(t),r.dnTimeout=setTimeout(()=>{(e?oe:re)(t)},500)}},pe=e=>{var t=g.controls,u=N.value,l=u.isWheel,i=C.value;(0,_utils.isEnableConf)(u)&&(!1===t?t:l)&&!i&&x.isActivated&&(e.stopPropagation(),e.preventDefault(),0<(u=e.deltaY)?B(e):u<0&&L(e)),A(e)},de=e=>{A(e)},me=e=>{var t=x.isActivated,u=y.value,l=F.value,i=h.value,n=C.value,a=v.value;i||n||!t||(x.isActivated=(0,_dom.getEventTargetNode)(e,u).flag||(0,_dom.getEventTargetNode)(e,l).flag,x.isActivated)||(a||(i=x.inputValue,n=i?Number(i):null,T(n,I(i),e)),w())},ce=t=>{var u=g.clearable,l=h.value,i=C.value;if(!l&&!i){l=_ui.globalEvents.hasKey(t,_ui.GLOBAL_EVENT_KEYS.TAB),i=_ui.globalEvents.hasKey(t,_ui.GLOBAL_EVENT_KEYS.DELETE);let e=x.isActivated;l&&(e&&w(),e=!1,x.isActivated=e),i&&u&&e&&k(t,null)}},_e=()=>{var e=x.isActivated;e&&w()};f={dispatchEvent:(e,t,u)=>{i(e,(0,_ui.createEvent)(u,{$numberInput:_},t))},focus(){var e;return C.value||(e=p.value,x.isActivated=!0,e.focus()),(0,_vue.nextTick)()},blur(){return p.value.blur(),(x.isActivated=!1,_vue.nextTick)()},select(){return p.value.select(),(x.isActivated=!1,_vue.nextTick)()}},Object.assign(_,f);let fe=()=>{var e=g.prefixIcon,t=K.value,u=b.prefix,e=e||t.icon,t=t.content;return u||e||t?(0,_vue.h)("div",{class:"vxe-number-input--prefix",onClick:$},[(0,_vue.h)("div",{class:"vxe-number-input--prefix-icon"},u?(0,_vn.getSlotVNs)(u({})):[e?(0,_vue.h)("i",{class:e}):(0,_ui.renderEmptyElement)(_),t?(0,_vue.h)("span",{class:"vxe-prefix-input--suffix-text"},""+t):(0,_ui.renderEmptyElement)(_)])]):(0,_ui.renderEmptyElement)(_)},ge=()=>{var e=g.suffixIcon,t=x.inputValue,u=b.suffix,l=R.value,i=h.value,n=V.value,e=e||l.icon,l=l.content;return(0,_vue.h)("div",{class:["vxe-number-input--suffix",{"is--clear":n&&!i&&!(""===t||_xeUtils.default.eqNull(t))}]},[n?(0,_vue.h)("div",{class:"vxe-number-input--clear-icon",onClick:k},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]):(0,_ui.renderEmptyElement)(_),u||e||l?(0,_vue.h)("div",{class:"vxe-number-input--suffix-icon",onClick:H},u?(0,_vn.getSlotVNs)(u({})):[e?(0,_vue.h)("i",{class:e}):(0,_ui.renderEmptyElement)(_),l?(0,_vue.h)("span",{class:"vxe-number-input--suffix-text"},""+l):(0,_ui.renderEmptyElement)(_)]):(0,_ui.renderEmptyElement)(_)])},O=()=>{var{type:e,name:t,autocomplete:u,autoComplete:l}=g,{inputValue:i,isFocus:n}=x,a=h.value,r=U.value,o=C.value,s=d.value,v=j.value;return(0,_vue.h)("div",{key:"ni",class:"vxe-number-input--input-wrapper"},[fe(),(0,_vue.h)("div",{class:"vxe-number-input--input-inner"},[(0,_vue.h)("input",{ref:p,class:"vxe-number-input--input",value:n||"amount"!==e?i:r,name:t,type:"text",placeholder:v,maxlength:s,readonly:o,disabled:a,autocomplete:l||u,onKeydown:le,onKeyup:ie,onClick:de,onInput:Y,onChange:G,onFocus:W,onBlur:ee})]),ge()])},be=()=>{var e=g.minusIcon,t=m.value;return(0,_vue.h)("button",{key:"prev",class:["vxe-number-input--minus-btn is--minus",{"is--disabled":t}],type:"button",onClick:se,onMousedown:ve,onMouseup:u,onMouseleave:u},[(0,_vue.h)("i",{class:e||(0,_ui.getIcon)().NUMBER_INPUT_MINUS_NUM})])},xe=()=>{var e=g.plusIcon,t=c.value;return(0,_vue.h)("button",{key:"next",class:["vxe-number-input--plus-btn is--plus",{"is--disabled":t}],type:"button",onClick:se,onMousedown:ve,onMouseup:u,onMouseleave:u},[(0,_vue.h)("i",{class:e||(0,_ui.getIcon)().NUMBER_INPUT_PLUS_NUM})])},ye=()=>(0,_vue.h)("div",{key:"cplr",class:"vxe-number-input--side-control"},[xe(),be()]);return _.renderVN=()=>{var{className:e,controls:t,type:u,align:l,prefixIcon:i,suffixIcon:n}=g,{inputValue:a,isActivated:r}=x,o=q.value,s=N.value,{layout:v,showButton:p}=s,d=h.value,m=E.value,c=U.value,_=b.prefix,f=b.suffix;return m?(0,_vue.h)("div",{ref:y,class:["vxe-number-input--readonly","type--"+u,e]},c):(m=C.value,c=V.value,s=(0,_utils.isEnableConf)(s)&&(!1===t?t:p),(0,_vue.h)("div",{ref:y,class:["vxe-number-input","type--"+u,"ctl--"+("right"===v||"left"===v?v:"default"),e,{["size--"+o]:o,["is--"+l]:l,"is--controls":s&&!m,"is--prefix":!!_||i,"is--suffix":!!f||n,"is--disabled":d,"is--active":r,"show--clear":c&&!d&&!(""===a||_xeUtils.default.eqNull(a))}],spellcheck:!1},s?"right"===v?[O(),ye()]:"left"===v?[ye(),O()]:[be(),O(),xe()]:[O()]))},(0,_vue.watch)(()=>g.modelValue,e=>{r.isUM||J(e),r.isUM=!1}),(0,_vue.watch)(()=>g.type,()=>{Object.assign(x,{inputValue:g.modelValue}),Q()}),(0,_vue.onMounted)(()=>{J(g.modelValue);var e=p.value;e&&e.addEventListener("wheel",pe,{passive:!1}),_ui.globalEvents.on(_,"mousedown",me),_ui.globalEvents.on(_,"keydown",ce),_ui.globalEvents.on(_,"blur",_e)}),(0,_vue.onBeforeUnmount)(()=>{x.isFocus=!1,u(),w();var e=p.value;e&&e.removeEventListener("wheel",pe),_ui.globalEvents.off(_,"mousedown"),_ui.globalEvents.off(_,"keydown"),_ui.globalEvents.off(_,"blur")}),Q(),_},render(){return this.renderVN()}});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_util=require("./util");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeNumberInput",props:{modelValue:[String,Number],immediate:{type:Boolean,default:!0},name:String,type:{type:String,default:"number"},clearable:{type:Boolean,default:()=>(0,_ui.getConfig)().numberInput.clearable},readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},placeholder:String,maxLength:{type:[String,Number],default:()=>(0,_ui.getConfig)().numberInput.maxLength},autoComplete:{type:String,default:"off"},align:String,form:String,className:String,inputClassName:{type:String,default:()=>(0,_ui.getConfig)().numberInput.inputClassName},size:{type:String,default:()=>(0,_ui.getConfig)().numberInput.size||(0,_ui.getConfig)().size},min:{type:[String,Number],default:null},max:{type:[String,Number],default:null},step:[String,Number],exponential:{type:Boolean,default:()=>(0,_ui.getConfig)().numberInput.exponential},showCurrency:{type:Boolean,default:()=>(0,_ui.getConfig)().numberInput.showCurrency},currencySymbol:{type:String,default:()=>(0,_ui.getConfig)().numberInput.currencySymbol},controlConfig:Object,roundingMode:{type:String,default:()=>(0,_ui.getConfig)().numberInput.roundingMode},digits:{type:[String,Number],default:null},autoFill:{type:Boolean,default:()=>(0,_ui.getConfig)().numberInput.autoFill},editable:{type:Boolean,default:!0},plusIcon:String,minusIcon:String,prefixIcon:String,prefixConfig:Object,suffixIcon:String,suffixConfig:Object,controls:{type:Boolean,default:null},maxlength:[String,Number],autocomplete:String},emits:["update:modelValue","input","change","keydown","keyup","wheel","click","focus","blur","clear","lazy-change","plus-number","minus-number","prefix-click","suffix-click","prev-number","next-number"],setup(g,e){let{slots:b,emit:i}=e,n=(0,_vue.inject)("$xeForm",null),a=(0,_vue.inject)("xeFormItemInfo",null);var u=_xeUtils.default.uniqueId();let O=(0,_ui.useSize)(g).computeSize,x=(0,_vue.reactive)({isFocus:!1,isActivated:!1,inputValue:""}),r={},y=(0,_vue.ref)(),m=(0,_vue.ref)(),q=(0,_vue.ref)(),E=(0,_vue.computed)(()=>{var e=g.readonly;return null===e?!!n&&n.props.readonly:e}),h=(0,_vue.computed)(()=>{var e=g.disabled;return null===e?!!n&&n.props.disabled:e}),o=(0,_vue.computed)(()=>{var{type:e,digits:u}=g;let t=u;return null===t&&null===(t=(0,_ui.getConfig)().numberInput.digits)&&"amount"===e&&(t=2),_xeUtils.default.toInteger(t)||1}),N=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().numberInput.controlConfig,g.controlConfig)),F=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().numberInput.prefixConfig,g.prefixConfig)),K=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().numberInput.suffixConfig,g.suffixConfig)),s=(0,_vue.computed)(()=>{var e=g.type;return"float"===e||"amount"===e}),R=(0,_vue.computed)(()=>{var e=g.type,u=o.value,t=s.value,l=g.step;return"integer"===e?_xeUtils.default.toInteger(l)||1:t?_xeUtils.default.toNumber(l)||1/Math.pow(10,u):_xeUtils.default.toNumber(l)||1}),V=(0,_vue.computed)(()=>g.clearable),C=(0,_vue.computed)(()=>{var e=g.editable;return E.value||!e}),D=(0,_vue.computed)(()=>{var e=g.placeholder;return(e=e||(0,_ui.getConfig)().numberInput.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseInput")}),d=(0,_vue.computed)(()=>{var{type:e,maxLength:u,maxlength:t,min:l,max:i}=g,n=o.value;return(0,_utils.eqEmptyValue)(l)||(0,_utils.eqEmptyValue)(i)?u||t?_xeUtils.default.toNumber(u||t):16:(""+i).length+("integer"===e?0:n+1)+(0<=_xeUtils.default.toNumber(l)?0:1)}),v=(0,_vue.computed)(()=>{var e=g.immediate;return e}),l=(0,_vue.computed)(()=>{var e=g.type,u=x.inputValue;return"integer"===e?_xeUtils.default.toInteger((0,_util.handleNumber)(u)):_xeUtils.default.toNumber((0,_util.handleNumber)(u))}),I=(0,_vue.computed)(()=>{var{type:u,roundingMode:t,showCurrency:l,currencySymbol:i,autoFill:n}=g,a=x.inputValue,r=o.value;if("amount"!==u)return _xeUtils.default.toString(a);{var u=_xeUtils.default.toNumber(a),a={digits:r};"floor"===t?a.floor=!0:"ceil"===t?a.ceil=!0:a.round=!0;let e=_xeUtils.default.commafy(u,a);return n||([r,t]=e.split("."),t&&(u=t.replace(/0+$/,""),e=u?[r,".",u].join(""):r)),l?""+(i||(0,_ui.getI18n)("vxe.numberInput.currencySymbol")||"")+e:e}}),p=(0,_vue.computed)(()=>{var e=g.min,u=x.inputValue,t=l.value;return!(!u&&0!==u||null===e)&&t<=_xeUtils.default.toNumber(e)}),_=(0,_vue.computed)(()=>{var e=g.max,u=x.inputValue,t=l.value;return!(!u&&0!==u||null===e)&&t>=_xeUtils.default.toNumber(e)}),j=(0,_vue.computed)(()=>{var e=g.inputClassName;return"vxe-number-input--input"+(e?" "+e:"")}),z={refElem:y,refInput:m},P={computeControlOpts:N},c={xID:u,props:g,context:e,reactData:x,internalData:r,getRefMaps:()=>z,getComputeMaps:()=>P},f=(e,u,t)=>{i(e,(0,_ui.createEvent)(t,{$numberInput:c},u))},U=e=>_xeUtils.default.eqNull(e)?"":""+e,S=e=>{var{type:u,exponential:t,roundingMode:l,autoFill:i}=g,n=d.value,a=o.value;let r="";return s.value?(r=(0,_util.toFloatValueFixed)(e,u,a,l),i||(r=U(_xeUtils.default.toNumber(r)))):r=U(e),!t||e!==r&&U(e).toLowerCase()!==_xeUtils.default.toNumber(r).toExponential()?r.slice(0,n):e},A=e=>{var u=x.inputValue;f(e.type,{value:u},e)},T=(e,u,t)=>{var e=(0,_utils.eqEmptyValue)(e)?null:Number(e),l=e!==g.modelValue;l&&(r.isUM=!0,i("update:modelValue",e)),x.inputValue!==u&&(0,_vue.nextTick)(()=>{x.inputValue=u||""}),f("input",{value:e},t),l&&(f("change",{value:e},t),n)&&a&&n.triggerItemEvent(t,a.itemConfig.field,e)},M=(e,u)=>{var t=v.value,l=(0,_utils.eqEmptyValue)(e)?null:_xeUtils.default.toNumber(e);x.inputValue=e,t?T(l,e,u):(f("input",{value:l},u),n&&a&&n.triggerItemEvent(u,a.itemConfig.field,l))},Y=e=>{var u=e.target.value;M(u,e)},G=e=>{v.value||A(e),f("lazy-change",{value:x.inputValue},e)},W=e=>{var u;C.value||(u=x.inputValue,x.inputValue=(0,_utils.eqEmptyValue)(u)?"":""+_xeUtils.default.toNumber(u),x.isFocus=!0,x.isActivated=!0,A(e))},$=e=>{var u;h.value||(u=x.inputValue,f("prefix-click",{value:u},e))},H=(e,u)=>{focus(),T(null,"",e),f("clear",{value:u},e),f("lazy-change",{value:u},e)},J=e=>{var u;h.value||(u=x.inputValue,f("suffix-click",{value:u},e))},Q=u=>{var{type:t,roundingMode:l,autoFill:i}=g,n=x.inputValue,a=o.value,r=s.value;if((0,_utils.eqEmptyValue)(u))x.inputValue="";else{let e=""+u;r&&(e=(0,_util.toFloatValueFixed)(u,t,a,l),i||(e=""+_xeUtils.default.toNumber(e))),e!==n&&(x.inputValue=e)}},X=()=>{var{type:t,roundingMode:l,autoFill:i}=g,n=x.inputValue,a=o.value,e=s.value;if(e&&n){let e="",u=null;n&&(e=(0,_util.toFloatValueFixed)(n,t,a,l),u=_xeUtils.default.toNumber(e),i||(e=""+u)),n!==u?T(u,e,{type:"init"}):x.inputValue=e}},Z=e=>null===g.max||""===g.max||_xeUtils.default.toNumber(e)<=_xeUtils.default.toNumber(g.max),ee=e=>null===g.min||""===g.min||_xeUtils.default.toNumber(e)>=_xeUtils.default.toNumber(g.min),k=()=>{var{type:u,min:t,max:l,exponential:i}=g,n=x.inputValue;if(!C.value)if((0,_utils.eqEmptyValue)(n)){let e=null,u=n;!t&&0!==t||(e=_xeUtils.default.toNumber(t),u=""+e),void T(e,""+(u||""),{type:"check"})}else if(n||t||l){let e="integer"===u?_xeUtils.default.toInteger((0,_util.handleNumber)(n)):_xeUtils.default.toNumber((0,_util.handleNumber)(n));ee(e)?Z(e)||(e=l):e=t,i&&(u=U(n).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=u);l=S(e);T((0,_utils.eqEmptyValue)(l)?null:Number(l),l,{type:"check"})}},ue=e=>{var u=x.inputValue,t=v.value,l=u?Number(u):null;t||T(l,U(u),e),k(),x.isFocus=!1,x.isActivated=!1,f("blur",{value:l},e),n&&a&&n.triggerItemEvent(e,a.itemConfig.field,l)},te=(e,u)=>{var{min:t,max:l,type:i}=g,n=x.inputValue,a=R.value,i="integer"===i?_xeUtils.default.toInteger((0,_util.handleNumber)(n)):_xeUtils.default.toNumber((0,_util.handleNumber)(n)),n=e?_xeUtils.default.add(i,a):_xeUtils.default.subtract(i,a);let r;r=ee(n)?Z(n)?n:l:t,M(S(r),u)},w=e=>{var u=h.value,t=E.value,l=_.value;u||t||l||te(!0,e),x.isActivated=!0,f("plus-number",{value:x.inputValue},e),f("lazy-change",{value:x.inputValue},e),f("next-number",{value:x.inputValue},e)},L=e=>{var u=h.value,t=E.value,l=p.value;u||t||l||te(!1,e),x.isActivated=!0,f("minus-number",{value:x.inputValue},e),f("lazy-change",{value:x.inputValue},e),f("prev-number",{value:x.inputValue},e)},le=e=>{var u=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);(u||t)&&(e.preventDefault(),(u?w:L)(e))},ie=e=>{var{type:u,exponential:t,controls:l}=g,i=N.value,n=i.isArrow,a=C.value,r=(0,_dom.hasControlKey)(e),o=e.shiftKey,s=e.altKey,v=e.keyCode,p=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),m=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),d=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);r||o||s||(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.SPACEBAR)||"integer"===u&&110===v||(!t||69!==v)&&65<=v&&v<=90||186<=v&&v<=188||191<=v)&&e.preventDefault(),p?k():(m||d)&&(0,_utils.isEnableConf)(i)&&(!1===l?l:n)&&!a&&le(e),A(e)},ne=e=>{A(e)},ae=()=>{var e=r.dnTimeout;e&&(clearTimeout(e),r.dnTimeout=void 0)},re=()=>{var e=r.ainTimeout;e&&(clearTimeout(e),r.ainTimeout=void 0)},oe=e=>{t(),r.ainTimeout=setTimeout(()=>{L(e),oe(e)},60)},se=e=>{t(),r.ainTimeout=setTimeout(()=>{w(e),se(e)},60)},t=()=>{ae(),re()},ve=e=>{r.isMouseDown?r.isMouseDown=!1:(t(),((0,_dom.hasClass)(e.currentTarget,"is--plus")?w:L)(e))},pe=u=>{if(t(),r.isMouseDown=!0,0===u.button){let e=(0,_dom.hasClass)(u.currentTarget,"is--plus");(e?w:L)(u),r.dnTimeout=setTimeout(()=>{(e?se:oe)(u)},500)}},me=e=>{var u=g.controls,t=N.value,l=t.isWheel,i=C.value;(0,_utils.isEnableConf)(t)&&(!1===u?u:l)&&!i&&x.isActivated&&(e.stopPropagation(),e.preventDefault(),0<(t=e.deltaY)?L(e):t<0&&w(e)),A(e)},de=e=>{A(e)},_e=e=>{var u=x.isActivated,t=y.value,l=q.value,i=h.value,n=C.value,a=v.value;i||n||!u||(x.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,l).flag,x.isActivated)||(a||(i=x.inputValue,n=i?Number(i):null,T(n,U(i),e)),k())},ce=u=>{var t=g.clearable,l=h.value,i=C.value;if(!l&&!i){l=_ui.globalEvents.hasKey(u,_ui.GLOBAL_EVENT_KEYS.TAB),i=_ui.globalEvents.hasKey(u,_ui.GLOBAL_EVENT_KEYS.DELETE);let e=x.isActivated;l&&(e&&k(),e=!1,x.isActivated=e),i&&t&&e&&H(u,null)}},fe=()=>{var e=x.isActivated;e&&k()};u={dispatchEvent:f,focus(){var e;return C.value||(e=m.value,x.isActivated=!0,e.focus()),(0,_vue.nextTick)()},blur(){return m.value.blur(),(x.isActivated=!1,_vue.nextTick)()},select(){return m.value.select(),(x.isActivated=!1,_vue.nextTick)()}};Object.assign(c,u);let ge=()=>{var e=g.prefixIcon,u=F.value,t=b.prefix,e=e||u.icon,u=u.content;return t||e||u?(0,_vue.h)("div",{class:"vxe-number-input--prefix",onClick:$},[(0,_vue.h)("div",{class:"vxe-number-input--prefix-icon"},t?(0,_vn.getSlotVNs)(t({})):[e?(0,_vue.h)("i",{class:e}):(0,_ui.renderEmptyElement)(c),u?(0,_vue.h)("span",{class:"vxe-prefix-input--suffix-text"},""+u):(0,_ui.renderEmptyElement)(c)])]):(0,_ui.renderEmptyElement)(c)},be=()=>{var e=g.suffixIcon,u=x.inputValue,t=b.suffix,l=K.value,i=h.value,n=V.value,e=e||l.icon,l=l.content;return(0,_vue.h)("div",{class:["vxe-number-input--suffix",{"is--clear":n&&!i&&!(""===u||_xeUtils.default.eqNull(u))}]},[n?(0,_vue.h)("div",{class:"vxe-number-input--clear-icon",onClick:H},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]):(0,_ui.renderEmptyElement)(c),t||e||l?(0,_vue.h)("div",{class:"vxe-number-input--suffix-icon",onClick:J},t?(0,_vn.getSlotVNs)(t({})):[e?(0,_vue.h)("i",{class:e}):(0,_ui.renderEmptyElement)(c),l?(0,_vue.h)("span",{class:"vxe-number-input--suffix-text"},""+l):(0,_ui.renderEmptyElement)(c)]):(0,_ui.renderEmptyElement)(c)])},B=()=>{var{type:e,name:u,autocomplete:t,autoComplete:l}=g,{inputValue:i,isFocus:n}=x,a=h.value,r=I.value,o=C.value,s=d.value,v=D.value,p=j.value;return(0,_vue.h)("div",{key:"ni",class:"vxe-number-input--input-wrapper"},[ge(),(0,_vue.h)("div",{class:"vxe-number-input--input-inner"},[(0,_vue.h)("input",{ref:m,class:p,name:u,type:"text",value:n||"amount"!==e?i:r,placeholder:v,maxlength:s,readonly:o,disabled:a,autocomplete:l||t,onKeydown:ie,onKeyup:ne,onClick:de,onInput:Y,onChange:G,onFocus:W,onBlur:ue})]),be()])},xe=()=>{var e=g.minusIcon,u=p.value;return(0,_vue.h)("button",{key:"prev",class:["vxe-number-input--minus-btn is--minus",{"is--disabled":u}],type:"button",onClick:ve,onMousedown:pe,onMouseup:t,onMouseleave:t},[(0,_vue.h)("i",{class:e||(0,_ui.getIcon)().NUMBER_INPUT_MINUS_NUM})])},ye=()=>{var e=g.plusIcon,u=_.value;return(0,_vue.h)("button",{key:"next",class:["vxe-number-input--plus-btn is--plus",{"is--disabled":u}],type:"button",onClick:ve,onMousedown:pe,onMouseup:t,onMouseleave:t},[(0,_vue.h)("i",{class:e||(0,_ui.getIcon)().NUMBER_INPUT_PLUS_NUM})])},Ee=()=>(0,_vue.h)("div",{key:"cplr",class:"vxe-number-input--side-control"},[ye(),xe()]);return c.renderVN=()=>{var{className:e,controls:u,type:t,align:l,prefixIcon:i,suffixIcon:n}=g,{inputValue:a,isActivated:r}=x,o=O.value,s=N.value,{layout:v,showButton:p}=s,m=h.value,d=E.value,_=I.value,c=b.prefix,f=b.suffix;return d?(0,_vue.h)("div",{ref:y,class:["vxe-number-input--readonly","type--"+t,e]},_):(d=C.value,_=V.value,s=(0,_utils.isEnableConf)(s)&&(!1===u?u:p),(0,_vue.h)("div",{ref:y,class:["vxe-number-input","type--"+t,"ctl--"+("right"===v||"left"===v?v:"default"),e,{["size--"+o]:o,["is--"+l]:l,"is--controls":s&&!d,"is--prefix":!!c||i,"is--suffix":!!f||n,"is--disabled":m,"is--active":r,"show--clear":_&&!m&&!(""===a||_xeUtils.default.eqNull(a))}],spellcheck:!1},s?"right"===v?[B(),Ee()]:"left"===v?[Ee(),B()]:[xe(),B(),ye()]:[B()]))},(0,_vue.watch)(()=>g.modelValue,e=>{r.isUM||Q(e),r.isUM=!1}),(0,_vue.watch)(()=>g.type,()=>{Object.assign(x,{inputValue:g.modelValue}),X()}),(0,_vue.onMounted)(()=>{Q(g.modelValue);var e=m.value;e&&e.addEventListener("wheel",me,{passive:!1}),_ui.globalEvents.on(c,"mousedown",_e),_ui.globalEvents.on(c,"keydown",ce),_ui.globalEvents.on(c,"blur",fe)}),(0,_vue.onBeforeUnmount)(()=>{x.isFocus=!1,t(),k();var e=m.value;e&&e.removeEventListener("wheel",me),_ui.globalEvents.off(c,"mousedown"),_ui.globalEvents.off(c,"keydown"),_ui.globalEvents.off(c,"blur")}),X(),c},render(){return this.renderVN()}});
|
|
@@ -33,6 +33,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
33
33
|
default: 'off'
|
|
34
34
|
},
|
|
35
35
|
className: String,
|
|
36
|
+
inputClassName: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: () => (0, _ui.getConfig)().passwordInput.inputClassName
|
|
39
|
+
},
|
|
36
40
|
size: {
|
|
37
41
|
type: String,
|
|
38
42
|
default: () => (0, _ui.getConfig)().passwordInput.size || (0, _ui.getConfig)().size
|
|
@@ -43,6 +47,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
43
47
|
type: Boolean,
|
|
44
48
|
default: () => (0, _ui.getConfig)().passwordInput.controls
|
|
45
49
|
},
|
|
50
|
+
editable: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
46
54
|
// 已废弃
|
|
47
55
|
autocomplete: String
|
|
48
56
|
},
|
|
@@ -76,16 +84,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
76
84
|
reactData,
|
|
77
85
|
getRefMaps: () => refMaps
|
|
78
86
|
};
|
|
79
|
-
let passwordInputMethods = {};
|
|
80
87
|
const computeIsClearable = (0, _vue.computed)(() => {
|
|
81
88
|
return props.clearable;
|
|
82
89
|
});
|
|
83
|
-
const computeInpReadonly = (0, _vue.computed)(() => {
|
|
84
|
-
const {
|
|
85
|
-
readonly
|
|
86
|
-
} = props;
|
|
87
|
-
return readonly;
|
|
88
|
-
});
|
|
89
90
|
const computeInpPlaceholder = (0, _vue.computed)(() => {
|
|
90
91
|
const {
|
|
91
92
|
placeholder
|
|
@@ -99,6 +100,36 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
99
100
|
}
|
|
100
101
|
return (0, _ui.getI18n)('vxe.base.pleaseInput');
|
|
101
102
|
});
|
|
103
|
+
const computeFormReadonly = (0, _vue.computed)(() => {
|
|
104
|
+
if ((0, _ui.getConfig)().inputReadonly === 'obsolete') {
|
|
105
|
+
if ($xeForm) {
|
|
106
|
+
return $xeForm.props.readonly;
|
|
107
|
+
}
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
const {
|
|
111
|
+
readonly
|
|
112
|
+
} = props;
|
|
113
|
+
if (readonly === null) {
|
|
114
|
+
if ($xeForm) {
|
|
115
|
+
return $xeForm.props.readonly;
|
|
116
|
+
}
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
return readonly;
|
|
120
|
+
});
|
|
121
|
+
const computeIsDisabled = (0, _vue.computed)(() => {
|
|
122
|
+
const {
|
|
123
|
+
disabled
|
|
124
|
+
} = props;
|
|
125
|
+
if (disabled === null) {
|
|
126
|
+
if ($xeForm) {
|
|
127
|
+
return $xeForm.props.disabled;
|
|
128
|
+
}
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
return disabled;
|
|
132
|
+
});
|
|
102
133
|
const computeInputType = (0, _vue.computed)(() => {
|
|
103
134
|
const {
|
|
104
135
|
showPwd
|
|
@@ -114,11 +145,36 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
114
145
|
} = props;
|
|
115
146
|
return immediate;
|
|
116
147
|
});
|
|
148
|
+
const computeInputReadonly = (0, _vue.computed)(() => {
|
|
149
|
+
const {
|
|
150
|
+
editable
|
|
151
|
+
} = props;
|
|
152
|
+
const formReadonly = computeFormReadonly.value;
|
|
153
|
+
return formReadonly || !editable;
|
|
154
|
+
});
|
|
155
|
+
const computeDomValue = (0, _vue.computed)(() => {
|
|
156
|
+
const {
|
|
157
|
+
inputValue
|
|
158
|
+
} = reactData;
|
|
159
|
+
return inputValue;
|
|
160
|
+
});
|
|
161
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
162
|
+
emit(type, (0, _ui.createEvent)(evnt, {
|
|
163
|
+
$passwordInput: $xePasswordInput
|
|
164
|
+
}, params));
|
|
165
|
+
};
|
|
166
|
+
const updateDomValue = () => {
|
|
167
|
+
const domValue = computeDomValue.value;
|
|
168
|
+
const inputElem = refInputTarget.value;
|
|
169
|
+
if (inputElem) {
|
|
170
|
+
inputElem.value = _xeUtils.default.eqNull(domValue) ? '' : '' + domValue;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
117
173
|
const triggerEvent = evnt => {
|
|
118
174
|
const {
|
|
119
175
|
inputValue
|
|
120
176
|
} = reactData;
|
|
121
|
-
|
|
177
|
+
dispatchEvent(evnt.type, {
|
|
122
178
|
value: inputValue
|
|
123
179
|
}, evnt);
|
|
124
180
|
};
|
|
@@ -128,7 +184,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
128
184
|
if (inpImmediate) {
|
|
129
185
|
handleChange(value, evnt);
|
|
130
186
|
} else {
|
|
131
|
-
|
|
187
|
+
dispatchEvent('input', {
|
|
132
188
|
value
|
|
133
189
|
}, evnt);
|
|
134
190
|
}
|
|
@@ -141,11 +197,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
141
197
|
const handleChange = (value, evnt) => {
|
|
142
198
|
reactData.inputValue = value;
|
|
143
199
|
emit('update:modelValue', value);
|
|
144
|
-
|
|
200
|
+
dispatchEvent('input', {
|
|
145
201
|
value
|
|
146
202
|
}, evnt);
|
|
147
203
|
if (_xeUtils.default.toValueString(props.modelValue) !== value) {
|
|
148
|
-
|
|
204
|
+
dispatchEvent('change', {
|
|
149
205
|
value
|
|
150
206
|
}, evnt);
|
|
151
207
|
// 自动更新校验状态
|
|
@@ -156,7 +212,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
156
212
|
};
|
|
157
213
|
const changeEvent = evnt => {
|
|
158
214
|
triggerEvent(evnt);
|
|
159
|
-
|
|
215
|
+
dispatchEvent('lazy-change', {
|
|
160
216
|
value: reactData.inputValue
|
|
161
217
|
}, evnt);
|
|
162
218
|
// 自动更新校验状态
|
|
@@ -174,7 +230,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
174
230
|
} = reactData;
|
|
175
231
|
const value = inputValue;
|
|
176
232
|
reactData.isActivated = false;
|
|
177
|
-
|
|
233
|
+
dispatchEvent('blur', {
|
|
178
234
|
value
|
|
179
235
|
}, evnt);
|
|
180
236
|
// 自动更新校验状态
|
|
@@ -183,17 +239,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
183
239
|
}
|
|
184
240
|
};
|
|
185
241
|
const passwordToggleEvent = evnt => {
|
|
186
|
-
const {
|
|
187
|
-
readonly,
|
|
188
|
-
disabled
|
|
189
|
-
} = props;
|
|
190
242
|
const {
|
|
191
243
|
showPwd
|
|
192
244
|
} = reactData;
|
|
193
|
-
|
|
245
|
+
const isDisabled = computeIsDisabled.value;
|
|
246
|
+
const formReadonly = computeFormReadonly.value;
|
|
247
|
+
if (!isDisabled && !formReadonly) {
|
|
194
248
|
reactData.showPwd = !showPwd;
|
|
195
249
|
}
|
|
196
|
-
|
|
250
|
+
dispatchEvent('toggle-visible', {
|
|
197
251
|
visible: reactData.showPwd
|
|
198
252
|
}, evnt);
|
|
199
253
|
};
|
|
@@ -203,39 +257,57 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
203
257
|
const clearValueEvent = (evnt, value) => {
|
|
204
258
|
focus();
|
|
205
259
|
handleChange('', evnt);
|
|
206
|
-
|
|
260
|
+
dispatchEvent('clear', {
|
|
207
261
|
value
|
|
208
262
|
}, evnt);
|
|
209
|
-
|
|
263
|
+
dispatchEvent('lazy-change', {
|
|
210
264
|
value: reactData.inputValue
|
|
211
265
|
}, evnt);
|
|
212
266
|
};
|
|
213
267
|
const clickSuffixEvent = evnt => {
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
} = props;
|
|
217
|
-
if (!disabled) {
|
|
268
|
+
const isDisabled = computeIsDisabled.value;
|
|
269
|
+
if (!isDisabled) {
|
|
218
270
|
const {
|
|
219
271
|
inputValue
|
|
220
272
|
} = reactData;
|
|
221
|
-
|
|
273
|
+
dispatchEvent('suffix-click', {
|
|
222
274
|
value: inputValue
|
|
223
275
|
}, evnt);
|
|
224
276
|
}
|
|
225
277
|
};
|
|
226
278
|
const clickPrefixEvent = evnt => {
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
} = props;
|
|
230
|
-
if (!disabled) {
|
|
279
|
+
const isDisabled = computeIsDisabled.value;
|
|
280
|
+
if (!isDisabled) {
|
|
231
281
|
const {
|
|
232
282
|
inputValue
|
|
233
283
|
} = reactData;
|
|
234
|
-
|
|
284
|
+
dispatchEvent('prefix-click', {
|
|
235
285
|
value: inputValue
|
|
236
286
|
}, evnt);
|
|
237
287
|
}
|
|
238
288
|
};
|
|
289
|
+
const passwordInputMethods = {
|
|
290
|
+
dispatchEvent,
|
|
291
|
+
focus() {
|
|
292
|
+
const inputElem = refInputTarget.value;
|
|
293
|
+
reactData.isActivated = true;
|
|
294
|
+
inputElem.focus();
|
|
295
|
+
return (0, _vue.nextTick)();
|
|
296
|
+
},
|
|
297
|
+
blur() {
|
|
298
|
+
const inputElem = refInputTarget.value;
|
|
299
|
+
inputElem.blur();
|
|
300
|
+
reactData.isActivated = false;
|
|
301
|
+
return (0, _vue.nextTick)();
|
|
302
|
+
},
|
|
303
|
+
select() {
|
|
304
|
+
const inputElem = refInputTarget.value;
|
|
305
|
+
inputElem.select();
|
|
306
|
+
reactData.isActivated = false;
|
|
307
|
+
return (0, _vue.nextTick)();
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
Object.assign($xePasswordInput, passwordInputMethods);
|
|
239
311
|
const renderPasswordIcon = () => {
|
|
240
312
|
const {
|
|
241
313
|
showPwd
|
|
@@ -263,18 +335,18 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
263
335
|
};
|
|
264
336
|
const renderSuffixIcon = () => {
|
|
265
337
|
const {
|
|
266
|
-
disabled,
|
|
267
338
|
suffixIcon,
|
|
268
339
|
controls
|
|
269
340
|
} = props;
|
|
270
341
|
const {
|
|
271
342
|
inputValue
|
|
272
343
|
} = reactData;
|
|
273
|
-
const
|
|
344
|
+
const isDisabled = computeIsDisabled.value;
|
|
274
345
|
const isClearable = computeIsClearable.value;
|
|
346
|
+
const suffixSlot = slots.suffix;
|
|
275
347
|
return isClearable || controls || suffixSlot || suffixIcon ? (0, _vue.h)('div', {
|
|
276
348
|
class: ['vxe-password-input--suffix', {
|
|
277
|
-
'is--clear': isClearable && !
|
|
349
|
+
'is--clear': isClearable && !isDisabled && !(inputValue === '' || _xeUtils.default.eqNull(inputValue))
|
|
278
350
|
}]
|
|
279
351
|
}, [isClearable ? (0, _vue.h)('div', {
|
|
280
352
|
class: 'vxe-password-input--clear-icon',
|
|
@@ -288,40 +360,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
288
360
|
class: suffixIcon
|
|
289
361
|
})]) : (0, _ui.renderEmptyElement)($xePasswordInput)]) : null;
|
|
290
362
|
};
|
|
291
|
-
passwordInputMethods = {
|
|
292
|
-
dispatchEvent(type, params, evnt) {
|
|
293
|
-
emit(type, (0, _ui.createEvent)(evnt, {
|
|
294
|
-
$passwordInput: $xePasswordInput
|
|
295
|
-
}, params));
|
|
296
|
-
},
|
|
297
|
-
focus() {
|
|
298
|
-
const inputElem = refInputTarget.value;
|
|
299
|
-
reactData.isActivated = true;
|
|
300
|
-
inputElem.focus();
|
|
301
|
-
return (0, _vue.nextTick)();
|
|
302
|
-
},
|
|
303
|
-
blur() {
|
|
304
|
-
const inputElem = refInputTarget.value;
|
|
305
|
-
inputElem.blur();
|
|
306
|
-
reactData.isActivated = false;
|
|
307
|
-
return (0, _vue.nextTick)();
|
|
308
|
-
},
|
|
309
|
-
select() {
|
|
310
|
-
const inputElem = refInputTarget.value;
|
|
311
|
-
inputElem.select();
|
|
312
|
-
reactData.isActivated = false;
|
|
313
|
-
return (0, _vue.nextTick)();
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
Object.assign($xePasswordInput, passwordInputMethods);
|
|
317
|
-
(0, _vue.watch)(() => props.modelValue, val => {
|
|
318
|
-
reactData.inputValue = val;
|
|
319
|
-
});
|
|
320
363
|
const renderVN = () => {
|
|
321
364
|
const {
|
|
322
365
|
className,
|
|
366
|
+
inputClassName,
|
|
323
367
|
name,
|
|
324
|
-
disabled,
|
|
325
368
|
readonly,
|
|
326
369
|
autocomplete,
|
|
327
370
|
autoComplete,
|
|
@@ -331,11 +374,19 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
331
374
|
inputValue,
|
|
332
375
|
isActivated
|
|
333
376
|
} = reactData;
|
|
377
|
+
const isDisabled = computeIsDisabled.value;
|
|
378
|
+
const formReadonly = computeFormReadonly.value;
|
|
379
|
+
if (formReadonly) {
|
|
380
|
+
return (0, _vue.h)('div', {
|
|
381
|
+
ref: refElem,
|
|
382
|
+
class: ['vxe-password-input--readonly', className]
|
|
383
|
+
}, (0, _utils.getText)(inputValue));
|
|
384
|
+
}
|
|
334
385
|
const vSize = computeSize.value;
|
|
335
|
-
const inpReadonly = computeInpReadonly.value;
|
|
336
386
|
const inputType = computeInputType.value;
|
|
337
387
|
const inpPlaceholder = computeInpPlaceholder.value;
|
|
338
388
|
const isClearable = computeIsClearable.value;
|
|
389
|
+
const inputReadonly = computeInputReadonly.value;
|
|
339
390
|
const prefix = renderPrefixIcon();
|
|
340
391
|
const suffix = renderSuffixIcon();
|
|
341
392
|
return (0, _vue.h)('div', {
|
|
@@ -345,22 +396,21 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
345
396
|
'is--prefix': !!prefix,
|
|
346
397
|
'is--suffix': !!suffix,
|
|
347
398
|
'is--readonly': readonly,
|
|
348
|
-
'is--disabled':
|
|
399
|
+
'is--disabled': isDisabled,
|
|
349
400
|
'is--active': isActivated,
|
|
350
|
-
'show--clear': isClearable && !
|
|
401
|
+
'show--clear': isClearable && !isDisabled && !(inputValue === '' || _xeUtils.default.eqNull(inputValue))
|
|
351
402
|
}],
|
|
352
403
|
spellcheck: false
|
|
353
404
|
}, [prefix || (0, _ui.renderEmptyElement)($xePasswordInput), (0, _vue.h)('div', {
|
|
354
405
|
class: 'vxe-password-input--wrapper'
|
|
355
406
|
}, [(0, _vue.h)('input', {
|
|
356
407
|
ref: refInputTarget,
|
|
357
|
-
class: 'vxe-password-input--inner',
|
|
358
|
-
value: inputValue,
|
|
408
|
+
class: 'vxe-password-input--inner' + (inputClassName ? ' ' + inputClassName : ''),
|
|
359
409
|
name,
|
|
360
410
|
type: inputType,
|
|
361
411
|
placeholder: inpPlaceholder,
|
|
362
|
-
readonly:
|
|
363
|
-
disabled,
|
|
412
|
+
readonly: inputReadonly,
|
|
413
|
+
disabled: isDisabled,
|
|
364
414
|
autocomplete: autocomplete || autoComplete,
|
|
365
415
|
maxlength: maxLength,
|
|
366
416
|
onClick: clickEvent,
|
|
@@ -370,6 +420,25 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
370
420
|
onBlur: blurEvent
|
|
371
421
|
})]), suffix || (0, _ui.renderEmptyElement)($xePasswordInput)]);
|
|
372
422
|
};
|
|
423
|
+
(0, _vue.watch)(() => props.modelValue, val => {
|
|
424
|
+
reactData.inputValue = val;
|
|
425
|
+
});
|
|
426
|
+
const rDvFlag = (0, _vue.ref)(0);
|
|
427
|
+
(0, _vue.watch)(computeFormReadonly, () => {
|
|
428
|
+
rDvFlag.value++;
|
|
429
|
+
});
|
|
430
|
+
(0, _vue.watch)(computeDomValue, () => {
|
|
431
|
+
rDvFlag.value++;
|
|
432
|
+
});
|
|
433
|
+
(0, _vue.watch)(rDvFlag, () => {
|
|
434
|
+
updateDomValue();
|
|
435
|
+
(0, _vue.nextTick)(() => {
|
|
436
|
+
updateDomValue();
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
(0, _vue.onMounted)(() => {
|
|
440
|
+
updateDomValue();
|
|
441
|
+
});
|
|
373
442
|
$xePasswordInput.renderVN = renderVN;
|
|
374
443
|
return $xePasswordInput;
|
|
375
444
|
},
|