vxe-table 3.4.2 → 3.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +3 -3
- package/README.md +2 -2
- package/README.zh-TW.md +2 -2
- package/lib/edit/src/mixin.js +267 -88
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/header/src/header.js +1 -1
- package/lib/header/src/header.min.js +1 -1
- package/lib/index.umd.js +1098 -140
- package/lib/index.umd.min.js +2 -1
- package/lib/input/src/input.js +10 -2
- package/lib/input/src/input.min.js +1 -1
- package/lib/table/src/body.js +10 -7
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +40 -36
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +5 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +1 -1
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/validator/src/mixin.js +3 -3
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +2 -23
- package/packages/edit/src/mixin.js +174 -62
- package/packages/header/src/header.js +1 -1
- package/packages/input/src/input.js +9 -2
- package/packages/table/src/body.js +8 -7
- package/packages/table/src/methods.js +33 -31
- package/packages/table/src/table.js +5 -3
- package/packages/v-x-e-table/src/conf.js +1 -1
- package/packages/validator/src/mixin.js +3 -3
- package/types/index.d.ts +1 -1
- package/types/table.d.ts +13 -10
- package/types/v-x-e-table/renderer.d.ts +3 -1
package/lib/input/src/input.js
CHANGED
|
@@ -68,12 +68,20 @@ function getDateQuarter(date) {
|
|
|
68
68
|
return 4;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
function toFloatValueFixed(inputValue, digitsValue) {
|
|
72
|
+
if (/^-/.test('' + inputValue)) {
|
|
73
|
+
return _xeUtils.default.toFixed(_xeUtils.default.ceil(inputValue, digitsValue), digitsValue);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return _xeUtils.default.toFixed(_xeUtils.default.floor(inputValue, digitsValue), digitsValue);
|
|
77
|
+
}
|
|
78
|
+
|
|
71
79
|
function getNumberValue(_vm, val) {
|
|
72
80
|
var type = _vm.type,
|
|
73
81
|
exponential = _vm.exponential,
|
|
74
82
|
digitsValue = _vm.digitsValue,
|
|
75
83
|
inpMaxlength = _vm.inpMaxlength;
|
|
76
|
-
var restVal = type === 'float' ?
|
|
84
|
+
var restVal = type === 'float' ? toFloatValueFixed(val, digitsValue) : _xeUtils.default.toValueString(val);
|
|
77
85
|
|
|
78
86
|
if (exponential && (val === restVal || _xeUtils.default.toValueString(val).toLowerCase() === _xeUtils.default.toNumber(restVal).toExponential())) {
|
|
79
87
|
return val;
|
|
@@ -1535,7 +1543,7 @@ var _default2 = {
|
|
|
1535
1543
|
this.changeValue();
|
|
1536
1544
|
} else if (type === 'float') {
|
|
1537
1545
|
if (inputValue) {
|
|
1538
|
-
var validValue =
|
|
1546
|
+
var validValue = toFloatValueFixed(inputValue, digitsValue);
|
|
1539
1547
|
|
|
1540
1548
|
if (inputValue !== validValue) {
|
|
1541
1549
|
this.emitModel(validValue, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_tools=require("../../tools");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var i,a=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,i)),a}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(i),!0).forEach(function(e){_defineProperty(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var yearSize=20,monthSize=20,quarterSize=8;function toStringTimeDate(e){if(e){var t,i,a,n=new Date;return _xeUtils.default.isDate(e)?(t=e.getHours(),i=e.getMinutes(),a=e.getSeconds()):(e=(e=_xeUtils.default.toValueString(e)).match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/))&&(t=e[1],i=e[3],a=e[5]),n.setHours(t||0),n.setMinutes(i||0),n.setSeconds(a||0),n}return new Date("")}function getDateQuarter(e){e=e.getMonth();return e<3?1:e<6?2:e<9?3:4}function getNumberValue(e,t){var i=e.type,a=e.exponential,n=e.digitsValue,e=e.inpMaxlength,n="float"===i?_xeUtils.default.toFixed(_xeUtils.default.floor(t,n),n):_xeUtils.default.toValueString(t);return!a||t!==n&&_xeUtils.default.toValueString(t).toLowerCase()!==_xeUtils.default.toNumber(n).toExponential()?n.slice(0,e):t}function renderDateLabel(t,e,i,a){var n=e.festivalMethod;if(n){n=n(_objectSpread({$input:e,type:e.datePanelType,viewType:e.datePanelType},i)),e=n?_xeUtils.default.isString(n)?{label:n}:n:{},i=e.extra?_xeUtils.default.isString(e.extra)?{label:e.extra}:e.extra:null,n=[t("span",{class:["vxe-input--date-label",{"is-notice":e.notice}]},i&&i.label?[t("span",a),t("span",{class:["vxe-input--date-label--extra",i.important?"is-important":"",i.className],style:i.style},_xeUtils.default.toValueString(i.label))]:a)],i=e.label;return i&&(i=_xeUtils.default.toValueString(i).split(","),n.push(t("span",{class:["vxe-input--date-festival",e.important?"is-important":"",e.className],style:e.style},[1<i.length?t("span",{class:["vxe-input--date-festival--overlap","overlap--".concat(i.length)]},i.map(function(e){return t("span",e.substring(0,3))})):t("span",{class:"vxe-input--date-festival--label"},i[0].substring(0,3))]))),n}return a}function isDateDisabled(e,t){var i=e.disabledMethod;return i&&i({$input:e,type:e.datePanelType,viewType:e.datePanelType,date:t.date})}function renderDateDayTable(t,i){var e=i.datePanelType,a=i.dateValue,n=i.datePanelValue,s=i.dateHeaders,r=i.dayDatas,l="yyyy-MM-dd";return[t("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[t("thead",[t("tr",s.map(function(e){return t("th",e.label)}))]),t("tbody",r.map(function(e){return t("tr",e.map(function(e){return t("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":isDateDisabled(i,e),"is--selected":_xeUtils.default.isDateSame(a,e.date,l),"is--hover":_xeUtils.default.isDateSame(n,e.date,l)},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},renderDateLabel(t,i,e,e.label))}))}))])]}function renderDateWeekTable(a,n){var e=n.datePanelType,s=n.dateValue,r=n.datePanelValue,t=n.weekHeaders,i=n.weekDates,l="yyyyMMdd";return[a("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("thead",[a("tr",t.map(function(e){return a("th",e.label)}))]),a("tbody",i.map(function(e){var t=e.some(function(e){return _xeUtils.default.isDateSame(s,e.date,l)}),i=e.some(function(e){return _xeUtils.default.isDateSame(r,e.date,l)});return a("tr",e.map(function(e){return a("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":isDateDisabled(n,e),"is--selected":t,"is--hover":i},on:{click:function(){return n.dateSelectEvent(e)},mouseenter:function(){return n.dateMouseenterEvent(e)}}},renderDateLabel(a,n,e,e.label))}))}))])]}function renderDateMonthTable(t,i){var a=i.dateValue,e=i.datePanelType,n=i.monthDatas,s=i.datePanelValue;return[t("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[t("tbody",n.map(function(e){return t("tr",e.map(function(e){return t("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":isDateDisabled(i,e),"is--selected":_xeUtils.default.isDateSame(a,e.date,"yyyyMM"),"is--hover":_xeUtils.default.isDateSame(s,e.date,"yyyyMM")},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},renderDateLabel(t,i,e,_conf.default.i18n("vxe.input.date.months.m".concat(e.month))))}))}))])]}function renderDateQuarterTable(t,i){var a=i.dateValue,e=i.datePanelType,n=i.quarterDatas,s=i.datePanelValue;return[t("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[t("tbody",n.map(function(e){return t("tr",e.map(function(e){return t("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":isDateDisabled(i,e),"is--selected":_xeUtils.default.isDateSame(a,e.date,"yyyyq"),"is--hover":_xeUtils.default.isDateSame(s,e.date,"yyyyq")},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},renderDateLabel(t,i,e,_conf.default.i18n("vxe.input.date.quarters.q".concat(e.quarter))))}))}))])]}function renderDateYearTable(t,i){var a=i.dateValue,e=i.datePanelType,n=i.yearDatas,s=i.datePanelValue;return[t("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[t("tbody",n.map(function(e){return t("tr",e.map(function(e){return t("td",{class:{"is--disabled":isDateDisabled(i,e),"is--current":e.isCurrent,"is--now":e.isNow,"is--selected":_xeUtils.default.isDateSame(a,e.date,"yyyy"),"is--hover":_xeUtils.default.isDateSame(s,e.date,"yyyy")},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},renderDateLabel(t,i,e,e.year))}))}))])]}function renderDateTable(e,t){switch(t.datePanelType){case"week":return renderDateWeekTable(e,t);case"month":return renderDateMonthTable(e,t);case"quarter":return renderDateQuarterTable(e,t);case"year":return renderDateYearTable(e,t)}return renderDateDayTable(e,t)}function renderDatePanel(e,t){var i=t.datePanelType,a=t.selectDatePanelLabel,n=t.isDisabledPrevDateBtn,s=t.isDisabledNextDateBtn;return[e("div",{class:"vxe-input--date-picker-header"},[e("div",{class:"vxe-input--date-picker-type-wrapper"},[e("span","year"===i?{class:"vxe-input--date-picker-label"}:{class:"vxe-input--date-picker-btn",on:{click:t.dateToggleTypeEvent}},a)]),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":n}],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":s}],on:{click:t.dateNextEvent}},[e("i",{class:"vxe-icon--caret-right"})])])]),e("div",{class:"vxe-input--date-picker-body"},renderDateTable(e,t))]}function renderTimePanel(i,a){var e=a.dateTimeLabel,n=a.datetimePanelValue,t=a.hourList,s=a.minuteList,r=a.secondList;return[i("div",{class:"vxe-input--time-picker-header"},[i("span",{class:"vxe-input--time-picker-title"},e),i("button",{class:"vxe-input--time-picker-confirm",attrs:{type:"button"},on:{click:a.dateConfirmEvent}},_conf.default.i18n("vxe.button.confirm"))]),i("div",{ref:"timeBody",class:"vxe-input--time-picker-body"},[i("ul",{class:"vxe-input--time-picker-hour-list"},t.map(function(t,e){return i("li",{key:e,class:{"is--selected":n&&n.getHours()===t.value},on:{click:function(e){return a.dateHourEvent(e,t)}}},t.label)})),i("ul",{class:"vxe-input--time-picker-minute-list"},s.map(function(t,e){return i("li",{key:e,class:{"is--selected":n&&n.getMinutes()===t.value},on:{click:function(e){return a.dateMinuteEvent(e,t)}}},t.label)})),i("ul",{class:"vxe-input--time-picker-second-list"},r.map(function(t,e){return i("li",{key:e,class:{"is--selected":n&&n.getSeconds()===t.value},on:{click:function(e){return a.dateSecondEvent(e,t)}}},t.label)}))])]}function renderPanel(e,t){var i=t.type,a=t.vSize,n=t.isDatePickerType,s=t.transfer,r=t.animatVisible,l=t.visiblePanel,u=t.panelPlacement,o=t.panelStyle,d=[];return n?("datetime"===i?d.push(e("div",{class:"vxe-input--panel-layout-wrapper"},[e("div",{class:"vxe-input--panel-left-wrapper"},renderDatePanel(e,t)),e("div",{class:"vxe-input--panel-right-wrapper"},renderTimePanel(e,t))])):"time"===i?d.push(e("div",{class:"vxe-input--panel-wrapper"},renderTimePanel(e,t))):d.push(e("div",{class:"vxe-input--panel-wrapper"},renderDatePanel(e,t))),e("div",{ref:"panel",class:["vxe-table--ignore-clear vxe-input--panel","type--".concat(i),(_defineProperty(i={},"size--".concat(a),a),_defineProperty(i,"is--transfer",s),_defineProperty(i,"animat--leave",r),_defineProperty(i,"animat--enter",l),i)],attrs:{placement:u},style:o},d)):null}function renderNumberIcon(e,t){return e("span",{class:"vxe-input--number-suffix"},[e("span",{class:"vxe-input--number-prev is--prev",on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:["vxe-input--number-prev-icon",_conf.default.icon.INPUT_PREV_NUM]})]),e("span",{class:"vxe-input--number-next is--next",on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:["vxe-input--number-next-icon",_conf.default.icon.INPUT_NEXT_NUM]})])])}function renderDatePickerIcon(e,t){return e("span",{class:"vxe-input--date-picker-suffix",on:{click:t.datePickerOpenEvent}},[e("i",{class:["vxe-input--date-picker-icon",_conf.default.icon.INPUT_DATE]})])}function renderSearchIcon(e,t){return e("span",{class:"vxe-input--search-suffix",on:{click:t.searchEvent}},[e("i",{class:["vxe-input--search-icon",_conf.default.icon.INPUT_SEARCH]})])}function renderPasswordIcon(e,t){var i=t.showPwd;return e("span",{class:"vxe-input--password-suffix",on:{click:t.passwordToggleEvent}},[e("i",{class:["vxe-input--password-icon",i?_conf.default.icon.INPUT_SHOW_PWD:_conf.default.icon.INPUT_PWD]})])}function rendePrefixIcon(e,t){var i=t.$scopedSlots,a=t.prefixIcon,n=[];return i.prefix?n.push(e("span",{class:"vxe-input--prefix-icon"},i.prefix.call(this,{},e))):a&&n.push(e("i",{class:["vxe-input--prefix-icon",a]})),n.length?e("span",{class:"vxe-input--prefix",on:{click:t.clickPrefixEvent}},n):null}function renderSuffixIcon(e,t){var i=t.$scopedSlots,a=t.inputValue,n=t.isClearable,s=t.disabled,r=t.suffixIcon,l=[];return i.suffix?l.push(e("span",{class:"vxe-input--suffix-icon"},i.suffix.call(this,{},e))):r&&l.push(e("i",{class:["vxe-input--suffix-icon",r]})),n&&l.push(e("i",{class:["vxe-input--clear-icon",_conf.default.icon.INPUT_CLEAR]})),l.length?e("span",{class:["vxe-input--suffix",{"is--clear":n&&!s&&!(""===a||_xeUtils.default.eqNull(a))}],on:{click:t.clickSuffixEvent}},l):null}function renderExtraSuffixIcon(e,t){var i,a=t.controls,n=t.isPawdType,s=t.isNumType,r=t.isDatePickerType,l=t.isSearch;return n?i=renderPasswordIcon(e,t):s?a&&(i=renderNumberIcon(e,t)):r?i=renderDatePickerIcon(e,t):l&&(i=renderSearchIcon(e,t)),i?e("span",{class:"vxe-input--extra-suffix"},[i]):null}var _default2={name:"VxeInput",mixins:[_size.default],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Date],immediate:{type:Boolean,default:!0},name:String,type:{type:String,default:"text"},clearable:{type:Boolean,default:function(){return _conf.default.input.clearable}},readonly:Boolean,disabled:Boolean,placeholder:String,maxlength:[String,Number],autocomplete:{type:String,default:"off"},align:String,form:String,className:String,size:{type:String,default:function(){return _conf.default.input.size||_conf.default.size}},min:{type:[String,Number],default:null},max:{type:[String,Number],default:null},step:[String,Number],exponential:{type:Boolean,default:function(){return _conf.default.input.exponential}},controls:{type:Boolean,default:function(){return _conf.default.input.controls}},digits:{type:[String,Number],default:function(){return _conf.default.input.digits}},dateConfig:Object,minDate:{type:[String,Number,Date],default:function(){return _conf.default.input.minDate}},maxDate:{type:[String,Number,Date],default:function(){return _conf.default.input.maxDate}},startWeek:Number,startDay:{type:[String,Number],default:function(){return _conf.default.input.startDay}},labelFormat:{type:String,default:function(){return _conf.default.input.labelFormat}},valueFormat:{type:String,default:function(){return _conf.default.input.valueFormat}},editable:{type:Boolean,default:!0},festivalMethod:{type:Function,default:function(){return _conf.default.input.festivalMethod}},disabledMethod:{type:Function,default:function(){return _conf.default.input.disabledMethod}},selectDay:{type:Number,default:function(){return _conf.default.input.selectDay}},prefixIcon:String,suffixIcon:String,placement:String,transfer:{type:Boolean,default:function(){return _conf.default.input.transfer}}},data:function(){return{panelIndex:0,showPwd:!1,visiblePanel:!1,animatVisible:!1,panelStyle:null,panelPlacement:null,isActivated:!1,inputValue:this.value,datetimePanelValue:null,datePanelValue:null,datePanelLabel:"",datePanelType:"day",selectMonth:null,currentDate:null}},computed:{isNumType:function(){return-1<["number","integer","float"].indexOf(this.type)},isDatePickerType:function(){return this.hasTime||-1<["date","week","month","quarter","year"].indexOf(this.type)},hasTime:function(){var e=this.type;return"time"===e||"datetime"===e},isPawdType:function(){return"password"===this.type},isSearch:function(){return"search"===this.type},stepValue:function(){var e=this.type,t=this.step;return"integer"===e?_xeUtils.default.toInteger(t)||1:"float"===e?_xeUtils.default.toNumber(t)||1/Math.pow(10,this.digitsValue):_xeUtils.default.toNumber(t)||1},digitsValue:function(){return _xeUtils.default.toInteger(this.digits)||1},isClearable:function(){return this.clearable&&(this.isPawdType||this.isNumType||this.isDatePickerType||"text"===this.type||"search"===this.type)},isDisabledPrevDateBtn:function(){var e=this.selectMonth,t=this.dateMinTime;return!!e&&e<=t},isDisabledNextDateBtn:function(){var e=this.selectMonth,t=this.dateMaxTime;return!!e&&t<=e},dateMinTime:function(){return this.minDate?_xeUtils.default.toStringDate(this.minDate):null},dateMaxTime:function(){return this.maxDate?_xeUtils.default.toStringDate(this.maxDate):null},dateValue:function(){var e=this.value,t=this.isDatePickerType,i=this.type,a=this.dateValueFormat,n=null;return e&&t&&(a="time"===i?toStringTimeDate(e):_xeUtils.default.toStringDate(e,a),_xeUtils.default.isValidDate(a)&&(n=a)),n},dateTimeLabel:function(){var e=this.datetimePanelValue;return e?_xeUtils.default.toDateString(e,"HH:mm:ss"):""},hmsTime:function(){var e=this.dateValue;return e&&this.hasTime?1e3*(3600*e.getHours()+60*e.getMinutes()+e.getSeconds()):0},dateLabelFormat:function(){return this.isDatePickerType?this.labelFormat||_conf.default.i18n("vxe.input.date.labelFormat.".concat(this.type)):null},dateValueFormat:function(){var e=this.type;return"time"===e?"HH:mm:ss":this.valueFormat||("datetime"===e?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd")},selectDatePanelLabel:function(){if(this.isDatePickerType){var e,t=this.datePanelType,i=this.selectMonth,a=this.yearList,n="";return i&&(n=i.getFullYear(),e=i.getMonth()+1),"quarter"===t?_conf.default.i18n("vxe.input.date.quarterLabel",[n]):"month"===t?_conf.default.i18n("vxe.input.date.monthLabel",[n]):"year"===t?a.length?"".concat(a[0].year," - ").concat(a[a.length-1].year):"":_conf.default.i18n("vxe.input.date.dayLabel",[n,e?_conf.default.i18n("vxe.input.date.m".concat(e)):"-"])}return""},weekDatas:function(){var e=[];if(this.isDatePickerType){var t=this.startDay,i=this.startWeek,a=_xeUtils.default.toNumber(_xeUtils.default.isNumber(t)||_xeUtils.default.isString(t)?t:i);e.push(a);for(var n=0;n<6;n++)6<=a?a=0:a++,e.push(a)}return e},dateHeaders:function(){return this.isDatePickerType?this.weekDatas.map(function(e){return{value:e,label:_conf.default.i18n("vxe.input.date.weeks.w".concat(e))}}):[]},weekHeaders:function(){return this.isDatePickerType?[{label:_conf.default.i18n("vxe.input.date.weeks.w")}].concat(this.dateHeaders):[]},yearList:function(){var e=this.selectMonth,t=this.currentDate,i=[];if(e&&t)for(var a=t.getFullYear(),n=new Date((""+e.getFullYear()).replace(/\d{1}$/,"0"),0,1),s=-10;s<yearSize-10;s++){var r=_xeUtils.default.getWhatYear(n,s,"first"),l=r.getFullYear();i.push({date:r,isCurrent:!0,isNow:a===l,year:l})}return i},yearDatas:function(){return _xeUtils.default.chunk(this.yearList,4)},quarterList:function(){var e=this.selectMonth,t=this.currentDate,i=[];if(e&&t)for(var a=t.getFullYear(),n=getDateQuarter(t),s=_xeUtils.default.getWhatYear(e,0,"first"),r=s.getFullYear(),l=-2;l<quarterSize-2;l++){var u=_xeUtils.default.getWhatQuarter(s,l),o=u.getFullYear(),d=getDateQuarter(u),h=o<r;i.push({date:u,isPrev:h,isCurrent:o===r,isNow:o===a&&d===n,isNext:!h&&r<o,quarter:d})}return i},quarterDatas:function(){return _xeUtils.default.chunk(this.quarterList,2)},monthList:function(){var e=this.selectMonth,t=this.currentDate,i=[];if(e&&t)for(var a=t.getFullYear(),n=t.getMonth(),s=_xeUtils.default.getWhatYear(e,0,"first").getFullYear(),r=-4;r<monthSize-4;r++){var l=_xeUtils.default.getWhatYear(e,0,r),u=l.getFullYear(),o=l.getMonth(),d=u<s;i.push({date:l,isPrev:d,isCurrent:u===s,isNow:u===a&&o===n,isNext:!d&&s<u,month:o})}return i},monthDatas:function(){return _xeUtils.default.chunk(this.monthList,4)},dayList:function(){var e=this.weekDatas,t=this.selectMonth,i=this.currentDate,a=this.hmsTime,n=[];if(t&&i)for(var s=i.getFullYear(),r=i.getMonth(),l=i.getDate(),u=t.getFullYear(),o=t.getMonth(),i=t.getDay(),i=-e.indexOf(i),d=new Date(_xeUtils.default.getWhatDay(t,i).getTime()+a),h=0;h<42;h++){var c=_xeUtils.default.getWhatDay(d,h),f=c.getFullYear(),p=c.getMonth(),v=c.getDate(),m=c<t;n.push({date:c,isPrev:m,isCurrent:f===u&&p===o,isNow:f===s&&p===r&&v===l,isNext:!m&&o!==p,label:v})}return n},dayDatas:function(){return _xeUtils.default.chunk(this.dayList,7)},weekDates:function(){return this.dayDatas.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)}].concat(e)})},hourList:function(){var e=[];if(this.hasTime)for(var t=0;t<24;t++)e.push({value:t,label:(""+t).padStart(2,0)});return e},minuteList:function(){var e=[];if(this.hasTime)for(var t=0;t<60;t++)e.push({value:t,label:(""+t).padStart(2,0)});return e},secondList:function(){return this.minuteList},inpImmediate:function(){var e=this.type;return this.immediate||!("text"===e||"number"===e||"integer"===e||"float"===e)},inpPlaceholder:function(){var e=this.placeholder;return e?_tools.UtilTools.getFuncText(e):""},inputType:function(){var e=this.isDatePickerType,t=this.isNumType,i=this.isPawdType,a=this.type,n=this.showPwd;return e||t||i&&n||"number"===a?"text":a},inpMaxlength:function(){var e=this.isNumType,t=this.maxlength;return e&&!_xeUtils.default.toNumber(t)?16:t},inpReadonly:function(){var e=this.type,t=this.readonly,i=this.editable;return t||!i||"week"===e||"quarter"===e}},watch:{value:function(e){this.inputValue=e,this.changeValue()},dateLabelFormat:function(){this.dateParseValue(this.datePanelValue),this.inputValue=this.datePanelLabel}},created:function(){this.initValue(),_tools.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent),_tools.GlobalEvent.on(this,"mousedown",this.handleGlobalMousedownEvent),_tools.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent),_tools.GlobalEvent.on(this,"blur",this.handleGlobalBlurEvent)},mounted:function(){this.dateConfig&&_tools.UtilTools.warn("vxe.error.removeProp",["date-config"]),this.isDatePickerType&&this.transfer&&document.body.appendChild(this.$refs.panel)},beforeDestroy:function(){var e=this.$refs.panel;e&&e.parentNode&&e.parentNode.removeChild(e)},destroyed:function(){this.numberStopDown(),_tools.GlobalEvent.off(this,"mousewheel"),_tools.GlobalEvent.off(this,"mousedown"),_tools.GlobalEvent.off(this,"keydown"),_tools.GlobalEvent.off(this,"blur")},render:function(e){var t=this.name,i=this.form,a=this.inputType,n=this.inpPlaceholder,s=this.inpMaxlength,r=this.inpReadonly,l=this.className,u=this.controls,o=this.inputValue,d=this.isDatePickerType,h=this.visiblePanel,c=this.isActivated,f=this.vSize,p=this.type,v=this.align,m=this.readonly,y=this.disabled,x=this.autocomplete,b=[],g=rendePrefixIcon(e,this),D=renderSuffixIcon(e,this);return g&&b.push(g),b.push(e("input",{ref:"input",class:"vxe-input--inner",domProps:{value:o},attrs:{name:t,form:i,type:a,placeholder:n,maxlength:s,readonly:r,disabled:y,autocomplete:x},on:{keydown:this.keydownEvent,keyup:this.triggerEvent,wheel:this.wheelEvent,click:this.clickEvent,input:this.inputEvent,change:this.changeEvent,focus:this.focusEvent,blur:this.blurEvent}})),D&&b.push(D),b.push(renderExtraSuffixIcon(e,this)),d&&b.push(renderPanel(e,this)),e("div",{class:["vxe-input","type--".concat(p),l,(_defineProperty(l={},"size--".concat(f),f),_defineProperty(l,"is--".concat(v),v),_defineProperty(l,"is--controls",u),_defineProperty(l,"is--prefix",!!g),_defineProperty(l,"is--suffix",!!D),_defineProperty(l,"is--readonly",m),_defineProperty(l,"is--visivle",h),_defineProperty(l,"is--disabled",y),_defineProperty(l,"is--active",c),l)]},b)},methods:{focus:function(){return this.isActivated=!0,this.$refs.input.focus(),this.$nextTick()},blur:function(){return this.$refs.input.blur(),this.isActivated=!1,this.$nextTick()},triggerEvent:function(e){var t=this.$refs,i=this.inputValue;this.$emit(e.type,{$panel:t.panel,value:i,$event:e})},emitModel:function(e,t){this.inputValue=e,this.$emit("modelValue",e),this.$emit("input",{value:e,$event:t}),_xeUtils.default.toValueString(this.value)!==e&&this.$emit("change",{value:e,$event:t})},emitInputEvent:function(e,t){var i=this.inpImmediate,a=this.isDatePickerType;this.inputValue=e,a||(i?this.emitModel(e,t):this.$emit("input",{value:e,$event:t}))},inputEvent:function(e){var t=e.target.value;this.emitInputEvent(t,e)},changeEvent:function(e){this.inpImmediate||this.triggerEvent(e)},focusEvent:function(e){this.isActivated=!0,this.triggerEvent(e)},blurEvent:function(e){var t=this.inputValue;this.inpImmediate||this.emitModel(t,e),this.afterCheckValue(),this.visiblePanel||(this.isActivated=!1),this.$emit("blur",{value:t,$event:e})},keydownEvent:function(e){var t,i,a,n,s=this.exponential,r=this.controls;this.isNumType&&(t=e.ctrlKey,i=e.shiftKey,a=e.altKey,n=e.keyCode,t||i||a||!(32===n||(!s||69!==n)&&65<=n&&n<=90||186<=n&&n<=188||191<=n)||e.preventDefault(),r&&this.numberKeydownEvent(e)),this.triggerEvent(e)},wheelEvent:function(e){var t;this.isNumType&&this.controls&&this.isActivated&&(0<(t=e.deltaY)?this.numberNextEvent(e):t<0&&this.numberPrevEvent(e),e.preventDefault()),this.triggerEvent(e)},clickEvent:function(e){this.isDatePickerType&&this.datePickerOpenEvent(e),this.triggerEvent(e)},clickPrefixEvent:function(e){var t=this.$refs,i=this.disabled,a=this.inputValue;i||this.$emit("prefix-click",{$panel:t.panel,value:a,$event:e})},clickSuffixEvent:function(e){var t=this.$refs,i=this.disabled,a=this.inputValue;i||(_tools.DomTools.hasClass(e.currentTarget,"is--clear")?(this.emitModel("",e),this.clearValueEvent(e,"")):this.$emit("suffix-click",{$panel:t.panel,value:a,$event:e}))},clearValueEvent:function(e,t){var i=this.$refs,a=this.type,n=this.isNumType;this.isDatePickerType&&this.hidePanel(),(n||-1<["text","search","password"].indexOf(a))&&this.focus(),this.$emit("clear",{$panel:i.panel,value:t,$event:e})},initValue:function(){var e=this.type,t=this.isDatePickerType,i=this.inputValue,a=this.digitsValue;t?this.changeValue():"float"===e&&(!i||i!==(a=_xeUtils.default.toFixed(_xeUtils.default.floor(i,a),a))&&this.emitModel(a,{type:"init"}))},changeValue:function(){this.isDatePickerType&&(this.dateParseValue(this.inputValue),this.inputValue=this.datePanelLabel)},afterCheckValue:function(){var e,t=this.type,i=this.exponential,a=this.inpReadonly,n=this.inputValue,s=this.isDatePickerType,r=this.isNumType,l=this.datetimePanelValue,u=this.dateLabelFormat,o=this.min,d=this.max;a||(r?n&&(e="integer"===t?_xeUtils.default.toInteger(n):_xeUtils.default.toNumber(n),this.vaildMinNum(e)?this.vaildMaxNum(e)||(e=d):e=o,!i||(i=_xeUtils.default.toValueString(n).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=i),this.emitModel(getNumberValue(this,e),{type:"check"})):s&&(n?"week"===t||"quarter"===t||(e="time"===t?toStringTimeDate(n):_xeUtils.default.toStringDate(n,u),_xeUtils.default.isValidDate(e)?"time"===t?(n!==(e=toStringTimeDate(e))&&this.emitModel(e,{type:"check"}),this.inputValue=e):(s=!1,"datetime"===t?n===_xeUtils.default.toDateString(this.dateValue,u)&&n===_xeUtils.default.toDateString(e,u)||(s=!0,l.setHours(e.getHours()),l.setMinutes(e.getMinutes()),l.setSeconds(e.getSeconds())):s=!0,this.inputValue=_xeUtils.default.toDateString(e,u),s&&this.dateChange(e)):this.dateRevert()):this.emitModel("",{type:"check"})))},passwordToggleEvent:function(e){var t=this.disabled,i=this.readonly,a=this.showPwd;t||i||(this.showPwd=!a),this.$emit("toggle-visible",{visible:this.showPwd,$event:e})},searchEvent:function(e){this.$emit("search-click",{$event:e})},vaildMinNum:function(e){return null===this.min||e>=_xeUtils.default.toNumber(this.min)},vaildMaxNum:function(e){return null===this.max||e<=_xeUtils.default.toNumber(this.max)},numberStopDown:function(){clearTimeout(this.downbumTimeout)},numberDownPrevEvent:function(e){var t=this;this.downbumTimeout=setTimeout(function(){t.numberPrevEvent(e),t.numberDownPrevEvent(e)},60)},numberDownNextEvent:function(e){var t=this;this.downbumTimeout=setTimeout(function(){t.numberNextEvent(e),t.numberDownNextEvent(e)},60)},numberKeydownEvent:function(e){var t=e.keyCode,i=38===t;!i&&40!==t||(e.preventDefault(),i?this.numberPrevEvent(e):this.numberNextEvent(e))},numberMousedownEvent:function(e){var t,i=this;this.numberStopDown(),0===e.button&&((t=_tools.DomTools.hasClass(e.currentTarget,"is--prev"))?this.numberPrevEvent(e):this.numberNextEvent(e),this.downbumTimeout=setTimeout(function(){t?i.numberDownPrevEvent(e):i.numberDownNextEvent(e)},500))},numberPrevEvent:function(e){var t=this.disabled,i=this.readonly;clearTimeout(this.downbumTimeout),t||i||this.numberChange(!0,e),this.$emit("prev-number",{$event:e})},numberNextEvent:function(e){var t=this.disabled,i=this.readonly;clearTimeout(this.downbumTimeout),t||i||this.numberChange(!1,e),this.$emit("next-number",{$event:e})},numberChange:function(e,t){var i=this.min,a=this.max,n=this.type,s=this.inputValue,r=this.stepValue,s="integer"===n?_xeUtils.default.toInteger(s):_xeUtils.default.toNumber(s),r=e?_xeUtils.default.add(s,r):_xeUtils.default.subtract(s,r),i=this.vaildMinNum(r)?this.vaildMaxNum(r)?r:a:i;this.emitInputEvent(getNumberValue(this,i),t)},datePickerOpenEvent:function(e){this.readonly||(e.preventDefault(),this.showPanel())},dateMonthHandle:function(e,t){this.selectMonth=_xeUtils.default.getWhatMonth(e,t,"first")},dateNowHandle:function(){var e=_xeUtils.default.getWhatDay(Date.now(),0,"first");this.currentDate=e,this.dateMonthHandle(e,0)},dateToggleTypeEvent:function(){var e="month"===(e=this.datePanelType)||"quarter"===e?"year":"month";this.datePanelType=e},datePrevEvent:function(e){var t=this.isDisabledPrevDateBtn,i=this.type,a=this.datePanelType;t||(this.selectMonth="year"===i?_xeUtils.default.getWhatYear(this.selectMonth,-yearSize,"first"):"month"===i||"quarter"===i?"year"===a?_xeUtils.default.getWhatYear(this.selectMonth,-yearSize,"first"):_xeUtils.default.getWhatYear(this.selectMonth,-1,"first"):"year"===a?_xeUtils.default.getWhatYear(this.selectMonth,-yearSize,"first"):"month"===a?_xeUtils.default.getWhatYear(this.selectMonth,-1,"first"):_xeUtils.default.getWhatMonth(this.selectMonth,-1,"first"),this.$emit("date-prev",{type:i,$event:e}))},dateTodayMonthEvent:function(e){this.dateNowHandle(),this.dateChange(this.currentDate),this.hidePanel(),this.$emit("date-today",{type:this.type,$event:e})},dateNextEvent:function(e){var t=this.isDisabledNextDateBtn,i=this.type,a=this.datePanelType;t||(this.selectMonth="year"===i?_xeUtils.default.getWhatYear(this.selectMonth,yearSize,"first"):"month"===i||"quarter"===i?"year"===a?_xeUtils.default.getWhatYear(this.selectMonth,yearSize,"first"):_xeUtils.default.getWhatYear(this.selectMonth,1,"first"):"year"===a?_xeUtils.default.getWhatYear(this.selectMonth,yearSize,"first"):"month"===a?_xeUtils.default.getWhatYear(this.selectMonth,1,"first"):_xeUtils.default.getWhatMonth(this.selectMonth,1,"first"),this.$emit("date-next",{type:i,$event:e}))},dateSelectEvent:function(e){isDateDisabled(this,e)||this.dateSelectItem(e.date)},dateSelectItem:function(e){var t=this.type,i=this.datePanelType,a="week"===t;"month"===t?"year"===i?(this.datePanelType="month",this.dateCheckMonth(e)):(this.dateChange(e),this.hidePanel()):"year"===t?(this.hidePanel(),this.dateChange(e)):"quarter"===t?"year"===i?(this.datePanelType="quarter",this.dateCheckMonth(e)):(this.dateChange(e),this.hidePanel()):"month"===i?(this.datePanelType="week"===t?t:"day",this.dateCheckMonth(e)):"year"===i?(this.datePanelType="month",this.dateCheckMonth(e)):(this.dateChange(e),this.hidePanel()),a&&this.changeValue()},dateMouseenterEvent:function(e){var t;isDateDisabled(this,e)||("month"===(t=this.datePanelType)?this.dateMoveMonth(e.date):"quarter"===t?this.dateMoveQuarter(e.date):"year"===t?this.dateMoveYear(e.date):this.dateMoveDay(e.date))},dateHourEvent:function(e,t){this.datetimePanelValue.setHours(t.value),this.dateTimeChangeEvent(e)},dateConfirmEvent:function(){this.dateChange(this.dateValue||this.currentDate),this.hidePanel()},dateMinuteEvent:function(e,t){this.datetimePanelValue.setMinutes(t.value),this.dateTimeChangeEvent(e)},dateSecondEvent:function(e,t){this.datetimePanelValue.setSeconds(t.value),this.dateTimeChangeEvent(e)},dateTimeChangeEvent:function(e){this.datetimePanelValue=new Date(this.datetimePanelValue.getTime()),this.updateTimePos(e.currentTarget)},updateTimePos:function(e){var t;e&&(t=e.offsetHeight,e.parentNode.scrollTop=e.offsetTop-4*t)},dateMoveDay:function(t){isDateDisabled(this,{date:t})||(this.dayList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyMMdd")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveMonth:function(t){isDateDisabled(this,{date:t})||(this.monthList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyMM")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveQuarter:function(t){isDateDisabled(this,{date:t})||(this.quarterList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyq")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveYear:function(t){isDateDisabled(this,{date:t})||(this.yearList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyy")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateParseValue:function(e){var t=this.type,i=this.dateLabelFormat,a=this.valueFormat,n=null,s="";e&&(n="time"===t?toStringTimeDate(e):_xeUtils.default.toStringDate(e,a)),_xeUtils.default.isValidDate(n)?s=_xeUtils.default.toDateString(n,i):n=null,this.datePanelValue=n,this.datePanelLabel=s},dateOffsetEvent:function(e){var t,i,a,n=this.isActivated,s=this.datePanelValue,r=this.datePanelType;n&&(e.preventDefault(),t=37===(i=e.keyCode),n=38===i,e=39===i,i=40===i,"year"===r?(a=_xeUtils.default.getWhatYear(s||Date.now(),0,"first"),t?a=_xeUtils.default.getWhatYear(a,-1):n?a=_xeUtils.default.getWhatYear(a,-4):e?a=_xeUtils.default.getWhatYear(a,1):i&&(a=_xeUtils.default.getWhatYear(a,4)),this.dateMoveYear(a)):"quarter"===r?(a=_xeUtils.default.getWhatQuarter(s||Date.now(),0,"first"),t?a=_xeUtils.default.getWhatQuarter(a,-1):n?a=_xeUtils.default.getWhatQuarter(a,-2):e?a=_xeUtils.default.getWhatQuarter(a,1):i&&(a=_xeUtils.default.getWhatQuarter(a,2)),this.dateMoveQuarter(a)):"month"===r?(r=_xeUtils.default.getWhatMonth(s||Date.now(),0,"first"),t?r=_xeUtils.default.getWhatMonth(r,-1):n?r=_xeUtils.default.getWhatMonth(r,-4):e?r=_xeUtils.default.getWhatMonth(r,1):i&&(r=_xeUtils.default.getWhatMonth(r,4)),this.dateMoveMonth(r)):(s=s||_xeUtils.default.getWhatDay(Date.now(),0,"first"),t?s=_xeUtils.default.getWhatDay(s,-1):n?s=_xeUtils.default.getWhatWeek(s,-1):e?s=_xeUtils.default.getWhatDay(s,1):i&&(s=_xeUtils.default.getWhatWeek(s,1)),this.dateMoveDay(s)))},datePgOffsetEvent:function(e){var t;this.isActivated&&(t=33===e.keyCode,e.preventDefault(),t?this.datePrevEvent(e):this.dateNextEvent(e))},dateChange:function(e){var t,i=this.value,a=this.datetimePanelValue,n=this.dateValueFormat;"week"===this.type?(t=_xeUtils.default.toNumber(this.selectDay),e=_xeUtils.default.getWhatWeek(e,0,t)):this.hasTime&&(e.setHours(a.getHours()),e.setMinutes(a.getMinutes()),e.setSeconds(a.getSeconds()));n=_xeUtils.default.toDateString(e,n);this.dateCheckMonth(e),_xeUtils.default.isEqual(i,n)||this.emitModel(n,{type:"update"})},dateCheckMonth:function(e){e=_xeUtils.default.getWhatMonth(e,0,"first");_xeUtils.default.isEqual(e,this.selectMonth)||(this.selectMonth=e)},dateOpenPanel:function(){var e=this,t=this.type,i=this.dateValue;-1<["year","quarter","month","week"].indexOf(t)?this.datePanelType=t:this.datePanelType="day",this.currentDate=_xeUtils.default.getWhatDay(Date.now(),0,"first"),i?(this.dateMonthHandle(i,0),this.dateParseValue(i)):this.dateNowHandle(),this.hasTime&&(this.datetimePanelValue=this.datePanelValue||_xeUtils.default.getWhatDay(Date.now(),0,"first"),this.$nextTick(function(){_xeUtils.default.arrayEach(e.$refs.timeBody.querySelectorAll("li.is--selected"),e.updateTimePos)}))},dateRevert:function(){this.inputValue=this.datePanelLabel},updateZindex:function(){this.panelIndex<_tools.UtilTools.getLastZIndex()&&(this.panelIndex=_tools.UtilTools.nextZIndex())},showPanel:function(){var e=this,t=this.disabled,i=this.visiblePanel,a=this.isDatePickerType;t||i||(clearTimeout(this.hidePanelTimeout),this.isActivated=!0,this.animatVisible=!0,a&&this.dateOpenPanel(),setTimeout(function(){e.visiblePanel=!0},10),this.updateZindex(),this.updatePlacement())},hidePanel:function(){var e=this;this.visiblePanel=!1,this.hidePanelTimeout=setTimeout(function(){e.animatVisible=!1},350)},updatePlacement:function(){var c=this;return this.$nextTick().then(function(){var e=c.$refs,t=c.transfer,i=c.placement,a=c.panelIndex,n=e.input,s=e.panel;if(n&&s){var r=n.offsetHeight,l=n.offsetWidth,u=s.offsetHeight,o=s.offsetWidth,d={zIndex:a},h=_tools.DomTools.getAbsolutePos(n),e=h.boundingTop,s=h.boundingLeft,a=h.visibleHeight,n=h.visibleWidth,h="bottom";return t?(t=e+r,"top"===i?(h="top",t=e-u):i||(a<t+u+5&&(h="top",t=e-u),t<5&&(h="bottom",t=e+r)),n<(s=s)+o+5&&(s-=s+o+5-n),s<5&&(s=5),Object.assign(d,{left:"".concat(s,"px"),top:"".concat(t,"px"),minWidth:"".concat(l,"px")})):"top"===i?(h="top",d.bottom="".concat(r,"px")):i||a<e+r+u&&5<e-r-u&&(h="top",d.bottom="".concat(r,"px")),c.panelStyle=d,c.panelPlacement=h,c.$nextTick()}})},handleGlobalMousedownEvent:function(e){var t=this.$refs,i=this.$el,a=this.disabled,n=this.visiblePanel,s=this.isActivated;!a&&s&&(this.isActivated=_tools.DomTools.getEventTargetNode(e,i).flag||_tools.DomTools.getEventTargetNode(e,t.panel).flag,this.isActivated||(this.isDatePickerType?n&&(this.hidePanel(),this.afterCheckValue()):this.afterCheckValue()))},handleGlobalKeydownEvent:function(e){var t,i,a,n,s,r,l,u,o,d,h=this.isDatePickerType,c=this.visiblePanel,f=this.clearable;this.disabled||(i=46===(t=e.keyCode),a=27===t,n=13===t,s=38===t,r=40===t,l=33===t,u=34===t,o=37===t||s||39===t||r,d=this.isActivated,(t=9===t)?(d&&this.afterCheckValue(),this.isActivated=d=!1):o?h&&d&&(c?this.dateOffsetEvent(e):(s||r)&&this.datePickerOpenEvent(e)):n?h&&(c?this.datePanelValue?this.dateSelectItem(this.datePanelValue):this.hidePanel():d&&this.datePickerOpenEvent(e)):(l||u)&&h&&d&&this.datePgOffsetEvent(e),t||a?c&&this.hidePanel():i&&f&&d&&this.clearValueEvent(e,null))},handleGlobalMousewheelEvent:function(e){var t=this.$refs,i=this.disabled,a=this.visiblePanel;i||a&&(_tools.DomTools.getEventTargetNode(e,t.panel).flag?this.updatePlacement():(this.hidePanel(),this.afterCheckValue()))},handleGlobalBlurEvent:function(){var e=this.isActivated;this.visiblePanel?(this.hidePanel(),this.afterCheckValue()):e&&this.afterCheckValue()}}};exports.default=_default2;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_tools=require("../../tools");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var i,a=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,i)),a}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(i),!0).forEach(function(e){_defineProperty(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var yearSize=20,monthSize=20,quarterSize=8;function toStringTimeDate(e){if(e){var t,i,a,n=new Date;return _xeUtils.default.isDate(e)?(t=e.getHours(),i=e.getMinutes(),a=e.getSeconds()):(e=(e=_xeUtils.default.toValueString(e)).match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/))&&(t=e[1],i=e[3],a=e[5]),n.setHours(t||0),n.setMinutes(i||0),n.setSeconds(a||0),n}return new Date("")}function getDateQuarter(e){e=e.getMonth();return e<3?1:e<6?2:e<9?3:4}function toFloatValueFixed(e,t){return/^-/.test(""+e)?_xeUtils.default.toFixed(_xeUtils.default.ceil(e,t),t):_xeUtils.default.toFixed(_xeUtils.default.floor(e,t),t)}function getNumberValue(e,t){var i=e.type,a=e.exponential,n=e.digitsValue,e=e.inpMaxlength,n="float"===i?toFloatValueFixed(t,n):_xeUtils.default.toValueString(t);return!a||t!==n&&_xeUtils.default.toValueString(t).toLowerCase()!==_xeUtils.default.toNumber(n).toExponential()?n.slice(0,e):t}function renderDateLabel(t,e,i,a){var n=e.festivalMethod;if(n){n=n(_objectSpread({$input:e,type:e.datePanelType,viewType:e.datePanelType},i)),e=n?_xeUtils.default.isString(n)?{label:n}:n:{},i=e.extra?_xeUtils.default.isString(e.extra)?{label:e.extra}:e.extra:null,n=[t("span",{class:["vxe-input--date-label",{"is-notice":e.notice}]},i&&i.label?[t("span",a),t("span",{class:["vxe-input--date-label--extra",i.important?"is-important":"",i.className],style:i.style},_xeUtils.default.toValueString(i.label))]:a)],i=e.label;return i&&(i=_xeUtils.default.toValueString(i).split(","),n.push(t("span",{class:["vxe-input--date-festival",e.important?"is-important":"",e.className],style:e.style},[1<i.length?t("span",{class:["vxe-input--date-festival--overlap","overlap--".concat(i.length)]},i.map(function(e){return t("span",e.substring(0,3))})):t("span",{class:"vxe-input--date-festival--label"},i[0].substring(0,3))]))),n}return a}function isDateDisabled(e,t){var i=e.disabledMethod;return i&&i({$input:e,type:e.datePanelType,viewType:e.datePanelType,date:t.date})}function renderDateDayTable(t,i){var e=i.datePanelType,a=i.dateValue,n=i.datePanelValue,s=i.dateHeaders,r=i.dayDatas,l="yyyy-MM-dd";return[t("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[t("thead",[t("tr",s.map(function(e){return t("th",e.label)}))]),t("tbody",r.map(function(e){return t("tr",e.map(function(e){return t("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":isDateDisabled(i,e),"is--selected":_xeUtils.default.isDateSame(a,e.date,l),"is--hover":_xeUtils.default.isDateSame(n,e.date,l)},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},renderDateLabel(t,i,e,e.label))}))}))])]}function renderDateWeekTable(a,n){var e=n.datePanelType,s=n.dateValue,r=n.datePanelValue,t=n.weekHeaders,i=n.weekDates,l="yyyyMMdd";return[a("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[a("thead",[a("tr",t.map(function(e){return a("th",e.label)}))]),a("tbody",i.map(function(e){var t=e.some(function(e){return _xeUtils.default.isDateSame(s,e.date,l)}),i=e.some(function(e){return _xeUtils.default.isDateSame(r,e.date,l)});return a("tr",e.map(function(e){return a("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":isDateDisabled(n,e),"is--selected":t,"is--hover":i},on:{click:function(){return n.dateSelectEvent(e)},mouseenter:function(){return n.dateMouseenterEvent(e)}}},renderDateLabel(a,n,e,e.label))}))}))])]}function renderDateMonthTable(t,i){var a=i.dateValue,e=i.datePanelType,n=i.monthDatas,s=i.datePanelValue;return[t("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[t("tbody",n.map(function(e){return t("tr",e.map(function(e){return t("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":isDateDisabled(i,e),"is--selected":_xeUtils.default.isDateSame(a,e.date,"yyyyMM"),"is--hover":_xeUtils.default.isDateSame(s,e.date,"yyyyMM")},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},renderDateLabel(t,i,e,_conf.default.i18n("vxe.input.date.months.m".concat(e.month))))}))}))])]}function renderDateQuarterTable(t,i){var a=i.dateValue,e=i.datePanelType,n=i.quarterDatas,s=i.datePanelValue;return[t("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[t("tbody",n.map(function(e){return t("tr",e.map(function(e){return t("td",{class:{"is--prev":e.isPrev,"is--current":e.isCurrent,"is--now":e.isNow,"is--next":e.isNext,"is--disabled":isDateDisabled(i,e),"is--selected":_xeUtils.default.isDateSame(a,e.date,"yyyyq"),"is--hover":_xeUtils.default.isDateSame(s,e.date,"yyyyq")},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},renderDateLabel(t,i,e,_conf.default.i18n("vxe.input.date.quarters.q".concat(e.quarter))))}))}))])]}function renderDateYearTable(t,i){var a=i.dateValue,e=i.datePanelType,n=i.yearDatas,s=i.datePanelValue;return[t("table",{class:"vxe-input--date-".concat(e,"-view"),attrs:{cellspacing:0,cellpadding:0,border:0}},[t("tbody",n.map(function(e){return t("tr",e.map(function(e){return t("td",{class:{"is--disabled":isDateDisabled(i,e),"is--current":e.isCurrent,"is--now":e.isNow,"is--selected":_xeUtils.default.isDateSame(a,e.date,"yyyy"),"is--hover":_xeUtils.default.isDateSame(s,e.date,"yyyy")},on:{click:function(){return i.dateSelectEvent(e)},mouseenter:function(){return i.dateMouseenterEvent(e)}}},renderDateLabel(t,i,e,e.year))}))}))])]}function renderDateTable(e,t){switch(t.datePanelType){case"week":return renderDateWeekTable(e,t);case"month":return renderDateMonthTable(e,t);case"quarter":return renderDateQuarterTable(e,t);case"year":return renderDateYearTable(e,t)}return renderDateDayTable(e,t)}function renderDatePanel(e,t){var i=t.datePanelType,a=t.selectDatePanelLabel,n=t.isDisabledPrevDateBtn,s=t.isDisabledNextDateBtn;return[e("div",{class:"vxe-input--date-picker-header"},[e("div",{class:"vxe-input--date-picker-type-wrapper"},[e("span","year"===i?{class:"vxe-input--date-picker-label"}:{class:"vxe-input--date-picker-btn",on:{click:t.dateToggleTypeEvent}},a)]),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":n}],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":s}],on:{click:t.dateNextEvent}},[e("i",{class:"vxe-icon--caret-right"})])])]),e("div",{class:"vxe-input--date-picker-body"},renderDateTable(e,t))]}function renderTimePanel(i,a){var e=a.dateTimeLabel,n=a.datetimePanelValue,t=a.hourList,s=a.minuteList,r=a.secondList;return[i("div",{class:"vxe-input--time-picker-header"},[i("span",{class:"vxe-input--time-picker-title"},e),i("button",{class:"vxe-input--time-picker-confirm",attrs:{type:"button"},on:{click:a.dateConfirmEvent}},_conf.default.i18n("vxe.button.confirm"))]),i("div",{ref:"timeBody",class:"vxe-input--time-picker-body"},[i("ul",{class:"vxe-input--time-picker-hour-list"},t.map(function(t,e){return i("li",{key:e,class:{"is--selected":n&&n.getHours()===t.value},on:{click:function(e){return a.dateHourEvent(e,t)}}},t.label)})),i("ul",{class:"vxe-input--time-picker-minute-list"},s.map(function(t,e){return i("li",{key:e,class:{"is--selected":n&&n.getMinutes()===t.value},on:{click:function(e){return a.dateMinuteEvent(e,t)}}},t.label)})),i("ul",{class:"vxe-input--time-picker-second-list"},r.map(function(t,e){return i("li",{key:e,class:{"is--selected":n&&n.getSeconds()===t.value},on:{click:function(e){return a.dateSecondEvent(e,t)}}},t.label)}))])]}function renderPanel(e,t){var i=t.type,a=t.vSize,n=t.isDatePickerType,s=t.transfer,r=t.animatVisible,l=t.visiblePanel,u=t.panelPlacement,o=t.panelStyle,d=[];return n?("datetime"===i?d.push(e("div",{class:"vxe-input--panel-layout-wrapper"},[e("div",{class:"vxe-input--panel-left-wrapper"},renderDatePanel(e,t)),e("div",{class:"vxe-input--panel-right-wrapper"},renderTimePanel(e,t))])):"time"===i?d.push(e("div",{class:"vxe-input--panel-wrapper"},renderTimePanel(e,t))):d.push(e("div",{class:"vxe-input--panel-wrapper"},renderDatePanel(e,t))),e("div",{ref:"panel",class:["vxe-table--ignore-clear vxe-input--panel","type--".concat(i),(_defineProperty(i={},"size--".concat(a),a),_defineProperty(i,"is--transfer",s),_defineProperty(i,"animat--leave",r),_defineProperty(i,"animat--enter",l),i)],attrs:{placement:u},style:o},d)):null}function renderNumberIcon(e,t){return e("span",{class:"vxe-input--number-suffix"},[e("span",{class:"vxe-input--number-prev is--prev",on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:["vxe-input--number-prev-icon",_conf.default.icon.INPUT_PREV_NUM]})]),e("span",{class:"vxe-input--number-next is--next",on:{mousedown:t.numberMousedownEvent,mouseup:t.numberStopDown,mouseleave:t.numberStopDown}},[e("i",{class:["vxe-input--number-next-icon",_conf.default.icon.INPUT_NEXT_NUM]})])])}function renderDatePickerIcon(e,t){return e("span",{class:"vxe-input--date-picker-suffix",on:{click:t.datePickerOpenEvent}},[e("i",{class:["vxe-input--date-picker-icon",_conf.default.icon.INPUT_DATE]})])}function renderSearchIcon(e,t){return e("span",{class:"vxe-input--search-suffix",on:{click:t.searchEvent}},[e("i",{class:["vxe-input--search-icon",_conf.default.icon.INPUT_SEARCH]})])}function renderPasswordIcon(e,t){var i=t.showPwd;return e("span",{class:"vxe-input--password-suffix",on:{click:t.passwordToggleEvent}},[e("i",{class:["vxe-input--password-icon",i?_conf.default.icon.INPUT_SHOW_PWD:_conf.default.icon.INPUT_PWD]})])}function rendePrefixIcon(e,t){var i=t.$scopedSlots,a=t.prefixIcon,n=[];return i.prefix?n.push(e("span",{class:"vxe-input--prefix-icon"},i.prefix.call(this,{},e))):a&&n.push(e("i",{class:["vxe-input--prefix-icon",a]})),n.length?e("span",{class:"vxe-input--prefix",on:{click:t.clickPrefixEvent}},n):null}function renderSuffixIcon(e,t){var i=t.$scopedSlots,a=t.inputValue,n=t.isClearable,s=t.disabled,r=t.suffixIcon,l=[];return i.suffix?l.push(e("span",{class:"vxe-input--suffix-icon"},i.suffix.call(this,{},e))):r&&l.push(e("i",{class:["vxe-input--suffix-icon",r]})),n&&l.push(e("i",{class:["vxe-input--clear-icon",_conf.default.icon.INPUT_CLEAR]})),l.length?e("span",{class:["vxe-input--suffix",{"is--clear":n&&!s&&!(""===a||_xeUtils.default.eqNull(a))}],on:{click:t.clickSuffixEvent}},l):null}function renderExtraSuffixIcon(e,t){var i,a=t.controls,n=t.isPawdType,s=t.isNumType,r=t.isDatePickerType,l=t.isSearch;return n?i=renderPasswordIcon(e,t):s?a&&(i=renderNumberIcon(e,t)):r?i=renderDatePickerIcon(e,t):l&&(i=renderSearchIcon(e,t)),i?e("span",{class:"vxe-input--extra-suffix"},[i]):null}var _default2={name:"VxeInput",mixins:[_size.default],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Date],immediate:{type:Boolean,default:!0},name:String,type:{type:String,default:"text"},clearable:{type:Boolean,default:function(){return _conf.default.input.clearable}},readonly:Boolean,disabled:Boolean,placeholder:String,maxlength:[String,Number],autocomplete:{type:String,default:"off"},align:String,form:String,className:String,size:{type:String,default:function(){return _conf.default.input.size||_conf.default.size}},min:{type:[String,Number],default:null},max:{type:[String,Number],default:null},step:[String,Number],exponential:{type:Boolean,default:function(){return _conf.default.input.exponential}},controls:{type:Boolean,default:function(){return _conf.default.input.controls}},digits:{type:[String,Number],default:function(){return _conf.default.input.digits}},dateConfig:Object,minDate:{type:[String,Number,Date],default:function(){return _conf.default.input.minDate}},maxDate:{type:[String,Number,Date],default:function(){return _conf.default.input.maxDate}},startWeek:Number,startDay:{type:[String,Number],default:function(){return _conf.default.input.startDay}},labelFormat:{type:String,default:function(){return _conf.default.input.labelFormat}},valueFormat:{type:String,default:function(){return _conf.default.input.valueFormat}},editable:{type:Boolean,default:!0},festivalMethod:{type:Function,default:function(){return _conf.default.input.festivalMethod}},disabledMethod:{type:Function,default:function(){return _conf.default.input.disabledMethod}},selectDay:{type:Number,default:function(){return _conf.default.input.selectDay}},prefixIcon:String,suffixIcon:String,placement:String,transfer:{type:Boolean,default:function(){return _conf.default.input.transfer}}},data:function(){return{panelIndex:0,showPwd:!1,visiblePanel:!1,animatVisible:!1,panelStyle:null,panelPlacement:null,isActivated:!1,inputValue:this.value,datetimePanelValue:null,datePanelValue:null,datePanelLabel:"",datePanelType:"day",selectMonth:null,currentDate:null}},computed:{isNumType:function(){return-1<["number","integer","float"].indexOf(this.type)},isDatePickerType:function(){return this.hasTime||-1<["date","week","month","quarter","year"].indexOf(this.type)},hasTime:function(){var e=this.type;return"time"===e||"datetime"===e},isPawdType:function(){return"password"===this.type},isSearch:function(){return"search"===this.type},stepValue:function(){var e=this.type,t=this.step;return"integer"===e?_xeUtils.default.toInteger(t)||1:"float"===e?_xeUtils.default.toNumber(t)||1/Math.pow(10,this.digitsValue):_xeUtils.default.toNumber(t)||1},digitsValue:function(){return _xeUtils.default.toInteger(this.digits)||1},isClearable:function(){return this.clearable&&(this.isPawdType||this.isNumType||this.isDatePickerType||"text"===this.type||"search"===this.type)},isDisabledPrevDateBtn:function(){var e=this.selectMonth,t=this.dateMinTime;return!!e&&e<=t},isDisabledNextDateBtn:function(){var e=this.selectMonth,t=this.dateMaxTime;return!!e&&t<=e},dateMinTime:function(){return this.minDate?_xeUtils.default.toStringDate(this.minDate):null},dateMaxTime:function(){return this.maxDate?_xeUtils.default.toStringDate(this.maxDate):null},dateValue:function(){var e=this.value,t=this.isDatePickerType,i=this.type,a=this.dateValueFormat,n=null;return e&&t&&(a="time"===i?toStringTimeDate(e):_xeUtils.default.toStringDate(e,a),_xeUtils.default.isValidDate(a)&&(n=a)),n},dateTimeLabel:function(){var e=this.datetimePanelValue;return e?_xeUtils.default.toDateString(e,"HH:mm:ss"):""},hmsTime:function(){var e=this.dateValue;return e&&this.hasTime?1e3*(3600*e.getHours()+60*e.getMinutes()+e.getSeconds()):0},dateLabelFormat:function(){return this.isDatePickerType?this.labelFormat||_conf.default.i18n("vxe.input.date.labelFormat.".concat(this.type)):null},dateValueFormat:function(){var e=this.type;return"time"===e?"HH:mm:ss":this.valueFormat||("datetime"===e?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd")},selectDatePanelLabel:function(){if(this.isDatePickerType){var e,t=this.datePanelType,i=this.selectMonth,a=this.yearList,n="";return i&&(n=i.getFullYear(),e=i.getMonth()+1),"quarter"===t?_conf.default.i18n("vxe.input.date.quarterLabel",[n]):"month"===t?_conf.default.i18n("vxe.input.date.monthLabel",[n]):"year"===t?a.length?"".concat(a[0].year," - ").concat(a[a.length-1].year):"":_conf.default.i18n("vxe.input.date.dayLabel",[n,e?_conf.default.i18n("vxe.input.date.m".concat(e)):"-"])}return""},weekDatas:function(){var e=[];if(this.isDatePickerType){var t=this.startDay,i=this.startWeek,a=_xeUtils.default.toNumber(_xeUtils.default.isNumber(t)||_xeUtils.default.isString(t)?t:i);e.push(a);for(var n=0;n<6;n++)6<=a?a=0:a++,e.push(a)}return e},dateHeaders:function(){return this.isDatePickerType?this.weekDatas.map(function(e){return{value:e,label:_conf.default.i18n("vxe.input.date.weeks.w".concat(e))}}):[]},weekHeaders:function(){return this.isDatePickerType?[{label:_conf.default.i18n("vxe.input.date.weeks.w")}].concat(this.dateHeaders):[]},yearList:function(){var e=this.selectMonth,t=this.currentDate,i=[];if(e&&t)for(var a=t.getFullYear(),n=new Date((""+e.getFullYear()).replace(/\d{1}$/,"0"),0,1),s=-10;s<yearSize-10;s++){var r=_xeUtils.default.getWhatYear(n,s,"first"),l=r.getFullYear();i.push({date:r,isCurrent:!0,isNow:a===l,year:l})}return i},yearDatas:function(){return _xeUtils.default.chunk(this.yearList,4)},quarterList:function(){var e=this.selectMonth,t=this.currentDate,i=[];if(e&&t)for(var a=t.getFullYear(),n=getDateQuarter(t),s=_xeUtils.default.getWhatYear(e,0,"first"),r=s.getFullYear(),l=-2;l<quarterSize-2;l++){var u=_xeUtils.default.getWhatQuarter(s,l),o=u.getFullYear(),d=getDateQuarter(u),h=o<r;i.push({date:u,isPrev:h,isCurrent:o===r,isNow:o===a&&d===n,isNext:!h&&r<o,quarter:d})}return i},quarterDatas:function(){return _xeUtils.default.chunk(this.quarterList,2)},monthList:function(){var e=this.selectMonth,t=this.currentDate,i=[];if(e&&t)for(var a=t.getFullYear(),n=t.getMonth(),s=_xeUtils.default.getWhatYear(e,0,"first").getFullYear(),r=-4;r<monthSize-4;r++){var l=_xeUtils.default.getWhatYear(e,0,r),u=l.getFullYear(),o=l.getMonth(),d=u<s;i.push({date:l,isPrev:d,isCurrent:u===s,isNow:u===a&&o===n,isNext:!d&&s<u,month:o})}return i},monthDatas:function(){return _xeUtils.default.chunk(this.monthList,4)},dayList:function(){var e=this.weekDatas,t=this.selectMonth,i=this.currentDate,a=this.hmsTime,n=[];if(t&&i)for(var s=i.getFullYear(),r=i.getMonth(),l=i.getDate(),u=t.getFullYear(),o=t.getMonth(),i=t.getDay(),i=-e.indexOf(i),d=new Date(_xeUtils.default.getWhatDay(t,i).getTime()+a),h=0;h<42;h++){var c=_xeUtils.default.getWhatDay(d,h),f=c.getFullYear(),p=c.getMonth(),v=c.getDate(),m=c<t;n.push({date:c,isPrev:m,isCurrent:f===u&&p===o,isNow:f===s&&p===r&&v===l,isNext:!m&&o!==p,label:v})}return n},dayDatas:function(){return _xeUtils.default.chunk(this.dayList,7)},weekDates:function(){return this.dayDatas.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)}].concat(e)})},hourList:function(){var e=[];if(this.hasTime)for(var t=0;t<24;t++)e.push({value:t,label:(""+t).padStart(2,0)});return e},minuteList:function(){var e=[];if(this.hasTime)for(var t=0;t<60;t++)e.push({value:t,label:(""+t).padStart(2,0)});return e},secondList:function(){return this.minuteList},inpImmediate:function(){var e=this.type;return this.immediate||!("text"===e||"number"===e||"integer"===e||"float"===e)},inpPlaceholder:function(){var e=this.placeholder;return e?_tools.UtilTools.getFuncText(e):""},inputType:function(){var e=this.isDatePickerType,t=this.isNumType,i=this.isPawdType,a=this.type,n=this.showPwd;return e||t||i&&n||"number"===a?"text":a},inpMaxlength:function(){var e=this.isNumType,t=this.maxlength;return e&&!_xeUtils.default.toNumber(t)?16:t},inpReadonly:function(){var e=this.type,t=this.readonly,i=this.editable;return t||!i||"week"===e||"quarter"===e}},watch:{value:function(e){this.inputValue=e,this.changeValue()},dateLabelFormat:function(){this.dateParseValue(this.datePanelValue),this.inputValue=this.datePanelLabel}},created:function(){this.initValue(),_tools.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent),_tools.GlobalEvent.on(this,"mousedown",this.handleGlobalMousedownEvent),_tools.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent),_tools.GlobalEvent.on(this,"blur",this.handleGlobalBlurEvent)},mounted:function(){this.dateConfig&&_tools.UtilTools.warn("vxe.error.removeProp",["date-config"]),this.isDatePickerType&&this.transfer&&document.body.appendChild(this.$refs.panel)},beforeDestroy:function(){var e=this.$refs.panel;e&&e.parentNode&&e.parentNode.removeChild(e)},destroyed:function(){this.numberStopDown(),_tools.GlobalEvent.off(this,"mousewheel"),_tools.GlobalEvent.off(this,"mousedown"),_tools.GlobalEvent.off(this,"keydown"),_tools.GlobalEvent.off(this,"blur")},render:function(e){var t=this.name,i=this.form,a=this.inputType,n=this.inpPlaceholder,s=this.inpMaxlength,r=this.inpReadonly,l=this.className,u=this.controls,o=this.inputValue,d=this.isDatePickerType,h=this.visiblePanel,c=this.isActivated,f=this.vSize,p=this.type,v=this.align,m=this.readonly,y=this.disabled,x=this.autocomplete,b=[],g=rendePrefixIcon(e,this),D=renderSuffixIcon(e,this);return g&&b.push(g),b.push(e("input",{ref:"input",class:"vxe-input--inner",domProps:{value:o},attrs:{name:t,form:i,type:a,placeholder:n,maxlength:s,readonly:r,disabled:y,autocomplete:x},on:{keydown:this.keydownEvent,keyup:this.triggerEvent,wheel:this.wheelEvent,click:this.clickEvent,input:this.inputEvent,change:this.changeEvent,focus:this.focusEvent,blur:this.blurEvent}})),D&&b.push(D),b.push(renderExtraSuffixIcon(e,this)),d&&b.push(renderPanel(e,this)),e("div",{class:["vxe-input","type--".concat(p),l,(_defineProperty(l={},"size--".concat(f),f),_defineProperty(l,"is--".concat(v),v),_defineProperty(l,"is--controls",u),_defineProperty(l,"is--prefix",!!g),_defineProperty(l,"is--suffix",!!D),_defineProperty(l,"is--readonly",m),_defineProperty(l,"is--visivle",h),_defineProperty(l,"is--disabled",y),_defineProperty(l,"is--active",c),l)]},b)},methods:{focus:function(){return this.isActivated=!0,this.$refs.input.focus(),this.$nextTick()},blur:function(){return this.$refs.input.blur(),this.isActivated=!1,this.$nextTick()},triggerEvent:function(e){var t=this.$refs,i=this.inputValue;this.$emit(e.type,{$panel:t.panel,value:i,$event:e})},emitModel:function(e,t){this.inputValue=e,this.$emit("modelValue",e),this.$emit("input",{value:e,$event:t}),_xeUtils.default.toValueString(this.value)!==e&&this.$emit("change",{value:e,$event:t})},emitInputEvent:function(e,t){var i=this.inpImmediate,a=this.isDatePickerType;this.inputValue=e,a||(i?this.emitModel(e,t):this.$emit("input",{value:e,$event:t}))},inputEvent:function(e){var t=e.target.value;this.emitInputEvent(t,e)},changeEvent:function(e){this.inpImmediate||this.triggerEvent(e)},focusEvent:function(e){this.isActivated=!0,this.triggerEvent(e)},blurEvent:function(e){var t=this.inputValue;this.inpImmediate||this.emitModel(t,e),this.afterCheckValue(),this.visiblePanel||(this.isActivated=!1),this.$emit("blur",{value:t,$event:e})},keydownEvent:function(e){var t,i,a,n,s=this.exponential,r=this.controls;this.isNumType&&(t=e.ctrlKey,i=e.shiftKey,a=e.altKey,n=e.keyCode,t||i||a||!(32===n||(!s||69!==n)&&65<=n&&n<=90||186<=n&&n<=188||191<=n)||e.preventDefault(),r&&this.numberKeydownEvent(e)),this.triggerEvent(e)},wheelEvent:function(e){var t;this.isNumType&&this.controls&&this.isActivated&&(0<(t=e.deltaY)?this.numberNextEvent(e):t<0&&this.numberPrevEvent(e),e.preventDefault()),this.triggerEvent(e)},clickEvent:function(e){this.isDatePickerType&&this.datePickerOpenEvent(e),this.triggerEvent(e)},clickPrefixEvent:function(e){var t=this.$refs,i=this.disabled,a=this.inputValue;i||this.$emit("prefix-click",{$panel:t.panel,value:a,$event:e})},clickSuffixEvent:function(e){var t=this.$refs,i=this.disabled,a=this.inputValue;i||(_tools.DomTools.hasClass(e.currentTarget,"is--clear")?(this.emitModel("",e),this.clearValueEvent(e,"")):this.$emit("suffix-click",{$panel:t.panel,value:a,$event:e}))},clearValueEvent:function(e,t){var i=this.$refs,a=this.type,n=this.isNumType;this.isDatePickerType&&this.hidePanel(),(n||-1<["text","search","password"].indexOf(a))&&this.focus(),this.$emit("clear",{$panel:i.panel,value:t,$event:e})},initValue:function(){var e=this.type,t=this.isDatePickerType,i=this.inputValue,a=this.digitsValue;t?this.changeValue():"float"===e&&(!i||i!==(a=toFloatValueFixed(i,a))&&this.emitModel(a,{type:"init"}))},changeValue:function(){this.isDatePickerType&&(this.dateParseValue(this.inputValue),this.inputValue=this.datePanelLabel)},afterCheckValue:function(){var e,t=this.type,i=this.exponential,a=this.inpReadonly,n=this.inputValue,s=this.isDatePickerType,r=this.isNumType,l=this.datetimePanelValue,u=this.dateLabelFormat,o=this.min,d=this.max;a||(r?n&&(e="integer"===t?_xeUtils.default.toInteger(n):_xeUtils.default.toNumber(n),this.vaildMinNum(e)?this.vaildMaxNum(e)||(e=d):e=o,!i||(i=_xeUtils.default.toValueString(n).toLowerCase())===_xeUtils.default.toNumber(e).toExponential()&&(e=i),this.emitModel(getNumberValue(this,e),{type:"check"})):s&&(n?"week"===t||"quarter"===t||(e="time"===t?toStringTimeDate(n):_xeUtils.default.toStringDate(n,u),_xeUtils.default.isValidDate(e)?"time"===t?(n!==(e=toStringTimeDate(e))&&this.emitModel(e,{type:"check"}),this.inputValue=e):(s=!1,"datetime"===t?n===_xeUtils.default.toDateString(this.dateValue,u)&&n===_xeUtils.default.toDateString(e,u)||(s=!0,l.setHours(e.getHours()),l.setMinutes(e.getMinutes()),l.setSeconds(e.getSeconds())):s=!0,this.inputValue=_xeUtils.default.toDateString(e,u),s&&this.dateChange(e)):this.dateRevert()):this.emitModel("",{type:"check"})))},passwordToggleEvent:function(e){var t=this.disabled,i=this.readonly,a=this.showPwd;t||i||(this.showPwd=!a),this.$emit("toggle-visible",{visible:this.showPwd,$event:e})},searchEvent:function(e){this.$emit("search-click",{$event:e})},vaildMinNum:function(e){return null===this.min||e>=_xeUtils.default.toNumber(this.min)},vaildMaxNum:function(e){return null===this.max||e<=_xeUtils.default.toNumber(this.max)},numberStopDown:function(){clearTimeout(this.downbumTimeout)},numberDownPrevEvent:function(e){var t=this;this.downbumTimeout=setTimeout(function(){t.numberPrevEvent(e),t.numberDownPrevEvent(e)},60)},numberDownNextEvent:function(e){var t=this;this.downbumTimeout=setTimeout(function(){t.numberNextEvent(e),t.numberDownNextEvent(e)},60)},numberKeydownEvent:function(e){var t=e.keyCode,i=38===t;!i&&40!==t||(e.preventDefault(),i?this.numberPrevEvent(e):this.numberNextEvent(e))},numberMousedownEvent:function(e){var t,i=this;this.numberStopDown(),0===e.button&&((t=_tools.DomTools.hasClass(e.currentTarget,"is--prev"))?this.numberPrevEvent(e):this.numberNextEvent(e),this.downbumTimeout=setTimeout(function(){t?i.numberDownPrevEvent(e):i.numberDownNextEvent(e)},500))},numberPrevEvent:function(e){var t=this.disabled,i=this.readonly;clearTimeout(this.downbumTimeout),t||i||this.numberChange(!0,e),this.$emit("prev-number",{$event:e})},numberNextEvent:function(e){var t=this.disabled,i=this.readonly;clearTimeout(this.downbumTimeout),t||i||this.numberChange(!1,e),this.$emit("next-number",{$event:e})},numberChange:function(e,t){var i=this.min,a=this.max,n=this.type,s=this.inputValue,r=this.stepValue,s="integer"===n?_xeUtils.default.toInteger(s):_xeUtils.default.toNumber(s),r=e?_xeUtils.default.add(s,r):_xeUtils.default.subtract(s,r),i=this.vaildMinNum(r)?this.vaildMaxNum(r)?r:a:i;this.emitInputEvent(getNumberValue(this,i),t)},datePickerOpenEvent:function(e){this.readonly||(e.preventDefault(),this.showPanel())},dateMonthHandle:function(e,t){this.selectMonth=_xeUtils.default.getWhatMonth(e,t,"first")},dateNowHandle:function(){var e=_xeUtils.default.getWhatDay(Date.now(),0,"first");this.currentDate=e,this.dateMonthHandle(e,0)},dateToggleTypeEvent:function(){var e="month"===(e=this.datePanelType)||"quarter"===e?"year":"month";this.datePanelType=e},datePrevEvent:function(e){var t=this.isDisabledPrevDateBtn,i=this.type,a=this.datePanelType;t||(this.selectMonth="year"===i?_xeUtils.default.getWhatYear(this.selectMonth,-yearSize,"first"):"month"===i||"quarter"===i?"year"===a?_xeUtils.default.getWhatYear(this.selectMonth,-yearSize,"first"):_xeUtils.default.getWhatYear(this.selectMonth,-1,"first"):"year"===a?_xeUtils.default.getWhatYear(this.selectMonth,-yearSize,"first"):"month"===a?_xeUtils.default.getWhatYear(this.selectMonth,-1,"first"):_xeUtils.default.getWhatMonth(this.selectMonth,-1,"first"),this.$emit("date-prev",{type:i,$event:e}))},dateTodayMonthEvent:function(e){this.dateNowHandle(),this.dateChange(this.currentDate),this.hidePanel(),this.$emit("date-today",{type:this.type,$event:e})},dateNextEvent:function(e){var t=this.isDisabledNextDateBtn,i=this.type,a=this.datePanelType;t||(this.selectMonth="year"===i?_xeUtils.default.getWhatYear(this.selectMonth,yearSize,"first"):"month"===i||"quarter"===i?"year"===a?_xeUtils.default.getWhatYear(this.selectMonth,yearSize,"first"):_xeUtils.default.getWhatYear(this.selectMonth,1,"first"):"year"===a?_xeUtils.default.getWhatYear(this.selectMonth,yearSize,"first"):"month"===a?_xeUtils.default.getWhatYear(this.selectMonth,1,"first"):_xeUtils.default.getWhatMonth(this.selectMonth,1,"first"),this.$emit("date-next",{type:i,$event:e}))},dateSelectEvent:function(e){isDateDisabled(this,e)||this.dateSelectItem(e.date)},dateSelectItem:function(e){var t=this.type,i=this.datePanelType,a="week"===t;"month"===t?"year"===i?(this.datePanelType="month",this.dateCheckMonth(e)):(this.dateChange(e),this.hidePanel()):"year"===t?(this.hidePanel(),this.dateChange(e)):"quarter"===t?"year"===i?(this.datePanelType="quarter",this.dateCheckMonth(e)):(this.dateChange(e),this.hidePanel()):"month"===i?(this.datePanelType="week"===t?t:"day",this.dateCheckMonth(e)):"year"===i?(this.datePanelType="month",this.dateCheckMonth(e)):(this.dateChange(e),this.hidePanel()),a&&this.changeValue()},dateMouseenterEvent:function(e){var t;isDateDisabled(this,e)||("month"===(t=this.datePanelType)?this.dateMoveMonth(e.date):"quarter"===t?this.dateMoveQuarter(e.date):"year"===t?this.dateMoveYear(e.date):this.dateMoveDay(e.date))},dateHourEvent:function(e,t){this.datetimePanelValue.setHours(t.value),this.dateTimeChangeEvent(e)},dateConfirmEvent:function(){this.dateChange(this.dateValue||this.currentDate),this.hidePanel()},dateMinuteEvent:function(e,t){this.datetimePanelValue.setMinutes(t.value),this.dateTimeChangeEvent(e)},dateSecondEvent:function(e,t){this.datetimePanelValue.setSeconds(t.value),this.dateTimeChangeEvent(e)},dateTimeChangeEvent:function(e){this.datetimePanelValue=new Date(this.datetimePanelValue.getTime()),this.updateTimePos(e.currentTarget)},updateTimePos:function(e){var t;e&&(t=e.offsetHeight,e.parentNode.scrollTop=e.offsetTop-4*t)},dateMoveDay:function(t){isDateDisabled(this,{date:t})||(this.dayList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyMMdd")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveMonth:function(t){isDateDisabled(this,{date:t})||(this.monthList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyMM")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveQuarter:function(t){isDateDisabled(this,{date:t})||(this.quarterList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyyq")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateMoveYear:function(t){isDateDisabled(this,{date:t})||(this.yearList.some(function(e){return _xeUtils.default.isDateSame(e.date,t,"yyyy")})||this.dateCheckMonth(t),this.dateParseValue(t))},dateParseValue:function(e){var t=this.type,i=this.dateLabelFormat,a=this.valueFormat,n=null,s="";e&&(n="time"===t?toStringTimeDate(e):_xeUtils.default.toStringDate(e,a)),_xeUtils.default.isValidDate(n)?s=_xeUtils.default.toDateString(n,i):n=null,this.datePanelValue=n,this.datePanelLabel=s},dateOffsetEvent:function(e){var t,i,a,n=this.isActivated,s=this.datePanelValue,r=this.datePanelType;n&&(e.preventDefault(),t=37===(i=e.keyCode),n=38===i,e=39===i,i=40===i,"year"===r?(a=_xeUtils.default.getWhatYear(s||Date.now(),0,"first"),t?a=_xeUtils.default.getWhatYear(a,-1):n?a=_xeUtils.default.getWhatYear(a,-4):e?a=_xeUtils.default.getWhatYear(a,1):i&&(a=_xeUtils.default.getWhatYear(a,4)),this.dateMoveYear(a)):"quarter"===r?(a=_xeUtils.default.getWhatQuarter(s||Date.now(),0,"first"),t?a=_xeUtils.default.getWhatQuarter(a,-1):n?a=_xeUtils.default.getWhatQuarter(a,-2):e?a=_xeUtils.default.getWhatQuarter(a,1):i&&(a=_xeUtils.default.getWhatQuarter(a,2)),this.dateMoveQuarter(a)):"month"===r?(r=_xeUtils.default.getWhatMonth(s||Date.now(),0,"first"),t?r=_xeUtils.default.getWhatMonth(r,-1):n?r=_xeUtils.default.getWhatMonth(r,-4):e?r=_xeUtils.default.getWhatMonth(r,1):i&&(r=_xeUtils.default.getWhatMonth(r,4)),this.dateMoveMonth(r)):(s=s||_xeUtils.default.getWhatDay(Date.now(),0,"first"),t?s=_xeUtils.default.getWhatDay(s,-1):n?s=_xeUtils.default.getWhatWeek(s,-1):e?s=_xeUtils.default.getWhatDay(s,1):i&&(s=_xeUtils.default.getWhatWeek(s,1)),this.dateMoveDay(s)))},datePgOffsetEvent:function(e){var t;this.isActivated&&(t=33===e.keyCode,e.preventDefault(),t?this.datePrevEvent(e):this.dateNextEvent(e))},dateChange:function(e){var t,i=this.value,a=this.datetimePanelValue,n=this.dateValueFormat;"week"===this.type?(t=_xeUtils.default.toNumber(this.selectDay),e=_xeUtils.default.getWhatWeek(e,0,t)):this.hasTime&&(e.setHours(a.getHours()),e.setMinutes(a.getMinutes()),e.setSeconds(a.getSeconds()));n=_xeUtils.default.toDateString(e,n);this.dateCheckMonth(e),_xeUtils.default.isEqual(i,n)||this.emitModel(n,{type:"update"})},dateCheckMonth:function(e){e=_xeUtils.default.getWhatMonth(e,0,"first");_xeUtils.default.isEqual(e,this.selectMonth)||(this.selectMonth=e)},dateOpenPanel:function(){var e=this,t=this.type,i=this.dateValue;-1<["year","quarter","month","week"].indexOf(t)?this.datePanelType=t:this.datePanelType="day",this.currentDate=_xeUtils.default.getWhatDay(Date.now(),0,"first"),i?(this.dateMonthHandle(i,0),this.dateParseValue(i)):this.dateNowHandle(),this.hasTime&&(this.datetimePanelValue=this.datePanelValue||_xeUtils.default.getWhatDay(Date.now(),0,"first"),this.$nextTick(function(){_xeUtils.default.arrayEach(e.$refs.timeBody.querySelectorAll("li.is--selected"),e.updateTimePos)}))},dateRevert:function(){this.inputValue=this.datePanelLabel},updateZindex:function(){this.panelIndex<_tools.UtilTools.getLastZIndex()&&(this.panelIndex=_tools.UtilTools.nextZIndex())},showPanel:function(){var e=this,t=this.disabled,i=this.visiblePanel,a=this.isDatePickerType;t||i||(clearTimeout(this.hidePanelTimeout),this.isActivated=!0,this.animatVisible=!0,a&&this.dateOpenPanel(),setTimeout(function(){e.visiblePanel=!0},10),this.updateZindex(),this.updatePlacement())},hidePanel:function(){var e=this;this.visiblePanel=!1,this.hidePanelTimeout=setTimeout(function(){e.animatVisible=!1},350)},updatePlacement:function(){var c=this;return this.$nextTick().then(function(){var e=c.$refs,t=c.transfer,i=c.placement,a=c.panelIndex,n=e.input,s=e.panel;if(n&&s){var r=n.offsetHeight,l=n.offsetWidth,u=s.offsetHeight,o=s.offsetWidth,d={zIndex:a},h=_tools.DomTools.getAbsolutePos(n),e=h.boundingTop,s=h.boundingLeft,a=h.visibleHeight,n=h.visibleWidth,h="bottom";return t?(t=e+r,"top"===i?(h="top",t=e-u):i||(a<t+u+5&&(h="top",t=e-u),t<5&&(h="bottom",t=e+r)),n<(s=s)+o+5&&(s-=s+o+5-n),s<5&&(s=5),Object.assign(d,{left:"".concat(s,"px"),top:"".concat(t,"px"),minWidth:"".concat(l,"px")})):"top"===i?(h="top",d.bottom="".concat(r,"px")):i||a<e+r+u&&5<e-r-u&&(h="top",d.bottom="".concat(r,"px")),c.panelStyle=d,c.panelPlacement=h,c.$nextTick()}})},handleGlobalMousedownEvent:function(e){var t=this.$refs,i=this.$el,a=this.disabled,n=this.visiblePanel,s=this.isActivated;!a&&s&&(this.isActivated=_tools.DomTools.getEventTargetNode(e,i).flag||_tools.DomTools.getEventTargetNode(e,t.panel).flag,this.isActivated||(this.isDatePickerType?n&&(this.hidePanel(),this.afterCheckValue()):this.afterCheckValue()))},handleGlobalKeydownEvent:function(e){var t,i,a,n,s,r,l,u,o,d,h=this.isDatePickerType,c=this.visiblePanel,f=this.clearable;this.disabled||(i=46===(t=e.keyCode),a=27===t,n=13===t,s=38===t,r=40===t,l=33===t,u=34===t,o=37===t||s||39===t||r,d=this.isActivated,(t=9===t)?(d&&this.afterCheckValue(),this.isActivated=d=!1):o?h&&d&&(c?this.dateOffsetEvent(e):(s||r)&&this.datePickerOpenEvent(e)):n?h&&(c?this.datePanelValue?this.dateSelectItem(this.datePanelValue):this.hidePanel():d&&this.datePickerOpenEvent(e)):(l||u)&&h&&d&&this.datePgOffsetEvent(e),t||a?c&&this.hidePanel():i&&f&&d&&this.clearValueEvent(e,null))},handleGlobalMousewheelEvent:function(e){var t=this.$refs,i=this.disabled,a=this.visiblePanel;i||a&&(_tools.DomTools.getEventTargetNode(e,t.panel).flag?this.updatePlacement():(this.hidePanel(),this.afterCheckValue()))},handleGlobalBlurEvent:function(){var e=this.isActivated;this.visiblePanel?(this.hidePanel(),this.afterCheckValue()):e&&this.afterCheckValue()}}};exports.default=_default2;
|
package/lib/table/src/body.js
CHANGED
|
@@ -212,7 +212,7 @@ function renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, r
|
|
|
212
212
|
} // 点击事件处理
|
|
213
213
|
|
|
214
214
|
|
|
215
|
-
if (highlightCurrentRow || tableListeners['cell-click'] || editRender && editConfig || expandOpts.trigger === 'row' || expandOpts.trigger === 'cell' || radioOpts.trigger === 'row' || column.type === 'radio' && radioOpts.trigger === 'cell' || checkboxOpts.trigger === 'row' || column.type === 'checkbox' && checkboxOpts.trigger === 'cell' || treeOpts.trigger === 'row' || column.treeNode && treeOpts.trigger === 'cell') {
|
|
215
|
+
if (rowOpts.isCurrent || highlightCurrentRow || tableListeners['cell-click'] || editRender && editConfig || expandOpts.trigger === 'row' || expandOpts.trigger === 'cell' || radioOpts.trigger === 'row' || column.type === 'radio' && radioOpts.trigger === 'cell' || checkboxOpts.trigger === 'row' || column.type === 'checkbox' && checkboxOpts.trigger === 'cell' || treeOpts.trigger === 'row' || column.treeNode && treeOpts.trigger === 'cell') {
|
|
216
216
|
tdOns.click = function (evnt) {
|
|
217
217
|
$xetable.triggerCellClickEvent(evnt, params);
|
|
218
218
|
};
|
|
@@ -350,7 +350,8 @@ function renderRows(h, _vm, $xetable, $seq, fixedType, tableData, tableColumn) {
|
|
|
350
350
|
checkboxOpts = $xetable.checkboxOpts,
|
|
351
351
|
expandColumn = $xetable.expandColumn,
|
|
352
352
|
hasFixedColumn = $xetable.hasFixedColumn,
|
|
353
|
-
fullAllDataRowIdData = $xetable.fullAllDataRowIdData
|
|
353
|
+
fullAllDataRowIdData = $xetable.fullAllDataRowIdData,
|
|
354
|
+
rowOpts = $xetable.rowOpts;
|
|
354
355
|
var rows = [];
|
|
355
356
|
tableData.forEach(function (row, $rowIndex) {
|
|
356
357
|
var trOn = {};
|
|
@@ -366,7 +367,7 @@ function renderRows(h, _vm, $xetable, $seq, fixedType, tableData, tableColumn) {
|
|
|
366
367
|
|
|
367
368
|
rowIndex = $xetable.getRowIndex(row); // 事件绑定
|
|
368
369
|
|
|
369
|
-
if (highlightHoverRow) {
|
|
370
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
370
371
|
trOn.mouseenter = function (evnt) {
|
|
371
372
|
if (isOperateMouse($xetable)) {
|
|
372
373
|
return;
|
|
@@ -697,7 +698,8 @@ var _default = {
|
|
|
697
698
|
scrollXLoad = $xetable.scrollXLoad,
|
|
698
699
|
scrollYLoad = $xetable.scrollYLoad,
|
|
699
700
|
lastScrollTop = $xetable.lastScrollTop,
|
|
700
|
-
lastScrollLeft = $xetable.lastScrollLeft
|
|
701
|
+
lastScrollLeft = $xetable.lastScrollLeft,
|
|
702
|
+
rowOpts = $xetable.rowOpts;
|
|
701
703
|
var tableHeader = $refs.tableHeader,
|
|
702
704
|
tableBody = $refs.tableBody,
|
|
703
705
|
leftBody = $refs.leftBody,
|
|
@@ -721,7 +723,7 @@ var _default = {
|
|
|
721
723
|
$xetable.lastScrollLeft = scrollLeft;
|
|
722
724
|
$xetable.lastScrollTime = Date.now();
|
|
723
725
|
|
|
724
|
-
if (highlightHoverRow) {
|
|
726
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
725
727
|
$xetable.clearHoverRow();
|
|
726
728
|
}
|
|
727
729
|
|
|
@@ -859,7 +861,8 @@ var _default = {
|
|
|
859
861
|
highlightHoverRow = $xetable.highlightHoverRow,
|
|
860
862
|
scrollYLoad = $xetable.scrollYLoad,
|
|
861
863
|
lastScrollTop = $xetable.lastScrollTop,
|
|
862
|
-
lastScrollLeft = $xetable.lastScrollLeft
|
|
864
|
+
lastScrollLeft = $xetable.lastScrollLeft,
|
|
865
|
+
rowOpts = $xetable.rowOpts;
|
|
863
866
|
var tableBody = $refs.tableBody;
|
|
864
867
|
var bodyElem = tableBody.$el;
|
|
865
868
|
var deltaTop = _dom.browse.firefox ? deltaY * 40 : deltaY;
|
|
@@ -881,7 +884,7 @@ var _default = {
|
|
|
881
884
|
$xetable.lastScrollLeft = scrollLeft;
|
|
882
885
|
$xetable.lastScrollTime = Date.now();
|
|
883
886
|
|
|
884
|
-
if (highlightHoverRow) {
|
|
887
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
885
888
|
$xetable.clearHoverRow();
|
|
886
889
|
}
|
|
887
890
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_tools=require("../../tools"),_util=require("./util"),_dom=require("../../tools/src/dom");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,l,t){return l in e?Object.defineProperty(e,l,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[l]=t,e}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,l){if(e){if("string"==typeof e)return _arrayLikeToArray(e,l);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,l):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,l){(null==l||l>e.length)&&(l=e.length);for(var t=0,o=new Array(l);t<l;t++)o[t]=e[t];return o}var scrollProcessTimeout,renderType="body";function isOperateMouse(e){return e._isResize||e.lastScrollTime&&Date.now()<e.lastScrollTime+e.delayHover}function renderLine(e,l,t,o,r,i){var n=i.column,a=t.treeOpts,s=t.treeConfig,c=n.slots,n=n.treeNode;return c&&c.line?t.callSlot(c.line,i,e):s&&n&&a.line?[e("div",{class:"vxe-tree--line-wrapper"},[e("div",{class:"vxe-tree--line",style:{height:"".concat((0,_util.calcTreeLine)(i,r),"px"),left:"".concat(o*a.indent+(o?2-(0,_util.getOffsetSize)(t):0)+16,"px")}})])]:[]}function renderColumn(e,l,t,o,r,i,n,a,s,c,d,u,p,f,h,y){var v,g=t.$listeners,m=t.afterFullData,x=t.tableData,w=t.height,b=t.columnKey,T=t.overflowX,_=t.sYOpts,S=t.scrollXLoad,O=t.scrollYLoad,$=t.highlightCurrentRow,C=t.showOverflow,L=t.isAllOverflow,I=t.align,k=t.currentColumn,E=t.cellClassName,R=t.cellStyle,Y=t.mergeList,A=t.spanMethod,H=t.radioOpts,P=t.checkboxOpts,B=t.expandOpts,D=t.treeOpts,M=t.tooltipOpts,U=t.mouseConfig,q=t.editConfig,W=t.editOpts,X=t.editRules,j=t.validOpts,N=t.editStore,z=t.validStore,F=t.tooltipConfig,V=t.rowOpts,K=p.type,G=p.cellRender,J=p.editRender,Q=p.align,Z=p.showOverflow,ee=p.className,le=p.treeNode,te=N.actived,oe=_.rHeight,re=V.height,ie=M.showAll||M.enabled,ne=t.getColumnIndex(p),N=t.getVTColumnIndex(p),_=(0,_tools.isEnableConf)(J),V=n?p.fixed!==n:p.fixed&&T,M=_xeUtils.default.isUndefined(Z)||_xeUtils.default.isNull(Z)?C:Z,T="ellipsis"===M,ae="title"===M,se=!0===M||"tooltip"===M,Z=ae||se||T,M={},Q=Q||I,I=z.row===s&&z.column===p,X=X&&j.showMessage&&("default"===j.message?w||1<x.length:"inline"===j.message),w={colid:p.id},ce=g["cell-mouseenter"],de=g["cell-mouseleave"],j=J&&q&&"dblclick"===W.trigger,ue={$table:t,$seq:o,seq:r,rowid:i,row:s,rowIndex:c,$rowIndex:d,_rowIndex:u,column:p,columnIndex:ne,$columnIndex:f,_columnIndex:N,fixed:n,type:renderType,isHidden:V,level:a,visibleData:m,data:x,items:y};if(!S&&!O||Z||(T=Z=!0),(ae||se||ie||ce||F)&&(M.mouseenter=function(e){isOperateMouse(t)||(ae?_tools.DomTools.updateCellTitle(e.currentTarget,p):(se||ie)&&t.triggerBodyTooltipEvent(e,ue),ce&&t.emitEvent("cell-mouseenter",Object.assign({cell:e.currentTarget},ue),e))}),(se||ie||de||F)&&(M.mouseleave=function(e){isOperateMouse(t)||((se||ie)&&t.handleTargetLeaveEvent(e),de&&t.emitEvent("cell-mouseleave",Object.assign({cell:e.currentTarget},ue),e))}),(P.range||U)&&(M.mousedown=function(e){t.triggerCellMousedownEvent(e,ue)}),($||g["cell-click"]||J&&q||"row"===B.trigger||"cell"===B.trigger||"row"===H.trigger||"radio"===p.type&&"cell"===H.trigger||"row"===P.trigger||"checkbox"===p.type&&"cell"===P.trigger||"row"===D.trigger||p.treeNode&&"cell"===D.trigger)&&(M.click=function(e){t.triggerCellClickEvent(e,ue)}),(j||g["cell-dblclick"])&&(M.dblclick=function(e){t.triggerCellDblclickEvent(e,ue)}),Y.length){u=(0,_util.mergeBodyMethod)(Y,u,N);if(u){var N=u.rowspan,pe=u.colspan;if(!N||!pe)return null;1<N&&(w.rowspan=N),1<pe&&(w.colspan=pe)}}else if(A){pe=A(ue)||{},A=pe.rowspan,A=void 0===A?1:A,pe=pe.colspan,pe=void 0===pe?1:pe;if(!A||!pe)return null;1<A&&(w.rowspan=A),1<pe&&(w.colspan=pe)}!(V=V&&Y&&(1<w.colspan||1<w.rowspan)?!1:V)&&q&&(J||G)&&(W.showStatus||W.showUpdateStatus)&&(v=t.isUpdateByRow(s,p.property));G=[];return V&&C&&L?G.push(e("div",{class:["vxe-cell",{"c--title":ae,"c--tooltip":se,"c--ellipsis":T}],style:{maxHeight:Z&&(oe||re)?"".concat(oe||re,"px"):""}})):(G.push.apply(G,_toConsumableArray(renderLine(e,l,t,a,y,ue)).concat([e("div",{class:["vxe-cell",{"c--title":ae,"c--tooltip":se,"c--ellipsis":T}],style:{maxHeight:Z&&(oe||re)?"".concat(oe||re,"px"):""},attrs:{title:ae?t.getCellLabel(s,p):null}},p.renderCell(e,ue))])),X&&I&&G.push(e("div",{class:"vxe-cell--valid",style:z.rule&&z.rule.maxWidth?{width:"".concat(z.rule.maxWidth,"px")}:null},[e("span",{class:"vxe-cell--valid-msg"},z.content)]))),e("td",{class:["vxe-body--column",p.id,(_defineProperty(e={},"col--".concat(Q),Q),_defineProperty(e,"col--".concat(K),K),_defineProperty(e,"col--last",f===h.length-1),_defineProperty(e,"col--tree-node",le),_defineProperty(e,"col--edit",_),_defineProperty(e,"col--ellipsis",Z),_defineProperty(e,"fixed--hidden",V),_defineProperty(e,"col--dirty",v),_defineProperty(e,"col--actived",q&&_&&te.row===s&&(te.column===p||"row"===W.mode)),_defineProperty(e,"col--valid-error",I),_defineProperty(e,"col--current",k===p),e),_tools.UtilTools.getClass(ee,ue),_tools.UtilTools.getClass(E,ue)],key:b?p.id:f,attrs:w,style:Object.assign({height:Z&&(oe||re)?"".concat(oe||re,"px"):""},R?_xeUtils.default.isFunction(R)?R(ue):R:null),on:M},G)}function renderRows(p,f,h,y,v,g,m){var x=h.stripe,w=h.rowKey,b=h.highlightHoverRow,T=h.rowClassName,_=h.rowStyle,S=h.editConfig,O=h.showOverflow,$=h.treeConfig,C=h.treeOpts,L=h.editOpts,I=h.treeExpandeds,k=h.scrollYLoad,E=h.scrollYStore,R=h.editStore,Y=h.rowExpandeds,A=h.radioOpts,H=h.checkboxOpts,P=h.expandColumn,B=h.hasFixedColumn,D=h.fullAllDataRowIdData,M=[];return g.forEach(function(t,o){var e={},r=o+1;k&&(r+=E.startIndex);var i=h.getVTRowIndex(t),n=h.getRowIndex(t);b&&(e.mouseenter=function(e){isOperateMouse(h)||h.triggerHoverEvent(e,{row:t,rowIndex:n})},e.mouseleave=function(){isOperateMouse(h)||h.clearHoverRow()});var l,a,s=_tools.UtilTools.getRowid(h,t),c=D[s],d=c?c.level:0,u={$table:h,$seq:y,seq:r,rowid:s,fixed:v,type:renderType,level:d,row:t,rowIndex:n,$rowIndex:o},c=!1;S&&(c=-1<R.insertList.indexOf(t)),M.push(p("tr",{class:["vxe-body--row",{"row--stripe":x&&(h.getVTRowIndex(t)+1)%2==0,"is--new":c,"row--new":c&&(L.showStatus||L.showInsertStatus),"row--radio":A.highlight&&h.selectRow===t,"row--checked":H.highlight&&h.isCheckedByCheckboxRow(t)},T?_xeUtils.default.isFunction(T)?T(u):T:""],attrs:{rowid:s},style:_?_xeUtils.default.isFunction(_)?_(u):_:null,key:w||$?s:o,on:e},m.map(function(e,l){return renderColumn(p,f,h,y,r,s,v,d,t,n,o,i,e,l,m,g)}))),P&&Y.length&&-1<Y.indexOf(t)&&($&&(l={paddingLeft:"".concat(d*C.indent+30,"px")}),a=P.showOverflow,u=_xeUtils.default.isUndefined(a)||_xeUtils.default.isNull(a)?O:a,a={$table:h,$seq:y,seq:r,column:P,fixed:v,type:renderType,level:d,row:t,rowIndex:n,$rowIndex:o},M.push(p("tr",{class:"vxe-body--expanded-row",key:"expand_".concat(s),style:_?_xeUtils.default.isFunction(_)?_(a):_:null,on:e},[p("td",{class:["vxe-body--expanded-column",{"fixed--hidden":v&&!B,"col--ellipsis":u}],attrs:{colspan:m.length}},[p("div",{class:"vxe-body--expanded-cell",style:l},[P.renderData(p,a)])])]))),!$||k||!I.length||(a=t[C.children])&&a.length&&-1<I.indexOf(t)&&M.push.apply(M,_toConsumableArray(renderRows(p,f,h,(y?"".concat(y,"."):"").concat(r),v,a,m)))}),M}function syncBodyScroll(e,l,t){(l||t)&&(l&&((0,_util.removeScrollListener)(l),l.scrollTop=e),t&&((0,_util.removeScrollListener)(t),t.scrollTop=e),clearTimeout(scrollProcessTimeout),scrollProcessTimeout=setTimeout(function(){(0,_util.restoreScrollListener)(l),(0,_util.restoreScrollListener)(t)},300))}var _default={name:"VxeTableBody",props:{tableData:Array,tableColumn:Array,fixedColumn:Array,size:String,fixedType:String},data:function(){return{wheelTime:null,wheelYSize:0,wheelYInterval:0,wheelYTotal:0}},mounted:function(){var e=this.$parent,l=this.$el,t=this.$refs,o=this.fixedType,e=e.elemStore,o="".concat(o||"main","-body-");e["".concat(o,"wrapper")]=l,e["".concat(o,"table")]=t.table,e["".concat(o,"colgroup")]=t.colgroup,e["".concat(o,"list")]=t.tbody,e["".concat(o,"xSpace")]=t.xSpace,e["".concat(o,"ySpace")]=t.ySpace,e["".concat(o,"emptyBlock")]=t.emptyBlock,this.$el.onscroll=this.scrollEvent,this.$el._onscroll=this.scrollEvent},beforeDestroy:function(){clearTimeout(this.wheelTime),this.$el._onscroll=null,this.$el.onscroll=null},render:function(t){var e=this._e,l=this.$parent,o=this.fixedColumn,r=this.fixedType,i=l.$scopedSlots,n=l.tId,a=l.tableData,s=l.tableColumn,c=l.visibleColumn,d=l.showOverflow,u=l.keyboardConfig,p=l.keyboardOpts,f=l.mergeList,h=l.spanMethod,y=l.scrollXLoad,v=l.scrollYLoad,g=l.isAllOverflow,m=l.emptyOpts,x=l.mouseConfig,w=l.mouseOpts,b=l.sYOpts;return r&&(s=!(y||v||d&&g)||f.length||h||u&&p.isMerge?c:o),m=i.empty?i.empty.call(this,{$table:l},t):(i=(i=m.name?_vXETable.default.renderer.get(m.name):null)?i.renderEmpty:null)?i.call(this,t,m,{$table:l}):l.emptyText||_conf.default.i18n("vxe.table.emptyText"),t("div",{class:["vxe-table--body-wrapper",r?"fixed-".concat(r,"--wrapper"):"body--wrapper"],attrs:{xid:n},on:v&&"wheel"===b.mode?{wheel:this.wheelEvent}:{}},[r?e():t("div",{class:"vxe-body--x-space",ref:"xSpace"}),t("div",{class:"vxe-body--y-space",ref:"ySpace"}),t("table",{class:"vxe-table--body",attrs:{xid:n,cellspacing:0,cellpadding:0,border:0},ref:"table"},[t("colgroup",{ref:"colgroup"},s.map(function(e,l){return t("col",{attrs:{name:e.id},key:l})})),t("tbody",{ref:"tbody"},renderRows(t,this,l,"",r,a,s))]),t("div",{class:"vxe-table--checkbox-range"}),x&&w.area?t("div",{class:"vxe-table--cell-area"},[t("span",{class:"vxe-table--cell-main-area"},w.extension?[t("span",{class:"vxe-table--cell-main-area-btn",on:{mousedown:function(e){l.triggerCellExtendMousedownEvent(e,{$table:l,fixed:r,type:renderType})}}})]:null),t("span",{class:"vxe-table--cell-copy-area"}),t("span",{class:"vxe-table--cell-extend-area"}),t("span",{class:"vxe-table--cell-multi-area"}),t("span",{class:"vxe-table--cell-active-area"})]):null,r?null:t("div",{class:"vxe-table--empty-block",ref:"emptyBlock"},[t("div",{class:"vxe-table--empty-content"},m)])])},methods:{scrollEvent:function(e){var l=this.$el,t=this.$parent,o=this.fixedType,r=t.$refs,i=t.elemStore,n=t.highlightHoverRow,a=t.scrollXLoad,s=t.scrollYLoad,c=t.lastScrollTop,d=t.lastScrollLeft,u=r.tableHeader,p=r.tableBody,f=r.leftBody,h=r.rightBody,y=r.tableFooter,v=r.validTip,g=u?u.$el:null,r=y?y.$el:null,u=p.$el,y=f?f.$el:null,p=h?h.$el:null,f=i["main-body-ySpace"],h=i["main-body-xSpace"],i=f?f.clientHeight:0,f=h?h.clientWidth:0,h=l.scrollTop,l=u.scrollLeft,d=l!==d,c=h!==c;t.lastScrollTop=h,t.lastScrollLeft=l,t.lastScrollTime=Date.now(),n&&t.clearHoverRow(),y&&"left"===o?syncBodyScroll(h=y.scrollTop,u,p):p&&"right"===o?syncBodyScroll(h=p.scrollTop,u,y):(d&&(g&&(g.scrollLeft=u.scrollLeft),r&&(r.scrollLeft=u.scrollLeft)),(y||p)&&(t.checkScrolling(),c&&syncBodyScroll(h,y,p))),a&&d&&t.triggerScrollXEvent(e),s&&c&&t.triggerScrollYEvent(e),d&&v&&v.visible&&v.updatePlacement(),t.emitEvent("scroll",{type:renderType,fixed:o,scrollTop:h,scrollLeft:l,bodyHeight:i,bodyWidth:f,isX:d,isY:c},e)},handleWheel:function(a,s,e,c,d){var u=this,p=this.$parent,l=p.$refs,t=p.elemStore,o=l.tableBody,r=l.leftBody,l=l.rightBody,f=o.$el,h=r?r.$el:null,y=l?l.$el:null,r=this.isPrevWheelTop===s?Math.max(0,this.wheelYSize-this.wheelYTotal):0,l=t["main-body-ySpace"],t=t["main-body-xSpace"],v=l?l.clientHeight:0,g=t?t.clientWidth:0;this.isPrevWheelTop=s,this.wheelYSize=Math.abs(s?e-r:e+r),this.wheelYInterval=0,this.wheelYTotal=0,clearTimeout(this.wheelTime),function e(){var l,t,o=u.fixedType,r=u.wheelYTotal,i=u.wheelYSize,n=u.wheelYInterval;r<i&&(i<(r+=n=Math.max(5,Math.floor(1.5*n)))&&(n-=r-i),t=f.scrollTop,l=f.clientHeight,i=f.scrollHeight,f.scrollTop=t=t+n*(s?-1:1),h&&(h.scrollTop=t),y&&(y.scrollTop=t),(s?t<i-l:0<=t)&&(u.wheelTime=setTimeout(e,10)),u.wheelYTotal=r,u.wheelYInterval=n,p.emitEvent("scroll",{type:renderType,fixed:o,scrollTop:f.scrollTop,scrollLeft:f.scrollLeft,bodyHeight:v,bodyWidth:g,isX:c,isY:d},a))}()},wheelEvent:function(e){var l=e.deltaY,t=e.deltaX,o=this.$el,r=this.$parent,i=r.$refs,n=r.highlightHoverRow,a=r.scrollYLoad,s=r.lastScrollTop,c=r.lastScrollLeft,d=i.tableBody.$el,i=_dom.browse.firefox?40*l:l,l=_dom.browse.firefox?40*t:t,t=i<0;(t?o.scrollTop<=0:o.scrollTop>=o.scrollHeight-o.clientHeight)||(o=o.scrollTop+i,c=(l=d.scrollLeft+l)!==c,(s=o!==s)&&(e.preventDefault(),r.lastScrollTop=o,r.lastScrollLeft=l,r.lastScrollTime=Date.now(),n&&r.clearHoverRow(),this.handleWheel(e,t,i,c,s),a&&r.triggerScrollYEvent(e)))}}};exports.default=_default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_tools=require("../../tools"),_util=require("./util"),_dom=require("../../tools/src/dom");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,l,t){return l in e?Object.defineProperty(e,l,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[l]=t,e}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,l){if(e){if("string"==typeof e)return _arrayLikeToArray(e,l);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,l):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,l){(null==l||l>e.length)&&(l=e.length);for(var t=0,o=new Array(l);t<l;t++)o[t]=e[t];return o}var scrollProcessTimeout,renderType="body";function isOperateMouse(e){return e._isResize||e.lastScrollTime&&Date.now()<e.lastScrollTime+e.delayHover}function renderLine(e,l,t,o,r,i){var n=i.column,s=t.treeOpts,a=t.treeConfig,c=n.slots,n=n.treeNode;return c&&c.line?t.callSlot(c.line,i,e):a&&n&&s.line?[e("div",{class:"vxe-tree--line-wrapper"},[e("div",{class:"vxe-tree--line",style:{height:"".concat((0,_util.calcTreeLine)(i,r),"px"),left:"".concat(o*s.indent+(o?2-(0,_util.getOffsetSize)(t):0)+16,"px")}})])]:[]}function renderColumn(e,l,t,o,r,i,n,s,a,c,d,u,p,f,h,y){var v,g=t.$listeners,m=t.afterFullData,x=t.tableData,w=t.height,b=t.columnKey,T=t.overflowX,_=t.sYOpts,S=t.scrollXLoad,O=t.scrollYLoad,C=t.highlightCurrentRow,$=t.showOverflow,L=t.isAllOverflow,I=t.align,k=t.currentColumn,E=t.cellClassName,H=t.cellStyle,R=t.mergeList,Y=t.spanMethod,A=t.radioOpts,P=t.checkboxOpts,B=t.expandOpts,D=t.treeOpts,M=t.tooltipOpts,U=t.mouseConfig,q=t.editConfig,W=t.editOpts,X=t.editRules,j=t.validOpts,N=t.editStore,z=t.validStore,F=t.tooltipConfig,V=t.rowOpts,K=p.type,G=p.cellRender,J=p.editRender,Q=p.align,Z=p.showOverflow,ee=p.className,le=p.treeNode,te=N.actived,oe=_.rHeight,re=V.height,ie=M.showAll||M.enabled,ne=t.getColumnIndex(p),se=t.getVTColumnIndex(p),N=(0,_tools.isEnableConf)(J),_=n?p.fixed!==n:p.fixed&&T,M=_xeUtils.default.isUndefined(Z)||_xeUtils.default.isNull(Z)?$:Z,T="ellipsis"===M,ae="title"===M,ce=!0===M||"tooltip"===M,Z=ae||ce||T,M={},Q=Q||I,I=z.row===a&&z.column===p,X=X&&j.showMessage&&("default"===j.message?w||1<x.length:"inline"===j.message),w={colid:p.id},de=g["cell-mouseenter"],ue=g["cell-mouseleave"],j=J&&q&&"dblclick"===W.trigger,pe={$table:t,$seq:o,seq:r,rowid:i,row:a,rowIndex:c,$rowIndex:d,_rowIndex:u,column:p,columnIndex:ne,$columnIndex:f,_columnIndex:se,fixed:n,type:renderType,isHidden:_,level:s,visibleData:m,data:x,items:y};if(!S&&!O||Z||(T=Z=!0),(ae||ce||ie||de||F)&&(M.mouseenter=function(e){isOperateMouse(t)||(ae?_tools.DomTools.updateCellTitle(e.currentTarget,p):(ce||ie)&&t.triggerBodyTooltipEvent(e,pe),de&&t.emitEvent("cell-mouseenter",Object.assign({cell:e.currentTarget},pe),e))}),(ce||ie||ue||F)&&(M.mouseleave=function(e){isOperateMouse(t)||((ce||ie)&&t.handleTargetLeaveEvent(e),ue&&t.emitEvent("cell-mouseleave",Object.assign({cell:e.currentTarget},pe),e))}),(P.range||U)&&(M.mousedown=function(e){t.triggerCellMousedownEvent(e,pe)}),(V.isCurrent||C||g["cell-click"]||J&&q||"row"===B.trigger||"cell"===B.trigger||"row"===A.trigger||"radio"===p.type&&"cell"===A.trigger||"row"===P.trigger||"checkbox"===p.type&&"cell"===P.trigger||"row"===D.trigger||p.treeNode&&"cell"===D.trigger)&&(M.click=function(e){t.triggerCellClickEvent(e,pe)}),(j||g["cell-dblclick"])&&(M.dblclick=function(e){t.triggerCellDblclickEvent(e,pe)}),R.length){u=(0,_util.mergeBodyMethod)(R,u,se);if(u){var se=u.rowspan,fe=u.colspan;if(!se||!fe)return null;1<se&&(w.rowspan=se),1<fe&&(w.colspan=fe)}}else if(Y){fe=Y(pe)||{},Y=fe.rowspan,Y=void 0===Y?1:Y,fe=fe.colspan,fe=void 0===fe?1:fe;if(!Y||!fe)return null;1<Y&&(w.rowspan=Y),1<fe&&(w.colspan=fe)}!(_=_&&R&&(1<w.colspan||1<w.rowspan)?!1:_)&&q&&(J||G)&&(W.showStatus||W.showUpdateStatus)&&(v=t.isUpdateByRow(a,p.property));G=[];return _&&$&&L?G.push(e("div",{class:["vxe-cell",{"c--title":ae,"c--tooltip":ce,"c--ellipsis":T}],style:{maxHeight:Z&&(oe||re)?"".concat(oe||re,"px"):""}})):(G.push.apply(G,_toConsumableArray(renderLine(e,l,t,s,y,pe)).concat([e("div",{class:["vxe-cell",{"c--title":ae,"c--tooltip":ce,"c--ellipsis":T}],style:{maxHeight:Z&&(oe||re)?"".concat(oe||re,"px"):""},attrs:{title:ae?t.getCellLabel(a,p):null}},p.renderCell(e,pe))])),X&&I&&G.push(e("div",{class:"vxe-cell--valid",style:z.rule&&z.rule.maxWidth?{width:"".concat(z.rule.maxWidth,"px")}:null},[e("span",{class:"vxe-cell--valid-msg"},z.content)]))),e("td",{class:["vxe-body--column",p.id,(_defineProperty(e={},"col--".concat(Q),Q),_defineProperty(e,"col--".concat(K),K),_defineProperty(e,"col--last",f===h.length-1),_defineProperty(e,"col--tree-node",le),_defineProperty(e,"col--edit",N),_defineProperty(e,"col--ellipsis",Z),_defineProperty(e,"fixed--hidden",_),_defineProperty(e,"col--dirty",v),_defineProperty(e,"col--actived",q&&N&&te.row===a&&(te.column===p||"row"===W.mode)),_defineProperty(e,"col--valid-error",I),_defineProperty(e,"col--current",k===p),e),_tools.UtilTools.getClass(ee,pe),_tools.UtilTools.getClass(E,pe)],key:b?p.id:f,attrs:w,style:Object.assign({height:Z&&(oe||re)?"".concat(oe||re,"px"):""},H?_xeUtils.default.isFunction(H)?H(pe):H:null),on:M},G)}function renderRows(p,f,h,y,v,g,m){var x=h.stripe,w=h.rowKey,b=h.highlightHoverRow,T=h.rowClassName,_=h.rowStyle,S=h.editConfig,O=h.showOverflow,C=h.treeConfig,$=h.treeOpts,L=h.editOpts,I=h.treeExpandeds,k=h.scrollYLoad,E=h.scrollYStore,H=h.editStore,R=h.rowExpandeds,Y=h.radioOpts,A=h.checkboxOpts,P=h.expandColumn,B=h.hasFixedColumn,D=h.fullAllDataRowIdData,M=h.rowOpts,U=[];return g.forEach(function(t,o){var e={},r=o+1;k&&(r+=E.startIndex);var i=h.getVTRowIndex(t),n=h.getRowIndex(t);(M.isHover||b)&&(e.mouseenter=function(e){isOperateMouse(h)||h.triggerHoverEvent(e,{row:t,rowIndex:n})},e.mouseleave=function(){isOperateMouse(h)||h.clearHoverRow()});var l,s,a=_tools.UtilTools.getRowid(h,t),c=D[a],d=c?c.level:0,u={$table:h,$seq:y,seq:r,rowid:a,fixed:v,type:renderType,level:d,row:t,rowIndex:n,$rowIndex:o},c=!1;S&&(c=-1<H.insertList.indexOf(t)),U.push(p("tr",{class:["vxe-body--row",{"row--stripe":x&&(h.getVTRowIndex(t)+1)%2==0,"is--new":c,"row--new":c&&(L.showStatus||L.showInsertStatus),"row--radio":Y.highlight&&h.selectRow===t,"row--checked":A.highlight&&h.isCheckedByCheckboxRow(t)},T?_xeUtils.default.isFunction(T)?T(u):T:""],attrs:{rowid:a},style:_?_xeUtils.default.isFunction(_)?_(u):_:null,key:w||C?a:o,on:e},m.map(function(e,l){return renderColumn(p,f,h,y,r,a,v,d,t,n,o,i,e,l,m,g)}))),P&&R.length&&-1<R.indexOf(t)&&(C&&(l={paddingLeft:"".concat(d*$.indent+30,"px")}),s=P.showOverflow,u=_xeUtils.default.isUndefined(s)||_xeUtils.default.isNull(s)?O:s,s={$table:h,$seq:y,seq:r,column:P,fixed:v,type:renderType,level:d,row:t,rowIndex:n,$rowIndex:o},U.push(p("tr",{class:"vxe-body--expanded-row",key:"expand_".concat(a),style:_?_xeUtils.default.isFunction(_)?_(s):_:null,on:e},[p("td",{class:["vxe-body--expanded-column",{"fixed--hidden":v&&!B,"col--ellipsis":u}],attrs:{colspan:m.length}},[p("div",{class:"vxe-body--expanded-cell",style:l},[P.renderData(p,s)])])]))),!C||k||!I.length||(s=t[$.children])&&s.length&&-1<I.indexOf(t)&&U.push.apply(U,_toConsumableArray(renderRows(p,f,h,(y?"".concat(y,"."):"").concat(r),v,s,m)))}),U}function syncBodyScroll(e,l,t){(l||t)&&(l&&((0,_util.removeScrollListener)(l),l.scrollTop=e),t&&((0,_util.removeScrollListener)(t),t.scrollTop=e),clearTimeout(scrollProcessTimeout),scrollProcessTimeout=setTimeout(function(){(0,_util.restoreScrollListener)(l),(0,_util.restoreScrollListener)(t)},300))}var _default={name:"VxeTableBody",props:{tableData:Array,tableColumn:Array,fixedColumn:Array,size:String,fixedType:String},data:function(){return{wheelTime:null,wheelYSize:0,wheelYInterval:0,wheelYTotal:0}},mounted:function(){var e=this.$parent,l=this.$el,t=this.$refs,o=this.fixedType,e=e.elemStore,o="".concat(o||"main","-body-");e["".concat(o,"wrapper")]=l,e["".concat(o,"table")]=t.table,e["".concat(o,"colgroup")]=t.colgroup,e["".concat(o,"list")]=t.tbody,e["".concat(o,"xSpace")]=t.xSpace,e["".concat(o,"ySpace")]=t.ySpace,e["".concat(o,"emptyBlock")]=t.emptyBlock,this.$el.onscroll=this.scrollEvent,this.$el._onscroll=this.scrollEvent},beforeDestroy:function(){clearTimeout(this.wheelTime),this.$el._onscroll=null,this.$el.onscroll=null},render:function(t){var e=this._e,l=this.$parent,o=this.fixedColumn,r=this.fixedType,i=l.$scopedSlots,n=l.tId,s=l.tableData,a=l.tableColumn,c=l.visibleColumn,d=l.showOverflow,u=l.keyboardConfig,p=l.keyboardOpts,f=l.mergeList,h=l.spanMethod,y=l.scrollXLoad,v=l.scrollYLoad,g=l.isAllOverflow,m=l.emptyOpts,x=l.mouseConfig,w=l.mouseOpts,b=l.sYOpts;return r&&(a=!(y||v||d&&g)||f.length||h||u&&p.isMerge?c:o),m=i.empty?i.empty.call(this,{$table:l},t):(i=(i=m.name?_vXETable.default.renderer.get(m.name):null)?i.renderEmpty:null)?i.call(this,t,m,{$table:l}):l.emptyText||_conf.default.i18n("vxe.table.emptyText"),t("div",{class:["vxe-table--body-wrapper",r?"fixed-".concat(r,"--wrapper"):"body--wrapper"],attrs:{xid:n},on:v&&"wheel"===b.mode?{wheel:this.wheelEvent}:{}},[r?e():t("div",{class:"vxe-body--x-space",ref:"xSpace"}),t("div",{class:"vxe-body--y-space",ref:"ySpace"}),t("table",{class:"vxe-table--body",attrs:{xid:n,cellspacing:0,cellpadding:0,border:0},ref:"table"},[t("colgroup",{ref:"colgroup"},a.map(function(e,l){return t("col",{attrs:{name:e.id},key:l})})),t("tbody",{ref:"tbody"},renderRows(t,this,l,"",r,s,a))]),t("div",{class:"vxe-table--checkbox-range"}),x&&w.area?t("div",{class:"vxe-table--cell-area"},[t("span",{class:"vxe-table--cell-main-area"},w.extension?[t("span",{class:"vxe-table--cell-main-area-btn",on:{mousedown:function(e){l.triggerCellExtendMousedownEvent(e,{$table:l,fixed:r,type:renderType})}}})]:null),t("span",{class:"vxe-table--cell-copy-area"}),t("span",{class:"vxe-table--cell-extend-area"}),t("span",{class:"vxe-table--cell-multi-area"}),t("span",{class:"vxe-table--cell-active-area"})]):null,r?null:t("div",{class:"vxe-table--empty-block",ref:"emptyBlock"},[t("div",{class:"vxe-table--empty-content"},m)])])},methods:{scrollEvent:function(e){var l=this.$el,t=this.$parent,o=this.fixedType,r=t.$refs,i=t.elemStore,n=t.highlightHoverRow,s=t.scrollXLoad,a=t.scrollYLoad,c=t.lastScrollTop,d=t.lastScrollLeft,u=t.rowOpts,p=r.tableHeader,f=r.tableBody,h=r.leftBody,y=r.rightBody,v=r.tableFooter,g=r.validTip,m=p?p.$el:null,r=v?v.$el:null,p=f.$el,v=h?h.$el:null,f=y?y.$el:null,h=i["main-body-ySpace"],y=i["main-body-xSpace"],i=h?h.clientHeight:0,h=y?y.clientWidth:0,y=l.scrollTop,l=p.scrollLeft,d=l!==d,c=y!==c;t.lastScrollTop=y,t.lastScrollLeft=l,t.lastScrollTime=Date.now(),(u.isHover||n)&&t.clearHoverRow(),v&&"left"===o?syncBodyScroll(y=v.scrollTop,p,f):f&&"right"===o?syncBodyScroll(y=f.scrollTop,p,v):(d&&(m&&(m.scrollLeft=p.scrollLeft),r&&(r.scrollLeft=p.scrollLeft)),(v||f)&&(t.checkScrolling(),c&&syncBodyScroll(y,v,f))),s&&d&&t.triggerScrollXEvent(e),a&&c&&t.triggerScrollYEvent(e),d&&g&&g.visible&&g.updatePlacement(),t.emitEvent("scroll",{type:renderType,fixed:o,scrollTop:y,scrollLeft:l,bodyHeight:i,bodyWidth:h,isX:d,isY:c},e)},handleWheel:function(s,a,e,c,d){var u=this,p=this.$parent,l=p.$refs,t=p.elemStore,o=l.tableBody,r=l.leftBody,l=l.rightBody,f=o.$el,h=r?r.$el:null,y=l?l.$el:null,r=this.isPrevWheelTop===a?Math.max(0,this.wheelYSize-this.wheelYTotal):0,l=t["main-body-ySpace"],t=t["main-body-xSpace"],v=l?l.clientHeight:0,g=t?t.clientWidth:0;this.isPrevWheelTop=a,this.wheelYSize=Math.abs(a?e-r:e+r),this.wheelYInterval=0,this.wheelYTotal=0,clearTimeout(this.wheelTime),function e(){var l,t,o=u.fixedType,r=u.wheelYTotal,i=u.wheelYSize,n=u.wheelYInterval;r<i&&(i<(r+=n=Math.max(5,Math.floor(1.5*n)))&&(n-=r-i),t=f.scrollTop,l=f.clientHeight,i=f.scrollHeight,f.scrollTop=t=t+n*(a?-1:1),h&&(h.scrollTop=t),y&&(y.scrollTop=t),(a?t<i-l:0<=t)&&(u.wheelTime=setTimeout(e,10)),u.wheelYTotal=r,u.wheelYInterval=n,p.emitEvent("scroll",{type:renderType,fixed:o,scrollTop:f.scrollTop,scrollLeft:f.scrollLeft,bodyHeight:v,bodyWidth:g,isX:c,isY:d},s))}()},wheelEvent:function(e){var l=e.deltaY,t=e.deltaX,o=this.$el,r=this.$parent,i=r.$refs,n=r.highlightHoverRow,s=r.scrollYLoad,a=r.lastScrollTop,c=r.lastScrollLeft,d=r.rowOpts,u=i.tableBody.$el,i=_dom.browse.firefox?40*l:l,l=_dom.browse.firefox?40*t:t,t=i<0;(t?o.scrollTop<=0:o.scrollTop>=o.scrollHeight-o.clientHeight)||(o=o.scrollTop+i,c=(l=u.scrollLeft+l)!==c,(a=o!==a)&&(e.preventDefault(),r.lastScrollTop=o,r.lastScrollLeft=l,r.lastScrollTime=Date.now(),(d.isHover||n)&&r.clearHoverRow(),this.handleWheel(e,t,i,c,a),s&&r.triggerScrollYEvent(e)))}}};exports.default=_default;
|
package/lib/table/src/methods.js
CHANGED
|
@@ -652,18 +652,15 @@ var Methods = {
|
|
|
652
652
|
|
|
653
653
|
if (oRow && row) {
|
|
654
654
|
if (field) {
|
|
655
|
-
|
|
656
|
-
} else {
|
|
657
|
-
if (record) {
|
|
658
|
-
tableSourceData[rowIndex] = record;
|
|
655
|
+
var newValue = _xeUtils.default.get(record || row, field);
|
|
659
656
|
|
|
660
|
-
|
|
657
|
+
_xeUtils.default.set(row, field, newValue);
|
|
661
658
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
|
|
659
|
+
_xeUtils.default.set(oRow, field, newValue);
|
|
660
|
+
} else {
|
|
661
|
+
var newRecord = _xeUtils.default.clone(_objectSpread({}, record), true);
|
|
662
|
+
|
|
663
|
+
_xeUtils.default.destructuring(oRow, Object.assign(row, newRecord));
|
|
667
664
|
}
|
|
668
665
|
}
|
|
669
666
|
|
|
@@ -2918,7 +2915,8 @@ var Methods = {
|
|
|
2918
2915
|
treeOpts = _this24.treeOpts,
|
|
2919
2916
|
highlightCurrentRow = _this24.highlightCurrentRow,
|
|
2920
2917
|
currentRow = _this24.currentRow,
|
|
2921
|
-
bodyCtxMenu = _this24.bodyCtxMenu
|
|
2918
|
+
bodyCtxMenu = _this24.bodyCtxMenu,
|
|
2919
|
+
rowOpts = _this24.rowOpts;
|
|
2922
2920
|
var selected = editStore.selected,
|
|
2923
2921
|
actived = editStore.actived;
|
|
2924
2922
|
var keyCode = evnt.keyCode;
|
|
@@ -2988,7 +2986,7 @@ var Methods = {
|
|
|
2988
2986
|
_this24.keyCtxTimeout = setTimeout(function () {
|
|
2989
2987
|
_this24._keyCtx = false;
|
|
2990
2988
|
}, 1000);
|
|
2991
|
-
} else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && highlightCurrentRow && currentRow)) {
|
|
2989
|
+
} else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow)) {
|
|
2992
2990
|
// 退出选中
|
|
2993
2991
|
if (hasCtrlKey) {
|
|
2994
2992
|
// 如果是激活编辑状态,则取消编辑
|
|
@@ -3022,7 +3020,7 @@ var Methods = {
|
|
|
3022
3020
|
_this24.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
|
|
3023
3021
|
}
|
|
3024
3022
|
}
|
|
3025
|
-
} else if (treeConfig && highlightCurrentRow && currentRow) {
|
|
3023
|
+
} else if (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
|
|
3026
3024
|
// 如果是树形表格当前行回车移动到子节点
|
|
3027
3025
|
var childrens = currentRow[treeOpts.children];
|
|
3028
3026
|
|
|
@@ -3047,7 +3045,7 @@ var Methods = {
|
|
|
3047
3045
|
// 如果按下了方向键
|
|
3048
3046
|
if (selected.row && selected.column) {
|
|
3049
3047
|
_this24.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
3050
|
-
} else if ((isUpArrow || isDwArrow) && highlightCurrentRow) {
|
|
3048
|
+
} else if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
3051
3049
|
// 当前行按键上下移动
|
|
3052
3050
|
_this24.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
3053
3051
|
}
|
|
@@ -3059,7 +3057,7 @@ var Methods = {
|
|
|
3059
3057
|
} else if (actived.row || actived.column) {
|
|
3060
3058
|
_this24.moveTabSelected(actived.args, hasShiftKey, evnt);
|
|
3061
3059
|
}
|
|
3062
|
-
} else if (keyboardConfig && (isDel || (treeConfig && highlightCurrentRow && currentRow ? isBack && keyboardOpts.isArrow : isBack))) {
|
|
3060
|
+
} else if (keyboardConfig && (isDel || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow ? isBack && keyboardOpts.isArrow : isBack))) {
|
|
3063
3061
|
if (!isEditStatus) {
|
|
3064
3062
|
var delMethod = keyboardOpts.delMethod,
|
|
3065
3063
|
backMethod = keyboardOpts.backMethod; // 如果是删除键
|
|
@@ -3093,7 +3091,7 @@ var Methods = {
|
|
|
3093
3091
|
// 如果按下 del 键,更新表尾数据
|
|
3094
3092
|
_this24.updateFooter();
|
|
3095
3093
|
}
|
|
3096
|
-
} else if (isBack && keyboardOpts.isArrow && treeConfig && highlightCurrentRow && currentRow) {
|
|
3094
|
+
} else if (isBack && keyboardOpts.isArrow && treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
|
|
3097
3095
|
// 如果树形表格回退键关闭当前行返回父节点
|
|
3098
3096
|
var _XEUtils$findTree = _xeUtils.default.findTree(_this24.afterFullData, function (item) {
|
|
3099
3097
|
return item === currentRow;
|
|
@@ -4035,6 +4033,18 @@ var Methods = {
|
|
|
4035
4033
|
var reserveSelection = [];
|
|
4036
4034
|
|
|
4037
4035
|
if (checkboxOpts.reserve) {
|
|
4036
|
+
var afterFullIdMaps = {};
|
|
4037
|
+
|
|
4038
|
+
if (treeConfig) {
|
|
4039
|
+
_xeUtils.default.eachTree(afterFullData, function (row) {
|
|
4040
|
+
afterFullIdMaps[getRowid(_this30, row)] = 1;
|
|
4041
|
+
}, treeOpts);
|
|
4042
|
+
} else {
|
|
4043
|
+
afterFullData.forEach(function (row) {
|
|
4044
|
+
afterFullIdMaps[getRowid(_this30, row)] = 1;
|
|
4045
|
+
});
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4038
4048
|
_xeUtils.default.each(checkboxReserveRowMap, function (oldRow, oldRowid) {
|
|
4039
4049
|
if (oldRow) {
|
|
4040
4050
|
if (isFull) {
|
|
@@ -4042,18 +4052,8 @@ var Methods = {
|
|
|
4042
4052
|
reserveSelection.push(oldRow);
|
|
4043
4053
|
}
|
|
4044
4054
|
} else {
|
|
4045
|
-
if (
|
|
4046
|
-
|
|
4047
|
-
return getRowid(_this30, row) === oldRowid;
|
|
4048
|
-
}, treeOpts)) {
|
|
4049
|
-
reserveSelection.push(oldRow);
|
|
4050
|
-
}
|
|
4051
|
-
} else {
|
|
4052
|
-
if (!afterFullData.some(function (row) {
|
|
4053
|
-
return getRowid(_this30, row) === oldRowid;
|
|
4054
|
-
})) {
|
|
4055
|
-
reserveSelection.push(oldRow);
|
|
4056
|
-
}
|
|
4055
|
+
if (!afterFullIdMaps[oldRowid]) {
|
|
4056
|
+
reserveSelection.push(oldRow);
|
|
4057
4057
|
}
|
|
4058
4058
|
}
|
|
4059
4059
|
}
|
|
@@ -4209,12 +4209,13 @@ var Methods = {
|
|
|
4209
4209
|
* @param {Row} row 行对象
|
|
4210
4210
|
*/
|
|
4211
4211
|
setCurrentRow: function setCurrentRow(row) {
|
|
4212
|
-
var $el = this.$el
|
|
4212
|
+
var $el = this.$el,
|
|
4213
|
+
rowOpts = this.rowOpts;
|
|
4213
4214
|
this.clearCurrentRow();
|
|
4214
4215
|
this.clearCurrentColumn();
|
|
4215
4216
|
this.currentRow = row;
|
|
4216
4217
|
|
|
4217
|
-
if (this.highlightCurrentRow) {
|
|
4218
|
+
if (rowOpts.isCurrent || this.highlightCurrentRow) {
|
|
4218
4219
|
if ($el) {
|
|
4219
4220
|
_xeUtils.default.arrayEach($el.querySelectorAll("[rowid=\"".concat(getRowid(this, row), "\"]")), function (elem) {
|
|
4220
4221
|
return addClass(elem, 'row--current');
|
|
@@ -4275,7 +4276,7 @@ var Methods = {
|
|
|
4275
4276
|
* 用于当前行,获取当前行的数据
|
|
4276
4277
|
*/
|
|
4277
4278
|
getCurrentRecord: function getCurrentRecord() {
|
|
4278
|
-
return this.highlightCurrentRow ? this.currentRow : null;
|
|
4279
|
+
return this.rowOpts.isCurrent || this.highlightCurrentRow ? this.currentRow : null;
|
|
4279
4280
|
},
|
|
4280
4281
|
|
|
4281
4282
|
/**
|
|
@@ -4370,7 +4371,7 @@ var Methods = {
|
|
|
4370
4371
|
cell: cell
|
|
4371
4372
|
}, params), evnt);
|
|
4372
4373
|
|
|
4373
|
-
if (this.highlightCurrentColumn) {
|
|
4374
|
+
if (this.columnOpts.isCurrent || this.highlightCurrentColumn) {
|
|
4374
4375
|
return this.setCurrentColumn(column);
|
|
4375
4376
|
}
|
|
4376
4377
|
|
|
@@ -4382,7 +4383,7 @@ var Methods = {
|
|
|
4382
4383
|
}, params), evnt);
|
|
4383
4384
|
},
|
|
4384
4385
|
getCurrentColumn: function getCurrentColumn() {
|
|
4385
|
-
return this.highlightCurrentColumn ? this.currentColumn : null;
|
|
4386
|
+
return this.columnOpts.isCurrent || this.highlightCurrentColumn ? this.currentColumn : null;
|
|
4386
4387
|
},
|
|
4387
4388
|
|
|
4388
4389
|
/**
|
|
@@ -4447,7 +4448,8 @@ var Methods = {
|
|
|
4447
4448
|
treeOpts = this.treeOpts,
|
|
4448
4449
|
editConfig = this.editConfig,
|
|
4449
4450
|
editOpts = this.editOpts,
|
|
4450
|
-
checkboxOpts = this.checkboxOpts
|
|
4451
|
+
checkboxOpts = this.checkboxOpts,
|
|
4452
|
+
rowOpts = this.rowOpts;
|
|
4451
4453
|
var actived = editStore.actived;
|
|
4452
4454
|
var _params = params,
|
|
4453
4455
|
row = _params.row,
|
|
@@ -4486,7 +4488,7 @@ var Methods = {
|
|
|
4486
4488
|
if (!triggerTreeNode) {
|
|
4487
4489
|
if (!triggerExpandNode) {
|
|
4488
4490
|
// 如果是高亮行
|
|
4489
|
-
if (highlightCurrentRow) {
|
|
4491
|
+
if (rowOpts.isCurrent || highlightCurrentRow) {
|
|
4490
4492
|
if (!triggerCheckbox && !triggerRadio) {
|
|
4491
4493
|
this.triggerCurrentRowEvent(evnt, params);
|
|
4492
4494
|
}
|
|
@@ -5356,9 +5358,11 @@ var Methods = {
|
|
|
5356
5358
|
treeOpts = this.treeOpts,
|
|
5357
5359
|
treeFullData = this.treeFullData;
|
|
5358
5360
|
var fullData = [];
|
|
5361
|
+
var expandMaps = new Map();
|
|
5359
5362
|
|
|
5360
5363
|
_xeUtils.default.eachTree(treeFullData, function (row, index, items, path, parent) {
|
|
5361
|
-
if (!parent || treeExpandeds.indexOf(parent) > -1) {
|
|
5364
|
+
if (!parent || expandMaps.has(parent) && treeExpandeds.indexOf(parent) > -1) {
|
|
5365
|
+
expandMaps.set(row, 1);
|
|
5362
5366
|
fullData.push(row);
|
|
5363
5367
|
}
|
|
5364
5368
|
}, treeOpts);
|