vxe-table 3.5.0-beta.1 → 3.5.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,8 @@ function getOptUniqueId() {
40
40
  }
41
41
 
42
42
  function getOptkey(_vm) {
43
- return _vm.optionId || '_X_ID';
43
+ var optionOpts = _vm.optionOpts;
44
+ return optionOpts.keyField || _vm.optionId || '_X_OPTION_KEY';
44
45
  }
45
46
 
46
47
  function getOptid(_vm, option) {
@@ -184,7 +185,9 @@ function renderOption(h, _vm, list, group) {
184
185
  optionKey = _vm.optionKey,
185
186
  value = _vm.value,
186
187
  multiple = _vm.multiple,
187
- currentValue = _vm.currentValue;
188
+ currentValue = _vm.currentValue,
189
+ optionOpts = _vm.optionOpts;
190
+ var useKey = optionOpts.useKey;
188
191
  return list.map(function (option, cIndex) {
189
192
  var slots = option.slots;
190
193
  var isVisible = !isGroup || isOptionVisible(option);
@@ -193,7 +196,7 @@ function renderOption(h, _vm, list, group) {
193
196
  var optid = getOptid(_vm, option);
194
197
  var defaultSlot = slots ? slots.default : null;
195
198
  return isVisible ? h('div', {
196
- key: optionKey ? optid : cIndex,
199
+ key: useKey || optionKey ? optid : cIndex,
197
200
  class: ['vxe-select-option', option.className, {
198
201
  'is--disabled': isDisabled,
199
202
  'is--selected': multiple ? value && value.indexOf(optionValue) > -1 : value === optionValue,
@@ -226,14 +229,16 @@ function renderOptgroup(h, _vm) {
226
229
  var optionKey = _vm.optionKey,
227
230
  visibleGroupList = _vm.visibleGroupList,
228
231
  groupLabelField = _vm.groupLabelField,
229
- groupOptionsField = _vm.groupOptionsField;
232
+ groupOptionsField = _vm.groupOptionsField,
233
+ optionOpts = _vm.optionOpts;
234
+ var useKey = optionOpts.useKey;
230
235
  return visibleGroupList.map(function (group, gIndex) {
231
236
  var slots = group.slots;
232
237
  var optid = getOptid(_vm, group);
233
238
  var isGroupDisabled = group.disabled;
234
239
  var defaultSlot = slots ? slots.default : null;
235
240
  return h('div', {
236
- key: optionKey ? optid : gIndex,
241
+ key: useKey || optionKey ? optid : gIndex,
237
242
  class: ['vxe-optgroup', group.className, {
238
243
  'is--disabled': isGroupDisabled
239
244
  }],
@@ -293,6 +298,7 @@ var _default2 = {
293
298
  optionProps: Object,
294
299
  optionGroups: Array,
295
300
  optionGroupProps: Object,
301
+ optionConfig: Object,
296
302
  className: [String, Function],
297
303
  size: {
298
304
  type: String,
@@ -301,12 +307,14 @@ var _default2 = {
301
307
  }
302
308
  },
303
309
  emptyText: String,
310
+ // 已废弃,被 option-config.keyField 替换
304
311
  optionId: {
305
312
  type: String,
306
313
  default: function _default() {
307
314
  return _conf.default.select.optionId;
308
315
  }
309
316
  },
317
+ // 已废弃,被 option-config.useKey 替换
310
318
  optionKey: Boolean,
311
319
  transfer: {
312
320
  type: Boolean,
@@ -359,6 +367,9 @@ var _default2 = {
359
367
  groupOptionsField: function groupOptionsField() {
360
368
  return this.groupPropsOpts.options || 'options';
361
369
  },
370
+ optionOpts: function optionOpts() {
371
+ return Object.assign({}, _conf.default.select.optionConfig, this.optionConfig);
372
+ },
362
373
  isGroup: function isGroup() {
363
374
  return this.fullGroupList.some(function (item) {
364
375
  return item.options && item.options.length;
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.renderOptgroup=renderOptgroup,exports.renderOption=renderOption;var _xeUtils=_interopRequireDefault(require("xe-utils")),_input=_interopRequireDefault(require("../../input/src/input")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event");function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(_getRequireWildcardCache=function(t){return t?i:e})(t)}function _interopRequireWildcard(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==_typeof(t)&&"function"!=typeof t)return{default:t};e=_getRequireWildcardCache(e);if(e&&e.has(t))return e.get(t);var i,n,o={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&((n=l?Object.getOwnPropertyDescriptor(t,i):null)&&(n.get||n.set)?Object.defineProperty(o,i,n):o[i]=t[i]);return o.default=t,e&&e.set(t,o),o}function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function isOptionVisible(t){return!1!==t.visible}function getOptUniqueId(){return _xeUtils.default.uniqueId("opt_")}function getOptkey(t){return t.optionId||"_X_ID"}function getOptid(t,e){t=e[getOptkey(t)];return t?encodeURIComponent(t):""}function findOffsetOption(t,e,i){var n,o,l,s,r=t.isGroup,u=t.visibleOptionList,a=t.visibleGroupList,p=t.valueField,f=t.groupOptionsField;if(r)for(var c=0;c<a.length;c++){var d=a[c],h=d[f],v=d.disabled;if(h)for(var b=0;b<h.length;b++){var O=h[b],g=isOptionVisible(O),m=v||O.disabled;if(n||m||(n=O),s&&g&&!m&&(l=O,!i))return{offsetOption:l};if(e===O[p]){if(s=O,i)return{offsetOption:o}}else g&&!m&&(o=O)}}else for(var _=0;_<u.length;_++){var x=u[_],P=x.disabled;if(n||P||(n=x),s&&!P&&(l=x,!i))return{offsetOption:l};if(e===x[p]){if(s=x,i)return{offsetOption:o}}else P||(o=x)}return{firstOption:n}}function findOption(t,e){var i=t.isGroup,n=t.fullOptionList,o=t.fullGroupList,l=t.valueField;if(i)for(var s=0;s<o.length;s++){var r=o[s];if(r.options)for(var u=0;u<r.options.length;u++){var a=r.options[u];if(e===a[l])return a}}return n.find(function(t){return e===t[l]})}function getSelectLabel(t,e){var i=findOption(t,e);return _xeUtils.default.toValueString(i?i[t.labelField]:e)}function renderOption(r,u,t,a){var p=u.isGroup,f=u.labelField,c=u.valueField,d=u.optionKey,h=u.value,v=u.multiple,b=u.currentValue;return t.map(function(t,e){var i=t.slots,n=!p||isOptionVisible(t),o=a&&a.disabled||t.disabled,l=t[c],s=getOptid(u,t),i=i?i.default:null;return n?r("div",{key:d?s:e,class:["vxe-select-option",t.className,{"is--disabled":o,"is--selected":v?h&&-1<h.indexOf(l):h===l,"is--hover":b===l}],attrs:{optid:s},on:{mousedown:u.mousedownOptionEvent,click:function(t){o||u.changeOptionEvent(t,l)},mouseenter:function(){o||u.setCurrentOption(t)}}},i?u.callSlot(i,{option:t,$select:u},r):_utils.default.formatText((0,_utils.getFuncText)(t[f]))):null})}function renderOptgroup(l,s){var r=s.optionKey,t=s.visibleGroupList,u=s.groupLabelField,a=s.groupOptionsField;return t.map(function(t,e){var i=t.slots,n=getOptid(s,t),o=t.disabled,i=i?i.default:null;return l("div",{key:r?n:e,class:["vxe-optgroup",t.className,{"is--disabled":o}],attrs:{optid:n}},[l("div",{class:"vxe-optgroup--title"},i?s.callSlot(i,{option:t,$select:s},l):(0,_utils.getFuncText)(t[u])),l("div",{class:"vxe-optgroup--wrapper"},renderOption(l,s,t[a],t))])})}function renderOpts(t,e){var i=e.isGroup,n=e.visibleGroupList,o=e.visibleOptionList;if(i){if(n.length)return renderOptgroup(t,e)}else if(o.length)return renderOption(t,e,o);return[t("div",{class:"vxe-select--empty-placeholder"},e.emptyText||_conf.default.i18n("vxe.select.emptyText"))]}var _default2={name:"VxeSelect",mixins:[_size.default],props:{value:null,clearable:Boolean,placeholder:String,loading:Boolean,disabled:Boolean,multiple:Boolean,multiCharOverflow:{type:[Number,String],default:function(){return _conf.default.select.multiCharOverflow}},prefixIcon:String,placement:String,options:Array,optionProps:Object,optionGroups:Array,optionGroupProps:Object,className:[String,Function],size:{type:String,default:function(){return _conf.default.select.size||_conf.default.size}},emptyText:String,optionId:{type:String,default:function(){return _conf.default.select.optionId}},optionKey:Boolean,transfer:{type:Boolean,default:function(){return _conf.default.select.transfer}}},components:{VxeInput:_input.default},provide:function(){return{$xeselect:this}},data:function(){return{inited:!1,collectOption:[],fullGroupList:[],fullOptionList:[],visibleGroupList:[],visibleOptionList:[],panelIndex:0,panelStyle:null,panelPlacement:null,currentValue:null,visiblePanel:!1,animatVisible:!1,isActivated:!1}},computed:{propsOpts:function(){return this.optionProps||{}},groupPropsOpts:function(){return this.optionGroupProps||{}},labelField:function(){return this.propsOpts.label||"label"},valueField:function(){return this.propsOpts.value||"value"},groupLabelField:function(){return this.groupPropsOpts.label||"label"},groupOptionsField:function(){return this.groupPropsOpts.options||"options"},isGroup:function(){return this.fullGroupList.some(function(t){return t.options&&t.options.length})},multiMaxCharNum:function(){return _xeUtils.default.toNumber(this.multiCharOverflow)},selectLabel:function(){var e=this,t=this.value,i=this.multiple,n=this.multiMaxCharNum;return t&&i?(_xeUtils.default.isArray(t)?t:[t]).map(function(t){t=getSelectLabel(e,t);return 0<n&&t.length>n?"".concat(t.substring(0,n),"..."):t}).join(", "):getSelectLabel(this,t)}},watch:{collectOption:function(t){t.some(function(t){return t.options&&t.options.length})?(this.fullOptionList=[],this.fullGroupList=t):(this.fullGroupList=[],this.fullOptionList=t),this.cacheItemMap()},options:function(t){this.fullGroupList=[],this.fullOptionList=t,this.cacheItemMap()},optionGroups:function(t){this.fullOptionList=[],this.fullGroupList=t,this.cacheItemMap()}},created:function(){var t=this.options,e=this.optionGroups;e?this.fullGroupList=e:t&&(this.fullOptionList=t),this.cacheItemMap(),_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent),_event.GlobalEvent.on(this,"mousedown",this.handleGlobalMousedownEvent),_event.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent),_event.GlobalEvent.on(this,"blur",this.handleGlobalBlurEvent)},beforeDestroy:function(){var t=this.$refs.panel;t&&t.parentNode&&t.parentNode.removeChild(t)},destroyed:function(){_event.GlobalEvent.off(this,"mousewheel"),_event.GlobalEvent.off(this,"mousedown"),_event.GlobalEvent.off(this,"keydown"),_event.GlobalEvent.off(this,"blur")},render:function(t){var e=this.$scopedSlots,i=this.vSize,n=this.className,o=this.inited,l=this.isActivated,s=this.loading,r=this.disabled,u=this.visiblePanel,a=e.prefix;return t("div",{class:["vxe-select",n?_xeUtils.default.isFunction(n)?n({$select:this}):n:"",(_defineProperty(n={},"size--".concat(i),i),_defineProperty(n,"is--visivle",u),_defineProperty(n,"is--disabled",r),_defineProperty(n,"is--loading",s),_defineProperty(n,"is--active",l),n)]},[t("div",{class:"vxe-select-slots",ref:"hideOption"},this.$slots.default),t("vxe-input",{ref:"input",props:{clearable:this.clearable,placeholder:this.placeholder,readonly:!0,disabled:r,type:"text",prefixIcon:this.prefixIcon,suffixIcon:s?_conf.default.icon.SELECT_LOADED:u?_conf.default.icon.SELECT_OPEN:_conf.default.icon.SELECT_CLOSE,value:this.selectLabel},on:{clear:this.clearEvent,click:this.togglePanelEvent,focus:this.focusEvent,blur:this.blurEvent,"suffix-click":this.togglePanelEvent},scopedSlots:a?{prefix:function(){return a({})}}:{}}),t("div",{ref:"panel",class:["vxe-table--ignore-clear vxe-select--panel",(_defineProperty(r={},"size--".concat(i),i),_defineProperty(r,"is--transfer",this.transfer),_defineProperty(r,"animat--leave",!s&&this.animatVisible),_defineProperty(r,"animat--enter",!s&&u),r)],attrs:{placement:this.panelPlacement},style:this.panelStyle},o?[t("div",{ref:"optWrapper",class:"vxe-select-option--wrapper"},renderOpts(t,this))]:null)])},methods:{callSlot:function(t,e,i){if(t){var n=this.$scopedSlots;if(_xeUtils.default.isString(t)&&(t=n[t]||null),_xeUtils.default.isFunction(t))return t.call(this,e,i)}return[]},cacheItemMap:function(){function e(t){getOptid(i,t)||(t[l]=getOptUniqueId())}var i=this,t=this.fullOptionList,n=this.fullGroupList,o=this.groupOptionsField,l=getOptkey(this);n.length?n.forEach(function(t){e(t),t[o]&&t[o].forEach(e)}):t.length&&t.forEach(e),this.refreshOption()},refreshOption:function(){var t=this.isGroup,e=this.fullOptionList,i=this.fullGroupList;return t?this.visibleGroupList=i.filter(isOptionVisible):this.visibleOptionList=e.filter(isOptionVisible),this.$nextTick()},setCurrentOption:function(t){t&&(this.currentValue=t[this.valueField])},scrollToOption:function(n,o){var l=this;return this.$nextTick().then(function(){var t,e,i;n&&(t=(i=l.$refs).optWrapper,e=i.panel.querySelector("[optid='".concat(getOptid(l,n),"']")),t&&e&&(i=t.offsetHeight,o?e.offsetTop+e.offsetHeight-t.scrollTop>i&&(t.scrollTop=e.offsetTop+e.offsetHeight-i):(e.offsetTop+5<t.scrollTop||e.offsetTop+5>t.scrollTop+t.clientHeight)&&(t.scrollTop=e.offsetTop-5)))})},clearEvent:function(t,e){this.clearValueEvent(e,null),this.hideOptionPanel()},clearValueEvent:function(t,e){this.changeEvent(t,e),this.$emit("clear",{value:e,$event:t})},changeEvent:function(t,e){e!==this.value&&(this.$emit("input",e),this.$emit("change",{value:e,$event:t}))},mousedownOptionEvent:function(t){0===t.button&&t.stopPropagation()},changeOptionEvent:function(t,e){var i=this.value;this.multiple?(i=i?-1===i.indexOf(e)?i.concat([e]):i.filter(function(t){return t!==e}):[e],this.changeEvent(t,i)):(this.changeEvent(t,e),this.hideOptionPanel())},handleGlobalMousewheelEvent:function(t){var e=this.$refs,i=this.disabled,n=this.visiblePanel;i||n&&(_dom.default.getEventTargetNode(t,e.panel).flag?this.updatePlacement():this.hideOptionPanel())},handleGlobalMousedownEvent:function(t){var e=this.$refs,i=this.$el,n=this.disabled,o=this.visiblePanel;n||(this.isActivated=_dom.default.getEventTargetNode(t,i).flag||_dom.default.getEventTargetNode(t,e.panel).flag,o&&!this.isActivated&&this.hideOptionPanel())},handleGlobalKeydownEvent:function(t){var e,i,n,o,l,s,r,u=this.visiblePanel,a=this.currentValue,p=this.clearable;this.disabled||(e=13===(s=t.keyCode),r=27===s,i=38===s,n=40===s,o=46===s,l=32===s,(s=9===s)&&(this.isActivated=!1),u?r||s?this.hideOptionPanel():e?(t.preventDefault(),t.stopPropagation(),this.changeOptionEvent(t,a)):i||n?(t.preventDefault(),s=(r=findOffsetOption(this,a,i)).firstOption,(r=r.offsetOption)||findOption(this,a)||(r=s),this.setCurrentOption(r),this.scrollToOption(r,n)):l&&t.preventDefault():(i||n||e||l)&&this.isActivated&&(t.preventDefault(),this.showOptionPanel()),this.isActivated&&o&&p&&this.clearValueEvent(t,null))},handleGlobalBlurEvent:function(){this.hideOptionPanel()},updateZindex:function(){this.panelIndex<_utils.default.getLastZIndex()&&(this.panelIndex=_utils.default.nextZIndex())},focusEvent:function(){this.disabled||(this.isActivated=!0)},blurEvent:function(){this.isActivated=!1},isPanelVisible:function(){return this.visiblePanel},togglePanel:function(){this.visiblePanel?this.hideOptionPanel():this.showOptionPanel(),this.$nextTick()},hidePanel:function(){this.visiblePanel&&this.hideOptionPanel(),this.$nextTick()},showPanel:function(){this.visiblePanel||this.showOptionPanel(),this.$nextTick()},togglePanelEvent:function(t){t.$event.preventDefault(),this.visiblePanel?this.hideOptionPanel():this.showOptionPanel()},showOptionPanel:function(){var i=this,t=this.loading,e=this.disabled;t||e||(clearTimeout(this.hidePanelTimeout),this.inited||(this.inited=!0,this.transfer&&document.body.appendChild(this.$refs.panel)),this.isActivated=!0,this.animatVisible=!0,setTimeout(function(){var t=i.value,e=i.multiple,t=findOption(i,e&&t?t[0]:t);i.visiblePanel=!0,t&&(i.setCurrentOption(t),i.scrollToOption(t))},10),this.updateZindex(),this.updatePlacement())},hideOptionPanel:function(){var t=this;this.visiblePanel=!1,this.hidePanelTimeout=setTimeout(function(){t.animatVisible=!1},350)},updatePlacement:function(){var c=this;return this.$nextTick().then(function(){var t=c.$refs,e=c.transfer,i=c.placement,n=c.panelIndex,o=t.input.$el,l=t.panel;if(l&&o){var s=o.offsetHeight,r=o.offsetWidth,u=l.offsetHeight,a=l.offsetWidth,p={zIndex:n},f=_dom.default.getAbsolutePos(o),t=f.boundingTop,l=f.boundingLeft,n=f.visibleHeight,o=f.visibleWidth,f="bottom";return e?(e=t+s,"top"===i?(f="top",e=t-u):i||(n<e+u+5&&(f="top",e=t-u),e<5&&(f="bottom",e=t+s)),o<(l=l)+a+5&&(l-=l+a+5-o),l<5&&(l=5),Object.assign(p,{left:"".concat(l,"px"),top:"".concat(e,"px"),minWidth:"".concat(r,"px")})):"top"===i?(f="top",p.bottom="".concat(s,"px")):i||n<t+s+u&&5<t-s-u&&(f="top",p.bottom="".concat(s,"px")),c.panelStyle=p,c.panelPlacement=f,c.$nextTick()}})},focus:function(){return this.isActivated=!0,this.$refs.input.focus(),this.$nextTick()},blur:function(){return this.hideOptionPanel(),this.$refs.input.blur(),this.$nextTick()}}};exports.default=_default2;
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.renderOptgroup=renderOptgroup,exports.renderOption=renderOption;var _xeUtils=_interopRequireDefault(require("xe-utils")),_input=_interopRequireDefault(require("../../input/src/input")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event");function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(_getRequireWildcardCache=function(t){return t?i:e})(t)}function _interopRequireWildcard(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==_typeof(t)&&"function"!=typeof t)return{default:t};e=_getRequireWildcardCache(e);if(e&&e.has(t))return e.get(t);var i,n,o={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&((n=l?Object.getOwnPropertyDescriptor(t,i):null)&&(n.get||n.set)?Object.defineProperty(o,i,n):o[i]=t[i]);return o.default=t,e&&e.set(t,o),o}function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function isOptionVisible(t){return!1!==t.visible}function getOptUniqueId(){return _xeUtils.default.uniqueId("opt_")}function getOptkey(t){return t.optionOpts.keyField||t.optionId||"_X_OPTION_KEY"}function getOptid(t,e){t=e[getOptkey(t)];return t?encodeURIComponent(t):""}function findOffsetOption(t,e,i){var n,o,l,s,r=t.isGroup,u=t.visibleOptionList,a=t.visibleGroupList,p=t.valueField,f=t.groupOptionsField;if(r)for(var c=0;c<a.length;c++){var d=a[c],h=d[f],v=d.disabled;if(h)for(var b=0;b<h.length;b++){var O=h[b],g=isOptionVisible(O),m=v||O.disabled;if(n||m||(n=O),s&&g&&!m&&(l=O,!i))return{offsetOption:l};if(e===O[p]){if(s=O,i)return{offsetOption:o}}else g&&!m&&(o=O)}}else for(var _=0;_<u.length;_++){var x=u[_],y=x.disabled;if(n||y||(n=x),s&&!y&&(l=x,!i))return{offsetOption:l};if(e===x[p]){if(s=x,i)return{offsetOption:o}}else y||(o=x)}return{firstOption:n}}function findOption(t,e){var i=t.isGroup,n=t.fullOptionList,o=t.fullGroupList,l=t.valueField;if(i)for(var s=0;s<o.length;s++){var r=o[s];if(r.options)for(var u=0;u<r.options.length;u++){var a=r.options[u];if(e===a[l])return a}}return n.find(function(t){return e===t[l]})}function getSelectLabel(t,e){var i=findOption(t,e);return _xeUtils.default.toValueString(i?i[t.labelField]:e)}function renderOption(r,u,t,a){var p=u.isGroup,f=u.labelField,c=u.valueField,d=u.optionKey,h=u.value,v=u.multiple,b=u.currentValue,O=u.optionOpts.useKey;return t.map(function(t,e){var i=t.slots,n=!p||isOptionVisible(t),o=a&&a.disabled||t.disabled,l=t[c],s=getOptid(u,t),i=i?i.default:null;return n?r("div",{key:O||d?s:e,class:["vxe-select-option",t.className,{"is--disabled":o,"is--selected":v?h&&-1<h.indexOf(l):h===l,"is--hover":b===l}],attrs:{optid:s},on:{mousedown:u.mousedownOptionEvent,click:function(t){o||u.changeOptionEvent(t,l)},mouseenter:function(){o||u.setCurrentOption(t)}}},i?u.callSlot(i,{option:t,$select:u},r):_utils.default.formatText((0,_utils.getFuncText)(t[f]))):null})}function renderOptgroup(l,s){var r=s.optionKey,t=s.visibleGroupList,u=s.groupLabelField,a=s.groupOptionsField,p=s.optionOpts.useKey;return t.map(function(t,e){var i=t.slots,n=getOptid(s,t),o=t.disabled,i=i?i.default:null;return l("div",{key:p||r?n:e,class:["vxe-optgroup",t.className,{"is--disabled":o}],attrs:{optid:n}},[l("div",{class:"vxe-optgroup--title"},i?s.callSlot(i,{option:t,$select:s},l):(0,_utils.getFuncText)(t[u])),l("div",{class:"vxe-optgroup--wrapper"},renderOption(l,s,t[a],t))])})}function renderOpts(t,e){var i=e.isGroup,n=e.visibleGroupList,o=e.visibleOptionList;if(i){if(n.length)return renderOptgroup(t,e)}else if(o.length)return renderOption(t,e,o);return[t("div",{class:"vxe-select--empty-placeholder"},e.emptyText||_conf.default.i18n("vxe.select.emptyText"))]}var _default2={name:"VxeSelect",mixins:[_size.default],props:{value:null,clearable:Boolean,placeholder:String,loading:Boolean,disabled:Boolean,multiple:Boolean,multiCharOverflow:{type:[Number,String],default:function(){return _conf.default.select.multiCharOverflow}},prefixIcon:String,placement:String,options:Array,optionProps:Object,optionGroups:Array,optionGroupProps:Object,optionConfig:Object,className:[String,Function],size:{type:String,default:function(){return _conf.default.select.size||_conf.default.size}},emptyText:String,optionId:{type:String,default:function(){return _conf.default.select.optionId}},optionKey:Boolean,transfer:{type:Boolean,default:function(){return _conf.default.select.transfer}}},components:{VxeInput:_input.default},provide:function(){return{$xeselect:this}},data:function(){return{inited:!1,collectOption:[],fullGroupList:[],fullOptionList:[],visibleGroupList:[],visibleOptionList:[],panelIndex:0,panelStyle:null,panelPlacement:null,currentValue:null,visiblePanel:!1,animatVisible:!1,isActivated:!1}},computed:{propsOpts:function(){return this.optionProps||{}},groupPropsOpts:function(){return this.optionGroupProps||{}},labelField:function(){return this.propsOpts.label||"label"},valueField:function(){return this.propsOpts.value||"value"},groupLabelField:function(){return this.groupPropsOpts.label||"label"},groupOptionsField:function(){return this.groupPropsOpts.options||"options"},optionOpts:function(){return Object.assign({},_conf.default.select.optionConfig,this.optionConfig)},isGroup:function(){return this.fullGroupList.some(function(t){return t.options&&t.options.length})},multiMaxCharNum:function(){return _xeUtils.default.toNumber(this.multiCharOverflow)},selectLabel:function(){var e=this,t=this.value,i=this.multiple,n=this.multiMaxCharNum;return t&&i?(_xeUtils.default.isArray(t)?t:[t]).map(function(t){t=getSelectLabel(e,t);return 0<n&&t.length>n?"".concat(t.substring(0,n),"..."):t}).join(", "):getSelectLabel(this,t)}},watch:{collectOption:function(t){t.some(function(t){return t.options&&t.options.length})?(this.fullOptionList=[],this.fullGroupList=t):(this.fullGroupList=[],this.fullOptionList=t),this.cacheItemMap()},options:function(t){this.fullGroupList=[],this.fullOptionList=t,this.cacheItemMap()},optionGroups:function(t){this.fullOptionList=[],this.fullGroupList=t,this.cacheItemMap()}},created:function(){var t=this.options,e=this.optionGroups;e?this.fullGroupList=e:t&&(this.fullOptionList=t),this.cacheItemMap(),_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent),_event.GlobalEvent.on(this,"mousedown",this.handleGlobalMousedownEvent),_event.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent),_event.GlobalEvent.on(this,"blur",this.handleGlobalBlurEvent)},beforeDestroy:function(){var t=this.$refs.panel;t&&t.parentNode&&t.parentNode.removeChild(t)},destroyed:function(){_event.GlobalEvent.off(this,"mousewheel"),_event.GlobalEvent.off(this,"mousedown"),_event.GlobalEvent.off(this,"keydown"),_event.GlobalEvent.off(this,"blur")},render:function(t){var e=this.$scopedSlots,i=this.vSize,n=this.className,o=this.inited,l=this.isActivated,s=this.loading,r=this.disabled,u=this.visiblePanel,a=e.prefix;return t("div",{class:["vxe-select",n?_xeUtils.default.isFunction(n)?n({$select:this}):n:"",(_defineProperty(n={},"size--".concat(i),i),_defineProperty(n,"is--visivle",u),_defineProperty(n,"is--disabled",r),_defineProperty(n,"is--loading",s),_defineProperty(n,"is--active",l),n)]},[t("div",{class:"vxe-select-slots",ref:"hideOption"},this.$slots.default),t("vxe-input",{ref:"input",props:{clearable:this.clearable,placeholder:this.placeholder,readonly:!0,disabled:r,type:"text",prefixIcon:this.prefixIcon,suffixIcon:s?_conf.default.icon.SELECT_LOADED:u?_conf.default.icon.SELECT_OPEN:_conf.default.icon.SELECT_CLOSE,value:this.selectLabel},on:{clear:this.clearEvent,click:this.togglePanelEvent,focus:this.focusEvent,blur:this.blurEvent,"suffix-click":this.togglePanelEvent},scopedSlots:a?{prefix:function(){return a({})}}:{}}),t("div",{ref:"panel",class:["vxe-table--ignore-clear vxe-select--panel",(_defineProperty(r={},"size--".concat(i),i),_defineProperty(r,"is--transfer",this.transfer),_defineProperty(r,"animat--leave",!s&&this.animatVisible),_defineProperty(r,"animat--enter",!s&&u),r)],attrs:{placement:this.panelPlacement},style:this.panelStyle},o?[t("div",{ref:"optWrapper",class:"vxe-select-option--wrapper"},renderOpts(t,this))]:null)])},methods:{callSlot:function(t,e,i){if(t){var n=this.$scopedSlots;if(_xeUtils.default.isString(t)&&(t=n[t]||null),_xeUtils.default.isFunction(t))return t.call(this,e,i)}return[]},cacheItemMap:function(){function e(t){getOptid(i,t)||(t[l]=getOptUniqueId())}var i=this,t=this.fullOptionList,n=this.fullGroupList,o=this.groupOptionsField,l=getOptkey(this);n.length?n.forEach(function(t){e(t),t[o]&&t[o].forEach(e)}):t.length&&t.forEach(e),this.refreshOption()},refreshOption:function(){var t=this.isGroup,e=this.fullOptionList,i=this.fullGroupList;return t?this.visibleGroupList=i.filter(isOptionVisible):this.visibleOptionList=e.filter(isOptionVisible),this.$nextTick()},setCurrentOption:function(t){t&&(this.currentValue=t[this.valueField])},scrollToOption:function(n,o){var l=this;return this.$nextTick().then(function(){var t,e,i;n&&(t=(i=l.$refs).optWrapper,e=i.panel.querySelector("[optid='".concat(getOptid(l,n),"']")),t&&e&&(i=t.offsetHeight,o?e.offsetTop+e.offsetHeight-t.scrollTop>i&&(t.scrollTop=e.offsetTop+e.offsetHeight-i):(e.offsetTop+5<t.scrollTop||e.offsetTop+5>t.scrollTop+t.clientHeight)&&(t.scrollTop=e.offsetTop-5)))})},clearEvent:function(t,e){this.clearValueEvent(e,null),this.hideOptionPanel()},clearValueEvent:function(t,e){this.changeEvent(t,e),this.$emit("clear",{value:e,$event:t})},changeEvent:function(t,e){e!==this.value&&(this.$emit("input",e),this.$emit("change",{value:e,$event:t}))},mousedownOptionEvent:function(t){0===t.button&&t.stopPropagation()},changeOptionEvent:function(t,e){var i=this.value;this.multiple?(i=i?-1===i.indexOf(e)?i.concat([e]):i.filter(function(t){return t!==e}):[e],this.changeEvent(t,i)):(this.changeEvent(t,e),this.hideOptionPanel())},handleGlobalMousewheelEvent:function(t){var e=this.$refs,i=this.disabled,n=this.visiblePanel;i||n&&(_dom.default.getEventTargetNode(t,e.panel).flag?this.updatePlacement():this.hideOptionPanel())},handleGlobalMousedownEvent:function(t){var e=this.$refs,i=this.$el,n=this.disabled,o=this.visiblePanel;n||(this.isActivated=_dom.default.getEventTargetNode(t,i).flag||_dom.default.getEventTargetNode(t,e.panel).flag,o&&!this.isActivated&&this.hideOptionPanel())},handleGlobalKeydownEvent:function(t){var e,i,n,o,l,s,r,u=this.visiblePanel,a=this.currentValue,p=this.clearable;this.disabled||(e=13===(s=t.keyCode),r=27===s,i=38===s,n=40===s,o=46===s,l=32===s,(s=9===s)&&(this.isActivated=!1),u?r||s?this.hideOptionPanel():e?(t.preventDefault(),t.stopPropagation(),this.changeOptionEvent(t,a)):i||n?(t.preventDefault(),s=(r=findOffsetOption(this,a,i)).firstOption,(r=r.offsetOption)||findOption(this,a)||(r=s),this.setCurrentOption(r),this.scrollToOption(r,n)):l&&t.preventDefault():(i||n||e||l)&&this.isActivated&&(t.preventDefault(),this.showOptionPanel()),this.isActivated&&o&&p&&this.clearValueEvent(t,null))},handleGlobalBlurEvent:function(){this.hideOptionPanel()},updateZindex:function(){this.panelIndex<_utils.default.getLastZIndex()&&(this.panelIndex=_utils.default.nextZIndex())},focusEvent:function(){this.disabled||(this.isActivated=!0)},blurEvent:function(){this.isActivated=!1},isPanelVisible:function(){return this.visiblePanel},togglePanel:function(){this.visiblePanel?this.hideOptionPanel():this.showOptionPanel(),this.$nextTick()},hidePanel:function(){this.visiblePanel&&this.hideOptionPanel(),this.$nextTick()},showPanel:function(){this.visiblePanel||this.showOptionPanel(),this.$nextTick()},togglePanelEvent:function(t){t.$event.preventDefault(),this.visiblePanel?this.hideOptionPanel():this.showOptionPanel()},showOptionPanel:function(){var i=this,t=this.loading,e=this.disabled;t||e||(clearTimeout(this.hidePanelTimeout),this.inited||(this.inited=!0,this.transfer&&document.body.appendChild(this.$refs.panel)),this.isActivated=!0,this.animatVisible=!0,setTimeout(function(){var t=i.value,e=i.multiple,t=findOption(i,e&&t?t[0]:t);i.visiblePanel=!0,t&&(i.setCurrentOption(t),i.scrollToOption(t))},10),this.updateZindex(),this.updatePlacement())},hideOptionPanel:function(){var t=this;this.visiblePanel=!1,this.hidePanelTimeout=setTimeout(function(){t.animatVisible=!1},350)},updatePlacement:function(){var c=this;return this.$nextTick().then(function(){var t=c.$refs,e=c.transfer,i=c.placement,n=c.panelIndex,o=t.input.$el,l=t.panel;if(l&&o){var s=o.offsetHeight,r=o.offsetWidth,u=l.offsetHeight,a=l.offsetWidth,p={zIndex:n},f=_dom.default.getAbsolutePos(o),t=f.boundingTop,l=f.boundingLeft,n=f.visibleHeight,o=f.visibleWidth,f="bottom";return e?(e=t+s,"top"===i?(f="top",e=t-u):i||(n<e+u+5&&(f="top",e=t-u),e<5&&(f="bottom",e=t+s)),o<(l=l)+a+5&&(l-=l+a+5-o),l<5&&(l=5),Object.assign(p,{left:"".concat(l,"px"),top:"".concat(e,"px"),minWidth:"".concat(r,"px")})):"top"===i?(f="top",p.bottom="".concat(s,"px")):i||n<t+s+u&&5<t-s-u&&(f="top",p.bottom="".concat(s,"px")),c.panelStyle=p,c.panelPlacement=f,c.$nextTick()}})},focus:function(){return this.isActivated=!0,this.$refs.input.focus(),this.$nextTick()},blur:function(){return this.hideOptionPanel(),this.$refs.input.blur(),this.$nextTick()}}};exports.default=_default2;
@@ -53,9 +53,7 @@ function renderLine(h, _vm, $xetable, params) {
53
53
  fullAllDataRowIdData = $xetable.fullAllDataRowIdData;
54
54
  var slots = column.slots,
55
55
  treeNode = column.treeNode;
56
-
57
- var rowid = _utils.default.getRowid($xetable, row);
58
-
56
+ var rowid = (0, _util.getRowid)($xetable, row);
59
57
  var rest = fullAllDataRowIdData[rowid];
60
58
  var rLevel = 0;
61
59
  var rIndex = 0;
@@ -403,8 +401,7 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
403
401
  };
404
402
  }
405
403
 
406
- var rowid = _utils.default.getRowid($xetable, row);
407
-
404
+ var rowid = (0, _util.getRowid)($xetable, row);
408
405
  var rest = fullAllDataRowIdData[rowid];
409
406
  var rowLevel = rest ? rest.level : 0;
410
407
  var seq = rest ? rest.seq : -1;
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_utils=_interopRequireWildcard(require("../../tools/utils")),_util=require("./util"),_dom=_interopRequireDefault(require("../../tools/dom"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var l=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:l})(e)}function _interopRequireWildcard(e,l){if(!l&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};l=_getRequireWildcardCache(l);if(l&&l.has(e))return l.get(e);var t,r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&((r=n?Object.getOwnPropertyDescriptor(e,t):null)&&(r.get||r.set)?Object.defineProperty(o,t,r):o[t]=e[t]);return o.default=e,l&&l.set(e,o),o}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,r=new Array(l);t<l;t++)r[t]=e[t];return r}var scrollProcessTimeout,renderType="body";function isOperateMouse(e){return e._isResize||e.lastScrollTime&&Date.now()<e.lastScrollTime+e.delayHover}function renderLine(e,l,t,r){var o=r.row,n=r.column,i=t.treeOpts,a=t.treeConfig,s=t.fullAllDataRowIdData,c=n.slots,d=n.treeNode,u=s[_utils.default.getRowid(t,o)],n=0,s=0,o=[];return u&&(n=u.level,s=u._index,o=u.items),c&&c.line?t.callSlot(c.line,r,e):a&&d&&i.line?[e("div",{class:"vxe-tree--line-wrapper"},[e("div",{class:"vxe-tree--line",style:{height:"".concat((0,_util.calcTreeLine)(r,o,s),"px"),left:"".concat(n*i.indent+(n?2-(0,_util.getOffsetSize)(t):0)+16,"px")}})])]:[]}function renderColumn(e,l,t,r,o,n,i,a,s,c,d,u,p,f,y){var h,g=t.$listeners,v=t.afterFullData,m=t.tableData,w=t.height,b=t.columnKey,x=t.overflowX,_=t.sYOpts,T=t.scrollXLoad,S=t.scrollYLoad,O=t.highlightCurrentRow,C=t.showOverflow,L=t.isAllOverflow,$=t.align,R=t.currentColumn,k=t.cellClassName,I=t.cellStyle,H=t.mergeList,E=t.spanMethod,A=t.radioOpts,Y=t.checkboxOpts,P=t.expandOpts,W=t.treeOpts,D=t.tooltipOpts,M=t.mouseConfig,q=t.editConfig,B=t.editOpts,j=t.editRules,U=t.validOpts,X=t.editStore,N=t.validStore,z=t.tooltipConfig,F=t.rowOpts,K=t.columnOpts,V=u.type,G=u.cellRender,J=u.editRender,Q=u.align,Z=u.showOverflow,ee=u.className,le=u.treeNode,te=X.actived,re=_.rHeight,oe=F.height,ne=D.showAll||D.enabled,ie=t.getColumnIndex(u),ae=t.getVTColumnIndex(u),X=(0,_utils.isEnableConf)(J),_=n?u.fixed!==n:u.fixed&&x,D=_xeUtils.default.isUndefined(Z)||_xeUtils.default.isNull(Z)?C:Z,x="ellipsis"===D,se="title"===D,ce=!0===D||"tooltip"===D,Z=se||ce||x,D={},Q=Q||$,$=N.row===a&&N.column===u,j=j&&U.showMessage&&("default"===U.message?w||1<m.length:"inline"===U.message),w={colid:u.id},de=g["cell-mouseenter"],ue=g["cell-mouseleave"],U=J&&q&&"dblclick"===B.trigger,pe={$table:t,seq:r,rowid:o,row:a,rowIndex:s,$rowIndex:c,_rowIndex:d,column:u,columnIndex:ie,$columnIndex:p,_columnIndex:ae,fixed:n,type:renderType,isHidden:_,level:i,visibleData:v,data:m,items:y};if(!T&&!S||Z||(x=Z=!0),(se||ce||ne||de||z)&&(D.mouseenter=function(e){isOperateMouse(t)||(se?_dom.default.updateCellTitle(e.currentTarget,u):(ce||ne)&&t.triggerBodyTooltipEvent(e,pe),de&&t.emitEvent("cell-mouseenter",Object.assign({cell:e.currentTarget},pe),e))}),(ce||ne||ue||z)&&(D.mouseleave=function(e){isOperateMouse(t)||((ce||ne)&&t.handleTargetLeaveEvent(e),ue&&t.emitEvent("cell-mouseleave",Object.assign({cell:e.currentTarget},pe),e))}),(Y.range||M)&&(D.mousedown=function(e){t.triggerCellMousedownEvent(e,pe)}),(F.isCurrent||O||g["cell-click"]||J&&q||"row"===P.trigger||"cell"===P.trigger||"row"===A.trigger||"radio"===u.type&&"cell"===A.trigger||"row"===Y.trigger||"checkbox"===u.type&&"cell"===Y.trigger||"row"===W.trigger||u.treeNode&&"cell"===W.trigger)&&(D.click=function(e){t.triggerCellClickEvent(e,pe)}),(U||g["cell-dblclick"])&&(D.dblclick=function(e){t.triggerCellDblclickEvent(e,pe)}),H.length){d=(0,_util.mergeBodyMethod)(H,d,ae);if(d){var ae=d.rowspan,fe=d.colspan;if(!ae||!fe)return null;1<ae&&(w.rowspan=ae),1<fe&&(w.colspan=fe)}}else if(E){fe=E(pe)||{},E=fe.rowspan,E=void 0===E?1:E,fe=fe.colspan,fe=void 0===fe?1:fe;if(!E||!fe)return null;1<E&&(w.rowspan=E),1<fe&&(w.colspan=fe)}!(_=_&&H&&(1<w.colspan||1<w.rowspan)?!1:_)&&q&&(J||G)&&(B.showStatus||B.showUpdateStatus)&&(h=t.isUpdateByRow(a,u.property));G=[];return _&&C&&L?G.push(e("div",{class:["vxe-cell",{"c--title":se,"c--tooltip":ce,"c--ellipsis":x}],style:{maxHeight:Z&&(re||oe)?"".concat(re||oe,"px"):""}})):(G.push.apply(G,_toConsumableArray(renderLine(e,l,t,pe)).concat([e("div",{class:["vxe-cell",{"c--title":se,"c--tooltip":ce,"c--ellipsis":x}],style:{maxHeight:Z&&(re||oe)?"".concat(re||oe,"px"):""},attrs:{title:se?t.getCellLabel(a,u):null}},u.renderCell(e,pe))])),j&&$&&G.push(e("div",{class:"vxe-cell--valid",style:N.rule&&N.rule.maxWidth?{width:"".concat(N.rule.maxWidth,"px")}:null},[e("span",{class:"vxe-cell--valid-msg"},N.content)]))),e("td",{class:["vxe-body--column",u.id,(_defineProperty(e={},"col--".concat(Q),Q),_defineProperty(e,"col--".concat(V),V),_defineProperty(e,"col--last",p===f.length-1),_defineProperty(e,"col--tree-node",le),_defineProperty(e,"col--edit",X),_defineProperty(e,"col--ellipsis",Z),_defineProperty(e,"fixed--hidden",_),_defineProperty(e,"col--dirty",h),_defineProperty(e,"col--actived",q&&X&&te.row===a&&(te.column===u||"row"===B.mode)),_defineProperty(e,"col--valid-error",$),_defineProperty(e,"col--current",R===u),e),_utils.default.getClass(ee,pe),_utils.default.getClass(k,pe)],key:b||K.useKey?u.id:p,attrs:w,style:Object.assign({height:Z&&(re||oe)?"".concat(re||oe,"px"):""},I?_xeUtils.default.isFunction(I)?I(pe):I:null),on:D},G)}function renderRows(p,f,y,h,g,v){var m=y.stripe,w=y.rowKey,b=y.highlightHoverRow,x=y.rowClassName,_=y.rowStyle,T=y.editConfig,S=y.showOverflow,O=y.treeConfig,C=y.treeOpts,L=y.editOpts,$=y.treeExpandeds,R=y.scrollYLoad,k=y.editStore,I=y.rowExpandeds,H=y.radioOpts,E=y.checkboxOpts,A=y.expandColumn,Y=y.hasFixedColumn,P=y.fullAllDataRowIdData,W=y.rowOpts,D=[];return g.forEach(function(t,r){var e={},o=y.getVTRowIndex(t),n=y.getRowIndex(t);(W.isHover||b)&&(e.mouseenter=function(e){isOperateMouse(y)||y.triggerHoverEvent(e,{row:t,rowIndex:n})},e.mouseleave=function(){isOperateMouse(y)||y.clearHoverRow()});var l,i,a=_utils.default.getRowid(y,t),s=P[a],c=s?s.level:0,d=s?s.seq:-1,u={$table:y,seq:d,rowid:a,fixed:h,type:renderType,level:c,row:t,rowIndex:n,$rowIndex:r},s=!1;T&&(s=-1<k.insertList.indexOf(t)),D.push(p("tr",{class:["vxe-body--row",{"row--stripe":m&&(y.getVTRowIndex(t)+1)%2==0,"is--new":s,"row--new":s&&(L.showStatus||L.showInsertStatus),"row--radio":H.highlight&&y.selectRow===t,"row--checked":E.highlight&&y.isCheckedByCheckboxRow(t)},x?_xeUtils.default.isFunction(x)?x(u):x:""],attrs:{rowid:a},style:_?_xeUtils.default.isFunction(_)?_(u):_:null,key:w||W.useKey||O?a:r,on:e},v.map(function(e,l){return renderColumn(p,f,y,d,a,h,c,t,n,r,o,e,l,v,g)}))),A&&I.length&&-1<I.indexOf(t)&&(O&&(l={paddingLeft:"".concat(c*C.indent+30,"px")}),i=A.showOverflow,u=_xeUtils.default.isUndefined(i)||_xeUtils.default.isNull(i)?S:i,i={$table:y,seq:d,column:A,fixed:h,type:renderType,level:c,row:t,rowIndex:n,$rowIndex:r},D.push(p("tr",{class:"vxe-body--expanded-row",key:"expand_".concat(a),style:_?_xeUtils.default.isFunction(_)?_(i):_:null,on:e},[p("td",{class:["vxe-body--expanded-column",{"fixed--hidden":h&&!Y,"col--ellipsis":u}],attrs:{colspan:v.length}},[p("div",{class:"vxe-body--expanded-cell",style:l},[A.renderData(p,i)])])]))),!O||R||C.transform||!$.length||(i=t[C.children])&&i.length&&-1<$.indexOf(t)&&D.push.apply(D,_toConsumableArray(renderRows(p,f,y,h,i,v)))}),D}function syncBodyScroll(e,l,t,r,o){(r||o)&&(r&&((0,_util.removeScrollListener)(r),r.scrollTop=t),o&&((0,_util.removeScrollListener)(o),o.scrollTop=t),clearTimeout(scrollProcessTimeout),scrollProcessTimeout=setTimeout(function(){(0,_util.restoreScrollListener)(r),(0,_util.restoreScrollListener)(o)},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,r=this.fixedType,e=e.elemStore,r="".concat(r||"main","-body-");e["".concat(r,"wrapper")]=l,e["".concat(r,"table")]=t.table,e["".concat(r,"colgroup")]=t.colgroup,e["".concat(r,"list")]=t.tbody,e["".concat(r,"xSpace")]=t.xSpace,e["".concat(r,"ySpace")]=t.ySpace,e["".concat(r,"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},destroyed:function(){var e=this.$parent,l=this.fixedType,e=e.elemStore,l="".concat(l||"main","-body-");e["".concat(l,"wrapper")]=null,e["".concat(l,"table")]=null,e["".concat(l,"colgroup")]=null,e["".concat(l,"list")]=null,e["".concat(l,"xSpace")]=null,e["".concat(l,"ySpace")]=null,e["".concat(l,"emptyBlock")]=null},render:function(t){var e=this._e,l=this.$parent,r=this.fixedColumn,o=this.fixedType,n=l.$scopedSlots,i=l.tId,a=l.tableData,s=l.tableColumn,c=l.visibleColumn,d=l.showOverflow,u=l.keyboardConfig,p=l.keyboardOpts,f=l.mergeList,y=l.spanMethod,h=l.scrollXLoad,g=l.scrollYLoad,v=l.isAllOverflow,m=l.emptyOpts,w=l.mouseConfig,b=l.mouseOpts,x=l.sYOpts;return o&&(s=!(h||g||d&&v)||f.length||y||u&&p.isMerge?c:r),m=n.empty?n.empty.call(this,{$table:l},t):(n=(n=m.name?_vXETable.default.renderer.get(m.name):null)?n.renderEmpty:null)?n.call(this,t,m,{$table:l}):l.emptyText||_conf.default.i18n("vxe.table.emptyText"),t("div",{class:["vxe-table--body-wrapper",o?"fixed-".concat(o,"--wrapper"):"body--wrapper"],attrs:{xid:i},on:g&&"wheel"===x.mode?{wheel:this.wheelEvent}:{}},[o?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:i,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,o,a,s))]),t("div",{class:"vxe-table--checkbox-range"}),w&&b.area?t("div",{class:"vxe-table--cell-area"},[t("span",{class:"vxe-table--cell-main-area"},b.extension?[t("span",{class:"vxe-table--cell-main-area-btn",on:{mousedown:function(e){l.triggerCellExtendMousedownEvent(e,{$table:l,fixed:o,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,o?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,r=this.fixedType,o=t.$refs,n=t.elemStore,i=t.highlightHoverRow,a=t.scrollXLoad,s=t.scrollYLoad,c=t.lastScrollTop,d=t.lastScrollLeft,u=t.rowOpts,p=o.tableHeader,f=o.tableBody,y=o.leftBody,h=o.rightBody,g=o.tableFooter,v=o.validTip,m=p?p.$el:null,o=g?g.$el:null,p=f.$el,g=y?y.$el:null,f=h?h.$el:null,y=n["main-body-ySpace"],h=n["main-body-xSpace"],n=(s&&y?y:p).clientHeight,y=(a&&h?h:p).clientWidth,h=l.scrollTop,l=p.scrollLeft,d=l!==d,c=h!==c;t.lastScrollTop=h,t.lastScrollLeft=l,t.lastScrollTime=Date.now(),(u.isHover||i)&&t.clearHoverRow(),g&&"left"===r?syncBodyScroll(t,r,h=g.scrollTop,p,f):f&&"right"===r?syncBodyScroll(t,r,h=f.scrollTop,p,g):(d&&(m&&(m.scrollLeft=p.scrollLeft),o&&(o.scrollLeft=p.scrollLeft)),(g||f)&&(t.checkScrolling(),c&&syncBodyScroll(t,r,h,g,f))),a&&d&&t.triggerScrollXEvent(e),s&&c&&t.triggerScrollYEvent(e),d&&v&&v.visible&&v.updatePlacement(),t.emitEvent("scroll",{type:renderType,fixed:r,scrollTop:h,scrollLeft:l,scrollHeight:p.scrollHeight,scrollWidth:p.scrollWidth,bodyHeight:n,bodyWidth:y,isX:d,isY:c},e)},handleWheel:function(a,s,e,c,d){var u=this,p=this.$parent,l=p.$refs,t=p.elemStore,r=p.scrollYLoad,o=p.scrollXLoad,n=l.tableBody,i=l.leftBody,l=l.rightBody,f=n.$el,y=i?i.$el:null,h=l?l.$el:null,i=this.isPrevWheelTop===s?Math.max(0,this.wheelYSize-this.wheelYTotal):0,l=t["main-body-ySpace"],t=t["main-body-xSpace"],g=(r&&l?l:f).clientHeight,v=(o&&t?t:f).clientWidth;this.isPrevWheelTop=s,this.wheelYSize=Math.abs(s?e-i:e+i),this.wheelYInterval=0,this.wheelYTotal=0,clearTimeout(this.wheelTime),function e(){var l,t,r=u.fixedType,o=u.wheelYTotal,n=u.wheelYSize,i=u.wheelYInterval;o<n&&(n<(o+=i=Math.max(5,Math.floor(1.5*i)))&&(i-=o-n),t=f.scrollTop,l=f.clientHeight,n=f.scrollHeight,f.scrollTop=t=t+i*(s?-1:1),y&&(y.scrollTop=t),h&&(h.scrollTop=t),(s?t<n-l:0<=t)&&(u.wheelTime=setTimeout(e,10)),u.wheelYTotal=o,u.wheelYInterval=i,p.emitEvent("scroll",{type:renderType,fixed:r,scrollTop:f.scrollTop,scrollLeft:f.scrollLeft,scrollHeight:f.scrollHeight,scrollWidth:f.scrollWidth,bodyHeight:g,bodyWidth:v,isX:c,isY:d},a))}()},wheelEvent:function(e){var l=e.deltaY,t=e.deltaX,r=this.$el,o=this.$parent,n=o.$refs,i=o.highlightHoverRow,a=o.scrollYLoad,s=o.lastScrollTop,c=o.lastScrollLeft,d=o.rowOpts,u=n.tableBody.$el,n=l,l=n<0;(l?r.scrollTop<=0:r.scrollTop>=r.scrollHeight-r.clientHeight)||(r=r.scrollTop+n,c=(t=u.scrollLeft+t)!==c,(s=r!==s)&&(e.preventDefault(),o.lastScrollTop=r,o.lastScrollLeft=t,o.lastScrollTime=Date.now(),(d.isHover||i)&&o.clearHoverRow(),this.handleWheel(e,l,n,c,s),a&&o.triggerScrollYEvent(e)))}}};exports.default=_default;
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_utils=_interopRequireWildcard(require("../../tools/utils")),_util=require("./util"),_dom=_interopRequireDefault(require("../../tools/dom"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var l=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:l})(e)}function _interopRequireWildcard(e,l){if(!l&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};l=_getRequireWildcardCache(l);if(l&&l.has(e))return l.get(e);var t,r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&((r=n?Object.getOwnPropertyDescriptor(e,t):null)&&(r.get||r.set)?Object.defineProperty(o,t,r):o[t]=e[t]);return o.default=e,l&&l.set(e,o),o}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,r=new Array(l);t<l;t++)r[t]=e[t];return r}var scrollProcessTimeout,renderType="body";function isOperateMouse(e){return e._isResize||e.lastScrollTime&&Date.now()<e.lastScrollTime+e.delayHover}function renderLine(e,l,t,r){var o=r.row,n=r.column,i=t.treeOpts,a=t.treeConfig,s=t.fullAllDataRowIdData,c=n.slots,d=n.treeNode,u=s[(0,_util.getRowid)(t,o)],n=0,s=0,o=[];return u&&(n=u.level,s=u._index,o=u.items),c&&c.line?t.callSlot(c.line,r,e):a&&d&&i.line?[e("div",{class:"vxe-tree--line-wrapper"},[e("div",{class:"vxe-tree--line",style:{height:"".concat((0,_util.calcTreeLine)(r,o,s),"px"),left:"".concat(n*i.indent+(n?2-(0,_util.getOffsetSize)(t):0)+16,"px")}})])]:[]}function renderColumn(e,l,t,r,o,n,i,a,s,c,d,u,p,f,y){var h,g=t.$listeners,v=t.afterFullData,m=t.tableData,w=t.height,b=t.columnKey,x=t.overflowX,_=t.sYOpts,T=t.scrollXLoad,S=t.scrollYLoad,O=t.highlightCurrentRow,C=t.showOverflow,L=t.isAllOverflow,$=t.align,R=t.currentColumn,k=t.cellClassName,I=t.cellStyle,H=t.mergeList,E=t.spanMethod,A=t.radioOpts,Y=t.checkboxOpts,P=t.expandOpts,W=t.treeOpts,D=t.tooltipOpts,M=t.mouseConfig,q=t.editConfig,B=t.editOpts,j=t.editRules,U=t.validOpts,X=t.editStore,N=t.validStore,z=t.tooltipConfig,F=t.rowOpts,K=t.columnOpts,V=u.type,G=u.cellRender,J=u.editRender,Q=u.align,Z=u.showOverflow,ee=u.className,le=u.treeNode,te=X.actived,re=_.rHeight,oe=F.height,ne=D.showAll||D.enabled,ie=t.getColumnIndex(u),ae=t.getVTColumnIndex(u),X=(0,_utils.isEnableConf)(J),_=n?u.fixed!==n:u.fixed&&x,D=_xeUtils.default.isUndefined(Z)||_xeUtils.default.isNull(Z)?C:Z,x="ellipsis"===D,se="title"===D,ce=!0===D||"tooltip"===D,Z=se||ce||x,D={},Q=Q||$,$=N.row===a&&N.column===u,j=j&&U.showMessage&&("default"===U.message?w||1<m.length:"inline"===U.message),w={colid:u.id},de=g["cell-mouseenter"],ue=g["cell-mouseleave"],U=J&&q&&"dblclick"===B.trigger,pe={$table:t,seq:r,rowid:o,row:a,rowIndex:s,$rowIndex:c,_rowIndex:d,column:u,columnIndex:ie,$columnIndex:p,_columnIndex:ae,fixed:n,type:renderType,isHidden:_,level:i,visibleData:v,data:m,items:y};if(!T&&!S||Z||(x=Z=!0),(se||ce||ne||de||z)&&(D.mouseenter=function(e){isOperateMouse(t)||(se?_dom.default.updateCellTitle(e.currentTarget,u):(ce||ne)&&t.triggerBodyTooltipEvent(e,pe),de&&t.emitEvent("cell-mouseenter",Object.assign({cell:e.currentTarget},pe),e))}),(ce||ne||ue||z)&&(D.mouseleave=function(e){isOperateMouse(t)||((ce||ne)&&t.handleTargetLeaveEvent(e),ue&&t.emitEvent("cell-mouseleave",Object.assign({cell:e.currentTarget},pe),e))}),(Y.range||M)&&(D.mousedown=function(e){t.triggerCellMousedownEvent(e,pe)}),(F.isCurrent||O||g["cell-click"]||J&&q||"row"===P.trigger||"cell"===P.trigger||"row"===A.trigger||"radio"===u.type&&"cell"===A.trigger||"row"===Y.trigger||"checkbox"===u.type&&"cell"===Y.trigger||"row"===W.trigger||u.treeNode&&"cell"===W.trigger)&&(D.click=function(e){t.triggerCellClickEvent(e,pe)}),(U||g["cell-dblclick"])&&(D.dblclick=function(e){t.triggerCellDblclickEvent(e,pe)}),H.length){d=(0,_util.mergeBodyMethod)(H,d,ae);if(d){var ae=d.rowspan,fe=d.colspan;if(!ae||!fe)return null;1<ae&&(w.rowspan=ae),1<fe&&(w.colspan=fe)}}else if(E){fe=E(pe)||{},E=fe.rowspan,E=void 0===E?1:E,fe=fe.colspan,fe=void 0===fe?1:fe;if(!E||!fe)return null;1<E&&(w.rowspan=E),1<fe&&(w.colspan=fe)}!(_=_&&H&&(1<w.colspan||1<w.rowspan)?!1:_)&&q&&(J||G)&&(B.showStatus||B.showUpdateStatus)&&(h=t.isUpdateByRow(a,u.property));G=[];return _&&C&&L?G.push(e("div",{class:["vxe-cell",{"c--title":se,"c--tooltip":ce,"c--ellipsis":x}],style:{maxHeight:Z&&(re||oe)?"".concat(re||oe,"px"):""}})):(G.push.apply(G,_toConsumableArray(renderLine(e,l,t,pe)).concat([e("div",{class:["vxe-cell",{"c--title":se,"c--tooltip":ce,"c--ellipsis":x}],style:{maxHeight:Z&&(re||oe)?"".concat(re||oe,"px"):""},attrs:{title:se?t.getCellLabel(a,u):null}},u.renderCell(e,pe))])),j&&$&&G.push(e("div",{class:"vxe-cell--valid",style:N.rule&&N.rule.maxWidth?{width:"".concat(N.rule.maxWidth,"px")}:null},[e("span",{class:"vxe-cell--valid-msg"},N.content)]))),e("td",{class:["vxe-body--column",u.id,(_defineProperty(e={},"col--".concat(Q),Q),_defineProperty(e,"col--".concat(V),V),_defineProperty(e,"col--last",p===f.length-1),_defineProperty(e,"col--tree-node",le),_defineProperty(e,"col--edit",X),_defineProperty(e,"col--ellipsis",Z),_defineProperty(e,"fixed--hidden",_),_defineProperty(e,"col--dirty",h),_defineProperty(e,"col--actived",q&&X&&te.row===a&&(te.column===u||"row"===B.mode)),_defineProperty(e,"col--valid-error",$),_defineProperty(e,"col--current",R===u),e),_utils.default.getClass(ee,pe),_utils.default.getClass(k,pe)],key:b||K.useKey?u.id:p,attrs:w,style:Object.assign({height:Z&&(re||oe)?"".concat(re||oe,"px"):""},I?_xeUtils.default.isFunction(I)?I(pe):I:null),on:D},G)}function renderRows(p,f,y,h,g,v){var m=y.stripe,w=y.rowKey,b=y.highlightHoverRow,x=y.rowClassName,_=y.rowStyle,T=y.editConfig,S=y.showOverflow,O=y.treeConfig,C=y.treeOpts,L=y.editOpts,$=y.treeExpandeds,R=y.scrollYLoad,k=y.editStore,I=y.rowExpandeds,H=y.radioOpts,E=y.checkboxOpts,A=y.expandColumn,Y=y.hasFixedColumn,P=y.fullAllDataRowIdData,W=y.rowOpts,D=[];return g.forEach(function(t,r){var e={},o=y.getVTRowIndex(t),n=y.getRowIndex(t);(W.isHover||b)&&(e.mouseenter=function(e){isOperateMouse(y)||y.triggerHoverEvent(e,{row:t,rowIndex:n})},e.mouseleave=function(){isOperateMouse(y)||y.clearHoverRow()});var l,i,a=(0,_util.getRowid)(y,t),s=P[a],c=s?s.level:0,d=s?s.seq:-1,u={$table:y,seq:d,rowid:a,fixed:h,type:renderType,level:c,row:t,rowIndex:n,$rowIndex:r},s=!1;T&&(s=-1<k.insertList.indexOf(t)),D.push(p("tr",{class:["vxe-body--row",{"row--stripe":m&&(y.getVTRowIndex(t)+1)%2==0,"is--new":s,"row--new":s&&(L.showStatus||L.showInsertStatus),"row--radio":H.highlight&&y.selectRow===t,"row--checked":E.highlight&&y.isCheckedByCheckboxRow(t)},x?_xeUtils.default.isFunction(x)?x(u):x:""],attrs:{rowid:a},style:_?_xeUtils.default.isFunction(_)?_(u):_:null,key:w||W.useKey||O?a:r,on:e},v.map(function(e,l){return renderColumn(p,f,y,d,a,h,c,t,n,r,o,e,l,v,g)}))),A&&I.length&&-1<I.indexOf(t)&&(O&&(l={paddingLeft:"".concat(c*C.indent+30,"px")}),i=A.showOverflow,u=_xeUtils.default.isUndefined(i)||_xeUtils.default.isNull(i)?S:i,i={$table:y,seq:d,column:A,fixed:h,type:renderType,level:c,row:t,rowIndex:n,$rowIndex:r},D.push(p("tr",{class:"vxe-body--expanded-row",key:"expand_".concat(a),style:_?_xeUtils.default.isFunction(_)?_(i):_:null,on:e},[p("td",{class:["vxe-body--expanded-column",{"fixed--hidden":h&&!Y,"col--ellipsis":u}],attrs:{colspan:v.length}},[p("div",{class:"vxe-body--expanded-cell",style:l},[A.renderData(p,i)])])]))),!O||R||C.transform||!$.length||(i=t[C.children])&&i.length&&-1<$.indexOf(t)&&D.push.apply(D,_toConsumableArray(renderRows(p,f,y,h,i,v)))}),D}function syncBodyScroll(e,l,t,r,o){(r||o)&&(r&&((0,_util.removeScrollListener)(r),r.scrollTop=t),o&&((0,_util.removeScrollListener)(o),o.scrollTop=t),clearTimeout(scrollProcessTimeout),scrollProcessTimeout=setTimeout(function(){(0,_util.restoreScrollListener)(r),(0,_util.restoreScrollListener)(o)},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,r=this.fixedType,e=e.elemStore,r="".concat(r||"main","-body-");e["".concat(r,"wrapper")]=l,e["".concat(r,"table")]=t.table,e["".concat(r,"colgroup")]=t.colgroup,e["".concat(r,"list")]=t.tbody,e["".concat(r,"xSpace")]=t.xSpace,e["".concat(r,"ySpace")]=t.ySpace,e["".concat(r,"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},destroyed:function(){var e=this.$parent,l=this.fixedType,e=e.elemStore,l="".concat(l||"main","-body-");e["".concat(l,"wrapper")]=null,e["".concat(l,"table")]=null,e["".concat(l,"colgroup")]=null,e["".concat(l,"list")]=null,e["".concat(l,"xSpace")]=null,e["".concat(l,"ySpace")]=null,e["".concat(l,"emptyBlock")]=null},render:function(t){var e=this._e,l=this.$parent,r=this.fixedColumn,o=this.fixedType,n=l.$scopedSlots,i=l.tId,a=l.tableData,s=l.tableColumn,c=l.visibleColumn,d=l.showOverflow,u=l.keyboardConfig,p=l.keyboardOpts,f=l.mergeList,y=l.spanMethod,h=l.scrollXLoad,g=l.scrollYLoad,v=l.isAllOverflow,m=l.emptyOpts,w=l.mouseConfig,b=l.mouseOpts,x=l.sYOpts;return o&&(s=!(h||g||d&&v)||f.length||y||u&&p.isMerge?c:r),m=n.empty?n.empty.call(this,{$table:l},t):(n=(n=m.name?_vXETable.default.renderer.get(m.name):null)?n.renderEmpty:null)?n.call(this,t,m,{$table:l}):l.emptyText||_conf.default.i18n("vxe.table.emptyText"),t("div",{class:["vxe-table--body-wrapper",o?"fixed-".concat(o,"--wrapper"):"body--wrapper"],attrs:{xid:i},on:g&&"wheel"===x.mode?{wheel:this.wheelEvent}:{}},[o?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:i,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,o,a,s))]),t("div",{class:"vxe-table--checkbox-range"}),w&&b.area?t("div",{class:"vxe-table--cell-area"},[t("span",{class:"vxe-table--cell-main-area"},b.extension?[t("span",{class:"vxe-table--cell-main-area-btn",on:{mousedown:function(e){l.triggerCellExtendMousedownEvent(e,{$table:l,fixed:o,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,o?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,r=this.fixedType,o=t.$refs,n=t.elemStore,i=t.highlightHoverRow,a=t.scrollXLoad,s=t.scrollYLoad,c=t.lastScrollTop,d=t.lastScrollLeft,u=t.rowOpts,p=o.tableHeader,f=o.tableBody,y=o.leftBody,h=o.rightBody,g=o.tableFooter,v=o.validTip,m=p?p.$el:null,o=g?g.$el:null,p=f.$el,g=y?y.$el:null,f=h?h.$el:null,y=n["main-body-ySpace"],h=n["main-body-xSpace"],n=(s&&y?y:p).clientHeight,y=(a&&h?h:p).clientWidth,h=l.scrollTop,l=p.scrollLeft,d=l!==d,c=h!==c;t.lastScrollTop=h,t.lastScrollLeft=l,t.lastScrollTime=Date.now(),(u.isHover||i)&&t.clearHoverRow(),g&&"left"===r?syncBodyScroll(t,r,h=g.scrollTop,p,f):f&&"right"===r?syncBodyScroll(t,r,h=f.scrollTop,p,g):(d&&(m&&(m.scrollLeft=p.scrollLeft),o&&(o.scrollLeft=p.scrollLeft)),(g||f)&&(t.checkScrolling(),c&&syncBodyScroll(t,r,h,g,f))),a&&d&&t.triggerScrollXEvent(e),s&&c&&t.triggerScrollYEvent(e),d&&v&&v.visible&&v.updatePlacement(),t.emitEvent("scroll",{type:renderType,fixed:r,scrollTop:h,scrollLeft:l,scrollHeight:p.scrollHeight,scrollWidth:p.scrollWidth,bodyHeight:n,bodyWidth:y,isX:d,isY:c},e)},handleWheel:function(a,s,e,c,d){var u=this,p=this.$parent,l=p.$refs,t=p.elemStore,r=p.scrollYLoad,o=p.scrollXLoad,n=l.tableBody,i=l.leftBody,l=l.rightBody,f=n.$el,y=i?i.$el:null,h=l?l.$el:null,i=this.isPrevWheelTop===s?Math.max(0,this.wheelYSize-this.wheelYTotal):0,l=t["main-body-ySpace"],t=t["main-body-xSpace"],g=(r&&l?l:f).clientHeight,v=(o&&t?t:f).clientWidth;this.isPrevWheelTop=s,this.wheelYSize=Math.abs(s?e-i:e+i),this.wheelYInterval=0,this.wheelYTotal=0,clearTimeout(this.wheelTime),function e(){var l,t,r=u.fixedType,o=u.wheelYTotal,n=u.wheelYSize,i=u.wheelYInterval;o<n&&(n<(o+=i=Math.max(5,Math.floor(1.5*i)))&&(i-=o-n),t=f.scrollTop,l=f.clientHeight,n=f.scrollHeight,f.scrollTop=t=t+i*(s?-1:1),y&&(y.scrollTop=t),h&&(h.scrollTop=t),(s?t<n-l:0<=t)&&(u.wheelTime=setTimeout(e,10)),u.wheelYTotal=o,u.wheelYInterval=i,p.emitEvent("scroll",{type:renderType,fixed:r,scrollTop:f.scrollTop,scrollLeft:f.scrollLeft,scrollHeight:f.scrollHeight,scrollWidth:f.scrollWidth,bodyHeight:g,bodyWidth:v,isX:c,isY:d},a))}()},wheelEvent:function(e){var l=e.deltaY,t=e.deltaX,r=this.$el,o=this.$parent,n=o.$refs,i=o.highlightHoverRow,a=o.scrollYLoad,s=o.lastScrollTop,c=o.lastScrollLeft,d=o.rowOpts,u=n.tableBody.$el,n=l,l=n<0;(l?r.scrollTop<=0:r.scrollTop>=r.scrollHeight-r.clientHeight)||(r=r.scrollTop+n,c=(t=u.scrollLeft+t)!==c,(s=r!==s)&&(e.preventDefault(),o.lastScrollTop=r,o.lastScrollLeft=t,o.lastScrollTime=Date.now(),(d.isHover||i)&&o.clearHoverRow(),this.handleWheel(e,l,n,c,s),a&&o.triggerScrollYEvent(e)))}}};exports.default=_default;
@@ -49,9 +49,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
49
49
 
50
50
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
51
51
 
52
- var getRowid = _utils.default.getRowid,
53
- getRowkey = _utils.default.getRowkey,
54
- setCellValue = _utils.default.setCellValue,
52
+ var setCellValue = _utils.default.setCellValue,
55
53
  hasChildrenList = _utils.default.hasChildrenList,
56
54
  getColumnList = _utils.default.getColumnList;
57
55
  var calcHeight = _dom.default.calcHeight,
@@ -492,7 +490,7 @@ var Methods = {
492
490
 
493
491
  var tableData = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0);
494
492
  tableData.forEach(function (row, $index) {
495
- var rowid = getRowid(_this3, row);
493
+ var rowid = (0, _util.getRowid)(_this3, row);
496
494
  var rest = fullDataRowIdData[rowid];
497
495
 
498
496
  if (rest) {
@@ -819,11 +817,11 @@ var Methods = {
819
817
  tableFullTreeData = this.tableFullTreeData;
820
818
  var fullDataRowIdData = this.fullDataRowIdData,
821
819
  fullAllDataRowIdData = this.fullAllDataRowIdData;
822
- var rowkey = getRowkey(this);
820
+ var rowkey = (0, _util.getRowkey)(this);
823
821
  var isLazy = treeConfig && treeOpts.lazy;
824
822
 
825
823
  var handleCache = function handleCache(row, index, items, path, parent, nodes) {
826
- var rowid = getRowid(_this10, row);
824
+ var rowid = (0, _util.getRowid)(_this10, row);
827
825
  var seq = treeConfig && path ? (0, _util.toTreePathSeq)(path) : index + 1;
828
826
  var level = nodes ? nodes.length - 1 : 0;
829
827
 
@@ -885,14 +883,14 @@ var Methods = {
885
883
  var transform = treeOpts.transform,
886
884
  children = treeOpts.children,
887
885
  mapChildren = treeOpts.mapChildren;
888
- var rest = fullAllDataRowIdData[getRowid(this, row)];
886
+ var rest = fullAllDataRowIdData[(0, _util.getRowid)(this, row)];
889
887
  var parentLevel = rest ? rest.level : 0;
890
888
  return this.createData(childRecords).then(function (rows) {
891
889
  if (keepSource) {
892
- var rowid = getRowid(_this11, row);
890
+ var rowid = (0, _util.getRowid)(_this11, row);
893
891
 
894
892
  var matchObj = _xeUtils.default.findTree(tableSourceData, function (item) {
895
- return rowid === getRowid(_this11, item);
893
+ return rowid === (0, _util.getRowid)(_this11, item);
896
894
  }, treeOpts);
897
895
 
898
896
  if (matchObj) {
@@ -901,7 +899,7 @@ var Methods = {
901
899
  }
902
900
 
903
901
  _xeUtils.default.eachTree(rows, function (childRow, index, items, path, parent, nodes) {
904
- var rowid = getRowid(_this11, childRow);
902
+ var rowid = (0, _util.getRowid)(_this11, childRow);
905
903
  var rest = {
906
904
  row: childRow,
907
905
  rowid: rowid,
@@ -1127,7 +1125,7 @@ var Methods = {
1127
1125
  var fullDataRowIdData = this.fullDataRowIdData;
1128
1126
 
1129
1127
  if (row) {
1130
- var rowid = getRowid(this, row);
1128
+ var rowid = (0, _util.getRowid)(this, row);
1131
1129
  var rest = fullDataRowIdData[rowid];
1132
1130
 
1133
1131
  if (rest) {
@@ -1236,7 +1234,7 @@ var Methods = {
1236
1234
  treeConfig = this.treeConfig,
1237
1235
  treeOpts = this.treeOpts,
1238
1236
  expandOpts = this.expandOpts;
1239
- var rowkey = getRowkey(this);
1237
+ var rowkey = (0, _util.getRowkey)(this);
1240
1238
  this.tableFullColumn.forEach(function (column) {
1241
1239
  var property = column.property,
1242
1240
  editRender = column.editRender;
@@ -1450,7 +1448,7 @@ var Methods = {
1450
1448
 
1451
1449
  if (keepSource) {
1452
1450
  var oRow, property;
1453
- var rowid = getRowid(this, row); // 新增的数据不需要检测
1451
+ var rowid = (0, _util.getRowid)(this, row); // 新增的数据不需要检测
1454
1452
 
1455
1453
  if (!fullDataRowIdData[rowid]) {
1456
1454
  return false;
@@ -1460,7 +1458,7 @@ var Methods = {
1460
1458
  var children = treeOpts.children;
1461
1459
 
1462
1460
  var matchObj = _xeUtils.default.findTree(tableSourceData, function (item) {
1463
- return rowid === getRowid(_this16, item);
1461
+ return rowid === (0, _util.getRowid)(_this16, item);
1464
1462
  }, treeOpts);
1465
1463
 
1466
1464
  row = Object.assign({}, row, _defineProperty({}, children, null));
@@ -1854,7 +1852,7 @@ var Methods = {
1854
1852
 
1855
1853
  if (treeConfig) {
1856
1854
  _xeUtils.default.eachTree(afterTreeFullData, function (row, index, items, path) {
1857
- var rowid = getRowid(_this18, row);
1855
+ var rowid = (0, _util.getRowid)(_this18, row);
1858
1856
  var allrest = fullAllDataRowIdData[rowid];
1859
1857
  var seq = path.map(function (num, i) {
1860
1858
  return i % 2 === 0 ? Number(num) + 1 : '.';
@@ -1883,7 +1881,7 @@ var Methods = {
1883
1881
  });
1884
1882
  } else {
1885
1883
  afterFullData.forEach(function (row, index) {
1886
- var rowid = getRowid(_this18, row);
1884
+ var rowid = (0, _util.getRowid)(_this18, row);
1887
1885
  var allrest = fullAllDataRowIdData[rowid];
1888
1886
  var seq = index + 1;
1889
1887
 
@@ -1922,7 +1920,7 @@ var Methods = {
1922
1920
  if (_xeUtils.default.isString(rowOrRowid)) {
1923
1921
  rowid = rowOrRowid;
1924
1922
  } else {
1925
- rowid = getRowid(this, rowOrRowid);
1923
+ rowid = (0, _util.getRowid)(this, rowOrRowid);
1926
1924
  }
1927
1925
 
1928
1926
  if (rowid) {
@@ -4124,7 +4122,7 @@ var Methods = {
4124
4122
  if (reserve) {
4125
4123
  if (value) {
4126
4124
  selectRows.forEach(function (row) {
4127
- checkboxReserveRowMap[getRowid(_this32, row)] = row;
4125
+ checkboxReserveRowMap[(0, _util.getRowid)(_this32, row)] = row;
4128
4126
  });
4129
4127
  } else {
4130
4128
  afterFullData.forEach(function (row) {
@@ -4256,7 +4254,7 @@ var Methods = {
4256
4254
 
4257
4255
 
4258
4256
  if (radioOpts.reserve && radioReserveRow) {
4259
- var rowid = getRowid(this, radioReserveRow);
4257
+ var rowid = (0, _util.getRowid)(this, radioReserveRow);
4260
4258
 
4261
4259
  if (fullDataRowIdData[rowid]) {
4262
4260
  this.setRadioRow(fullDataRowIdData[rowid].row);
@@ -4303,14 +4301,14 @@ var Methods = {
4303
4301
  treeOpts = this.treeOpts;
4304
4302
 
4305
4303
  if (radioOpts.reserve && radioReserveRow) {
4306
- var rowid = getRowid(this, radioReserveRow);
4304
+ var rowid = (0, _util.getRowid)(this, radioReserveRow);
4307
4305
 
4308
4306
  if (isFull) {
4309
4307
  if (!fullDataRowIdData[rowid]) {
4310
4308
  return radioReserveRow;
4311
4309
  }
4312
4310
  } else {
4313
- var rowkey = getRowkey(this);
4311
+ var rowkey = (0, _util.getRowkey)(this);
4314
4312
 
4315
4313
  if (treeConfig) {
4316
4314
  var matchObj = _xeUtils.default.findTree(afterFullData, function (row) {
@@ -4363,11 +4361,11 @@ var Methods = {
4363
4361
 
4364
4362
  if (treeConfig) {
4365
4363
  _xeUtils.default.eachTree(afterFullData, function (row) {
4366
- afterFullIdMaps[getRowid(_this33, row)] = 1;
4364
+ afterFullIdMaps[(0, _util.getRowid)(_this33, row)] = 1;
4367
4365
  }, treeOpts);
4368
4366
  } else {
4369
4367
  afterFullData.forEach(function (row) {
4370
- afterFullIdMaps[getRowid(_this33, row)] = 1;
4368
+ afterFullIdMaps[(0, _util.getRowid)(_this33, row)] = 1;
4371
4369
  });
4372
4370
  }
4373
4371
 
@@ -4397,7 +4395,7 @@ var Methods = {
4397
4395
  checkboxOpts = this.checkboxOpts;
4398
4396
 
4399
4397
  if (checkboxOpts.reserve) {
4400
- var rowid = getRowid(this, row);
4398
+ var rowid = (0, _util.getRowid)(this, row);
4401
4399
 
4402
4400
  if (checked) {
4403
4401
  checkboxReserveRowMap[rowid] = row;
@@ -4482,7 +4480,7 @@ var Methods = {
4482
4480
  }
4483
4481
 
4484
4482
  if (reserve) {
4485
- var rowkey = getRowkey(this);
4483
+ var rowkey = (0, _util.getRowkey)(this);
4486
4484
  this.radioReserveRow = _defineProperty({}, rowkey, rowid);
4487
4485
  }
4488
4486
  }
@@ -4543,7 +4541,7 @@ var Methods = {
4543
4541
 
4544
4542
  if (rowOpts.isCurrent || this.highlightCurrentRow) {
4545
4543
  if ($el) {
4546
- _xeUtils.default.arrayEach($el.querySelectorAll("[rowid=\"".concat(getRowid(this, row), "\"]")), function (elem) {
4544
+ _xeUtils.default.arrayEach($el.querySelectorAll("[rowid=\"".concat((0, _util.getRowid)(this, row), "\"]")), function (elem) {
4547
4545
  return addClass(elem, 'row--current');
4548
4546
  });
4549
4547
  }
@@ -4616,7 +4614,7 @@ var Methods = {
4616
4614
  afterFullData = this.afterFullData;
4617
4615
 
4618
4616
  if (selectRow) {
4619
- var rowid = getRowid(this, selectRow);
4617
+ var rowid = (0, _util.getRowid)(this, selectRow);
4620
4618
 
4621
4619
  if (isFull) {
4622
4620
  if (!fullDataRowIdData[rowid]) {
@@ -4624,7 +4622,7 @@ var Methods = {
4624
4622
  }
4625
4623
  } else {
4626
4624
  if (treeConfig) {
4627
- var rowkey = getRowkey(this);
4625
+ var rowkey = (0, _util.getRowkey)(this);
4628
4626
 
4629
4627
  var matchObj = _xeUtils.default.findTree(afterFullData, function (row) {
4630
4628
  return rowid === _xeUtils.default.get(row, rowkey);
@@ -4653,7 +4651,7 @@ var Methods = {
4653
4651
  },
4654
4652
  setHoverRow: function setHoverRow(row) {
4655
4653
  var $el = this.$el;
4656
- var rowid = getRowid(this, row);
4654
+ var rowid = (0, _util.getRowid)(this, row);
4657
4655
  this.clearHoverRow();
4658
4656
 
4659
4657
  if ($el) {
@@ -5378,7 +5376,7 @@ var Methods = {
5378
5376
  expandOpts = this.expandOpts;
5379
5377
 
5380
5378
  if (expandOpts.reserve) {
5381
- var rowid = getRowid(this, row);
5379
+ var rowid = (0, _util.getRowid)(this, row);
5382
5380
 
5383
5381
  if (expanded) {
5384
5382
  rowExpandedReserveRowMap[rowid] = row;
@@ -5526,7 +5524,7 @@ var Methods = {
5526
5524
  this.setAllTreeExpand(true);
5527
5525
  } else if (expandRowKeys) {
5528
5526
  var defExpandeds = [];
5529
- var rowkey = getRowkey(this);
5527
+ var rowkey = (0, _util.getRowkey)(this);
5530
5528
  expandRowKeys.forEach(function (rowid) {
5531
5529
  var matchObj = _xeUtils.default.findTree(tableFullData, function (item) {
5532
5530
  return rowid === _xeUtils.default.get(item, rowkey);
@@ -5798,7 +5796,7 @@ var Methods = {
5798
5796
  treeOpts = this.treeOpts;
5799
5797
 
5800
5798
  if (treeOpts.reserve) {
5801
- var rowid = getRowid(this, row);
5799
+ var rowid = (0, _util.getRowid)(this, row);
5802
5800
 
5803
5801
  if (expanded) {
5804
5802
  treeExpandedReserveRowMap[rowid] = row;
@@ -6419,7 +6417,7 @@ var Methods = {
6419
6417
  *************************/
6420
6418
  getCell: function getCell(row, column) {
6421
6419
  var $refs = this.$refs;
6422
- var rowid = getRowid(this, row);
6420
+ var rowid = (0, _util.getRowid)(this, row);
6423
6421
  var bodyElem = $refs["".concat(column.fixed || 'table', "Body")] || $refs.tableBody;
6424
6422
 
6425
6423
  if (bodyElem && bodyElem.$el) {