vxe-pc-ui 3.16.26 → 3.16.27
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/icon/style.css +1 -1
- package/es/input/src/input.js +10 -0
- package/es/list/src/list.js +14 -8
- package/es/number-input/src/number-input.js +6 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/textarea/src/textarea.js +8 -0
- package/es/tree/src/tree.js +17 -11
- package/es/tree-select/src/tree-select.js +9 -0
- package/es/tree-select/style.css +6 -0
- package/es/tree-select/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-tree-select/style.css +6 -0
- package/es/vxe-tree-select/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +72 -34
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +10 -0
- package/lib/input/src/input.min.js +1 -1
- package/lib/list/src/list.js +18 -14
- package/lib/list/src/list.min.js +1 -1
- package/lib/number-input/src/number-input.js +6 -0
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/textarea/src/textarea.js +7 -0
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/tree/src/tree.js +20 -18
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree-select/src/tree-select.js +9 -0
- package/lib/tree-select/src/tree-select.min.js +1 -1
- package/lib/tree-select/style/style.css +6 -0
- package/lib/tree-select/style/style.min.css +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-tree-select/style/style.css +6 -0
- package/lib/vxe-tree-select/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/input/src/input.ts +10 -0
- package/packages/list/src/list.ts +14 -8
- package/packages/number-input/src/number-input.ts +6 -0
- package/packages/textarea/src/textarea.ts +7 -0
- package/packages/tree/src/tree.ts +17 -11
- package/packages/tree-select/src/tree-select.ts +9 -0
- package/styles/components/tree-select.scss +7 -0
- package/types/components/grid.d.ts +176 -0
- package/types/components/tree-select.d.ts +6 -1
- /package/es/icon/{iconfont.1785912556406.ttf → iconfont.1785940501934.ttf} +0 -0
- /package/es/icon/{iconfont.1785912556406.woff → iconfont.1785940501934.woff} +0 -0
- /package/es/icon/{iconfont.1785912556406.woff2 → iconfont.1785940501934.woff2} +0 -0
- /package/es/{iconfont.1785912556406.ttf → iconfont.1785940501934.ttf} +0 -0
- /package/es/{iconfont.1785912556406.woff → iconfont.1785940501934.woff} +0 -0
- /package/es/{iconfont.1785912556406.woff2 → iconfont.1785940501934.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1785912556406.ttf → iconfont.1785940501934.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1785912556406.woff → iconfont.1785940501934.woff} +0 -0
- /package/lib/icon/style/{iconfont.1785912556406.woff2 → iconfont.1785940501934.woff2} +0 -0
- /package/lib/{iconfont.1785912556406.ttf → iconfont.1785940501934.ttf} +0 -0
- /package/lib/{iconfont.1785912556406.woff → iconfont.1785940501934.woff} +0 -0
- /package/lib/{iconfont.1785912556406.woff2 → iconfont.1785940501934.woff2} +0 -0
package/lib/input/src/input.js
CHANGED
|
@@ -989,6 +989,10 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
989
989
|
emitInputEvent: function emitInputEvent(value, evnt) {
|
|
990
990
|
var $xeInput = this;
|
|
991
991
|
var reactData = $xeInput.reactData;
|
|
992
|
+
var $xeForm = $xeInput.$xeForm;
|
|
993
|
+
var formItemInfo = $xeInput.formItemInfo;
|
|
994
|
+
var $xeSelect = $xeInput.$xeSelect;
|
|
995
|
+
var $xeTreeSelect = $xeInput.$xeTreeSelect;
|
|
992
996
|
var isDatePickerType = $xeInput.computeIsDatePickerType;
|
|
993
997
|
var inpImmediate = $xeInput.computeInpImmediate;
|
|
994
998
|
reactData.inputValue = value;
|
|
@@ -999,6 +1003,12 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
999
1003
|
$xeInput.dispatchEvent('input', {
|
|
1000
1004
|
value: value
|
|
1001
1005
|
}, evnt);
|
|
1006
|
+
if (!$xeSelect && !$xeTreeSelect) {
|
|
1007
|
+
// 自动更新校验状态
|
|
1008
|
+
if ($xeForm && formItemInfo) {
|
|
1009
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1002
1012
|
}
|
|
1003
1013
|
}
|
|
1004
1014
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom"),_util=require("../../date-panel/src/util"),_util2=require("../../number-input/src/util"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,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 a=e[Symbol.toPrimitive];if(void 0===a)return("string"===t?String:Number)(e);a=a.call(e,t||"default");if("object"!=_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var a;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(a="Object"===(a={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:a)||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}var _createComponentLog=(0,_log.createComponentLog)("input"),warnLog=_createComponentLog.warnLog,_default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeInput",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Date],immediate:{type:Boolean,default:!0},name:String,title:String,type:{type:String,default:"text"},clearable:{type:Boolean,default:function(){return(0,_ui.getConfig)().input.clearable}},readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},placeholder:{type:String,default:null},maxLength:{type:[String,Number],default:function(){return(0,_ui.getConfig)().input.maxLength}},autoComplete:{type:String,default:"off"},autoFocus:{type:Boolean,default:null},align:String,form:String,className:String,size:{type:String,default:function(){return(0,_ui.getConfig)().input.size||(0,_ui.getConfig)().size}},multiple:Boolean,showWordCount:Boolean,countMethod:Function,min:{type:[String,Number],default:null},max:{type:[String,Number],default:null},step:[String,Number],trim:{type:Boolean,default:function(){return(0,_ui.getConfig)().input.trim}},exponential:{type:Boolean,default:function(){return(0,_ui.getConfig)().input.exponential}},controls:{type:Boolean,default:function(){return(0,_ui.getConfig)().input.controls}},digits:{type:[String,Number],default:function(){return(0,_ui.getConfig)().input.digits}},startDate:{type:[String,Number,Date],default:function(){return(0,_ui.getConfig)().input.startDate}},endDate:{type:[String,Number,Date],default:function(){return(0,_ui.getConfig)().input.endDate}},minDate:[String,Number,Date],maxDate:[String,Number,Date],startWeek:Number,startDay:{type:[String,Number],default:function(){return(0,_ui.getConfig)().input.startDay}},labelFormat:String,valueFormat:String,editable:{type:Boolean,default:!0},festivalMethod:{type:Function,default:function(){return(0,_ui.getConfig)().input.festivalMethod}},disabledMethod:{type:Function,default:function(){return(0,_ui.getConfig)().input.disabledMethod}},selectDay:{type:[String,Number],default:function(){return(0,_ui.getConfig)().input.selectDay}},prefixIcon:String,prefixConfig:Object,suffixIcon:String,suffixConfig:Object,placement:String,transfer:{type:Boolean,default:null},maxlength:[String,Number],autocomplete:String},inject:{$xeSelect:{default:null},$xeTreeSelect:{default:null},$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,panelIndex:0,showPwd:!1,visiblePanel:!1,isAniVisible:!1,panelStyle:{},panelPlacement:"",isActivated:!1,inputValue:"",datetimePanelValue:null,datePanelValue:null,datePanelLabel:"",datePanelType:"day",selectMonth:null,currentDate:null},internalData:{yearSize:12,monthSize:20,quarterSize:8,hpTimeout:void 0,dnTimeout:void 0}}},computed:Object.assign(Object.assign({},{}),{computePrefixOpts:function(){return Object.assign({},(0,_ui.getConfig)().input.prefixConfig,this.prefixConfig)},computeSuffixOpts:function(){return Object.assign({},(0,_ui.getConfig)().input.suffixConfig,this.suffixConfig)},computeBtnTransfer:function(){var e=this,t=e.$xeTable,a=e.$xeModal,n=e.$xeDrawer,i=e.$xeForm,e=e.transfer;if(null===e){var u=(0,_ui.getConfig)().input.transfer;if(_xeUtils.default.isBoolean(u))return u;if(t||a||n||i)return!0}return e},computeFormReadonly:function(){var e,t=this.$xeForm;return"obsolete"===(0,_ui.getConfig)().inputReadonly||null===(e=this.readonly)?!!t&&t.readonly:e},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeInpMaxLength:function(){var e=this.maxLength,t=this.maxlength,e=e||t;return this.computeIsNumType&&!_xeUtils.default.toNumber(e)?16:e},computeIsDateTimeType:function(){var e=this.type;return"time"===e||"datetime"===e},computeIsNumType:function(){return-1<["number","integer","float"].indexOf(this.type)},computeInputCount:function(){var e=this.reactData;return _xeUtils.default.getSize(e.inputValue)},computeIsCountError:function(){var e=this.computeInputCount,t=this.computeInpMaxLength;return t&&e>_xeUtils.default.toNumber(t)},computeIsDatePickerType:function(){return this.computeIsDateTimeType||-1<["date","week","month","quarter","year"].indexOf(this.type)},computeIsPawdType:function(){return"password"===this.type},computeIsSearchType:function(){return"search"===this.type},computeDigitsValue:function(){return _xeUtils.default.toInteger(this.digits)||1},computeStepValue:function(){var e=this.type,t=this.computeDigitsValue,a=this.step;return"integer"===e?_xeUtils.default.toInteger(a)||1:"float"===e?_xeUtils.default.toNumber(a)||1/Math.pow(10,t):_xeUtils.default.toNumber(a)||1},computeIsClearable:function(){var e=this.type,t=this.computeIsNumType,a=this.computeIsDatePickerType,n=this.computeIsPawdType;return this.clearable&&(n||t||a||"text"===e||"search"===e)},computeDateStartTime:function(){return this.startDate?_xeUtils.default.toStringDate(this.startDate):null},computeDateEndTime:function(){return this.endDate?_xeUtils.default.toStringDate(this.endDate):null},computeSupportMultiples:function(){return-1<["date","week","month","quarter","year"].indexOf(this.type)},computeDateListValue:function(){var t=this,e=t.value,a=t.computeIsDatePickerType,n=t.computeDateValueFormat;return t.multiple&&e&&a?_xeUtils.default.toValueString(e).split(",").map(function(e){e=t.parseDate(e,n);return _xeUtils.default.isValidDate(e),e}):[]},computeDateMultipleValue:function(){var e=this.computeDateListValue,t=this.computeDateValueFormat;return e.map(function(e){return _xeUtils.default.toDateString(e,t)})},computeDateMultipleLabel:function(){var e=this.computeDateListValue,t=this.computeDateLabelFormat;return e.map(function(e){return _xeUtils.default.toDateString(e,t)}).join(", ")},computeDateValueFormat:function(){var e=this.type,t=this.valueFormat;return t||("time"===e?"HH:mm:ss":"datetime"===e?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd")},computeDateValue:function(){var e=this.value,t=this.computeIsDatePickerType,a=this.computeDateValueFormat,n=null;return n=e&&t&&(t=this.parseDate(e,a),_xeUtils.default.isValidDate(t))?t:n},computeIsDisabledPrevDateBtn:function(){var e=this.reactData,t=this.computeDateStartTime,e=e.selectMonth;return!(!e||!t)&&e<=t},computeIsDisabledNextDateBtn:function(){var e=this.reactData,t=this.computeDateEndTime,e=e.selectMonth;return!(!e||!t)&&t<=e},computeDateTimeLabel:function(){var e=this.reactData.datetimePanelValue,t=this.computeHasTimeSecond;return e?_xeUtils.default.toDateString(e,t?"HH:mm:ss":"HH:mm"):""},computeDateHMSTime:function(){var e=this.computeDateValue,t=this.computeIsDateTimeType;return e&&t?1e3*(3600*e.getHours()+60*e.getMinutes()+e.getSeconds()):0},computeDateLabelFormat:function(){var e=this.labelFormat;return this.computeIsDatePickerType?e||(0,_ui.getI18n)("vxe.input.date.labelFormat.".concat(this.type)):""},computeYearList:function(){var e=this.reactData,t=this.internalData,a=e.selectMonth,e=e.currentDate,n=t.yearSize,i=[];if(a&&e)for(var u=e.getFullYear(),t=a.getFullYear(),r=new Date(t-t%n,0,1),l=-4;l<n+4;l++){var s=_xeUtils.default.getWhatYear(r,l,"first"),o=s.getFullYear();i.push({date:s,isCurrent:!0,isPrev:l<0,isNow:u===o,isNext:n<=l,year:o})}return i},computeSelectDatePanelObj:function(){var e,t,a,n,i=this.reactData,u="",r="";return this.computeIsDatePickerType&&(e=i.datePanelType,i=i.selectMonth,t=this.computeYearList,a="",i&&(a=i.getFullYear(),n=i.getMonth()+1),"quarter"===e||"month"===e?u=(0,_ui.getI18n)("vxe.datePicker.yearTitle",[a]):"year"===e?u=t.length?"".concat(t[0].year," - ").concat(t[t.length-1].year):"":(u=(0,_ui.getI18n)("vxe.datePicker.yearTitle",[a]),r=n?(0,_ui.getI18n)("vxe.input.date.m".concat(n)):"-")),{y:u,m:r}},computeFirstDayOfWeek:function(){var e=this.startDay,t=this.startWeek;return _xeUtils.default.toNumber(_xeUtils.default.isNumber(e)||_xeUtils.default.isString(e)?e:t)},computeWeekDatas:function(){var e=[];if(this.computeIsDatePickerType){var t=this.computeFirstDayOfWeek;e.push(t);for(var a=0;a<6;a++)6<=t?t=0:t++,e.push(t)}return e},computeDateHeaders:function(){return this.computeIsDatePickerType?this.computeWeekDatas.map(function(e){return{value:e,label:(0,_ui.getI18n)("vxe.input.date.weeks.w".concat(e))}}):[]},computeWeekHeaders:function(){var e;return this.computeIsDatePickerType?(e=this.computeDateHeaders,[{label:(0,_ui.getI18n)("vxe.input.date.weeks.w")}].concat(e)):[]},computeYearDatas:function(){var e=this.computeYearList;return _xeUtils.default.chunk(e,4)},computeQuarterList:function(){var e=this.reactData,t=this.internalData,a=e.selectMonth,e=e.currentDate,n=t.quarterSize,i=[];if(a&&e)for(var u=e.getFullYear(),r=(0,_util.getDateQuarter)(e),l=_xeUtils.default.getWhatYear(a,0,"first"),s=l.getFullYear(),o=-2;o<n-2;o++){var c=_xeUtils.default.getWhatQuarter(l,o),d=c.getFullYear(),p=(0,_util.getDateQuarter)(c),m=d<s;i.push({date:c,isPrev:m,isCurrent:d===s,isNow:d===u&&p===r,isNext:!m&&s<d,quarter:p})}return i},computeQuarterDatas:function(){var e=this.computeQuarterList;return _xeUtils.default.chunk(e,2)},computeMonthList:function(){var e=this.reactData,t=this.internalData,a=e.selectMonth,e=e.currentDate,n=t.monthSize,i=[];if(a&&e)for(var u=e.getFullYear(),r=e.getMonth(),l=_xeUtils.default.getWhatYear(a,0,"first").getFullYear(),s=-4;s<n-4;s++){var o=_xeUtils.default.getWhatYear(a,0,s),c=o.getFullYear(),d=o.getMonth(),p=c<l;i.push({date:o,isPrev:p,isCurrent:c===l,isNow:c===u&&d===r,isNext:!p&&l<c,month:d})}return i},computeMonthDatas:function(){var e=this.computeMonthList;return _xeUtils.default.chunk(e,4)},computeDayList:function(){var e=this.reactData,t=e.selectMonth,e=e.currentDate,a=[];if(t&&e)for(var n=this.computeDateHMSTime,i=this.computeWeekDatas,u=e.getFullYear(),r=e.getMonth(),l=e.getDate(),s=t.getFullYear(),o=t.getMonth(),e=t.getDay(),i=-i.indexOf(e),c=new Date(_xeUtils.default.getWhatDay(t,i).getTime()+n),d=0;d<42;d++){var p=_xeUtils.default.getWhatDay(c,d),m=p.getFullYear(),f=p.getMonth(),h=p.getDate(),v=p<t;a.push({date:p,isPrev:v,isCurrent:m===s&&f===o,isNow:m===u&&f===r&&h===l,isNext:!v&&o!==f,label:h})}return a},computeDayDatas:function(){var e=this.computeDayList;return _xeUtils.default.chunk(e,7)},computeWeekDates:function(){var e=this.computeDayDatas,a=this.computeFirstDayOfWeek;return e.map(function(e){var t=e[0];return[{date:t.date,isWeekNumber:!0,isPrev:!1,isCurrent:!1,isNow:!1,isNext:!1,label:_xeUtils.default.getYearWeek(t.date,a)}].concat(e)})},computeHourList:function(){var e=[];if(this.computeIsDateTimeType)for(var t=0;t<24;t++)e.push({value:t,label:(""+t).padStart(2,"0"),disabled:!1});return e},computeMinuteList:function(){var e=[];if(this.computeIsDateTimeType)for(var t=0;t<60;t++)e.push({value:t,label:(""+t).padStart(2,"0"),disabled:!1});return e},computeHasTimeMinute:function(){var e=this.computeDateValueFormat;return!/HH/.test(e)||/mm/.test(e)},computeHasTimeSecond:function(){var e=this.computeDateValueFormat;return!/HH/.test(e)||/ss/.test(e)},computeSecondList:function(){return this.computeMinuteList},computeInputReadonly:function(){var e=this.type,t=this.editable,a=this.multiple;return this.readonly||a||!t||"week"===e||"quarter"===e},computeInputType:function(){var e=this,t=e.reactData,a=e.type,t=t.showPwd;return e.computeIsDatePickerType||e.computeIsNumType||e.computeIsPawdType&&t||"number"===a?"text":a},computeInpPlaceholder:function(){var e,t=this.placeholder;return t?(0,_utils.getFuncText)(t):_xeUtils.default.eqNull(t)?(e=(0,_ui.getConfig)().input.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseInput"):t},computeInpImmediate:function(){var e=this.type;return this.immediate||!("text"===e||"number"===e||"integer"===e||"float"===e)},computeNumValue:function(){var e=this.reactData,t=this.type,e=e.inputValue;return this.computeIsNumType?"integer"===t?_xeUtils.default.toInteger((0,_util2.handleNumber)(e)):_xeUtils.default.toNumber((0,_util2.handleNumber)(e)):0},computeIsDisabledSubtractNumber:function(){var e=this.reactData,t=this.min,e=e.inputValue,a=this.computeIsNumType,n=this.computeNumValue;return!(!e&&0!==e||!a||null===t)&&n<=_xeUtils.default.toNumber(t)},computeIsDisabledAddNumber:function(){var e=this.reactData,t=this.max,e=e.inputValue,a=this.computeIsNumType,n=this.computeNumValue;return!(!e&&0!==e||!a||null===t)&&n>=_xeUtils.default.toNumber(t)}}),methods:{dispatchEvent:function(e,t,a){this.$emit(e,(0,_ui.createEvent)(a,{$input:this},t))},emitModel:function(e){var t=this.trim,a=this._events;a&&a.modelValue?this.$emit("modelValue",t?"".concat(e||"").trim():e):this.$emit("model-value",t?"".concat(e||"").trim():e)},focus:function(){var e=this.reactData,t=this.$refs.refInputTarget;return e.isActivated=!0,t.focus(),this.$nextTick()},blur:function(){var e=this.reactData;return this.$refs.refInputTarget.blur(),e.isActivated=!1,this.$nextTick()},select:function(){var e=this.reactData;return this.$refs.refInputTarget.select(),e.isActivated=!1,this.$nextTick()},parseDate:function(e,t){return"time"===this.type?(0,_util.toStringTimeDate)(e):_xeUtils.default.toStringDate(e,t)},getNumberValue:function(e){var t=this.type,a=this.exponential,n=this.computeInpMaxLength,i=this.computeDigitsValue,t="float"===t?(0,_util2.toFloatValueFixed)(e,t,i,""):_xeUtils.default.toValueString(e);return!a||e!==t&&_xeUtils.default.toValueString(e).toLowerCase()!==_xeUtils.default.toNumber(t).toExponential()?t.slice(0,n):e},triggerEvent:function(e){var t=this.reactData.inputValue;this.dispatchEvent(e.type,{value:t},e)},handleChange:function(e,t){var a=this,n=a,i=a.reactData,u=a.$xeForm,r=a.formItemInfo,l=a.$xeSelect,s=a.$xeTreeSelect;n.trim&&(e="".concat(e||"").trim()),i.inputValue=e,a.emitModel(e),a.dispatchEvent("input",{value:e},t),_xeUtils.default.toValueString(n.value)!==e&&(a.dispatchEvent("change",{value:e},t),l||s||u&&r&&u.triggerItemEvent(t,r.itemConfig.field,e))},emitInputEvent:function(e,t){var a=this,n=a.reactData,i=a.computeIsDatePickerType,u=a.computeInpImmediate;n.inputValue=e,i||(u?a.handleChange(e,t):a.dispatchEvent("input",{value:e},t))},inputEvent:function(e){var t=e.target.value;this.emitInputEvent(t,e)},changeEvent:function(e){var t=this.reactData;this.computeInpImmediate||this.triggerEvent(e),this.dispatchEvent("lazy-change",{value:t.inputValue},e)},blurEvent:function(e){var t=this,a=t.reactData,n=t.$xeForm,i=t.formItemInfo,u=t.$xeSelect,r=t.$xeTreeSelect,l=a.inputValue;t.computeInpImmediate||t.handleChange(l,e),t.afterCheckValue(),a.visiblePanel||(a.isActivated=!1),t.dispatchEvent("blur",{value:l},e),u||r||n&&i&&n.triggerItemEvent(e,i.itemConfig.field,l)},focusEvent:function(e){var t=this,a=t.reactData,n=a.inputValue,i=t.computeIsNumType,u=t.computeIsDatePickerType;a.isActivated=!0,i?a.inputValue=(0,_utils.eqEmptyValue)(n)?"":"".concat(_xeUtils.default.toNumber(n)):u&&t.datePickerOpenEvent(e),t.triggerEvent(e)},clickPrefixEvent:function(e){var t=this.reactData;this.computeIsDisabled||(t=t.inputValue,this.dispatchEvent("prefix-click",{value:t},e))},hidePanel:function(){var t=this.reactData,a=this.internalData;return new Promise(function(e){t.visiblePanel=!1,a.hpTimeout=setTimeout(function(){t.isAniVisible=!1,e()},350)})},clearValueEvent:function(e,t){var a=this,n=a.type,i=a.autoFocus,u=a.computeIsNumType;a.computeIsDatePickerType&&a.hidePanel(),(i||null===i)&&(u||-1<["text","search","password"].indexOf(n))&&a.focus(),a.handleChange("",e),a.dispatchEvent("clear",{value:t},e),a.dispatchEvent("lazy-change",{value:t},e)},clickSuffixEvent:function(e){var t=this.reactData;this.computeIsDisabled||(t=t.inputValue,this.dispatchEvent("suffix-click",{value:t},e))},dateParseValue:function(e){var t=this,a=t.reactData,n=t.type,i=t.computeDateLabelFormat,u=t.computeFirstDayOfWeek,r=null,l="";e&&(r=t.parseDate(e,t.computeDateValueFormat)),_xeUtils.default.isValidDate(r)?(l=_xeUtils.default.toDateString(r,i,{firstDay:u}),i&&"week"===n&&(e=_xeUtils.default.getYearWeek(r,u),(t=_xeUtils.default.getWhatWeek(r,0,1===e?(6+u)%7:u,u).getFullYear())!==r.getFullYear())&&-1<(n=i.indexOf("yyyy"))&&(e=Number(l.substring(n,n+4)))&&!isNaN(e)&&(l=l.replace("".concat(e),"".concat(t)))):r=null,a.datePanelValue=r,a.datePanelLabel=l},changeValue:function(){var e=this,t=e,a=e.reactData,n=a.inputValue;e.computeIsDatePickerType&&(e.dateParseValue(n),a.inputValue=t.multiple?e.computeDateMultipleLabel:a.datePanelLabel)},initValue:function(){var e=this,t=e.reactData,a=e.type,t=t.inputValue,n=e.computeDigitsValue;e.computeIsDatePickerType?e.changeValue():"float"===a&&t&&t!==(t=(0,_util2.toFloatValueFixed)(t,a,n,""))&&e.handleChange(t,{type:"init"})},validMaxNum:function(e){return null===this.max||""===this.max||_xeUtils.default.toNumber(e)<=_xeUtils.default.toNumber(this.max)},validMinNum:function(e){return null===this.min||""===this.min||_xeUtils.default.toNumber(e)>=_xeUtils.default.toNumber(this.min)},dateRevert:function(){var e=this.reactData;e.inputValue=this.multiple?this.computeDateMultipleLabel:e.datePanelLabel},dateCheckMonth:function(e){var t=this.reactData,a=this.computeFirstDayOfWeek,n=_xeUtils.default.getYearWeek(e,a),a=_xeUtils.default.getWhatWeek(e,0,a,a),n=_xeUtils.default.getWhatMonth(1===n?_xeUtils.default.getWhatDay(a,6):e,0,"first");_xeUtils.default.isEqual(n,t.selectMonth)||(t.selectMonth=n)},dateChange:function(t){var e,a,n=this,i=n,u=n.reactData,r=i.multiple,l=u.datetimePanelValue,u=n.computeIsDateTimeType,s=n.computeDateValueFormat,o=n.computeFirstDayOfWeek,c=("week"===i.type?(e=_xeUtils.default.toNumber(i.selectDay),t=_xeUtils.default.getWhatWeek(t,0,e,o)):u&&(t.setHours(l.getHours()),t.setMinutes(l.getMinutes()),t.setSeconds(l.getSeconds())),_xeUtils.default.toDateString(t,s,{firstDay:o}));n.dateCheckMonth(t),r?(e=n.computeDateMultipleValue,u?(o=_toConsumableArray(n.computeDateListValue),a=[],-1===(r=_xeUtils.default.findIndexOf(o,function(e){return _xeUtils.default.isDateSame(t,e,"yyyyMMdd")}))?o.push(t):o.splice(r,1),o.forEach(function(e){e&&(e.setHours(l.getHours()),e.setMinutes(l.getMinutes()),e.setSeconds(l.getSeconds()),a.push(e))}),n.handleChange(a.map(function(e){return _xeUtils.default.toDateString(e,s)}).join(","),{type:"update"})):e.some(function(e){return _xeUtils.default.isEqual(e,c)})?n.handleChange(e.filter(function(e){return!_xeUtils.default.isEqual(e,c)}).join(","),{type:"update"}):n.handleChange(e.concat([c]).join(","),{type:"update"})):_xeUtils.default.isEqual(i.value,c)||n.handleChange(c,{type:"update"})},afterCheckValue:function(){var e,t=this,a=t.reactData,n=t.type,i=t.min,u=t.max,r=t.exponential,l=a.inputValue,s=a.datetimePanelValue,o=t.computeIsDatePickerType,c=t.computeDateLabelFormat;t.computeInputReadonly||(t.computeIsNumType?l&&((e="".concat((0,_util2.handleNumber)(l)))?(e="integer"===n?_xeUtils.default.toInteger(e):_xeUtils.default.toNumber(e),t.validMinNum(e)?t.validMaxNum(e)||(e=u):e=i,r&&(u=_xeUtils.default.toValueString(l).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=u),t.handleChange(t.getNumberValue(e),{type:"check"})):(r="",!i&&0!==i||(r="".concat(i)),t.handleChange(r,{type:"check"}))):o&&(l?(u=t.parseDate(l,c),_xeUtils.default.isValidDate(u)?"time"===n?(l!==(u=_xeUtils.default.toDateString(u,c))&&t.handleChange(u,{type:"check"}),a.inputValue=u):(e=!1,i=t.computeFirstDayOfWeek,"datetime"===n?(r=t.computeDateValue,l===_xeUtils.default.toDateString(r,c)&&l===_xeUtils.default.toDateString(u,c)||(e=!0,s.setHours(u.getHours()),s.setMinutes(u.getMinutes()),s.setSeconds(u.getSeconds()))):e=!0,a.inputValue=_xeUtils.default.toDateString(u,c,{firstDay:i}),e&&t.dateChange(u)):t.dateRevert()):t.handleChange("",{type:"check"})))},passwordToggleEvent:function(e){var t=this.reactData,a=t.showPwd,n=this.computeIsDisabled,i=this.computeInputReadonly;n||i||(t.showPwd=!a),this.dispatchEvent("toggle-visible",{visible:t.showPwd},e)},searchEvent:function(e){this.dispatchEvent("search-click",{},e)},numberChange:function(e,t){var a=this,n=a.reactData,i=a.min,u=a.max,n=n.inputValue,r=a.computeStepValue,n="integer"===a.type?_xeUtils.default.toInteger((0,_util2.handleNumber)(n)):_xeUtils.default.toNumber((0,_util2.handleNumber)(n)),e=e?_xeUtils.default.add(n,r):_xeUtils.default.subtract(n,r),n=a.validMinNum(e)?a.validMaxNum(e)?e:u:i;a.emitInputEvent(a.getNumberValue(n),t)},numberNextEvent:function(e){var t=this,a=t.reactData,n=t.computeIsDisabled,i=t.computeInputReadonly,u=t.computeIsDisabledSubtractNumber;t.numberStopDown(),n||i||u||t.numberChange(!1,e),t.dispatchEvent("next-number",{value:a.inputValue},e)},numberDownNextEvent:function(e){var t=this;t.internalData.dnTimeout=setTimeout(function(){t.numberNextEvent(e),t.numberDownNextEvent(e)},60)},numberPrevEvent:function(e){var t=this,a=t.reactData,n=t.computeIsDisabled,i=t.computeInputReadonly,u=t.computeIsDisabledAddNumber;t.numberStopDown(),n||i||u||t.numberChange(!0,e),t.dispatchEvent("prev-number",{value:a.inputValue},e)},numberKeydownEvent:function(e){var t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),a=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);(t||a)&&(e.preventDefault(),t?this.numberPrevEvent(e):this.numberNextEvent(e))},keydownEvent:function(e){var t,a,n,i,u,r,l,s=this,o=s.type,c=s.exponential,d=s.controls;s.computeIsNumType&&(t=(0,_dom.hasControlKey)(e),a=e.shiftKey,n=e.altKey,i=e.keyCode,u=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),r=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),l=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN),t||a||n||(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.SPACEBAR)||"integer"===o&&110===i||(!c||69!==i)&&65<=i&&i<=90||186<=i&&i<=188||191<=i)&&e.preventDefault(),u?s.afterCheckValue():(r||l)&&d&&s.numberKeydownEvent(e)),s.triggerEvent(e)},keyupEvent:function(e){this.triggerEvent(e)},numberStopDown:function(){var e=this.internalData,t=e.dnTimeout;t&&(clearTimeout(t),e.dnTimeout=void 0)},numberDownPrevEvent:function(e){var t=this;t.internalData.dnTimeout=setTimeout(function(){t.numberPrevEvent(e),t.numberDownPrevEvent(e)},60)},numberMousedownEvent:function(e){var t,a=this,n=a.internalData;a.numberStopDown(),0===e.button&&((t=(0,_dom.hasClass)(e.currentTarget,"is--prev"))?a.numberPrevEvent(e):a.numberNextEvent(e),n.dnTimeout=setTimeout(function(){t?a.numberDownPrevEvent(e):a.numberDownNextEvent(e)},500))},wheelEvent:function(e){var t=this,a=t.reactData;t.computeIsNumType&&t.controls&&a.isActivated&&(0<(a=e.deltaY)?t.numberNextEvent(e):a<0&&t.numberPrevEvent(e),e.preventDefault()),t.triggerEvent(e)},dateMonthHandle:function(e,t){var a=this.reactData,n=this.computeFirstDayOfWeek,i=_xeUtils.default.getYearWeek(e,n),n=_xeUtils.default.getWhatWeek(e,0,n,n),i=_xeUtils.default.getWhatMonth(1===i?_xeUtils.default.getWhatDay(n,6):e,t,"first");a.selectMonth=i},dateNowHandle:function(){var e=this.reactData,t=_xeUtils.default.getWhatDay(Date.now(),0,"first");e.currentDate=t,this.dateMonthHandle(t,0)},dateToggleYearTypeEvent:function(){this.reactData.datePanelType="year"},dateToggleMonthTypeEvent:function(){var e=this.reactData,t="month"===(t=e.datePanelType)||"quarter"===t?"year":"month";e.datePanelType=t},datePrevEvent:function(e){var t=this,a=t.reactData,n=t.type,i=a.datePanelType,u=a.selectMonth,r=t.internalData.yearSize,l=a.inputValue;t.computeIsDisabledPrevDateBtn||(r="year"===n?_xeUtils.default.getWhatYear(u,-r,"first"):"month"===n||"quarter"===n?"year"===i?_xeUtils.default.getWhatYear(u,-r,"first"):_xeUtils.default.getWhatYear(u,-1,"first"):"year"===i?_xeUtils.default.getWhatYear(u,-r,"first"):"month"===i?_xeUtils.default.getWhatYear(u,-1,"first"):_xeUtils.default.getWhatMonth(u,-1,"first"),a.selectMonth=r,t.dispatchEvent("date-prev",{viewType:i,viewDate:r,value:l,type:n},e))},dateTodayMonthEvent:function(e){var t=this,a=t,n=t.reactData;t.dateNowHandle(),a.multiple||(t.dateChange(n.currentDate),t.hidePanel()),t.dispatchEvent("date-today",{type:a.type},e)},dateNextEvent:function(e){var t=this,a=t.reactData,n=t.type,i=a.datePanelType,u=a.selectMonth,r=t.internalData.yearSize,l=a.inputValue;t.computeIsDisabledNextDateBtn||(r="year"===n?_xeUtils.default.getWhatYear(u,r,"first"):"month"===n||"quarter"===n?"year"===i?_xeUtils.default.getWhatYear(u,r,"first"):_xeUtils.default.getWhatYear(u,1,"first"):"year"===i?_xeUtils.default.getWhatYear(u,r,"first"):"month"===i?_xeUtils.default.getWhatYear(u,1,"first"):_xeUtils.default.getWhatMonth(u,1,"first"),a.selectMonth=r,t.dispatchEvent("date-next",{viewType:i,viewDate:r,value:l,type:n},e))},isDateDisabled:function(e){var t=this,a=t.reactData,n=t.disabledMethod,a=a.datePanelType,i=t.computeDateStartTime,u=t.computeDateEndTime,e=e.date;return!!(i&&i.getTime()>e.getTime())||!!(u&&u.getTime()<e.getTime())||!!n&&n({type:a,viewType:a,date:e,$input:t})},dateSelectItem:function(e){var t=this,a=t.reactData,n=t.type,i=t.multiple,u=a.datePanelType;"month"===n?"year"===u?(a.datePanelType="month",t.dateCheckMonth(e)):(t.dateChange(e),i||t.hidePanel()):"year"===n?(t.dateChange(e),i||t.hidePanel()):"quarter"===n?"year"===u?(a.datePanelType="quarter",t.dateCheckMonth(e)):(t.dateChange(e),i||t.hidePanel()):"month"===u?(a.datePanelType="week"===n?n:"day",t.dateCheckMonth(e)):"year"===u?(a.datePanelType="month",t.dateCheckMonth(e)):(t.dateChange(e),"datetime"===n||i||t.hidePanel())},dateSelectEvent:function(e){this.isDateDisabled(e)||this.dateSelectItem(e.date)},dateMoveDay:function(t){this.isDateDisabled({date:t})||(this.computeDayList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyMMdd")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveYear:function(t){this.isDateDisabled({date:t})||(this.computeYearList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyy")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveQuarter:function(t){this.isDateDisabled({date:t})||(this.computeQuarterList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyq")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveMonth:function(t){this.isDateDisabled({date:t})||(this.computeMonthList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyMM")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMouseenterEvent:function(e){var t=this,a=t.reactData;t.isDateDisabled(e)||("month"===(a=a.datePanelType)?t.dateMoveMonth(e.date):"quarter"===a?t.dateMoveQuarter(e.date):"year"===a?t.dateMoveYear(e.date):t.dateMoveDay(e.date))},updateTimePos:function(e){var t;e&&(t=e.offsetHeight,e.parentNode.scrollTop=e.offsetTop-4*t)},dateTimeChangeEvent:function(e){var t=this.reactData;t.datetimePanelValue=new Date(t.datetimePanelValue.getTime()),this.updateTimePos(e.currentTarget)},dateHourEvent:function(e,t){this.reactData.datetimePanelValue.setHours(t.value),this.dateTimeChangeEvent(e)},dateConfirmEvent:function(){var t,a,e=this,n=e.reactData,i=e.multiple,u=n.datetimePanelValue,r=e.computeDateValue,l=e.computeIsDateTimeType;l&&(t=e.computeDateValueFormat,i?(i=e.computeDateMultipleValue,l?(l=_toConsumableArray(e.computeDateListValue),a=[],l.forEach(function(e){e&&(e.setHours(u.getHours()),e.setMinutes(u.getMinutes()),e.setSeconds(u.getSeconds()),a.push(e))}),e.handleChange(a.map(function(e){return _xeUtils.default.toDateString(e,t)}).join(","),{type:"update"})):e.handleChange(i.join(","),{type:"update"})):e.dateChange(r||n.currentDate)),e.hidePanel()},dateMinuteEvent:function(e,t){this.reactData.datetimePanelValue.setMinutes(t.value),this.dateTimeChangeEvent(e)},dateSecondEvent:function(e,t){this.reactData.datetimePanelValue.setSeconds(t.value),this.dateTimeChangeEvent(e)},dateOffsetEvent:function(e){var t,a,n,i=this,u=i.reactData,r=u.isActivated,l=u.datePanelValue,u=u.datePanelType;r&&(e.preventDefault(),r=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_LEFT),t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),a=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_RIGHT),e=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN),"year"===u?(n=_xeUtils.default.getWhatYear(l||Date.now(),0,"first"),r?n=_xeUtils.default.getWhatYear(n,-1):t?n=_xeUtils.default.getWhatYear(n,-4):a?n=_xeUtils.default.getWhatYear(n,1):e&&(n=_xeUtils.default.getWhatYear(n,4)),i.dateMoveYear(n)):"quarter"===u?(n=_xeUtils.default.getWhatQuarter(l||Date.now(),0,"first"),r?n=_xeUtils.default.getWhatQuarter(n,-1):t?n=_xeUtils.default.getWhatQuarter(n,-2):a?n=_xeUtils.default.getWhatQuarter(n,1):e&&(n=_xeUtils.default.getWhatQuarter(n,2)),i.dateMoveQuarter(n)):"month"===u?(n=_xeUtils.default.getWhatMonth(l||Date.now(),0,"first"),r?n=_xeUtils.default.getWhatMonth(n,-1):t?n=_xeUtils.default.getWhatMonth(n,-4):a?n=_xeUtils.default.getWhatMonth(n,1):e&&(n=_xeUtils.default.getWhatMonth(n,4)),i.dateMoveMonth(n)):(u=l||_xeUtils.default.getWhatDay(Date.now(),0,"first"),n=i.computeFirstDayOfWeek,r?u=_xeUtils.default.getWhatDay(u,-1):t?u=_xeUtils.default.getWhatWeek(u,-1,n):a?u=_xeUtils.default.getWhatDay(u,1):e&&(u=_xeUtils.default.getWhatWeek(u,1,n)),i.dateMoveDay(u)))},datePgOffsetEvent:function(e){var t;this.reactData.isActivated&&(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.PAGE_UP),e.preventDefault(),t?this.datePrevEvent(e):this.dateNextEvent(e))},dateOpenPanel:function(){var t=this,e=t.reactData,a=t.type,n=t.computeIsDateTimeType,i=t.computeDateValue;-1<["year","quarter","month","week"].indexOf(a)?e.datePanelType=a:e.datePanelType="day",e.currentDate=_xeUtils.default.getWhatDay(Date.now(),0,"first"),i?(t.dateMonthHandle(i,0),t.dateParseValue(i)):t.dateNowHandle(),n&&(e.datetimePanelValue=e.datePanelValue||_xeUtils.default.getWhatDay(Date.now(),0,"first"),t.$nextTick(function(){var e=t.$refs.refInputTimeBody;_xeUtils.default.arrayEach(e.querySelectorAll("li.is--selected"),function(e){t.updateTimePos(e)})}))},updateZindex:function(){var e=this.reactData;e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){var p=this,m=p,f=p.reactData;return p.$nextTick().then(function(){var e,t,a,n,i,u,r,l=m.placement,s=f.panelIndex,o=p.$refs.refInputTarget,c=p.$refs.refInputPanel,d=p.computeBtnTransfer;if(o&&c)return e=o.offsetHeight,t=o.offsetWidth,a=c.offsetHeight,c=c.offsetWidth,s={zIndex:s},n=(o=(0,_dom.getAbsolutePos)(o)).boundingTop,i=o.visibleHeight,u=o.visibleWidth,r="bottom",d?(d=n+e,"top"===l?(r="top",d=n-a):l||(i<d+a+5&&(r="top",d=n-a),d<5&&(r="bottom",d=n+e)),u<(o=o.boundingLeft)+c+5&&(o-=o+c+5-u),o<5&&(o=5),Object.assign(s,{left:"".concat(o,"px"),top:"".concat(d,"px"),minWidth:"".concat(t,"px")})):"top"===l?(r="top",s.bottom="".concat(e,"px")):l||(s.top="".concat(e,"px"),i<n+e+a&&5<n-e-a&&(r="top",s.top="",s.bottom="".concat(e,"px"))),f.panelStyle=s,f.panelPlacement=r,p.$nextTick()})},showPanel:function(){var e=this,t=e.reactData,a=e.internalData,n=t.visiblePanel,i=a.hpTimeout,u=e.computeIsDatePickerType,r=e.computeBtnTransfer;return e.computeIsDisabled||n?e.$nextTick():(n=e.$refs.refInputPanel,t.initialized||(t.initialized=!0,r&&n&&document.body.appendChild(n)),i&&(clearTimeout(i),a.hpTimeout=void 0),t.isActivated=!0,t.isAniVisible=!0,u&&e.dateOpenPanel(),setTimeout(function(){t.visiblePanel=!0},10),e.updateZindex(),e.updatePlacement())},datePickerOpenEvent:function(e){this.computeInputReadonly||(e.preventDefault(),this.showPanel())},clickEvent:function(e){this.triggerEvent(e)},handleGlobalMousedownEvent:function(e){var t=this,a=t.reactData,n=a.visiblePanel,i=t.computeIsDatePickerType,u=t.$refs.refElem,r=t.$refs.refPanelWrapper;!t.computeIsDisabled&&a.isActivated&&(a.isActivated=(0,_dom.getEventTargetNode)(e,u).flag||(0,_dom.getEventTargetNode)(e,r).flag,a.isActivated||(i?n&&(t.hidePanel(),t.afterCheckValue()):t.afterCheckValue()))},handleGlobalKeydownEvent:function(e){var t,a,n,i,u,r,l,s,o,c,d=this,p=d.reactData,m=d.clearable,f=p.visiblePanel,h=d.computeIsDatePickerType;d.computeIsDisabled||(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.TAB),a=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.DELETE),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),i=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ENTER),o=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_LEFT),u=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),c=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_RIGHT),r=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN),l=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.PAGE_UP),s=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.PAGE_DOWN),o=o||u||c||r,c=p.isActivated,t?(c&&d.afterCheckValue(),p.isActivated=c=!1):o?h&&c&&(f?d.dateOffsetEvent(e):(u||r)&&d.datePickerOpenEvent(e)):i?h&&(f?p.datePanelValue?d.dateSelectItem(p.datePanelValue):d.hidePanel():c&&d.datePickerOpenEvent(e)):(l||s)&&h&&c&&d.datePgOffsetEvent(e),t||n?f&&d.hidePanel():a&&m&&c&&d.clearValueEvent(e,null))},handleGlobalMousewheelEvent:function(e){var t=this,a=t.reactData.visiblePanel;t.computeIsDisabled||a&&(a=t.$refs.refPanelWrapper,(0,_dom.getEventTargetNode)(e,a).flag?t.updatePlacement():(t.hidePanel(),t.afterCheckValue()))},handleGlobalBlurEvent:function(){var e=this.reactData,t=e.isActivated;e.visiblePanel&&this.hidePanel(),t&&(e.isActivated=!1),t&&(this.afterCheckValue(),e=this.$refs.refInputTarget)&&e.blur()},renderDateLabel:function(t,e,a){var n=this.reactData,i=this.festivalMethod;return i?(e=(i=(n=i({type:i=n.datePanelType,viewType:i,date:e.date,$input:this}))?_xeUtils.default.isString(n)?{label:n}:n:{}).extra?_xeUtils.default.isString(i.extra)?{label:i.extra}:i.extra:null,n=[t("span",{class:["vxe-input--date-label",{"is-notice":i.notice}]},e&&e.label?[t("span","".concat(a||"")),t("span",{class:["vxe-input--date-label--extra",e.important?"is-important":"",e.className],style:e.style},_xeUtils.default.toValueString(e.label))]:["".concat(a||"")])],(e=i.label)&&(e=_xeUtils.default.toValueString(e).split(","),n.push(t("span",{class:["vxe-input--date-festival",i.important?"is-important":"",i.className],style:i.style},[1<e.length?t("span",{class:["vxe-input--date-festival--overlap","overlap--".concat(e.length)]},e.map(function(e){return t("span",e.substring(0,3))})):t("span",{class:"vxe-input--date-festival--label"},e[0].substring(0,3))]))),n):["".concat(a||"")]},renderDateDayTable:function(a){var n=this,e=n.reactData,i=n.multiple,t=e.datePanelType,u=e.datePanelValue,r=n.computeDateValue,e=n.computeDateHeaders,l=n.computeDayDatas,s=n.computeDateListValue,o="yyyyMMdd";return[a("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("thead",[a("tr",e.map(function(e){return a("th",e.label)}))]),a("tbody",l.map(function(e){return a("tr",e.map(function(t){return a("td",{class:{"is--prev":t.isPrev,"is--current":t.isCurrent,"is--now":t.isNow,"is--next":t.isNext,"is--disabled":n.isDateDisabled(t),"is--selected":i?s.some(function(e){return _xeUtils.default.isDateSame(e,t.date,o)}):_xeUtils.default.isDateSame(r,t.date,o),"is--hover":_xeUtils.default.isDateSame(u,t.date,o)},on:{click:function(){return n.dateSelectEvent(t)},mouseenter:function(){return n.dateMouseenterEvent(t)}}},n.renderDateLabel(a,t,t.label))}))}))])]},renderDateWeekTable:function(n){var i=this,e=i.reactData,u=i.multiple,t=e.datePanelType,r=e.datePanelValue,l=i.computeDateValue,e=i.computeWeekHeaders,a=i.computeWeekDates,s=i.computeDateListValue,o="yyyyMMdd";return[n("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[n("thead",[n("tr",e.map(function(e){return n("th",e.label)}))]),n("tbody",a.map(function(e){var t=u?e.some(function(t){return s.some(function(e){return _xeUtils.default.isDateSame(e,t.date,o)})}):e.some(function(e){return _xeUtils.default.isDateSame(l,e.date,o)}),a=e.some(function(e){return _xeUtils.default.isDateSame(r,e.date,o)});return n("tr",e.map(function(e){return n("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":i.isDateDisabled(e),"is--selected":t,"is--hover":a},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},i.renderDateLabel(n,e,e.label))}))}))])]},renderDateMonthTable:function(a){var n=this,e=n.reactData,i=n.multiple,t=e.datePanelType,u=e.datePanelValue,r=n.computeDateValue,e=n.computeMonthDatas,l=n.computeDateListValue,s="yyyyMM";return[a("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("tbody",e.map(function(e){return a("tr",e.map(function(t){return a("td",{class:{"is--prev":t.isPrev,"is--current":t.isCurrent,"is--now":t.isNow,"is--next":t.isNext,"is--disabled":n.isDateDisabled(t),"is--selected":i?l.some(function(e){return _xeUtils.default.isDateSame(e,t.date,s)}):_xeUtils.default.isDateSame(r,t.date,s),"is--hover":_xeUtils.default.isDateSame(u,t.date,s)},on:{click:function(){return n.dateSelectEvent(t)},mouseenter:function(){return n.dateMouseenterEvent(t)}}},n.renderDateLabel(a,t,(0,_ui.getI18n)("vxe.input.date.months.m".concat(t.month))))}))}))])]},renderDateQuarterTable:function(a){var n=this,e=n.reactData,i=n.multiple,t=e.datePanelType,u=e.datePanelValue,r=n.computeDateValue,e=n.computeQuarterDatas,l=n.computeDateListValue,s="yyyyq";return[a("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("tbody",e.map(function(e){return a("tr",e.map(function(t){return a("td",{class:{"is--prev":t.isPrev,"is--current":t.isCurrent,"is--now":t.isNow,"is--next":t.isNext,"is--disabled":n.isDateDisabled(t),"is--selected":i?l.some(function(e){return _xeUtils.default.isDateSame(e,t.date,s)}):_xeUtils.default.isDateSame(r,t.date,s),"is--hover":_xeUtils.default.isDateSame(u,t.date,s)},on:{click:function(){return n.dateSelectEvent(t)},mouseenter:function(){return n.dateMouseenterEvent(t)}}},n.renderDateLabel(a,t,(0,_ui.getI18n)("vxe.input.date.quarters.q".concat(t.quarter))))}))}))])]},renderDateYearTable:function(a){var n=this,e=n.reactData,i=n.multiple,t=e.datePanelType,u=e.datePanelValue,r=n.computeDateValue,e=n.computeYearDatas,l=n.computeDateListValue,s="yyyy";return[a("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("tbody",e.map(function(e){return a("tr",e.map(function(t){return a("td",{class:{"is--prev":t.isPrev,"is--current":t.isCurrent,"is--now":t.isNow,"is--next":t.isNext,"is--disabled":n.isDateDisabled(t),"is--selected":i?l.some(function(e){return _xeUtils.default.isDateSame(e,t.date,s)}):_xeUtils.default.isDateSame(r,t.date,s),"is--hover":_xeUtils.default.isDateSame(u,t.date,s)},on:{click:function(){return n.dateSelectEvent(t)},mouseenter:function(){return n.dateMouseenterEvent(t)}}},n.renderDateLabel(a,t,t.year))}))}))])]},renderDateTable:function(e){var t=this;switch(t.reactData.datePanelType){case"week":return t.renderDateWeekTable(e);case"month":return t.renderDateMonthTable(e);case"quarter":return t.renderDateQuarterTable(e);case"year":return t.renderDateYearTable(e)}return t.renderDateDayTable(e)},renderDatePanel:function(e){var t=this,a=t.reactData,n=t.multiple,a=a.datePanelType,i=t.computeIsDisabledPrevDateBtn,u=t.computeIsDisabledNextDateBtn,r=t.computeSelectDatePanelObj;return[e("div",{class:"vxe-input--date-picker-header"},[e("div",{class:"vxe-input--date-picker-type-wrapper"},["year"===a?e("span",{class:"vxe-input--date-picker-label"},r.y):e("span",{class:"vxe-input--date-picker-btns"},[e("span",{class:"vxe-input--date-picker-btn",on:{click:t.dateToggleYearTypeEvent}},r.y),r.m?e("span",{class:"vxe-input--date-picker-btn",on:{click:t.dateToggleMonthTypeEvent}},r.m):(0,_ui.renderEmptyElement)(t)])]),e("div",{class:"vxe-input--date-picker-btn-wrapper"},[e("span",{class:["vxe-input--date-picker-btn vxe-input--date-picker-prev-btn",{"is--disabled":i}],on:{click:t.datePrevEvent}},[e("i",{class:"vxe-icon-caret-left"})]),e("span",{class:"vxe-input--date-picker-btn vxe-input--date-picker-current-btn",on:{click:t.dateTodayMonthEvent}},[e("i",{class:"vxe-icon-dot"})]),e("span",{class:["vxe-input--date-picker-btn vxe-input--date-picker-next-btn",{"is--disabled":u}],on:{click:t.dateNextEvent}},[e("i",{class:"vxe-icon-caret-right"})]),n&&t.computeSupportMultiples?e("span",{class:"vxe-input--date-picker-btn vxe-input--date-picker-confirm-btn"},[e("button",{class:"vxe-input--date-picker-confirm",attrs:{type:"button"},on:{click:t.dateConfirmEvent}},(0,_ui.getI18n)("vxe.button.confirm"))]):null])]),e("div",{class:"vxe-input--date-picker-body"},t.renderDateTable(e))]},renderTimePanel:function(a){var n=this,i=n.reactData.datetimePanelValue,e=n.computeHourList,t=n.computeHasTimeMinute,u=n.computeMinuteList,r=n.computeHasTimeSecond,l=n.computeSecondList;return[a("div",{class:"vxe-input--time-picker-header"},[t?a("span",{class:"vxe-input--time-picker-title"},n.computeDateTimeLabel):(0,_ui.renderEmptyElement)(n),a("div",{class:"vxe-input--time-picker-btn"},[a("button",{class:"vxe-input--time-picker-confirm",attrs:{type:"button"},on:{click:n.dateConfirmEvent}},(0,_ui.getI18n)("vxe.button.confirm"))])]),a("div",{ref:"refInputTimeBody",class:"vxe-input--time-picker-body"},[a("ul",{class:"vxe-input--time-picker-hour-list"},e.map(function(t,e){return a("li",{key:e,class:{"is--selected":i&&i.getHours()===t.value},on:{click:function(e){return n.dateHourEvent(e,t)}}},t.label)})),t?a("ul",{class:"vxe-input--time-picker-minute-list"},u.map(function(t,e){return a("li",{key:e,class:{"is--selected":i&&i.getMinutes()===t.value},on:{click:function(e){return n.dateMinuteEvent(e,t)}}},t.label)})):(0,_ui.renderEmptyElement)(n),t&&r?a("ul",{class:"vxe-input--time-picker-second-list"},l.map(function(t,e){return a("li",{key:e,class:{"is--selected":i&&i.getSeconds()===t.value},on:{click:function(e){return n.dateSecondEvent(e,t)}}},t.label)})):(0,_ui.renderEmptyElement)(n)])]},renderPanel:function(e){var t=this,a=t.reactData,n=t.type,i=a.initialized,u=a.isAniVisible,r=a.visiblePanel,l=a.panelPlacement,a=a.panelStyle,s=t.computeSize,o=t.computeBtnTransfer,c=[];return t.computeIsDatePickerType?(c.push("datetime"===n?e("div",{key:n,ref:"refPanelWrapper",class:"vxe-input--panel-layout-wrapper"},[e("div",{class:"vxe-input--panel-left-wrapper"},t.renderDatePanel(e)),e("div",{class:"vxe-input--panel-right-wrapper"},t.renderTimePanel(e))]):"time"===n?e("div",{key:n,ref:"refPanelWrapper",class:"vxe-input--panel-wrapper"},t.renderTimePanel(e)):e("div",{key:n||"default",ref:"refPanelWrapper",class:"vxe-input--panel-wrapper"},t.renderDatePanel(e))),e("div",{ref:"refInputPanel",class:["vxe-table--ignore-clear vxe-input--panel","type--".concat(n),_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(s),s),"is--transfer",o),"ani--leave",u),"ani--enter",r)],attrs:{placement:l},style:a},i&&(r||u)?c:[])):(0,_ui.renderEmptyElement)(t)},renderNumberIcon:function(e){var t=this,a=t.computeIsDisabledAddNumber,n=t.computeIsDisabledSubtractNumber;return e("div",{class:"vxe-input--control-icon"},[e("div",{class:"vxe-input--number-icon"},[e("div",{class:["vxe-input--number-btn is--prev",{"is--disabled":a}],on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:(0,_ui.getIcon)().INPUT_PLUS_NUM})]),e("div",{class:["vxe-input--number-btn is--next",{"is--disabled":n}],on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:(0,_ui.getIcon)().INPUT_MINUS_NUM})])])])},renderDatePickerIcon:function(e){return e("div",{class:"vxe-input--control-icon",on:{click:this.datePickerOpenEvent}},[e("i",{class:["vxe-input--date-picker-icon",(0,_ui.getIcon)().DATE_PICKER_DATE]})])},renderSearchIcon:function(e){return e("div",{class:"vxe-input--control-icon",on:{click:this.searchEvent}},[e("i",{class:["vxe-input--search-icon",(0,_ui.getIcon)().INPUT_SEARCH]})])},renderPasswordIcon:function(e){var t=this.reactData.showPwd;return e("div",{class:"vxe-input--control-icon",on:{click:this.passwordToggleEvent}},[e("i",{class:["vxe-input--password-icon",t?(0,_ui.getIcon)().PASSWORD_INPUT_SHOW_PWD:(0,_ui.getIcon)().PASSWORD_INPUT_HIDE_PWD]})])},renderPrefixIcon:function(e){var t=this,a=t.$scopedSlots,n=t.prefixIcon,i=t.computePrefixOpts,a=a.prefix,n=n||i.icon,i=i.content;return a||n||i?e("div",{class:"vxe-input--prefix",on:{click:t.clickPrefixEvent}},[e("div",{class:"vxe-input--prefix-icon"},a?(0,_vn.getSlotVNs)(a({})):[n?e("i",{class:n}):(0,_ui.renderEmptyElement)(t),i?e("span",{class:"vxe-input--prefix-text"},"".concat(i)):(0,_ui.renderEmptyElement)(t)])]):null},renderSuffixIcon:function(e){var t=this,a=t.$scopedSlots,n=t.suffixIcon,i=t.reactData.inputValue,a=a.suffix,u=t.computeSuffixOpts,r=t.computeIsClearable,l=t.computeIsPawdType||t.computeIsNumType||t.computeIsDatePickerType||t.computeIsSearchType,n=n||u.icon,u=u.content;return r||a||n||u||l?e("div",{class:["vxe-input--suffix",{"is--clear":r&&!t.computeIsDisabled&&!(""===i||_xeUtils.default.eqNull(i))}]},[r?e("div",{class:"vxe-input--clear-icon",on:{click:t.clearValueEvent}},[e("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]):(0,_ui.renderEmptyElement)(t),l?t.renderExtraSuffixIcon(e):(0,_ui.renderEmptyElement)(t),a||n||u?e("div",{class:"vxe-input--suffix-icon",on:{click:t.clickSuffixEvent}},a?(0,_vn.getSlotVNs)(a({})):[n?e("i",{class:n}):(0,_ui.renderEmptyElement)(t),u?e("span",{class:"vxe-input--suffix-text"},"".concat(u)):(0,_ui.renderEmptyElement)(t)]):(0,_ui.renderEmptyElement)(t)]):null},renderExtraSuffixIcon:function(e){var t=this,a=t.controls,n=t.computeIsNumType,i=t.computeIsDatePickerType,u=t.computeIsSearchType;return t.computeIsPawdType?t.renderPasswordIcon(e):n&&a?t.renderNumberIcon(e):i?t.renderDatePickerIcon(e):u?t.renderSearchIcon(e):(0,_ui.renderEmptyElement)(t)},renderVN:function(e){var t,a,n,i,u,r,l,s,o,c=this,d=c.reactData,p=c.className,m=c.controls,f=c.type,h=c.title,v=c.align,y=c.showWordCount,D=c.countMethod,g=c.name,x=c.autoComplete,_=c.autocomplete,b=d.inputValue,E=d.visiblePanel,d=d.isActivated,P=c.computeSize,T=c.computeIsDisabled;return c.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-input--readonly","type--".concat(f),p]},b):(t=c.computeIsCountError,a=c.computeInputCount,n=c.computeInputReadonly,i=c.computeInpMaxLength,u=c.computeInputType,r=c.computeInpPlaceholder,l=c.computeIsClearable,y=y&&["text","search"].includes(f),s=c.renderPrefixIcon(e),o=c.renderSuffixIcon(e),e("div",{ref:"refElem",class:["vxe-input","type--".concat(f),p,_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(P),P),"is--".concat(v),v),"is--controls",m),"is--prefix",!!s),"is--suffix",!!o),"is--visible",E),"is--count",y),"is--disabled",T),"is--active",d),"show--clear",l&&!T&&!(""===b||_xeUtils.default.eqNull(b)))],attrs:{spellcheck:!1}},[s||(0,_ui.renderEmptyElement)(c),e("div",{class:"vxe-input--wrapper",attrs:h?{title:h}:void 0},[e("input",{ref:"refInputTarget",class:"vxe-input--inner",domProps:{value:b},attrs:{name:g,type:u,placeholder:r,maxlength:i,readonly:n,disabled:T,autocomplete:x||_},on:{keydown:c.keydownEvent,keyup:c.keyupEvent,click:c.clickEvent,input:c.inputEvent,change:c.changeEvent,focus:c.focusEvent,blur:c.blurEvent}})]),o||(0,_ui.renderEmptyElement)(c),c.renderPanel(e),y?e("span",{class:["vxe-input--count",{"is--error":t}]},D?"".concat(D({value:b})):"".concat(a).concat(i?"/".concat(i):"")):(0,_ui.renderEmptyElement)(c)]))}},watch:{value:function(e){this.reactData.inputValue=e,this.changeValue()},type:function(){var e=this.reactData;Object.assign(e,{inputValue:this.value,datetimePanelValue:null,datePanelValue:null,datePanelLabel:"",datePanelType:"day",selectMonth:null,currentDate:null}),this.initValue()},computeDateLabelFormat:function(){var e=this,t=e,a=e.reactData;e.computeIsDatePickerType&&(e.dateParseValue(a.datePanelValue),a.inputValue=t.multiple?e.computeDateMultipleLabel:a.datePanelLabel)}},created:function(){this.reactData.inputValue=this.value,this.initValue()},mounted:function(){var e=this,t=e.type,t=(["date","time","datetime","week","month","quarter","year"].includes(t)?warnLog("vxe.error.useNew",['<vxe-input type="'.concat(t,'" ... />'),'<vxe-date-picker type="'.concat(t,'" ... />')]):["number","integer","float"].includes(t)?warnLog("vxe.error.useNew",['<vxe-input type="'.concat(t,'" ... />'),'<vxe-number-input type="'.concat(t,'" ... />')]):["password"].includes(t)&&warnLog("vxe.error.useNew",['<vxe-input type="'.concat(t,'" ... />'),"<vxe-password-input ... />"]),e.$refs.refInputTarget);t&&t.addEventListener("wheel",e.wheelEvent,{passive:!1}),_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.refInputPanel,t=(t&&t.parentNode&&t.parentNode.removeChild(t),e.numberStopDown(),e.afterCheckValue(),e.$refs.refInputTarget);t&&t.removeEventListener("wheel",e.wheelEvent),_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)}});
|
|
1
|
+
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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom"),_util=require("../../date-panel/src/util"),_util2=require("../../number-input/src/util"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,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 a=e[Symbol.toPrimitive];if(void 0===a)return("string"===t?String:Number)(e);a=a.call(e,t||"default");if("object"!=_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var a;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(a="Object"===(a={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:a)||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}var _createComponentLog=(0,_log.createComponentLog)("input"),warnLog=_createComponentLog.warnLog,_default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeInput",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Date],immediate:{type:Boolean,default:!0},name:String,title:String,type:{type:String,default:"text"},clearable:{type:Boolean,default:function(){return(0,_ui.getConfig)().input.clearable}},readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},placeholder:{type:String,default:null},maxLength:{type:[String,Number],default:function(){return(0,_ui.getConfig)().input.maxLength}},autoComplete:{type:String,default:"off"},autoFocus:{type:Boolean,default:null},align:String,form:String,className:String,size:{type:String,default:function(){return(0,_ui.getConfig)().input.size||(0,_ui.getConfig)().size}},multiple:Boolean,showWordCount:Boolean,countMethod:Function,min:{type:[String,Number],default:null},max:{type:[String,Number],default:null},step:[String,Number],trim:{type:Boolean,default:function(){return(0,_ui.getConfig)().input.trim}},exponential:{type:Boolean,default:function(){return(0,_ui.getConfig)().input.exponential}},controls:{type:Boolean,default:function(){return(0,_ui.getConfig)().input.controls}},digits:{type:[String,Number],default:function(){return(0,_ui.getConfig)().input.digits}},startDate:{type:[String,Number,Date],default:function(){return(0,_ui.getConfig)().input.startDate}},endDate:{type:[String,Number,Date],default:function(){return(0,_ui.getConfig)().input.endDate}},minDate:[String,Number,Date],maxDate:[String,Number,Date],startWeek:Number,startDay:{type:[String,Number],default:function(){return(0,_ui.getConfig)().input.startDay}},labelFormat:String,valueFormat:String,editable:{type:Boolean,default:!0},festivalMethod:{type:Function,default:function(){return(0,_ui.getConfig)().input.festivalMethod}},disabledMethod:{type:Function,default:function(){return(0,_ui.getConfig)().input.disabledMethod}},selectDay:{type:[String,Number],default:function(){return(0,_ui.getConfig)().input.selectDay}},prefixIcon:String,prefixConfig:Object,suffixIcon:String,suffixConfig:Object,placement:String,transfer:{type:Boolean,default:null},maxlength:[String,Number],autocomplete:String},inject:{$xeSelect:{default:null},$xeTreeSelect:{default:null},$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,panelIndex:0,showPwd:!1,visiblePanel:!1,isAniVisible:!1,panelStyle:{},panelPlacement:"",isActivated:!1,inputValue:"",datetimePanelValue:null,datePanelValue:null,datePanelLabel:"",datePanelType:"day",selectMonth:null,currentDate:null},internalData:{yearSize:12,monthSize:20,quarterSize:8,hpTimeout:void 0,dnTimeout:void 0}}},computed:Object.assign(Object.assign({},{}),{computePrefixOpts:function(){return Object.assign({},(0,_ui.getConfig)().input.prefixConfig,this.prefixConfig)},computeSuffixOpts:function(){return Object.assign({},(0,_ui.getConfig)().input.suffixConfig,this.suffixConfig)},computeBtnTransfer:function(){var e=this,t=e.$xeTable,a=e.$xeModal,n=e.$xeDrawer,i=e.$xeForm,e=e.transfer;if(null===e){var r=(0,_ui.getConfig)().input.transfer;if(_xeUtils.default.isBoolean(r))return r;if(t||a||n||i)return!0}return e},computeFormReadonly:function(){var e,t=this.$xeForm;return"obsolete"===(0,_ui.getConfig)().inputReadonly||null===(e=this.readonly)?!!t&&t.readonly:e},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeInpMaxLength:function(){var e=this.maxLength,t=this.maxlength,e=e||t;return this.computeIsNumType&&!_xeUtils.default.toNumber(e)?16:e},computeIsDateTimeType:function(){var e=this.type;return"time"===e||"datetime"===e},computeIsNumType:function(){return-1<["number","integer","float"].indexOf(this.type)},computeInputCount:function(){var e=this.reactData;return _xeUtils.default.getSize(e.inputValue)},computeIsCountError:function(){var e=this.computeInputCount,t=this.computeInpMaxLength;return t&&e>_xeUtils.default.toNumber(t)},computeIsDatePickerType:function(){return this.computeIsDateTimeType||-1<["date","week","month","quarter","year"].indexOf(this.type)},computeIsPawdType:function(){return"password"===this.type},computeIsSearchType:function(){return"search"===this.type},computeDigitsValue:function(){return _xeUtils.default.toInteger(this.digits)||1},computeStepValue:function(){var e=this.type,t=this.computeDigitsValue,a=this.step;return"integer"===e?_xeUtils.default.toInteger(a)||1:"float"===e?_xeUtils.default.toNumber(a)||1/Math.pow(10,t):_xeUtils.default.toNumber(a)||1},computeIsClearable:function(){var e=this.type,t=this.computeIsNumType,a=this.computeIsDatePickerType,n=this.computeIsPawdType;return this.clearable&&(n||t||a||"text"===e||"search"===e)},computeDateStartTime:function(){return this.startDate?_xeUtils.default.toStringDate(this.startDate):null},computeDateEndTime:function(){return this.endDate?_xeUtils.default.toStringDate(this.endDate):null},computeSupportMultiples:function(){return-1<["date","week","month","quarter","year"].indexOf(this.type)},computeDateListValue:function(){var t=this,e=t.value,a=t.computeIsDatePickerType,n=t.computeDateValueFormat;return t.multiple&&e&&a?_xeUtils.default.toValueString(e).split(",").map(function(e){e=t.parseDate(e,n);return _xeUtils.default.isValidDate(e),e}):[]},computeDateMultipleValue:function(){var e=this.computeDateListValue,t=this.computeDateValueFormat;return e.map(function(e){return _xeUtils.default.toDateString(e,t)})},computeDateMultipleLabel:function(){var e=this.computeDateListValue,t=this.computeDateLabelFormat;return e.map(function(e){return _xeUtils.default.toDateString(e,t)}).join(", ")},computeDateValueFormat:function(){var e=this.type,t=this.valueFormat;return t||("time"===e?"HH:mm:ss":"datetime"===e?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd")},computeDateValue:function(){var e=this.value,t=this.computeIsDatePickerType,a=this.computeDateValueFormat,n=null;return n=e&&t&&(t=this.parseDate(e,a),_xeUtils.default.isValidDate(t))?t:n},computeIsDisabledPrevDateBtn:function(){var e=this.reactData,t=this.computeDateStartTime,e=e.selectMonth;return!(!e||!t)&&e<=t},computeIsDisabledNextDateBtn:function(){var e=this.reactData,t=this.computeDateEndTime,e=e.selectMonth;return!(!e||!t)&&t<=e},computeDateTimeLabel:function(){var e=this.reactData.datetimePanelValue,t=this.computeHasTimeSecond;return e?_xeUtils.default.toDateString(e,t?"HH:mm:ss":"HH:mm"):""},computeDateHMSTime:function(){var e=this.computeDateValue,t=this.computeIsDateTimeType;return e&&t?1e3*(3600*e.getHours()+60*e.getMinutes()+e.getSeconds()):0},computeDateLabelFormat:function(){var e=this.labelFormat;return this.computeIsDatePickerType?e||(0,_ui.getI18n)("vxe.input.date.labelFormat.".concat(this.type)):""},computeYearList:function(){var e=this.reactData,t=this.internalData,a=e.selectMonth,e=e.currentDate,n=t.yearSize,i=[];if(a&&e)for(var r=e.getFullYear(),t=a.getFullYear(),u=new Date(t-t%n,0,1),l=-4;l<n+4;l++){var s=_xeUtils.default.getWhatYear(u,l,"first"),o=s.getFullYear();i.push({date:s,isCurrent:!0,isPrev:l<0,isNow:r===o,isNext:n<=l,year:o})}return i},computeSelectDatePanelObj:function(){var e,t,a,n,i=this.reactData,r="",u="";return this.computeIsDatePickerType&&(e=i.datePanelType,i=i.selectMonth,t=this.computeYearList,a="",i&&(a=i.getFullYear(),n=i.getMonth()+1),"quarter"===e||"month"===e?r=(0,_ui.getI18n)("vxe.datePicker.yearTitle",[a]):"year"===e?r=t.length?"".concat(t[0].year," - ").concat(t[t.length-1].year):"":(r=(0,_ui.getI18n)("vxe.datePicker.yearTitle",[a]),u=n?(0,_ui.getI18n)("vxe.input.date.m".concat(n)):"-")),{y:r,m:u}},computeFirstDayOfWeek:function(){var e=this.startDay,t=this.startWeek;return _xeUtils.default.toNumber(_xeUtils.default.isNumber(e)||_xeUtils.default.isString(e)?e:t)},computeWeekDatas:function(){var e=[];if(this.computeIsDatePickerType){var t=this.computeFirstDayOfWeek;e.push(t);for(var a=0;a<6;a++)6<=t?t=0:t++,e.push(t)}return e},computeDateHeaders:function(){return this.computeIsDatePickerType?this.computeWeekDatas.map(function(e){return{value:e,label:(0,_ui.getI18n)("vxe.input.date.weeks.w".concat(e))}}):[]},computeWeekHeaders:function(){var e;return this.computeIsDatePickerType?(e=this.computeDateHeaders,[{label:(0,_ui.getI18n)("vxe.input.date.weeks.w")}].concat(e)):[]},computeYearDatas:function(){var e=this.computeYearList;return _xeUtils.default.chunk(e,4)},computeQuarterList:function(){var e=this.reactData,t=this.internalData,a=e.selectMonth,e=e.currentDate,n=t.quarterSize,i=[];if(a&&e)for(var r=e.getFullYear(),u=(0,_util.getDateQuarter)(e),l=_xeUtils.default.getWhatYear(a,0,"first"),s=l.getFullYear(),o=-2;o<n-2;o++){var c=_xeUtils.default.getWhatQuarter(l,o),d=c.getFullYear(),p=(0,_util.getDateQuarter)(c),m=d<s;i.push({date:c,isPrev:m,isCurrent:d===s,isNow:d===r&&p===u,isNext:!m&&s<d,quarter:p})}return i},computeQuarterDatas:function(){var e=this.computeQuarterList;return _xeUtils.default.chunk(e,2)},computeMonthList:function(){var e=this.reactData,t=this.internalData,a=e.selectMonth,e=e.currentDate,n=t.monthSize,i=[];if(a&&e)for(var r=e.getFullYear(),u=e.getMonth(),l=_xeUtils.default.getWhatYear(a,0,"first").getFullYear(),s=-4;s<n-4;s++){var o=_xeUtils.default.getWhatYear(a,0,s),c=o.getFullYear(),d=o.getMonth(),p=c<l;i.push({date:o,isPrev:p,isCurrent:c===l,isNow:c===r&&d===u,isNext:!p&&l<c,month:d})}return i},computeMonthDatas:function(){var e=this.computeMonthList;return _xeUtils.default.chunk(e,4)},computeDayList:function(){var e=this.reactData,t=e.selectMonth,e=e.currentDate,a=[];if(t&&e)for(var n=this.computeDateHMSTime,i=this.computeWeekDatas,r=e.getFullYear(),u=e.getMonth(),l=e.getDate(),s=t.getFullYear(),o=t.getMonth(),e=t.getDay(),i=-i.indexOf(e),c=new Date(_xeUtils.default.getWhatDay(t,i).getTime()+n),d=0;d<42;d++){var p=_xeUtils.default.getWhatDay(c,d),m=p.getFullYear(),f=p.getMonth(),h=p.getDate(),v=p<t;a.push({date:p,isPrev:v,isCurrent:m===s&&f===o,isNow:m===r&&f===u&&h===l,isNext:!v&&o!==f,label:h})}return a},computeDayDatas:function(){var e=this.computeDayList;return _xeUtils.default.chunk(e,7)},computeWeekDates:function(){var e=this.computeDayDatas,a=this.computeFirstDayOfWeek;return e.map(function(e){var t=e[0];return[{date:t.date,isWeekNumber:!0,isPrev:!1,isCurrent:!1,isNow:!1,isNext:!1,label:_xeUtils.default.getYearWeek(t.date,a)}].concat(e)})},computeHourList:function(){var e=[];if(this.computeIsDateTimeType)for(var t=0;t<24;t++)e.push({value:t,label:(""+t).padStart(2,"0"),disabled:!1});return e},computeMinuteList:function(){var e=[];if(this.computeIsDateTimeType)for(var t=0;t<60;t++)e.push({value:t,label:(""+t).padStart(2,"0"),disabled:!1});return e},computeHasTimeMinute:function(){var e=this.computeDateValueFormat;return!/HH/.test(e)||/mm/.test(e)},computeHasTimeSecond:function(){var e=this.computeDateValueFormat;return!/HH/.test(e)||/ss/.test(e)},computeSecondList:function(){return this.computeMinuteList},computeInputReadonly:function(){var e=this.type,t=this.editable,a=this.multiple;return this.readonly||a||!t||"week"===e||"quarter"===e},computeInputType:function(){var e=this,t=e.reactData,a=e.type,t=t.showPwd;return e.computeIsDatePickerType||e.computeIsNumType||e.computeIsPawdType&&t||"number"===a?"text":a},computeInpPlaceholder:function(){var e,t=this.placeholder;return t?(0,_utils.getFuncText)(t):_xeUtils.default.eqNull(t)?(e=(0,_ui.getConfig)().input.placeholder)?(0,_utils.getFuncText)(e):(0,_ui.getI18n)("vxe.base.pleaseInput"):t},computeInpImmediate:function(){var e=this.type;return this.immediate||!("text"===e||"number"===e||"integer"===e||"float"===e)},computeNumValue:function(){var e=this.reactData,t=this.type,e=e.inputValue;return this.computeIsNumType?"integer"===t?_xeUtils.default.toInteger((0,_util2.handleNumber)(e)):_xeUtils.default.toNumber((0,_util2.handleNumber)(e)):0},computeIsDisabledSubtractNumber:function(){var e=this.reactData,t=this.min,e=e.inputValue,a=this.computeIsNumType,n=this.computeNumValue;return!(!e&&0!==e||!a||null===t)&&n<=_xeUtils.default.toNumber(t)},computeIsDisabledAddNumber:function(){var e=this.reactData,t=this.max,e=e.inputValue,a=this.computeIsNumType,n=this.computeNumValue;return!(!e&&0!==e||!a||null===t)&&n>=_xeUtils.default.toNumber(t)}}),methods:{dispatchEvent:function(e,t,a){this.$emit(e,(0,_ui.createEvent)(a,{$input:this},t))},emitModel:function(e){var t=this.trim,a=this._events;a&&a.modelValue?this.$emit("modelValue",t?"".concat(e||"").trim():e):this.$emit("model-value",t?"".concat(e||"").trim():e)},focus:function(){var e=this.reactData,t=this.$refs.refInputTarget;return e.isActivated=!0,t.focus(),this.$nextTick()},blur:function(){var e=this.reactData;return this.$refs.refInputTarget.blur(),e.isActivated=!1,this.$nextTick()},select:function(){var e=this.reactData;return this.$refs.refInputTarget.select(),e.isActivated=!1,this.$nextTick()},parseDate:function(e,t){return"time"===this.type?(0,_util.toStringTimeDate)(e):_xeUtils.default.toStringDate(e,t)},getNumberValue:function(e){var t=this.type,a=this.exponential,n=this.computeInpMaxLength,i=this.computeDigitsValue,t="float"===t?(0,_util2.toFloatValueFixed)(e,t,i,""):_xeUtils.default.toValueString(e);return!a||e!==t&&_xeUtils.default.toValueString(e).toLowerCase()!==_xeUtils.default.toNumber(t).toExponential()?t.slice(0,n):e},triggerEvent:function(e){var t=this.reactData.inputValue;this.dispatchEvent(e.type,{value:t},e)},handleChange:function(e,t){var a=this,n=a,i=a.reactData,r=a.$xeForm,u=a.formItemInfo,l=a.$xeSelect,s=a.$xeTreeSelect;n.trim&&(e="".concat(e||"").trim()),i.inputValue=e,a.emitModel(e),a.dispatchEvent("input",{value:e},t),_xeUtils.default.toValueString(n.value)!==e&&(a.dispatchEvent("change",{value:e},t),l||s||r&&u&&r.triggerItemEvent(t,u.itemConfig.field,e))},emitInputEvent:function(e,t){var a=this,n=a.reactData,i=a.$xeForm,r=a.formItemInfo,u=a.$xeSelect,l=a.$xeTreeSelect,s=a.computeIsDatePickerType,o=a.computeInpImmediate;n.inputValue=e,s||(o?a.handleChange(e,t):(a.dispatchEvent("input",{value:e},t),u||l||i&&r&&i.triggerItemEvent(t,r.itemConfig.field,e)))},inputEvent:function(e){var t=e.target.value;this.emitInputEvent(t,e)},changeEvent:function(e){var t=this.reactData;this.computeInpImmediate||this.triggerEvent(e),this.dispatchEvent("lazy-change",{value:t.inputValue},e)},blurEvent:function(e){var t=this,a=t.reactData,n=t.$xeForm,i=t.formItemInfo,r=t.$xeSelect,u=t.$xeTreeSelect,l=a.inputValue;t.computeInpImmediate||t.handleChange(l,e),t.afterCheckValue(),a.visiblePanel||(a.isActivated=!1),t.dispatchEvent("blur",{value:l},e),r||u||n&&i&&n.triggerItemEvent(e,i.itemConfig.field,l)},focusEvent:function(e){var t=this,a=t.reactData,n=a.inputValue,i=t.computeIsNumType,r=t.computeIsDatePickerType;a.isActivated=!0,i?a.inputValue=(0,_utils.eqEmptyValue)(n)?"":"".concat(_xeUtils.default.toNumber(n)):r&&t.datePickerOpenEvent(e),t.triggerEvent(e)},clickPrefixEvent:function(e){var t=this.reactData;this.computeIsDisabled||(t=t.inputValue,this.dispatchEvent("prefix-click",{value:t},e))},hidePanel:function(){var t=this.reactData,a=this.internalData;return new Promise(function(e){t.visiblePanel=!1,a.hpTimeout=setTimeout(function(){t.isAniVisible=!1,e()},350)})},clearValueEvent:function(e,t){var a=this,n=a.type,i=a.autoFocus,r=a.computeIsNumType;a.computeIsDatePickerType&&a.hidePanel(),(i||null===i)&&(r||-1<["text","search","password"].indexOf(n))&&a.focus(),a.handleChange("",e),a.dispatchEvent("clear",{value:t},e),a.dispatchEvent("lazy-change",{value:t},e)},clickSuffixEvent:function(e){var t=this.reactData;this.computeIsDisabled||(t=t.inputValue,this.dispatchEvent("suffix-click",{value:t},e))},dateParseValue:function(e){var t=this,a=t.reactData,n=t.type,i=t.computeDateLabelFormat,r=t.computeFirstDayOfWeek,u=null,l="";e&&(u=t.parseDate(e,t.computeDateValueFormat)),_xeUtils.default.isValidDate(u)?(l=_xeUtils.default.toDateString(u,i,{firstDay:r}),i&&"week"===n&&(e=_xeUtils.default.getYearWeek(u,r),(t=_xeUtils.default.getWhatWeek(u,0,1===e?(6+r)%7:r,r).getFullYear())!==u.getFullYear())&&-1<(n=i.indexOf("yyyy"))&&(e=Number(l.substring(n,n+4)))&&!isNaN(e)&&(l=l.replace("".concat(e),"".concat(t)))):u=null,a.datePanelValue=u,a.datePanelLabel=l},changeValue:function(){var e=this,t=e,a=e.reactData,n=a.inputValue;e.computeIsDatePickerType&&(e.dateParseValue(n),a.inputValue=t.multiple?e.computeDateMultipleLabel:a.datePanelLabel)},initValue:function(){var e=this,t=e.reactData,a=e.type,t=t.inputValue,n=e.computeDigitsValue;e.computeIsDatePickerType?e.changeValue():"float"===a&&t&&t!==(t=(0,_util2.toFloatValueFixed)(t,a,n,""))&&e.handleChange(t,{type:"init"})},validMaxNum:function(e){return null===this.max||""===this.max||_xeUtils.default.toNumber(e)<=_xeUtils.default.toNumber(this.max)},validMinNum:function(e){return null===this.min||""===this.min||_xeUtils.default.toNumber(e)>=_xeUtils.default.toNumber(this.min)},dateRevert:function(){var e=this.reactData;e.inputValue=this.multiple?this.computeDateMultipleLabel:e.datePanelLabel},dateCheckMonth:function(e){var t=this.reactData,a=this.computeFirstDayOfWeek,n=_xeUtils.default.getYearWeek(e,a),a=_xeUtils.default.getWhatWeek(e,0,a,a),n=_xeUtils.default.getWhatMonth(1===n?_xeUtils.default.getWhatDay(a,6):e,0,"first");_xeUtils.default.isEqual(n,t.selectMonth)||(t.selectMonth=n)},dateChange:function(t){var e,a,n=this,i=n,r=n.reactData,u=i.multiple,l=r.datetimePanelValue,r=n.computeIsDateTimeType,s=n.computeDateValueFormat,o=n.computeFirstDayOfWeek,c=("week"===i.type?(e=_xeUtils.default.toNumber(i.selectDay),t=_xeUtils.default.getWhatWeek(t,0,e,o)):r&&(t.setHours(l.getHours()),t.setMinutes(l.getMinutes()),t.setSeconds(l.getSeconds())),_xeUtils.default.toDateString(t,s,{firstDay:o}));n.dateCheckMonth(t),u?(e=n.computeDateMultipleValue,r?(o=_toConsumableArray(n.computeDateListValue),a=[],-1===(u=_xeUtils.default.findIndexOf(o,function(e){return _xeUtils.default.isDateSame(t,e,"yyyyMMdd")}))?o.push(t):o.splice(u,1),o.forEach(function(e){e&&(e.setHours(l.getHours()),e.setMinutes(l.getMinutes()),e.setSeconds(l.getSeconds()),a.push(e))}),n.handleChange(a.map(function(e){return _xeUtils.default.toDateString(e,s)}).join(","),{type:"update"})):e.some(function(e){return _xeUtils.default.isEqual(e,c)})?n.handleChange(e.filter(function(e){return!_xeUtils.default.isEqual(e,c)}).join(","),{type:"update"}):n.handleChange(e.concat([c]).join(","),{type:"update"})):_xeUtils.default.isEqual(i.value,c)||n.handleChange(c,{type:"update"})},afterCheckValue:function(){var e,t=this,a=t.reactData,n=t.type,i=t.min,r=t.max,u=t.exponential,l=a.inputValue,s=a.datetimePanelValue,o=t.computeIsDatePickerType,c=t.computeDateLabelFormat;t.computeInputReadonly||(t.computeIsNumType?l&&((e="".concat((0,_util2.handleNumber)(l)))?(e="integer"===n?_xeUtils.default.toInteger(e):_xeUtils.default.toNumber(e),t.validMinNum(e)?t.validMaxNum(e)||(e=r):e=i,u&&(r=_xeUtils.default.toValueString(l).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=r),t.handleChange(t.getNumberValue(e),{type:"check"})):(u="",!i&&0!==i||(u="".concat(i)),t.handleChange(u,{type:"check"}))):o&&(l?(r=t.parseDate(l,c),_xeUtils.default.isValidDate(r)?"time"===n?(l!==(r=_xeUtils.default.toDateString(r,c))&&t.handleChange(r,{type:"check"}),a.inputValue=r):(e=!1,i=t.computeFirstDayOfWeek,"datetime"===n?(u=t.computeDateValue,l===_xeUtils.default.toDateString(u,c)&&l===_xeUtils.default.toDateString(r,c)||(e=!0,s.setHours(r.getHours()),s.setMinutes(r.getMinutes()),s.setSeconds(r.getSeconds()))):e=!0,a.inputValue=_xeUtils.default.toDateString(r,c,{firstDay:i}),e&&t.dateChange(r)):t.dateRevert()):t.handleChange("",{type:"check"})))},passwordToggleEvent:function(e){var t=this.reactData,a=t.showPwd,n=this.computeIsDisabled,i=this.computeInputReadonly;n||i||(t.showPwd=!a),this.dispatchEvent("toggle-visible",{visible:t.showPwd},e)},searchEvent:function(e){this.dispatchEvent("search-click",{},e)},numberChange:function(e,t){var a=this,n=a.reactData,i=a.min,r=a.max,n=n.inputValue,u=a.computeStepValue,n="integer"===a.type?_xeUtils.default.toInteger((0,_util2.handleNumber)(n)):_xeUtils.default.toNumber((0,_util2.handleNumber)(n)),e=e?_xeUtils.default.add(n,u):_xeUtils.default.subtract(n,u),n=a.validMinNum(e)?a.validMaxNum(e)?e:r:i;a.emitInputEvent(a.getNumberValue(n),t)},numberNextEvent:function(e){var t=this,a=t.reactData,n=t.computeIsDisabled,i=t.computeInputReadonly,r=t.computeIsDisabledSubtractNumber;t.numberStopDown(),n||i||r||t.numberChange(!1,e),t.dispatchEvent("next-number",{value:a.inputValue},e)},numberDownNextEvent:function(e){var t=this;t.internalData.dnTimeout=setTimeout(function(){t.numberNextEvent(e),t.numberDownNextEvent(e)},60)},numberPrevEvent:function(e){var t=this,a=t.reactData,n=t.computeIsDisabled,i=t.computeInputReadonly,r=t.computeIsDisabledAddNumber;t.numberStopDown(),n||i||r||t.numberChange(!0,e),t.dispatchEvent("prev-number",{value:a.inputValue},e)},numberKeydownEvent:function(e){var t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),a=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN);(t||a)&&(e.preventDefault(),t?this.numberPrevEvent(e):this.numberNextEvent(e))},keydownEvent:function(e){var t,a,n,i,r,u,l,s=this,o=s.type,c=s.exponential,d=s.controls;s.computeIsNumType&&(t=(0,_dom.hasControlKey)(e),a=e.shiftKey,n=e.altKey,i=e.keyCode,r=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),u=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),l=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN),t||a||n||(_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.SPACEBAR)||"integer"===o&&110===i||(!c||69!==i)&&65<=i&&i<=90||186<=i&&i<=188||191<=i)&&e.preventDefault(),r?s.afterCheckValue():(u||l)&&d&&s.numberKeydownEvent(e)),s.triggerEvent(e)},keyupEvent:function(e){this.triggerEvent(e)},numberStopDown:function(){var e=this.internalData,t=e.dnTimeout;t&&(clearTimeout(t),e.dnTimeout=void 0)},numberDownPrevEvent:function(e){var t=this;t.internalData.dnTimeout=setTimeout(function(){t.numberPrevEvent(e),t.numberDownPrevEvent(e)},60)},numberMousedownEvent:function(e){var t,a=this,n=a.internalData;a.numberStopDown(),0===e.button&&((t=(0,_dom.hasClass)(e.currentTarget,"is--prev"))?a.numberPrevEvent(e):a.numberNextEvent(e),n.dnTimeout=setTimeout(function(){t?a.numberDownPrevEvent(e):a.numberDownNextEvent(e)},500))},wheelEvent:function(e){var t=this,a=t.reactData;t.computeIsNumType&&t.controls&&a.isActivated&&(0<(a=e.deltaY)?t.numberNextEvent(e):a<0&&t.numberPrevEvent(e),e.preventDefault()),t.triggerEvent(e)},dateMonthHandle:function(e,t){var a=this.reactData,n=this.computeFirstDayOfWeek,i=_xeUtils.default.getYearWeek(e,n),n=_xeUtils.default.getWhatWeek(e,0,n,n),i=_xeUtils.default.getWhatMonth(1===i?_xeUtils.default.getWhatDay(n,6):e,t,"first");a.selectMonth=i},dateNowHandle:function(){var e=this.reactData,t=_xeUtils.default.getWhatDay(Date.now(),0,"first");e.currentDate=t,this.dateMonthHandle(t,0)},dateToggleYearTypeEvent:function(){this.reactData.datePanelType="year"},dateToggleMonthTypeEvent:function(){var e=this.reactData,t="month"===(t=e.datePanelType)||"quarter"===t?"year":"month";e.datePanelType=t},datePrevEvent:function(e){var t=this,a=t.reactData,n=t.type,i=a.datePanelType,r=a.selectMonth,u=t.internalData.yearSize,l=a.inputValue;t.computeIsDisabledPrevDateBtn||(u="year"===n?_xeUtils.default.getWhatYear(r,-u,"first"):"month"===n||"quarter"===n?"year"===i?_xeUtils.default.getWhatYear(r,-u,"first"):_xeUtils.default.getWhatYear(r,-1,"first"):"year"===i?_xeUtils.default.getWhatYear(r,-u,"first"):"month"===i?_xeUtils.default.getWhatYear(r,-1,"first"):_xeUtils.default.getWhatMonth(r,-1,"first"),a.selectMonth=u,t.dispatchEvent("date-prev",{viewType:i,viewDate:u,value:l,type:n},e))},dateTodayMonthEvent:function(e){var t=this,a=t,n=t.reactData;t.dateNowHandle(),a.multiple||(t.dateChange(n.currentDate),t.hidePanel()),t.dispatchEvent("date-today",{type:a.type},e)},dateNextEvent:function(e){var t=this,a=t.reactData,n=t.type,i=a.datePanelType,r=a.selectMonth,u=t.internalData.yearSize,l=a.inputValue;t.computeIsDisabledNextDateBtn||(u="year"===n?_xeUtils.default.getWhatYear(r,u,"first"):"month"===n||"quarter"===n?"year"===i?_xeUtils.default.getWhatYear(r,u,"first"):_xeUtils.default.getWhatYear(r,1,"first"):"year"===i?_xeUtils.default.getWhatYear(r,u,"first"):"month"===i?_xeUtils.default.getWhatYear(r,1,"first"):_xeUtils.default.getWhatMonth(r,1,"first"),a.selectMonth=u,t.dispatchEvent("date-next",{viewType:i,viewDate:u,value:l,type:n},e))},isDateDisabled:function(e){var t=this,a=t.reactData,n=t.disabledMethod,a=a.datePanelType,i=t.computeDateStartTime,r=t.computeDateEndTime,e=e.date;return!!(i&&i.getTime()>e.getTime())||!!(r&&r.getTime()<e.getTime())||!!n&&n({type:a,viewType:a,date:e,$input:t})},dateSelectItem:function(e){var t=this,a=t.reactData,n=t.type,i=t.multiple,r=a.datePanelType;"month"===n?"year"===r?(a.datePanelType="month",t.dateCheckMonth(e)):(t.dateChange(e),i||t.hidePanel()):"year"===n?(t.dateChange(e),i||t.hidePanel()):"quarter"===n?"year"===r?(a.datePanelType="quarter",t.dateCheckMonth(e)):(t.dateChange(e),i||t.hidePanel()):"month"===r?(a.datePanelType="week"===n?n:"day",t.dateCheckMonth(e)):"year"===r?(a.datePanelType="month",t.dateCheckMonth(e)):(t.dateChange(e),"datetime"===n||i||t.hidePanel())},dateSelectEvent:function(e){this.isDateDisabled(e)||this.dateSelectItem(e.date)},dateMoveDay:function(t){this.isDateDisabled({date:t})||(this.computeDayList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyMMdd")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveYear:function(t){this.isDateDisabled({date:t})||(this.computeYearList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyy")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveQuarter:function(t){this.isDateDisabled({date:t})||(this.computeQuarterList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyq")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveMonth:function(t){this.isDateDisabled({date:t})||(this.computeMonthList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyMM")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMouseenterEvent:function(e){var t=this,a=t.reactData;t.isDateDisabled(e)||("month"===(a=a.datePanelType)?t.dateMoveMonth(e.date):"quarter"===a?t.dateMoveQuarter(e.date):"year"===a?t.dateMoveYear(e.date):t.dateMoveDay(e.date))},updateTimePos:function(e){var t;e&&(t=e.offsetHeight,e.parentNode.scrollTop=e.offsetTop-4*t)},dateTimeChangeEvent:function(e){var t=this.reactData;t.datetimePanelValue=new Date(t.datetimePanelValue.getTime()),this.updateTimePos(e.currentTarget)},dateHourEvent:function(e,t){this.reactData.datetimePanelValue.setHours(t.value),this.dateTimeChangeEvent(e)},dateConfirmEvent:function(){var t,a,e=this,n=e.reactData,i=e.multiple,r=n.datetimePanelValue,u=e.computeDateValue,l=e.computeIsDateTimeType;l&&(t=e.computeDateValueFormat,i?(i=e.computeDateMultipleValue,l?(l=_toConsumableArray(e.computeDateListValue),a=[],l.forEach(function(e){e&&(e.setHours(r.getHours()),e.setMinutes(r.getMinutes()),e.setSeconds(r.getSeconds()),a.push(e))}),e.handleChange(a.map(function(e){return _xeUtils.default.toDateString(e,t)}).join(","),{type:"update"})):e.handleChange(i.join(","),{type:"update"})):e.dateChange(u||n.currentDate)),e.hidePanel()},dateMinuteEvent:function(e,t){this.reactData.datetimePanelValue.setMinutes(t.value),this.dateTimeChangeEvent(e)},dateSecondEvent:function(e,t){this.reactData.datetimePanelValue.setSeconds(t.value),this.dateTimeChangeEvent(e)},dateOffsetEvent:function(e){var t,a,n,i=this,r=i.reactData,u=r.isActivated,l=r.datePanelValue,r=r.datePanelType;u&&(e.preventDefault(),u=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_LEFT),t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),a=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_RIGHT),e=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN),"year"===r?(n=_xeUtils.default.getWhatYear(l||Date.now(),0,"first"),u?n=_xeUtils.default.getWhatYear(n,-1):t?n=_xeUtils.default.getWhatYear(n,-4):a?n=_xeUtils.default.getWhatYear(n,1):e&&(n=_xeUtils.default.getWhatYear(n,4)),i.dateMoveYear(n)):"quarter"===r?(n=_xeUtils.default.getWhatQuarter(l||Date.now(),0,"first"),u?n=_xeUtils.default.getWhatQuarter(n,-1):t?n=_xeUtils.default.getWhatQuarter(n,-2):a?n=_xeUtils.default.getWhatQuarter(n,1):e&&(n=_xeUtils.default.getWhatQuarter(n,2)),i.dateMoveQuarter(n)):"month"===r?(n=_xeUtils.default.getWhatMonth(l||Date.now(),0,"first"),u?n=_xeUtils.default.getWhatMonth(n,-1):t?n=_xeUtils.default.getWhatMonth(n,-4):a?n=_xeUtils.default.getWhatMonth(n,1):e&&(n=_xeUtils.default.getWhatMonth(n,4)),i.dateMoveMonth(n)):(r=l||_xeUtils.default.getWhatDay(Date.now(),0,"first"),n=i.computeFirstDayOfWeek,u?r=_xeUtils.default.getWhatDay(r,-1):t?r=_xeUtils.default.getWhatWeek(r,-1,n):a?r=_xeUtils.default.getWhatDay(r,1):e&&(r=_xeUtils.default.getWhatWeek(r,1,n)),i.dateMoveDay(r)))},datePgOffsetEvent:function(e){var t;this.reactData.isActivated&&(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.PAGE_UP),e.preventDefault(),t?this.datePrevEvent(e):this.dateNextEvent(e))},dateOpenPanel:function(){var t=this,e=t.reactData,a=t.type,n=t.computeIsDateTimeType,i=t.computeDateValue;-1<["year","quarter","month","week"].indexOf(a)?e.datePanelType=a:e.datePanelType="day",e.currentDate=_xeUtils.default.getWhatDay(Date.now(),0,"first"),i?(t.dateMonthHandle(i,0),t.dateParseValue(i)):t.dateNowHandle(),n&&(e.datetimePanelValue=e.datePanelValue||_xeUtils.default.getWhatDay(Date.now(),0,"first"),t.$nextTick(function(){var e=t.$refs.refInputTimeBody;_xeUtils.default.arrayEach(e.querySelectorAll("li.is--selected"),function(e){t.updateTimePos(e)})}))},updateZindex:function(){var e=this.reactData;e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){var p=this,m=p,f=p.reactData;return p.$nextTick().then(function(){var e,t,a,n,i,r,u,l=m.placement,s=f.panelIndex,o=p.$refs.refInputTarget,c=p.$refs.refInputPanel,d=p.computeBtnTransfer;if(o&&c)return e=o.offsetHeight,t=o.offsetWidth,a=c.offsetHeight,c=c.offsetWidth,s={zIndex:s},n=(o=(0,_dom.getAbsolutePos)(o)).boundingTop,i=o.visibleHeight,r=o.visibleWidth,u="bottom",d?(d=n+e,"top"===l?(u="top",d=n-a):l||(i<d+a+5&&(u="top",d=n-a),d<5&&(u="bottom",d=n+e)),r<(o=o.boundingLeft)+c+5&&(o-=o+c+5-r),o<5&&(o=5),Object.assign(s,{left:"".concat(o,"px"),top:"".concat(d,"px"),minWidth:"".concat(t,"px")})):"top"===l?(u="top",s.bottom="".concat(e,"px")):l||(s.top="".concat(e,"px"),i<n+e+a&&5<n-e-a&&(u="top",s.top="",s.bottom="".concat(e,"px"))),f.panelStyle=s,f.panelPlacement=u,p.$nextTick()})},showPanel:function(){var e=this,t=e.reactData,a=e.internalData,n=t.visiblePanel,i=a.hpTimeout,r=e.computeIsDatePickerType,u=e.computeBtnTransfer;return e.computeIsDisabled||n?e.$nextTick():(n=e.$refs.refInputPanel,t.initialized||(t.initialized=!0,u&&n&&document.body.appendChild(n)),i&&(clearTimeout(i),a.hpTimeout=void 0),t.isActivated=!0,t.isAniVisible=!0,r&&e.dateOpenPanel(),setTimeout(function(){t.visiblePanel=!0},10),e.updateZindex(),e.updatePlacement())},datePickerOpenEvent:function(e){this.computeInputReadonly||(e.preventDefault(),this.showPanel())},clickEvent:function(e){this.triggerEvent(e)},handleGlobalMousedownEvent:function(e){var t=this,a=t.reactData,n=a.visiblePanel,i=t.computeIsDatePickerType,r=t.$refs.refElem,u=t.$refs.refPanelWrapper;!t.computeIsDisabled&&a.isActivated&&(a.isActivated=(0,_dom.getEventTargetNode)(e,r).flag||(0,_dom.getEventTargetNode)(e,u).flag,a.isActivated||(i?n&&(t.hidePanel(),t.afterCheckValue()):t.afterCheckValue()))},handleGlobalKeydownEvent:function(e){var t,a,n,i,r,u,l,s,o,c,d=this,p=d.reactData,m=d.clearable,f=p.visiblePanel,h=d.computeIsDatePickerType;d.computeIsDisabled||(t=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.TAB),a=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.DELETE),n=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ESCAPE),i=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ENTER),o=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_LEFT),r=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_UP),c=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_RIGHT),u=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.ARROW_DOWN),l=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.PAGE_UP),s=_ui.globalEvents.hasKey(e,_ui.GLOBAL_EVENT_KEYS.PAGE_DOWN),o=o||r||c||u,c=p.isActivated,t?(c&&d.afterCheckValue(),p.isActivated=c=!1):o?h&&c&&(f?d.dateOffsetEvent(e):(r||u)&&d.datePickerOpenEvent(e)):i?h&&(f?p.datePanelValue?d.dateSelectItem(p.datePanelValue):d.hidePanel():c&&d.datePickerOpenEvent(e)):(l||s)&&h&&c&&d.datePgOffsetEvent(e),t||n?f&&d.hidePanel():a&&m&&c&&d.clearValueEvent(e,null))},handleGlobalMousewheelEvent:function(e){var t=this,a=t.reactData.visiblePanel;t.computeIsDisabled||a&&(a=t.$refs.refPanelWrapper,(0,_dom.getEventTargetNode)(e,a).flag?t.updatePlacement():(t.hidePanel(),t.afterCheckValue()))},handleGlobalBlurEvent:function(){var e=this.reactData,t=e.isActivated;e.visiblePanel&&this.hidePanel(),t&&(e.isActivated=!1),t&&(this.afterCheckValue(),e=this.$refs.refInputTarget)&&e.blur()},renderDateLabel:function(t,e,a){var n=this.reactData,i=this.festivalMethod;return i?(e=(i=(n=i({type:i=n.datePanelType,viewType:i,date:e.date,$input:this}))?_xeUtils.default.isString(n)?{label:n}:n:{}).extra?_xeUtils.default.isString(i.extra)?{label:i.extra}:i.extra:null,n=[t("span",{class:["vxe-input--date-label",{"is-notice":i.notice}]},e&&e.label?[t("span","".concat(a||"")),t("span",{class:["vxe-input--date-label--extra",e.important?"is-important":"",e.className],style:e.style},_xeUtils.default.toValueString(e.label))]:["".concat(a||"")])],(e=i.label)&&(e=_xeUtils.default.toValueString(e).split(","),n.push(t("span",{class:["vxe-input--date-festival",i.important?"is-important":"",i.className],style:i.style},[1<e.length?t("span",{class:["vxe-input--date-festival--overlap","overlap--".concat(e.length)]},e.map(function(e){return t("span",e.substring(0,3))})):t("span",{class:"vxe-input--date-festival--label"},e[0].substring(0,3))]))),n):["".concat(a||"")]},renderDateDayTable:function(a){var n=this,e=n.reactData,i=n.multiple,t=e.datePanelType,r=e.datePanelValue,u=n.computeDateValue,e=n.computeDateHeaders,l=n.computeDayDatas,s=n.computeDateListValue,o="yyyyMMdd";return[a("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("thead",[a("tr",e.map(function(e){return a("th",e.label)}))]),a("tbody",l.map(function(e){return a("tr",e.map(function(t){return a("td",{class:{"is--prev":t.isPrev,"is--current":t.isCurrent,"is--now":t.isNow,"is--next":t.isNext,"is--disabled":n.isDateDisabled(t),"is--selected":i?s.some(function(e){return _xeUtils.default.isDateSame(e,t.date,o)}):_xeUtils.default.isDateSame(u,t.date,o),"is--hover":_xeUtils.default.isDateSame(r,t.date,o)},on:{click:function(){return n.dateSelectEvent(t)},mouseenter:function(){return n.dateMouseenterEvent(t)}}},n.renderDateLabel(a,t,t.label))}))}))])]},renderDateWeekTable:function(n){var i=this,e=i.reactData,r=i.multiple,t=e.datePanelType,u=e.datePanelValue,l=i.computeDateValue,e=i.computeWeekHeaders,a=i.computeWeekDates,s=i.computeDateListValue,o="yyyyMMdd";return[n("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[n("thead",[n("tr",e.map(function(e){return n("th",e.label)}))]),n("tbody",a.map(function(e){var t=r?e.some(function(t){return s.some(function(e){return _xeUtils.default.isDateSame(e,t.date,o)})}):e.some(function(e){return _xeUtils.default.isDateSame(l,e.date,o)}),a=e.some(function(e){return _xeUtils.default.isDateSame(u,e.date,o)});return n("tr",e.map(function(e){return n("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":i.isDateDisabled(e),"is--selected":t,"is--hover":a},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},i.renderDateLabel(n,e,e.label))}))}))])]},renderDateMonthTable:function(a){var n=this,e=n.reactData,i=n.multiple,t=e.datePanelType,r=e.datePanelValue,u=n.computeDateValue,e=n.computeMonthDatas,l=n.computeDateListValue,s="yyyyMM";return[a("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("tbody",e.map(function(e){return a("tr",e.map(function(t){return a("td",{class:{"is--prev":t.isPrev,"is--current":t.isCurrent,"is--now":t.isNow,"is--next":t.isNext,"is--disabled":n.isDateDisabled(t),"is--selected":i?l.some(function(e){return _xeUtils.default.isDateSame(e,t.date,s)}):_xeUtils.default.isDateSame(u,t.date,s),"is--hover":_xeUtils.default.isDateSame(r,t.date,s)},on:{click:function(){return n.dateSelectEvent(t)},mouseenter:function(){return n.dateMouseenterEvent(t)}}},n.renderDateLabel(a,t,(0,_ui.getI18n)("vxe.input.date.months.m".concat(t.month))))}))}))])]},renderDateQuarterTable:function(a){var n=this,e=n.reactData,i=n.multiple,t=e.datePanelType,r=e.datePanelValue,u=n.computeDateValue,e=n.computeQuarterDatas,l=n.computeDateListValue,s="yyyyq";return[a("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("tbody",e.map(function(e){return a("tr",e.map(function(t){return a("td",{class:{"is--prev":t.isPrev,"is--current":t.isCurrent,"is--now":t.isNow,"is--next":t.isNext,"is--disabled":n.isDateDisabled(t),"is--selected":i?l.some(function(e){return _xeUtils.default.isDateSame(e,t.date,s)}):_xeUtils.default.isDateSame(u,t.date,s),"is--hover":_xeUtils.default.isDateSame(r,t.date,s)},on:{click:function(){return n.dateSelectEvent(t)},mouseenter:function(){return n.dateMouseenterEvent(t)}}},n.renderDateLabel(a,t,(0,_ui.getI18n)("vxe.input.date.quarters.q".concat(t.quarter))))}))}))])]},renderDateYearTable:function(a){var n=this,e=n.reactData,i=n.multiple,t=e.datePanelType,r=e.datePanelValue,u=n.computeDateValue,e=n.computeYearDatas,l=n.computeDateListValue,s="yyyy";return[a("table",{class:"vxe-input--date-".concat(t,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("tbody",e.map(function(e){return a("tr",e.map(function(t){return a("td",{class:{"is--prev":t.isPrev,"is--current":t.isCurrent,"is--now":t.isNow,"is--next":t.isNext,"is--disabled":n.isDateDisabled(t),"is--selected":i?l.some(function(e){return _xeUtils.default.isDateSame(e,t.date,s)}):_xeUtils.default.isDateSame(u,t.date,s),"is--hover":_xeUtils.default.isDateSame(r,t.date,s)},on:{click:function(){return n.dateSelectEvent(t)},mouseenter:function(){return n.dateMouseenterEvent(t)}}},n.renderDateLabel(a,t,t.year))}))}))])]},renderDateTable:function(e){var t=this;switch(t.reactData.datePanelType){case"week":return t.renderDateWeekTable(e);case"month":return t.renderDateMonthTable(e);case"quarter":return t.renderDateQuarterTable(e);case"year":return t.renderDateYearTable(e)}return t.renderDateDayTable(e)},renderDatePanel:function(e){var t=this,a=t.reactData,n=t.multiple,a=a.datePanelType,i=t.computeIsDisabledPrevDateBtn,r=t.computeIsDisabledNextDateBtn,u=t.computeSelectDatePanelObj;return[e("div",{class:"vxe-input--date-picker-header"},[e("div",{class:"vxe-input--date-picker-type-wrapper"},["year"===a?e("span",{class:"vxe-input--date-picker-label"},u.y):e("span",{class:"vxe-input--date-picker-btns"},[e("span",{class:"vxe-input--date-picker-btn",on:{click:t.dateToggleYearTypeEvent}},u.y),u.m?e("span",{class:"vxe-input--date-picker-btn",on:{click:t.dateToggleMonthTypeEvent}},u.m):(0,_ui.renderEmptyElement)(t)])]),e("div",{class:"vxe-input--date-picker-btn-wrapper"},[e("span",{class:["vxe-input--date-picker-btn vxe-input--date-picker-prev-btn",{"is--disabled":i}],on:{click:t.datePrevEvent}},[e("i",{class:"vxe-icon-caret-left"})]),e("span",{class:"vxe-input--date-picker-btn vxe-input--date-picker-current-btn",on:{click:t.dateTodayMonthEvent}},[e("i",{class:"vxe-icon-dot"})]),e("span",{class:["vxe-input--date-picker-btn vxe-input--date-picker-next-btn",{"is--disabled":r}],on:{click:t.dateNextEvent}},[e("i",{class:"vxe-icon-caret-right"})]),n&&t.computeSupportMultiples?e("span",{class:"vxe-input--date-picker-btn vxe-input--date-picker-confirm-btn"},[e("button",{class:"vxe-input--date-picker-confirm",attrs:{type:"button"},on:{click:t.dateConfirmEvent}},(0,_ui.getI18n)("vxe.button.confirm"))]):null])]),e("div",{class:"vxe-input--date-picker-body"},t.renderDateTable(e))]},renderTimePanel:function(a){var n=this,i=n.reactData.datetimePanelValue,e=n.computeHourList,t=n.computeHasTimeMinute,r=n.computeMinuteList,u=n.computeHasTimeSecond,l=n.computeSecondList;return[a("div",{class:"vxe-input--time-picker-header"},[t?a("span",{class:"vxe-input--time-picker-title"},n.computeDateTimeLabel):(0,_ui.renderEmptyElement)(n),a("div",{class:"vxe-input--time-picker-btn"},[a("button",{class:"vxe-input--time-picker-confirm",attrs:{type:"button"},on:{click:n.dateConfirmEvent}},(0,_ui.getI18n)("vxe.button.confirm"))])]),a("div",{ref:"refInputTimeBody",class:"vxe-input--time-picker-body"},[a("ul",{class:"vxe-input--time-picker-hour-list"},e.map(function(t,e){return a("li",{key:e,class:{"is--selected":i&&i.getHours()===t.value},on:{click:function(e){return n.dateHourEvent(e,t)}}},t.label)})),t?a("ul",{class:"vxe-input--time-picker-minute-list"},r.map(function(t,e){return a("li",{key:e,class:{"is--selected":i&&i.getMinutes()===t.value},on:{click:function(e){return n.dateMinuteEvent(e,t)}}},t.label)})):(0,_ui.renderEmptyElement)(n),t&&u?a("ul",{class:"vxe-input--time-picker-second-list"},l.map(function(t,e){return a("li",{key:e,class:{"is--selected":i&&i.getSeconds()===t.value},on:{click:function(e){return n.dateSecondEvent(e,t)}}},t.label)})):(0,_ui.renderEmptyElement)(n)])]},renderPanel:function(e){var t=this,a=t.reactData,n=t.type,i=a.initialized,r=a.isAniVisible,u=a.visiblePanel,l=a.panelPlacement,a=a.panelStyle,s=t.computeSize,o=t.computeBtnTransfer,c=[];return t.computeIsDatePickerType?(c.push("datetime"===n?e("div",{key:n,ref:"refPanelWrapper",class:"vxe-input--panel-layout-wrapper"},[e("div",{class:"vxe-input--panel-left-wrapper"},t.renderDatePanel(e)),e("div",{class:"vxe-input--panel-right-wrapper"},t.renderTimePanel(e))]):"time"===n?e("div",{key:n,ref:"refPanelWrapper",class:"vxe-input--panel-wrapper"},t.renderTimePanel(e)):e("div",{key:n||"default",ref:"refPanelWrapper",class:"vxe-input--panel-wrapper"},t.renderDatePanel(e))),e("div",{ref:"refInputPanel",class:["vxe-table--ignore-clear vxe-input--panel","type--".concat(n),_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(s),s),"is--transfer",o),"ani--leave",r),"ani--enter",u)],attrs:{placement:l},style:a},i&&(u||r)?c:[])):(0,_ui.renderEmptyElement)(t)},renderNumberIcon:function(e){var t=this,a=t.computeIsDisabledAddNumber,n=t.computeIsDisabledSubtractNumber;return e("div",{class:"vxe-input--control-icon"},[e("div",{class:"vxe-input--number-icon"},[e("div",{class:["vxe-input--number-btn is--prev",{"is--disabled":a}],on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:(0,_ui.getIcon)().INPUT_PLUS_NUM})]),e("div",{class:["vxe-input--number-btn is--next",{"is--disabled":n}],on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:(0,_ui.getIcon)().INPUT_MINUS_NUM})])])])},renderDatePickerIcon:function(e){return e("div",{class:"vxe-input--control-icon",on:{click:this.datePickerOpenEvent}},[e("i",{class:["vxe-input--date-picker-icon",(0,_ui.getIcon)().DATE_PICKER_DATE]})])},renderSearchIcon:function(e){return e("div",{class:"vxe-input--control-icon",on:{click:this.searchEvent}},[e("i",{class:["vxe-input--search-icon",(0,_ui.getIcon)().INPUT_SEARCH]})])},renderPasswordIcon:function(e){var t=this.reactData.showPwd;return e("div",{class:"vxe-input--control-icon",on:{click:this.passwordToggleEvent}},[e("i",{class:["vxe-input--password-icon",t?(0,_ui.getIcon)().PASSWORD_INPUT_SHOW_PWD:(0,_ui.getIcon)().PASSWORD_INPUT_HIDE_PWD]})])},renderPrefixIcon:function(e){var t=this,a=t.$scopedSlots,n=t.prefixIcon,i=t.computePrefixOpts,a=a.prefix,n=n||i.icon,i=i.content;return a||n||i?e("div",{class:"vxe-input--prefix",on:{click:t.clickPrefixEvent}},[e("div",{class:"vxe-input--prefix-icon"},a?(0,_vn.getSlotVNs)(a({})):[n?e("i",{class:n}):(0,_ui.renderEmptyElement)(t),i?e("span",{class:"vxe-input--prefix-text"},"".concat(i)):(0,_ui.renderEmptyElement)(t)])]):null},renderSuffixIcon:function(e){var t=this,a=t.$scopedSlots,n=t.suffixIcon,i=t.reactData.inputValue,a=a.suffix,r=t.computeSuffixOpts,u=t.computeIsClearable,l=t.computeIsPawdType||t.computeIsNumType||t.computeIsDatePickerType||t.computeIsSearchType,n=n||r.icon,r=r.content;return u||a||n||r||l?e("div",{class:["vxe-input--suffix",{"is--clear":u&&!t.computeIsDisabled&&!(""===i||_xeUtils.default.eqNull(i))}]},[u?e("div",{class:"vxe-input--clear-icon",on:{click:t.clearValueEvent}},[e("i",{class:(0,_ui.getIcon)().INPUT_CLEAR})]):(0,_ui.renderEmptyElement)(t),l?t.renderExtraSuffixIcon(e):(0,_ui.renderEmptyElement)(t),a||n||r?e("div",{class:"vxe-input--suffix-icon",on:{click:t.clickSuffixEvent}},a?(0,_vn.getSlotVNs)(a({})):[n?e("i",{class:n}):(0,_ui.renderEmptyElement)(t),r?e("span",{class:"vxe-input--suffix-text"},"".concat(r)):(0,_ui.renderEmptyElement)(t)]):(0,_ui.renderEmptyElement)(t)]):null},renderExtraSuffixIcon:function(e){var t=this,a=t.controls,n=t.computeIsNumType,i=t.computeIsDatePickerType,r=t.computeIsSearchType;return t.computeIsPawdType?t.renderPasswordIcon(e):n&&a?t.renderNumberIcon(e):i?t.renderDatePickerIcon(e):r?t.renderSearchIcon(e):(0,_ui.renderEmptyElement)(t)},renderVN:function(e){var t,a,n,i,r,u,l,s,o,c=this,d=c.reactData,p=c.className,m=c.controls,f=c.type,h=c.title,v=c.align,y=c.showWordCount,g=c.countMethod,D=c.name,x=c.autoComplete,_=c.autocomplete,b=d.inputValue,E=d.visiblePanel,d=d.isActivated,P=c.computeSize,T=c.computeIsDisabled;return c.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-input--readonly","type--".concat(f),p]},b):(t=c.computeIsCountError,a=c.computeInputCount,n=c.computeInputReadonly,i=c.computeInpMaxLength,r=c.computeInputType,u=c.computeInpPlaceholder,l=c.computeIsClearable,y=y&&["text","search"].includes(f),s=c.renderPrefixIcon(e),o=c.renderSuffixIcon(e),e("div",{ref:"refElem",class:["vxe-input","type--".concat(f),p,_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(P),P),"is--".concat(v),v),"is--controls",m),"is--prefix",!!s),"is--suffix",!!o),"is--visible",E),"is--count",y),"is--disabled",T),"is--active",d),"show--clear",l&&!T&&!(""===b||_xeUtils.default.eqNull(b)))],attrs:{spellcheck:!1}},[s||(0,_ui.renderEmptyElement)(c),e("div",{class:"vxe-input--wrapper",attrs:h?{title:h}:void 0},[e("input",{ref:"refInputTarget",class:"vxe-input--inner",domProps:{value:b},attrs:{name:D,type:r,placeholder:u,maxlength:i,readonly:n,disabled:T,autocomplete:x||_},on:{keydown:c.keydownEvent,keyup:c.keyupEvent,click:c.clickEvent,input:c.inputEvent,change:c.changeEvent,focus:c.focusEvent,blur:c.blurEvent}})]),o||(0,_ui.renderEmptyElement)(c),c.renderPanel(e),y?e("span",{class:["vxe-input--count",{"is--error":t}]},g?"".concat(g({value:b})):"".concat(a).concat(i?"/".concat(i):"")):(0,_ui.renderEmptyElement)(c)]))}},watch:{value:function(e){this.reactData.inputValue=e,this.changeValue()},type:function(){var e=this.reactData;Object.assign(e,{inputValue:this.value,datetimePanelValue:null,datePanelValue:null,datePanelLabel:"",datePanelType:"day",selectMonth:null,currentDate:null}),this.initValue()},computeDateLabelFormat:function(){var e=this,t=e,a=e.reactData;e.computeIsDatePickerType&&(e.dateParseValue(a.datePanelValue),a.inputValue=t.multiple?e.computeDateMultipleLabel:a.datePanelLabel)}},created:function(){this.reactData.inputValue=this.value,this.initValue()},mounted:function(){var e=this,t=e.type,t=(["date","time","datetime","week","month","quarter","year"].includes(t)?warnLog("vxe.error.useNew",['<vxe-input type="'.concat(t,'" ... />'),'<vxe-date-picker type="'.concat(t,'" ... />')]):["number","integer","float"].includes(t)?warnLog("vxe.error.useNew",['<vxe-input type="'.concat(t,'" ... />'),'<vxe-number-input type="'.concat(t,'" ... />')]):["password"].includes(t)&&warnLog("vxe.error.useNew",['<vxe-input type="'.concat(t,'" ... />'),"<vxe-password-input ... />"]),e.$refs.refInputTarget);t&&t.addEventListener("wheel",e.wheelEvent,{passive:!1}),_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.refInputPanel,t=(t&&t.parentNode&&t.parentNode.removeChild(t),e.numberStopDown(),e.afterCheckValue(),e.$refs.refInputTarget);t&&t.removeEventListener("wheel",e.wheelEvent),_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)}});
|
package/lib/list/src/list.js
CHANGED
|
@@ -2018,23 +2018,18 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
2018
2018
|
}
|
|
2019
2019
|
return (0, _ui.renderEmptyElement)($xeList);
|
|
2020
2020
|
},
|
|
2021
|
-
renderRadio: function renderRadio(h, row, rowid, isChecked) {
|
|
2021
|
+
renderRadio: function renderRadio(h, row, rowid, isDisabled, isChecked) {
|
|
2022
2022
|
var $xeList = this;
|
|
2023
2023
|
var props = $xeList;
|
|
2024
2024
|
var showRadio = props.showRadio;
|
|
2025
2025
|
var radioOpts = $xeList.computeRadioOpts;
|
|
2026
2026
|
var showIcon = radioOpts.showIcon,
|
|
2027
|
-
checkMethod = radioOpts.checkMethod,
|
|
2028
2027
|
visibleMethod = radioOpts.visibleMethod;
|
|
2029
2028
|
var isVisible = !visibleMethod || visibleMethod({
|
|
2030
2029
|
$list: $xeList,
|
|
2031
2030
|
row: row
|
|
2032
2031
|
});
|
|
2033
2032
|
if (showRadio && showIcon && isVisible) {
|
|
2034
|
-
var isDisabled = checkMethod ? !checkMethod({
|
|
2035
|
-
$list: $xeList,
|
|
2036
|
-
row: row
|
|
2037
|
-
}) : false;
|
|
2038
2033
|
return h('div', {
|
|
2039
2034
|
key: 'ct2',
|
|
2040
2035
|
class: ['vxe-list--radio-option', {
|
|
@@ -2054,23 +2049,18 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
2054
2049
|
}
|
|
2055
2050
|
return (0, _ui.renderEmptyElement)($xeList);
|
|
2056
2051
|
},
|
|
2057
|
-
renderCheckbox: function renderCheckbox(h, row, rowid, isChecked) {
|
|
2052
|
+
renderCheckbox: function renderCheckbox(h, row, rowid, isDisabled, isChecked) {
|
|
2058
2053
|
var $xeList = this;
|
|
2059
2054
|
var props = $xeList;
|
|
2060
2055
|
var showCheckbox = props.showCheckbox;
|
|
2061
2056
|
var checkboxOpts = $xeList.computeCheckboxOpts;
|
|
2062
2057
|
var showIcon = checkboxOpts.showIcon,
|
|
2063
|
-
checkMethod = checkboxOpts.checkMethod,
|
|
2064
2058
|
visibleMethod = checkboxOpts.visibleMethod;
|
|
2065
2059
|
var isVisible = !visibleMethod || visibleMethod({
|
|
2066
2060
|
$list: $xeList,
|
|
2067
2061
|
row: row
|
|
2068
2062
|
});
|
|
2069
2063
|
if (showCheckbox && showIcon && isVisible) {
|
|
2070
|
-
var isDisabled = checkMethod ? !checkMethod({
|
|
2071
|
-
$list: $xeList,
|
|
2072
|
-
row: row
|
|
2073
|
-
}) : false;
|
|
2074
2064
|
return h('div', {
|
|
2075
2065
|
key: 'ct3',
|
|
2076
2066
|
class: ['vxe-list--checkbox-option', {
|
|
@@ -2110,6 +2100,8 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
2110
2100
|
icon = dragOpts.icon,
|
|
2111
2101
|
disabledMethod = dragOpts.disabledMethod,
|
|
2112
2102
|
visibleMethod = dragOpts.visibleMethod;
|
|
2103
|
+
var radioOpts = $xeList.computeRadioOpts;
|
|
2104
|
+
var checkboxOpts = $xeList.computeCheckboxOpts;
|
|
2113
2105
|
var rowOpts = $xeList.computeRowOpts;
|
|
2114
2106
|
var useKey = rowOpts.useKey,
|
|
2115
2107
|
contentField = rowOpts.contentField,
|
|
@@ -2126,19 +2118,29 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
2126
2118
|
$list: $xeList
|
|
2127
2119
|
};
|
|
2128
2120
|
var isRadioChecked = false;
|
|
2121
|
+
var isRadioDisabled = false;
|
|
2129
2122
|
if (showRadio) {
|
|
2130
2123
|
isRadioChecked = selectRadioRow && (row === selectRadioRow || $xeList.eqRowByKey(selectRadioRow, rowKey));
|
|
2124
|
+
isRadioDisabled = radioOpts.checkMethod ? !radioOpts.checkMethod({
|
|
2125
|
+
$list: $xeList,
|
|
2126
|
+
row: row
|
|
2127
|
+
}) : false;
|
|
2131
2128
|
}
|
|
2132
2129
|
var isCheckboxChecked = false;
|
|
2130
|
+
var isCheckboxDisabled = false;
|
|
2133
2131
|
if (showCheckbox) {
|
|
2134
2132
|
isCheckboxChecked = !!(updateCheckboxFlag && selectCheckboxMaps[rowid]);
|
|
2133
|
+
isCheckboxDisabled = checkboxOpts.checkMethod ? !checkboxOpts.checkMethod({
|
|
2134
|
+
$list: $xeList,
|
|
2135
|
+
row: row
|
|
2136
|
+
}) : false;
|
|
2135
2137
|
}
|
|
2136
2138
|
var ctVNs = [];
|
|
2137
2139
|
if (showRadio) {
|
|
2138
|
-
ctVNs.push($xeList.renderRadio(h, row, rowid, isRadioChecked));
|
|
2140
|
+
ctVNs.push($xeList.renderRadio(h, row, rowid, isRadioDisabled, isRadioChecked));
|
|
2139
2141
|
}
|
|
2140
2142
|
if (showCheckbox) {
|
|
2141
|
-
ctVNs.push($xeList.renderCheckbox(h, row, rowid, isCheckboxChecked));
|
|
2143
|
+
ctVNs.push($xeList.renderCheckbox(h, row, rowid, isCheckboxDisabled, isCheckboxChecked));
|
|
2142
2144
|
}
|
|
2143
2145
|
var isDragDisabled = false;
|
|
2144
2146
|
if (isDrag && keyField && (!visibleMethod || visibleMethod(rowParams))) {
|
|
@@ -2198,7 +2200,9 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
2198
2200
|
class: ['vxe-list--row', isRowFnCls ? rowClassName(rowParams) : rowClassName || '', {
|
|
2199
2201
|
'is--drag-disabled': isDragDisabled,
|
|
2200
2202
|
'is--current': currRowFlag && currentRow && $xeList.eqRowByKey(currentRow, rowKey),
|
|
2203
|
+
'is-radio--disabled': isRadioDisabled,
|
|
2201
2204
|
'is-radio--checked': isRadioChecked,
|
|
2205
|
+
'is-checkbox--disabled': isCheckboxDisabled,
|
|
2202
2206
|
'is-checkbox--checked': isCheckboxChecked
|
|
2203
2207
|
}],
|
|
2204
2208
|
attrs: hasKey && keyField ? {
|
package/lib/list/src/list.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_store=require("./store"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_anime=require("../../ui/src/anime"),_util=require("./util"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,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 r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _createForOfIteratorHelper(e,t){var r,o,a,i,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return a=!(o=!0),{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw r}}};if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),i=0,{s:t=function(){},n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}var _createComponentLog=(0,_log.createComponentLog)("tree"),warnLog=_createComponentLog.warnLog,errLog=_createComponentLog.errLog,crossListDragRowObj=null;function eqRowKey(e,t){return""+e==""+t}function getRowKeyByField(e,t){return e?""+(e[t]||""):""}function getRowIdByField(e,t){return e?(e=getRowKeyByField(e,t),(0,_utils.enModelValue)(e)):""}function createReactData(){return{scrollYLoad:!1,bodyHeight:0,headHeight:0,footHeight:0,customHeight:0,customMaxHeight:0,parentHeight:0,topSpaceHeight:0,rowList:[],selectRadioRow:null,currRowFlag:1,updateCheckboxFlag:1,isAllChecked:!1,isAllIndeterminate:!1,insertRowFlag:1,removeRowFlag:1,dragRow:null,dragTipText:"",isCrossDragRow:!1}}function createInternalData(){return{resizeObserver:void 0,fullData:[],afterList:[],fullKeyMaps:{},rowMaps:{},lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0},currentRow:null,selectCheckboxMaps:{},insertRowMaps:{},removeRowMaps:{}}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeList",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,height:[Number,String],maxHeight:[Number,String],loading:Boolean,className:[String,Function],size:{type:String,default:function(){return(0,_ui.getConfig)().list.size||(0,_ui.getConfig)().size}},autoResize:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.autoResize}},syncResize:[Boolean,String,Number],showSeq:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.showSeq}},showRadio:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.showRadio}},checkRowKey:[String,Number],radioConfig:Object,showCheckbox:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.showCheckbox}},checkRowKeys:Array,checkboxConfig:Object,rowConfig:Object,dragConfig:Object,menuConfig:Object,virtualYConfig:Object,scrollY:Object},data:function(){var e=_xeUtils.default.uniqueId(),t=createReactData();return Object.assign(Object.assign({},{}),{xID:e,reactData:t,crossListDragRowInfo:_store.crossListDragRowGlobal,reFlag:0})},computed:Object.assign(Object.assign({},{}),{computeRowOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.rowConfig,this.rowConfig)},computeDragOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.dragConfig,this.dragConfig)},computeSYOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.virtualYConfig||(0,_ui.getConfig)().list.scrollY,this.virtualYConfig||this.scrollY)},computeKeyField:function(){return this.computeRowOpts.keyField||""},computeIsDrag:function(){var e=this.dragConfig,t=this.computeDragOpts;return e&&(0,_utils.isEnableConf)(t)},computeRowHeight:function(){return this.computeRowOpts.height},computeRadioOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().list.radioConfig,this.radioConfig)},computeCheckboxOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().list.checkboxConfig,this.checkboxConfig)},computeMenuOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.menuConfig,this.menuConfig)},computeWrapperStyles:function(){var e=this.computeRowHeight,t={};return e&&(t["--vxe-ui-list-row-height"]=(0,_dom.toCssUnit)(e)),t},computeVirtualStyles:function(){var e=this.reactData,t=this.height,r=this.maxHeight,o=e.customHeight,a=e.customMaxHeight,i=e.headHeight,e=e.footHeight,n={};return t?n.height=(0,_dom.toCssUnit)(Math.max(20,o-i-e)):r&&(n.height="auto",n.maxHeight=(0,_dom.toCssUnit)(Math.max(20,a-i-e))),n}}),methods:{dispatchEvent:function(e,t,r){this.$emit(e,(0,_ui.createEvent)(r,{$list:this},t))},emitCheckboxMode:function(e){this.$emit("update:checkRowKeys",e)},emitRadioMode:function(e){this.$emit("update:checkRowKey",e)},callSlot:function(e,t,r){var o=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=o[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,r)):[]},getRowId:function(e){return getRowIdByField(e,this.computeKeyField)},updateRadioModeValue:function(){var e=this.reactData,t=this.internalData,r=this.checkRowKey,t=t.fullKeyMaps;r?(t=t[r],e.selectRadioRow=t||null):e.selectRadioRow=null},updateCheckboxModeValue:function(){var e=this.internalData,t=this.checkRowKeys,r=e.fullKeyMaps,o=this.computeKeyField,a={};if(t&&t.length){var i,n=_createForOfIteratorHelper(t);try{for(n.s();!(i=n.n()).done;){var s=r[i.value];s&&(a[getRowIdByField(s,o)]=s)}}catch(e){n.e(e)}finally{n.f()}}e.selectCheckboxMaps=a,this.updateCheckboxStatus()},updateAfterDataIndex:function(){var e=this.internalData,t=e.afterList,a=e.rowMaps,i=this.computeKeyField,n=0;t.forEach(function(e,t){var r=getRowIdByField(e,i),o=a[r];o?o._index=n:(o={item:e,index:t,$index:-1,_index:n},a[r]=o),n++})},cacheRowMap:function(){var e=this.internalData,t=e.fullData,r=this.computeKeyField,o={};t.forEach(function(e){var t=getRowKeyByField(e,r);o[t]=e}),e.fullKeyMaps=o},loadData:function(e){var t=this,r=t.reactData,o=t.internalData,a=o.scrollYStore,i=t.computeSYOpts,e=e?e.slice(0):[];return Object.assign(a,{startIndex:0,endIndex:1,visibleSize:0}),o.fullData=e,o.insertRowMaps={},r.insertRowFlag++,o.removeRowMaps={},r.removeRowFlag++,r.scrollYLoad=!!i.enabled&&-1<i.gt&&(0===i.gt||i.gt<=e.length),t.cacheRowMap(),t.handleData(!0),t.updateRadioModeValue(),t.updateCheckboxModeValue(),t.computeScrollLoad().then(function(){t.refreshScroll()})},reloadData:function(e){return this.clearScroll(),this.loadData(e)},getFullData:function(){return this.internalData.fullData},calcTableHeight:function(e){var t=this.reactData.parentHeight,e=this[e],r=0;return r=e?"100%"===e||"auto"===e?t:(r=(0,_dom.isScale)(e)?Math.floor((_xeUtils.default.toInteger(e)||1)/100*t):_xeUtils.default.toNumber(e),Math.max(40,r)):r},updateHeight:function(){var e=this,t=e.reactData,r=e.$refs.refHeaderElem,o=e.$refs.refFooterElem;t.headHeight=r?Math.floor(r.offsetHeight):0,t.footHeight=o?Math.floor(o.offsetHeight):0,t.customHeight=e.calcTableHeight("height"),t.customMaxHeight=e.calcTableHeight("maxHeight")},updateYSpace:function(){var e=this.reactData,t=this.internalData,r=e.scrollYLoad,o=t.scrollYStore;e.bodyHeight=r?t.fullData.length*o.rowHeight:0,e.topSpaceHeight=r?Math.max(o.startIndex*o.rowHeight,0):0},updateAfterFullData:function(){var e=this.internalData,t=e.fullData;e.afterList=t.slice(0),this.updateAfterDataIndex()},handleData:function(e){var t=this,r=t.reactData,o=t.internalData,a=r.scrollYLoad,i=o.fullData,n=o.scrollYStore,s=o.rowMaps,l=t.computeKeyField,o=(e&&t.updateAfterFullData(),a?i.slice(n.startIndex,n.endIndex):i.slice(0));return l&&o.forEach(function(e,t){e=getRowIdByField(e,l),e=s[e];e&&(e.$index=t)}),r.rowList=o,t.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var n=this,s=n.reactData,l=n.internalData,c=n.browseObj;return n.$nextTick().then(function(){var e,t=s.scrollYLoad,r=l.scrollYStore,o=n.$refs.refVirtualBody,a=n.computeSYOpts,i=0;(e=o?(e=a.sItem?o.querySelector(a.sItem):e)||o.children[0]:e)&&(i=e.offsetHeight),i=Math.max(12,i),r.rowHeight=i,t?(o=n.$refs.refVirtualWrapper,e=Math.max(8,Math.ceil(o.clientHeight/i)),t=a.oSize?_xeUtils.default.toNumber(a.oSize):c.edge?10:0,r.offsetSize=t,r.visibleSize=e,r.endIndex=Math.max(r.startIndex+e+t,r.endIndex),n.updateYData()):n.updateYSpace()})},clearScroll:function(){var e=this.$refs.refVirtualWrapper;return e&&(e.scrollTop=0),this.$nextTick()},scrollTo:function(e,t){var r=this,o=r.reactData,a=r.$refs.refVirtualWrapper;return e&&!_xeUtils.default.isNumber(e)&&(t=e.top,e=e.left),_xeUtils.default.isNumber(e)&&(a.scrollLeft=e),_xeUtils.default.isNumber(t)&&(a.scrollTop=t),o.scrollYLoad?new Promise(function(e){setTimeout(function(){r.$nextTick(function(){e()})},50)}):r.$nextTick()},refreshScroll:function(){var e=this.internalData,t=e.lastScrollLeft,r=e.lastScrollTop;return this.clearScroll().then(function(){if(t||r)return e.lastScrollLeft=0,e.lastScrollTop=0,scrollTo(t,r)})},recalculate:function(){var e=this,t=e.reactData,r=e.$refs.refElem;if(r){var o,a=r.parentElement,i=0;if(a&&(o=getComputedStyle(a),i=a.clientHeight-Math.ceil(_xeUtils.default.toNumber(o.paddingLeft)+_xeUtils.default.toNumber(o.paddingRight))),t.parentHeight=i,e.updateHeight(),r.clientWidth&&r.clientHeight)return e.computeScrollLoad()}return e.$nextTick()},loadYData:function(e){var t=this.internalData.scrollYStore,r=t.startIndex,o=t.endIndex,a=t.visibleSize,i=t.offsetSize,e=e.target.scrollTop,e=Math.floor(e/t.rowHeight),n=Math.max(0,e-1-i),i=e+a+i;!(e<=r||o-a-1<=e)||r===n&&o===i||(t.startIndex=n,t.endIndex=i,this.updateYData())},scrollEvent:function(e){var t=this.reactData,r=this.internalData,o=e.target,a=o.scrollTop,o=o.scrollLeft,i=o!==r.lastScrollLeft,n=a!==r.lastScrollTop;r.lastScrollTop=a,r.lastScrollLeft=o,t.scrollYLoad&&this.loadYData(e),this.dispatchEvent("scroll",{scrollLeft:o,scrollTop:a,isX:i,isY:n},e)},getRowKey:function(e){return getRowKeyByField(e,this.computeKeyField)},eqRowKey:eqRowKey,eqRow:function(e,t){return!(!e||!t)&&(e===t||eqRowKey(this.getRowId(e),this.getRowId(t)))},eqRowByKey:function(e,t){return e&&eqRowKey(this.getRowKey(e),t)},findRow:function(e,t){var r=this;return t?_xeUtils.default.find(e,function(e){return r.eqRow(e,t)}):null},findRowByKey:function(e,t){var r=this.computeKeyField;return _xeUtils.default.find(e,function(e){return eqRowKey(getRowIdByField(e,r),t)})},findRowIndexOf:function(e,t){var r=this;return t?_xeUtils.default.findIndexOf(e,function(e){return r.eqRow(e,t)}):-1},findRowIndexOfByKey:function(e,t){var r=this.computeKeyField;return _xeUtils.default.findIndexOf(e,function(e){return eqRowKey(getRowIdByField(e,r),t)})},isCheckedByRadioRowKey:function(e){var t=this.reactData.selectRadioRow;return this.getRowKey(t)===e},isCheckedByRadioRow:function(e){return this.isCheckedByRadioRowKey(this.getRowKey(e))},isCheckedByCheckboxRowKey:function(e){var t=this.reactData,r=this.internalData,t=t.updateCheckboxFlag,r=r.selectCheckboxMaps;return!(!t||!r[e])},isCheckedByCheckboxRow:function(e){return this.isCheckedByCheckboxRowKey(this.getRowKey(e))},setCurrentRow:function(e){var t=this.reactData;return this.internalData.currentRow=e,t.currRowFlag++,this.$nextTick()},setCurrentRowByKey:function(e){var t=this.reactData,r=this.internalData,o=r.fullData;return r.currentRow=this.findRowByKey(o,e),t.currRowFlag++,this.$nextTick()},getCurrentRow:function(){return this.internalData.currentRow},getCurrentRowKey:function(){var e=this.internalData.currentRow;return e?this.getRowKey(e):null},clearCurrentRow:function(){var e=this.reactData;return this.internalData.currentRow=null,e.currRowFlag++,this.$nextTick()},setRadioRow:function(e){this.reactData.selectRadioRow=e;e=this.getRowKey(e);return this.emitRadioMode(e),this.$nextTick()},setRadioRowByKey:function(e){var t=this,r=t.reactData,o=t.internalData.fullData,r=(r.selectRadioRow=t.findRowByKey(o,e),e);return t.emitRadioMode(r),t.$nextTick()},getRadioRow:function(){return this.reactData.selectRadioRow},getRadioRowKey:function(){var e=this.reactData.selectRadioRow;return e?this.getRowKey(e):null},clearRadioRow:function(){return this.reactData.selectRadioRow=null,this.emitRadioMode(null),this.$nextTick()},setCheckboxRow:function(e,t){var r=this,o=r.internalData.selectCheckboxMaps,a=r.computeKeyField,e=((e?_xeUtils.default.isArray(e)?e:[e]:[]).forEach(t?function(e){var t=getRowIdByField(e,a);o[t]||(o[t]=e)}:function(e){e=getRowIdByField(e,a);o[e]&&delete o[e]}),r.getCheckboxRowKeys());return r.emitCheckboxMode(e),r.updateCheckboxStatus()},setCheckboxRowByKey:function(e,t){var r=this,o=r.internalData,a=o.selectCheckboxMaps,i=o.fullKeyMaps,n=r.computeKeyField,o=((e?_xeUtils.default.isArray(e)?e:[e]:[]).forEach(t?function(e){var t,e=i[e||""];e&&(t=getRowIdByField(e,n),e)&&!a[t]&&(a[t]=e)}:function(e){var e=i[e||""];e&&(e=getRowIdByField(e,n),a[e])&&delete a[e]}),r.getCheckboxRowKeys());return r.emitCheckboxMode(o),r.updateCheckboxStatus()},getCheckboxRecords:function(){var e=this.reactData,t=this.internalData,e=e.updateCheckboxFlag,t=t.selectCheckboxMaps,r=[];return e&&_xeUtils.default.each(t,function(e){e&&r.push(e)}),r},getCheckboxRows:function(){return this.getCheckboxRecords()},getCheckboxRowKeys:function(){var e=this.reactData,t=this.internalData,e=e.updateCheckboxFlag,t=t.selectCheckboxMaps,r=this.computeKeyField,o=[];return e&&_xeUtils.default.each(t,function(e){e&&(e=getRowKeyByField(e,r),o.push(e))}),o},clearCheckboxRow:function(){var e=this.reactData;this.internalData.selectCheckboxMaps={},e.updateCheckboxFlag++,e.isAllChecked=!1,e.isAllIndeterminate=!1;return this.emitCheckboxMode([]),this.$nextTick()},setAllCheckboxRow:function(e){var t=this,r=t.internalData,o=r.fullData,a=r.selectCheckboxMaps,i=t.computeKeyField;if(e){var n,s=[],l=_createForOfIteratorHelper(o);try{for(l.s();!(n=l.n()).done;){var c=n.value,u=getRowKeyByField(c,i);a[getRowIdByField(c,i)]=c,s.push(u)}}catch(e){l.e(e)}finally{l.f()}return t.emitCheckboxMode(s),t.updateCheckboxStatus()}return t.clearCheckboxRow()},updateCheckboxStatus:function(){var e=this,t=e.reactData,r=e.internalData,o=r.selectCheckboxMaps,r=r.fullData,a=e.computeKeyField,i=e.computeCheckboxOpts.checkMethod,n=!1,s=!1;if(i){var l,c=_createForOfIteratorHelper(r);try{for(c.s();!(l=c.n()).done;){var u=l.value;if(i({row:u,$list:e}))if(o[getRowIdByField(u,a)])n=!0;else if(s=!0,n)break}}catch(e){c.e(e)}finally{c.f()}}else{var d,h=_createForOfIteratorHelper(r);try{for(h.s();!(d=h.n()).done;)if(o[getRowIdByField(d.value,a)])n=!0;else if(s=!0,n)break}catch(e){h.e(e)}finally{h.f()}}return t.isAllChecked=n&&!s,t.isAllIndeterminate=n&&s,t.updateCheckboxFlag++,e.$nextTick()},changeCheckboxAllEvent:function(e){var t=!this.reactData.isAllChecked;t?this.setAllCheckboxRow(!0):this.clearCheckboxRow(),this.dispatchEvent("checkbox-all",{checked:t},e)},changeCheckboxEvent:function(e,t){var r=this,o=r.reactData,a=r.internalData,a=(e.preventDefault(),e.stopPropagation(),a.selectCheckboxMaps),i=r.computeCheckboxOpts.checkMethod,n=r.getRowKey(t);(!i||i({$list:r,row:t}))&&(i=!1,a[n]?delete a[n]:(i=!0,a[n]=t),o.updateCheckboxFlag++,r.updateCheckboxStatus(),n=_xeUtils.default.keys(a).map(_utils.deModelValue),r.emitCheckboxMode(n),r.dispatchEvent("checkbox-change",{row:t,value:n,checked:i},e))},changeCurrentEvent:function(e,t){var r=this.reactData,o=this.internalData;e.preventDefault();var a=this.computeRowOpts.currentMethod,i=!1;(i=a?!a({row:t}):i)||(o.currentRow=t,r.currRowFlag++,this.dispatchEvent("current-change",{row:t,checked:!0},e))},changeRadioEvent:function(e,t){var r,o=this,a=o.reactData,i=(e.preventDefault(),e.stopPropagation(),a.selectRadioRow),n=o.computeRadioOpts,s=n.strict,n=n.checkMethod,l=o.getRowKey(t);(!n||n({$list:o,row:t}))&&(n=l,r=!0,s&&i&&l===o.getRowKey(i)?(r=!1,a.selectRadioRow=null):a.selectRadioRow=t,o.emitRadioMode(n),o.dispatchEvent("radio-change",{row:t,value:n,checked:r},e))},handleRowDragEndClearStatus:function(){this.clearRowDragData(),this.clearCrossListDragStatus(),this.recalculate()},clearRowDropOrigin:function(){var t,e=this.$refs.refElem;e&&_xeUtils.default.arrayEach(e.querySelectorAll(".".concat(t="row--drag-origin")),function(e){(e.draggable=!1,_dom.removeClass)(e,t)})},updateRowDropOrigin:function(e){var t=this.computeSYOpts.sItem,r=this.$refs.refElem;r&&(e=this.getRowId(e),_xeUtils.default.arrayEach(r.querySelectorAll('.vxe-list--row[rowid="'.concat(e,'"]')+(t?"".concat(t,'[rowid="').concat(e,'"]'):"")),function(e){(0,_dom.addClass)(e,"row--drag-origin")}))},updateRowDropTipContent:function(e){var t=this.reactData,r=t.dragRow,o=this.computeDragOpts.tooltipMethod,a="";a=o?"".concat(o({$list:this,row:r})||""):(0,_ui.getI18n)("vxe.list.dragTip",[e.textContent||""]),t.dragTipText=a},hideDropTip:function(){var e=this.$refs.refDragTipElem,t=this.$refs.refDragRowLineElem;e&&(e.style.display=""),t&&(t.style.display="")},clearCrossListDragStatus:function(){var e=(0,_store.getCrossListDragRowInfo)(this);crossListDragRowObj=null,e.row=null},clearDragStatus:function(){var e=this.reactData;e.dragRow&&(this.hideDropTip(),this.clearRowDropOrigin(),this.clearCrossListDragStatus(),e.dragRow=null)},handleRowDragMousedownEvent:function(e,t){var r=this,o=r.reactData,a=(0,_store.getCrossListDragRowInfo)(r),i=(e.stopPropagation(),t.row),n=r.computeDragOpts,s=n.isCrossListDrag,l=n.dragStartMethod,c=e.currentTarget,n="row"===n.trigger?c:c.parentElement.parentElement;r.clearRowDropOrigin(),l&&!l(t)?(n.draggable=!1,o.dragRow=null,r.hideDropTip()):(s&&(a.row=i,crossListDragRowObj={$oldList:r,$newList:null}),c={row:i},o.dragRow=i,n.draggable=!0,r.updateRowDropOrigin(i),r.updateRowDropTipContent(n),r.dispatchEvent("row-dragstart",c,e))},handleRowDragMouseupEvent:function(){this.clearDragStatus()},showDropTip:function(e,t,r,o){var a,i,n,s,l=this.$refs.refElem;l&&(a=l.getBoundingClientRect(),s=l.clientHeight,t&&(i=this.$refs.refDragRowLineElem)&&(r?(n=t.getBoundingClientRect(),t=t.clientHeight,s<(n=Math.max(1,n.y-a.y))+t&&(t=s-n),i.style.display="block",i.style.top="".concat(n,"px"),i.style.height="".concat(t,"px"),i.setAttribute("drag-pos",o)):i.style.display=""),s=this.$refs.refDragTipElem)&&(s.style.display="block",s.style.top="".concat(Math.min(l.clientHeight-l.scrollTop-s.clientHeight,e.clientY-a.y),"px"),s.style.left="".concat(Math.min(l.clientWidth-l.scrollLeft-s.clientWidth-1,e.clientX-a.x),"px"),s.setAttribute("drag-status",r?"normal":"disabled"))},clearRowDragData:function(){var e=this.reactData,t=this.$refs.refElem;this.hideDropTip(),this.clearRowDropOrigin(),(0,_anime.clearRowAnimate)(t,[".vxe-list--row"]),e.dragRow=null},handleRowDragSwapEvent:function(t,r,o,a){var e,u,d,h,f,i,n,s,l,g=this,p=g.reactData,w=g.internalData,c=w.fullData,R=g.computeDragOpts,v=R.animation,R=R.dragEndMethod||(R?R.dragEndMethod:null),D="bottom"===a?1:0,m=g.$refs.refElem,x={status:!1};if(m&&o&&r){if(o!==r)return e={oldRow:r,newRow:o,dragRow:r,dragPos:a,offsetIndex:D},u=g.getRowId(r),d=g.findRowIndexOfByKey(c,u),n=g.getRowKey(o),h=0,f=-1,v&&(n=m.querySelector('.vxe-list--row[rowid="'.concat(n,'"]')),i=m.querySelector('.vxe-list--row[rowid="'.concat(u,'"]')),(n=n||i)&&(h=n.offsetHeight),i)&&(f=i.offsetTop),l=s=-1,Promise.resolve(!R||R(e)).then(function(e){if(!e)return x;s=g.findRowIndexOf(c,r),c.splice(s,1);e=g.findRowIndexOf(c,o);return l=e+D,c.splice(l,0,r),g.handleData(),p.scrollYLoad&&g.updateYSpace(),t&&g.dispatchEvent("row-dragend",{oldRow:r,newRow:o,dragRow:r,dragPos:a,offsetIndex:D,_index:{newIndex:l,oldIndex:s}},t),g.$nextTick().then(function(){var e,t,r,o,a,i,n,s,l,c;v&&(n=p.rowList,c=w.fullData,l=g.findRowIndexOfByKey(c,u),s=c[0],s=g.findRowIndexOf(c,s),e=m,-1<s&&(a=s+c.length,r=t=-1,o=1,d<s?(t=0,r=l-s):a<d?(t=g.findRowIndexOfByKey(n,u)+1,r=c.length,o=-1):d<l?r=(t=d-s)+l-d:(r=(t=l-s)+d-l+1,o=-1),(a=c.slice(t,r)).length)&&(i=[],a.forEach(function(e){e=g.getRowId(e);i.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),n=e.querySelectorAll(i.join(",")),(0,_anime.moveRowAnimateToTb)(n,o*h)),s=['.vxe-list--row[rowid="'.concat(u,'"]')],c=(l=e.querySelectorAll(s.join(",")))[0],-1<f)&&c&&(0,_anime.moveRowAnimateToTb)(l,f-c.offsetTop),g.recalculate()}).then(function(){return{status:!0}})}).catch(function(){return x}).then(function(e){return g.clearRowDragData(),g.clearCrossListDragStatus(),e});g.clearRowDragData(),g.clearCrossListDragStatus()}return Promise.resolve(x)},handleRowDragDragstartEvent:function(e){e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0)},handleRowDragDragendEvent:function(e){var t=this,r=t.reactData,o=t.internalData,r=r.dragRow,a=o.prevDragRow,o=o.prevDragPos;if(t.computeDragOpts.isCrossListDrag&&crossListDragRowObj){var i=crossListDragRowObj.$newList;if(i&&i.xID!==t.xID)return void i.handleCrossListRowDragInsertEvent(e)}t.handleRowDragSwapEvent(e,r,a,o)},handleRowDragDragoverEvent:function(e){var t,r=this,o=r.reactData,a=r.internalData,o=o.dragRow,i=a.fullData,n=(o||e.preventDefault(),e.currentTarget),s=n.getAttribute("rowid")||"",i=r.findRowByKey(i,s);i&&(e.preventDefault(),t=e.clientY-n.getBoundingClientRect().y<n.clientHeight/2?"top":"bottom",a.prevDragRow=i,a.prevDragPos=t,o&&r.getRowId(o)===s?r.showDropTip(e,n,!1,t):(a={oldRow:o,targetRow:i,dragPos:t,dragRow:o,offsetIndex:"bottom"==t?1:0},r.showDropTip(e,n,!0,t),r.dispatchEvent("row-dragover",a,e)))},handleRowMousedownEvent:function(e,t){var r=this.computeDragOpts,o=this.computeIsDrag,a=r.trigger,r=r.disabledMethod,i=!1,t={row:t,$list:this};!(i=o?"row"===a:i)||r&&r(t)||this.handleRowDragMousedownEvent(e,t)},handleRowClickEvent:function(e,t){var r=this,o=r.reactData,a=r.internalData,i=r.showRadio,n=r.showCheckbox,s=a.currentRow,l=r.computeRadioOpts,c=r.computeCheckboxOpts,u=!1,d=!1,h=!1;r.computeRowOpts.isCurrent?(u=!0,r.changeCurrentEvent(e,t)):s&&(a.currentRow=null,o.currRowFlag++),i&&"row"===l.trigger&&(d=!0,r.changeRadioEvent(e,t)),n&&"row"===c.trigger&&(h=!0,r.changeCheckboxEvent(e,t)),r.dispatchEvent("row-click",{row:t,triggerCurrent:u,triggerRadio:d,triggerCheckbox:h},e)},handleRowDblclickEvent:function(e,t){this.dispatchEvent("row-dblclick",{row:t},e)},insertListRow:function(e,t){var r=this.internalData,o=r.fullData,a=r.rowMaps,i=this.computeKeyField,n=t?"push":"unshift";e.forEach(function(e){var t=getRowIdByField(e,i),r=(0,_util.getItemCacheObj)(e);o[n](e),a[t]=r})},handleInsertRowAt:function(e,t,r){var o=this,a=o.reactData,i=o.internalData,n=i.fullData,s=i.rowMaps,l=i.removeRowMaps,c=i.insertRowMaps,u=o.computeKeyField;if(!u)return errLog("vxe.error.reqSupportProp",["insert() | insertAt() | insertNextAt()","row-config.keyField"]),Promise.resolve({row:null,rows:[]});_xeUtils.default.isArray(e)||(e=[e]);var d,h=t;return(_xeUtils.default.isString(t)||_xeUtils.default.isNumber(t))&&(i=s[t])&&(h=i.item),e.length?(d=e.map(function(e){return _xeUtils.default.assign({},e)}),_xeUtils.default.eqNull(h)?o.insertListRow(d,!1):-1===h?o.insertListRow(d,!0):-1<(t=n.findIndex(function(e){return h[u]===e[u]}))?(d.forEach(function(e){var t=getRowIdByField(e,u),e=(0,_util.getItemCacheObj)(e);s[t]=e}),i=t,r&&(i+=1),n.splice.apply(n,[i,0].concat(_toConsumableArray(d)))):(warnLog("vxe.error.unableInsert"),o.insertListRow(d,!0)),d.forEach(function(e){var t=getRowIdByField(e,u);l[t]?(delete l[t],c[t]&&delete c[t]):c[t]=e}),a.removeRowFlag++,a.insertRowFlag++,o.cacheRowMap(),o.handleData(!0),o.updateAfterDataIndex(),o.updateCheckboxStatus(),a.scrollYLoad&&o.updateYSpace(),o.$nextTick().then(function(){return{row:d.length?d[d.length-1]:null,rows:d}})):Promise.resolve({row:null,rows:[]})},insert:function(e){return this.handleInsertRowAt(e,null)},insertAt:function(e,t){return this.handleInsertRowAt(e,t)},insertNextAt:function(e,t){return this.handleInsertRowAt(e,t,!0)},getInsertRecords:function(){var e=this.internalData.insertRowMaps,t=[];return _xeUtils.default.each(e,function(e){t.push(e)}),t},isInsertByRow:function(e){var t=this.reactData,r=this.internalData,e=this.getRowId(e);return!!t.insertRowFlag&&!!r.insertRowMaps[e]},remove:function(e){var r,o=this,t=o.reactData,a=o.internalData,i=a.fullData,n=a.insertRowMaps,s=a.removeRowMaps;return o.computeKeyField?(r=[],e?_xeUtils.default.isArray(e)||(e=[e]):e=i,e.length?(e.forEach(function(e){var t;o.isInsertByRow(e)||(t=o.getRowId(e),s[t]=e)}),i===e?(e=r=i.slice(0),a.fullData=[]):e.forEach(function(e){var t=o.getRowId(e),e=_xeUtils.default.findIndexOf(i,function(e){return t===o.getRowId(e)});-1<e&&(e=i.splice(e,1),r.push(e[0]))}),e.forEach(function(e){e=o.getRowId(e);n[e]&&delete n[e]}),t.removeRowFlag++,t.insertRowFlag++,o.cacheRowMap(),o.handleData(!0),o.updateAfterDataIndex(),o.updateCheckboxStatus(),t.scrollYLoad&&o.updateYSpace(),o.$nextTick().then(function(){return o.recalculate()}).then(function(){return{row:r.length?r[r.length-1]:null,rows:r}})):Promise.resolve({row:null,rows:[]})):(errLog("vxe.error.reqSupportProp",["insert() | insertAt() | insertNextAt()","row-config.keyField"]),Promise.resolve({row:null,rows:[]}))},getRemoveRecords:function(){var e=this.internalData.removeRowMaps,t=[];return _xeUtils.default.each(e,function(e){t.push(e)}),t},isRemoveByRow:function(e){var t=this.reactData,r=this.internalData,e=this.getRowId(e);return!!t.removeRowFlag&&!!r.removeRowMaps[e]},getRecordset:function(){return{insertRecords:this.getInsertRecords(),removeRecords:this.getRemoveRecords()}},handleCrossListRowDragCancelEvent:function(){this.clearRowDragData(),this.clearCrossListDragStatus()},handleCrossListRowDragFinishEvent:function(e){var r,t,o,a=this,i=a.reactData,n=a.internalData,s=(0,_store.getCrossListDragRowInfo)(a),i=i.rowList,n=n.rowMaps,l=a.computeDragOpts,c=l.animation,u=a.$refs.refElem;u&&l.isCrossListDrag&&crossListDragRowObj&&s&&(l=s.row)&&(n=n[s=a.getRowId(l)],r=0,t=-1,n&&(c&&(s=u.querySelector('.vxe-list--row[rowid="'.concat(s,'"]')))&&(r=s.offsetHeight),t=n.$index),o=-1<t&&t<i.length-1?i.slice(t+1):[],a.remove([l]).then(function(){var t,e;c&&r&&o.length&&(e=u,t=[],o.forEach(function(e){e=a.getRowId(e);t.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),e=e.querySelectorAll(t.join(",")),(0,_anime.moveRowAnimateToTb)(e,r))}),a.dispatchEvent("row-remove-dragend",{row:l},e),a.handleRowDragEndClearStatus())},handleCrossListRowDragoverEmptyEvent:function(e){var t,r,o=this,a=o.reactData,i=o.internalData,n=a.rowList;o.computeDragOpts.isCrossListDrag&&crossListDragRowObj&&!n.length&&(t=(n=crossListDragRowObj).$oldList,n=n.$newList,t)&&(r=t).xID!==o.xID&&(n&&n.xID!==o.xID&&n.hideCrossListRowDropClearStatus(),e.preventDefault(),t.hideCrossListRowDropClearStatus(),crossListDragRowObj.$newList=o,i.prevDragRow=null,a.dragTipText=r.dragTipText,o.showDropTip(e,e.currentTarget,!0,""))},handleCrossListRowDragInsertEvent:function(r){var o,a,n,s,i,l,c=this,u=c.reactData,d=c.internalData,e=(0,_store.getCrossListDragRowInfo)(c),h=d.prevDragRow,f=d.prevDragPos,t=c.computeDragOpts,g=t.animation,p=t.dragEndMethod;t.isCrossListDrag&&crossListDragRowObj&&e&&(o=e.row,a=crossListDragRowObj.$oldList,n=c.$refs.refElem)&&a&&o&&(i=-1,t={oldRow:s=o,newRow:h,dragRow:s,dragPos:f,offsetIndex:i=h?"bottom"===f?1:0:i},l={status:!1},Promise.resolve(!p||p(t)).then(function(e){if(!e)return a&&a.xID!==c.xID&&a.handleCrossListRowDragCancelEvent(r),c.handleRowDragEndClearStatus(),l;var e=Promise.resolve(),t=[s];a.handleCrossListRowDragFinishEvent(r),e=h?"bottom"===f?c.insertNextAt(t,h):c.insertAt(t,h):c.insert(t),c.dispatchEvent("row-insert-dragend",{oldRow:o,newRow:h,dragRow:s,dragPos:f,offsetIndex:i},r),c.clearRowDragData(),e.then(function(){var t,e=u.rowList,r=d.rowMaps,o=c.getRowId(s),r=r[o],a=0,i=-1,o=(r&&(g&&(o=n.querySelector('.vxe-list--row[rowid="'.concat(o,'"]')))&&(a=o.offsetHeight),i=r.$index),-1<i?e.slice(i):[]);g&&a&&o.length&&(r=n,t=[],o.forEach(function(e){e=c.getRowId(e);t.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),e=r.querySelectorAll(t.join(",")),(0,_anime.moveRowAnimateToTb)(e,-a))})}))},hideCrossListRowDropClearStatus:function(){this.hideDropTip()},handleContextmenuEvent:function(o,a){var i=this,e=i.reactData,t=i.internalData,r=i.menuConfig,n=i.computeMenuOpts,s=i.computeRowOpts.isCurrent;(r?(0,_utils.isEnableConf)(n):n.enabled)&&(r=n.options,(n=n.visibleMethod)&&!n({$list:i,options:r,row:a})||(s?i.changeCurrentEvent(o,a):t.currentRow&&(t.currentRow=null,e.currRowFlag++),_ui.VxeUI.contextMenu&&_ui.VxeUI.contextMenu.openByEvent(o,{options:r,events:{optionClick:function(e){var t=e.option,r=_ui.menus.get(t.code),r=r?r.listMenuMethod:null,t={menu:t,row:a,$event:o,$list:i};r&&r(t,o),i.dispatchEvent("menu-click",t,e.$event)}}}))),i.dispatchEvent("row-menu",{row:a},o)},renderDragTip:function(e){var t=this,r=t.reactData,o=r.dragRow,r=r.dragTipText,a=t.computeDragOpts;return t.computeIsDrag?e("div",{class:"vxe-list--drag-wrapper"},[e("div",{ref:"refDragRowLineElem",class:["vxe-list--drag-row-line",{"is--guides":a.showGuidesStatus}]}),o&&a.showDragTip?e("div",{ref:"refDragTipElem",class:"vxe-list--drag-sort-tip"},[e("div",{class:"vxe-list--drag-sort-tip-wrapper"},[e("div",{class:"vxe-list--drag-sort-tip-status"},[e("span",{class:["vxe-list--drag-sort-tip-normal-status",(0,_ui.getIcon)().LIST_DRAG_STATUS_NODE]}),e("span",{class:["vxe-list--drag-sort-tip-disabled-status",(0,_ui.getIcon)().LIST_DRAG_DISABLED]})]),e("div",{class:"vxe-list--drag-sort-tip-content"},r)])]):(0,_ui.renderEmptyElement)(t)]):(0,_ui.renderEmptyElement)(t)},renderRadio:function(e,t,r,o){var a,i=this,n=i.showRadio,s=i.computeRadioOpts,l=s.showIcon,c=s.checkMethod,s=s.visibleMethod,s=!s||s({$list:i,row:t});return n&&l&&s?e("div",{key:"ct2",class:["vxe-list--radio-option",{"is--checked":o,"is--disabled":a=!!c&&!c({$list:i,row:t})}],on:{click:function(e){a||i.changeRadioEvent(e,t)}}},[e("span",{class:["vxe-radio--icon",o?(0,_ui.getIcon)().RADIO_CHECKED:a?(0,_ui.getIcon)().RADIO_DISABLED_UNCHECKED:(0,_ui.getIcon)().RADIO_UNCHECKED]})]):(0,_ui.renderEmptyElement)(i)},renderCheckbox:function(e,t,r,o){var a,i=this,n=i.showCheckbox,s=i.computeCheckboxOpts,l=s.showIcon,c=s.checkMethod,s=s.visibleMethod,s=!s||s({$list:i,row:t});return n&&l&&s?e("div",{key:"ct3",class:["vxe-list--checkbox-option",{"is--checked":o,"is--disabled":a=!!c&&!c({$list:i,row:t})}],on:{click:function(e){a||i.changeCheckboxEvent(e,t)}}},[e("span",{class:["vxe-checkbox--icon",o?(0,_ui.getIcon)().CHECKBOX_CHECKED:a?(0,_ui.getIcon)().CHECKBOX_DISABLED_UNCHECKED:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})]):(0,_ui.renderEmptyElement)(i)},renderRow:function(e,t,r){var o=this,a=o.reactData,i=o.internalData,n=o.$scopedSlots,s=o.showRadio,l=o.showCheckbox,c=a.selectRadioRow,u=a.currRowFlag,a=a.updateCheckboxFlag,d=i.selectCheckboxMaps,i=i.currentRow,h=n.content,n=n.extra,f=o.computeDragOpts,g=f.trigger,p=f.icon,w=f.disabledMethod,f=f.visibleMethod,R=o.computeRowOpts,v=R.useKey,D=R.contentField,m=R.className,R=R.isCurrent,x=o.computeIsDrag,y=o.computeKeyField,b=m&&_xeUtils.default.isFunction(m),v=y||v||x||R||s||l,R=v&&y?getRowIdByField(t,y):"",C=(0,_utils.enModelValue)(R),_={row:t,$list:o},k=!1,c=(s&&(k=c&&(t===c||o.eqRowByKey(c,R))),!1),a=(l&&(c=!(!a||!d[C])),[]),I=(s&&a.push(o.renderRadio(e,t,C,k)),l&&a.push(o.renderCheckbox(e,t,C,c)),!1),s=(x&&y&&(!f||f(_))&&(d={},"row"!==g&&(I=!(!w||!w(_)),d.mousedown=function(e){I||o.handleRowDragMousedownEvent(e,_)},d.mouseup=o.handleRowDragMouseupEvent),a.push(e("div",{key:"ct1",class:"vxe-list--row-drag"},[e("span",{class:"vxe-list--drag-handle",on:d},[e("i",{class:p||(0,_ui.getIcon)().LIST_DRAG})])]))),a.push(e("div",{key:"ct5",class:"vxe-list--row-content"},h?h(_):D?(0,_utils.getText)(t[D]):"")),n&&a.push(e("div",{key:"ct7",class:"vxe-list--row-extra"},n(_))),{mousedown:function(e){o.handleRowMousedownEvent(e,t)},mouseup:o.handleRowDragMouseupEvent,click:function(e){o.handleRowClickEvent(e,t)},dblclick:function(e){o.handleRowDblclickEvent(e,t)},contextmenu:function(e){o.handleContextmenuEvent(e,t)}});return x&&(s.dragstart=o.handleRowDragDragstartEvent,s.dragend=o.handleRowDragDragendEvent,s.dragover=o.handleRowDragDragoverEvent),e("div",{key:v&&y?C:r,class:["vxe-list--row",b?m(_):m||"",{"is--drag-disabled":I,"is--current":u&&i&&o.eqRowByKey(i,R),"is-radio--checked":k,"is-checkbox--checked":c}],attrs:v&&y?{rowid:C}:void 0,on:s},a)},renderVN:function(r){var o=this,e=o.reactData,t=o.$scopedSlots,a=o.showCheckbox,i=o.className,n=o.loading,s=e.bodyHeight,l=e.topSpaceHeight,c=e.rowList,u=e.isAllChecked,e=e.isAllIndeterminate,d=t.default,h=t.header,t=t.footer,f=o.computeSize,g=o.computeWrapperStyles,p=o.computeVirtualStyles,w=o.computeRadioOpts,R=o.computeCheckboxOpts,v=o.computeDragOpts,D=v.trigger,m=o.computeRowOpts,x=m.isHover,m=m.padding,a=a&&!1!==R.showHeader,y={};return v.isCrossListDrag&&!c.length&&(y.dragover=o.handleCrossListRowDragoverEmptyEvent),r("div",{ref:"refElem",class:["vxe-list",i?_xeUtils.default.isFunction(i)?i({$list:o}):i:"",_defineProperty(_defineProperty({},"size--".concat(f),f),"is--loading",n)],on:y,style:g},[h||a?r("div",{ref:"refHeaderElem",class:"vxe-list--header-wrapper"},[a?r("div",{class:"vxe-list--header-left"},[r("div",{class:["vxe-list--checkbox-header",{"is--checked":u,"is--indeterminate":e}],on:{click:o.changeCheckboxAllEvent}},[r("span",{class:["vxe-checkbox--icon",u?(0,_ui.getIcon)().CHECKBOX_CHECKED:e?(0,_ui.getIcon)().CHECKBOX_INDETERMINATE:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})])]):(0,_ui.renderEmptyElement)(o),h?r("div",{class:"vxe-list--header-content"},h({items:c,$list:o})):(0,_ui.renderEmptyElement)(o)]):(0,_ui.renderEmptyElement)(o),r("div",{ref:"refVirtualWrapper",class:"vxe-list--virtual-wrapper",style:p,on:{scroll:o.scrollEvent}},[r("div",{class:"vxe-list--y-space",style:{height:s?"".concat(s,"px"):""}}),r("div",{ref:"refVirtualBody",class:["vxe-list--body",{"trigger--row":"row"===D,"checkbox--highlight":R.highlight,"radio--highlight":w.highlight,"row--hover":x,"is--padding":m}],style:{marginTop:l?"".concat(l,"px"):""}},d?d({items:c,$list:o}):c.map(function(e,t){return o.renderRow(r,e,t)}))]),t?r("div",{ref:"refFooterElem",class:"vxe-list--footer-wrapper"},t({items:c,$list:o})):(0,_ui.renderEmptyElement)(o),o.renderDragTip(r),r(_loading.default,{class:"vxe-list--loading",props:{value:n}})])}},watch:{data:function(){this.loadData(this.data||[])},height:function(){this.reFlag++},maxHeight:function(){this.reFlag++},syncResize:function(){this.reFlag++},computeRowHeight:function(){this.reFlag++},reFlag:function(){var e=this;e.$nextTick(function(){e.recalculate()})},checkRowKey:function(){this.updateRadioModeValue()},checkRowKeys:function(){this.updateCheckboxModeValue()}},created:function(){this.internalData=createInternalData(),this.browseObj=_xeUtils.default.browse(),this.loadData(this.data||[])},mounted:function(){var e=this,t=e,r=e.internalData,o=t.showSeq,a=t.showRadio,i=t.showCheckbox,n=e.computeRowOpts,s=n.useKey,n=n.keyField,l=e.computeIsDrag;n||(o&&errLog("vxe.error.reqSupportProp",["show-seq","row-config.keyField"]),a&&errLog("vxe.error.reqSupportProp",["show-radio","row-config.keyField"]),i&&errLog("vxe.error.reqSupportProp",["show-checkbox","row-config.keyField"]),l&&errLog("vxe.error.reqSupportProp",["drag-config","row-config.keyField"])),s&&!n&&errLog("vxe.error.reqSupportProp",["row-config.useKey","row-config.keyField"]),t.autoResize&&(o=e.$refs.refElem,(a=_ui.globalResize.create(function(){return e.recalculate()})).observe(o),o&&a.observe(o.parentElement),r.resizeObserver=a),e.recalculate(),_ui.globalEvents.on(e,"resize",e.recalculate)},activated:function(){var e=this;e.recalculate().then(function(){return e.refreshScroll()})},beforeDestroy:function(){var e=this.reactData,t=this.internalData,r=t.resizeObserver;r&&r.disconnect(),_ui.globalEvents.off(this,"resize"),_xeUtils.default.assign(e,createReactData()),_xeUtils.default.assign(t,createInternalData())},render:function(e){return this.renderVN(e)}});
|
|
1
|
+
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)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_store=require("./store"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_anime=require("../../ui/src/anime"),_util=require("./util"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,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 r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _createForOfIteratorHelper(e,t){var r,o,a,i,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return a=!(o=!0),{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw r}}};if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),i=0,{s:t=function(){},n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}var _createComponentLog=(0,_log.createComponentLog)("tree"),warnLog=_createComponentLog.warnLog,errLog=_createComponentLog.errLog,crossListDragRowObj=null;function eqRowKey(e,t){return""+e==""+t}function getRowKeyByField(e,t){return e?""+(e[t]||""):""}function getRowIdByField(e,t){return e?(e=getRowKeyByField(e,t),(0,_utils.enModelValue)(e)):""}function createReactData(){return{scrollYLoad:!1,bodyHeight:0,headHeight:0,footHeight:0,customHeight:0,customMaxHeight:0,parentHeight:0,topSpaceHeight:0,rowList:[],selectRadioRow:null,currRowFlag:1,updateCheckboxFlag:1,isAllChecked:!1,isAllIndeterminate:!1,insertRowFlag:1,removeRowFlag:1,dragRow:null,dragTipText:"",isCrossDragRow:!1}}function createInternalData(){return{resizeObserver:void 0,fullData:[],afterList:[],fullKeyMaps:{},rowMaps:{},lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0},currentRow:null,selectCheckboxMaps:{},insertRowMaps:{},removeRowMaps:{}}}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeList",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,height:[Number,String],maxHeight:[Number,String],loading:Boolean,className:[String,Function],size:{type:String,default:function(){return(0,_ui.getConfig)().list.size||(0,_ui.getConfig)().size}},autoResize:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.autoResize}},syncResize:[Boolean,String,Number],showSeq:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.showSeq}},showRadio:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.showRadio}},checkRowKey:[String,Number],radioConfig:Object,showCheckbox:{type:Boolean,default:function(){return(0,_ui.getConfig)().list.showCheckbox}},checkRowKeys:Array,checkboxConfig:Object,rowConfig:Object,dragConfig:Object,menuConfig:Object,virtualYConfig:Object,scrollY:Object},data:function(){var e=_xeUtils.default.uniqueId(),t=createReactData();return Object.assign(Object.assign({},{}),{xID:e,reactData:t,crossListDragRowInfo:_store.crossListDragRowGlobal,reFlag:0})},computed:Object.assign(Object.assign({},{}),{computeRowOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.rowConfig,this.rowConfig)},computeDragOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.dragConfig,this.dragConfig)},computeSYOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.virtualYConfig||(0,_ui.getConfig)().list.scrollY,this.virtualYConfig||this.scrollY)},computeKeyField:function(){return this.computeRowOpts.keyField||""},computeIsDrag:function(){var e=this.dragConfig,t=this.computeDragOpts;return e&&(0,_utils.isEnableConf)(t)},computeRowHeight:function(){return this.computeRowOpts.height},computeRadioOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().list.radioConfig,this.radioConfig)},computeCheckboxOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().list.checkboxConfig,this.checkboxConfig)},computeMenuOpts:function(){return Object.assign({},(0,_ui.getConfig)().list.menuConfig,this.menuConfig)},computeWrapperStyles:function(){var e=this.computeRowHeight,t={};return e&&(t["--vxe-ui-list-row-height"]=(0,_dom.toCssUnit)(e)),t},computeVirtualStyles:function(){var e=this.reactData,t=this.height,r=this.maxHeight,o=e.customHeight,a=e.customMaxHeight,i=e.headHeight,e=e.footHeight,n={};return t?n.height=(0,_dom.toCssUnit)(Math.max(20,o-i-e)):r&&(n.height="auto",n.maxHeight=(0,_dom.toCssUnit)(Math.max(20,a-i-e))),n}}),methods:{dispatchEvent:function(e,t,r){this.$emit(e,(0,_ui.createEvent)(r,{$list:this},t))},emitCheckboxMode:function(e){this.$emit("update:checkRowKeys",e)},emitRadioMode:function(e){this.$emit("update:checkRowKey",e)},callSlot:function(e,t,r){var o=this.$scopedSlots;return e&&(_xeUtils.default.isString(e)&&(e=o[e]||null),_xeUtils.default.isFunction(e))?(0,_vn.getSlotVNs)(e.call(this,t,r)):[]},getRowId:function(e){return getRowIdByField(e,this.computeKeyField)},updateRadioModeValue:function(){var e=this.reactData,t=this.internalData,r=this.checkRowKey,t=t.fullKeyMaps;r?(t=t[r],e.selectRadioRow=t||null):e.selectRadioRow=null},updateCheckboxModeValue:function(){var e=this.internalData,t=this.checkRowKeys,r=e.fullKeyMaps,o=this.computeKeyField,a={};if(t&&t.length){var i,n=_createForOfIteratorHelper(t);try{for(n.s();!(i=n.n()).done;){var s=r[i.value];s&&(a[getRowIdByField(s,o)]=s)}}catch(e){n.e(e)}finally{n.f()}}e.selectCheckboxMaps=a,this.updateCheckboxStatus()},updateAfterDataIndex:function(){var e=this.internalData,t=e.afterList,a=e.rowMaps,i=this.computeKeyField,n=0;t.forEach(function(e,t){var r=getRowIdByField(e,i),o=a[r];o?o._index=n:(o={item:e,index:t,$index:-1,_index:n},a[r]=o),n++})},cacheRowMap:function(){var e=this.internalData,t=e.fullData,r=this.computeKeyField,o={};t.forEach(function(e){var t=getRowKeyByField(e,r);o[t]=e}),e.fullKeyMaps=o},loadData:function(e){var t=this,r=t.reactData,o=t.internalData,a=o.scrollYStore,i=t.computeSYOpts,e=e?e.slice(0):[];return Object.assign(a,{startIndex:0,endIndex:1,visibleSize:0}),o.fullData=e,o.insertRowMaps={},r.insertRowFlag++,o.removeRowMaps={},r.removeRowFlag++,r.scrollYLoad=!!i.enabled&&-1<i.gt&&(0===i.gt||i.gt<=e.length),t.cacheRowMap(),t.handleData(!0),t.updateRadioModeValue(),t.updateCheckboxModeValue(),t.computeScrollLoad().then(function(){t.refreshScroll()})},reloadData:function(e){return this.clearScroll(),this.loadData(e)},getFullData:function(){return this.internalData.fullData},calcTableHeight:function(e){var t=this.reactData.parentHeight,e=this[e],r=0;return r=e?"100%"===e||"auto"===e?t:(r=(0,_dom.isScale)(e)?Math.floor((_xeUtils.default.toInteger(e)||1)/100*t):_xeUtils.default.toNumber(e),Math.max(40,r)):r},updateHeight:function(){var e=this,t=e.reactData,r=e.$refs.refHeaderElem,o=e.$refs.refFooterElem;t.headHeight=r?Math.floor(r.offsetHeight):0,t.footHeight=o?Math.floor(o.offsetHeight):0,t.customHeight=e.calcTableHeight("height"),t.customMaxHeight=e.calcTableHeight("maxHeight")},updateYSpace:function(){var e=this.reactData,t=this.internalData,r=e.scrollYLoad,o=t.scrollYStore;e.bodyHeight=r?t.fullData.length*o.rowHeight:0,e.topSpaceHeight=r?Math.max(o.startIndex*o.rowHeight,0):0},updateAfterFullData:function(){var e=this.internalData,t=e.fullData;e.afterList=t.slice(0),this.updateAfterDataIndex()},handleData:function(e){var t=this,r=t.reactData,o=t.internalData,a=r.scrollYLoad,i=o.fullData,n=o.scrollYStore,s=o.rowMaps,l=t.computeKeyField,o=(e&&t.updateAfterFullData(),a?i.slice(n.startIndex,n.endIndex):i.slice(0));return l&&o.forEach(function(e,t){e=getRowIdByField(e,l),e=s[e];e&&(e.$index=t)}),r.rowList=o,t.$nextTick()},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var n=this,s=n.reactData,l=n.internalData,c=n.browseObj;return n.$nextTick().then(function(){var e,t=s.scrollYLoad,r=l.scrollYStore,o=n.$refs.refVirtualBody,a=n.computeSYOpts,i=0;(e=o?(e=a.sItem?o.querySelector(a.sItem):e)||o.children[0]:e)&&(i=e.offsetHeight),i=Math.max(12,i),r.rowHeight=i,t?(o=n.$refs.refVirtualWrapper,e=Math.max(8,Math.ceil(o.clientHeight/i)),t=a.oSize?_xeUtils.default.toNumber(a.oSize):c.edge?10:0,r.offsetSize=t,r.visibleSize=e,r.endIndex=Math.max(r.startIndex+e+t,r.endIndex),n.updateYData()):n.updateYSpace()})},clearScroll:function(){var e=this.$refs.refVirtualWrapper;return e&&(e.scrollTop=0),this.$nextTick()},scrollTo:function(e,t){var r=this,o=r.reactData,a=r.$refs.refVirtualWrapper;return e&&!_xeUtils.default.isNumber(e)&&(t=e.top,e=e.left),_xeUtils.default.isNumber(e)&&(a.scrollLeft=e),_xeUtils.default.isNumber(t)&&(a.scrollTop=t),o.scrollYLoad?new Promise(function(e){setTimeout(function(){r.$nextTick(function(){e()})},50)}):r.$nextTick()},refreshScroll:function(){var e=this.internalData,t=e.lastScrollLeft,r=e.lastScrollTop;return this.clearScroll().then(function(){if(t||r)return e.lastScrollLeft=0,e.lastScrollTop=0,scrollTo(t,r)})},recalculate:function(){var e=this,t=e.reactData,r=e.$refs.refElem;if(r){var o,a=r.parentElement,i=0;if(a&&(o=getComputedStyle(a),i=a.clientHeight-Math.ceil(_xeUtils.default.toNumber(o.paddingLeft)+_xeUtils.default.toNumber(o.paddingRight))),t.parentHeight=i,e.updateHeight(),r.clientWidth&&r.clientHeight)return e.computeScrollLoad()}return e.$nextTick()},loadYData:function(e){var t=this.internalData.scrollYStore,r=t.startIndex,o=t.endIndex,a=t.visibleSize,i=t.offsetSize,e=e.target.scrollTop,e=Math.floor(e/t.rowHeight),n=Math.max(0,e-1-i),i=e+a+i;!(e<=r||o-a-1<=e)||r===n&&o===i||(t.startIndex=n,t.endIndex=i,this.updateYData())},scrollEvent:function(e){var t=this.reactData,r=this.internalData,o=e.target,a=o.scrollTop,o=o.scrollLeft,i=o!==r.lastScrollLeft,n=a!==r.lastScrollTop;r.lastScrollTop=a,r.lastScrollLeft=o,t.scrollYLoad&&this.loadYData(e),this.dispatchEvent("scroll",{scrollLeft:o,scrollTop:a,isX:i,isY:n},e)},getRowKey:function(e){return getRowKeyByField(e,this.computeKeyField)},eqRowKey:eqRowKey,eqRow:function(e,t){return!(!e||!t)&&(e===t||eqRowKey(this.getRowId(e),this.getRowId(t)))},eqRowByKey:function(e,t){return e&&eqRowKey(this.getRowKey(e),t)},findRow:function(e,t){var r=this;return t?_xeUtils.default.find(e,function(e){return r.eqRow(e,t)}):null},findRowByKey:function(e,t){var r=this.computeKeyField;return _xeUtils.default.find(e,function(e){return eqRowKey(getRowIdByField(e,r),t)})},findRowIndexOf:function(e,t){var r=this;return t?_xeUtils.default.findIndexOf(e,function(e){return r.eqRow(e,t)}):-1},findRowIndexOfByKey:function(e,t){var r=this.computeKeyField;return _xeUtils.default.findIndexOf(e,function(e){return eqRowKey(getRowIdByField(e,r),t)})},isCheckedByRadioRowKey:function(e){var t=this.reactData.selectRadioRow;return this.getRowKey(t)===e},isCheckedByRadioRow:function(e){return this.isCheckedByRadioRowKey(this.getRowKey(e))},isCheckedByCheckboxRowKey:function(e){var t=this.reactData,r=this.internalData,t=t.updateCheckboxFlag,r=r.selectCheckboxMaps;return!(!t||!r[e])},isCheckedByCheckboxRow:function(e){return this.isCheckedByCheckboxRowKey(this.getRowKey(e))},setCurrentRow:function(e){var t=this.reactData;return this.internalData.currentRow=e,t.currRowFlag++,this.$nextTick()},setCurrentRowByKey:function(e){var t=this.reactData,r=this.internalData,o=r.fullData;return r.currentRow=this.findRowByKey(o,e),t.currRowFlag++,this.$nextTick()},getCurrentRow:function(){return this.internalData.currentRow},getCurrentRowKey:function(){var e=this.internalData.currentRow;return e?this.getRowKey(e):null},clearCurrentRow:function(){var e=this.reactData;return this.internalData.currentRow=null,e.currRowFlag++,this.$nextTick()},setRadioRow:function(e){this.reactData.selectRadioRow=e;e=this.getRowKey(e);return this.emitRadioMode(e),this.$nextTick()},setRadioRowByKey:function(e){var t=this,r=t.reactData,o=t.internalData.fullData,r=(r.selectRadioRow=t.findRowByKey(o,e),e);return t.emitRadioMode(r),t.$nextTick()},getRadioRow:function(){return this.reactData.selectRadioRow},getRadioRowKey:function(){var e=this.reactData.selectRadioRow;return e?this.getRowKey(e):null},clearRadioRow:function(){return this.reactData.selectRadioRow=null,this.emitRadioMode(null),this.$nextTick()},setCheckboxRow:function(e,t){var r=this,o=r.internalData.selectCheckboxMaps,a=r.computeKeyField,e=((e?_xeUtils.default.isArray(e)?e:[e]:[]).forEach(t?function(e){var t=getRowIdByField(e,a);o[t]||(o[t]=e)}:function(e){e=getRowIdByField(e,a);o[e]&&delete o[e]}),r.getCheckboxRowKeys());return r.emitCheckboxMode(e),r.updateCheckboxStatus()},setCheckboxRowByKey:function(e,t){var r=this,o=r.internalData,a=o.selectCheckboxMaps,i=o.fullKeyMaps,n=r.computeKeyField,o=((e?_xeUtils.default.isArray(e)?e:[e]:[]).forEach(t?function(e){var t,e=i[e||""];e&&(t=getRowIdByField(e,n),e)&&!a[t]&&(a[t]=e)}:function(e){var e=i[e||""];e&&(e=getRowIdByField(e,n),a[e])&&delete a[e]}),r.getCheckboxRowKeys());return r.emitCheckboxMode(o),r.updateCheckboxStatus()},getCheckboxRecords:function(){var e=this.reactData,t=this.internalData,e=e.updateCheckboxFlag,t=t.selectCheckboxMaps,r=[];return e&&_xeUtils.default.each(t,function(e){e&&r.push(e)}),r},getCheckboxRows:function(){return this.getCheckboxRecords()},getCheckboxRowKeys:function(){var e=this.reactData,t=this.internalData,e=e.updateCheckboxFlag,t=t.selectCheckboxMaps,r=this.computeKeyField,o=[];return e&&_xeUtils.default.each(t,function(e){e&&(e=getRowKeyByField(e,r),o.push(e))}),o},clearCheckboxRow:function(){var e=this.reactData;this.internalData.selectCheckboxMaps={},e.updateCheckboxFlag++,e.isAllChecked=!1,e.isAllIndeterminate=!1;return this.emitCheckboxMode([]),this.$nextTick()},setAllCheckboxRow:function(e){var t=this,r=t.internalData,o=r.fullData,a=r.selectCheckboxMaps,i=t.computeKeyField;if(e){var n,s=[],l=_createForOfIteratorHelper(o);try{for(l.s();!(n=l.n()).done;){var c=n.value,u=getRowKeyByField(c,i);a[getRowIdByField(c,i)]=c,s.push(u)}}catch(e){l.e(e)}finally{l.f()}return t.emitCheckboxMode(s),t.updateCheckboxStatus()}return t.clearCheckboxRow()},updateCheckboxStatus:function(){var e=this,t=e.reactData,r=e.internalData,o=r.selectCheckboxMaps,r=r.fullData,a=e.computeKeyField,i=e.computeCheckboxOpts.checkMethod,n=!1,s=!1;if(i){var l,c=_createForOfIteratorHelper(r);try{for(c.s();!(l=c.n()).done;){var u=l.value;if(i({row:u,$list:e}))if(o[getRowIdByField(u,a)])n=!0;else if(s=!0,n)break}}catch(e){c.e(e)}finally{c.f()}}else{var d,h=_createForOfIteratorHelper(r);try{for(h.s();!(d=h.n()).done;)if(o[getRowIdByField(d.value,a)])n=!0;else if(s=!0,n)break}catch(e){h.e(e)}finally{h.f()}}return t.isAllChecked=n&&!s,t.isAllIndeterminate=n&&s,t.updateCheckboxFlag++,e.$nextTick()},changeCheckboxAllEvent:function(e){var t=!this.reactData.isAllChecked;t?this.setAllCheckboxRow(!0):this.clearCheckboxRow(),this.dispatchEvent("checkbox-all",{checked:t},e)},changeCheckboxEvent:function(e,t){var r=this,o=r.reactData,a=r.internalData,a=(e.preventDefault(),e.stopPropagation(),a.selectCheckboxMaps),i=r.computeCheckboxOpts.checkMethod,n=r.getRowKey(t);(!i||i({$list:r,row:t}))&&(i=!1,a[n]?delete a[n]:(i=!0,a[n]=t),o.updateCheckboxFlag++,r.updateCheckboxStatus(),n=_xeUtils.default.keys(a).map(_utils.deModelValue),r.emitCheckboxMode(n),r.dispatchEvent("checkbox-change",{row:t,value:n,checked:i},e))},changeCurrentEvent:function(e,t){var r=this.reactData,o=this.internalData;e.preventDefault();var a=this.computeRowOpts.currentMethod,i=!1;(i=a?!a({row:t}):i)||(o.currentRow=t,r.currRowFlag++,this.dispatchEvent("current-change",{row:t,checked:!0},e))},changeRadioEvent:function(e,t){var r,o=this,a=o.reactData,i=(e.preventDefault(),e.stopPropagation(),a.selectRadioRow),n=o.computeRadioOpts,s=n.strict,n=n.checkMethod,l=o.getRowKey(t);(!n||n({$list:o,row:t}))&&(n=l,r=!0,s&&i&&l===o.getRowKey(i)?(r=!1,a.selectRadioRow=null):a.selectRadioRow=t,o.emitRadioMode(n),o.dispatchEvent("radio-change",{row:t,value:n,checked:r},e))},handleRowDragEndClearStatus:function(){this.clearRowDragData(),this.clearCrossListDragStatus(),this.recalculate()},clearRowDropOrigin:function(){var t,e=this.$refs.refElem;e&&_xeUtils.default.arrayEach(e.querySelectorAll(".".concat(t="row--drag-origin")),function(e){(e.draggable=!1,_dom.removeClass)(e,t)})},updateRowDropOrigin:function(e){var t=this.computeSYOpts.sItem,r=this.$refs.refElem;r&&(e=this.getRowId(e),_xeUtils.default.arrayEach(r.querySelectorAll('.vxe-list--row[rowid="'.concat(e,'"]')+(t?"".concat(t,'[rowid="').concat(e,'"]'):"")),function(e){(0,_dom.addClass)(e,"row--drag-origin")}))},updateRowDropTipContent:function(e){var t=this.reactData,r=t.dragRow,o=this.computeDragOpts.tooltipMethod,a="";a=o?"".concat(o({$list:this,row:r})||""):(0,_ui.getI18n)("vxe.list.dragTip",[e.textContent||""]),t.dragTipText=a},hideDropTip:function(){var e=this.$refs.refDragTipElem,t=this.$refs.refDragRowLineElem;e&&(e.style.display=""),t&&(t.style.display="")},clearCrossListDragStatus:function(){var e=(0,_store.getCrossListDragRowInfo)(this);crossListDragRowObj=null,e.row=null},clearDragStatus:function(){var e=this.reactData;e.dragRow&&(this.hideDropTip(),this.clearRowDropOrigin(),this.clearCrossListDragStatus(),e.dragRow=null)},handleRowDragMousedownEvent:function(e,t){var r=this,o=r.reactData,a=(0,_store.getCrossListDragRowInfo)(r),i=(e.stopPropagation(),t.row),n=r.computeDragOpts,s=n.isCrossListDrag,l=n.dragStartMethod,c=e.currentTarget,n="row"===n.trigger?c:c.parentElement.parentElement;r.clearRowDropOrigin(),l&&!l(t)?(n.draggable=!1,o.dragRow=null,r.hideDropTip()):(s&&(a.row=i,crossListDragRowObj={$oldList:r,$newList:null}),c={row:i},o.dragRow=i,n.draggable=!0,r.updateRowDropOrigin(i),r.updateRowDropTipContent(n),r.dispatchEvent("row-dragstart",c,e))},handleRowDragMouseupEvent:function(){this.clearDragStatus()},showDropTip:function(e,t,r,o){var a,i,n,s,l=this.$refs.refElem;l&&(a=l.getBoundingClientRect(),s=l.clientHeight,t&&(i=this.$refs.refDragRowLineElem)&&(r?(n=t.getBoundingClientRect(),t=t.clientHeight,s<(n=Math.max(1,n.y-a.y))+t&&(t=s-n),i.style.display="block",i.style.top="".concat(n,"px"),i.style.height="".concat(t,"px"),i.setAttribute("drag-pos",o)):i.style.display=""),s=this.$refs.refDragTipElem)&&(s.style.display="block",s.style.top="".concat(Math.min(l.clientHeight-l.scrollTop-s.clientHeight,e.clientY-a.y),"px"),s.style.left="".concat(Math.min(l.clientWidth-l.scrollLeft-s.clientWidth-1,e.clientX-a.x),"px"),s.setAttribute("drag-status",r?"normal":"disabled"))},clearRowDragData:function(){var e=this.reactData,t=this.$refs.refElem;this.hideDropTip(),this.clearRowDropOrigin(),(0,_anime.clearRowAnimate)(t,[".vxe-list--row"]),e.dragRow=null},handleRowDragSwapEvent:function(t,r,o,a){var e,u,d,h,f,i,n,s,l,g=this,p=g.reactData,w=g.internalData,c=w.fullData,R=g.computeDragOpts,v=R.animation,R=R.dragEndMethod||(R?R.dragEndMethod:null),m="bottom"===a?1:0,D=g.$refs.refElem,x={status:!1};if(D&&o&&r){if(o!==r)return e={oldRow:r,newRow:o,dragRow:r,dragPos:a,offsetIndex:m},u=g.getRowId(r),d=g.findRowIndexOfByKey(c,u),n=g.getRowKey(o),h=0,f=-1,v&&(n=D.querySelector('.vxe-list--row[rowid="'.concat(n,'"]')),i=D.querySelector('.vxe-list--row[rowid="'.concat(u,'"]')),(n=n||i)&&(h=n.offsetHeight),i)&&(f=i.offsetTop),l=s=-1,Promise.resolve(!R||R(e)).then(function(e){if(!e)return x;s=g.findRowIndexOf(c,r),c.splice(s,1);e=g.findRowIndexOf(c,o);return l=e+m,c.splice(l,0,r),g.handleData(),p.scrollYLoad&&g.updateYSpace(),t&&g.dispatchEvent("row-dragend",{oldRow:r,newRow:o,dragRow:r,dragPos:a,offsetIndex:m,_index:{newIndex:l,oldIndex:s}},t),g.$nextTick().then(function(){var e,t,r,o,a,i,n,s,l,c;v&&(n=p.rowList,c=w.fullData,l=g.findRowIndexOfByKey(c,u),s=c[0],s=g.findRowIndexOf(c,s),e=D,-1<s&&(a=s+c.length,r=t=-1,o=1,d<s?(t=0,r=l-s):a<d?(t=g.findRowIndexOfByKey(n,u)+1,r=c.length,o=-1):d<l?r=(t=d-s)+l-d:(r=(t=l-s)+d-l+1,o=-1),(a=c.slice(t,r)).length)&&(i=[],a.forEach(function(e){e=g.getRowId(e);i.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),n=e.querySelectorAll(i.join(",")),(0,_anime.moveRowAnimateToTb)(n,o*h)),s=['.vxe-list--row[rowid="'.concat(u,'"]')],c=(l=e.querySelectorAll(s.join(",")))[0],-1<f)&&c&&(0,_anime.moveRowAnimateToTb)(l,f-c.offsetTop),g.recalculate()}).then(function(){return{status:!0}})}).catch(function(){return x}).then(function(e){return g.clearRowDragData(),g.clearCrossListDragStatus(),e});g.clearRowDragData(),g.clearCrossListDragStatus()}return Promise.resolve(x)},handleRowDragDragstartEvent:function(e){e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0)},handleRowDragDragendEvent:function(e){var t=this,r=t.reactData,o=t.internalData,r=r.dragRow,a=o.prevDragRow,o=o.prevDragPos;if(t.computeDragOpts.isCrossListDrag&&crossListDragRowObj){var i=crossListDragRowObj.$newList;if(i&&i.xID!==t.xID)return void i.handleCrossListRowDragInsertEvent(e)}t.handleRowDragSwapEvent(e,r,a,o)},handleRowDragDragoverEvent:function(e){var t,r=this,o=r.reactData,a=r.internalData,o=o.dragRow,i=a.fullData,n=(o||e.preventDefault(),e.currentTarget),s=n.getAttribute("rowid")||"",i=r.findRowByKey(i,s);i&&(e.preventDefault(),t=e.clientY-n.getBoundingClientRect().y<n.clientHeight/2?"top":"bottom",a.prevDragRow=i,a.prevDragPos=t,o&&r.getRowId(o)===s?r.showDropTip(e,n,!1,t):(a={oldRow:o,targetRow:i,dragPos:t,dragRow:o,offsetIndex:"bottom"==t?1:0},r.showDropTip(e,n,!0,t),r.dispatchEvent("row-dragover",a,e)))},handleRowMousedownEvent:function(e,t){var r=this.computeDragOpts,o=this.computeIsDrag,a=r.trigger,r=r.disabledMethod,i=!1,t={row:t,$list:this};!(i=o?"row"===a:i)||r&&r(t)||this.handleRowDragMousedownEvent(e,t)},handleRowClickEvent:function(e,t){var r=this,o=r.reactData,a=r.internalData,i=r.showRadio,n=r.showCheckbox,s=a.currentRow,l=r.computeRadioOpts,c=r.computeCheckboxOpts,u=!1,d=!1,h=!1;r.computeRowOpts.isCurrent?(u=!0,r.changeCurrentEvent(e,t)):s&&(a.currentRow=null,o.currRowFlag++),i&&"row"===l.trigger&&(d=!0,r.changeRadioEvent(e,t)),n&&"row"===c.trigger&&(h=!0,r.changeCheckboxEvent(e,t)),r.dispatchEvent("row-click",{row:t,triggerCurrent:u,triggerRadio:d,triggerCheckbox:h},e)},handleRowDblclickEvent:function(e,t){this.dispatchEvent("row-dblclick",{row:t},e)},insertListRow:function(e,t){var r=this.internalData,o=r.fullData,a=r.rowMaps,i=this.computeKeyField,n=t?"push":"unshift";e.forEach(function(e){var t=getRowIdByField(e,i),r=(0,_util.getItemCacheObj)(e);o[n](e),a[t]=r})},handleInsertRowAt:function(e,t,r){var o=this,a=o.reactData,i=o.internalData,n=i.fullData,s=i.rowMaps,l=i.removeRowMaps,c=i.insertRowMaps,u=o.computeKeyField;if(!u)return errLog("vxe.error.reqSupportProp",["insert() | insertAt() | insertNextAt()","row-config.keyField"]),Promise.resolve({row:null,rows:[]});_xeUtils.default.isArray(e)||(e=[e]);var d,h=t;return(_xeUtils.default.isString(t)||_xeUtils.default.isNumber(t))&&(i=s[t])&&(h=i.item),e.length?(d=e.map(function(e){return _xeUtils.default.assign({},e)}),_xeUtils.default.eqNull(h)?o.insertListRow(d,!1):-1===h?o.insertListRow(d,!0):-1<(t=n.findIndex(function(e){return h[u]===e[u]}))?(d.forEach(function(e){var t=getRowIdByField(e,u),e=(0,_util.getItemCacheObj)(e);s[t]=e}),i=t,r&&(i+=1),n.splice.apply(n,[i,0].concat(_toConsumableArray(d)))):(warnLog("vxe.error.unableInsert"),o.insertListRow(d,!0)),d.forEach(function(e){var t=getRowIdByField(e,u);l[t]?(delete l[t],c[t]&&delete c[t]):c[t]=e}),a.removeRowFlag++,a.insertRowFlag++,o.cacheRowMap(),o.handleData(!0),o.updateAfterDataIndex(),o.updateCheckboxStatus(),a.scrollYLoad&&o.updateYSpace(),o.$nextTick().then(function(){return{row:d.length?d[d.length-1]:null,rows:d}})):Promise.resolve({row:null,rows:[]})},insert:function(e){return this.handleInsertRowAt(e,null)},insertAt:function(e,t){return this.handleInsertRowAt(e,t)},insertNextAt:function(e,t){return this.handleInsertRowAt(e,t,!0)},getInsertRecords:function(){var e=this.internalData.insertRowMaps,t=[];return _xeUtils.default.each(e,function(e){t.push(e)}),t},isInsertByRow:function(e){var t=this.reactData,r=this.internalData,e=this.getRowId(e);return!!t.insertRowFlag&&!!r.insertRowMaps[e]},remove:function(e){var r,o=this,t=o.reactData,a=o.internalData,i=a.fullData,n=a.insertRowMaps,s=a.removeRowMaps;return o.computeKeyField?(r=[],e?_xeUtils.default.isArray(e)||(e=[e]):e=i,e.length?(e.forEach(function(e){var t;o.isInsertByRow(e)||(t=o.getRowId(e),s[t]=e)}),i===e?(e=r=i.slice(0),a.fullData=[]):e.forEach(function(e){var t=o.getRowId(e),e=_xeUtils.default.findIndexOf(i,function(e){return t===o.getRowId(e)});-1<e&&(e=i.splice(e,1),r.push(e[0]))}),e.forEach(function(e){e=o.getRowId(e);n[e]&&delete n[e]}),t.removeRowFlag++,t.insertRowFlag++,o.cacheRowMap(),o.handleData(!0),o.updateAfterDataIndex(),o.updateCheckboxStatus(),t.scrollYLoad&&o.updateYSpace(),o.$nextTick().then(function(){return o.recalculate()}).then(function(){return{row:r.length?r[r.length-1]:null,rows:r}})):Promise.resolve({row:null,rows:[]})):(errLog("vxe.error.reqSupportProp",["insert() | insertAt() | insertNextAt()","row-config.keyField"]),Promise.resolve({row:null,rows:[]}))},getRemoveRecords:function(){var e=this.internalData.removeRowMaps,t=[];return _xeUtils.default.each(e,function(e){t.push(e)}),t},isRemoveByRow:function(e){var t=this.reactData,r=this.internalData,e=this.getRowId(e);return!!t.removeRowFlag&&!!r.removeRowMaps[e]},getRecordset:function(){return{insertRecords:this.getInsertRecords(),removeRecords:this.getRemoveRecords()}},handleCrossListRowDragCancelEvent:function(){this.clearRowDragData(),this.clearCrossListDragStatus()},handleCrossListRowDragFinishEvent:function(e){var r,t,o,a=this,i=a.reactData,n=a.internalData,s=(0,_store.getCrossListDragRowInfo)(a),i=i.rowList,n=n.rowMaps,l=a.computeDragOpts,c=l.animation,u=a.$refs.refElem;u&&l.isCrossListDrag&&crossListDragRowObj&&s&&(l=s.row)&&(n=n[s=a.getRowId(l)],r=0,t=-1,n&&(c&&(s=u.querySelector('.vxe-list--row[rowid="'.concat(s,'"]')))&&(r=s.offsetHeight),t=n.$index),o=-1<t&&t<i.length-1?i.slice(t+1):[],a.remove([l]).then(function(){var t,e;c&&r&&o.length&&(e=u,t=[],o.forEach(function(e){e=a.getRowId(e);t.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),e=e.querySelectorAll(t.join(",")),(0,_anime.moveRowAnimateToTb)(e,r))}),a.dispatchEvent("row-remove-dragend",{row:l},e),a.handleRowDragEndClearStatus())},handleCrossListRowDragoverEmptyEvent:function(e){var t,r,o=this,a=o.reactData,i=o.internalData,n=a.rowList;o.computeDragOpts.isCrossListDrag&&crossListDragRowObj&&!n.length&&(t=(n=crossListDragRowObj).$oldList,n=n.$newList,t)&&(r=t).xID!==o.xID&&(n&&n.xID!==o.xID&&n.hideCrossListRowDropClearStatus(),e.preventDefault(),t.hideCrossListRowDropClearStatus(),crossListDragRowObj.$newList=o,i.prevDragRow=null,a.dragTipText=r.dragTipText,o.showDropTip(e,e.currentTarget,!0,""))},handleCrossListRowDragInsertEvent:function(r){var o,a,n,s,i,l,c=this,u=c.reactData,d=c.internalData,e=(0,_store.getCrossListDragRowInfo)(c),h=d.prevDragRow,f=d.prevDragPos,t=c.computeDragOpts,g=t.animation,p=t.dragEndMethod;t.isCrossListDrag&&crossListDragRowObj&&e&&(o=e.row,a=crossListDragRowObj.$oldList,n=c.$refs.refElem)&&a&&o&&(i=-1,t={oldRow:s=o,newRow:h,dragRow:s,dragPos:f,offsetIndex:i=h?"bottom"===f?1:0:i},l={status:!1},Promise.resolve(!p||p(t)).then(function(e){if(!e)return a&&a.xID!==c.xID&&a.handleCrossListRowDragCancelEvent(r),c.handleRowDragEndClearStatus(),l;var e=Promise.resolve(),t=[s];a.handleCrossListRowDragFinishEvent(r),e=h?"bottom"===f?c.insertNextAt(t,h):c.insertAt(t,h):c.insert(t),c.dispatchEvent("row-insert-dragend",{oldRow:o,newRow:h,dragRow:s,dragPos:f,offsetIndex:i},r),c.clearRowDragData(),e.then(function(){var t,e=u.rowList,r=d.rowMaps,o=c.getRowId(s),r=r[o],a=0,i=-1,o=(r&&(g&&(o=n.querySelector('.vxe-list--row[rowid="'.concat(o,'"]')))&&(a=o.offsetHeight),i=r.$index),-1<i?e.slice(i):[]);g&&a&&o.length&&(r=n,t=[],o.forEach(function(e){e=c.getRowId(e);t.push('.vxe-list--row[rowid="'.concat(e,'"]'))}),e=r.querySelectorAll(t.join(",")),(0,_anime.moveRowAnimateToTb)(e,-a))})}))},hideCrossListRowDropClearStatus:function(){this.hideDropTip()},handleContextmenuEvent:function(o,a){var i=this,e=i.reactData,t=i.internalData,r=i.menuConfig,n=i.computeMenuOpts,s=i.computeRowOpts.isCurrent;(r?(0,_utils.isEnableConf)(n):n.enabled)&&(r=n.options,(n=n.visibleMethod)&&!n({$list:i,options:r,row:a})||(s?i.changeCurrentEvent(o,a):t.currentRow&&(t.currentRow=null,e.currRowFlag++),_ui.VxeUI.contextMenu&&_ui.VxeUI.contextMenu.openByEvent(o,{options:r,events:{optionClick:function(e){var t=e.option,r=_ui.menus.get(t.code),r=r?r.listMenuMethod:null,t={menu:t,row:a,$event:o,$list:i};r&&r(t,o),i.dispatchEvent("menu-click",t,e.$event)}}}))),i.dispatchEvent("row-menu",{row:a},o)},renderDragTip:function(e){var t=this,r=t.reactData,o=r.dragRow,r=r.dragTipText,a=t.computeDragOpts;return t.computeIsDrag?e("div",{class:"vxe-list--drag-wrapper"},[e("div",{ref:"refDragRowLineElem",class:["vxe-list--drag-row-line",{"is--guides":a.showGuidesStatus}]}),o&&a.showDragTip?e("div",{ref:"refDragTipElem",class:"vxe-list--drag-sort-tip"},[e("div",{class:"vxe-list--drag-sort-tip-wrapper"},[e("div",{class:"vxe-list--drag-sort-tip-status"},[e("span",{class:["vxe-list--drag-sort-tip-normal-status",(0,_ui.getIcon)().LIST_DRAG_STATUS_NODE]}),e("span",{class:["vxe-list--drag-sort-tip-disabled-status",(0,_ui.getIcon)().LIST_DRAG_DISABLED]})]),e("div",{class:"vxe-list--drag-sort-tip-content"},r)])]):(0,_ui.renderEmptyElement)(t)]):(0,_ui.renderEmptyElement)(t)},renderRadio:function(e,t,r,o,a){var i=this,n=i.showRadio,s=i.computeRadioOpts,l=s.showIcon,s=s.visibleMethod,s=!s||s({$list:i,row:t});return n&&l&&s?e("div",{key:"ct2",class:["vxe-list--radio-option",{"is--checked":a,"is--disabled":o}],on:{click:function(e){o||i.changeRadioEvent(e,t)}}},[e("span",{class:["vxe-radio--icon",a?(0,_ui.getIcon)().RADIO_CHECKED:o?(0,_ui.getIcon)().RADIO_DISABLED_UNCHECKED:(0,_ui.getIcon)().RADIO_UNCHECKED]})]):(0,_ui.renderEmptyElement)(i)},renderCheckbox:function(e,t,r,o,a){var i=this,n=i.showCheckbox,s=i.computeCheckboxOpts,l=s.showIcon,s=s.visibleMethod,s=!s||s({$list:i,row:t});return n&&l&&s?e("div",{key:"ct3",class:["vxe-list--checkbox-option",{"is--checked":a,"is--disabled":o}],on:{click:function(e){o||i.changeCheckboxEvent(e,t)}}},[e("span",{class:["vxe-checkbox--icon",a?(0,_ui.getIcon)().CHECKBOX_CHECKED:o?(0,_ui.getIcon)().CHECKBOX_DISABLED_UNCHECKED:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})]):(0,_ui.renderEmptyElement)(i)},renderRow:function(e,t,r){var o=this,a=o.reactData,i=o.internalData,n=o.$scopedSlots,s=o.showRadio,l=o.showCheckbox,c=a.selectRadioRow,u=a.currRowFlag,a=a.updateCheckboxFlag,d=i.selectCheckboxMaps,i=i.currentRow,h=n.content,n=n.extra,f=o.computeDragOpts,g=f.trigger,p=f.icon,w=f.disabledMethod,f=f.visibleMethod,R=o.computeRadioOpts,v=o.computeCheckboxOpts,m=o.computeRowOpts,D=m.useKey,x=m.contentField,y=m.className,m=m.isCurrent,b=o.computeIsDrag,C=o.computeKeyField,_=y&&_xeUtils.default.isFunction(y),D=C||D||b||m||s||l,m=D&&C?getRowIdByField(t,C):"",k=(0,_utils.enModelValue)(m),I={row:t,$list:o},E=!1,S=!1,c=(s&&(E=c&&(t===c||o.eqRowByKey(c,m)),S=!!R.checkMethod&&!R.checkMethod({$list:o,row:t})),!1),R=!1,a=(l&&(c=!(!a||!d[k]),R=!!v.checkMethod&&!v.checkMethod({$list:o,row:t})),[]),M=(s&&a.push(o.renderRadio(e,t,k,S,E)),l&&a.push(o.renderCheckbox(e,t,k,R,c)),!1),v=(b&&C&&(!f||f(I))&&(d={},"row"!==g&&(M=!(!w||!w(I)),d.mousedown=function(e){M||o.handleRowDragMousedownEvent(e,I)},d.mouseup=o.handleRowDragMouseupEvent),a.push(e("div",{key:"ct1",class:"vxe-list--row-drag"},[e("span",{class:"vxe-list--drag-handle",on:d},[e("i",{class:p||(0,_ui.getIcon)().LIST_DRAG})])]))),a.push(e("div",{key:"ct5",class:"vxe-list--row-content"},h?h(I):x?(0,_utils.getText)(t[x]):"")),n&&a.push(e("div",{key:"ct7",class:"vxe-list--row-extra"},n(I))),{mousedown:function(e){o.handleRowMousedownEvent(e,t)},mouseup:o.handleRowDragMouseupEvent,click:function(e){o.handleRowClickEvent(e,t)},dblclick:function(e){o.handleRowDblclickEvent(e,t)},contextmenu:function(e){o.handleContextmenuEvent(e,t)}});return b&&(v.dragstart=o.handleRowDragDragstartEvent,v.dragend=o.handleRowDragDragendEvent,v.dragover=o.handleRowDragDragoverEvent),e("div",{key:D&&C?k:r,class:["vxe-list--row",_?y(I):y||"",{"is--drag-disabled":M,"is--current":u&&i&&o.eqRowByKey(i,m),"is-radio--disabled":S,"is-radio--checked":E,"is-checkbox--disabled":R,"is-checkbox--checked":c}],attrs:D&&C?{rowid:k}:void 0,on:v},a)},renderVN:function(r){var o=this,e=o.reactData,t=o.$scopedSlots,a=o.showCheckbox,i=o.className,n=o.loading,s=e.bodyHeight,l=e.topSpaceHeight,c=e.rowList,u=e.isAllChecked,e=e.isAllIndeterminate,d=t.default,h=t.header,t=t.footer,f=o.computeSize,g=o.computeWrapperStyles,p=o.computeVirtualStyles,w=o.computeRadioOpts,R=o.computeCheckboxOpts,v=o.computeDragOpts,m=v.trigger,D=o.computeRowOpts,x=D.isHover,D=D.padding,a=a&&!1!==R.showHeader,y={};return v.isCrossListDrag&&!c.length&&(y.dragover=o.handleCrossListRowDragoverEmptyEvent),r("div",{ref:"refElem",class:["vxe-list",i?_xeUtils.default.isFunction(i)?i({$list:o}):i:"",_defineProperty(_defineProperty({},"size--".concat(f),f),"is--loading",n)],on:y,style:g},[h||a?r("div",{ref:"refHeaderElem",class:"vxe-list--header-wrapper"},[a?r("div",{class:"vxe-list--header-left"},[r("div",{class:["vxe-list--checkbox-header",{"is--checked":u,"is--indeterminate":e}],on:{click:o.changeCheckboxAllEvent}},[r("span",{class:["vxe-checkbox--icon",u?(0,_ui.getIcon)().CHECKBOX_CHECKED:e?(0,_ui.getIcon)().CHECKBOX_INDETERMINATE:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})])]):(0,_ui.renderEmptyElement)(o),h?r("div",{class:"vxe-list--header-content"},h({items:c,$list:o})):(0,_ui.renderEmptyElement)(o)]):(0,_ui.renderEmptyElement)(o),r("div",{ref:"refVirtualWrapper",class:"vxe-list--virtual-wrapper",style:p,on:{scroll:o.scrollEvent}},[r("div",{class:"vxe-list--y-space",style:{height:s?"".concat(s,"px"):""}}),r("div",{ref:"refVirtualBody",class:["vxe-list--body",{"trigger--row":"row"===m,"checkbox--highlight":R.highlight,"radio--highlight":w.highlight,"row--hover":x,"is--padding":D}],style:{marginTop:l?"".concat(l,"px"):""}},d?d({items:c,$list:o}):c.map(function(e,t){return o.renderRow(r,e,t)}))]),t?r("div",{ref:"refFooterElem",class:"vxe-list--footer-wrapper"},t({items:c,$list:o})):(0,_ui.renderEmptyElement)(o),o.renderDragTip(r),r(_loading.default,{class:"vxe-list--loading",props:{value:n}})])}},watch:{data:function(){this.loadData(this.data||[])},height:function(){this.reFlag++},maxHeight:function(){this.reFlag++},syncResize:function(){this.reFlag++},computeRowHeight:function(){this.reFlag++},reFlag:function(){var e=this;e.$nextTick(function(){e.recalculate()})},checkRowKey:function(){this.updateRadioModeValue()},checkRowKeys:function(){this.updateCheckboxModeValue()}},created:function(){this.internalData=createInternalData(),this.browseObj=_xeUtils.default.browse(),this.loadData(this.data||[])},mounted:function(){var e=this,t=e,r=e.internalData,o=t.showSeq,a=t.showRadio,i=t.showCheckbox,n=e.computeRowOpts,s=n.useKey,n=n.keyField,l=e.computeIsDrag;n||(o&&errLog("vxe.error.reqSupportProp",["show-seq","row-config.keyField"]),a&&errLog("vxe.error.reqSupportProp",["show-radio","row-config.keyField"]),i&&errLog("vxe.error.reqSupportProp",["show-checkbox","row-config.keyField"]),l&&errLog("vxe.error.reqSupportProp",["drag-config","row-config.keyField"])),s&&!n&&errLog("vxe.error.reqSupportProp",["row-config.useKey","row-config.keyField"]),t.autoResize&&(o=e.$refs.refElem,(a=_ui.globalResize.create(function(){return e.recalculate()})).observe(o),o&&a.observe(o.parentElement),r.resizeObserver=a),e.recalculate(),_ui.globalEvents.on(e,"resize",e.recalculate)},activated:function(){var e=this;e.recalculate().then(function(){return e.refreshScroll()})},beforeDestroy:function(){var e=this.reactData,t=this.internalData,r=t.resizeObserver;r&&r.disconnect(),_ui.globalEvents.off(this,"resize"),_xeUtils.default.assign(e,createReactData()),_xeUtils.default.assign(t,createInternalData())},render:function(e){return this.renderVN(e)}});
|
|
@@ -490,6 +490,8 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
490
490
|
emitInputEvent: function emitInputEvent(inputValue, evnt) {
|
|
491
491
|
var $xeNumberInput = this;
|
|
492
492
|
var reactData = $xeNumberInput.reactData;
|
|
493
|
+
var $xeForm = $xeNumberInput.$xeForm;
|
|
494
|
+
var formItemInfo = $xeNumberInput.formItemInfo;
|
|
493
495
|
var inpImmediate = $xeNumberInput.computeInpImmediate;
|
|
494
496
|
var value = inputValue === (0, _utils.eqEmptyValue)(inputValue) ? null : _xeUtils.default.toNumber(inputValue);
|
|
495
497
|
reactData.inputValue = inputValue;
|
|
@@ -499,6 +501,10 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
499
501
|
$xeNumberInput.dispatchEvent('input', {
|
|
500
502
|
value: value
|
|
501
503
|
}, evnt);
|
|
504
|
+
// 自动更新校验状态
|
|
505
|
+
if ($xeForm && formItemInfo) {
|
|
506
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
507
|
+
}
|
|
502
508
|
}
|
|
503
509
|
},
|
|
504
510
|
inputEvent: function inputEvent(evnt) {
|