vxe-pc-ui 3.8.0 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/icon/style.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table-select/src/table-select.js +20 -3
- package/es/tree/src/tree.js +63 -25
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +91 -32
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table-select/src/table-select.js +19 -3
- package/lib/table-select/src/table-select.min.js +1 -1
- package/lib/tree/src/tree.js +70 -26
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table-select/src/table-select.ts +19 -3
- package/packages/tree/src/tree.ts +74 -33
- package/types/components/column.d.ts +4 -12
- package/types/components/table.d.ts +24 -10
- package/types/components/tree.d.ts +15 -7
- /package/es/icon/{iconfont.1753775375287.ttf → iconfont.1753864721304.ttf} +0 -0
- /package/es/icon/{iconfont.1753775375287.woff → iconfont.1753864721304.woff} +0 -0
- /package/es/icon/{iconfont.1753775375287.woff2 → iconfont.1753864721304.woff2} +0 -0
- /package/es/{iconfont.1753775375287.ttf → iconfont.1753864721304.ttf} +0 -0
- /package/es/{iconfont.1753775375287.woff → iconfont.1753864721304.woff} +0 -0
- /package/es/{iconfont.1753775375287.woff2 → iconfont.1753864721304.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1753775375287.ttf → iconfont.1753864721304.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1753775375287.woff → iconfont.1753864721304.woff} +0 -0
- /package/lib/icon/style/{iconfont.1753775375287.woff2 → iconfont.1753864721304.woff2} +0 -0
- /package/lib/{iconfont.1753775375287.ttf → iconfont.1753864721304.ttf} +0 -0
- /package/lib/{iconfont.1753775375287.woff → iconfont.1753864721304.woff} +0 -0
- /package/lib/{iconfont.1753775375287.woff2 → iconfont.1753864721304.woff2} +0 -0
|
@@ -293,18 +293,34 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
293
293
|
var reactData = $xeTableSelect.reactData;
|
|
294
294
|
var multiple = props.multiple;
|
|
295
295
|
var tableCols = [];
|
|
296
|
+
var hasRadioCol = false;
|
|
297
|
+
var hasCheckboxCol = false;
|
|
298
|
+
columns.forEach(function (column) {
|
|
299
|
+
if (!hasRadioCol && column.type === 'radio') {
|
|
300
|
+
hasRadioCol = true;
|
|
301
|
+
} else if (!hasCheckboxCol && column.type === 'checkbox') {
|
|
302
|
+
hasCheckboxCol = true;
|
|
303
|
+
}
|
|
304
|
+
tableCols.push(column);
|
|
305
|
+
});
|
|
296
306
|
if (multiple) {
|
|
297
|
-
|
|
307
|
+
if (!hasCheckboxCol) {
|
|
308
|
+
(0, _log.errLog)('vxe.error.reqProp', ['{ type: "checkbox" }']);
|
|
309
|
+
}
|
|
310
|
+
tableCols.unshift({
|
|
298
311
|
type: 'checkbox',
|
|
299
312
|
width: 70
|
|
300
313
|
});
|
|
301
314
|
} else {
|
|
302
|
-
|
|
315
|
+
if (!hasRadioCol) {
|
|
316
|
+
(0, _log.errLog)('vxe.error.reqProp', ['{ type: "radio" }']);
|
|
317
|
+
}
|
|
318
|
+
tableCols.unshift({
|
|
303
319
|
type: 'radio',
|
|
304
320
|
width: 70
|
|
305
321
|
});
|
|
306
322
|
}
|
|
307
|
-
reactData.tableColumns = tableCols
|
|
323
|
+
reactData.tableColumns = tableCols;
|
|
308
324
|
},
|
|
309
325
|
cacheDataMap: function cacheDataMap() {
|
|
310
326
|
var $xeTableSelect = this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.getRowUniqueId=getRowUniqueId;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input/src/input"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}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)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function getRowUniqueId(){return _xeUtils.default.uniqueId("row_")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableSelect",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Array],clearable:Boolean,placeholder:{type:String,default:function(){return _xeUtils.default.eqNull((0,_ui.getConfig)().tableSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().tableSelect.placeholder}},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,className:[String,Function],prefixIcon:String,placement:String,columns:Array,options:Array,optionProps:Object,size:{type:String,default:function(){return(0,_ui.getConfig)().select.size||(0,_ui.getConfig)().size}},popupConfig:Object,gridConfig:Object,transfer:{type:Boolean,default:null}},inject:{$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},provide:function(){return{$xeTableSelect:this}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,tableColumns:[],fullOptionList:[],fullRowMaps:{},panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1},internalData:{},gridEvents:{}}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeBtnTransfer:function(){var e=this,t=e.$xeForm,n=e.$xeTable,i=e.$xeModal,o=e.$xeDrawer,e=e.transfer;if(null===e){var l=(0,_ui.getConfig)().tableSelect.transfer;if(_xeUtils.default.isBoolean(l))return l;if(n||i||o||t)return!0}return e},computePropsOpts:function(){return this.optionProps||{}},computeRowOpts:function(){var e=this.computeGridOpts;return Object.assign({},e.rowConfig,{isCurrent:!0})},computeRowKeyField:function(){return this.computeRowOpts.keyField||"_X_ROW_KEY"},computeLabelField:function(){return this.computePropsOpts.label||"label"},computeValueField:function(){return this.computePropsOpts.value||"value"},computePopupOpts:function(){return Object.assign({},(0,_ui.getConfig)().tableSelect.popupConfig,this.popupConfig)},computeGridOpts:function(){return Object.assign({},(0,_ui.getConfig)().tableSelect.gridConfig,this.gridConfig,{data:void 0,columns:void 0})},computeSelectLabel:function(){var e=this.reactData,t=this.value,n=e.fullRowMaps,i=this.computeLabelField;return(_xeUtils.default.isArray(t)?t:[t]).map(function(e){var t=n[e];return t?t.item[i]:e}).join(", ")},computePopupWrapperStyle:function(){var e=this.computePopupOpts,t=e.height,e=e.width,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t)),n}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$tableSelect:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},getRowid:function(e){e=e[this.computeRowKeyField];return e?encodeURIComponent(e):""},getRowsByValue:function(e){var t=this.reactData.fullRowMaps,n=[];return(_xeUtils.default.eqNull(e)?[]:_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){e=t[e];e&&n.push(e.item)}),n},updateModel:function(n){var i=this,o=i.multiple;i.$nextTick(function(){var e,t=i.$refs.refGrid;t&&(e=i.getRowsByValue(n)).length&&(o?t.setCheckboxRow(e,!0):t.setRadioRow(e[0]))})},loadTableColumn:function(e){var t=this.reactData,n=this.multiple,i=[];i.push(n?{type:"checkbox",width:70}:{type:"radio",width:70}),t.tableColumns=i.concat(e||[])},cacheDataMap:function(){var o=this,e=o,t=o.reactData,n=e.options,l=o.computeRowKeyField,a=o.computeValueField,i=o.computeGridOpts.treeConfig,r={},u={};i||_xeUtils.default.arrayEach(n||[],function(e,t,n){var i=(i=o.getRowid(e))||getRowUniqueId(),i=(u[i]&&(0,_log.errLog)("vxe.error.repeatKey",[l,i]),u[i]=!0,e[a]);r[i]&&(0,_log.errLog)("vxe.error.repeatKey",[a,i]),r[i]={item:e,index:t,items:n,parent:null,nodes:[]}}),t.fullOptionList=n||[],t.fullRowMaps=r,o.updateModel(e.value)},updateZindex:function(){var e=this.reactData;e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){function e(){var e=(0,_dom.updatePanelPlacement)(l,a,{placement:i,teleportTo:r}),t=Object.assign(e.style,{zIndex:o});n.panelStyle=t,n.panelPlacement=e.placement}var t=this,n=t.reactData,i=t.placement,o=n.panelIndex,l=t.$refs.refElem,a=t.$refs.refOptionPanel,r=t.computeBtnTransfer;return e(),t.$nextTick().then(e)},showOptionPanel:function(){var e,t,n=this,i=n,o=n.reactData,l=n.internalData;i.loading||n.computeIsDisabled||(l.vpTimeout&&clearTimeout(l.vpTimeout),l.hpTimeout&&clearTimeout(l.hpTimeout),o.initialized||(o.initialized=!0,e=n.computeBtnTransfer,t=n.$refs.refOptionPanel,e&&t&&document.body.appendChild(t)),o.isActivated=!0,o.isAniVisible=!0,l.vpTimeout=setTimeout(function(){o.visiblePanel=!0,n.updateModel(i.value),l.vpTimeout=void 0},10),n.updateZindex(),n.updatePlacement())},hideOptionPanel:function(){var e=this.reactData,t=this.internalData;e.visiblePanel=!1,t.hpTimeout=setTimeout(function(){e.isAniVisible=!1},350)},changeEvent:function(e,t){var n=this,i=n,o=n.reactData,l=n.$xeForm,a=n.formItemInfo,o=o.fullRowMaps;n.emitModel(t),t!==i.value&&(i=o[t],n.dispatchEvent("change",{value:t,row:i?i.item:null},e),l)&&a&&l.triggerItemEvent(e,a.itemConfig.field,t)},clearValueEvent:function(e,t){this.changeEvent(e,t),this.dispatchEvent("clear",{value:t},e)},clearEvent:function(e,t){this.clearValueEvent(t,null),this.hideOptionPanel()},handleGlobalMousewheelEvent:function(e){var t=this,n=t.reactData.visiblePanel;t.computeIsDisabled||n&&(n=t.$refs.refOptionPanel,(0,_dom.getEventTargetNode)(e,n).flag?t.updatePlacement():t.hideOptionPanel())},handleGlobalMousedownEvent:function(e){var t,n,i=this,o=i.reactData,l=o.visiblePanel;i.computeIsDisabled||(t=i.$refs.refElem,n=i.$refs.refOptionPanel,o.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,n).flag,l&&!o.isActivated&&i.hideOptionPanel())},handleGlobalBlurEvent:function(){var e=this.reactData,t=e.visiblePanel,n=e.isActivated;t&&this.hideOptionPanel(),n&&(e.isActivated=!1),(t||n)&&(e=this.$refs.refInput)&&e.blur()},handleGlobalResizeEvent:function(){this.reactData.visiblePanel&&this.updatePlacement()},focusEvent:function(e){var t=this.reactData;this.computeIsDisabled||t.visiblePanel||(t.triggerFocusPanel=!0,this.showOptionPanel(),setTimeout(function(){t.triggerFocusPanel=!1},150)),this.dispatchEvent("focus",{},e)},clickEvent:function(e){this.togglePanelEvent(e),this.dispatchEvent("click",{},e)},blurEvent:function(e){this.reactData.isActivated=!1,this.dispatchEvent("blur",{},e)},togglePanelEvent:function(e){var t=this.reactData;e.$event.preventDefault(),t.triggerFocusPanel?t.triggerFocusPanel=!1:t.visiblePanel?this.hideOptionPanel():this.showOptionPanel()},radioChangeEvent:function(e){var t=e.$event,e=e.row[this.computeValueField];this.changeEvent(t,e),this.hideOptionPanel()},checkboxChangeEvent:function(e){var t=e.$grid,e=e.$event,n=this.computeValueField;t&&(t=t.getCheckboxRecords().map(function(e){return e[n]}),this.changeEvent(e,t))},checkboxAllEvent:function(e){this.checkboxChangeEvent(e)},renderVN:function(e){var t=_ui.VxeUI.getComponent("vxe-grid"),n=this,i=n,o=n.$scopedSlots,l=n.reactData,a=i.className,r=i.options,u=i.loading,s=l.initialized,c=l.isActivated,p=l.isAniVisible,d=l.visiblePanel,f=l.tableColumns,v=n.computeSize,m=n.computeIsDisabled,h=n.computeSelectLabel,g=n.computeBtnTransfer,b=n.computePopupOpts.className,_=n.computeGridOpts,x=n.computeRowOpts,E=n.computePopupWrapperStyle,y=o.header,P=o.footer,O=o.prefix;return n.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-table-select--readonly",a]},[e("span",{class:"vxe-table-select-label"},h)]):e("div",{ref:"refElem",class:["vxe-table-select",a?_xeUtils.default.isFunction(a)?a({$tableSelect:n}):a:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(v),v),"is--visible",d),"is--disabled",m),"is--loading",u),"is--active",c)]},[e(_input.default,{ref:"refInput",props:{clearable:i.clearable,placeholder:i.placeholder,readonly:!0,disabled:m,type:"text",prefixIcon:i.prefixIcon,suffixIcon:u?(0,_ui.getIcon)().TABLE_SELECT_LOADED:d?(0,_ui.getIcon)().TABLE_SELECT_OPEN:(0,_ui.getIcon)().TABLE_SELECT_CLOSE,value:u?(0,_ui.getI18n)("vxe.select.loadingText"):h},on:{clear:n.clearEvent,click:n.clickEvent,focus:n.focusEvent,blur:n.blurEvent,"suffix-click":n.togglePanelEvent},scopedSlots:O?{prefix:function(){return O({})}}:{}}),e("div",{ref:"refOptionPanel",class:["vxe-table--ignore-clear vxe-table-select--panel",b?_xeUtils.default.isFunction(b)?b({$tableSelect:n}):b:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(v),v),"is--transfer",g),"ani--leave",!u&&p),"ani--enter",!u&&d)],attrs:{placement:l.panelPlacement},style:l.panelStyle},s?[e("div",{class:"vxe-table-select--panel-wrapper"},[y?e("div",{class:"vxe-table-select--panel-header"},y({})):(0,_ui.renderEmptyElement)(n),e("div",{class:"vxe-table-select--panel-body"},[e("div",{ref:"refGridWrapper",class:"vxe-table-select-grid--wrapper",style:E},[t?e(t,{ref:"refGrid",class:"vxe-table-select--grid",props:Object.assign(Object.assign({},_),{rowConfig:x,data:r,columns:f,height:"100%",autoResize:!0}),on:Object.assign(Object.assign({},n.gridEvents),{"radio-change":n.radioChangeEvent,"checkbox-change":n.checkboxChangeEvent,"checkbox-all":n.checkboxAllEvent}),scopedSlots:Object.assign({},o,{header:void 0,footer:void 0,prefixSlot:void 0})}):(0,_ui.renderEmptyElement)(n)])]),P?e("div",{class:"vxe-table-select--panel-footer"},P({})):(0,_ui.renderEmptyElement)(n)])]:[])])}},watch:{options:function(){this.cacheDataMap()},columns:function(e){this.loadTableColumn(e||[])},value:function(e){this.updateModel(e)}},created:function(){var n=this,e=n,i=n.gridEvents;["form-submit","form-reset","form-collapse","page-change"].forEach(function(t){i[(0,_vn.getOnName)(t)]=function(e){n.dispatchEvent(t,e,e.$event)}}),n.loadTableColumn(e.columns||[]),n.cacheDataMap()},mounted:function(){var e=this,t=_ui.VxeUI.getComponent("vxe-grid");e.$nextTick(function(){t||(0,_log.errLog)("vxe.error.reqComp",["vxe-grid"])}),_ui.globalEvents.on(e,"mousewheel",e.handleGlobalMousewheelEvent),_ui.globalEvents.on(e,"mousedown",e.handleGlobalMousedownEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent),_ui.globalEvents.on(e,"resize",e.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this,t=e.$refs.refOptionPanel;t&&t.parentNode&&t.parentNode.removeChild(t),_ui.globalEvents.off(e,"mousewheel"),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"blur"),_ui.globalEvents.off(e,"resize")},render:function(e){return this.renderVN(e)}});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.getRowUniqueId=getRowUniqueId;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_vn=require("../../ui/src/vn"),_utils=require("../../ui/src/utils"),_log=require("../../ui/src/log"),_input=_interopRequireDefault(require("../../input/src/input"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}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)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function getRowUniqueId(){return _xeUtils.default.uniqueId("row_")}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableSelect",mixins:[_ui.globalMixins.sizeMixin],model:{prop:"value",event:"modelValue"},props:{value:[String,Number,Array],clearable:Boolean,placeholder:{type:String,default:function(){return _xeUtils.default.eqNull((0,_ui.getConfig)().tableSelect.placeholder)?(0,_ui.getI18n)("vxe.base.pleaseSelect"):(0,_ui.getConfig)().tableSelect.placeholder}},readonly:{type:Boolean,default:null},loading:Boolean,disabled:{type:Boolean,default:null},multiple:Boolean,className:[String,Function],prefixIcon:String,placement:String,columns:Array,options:Array,optionProps:Object,size:{type:String,default:function(){return(0,_ui.getConfig)().select.size||(0,_ui.getConfig)().size}},popupConfig:Object,gridConfig:Object,transfer:{type:Boolean,default:null}},inject:{$xeModal:{default:null},$xeDrawer:{default:null},$xeTable:{default:null},$xeForm:{default:null},formItemInfo:{from:"xeFormItemInfo",default:null}},provide:function(){return{$xeTableSelect:this}},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{initialized:!1,tableColumns:[],fullOptionList:[],fullRowMaps:{},panelIndex:0,panelStyle:{},panelPlacement:null,triggerFocusPanel:!1,visiblePanel:!1,isAniVisible:!1,isActivated:!1},internalData:{},gridEvents:{}}},computed:Object.assign(Object.assign({},{}),{computeFormReadonly:function(){var e=this.$xeForm,t=this.readonly;return null===t?!!e&&e.readonly:t},computeIsDisabled:function(){var e=this.$xeForm,t=this.disabled;return null===t?!!e&&e.disabled:t},computeBtnTransfer:function(){var e=this,t=e.$xeForm,n=e.$xeTable,i=e.$xeModal,o=e.$xeDrawer,e=e.transfer;if(null===e){var l=(0,_ui.getConfig)().tableSelect.transfer;if(_xeUtils.default.isBoolean(l))return l;if(n||i||o||t)return!0}return e},computePropsOpts:function(){return this.optionProps||{}},computeRowOpts:function(){var e=this.computeGridOpts;return Object.assign({},e.rowConfig,{isCurrent:!0})},computeRowKeyField:function(){return this.computeRowOpts.keyField||"_X_ROW_KEY"},computeLabelField:function(){return this.computePropsOpts.label||"label"},computeValueField:function(){return this.computePropsOpts.value||"value"},computePopupOpts:function(){return Object.assign({},(0,_ui.getConfig)().tableSelect.popupConfig,this.popupConfig)},computeGridOpts:function(){return Object.assign({},(0,_ui.getConfig)().tableSelect.gridConfig,this.gridConfig,{data:void 0,columns:void 0})},computeSelectLabel:function(){var e=this.reactData,t=this.value,n=e.fullRowMaps,i=this.computeLabelField;return(_xeUtils.default.isArray(t)?t:[t]).map(function(e){var t=n[e];return t?t.item[i]:e}).join(", ")},computePopupWrapperStyle:function(){var e=this.computePopupOpts,t=e.height,e=e.width,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t)),n}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$tableSelect:this},t))},emitModel:function(e){var t=this._events;t&&t.modelValue?this.$emit("modelValue",e):this.$emit("model-value",e)},getRowid:function(e){e=e[this.computeRowKeyField];return e?encodeURIComponent(e):""},getRowsByValue:function(e){var t=this.reactData.fullRowMaps,n=[];return(_xeUtils.default.eqNull(e)?[]:_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){e=t[e];e&&n.push(e.item)}),n},updateModel:function(n){var i=this,o=i.multiple;i.$nextTick(function(){var e,t=i.$refs.refGrid;t&&(e=i.getRowsByValue(n)).length&&(o?t.setCheckboxRow(e,!0):t.setRadioRow(e[0]))})},loadTableColumn:function(e){var t=this.reactData,n=this.multiple,i=[],o=!1,l=!1;e.forEach(function(e){o||"radio"!==e.type?l||"checkbox"!==e.type||(l=!0):o=!0,i.push(e)}),n?(l||(0,_log.errLog)("vxe.error.reqProp",['{ type: "checkbox" }']),i.unshift({type:"checkbox",width:70})):(o||(0,_log.errLog)("vxe.error.reqProp",['{ type: "radio" }']),i.unshift({type:"radio",width:70})),t.tableColumns=i},cacheDataMap:function(){var o=this,e=o,t=o.reactData,n=e.options,l=o.computeRowKeyField,a=o.computeValueField,i=o.computeGridOpts.treeConfig,r={},u={};i||_xeUtils.default.arrayEach(n||[],function(e,t,n){var i=(i=o.getRowid(e))||getRowUniqueId(),i=(u[i]&&(0,_log.errLog)("vxe.error.repeatKey",[l,i]),u[i]=!0,e[a]);r[i]&&(0,_log.errLog)("vxe.error.repeatKey",[a,i]),r[i]={item:e,index:t,items:n,parent:null,nodes:[]}}),t.fullOptionList=n||[],t.fullRowMaps=r,o.updateModel(e.value)},updateZindex:function(){var e=this.reactData;e.panelIndex<(0,_utils.getLastZIndex)()&&(e.panelIndex=(0,_utils.nextZIndex)())},updatePlacement:function(){function e(){var e=(0,_dom.updatePanelPlacement)(l,a,{placement:i,teleportTo:r}),t=Object.assign(e.style,{zIndex:o});n.panelStyle=t,n.panelPlacement=e.placement}var t=this,n=t.reactData,i=t.placement,o=n.panelIndex,l=t.$refs.refElem,a=t.$refs.refOptionPanel,r=t.computeBtnTransfer;return e(),t.$nextTick().then(e)},showOptionPanel:function(){var e,t,n=this,i=n,o=n.reactData,l=n.internalData;i.loading||n.computeIsDisabled||(l.vpTimeout&&clearTimeout(l.vpTimeout),l.hpTimeout&&clearTimeout(l.hpTimeout),o.initialized||(o.initialized=!0,e=n.computeBtnTransfer,t=n.$refs.refOptionPanel,e&&t&&document.body.appendChild(t)),o.isActivated=!0,o.isAniVisible=!0,l.vpTimeout=setTimeout(function(){o.visiblePanel=!0,n.updateModel(i.value),l.vpTimeout=void 0},10),n.updateZindex(),n.updatePlacement())},hideOptionPanel:function(){var e=this.reactData,t=this.internalData;e.visiblePanel=!1,t.hpTimeout=setTimeout(function(){e.isAniVisible=!1},350)},changeEvent:function(e,t){var n=this,i=n,o=n.reactData,l=n.$xeForm,a=n.formItemInfo,o=o.fullRowMaps;n.emitModel(t),t!==i.value&&(i=o[t],n.dispatchEvent("change",{value:t,row:i?i.item:null},e),l)&&a&&l.triggerItemEvent(e,a.itemConfig.field,t)},clearValueEvent:function(e,t){this.changeEvent(e,t),this.dispatchEvent("clear",{value:t},e)},clearEvent:function(e,t){this.clearValueEvent(t,null),this.hideOptionPanel()},handleGlobalMousewheelEvent:function(e){var t=this,n=t.reactData.visiblePanel;t.computeIsDisabled||n&&(n=t.$refs.refOptionPanel,(0,_dom.getEventTargetNode)(e,n).flag?t.updatePlacement():t.hideOptionPanel())},handleGlobalMousedownEvent:function(e){var t,n,i=this,o=i.reactData,l=o.visiblePanel;i.computeIsDisabled||(t=i.$refs.refElem,n=i.$refs.refOptionPanel,o.isActivated=(0,_dom.getEventTargetNode)(e,t).flag||(0,_dom.getEventTargetNode)(e,n).flag,l&&!o.isActivated&&i.hideOptionPanel())},handleGlobalBlurEvent:function(){var e=this.reactData,t=e.visiblePanel,n=e.isActivated;t&&this.hideOptionPanel(),n&&(e.isActivated=!1),(t||n)&&(e=this.$refs.refInput)&&e.blur()},handleGlobalResizeEvent:function(){this.reactData.visiblePanel&&this.updatePlacement()},focusEvent:function(e){var t=this.reactData;this.computeIsDisabled||t.visiblePanel||(t.triggerFocusPanel=!0,this.showOptionPanel(),setTimeout(function(){t.triggerFocusPanel=!1},150)),this.dispatchEvent("focus",{},e)},clickEvent:function(e){this.togglePanelEvent(e),this.dispatchEvent("click",{},e)},blurEvent:function(e){this.reactData.isActivated=!1,this.dispatchEvent("blur",{},e)},togglePanelEvent:function(e){var t=this.reactData;e.$event.preventDefault(),t.triggerFocusPanel?t.triggerFocusPanel=!1:t.visiblePanel?this.hideOptionPanel():this.showOptionPanel()},radioChangeEvent:function(e){var t=e.$event,e=e.row[this.computeValueField];this.changeEvent(t,e),this.hideOptionPanel()},checkboxChangeEvent:function(e){var t=e.$grid,e=e.$event,n=this.computeValueField;t&&(t=t.getCheckboxRecords().map(function(e){return e[n]}),this.changeEvent(e,t))},checkboxAllEvent:function(e){this.checkboxChangeEvent(e)},renderVN:function(e){var t=_ui.VxeUI.getComponent("vxe-grid"),n=this,i=n,o=n.$scopedSlots,l=n.reactData,a=i.className,r=i.options,u=i.loading,s=l.initialized,c=l.isActivated,p=l.isAniVisible,d=l.visiblePanel,f=l.tableColumns,v=n.computeSize,m=n.computeIsDisabled,h=n.computeSelectLabel,g=n.computeBtnTransfer,b=n.computePopupOpts.className,_=n.computeGridOpts,x=n.computeRowOpts,y=n.computePopupWrapperStyle,E=o.header,P=o.footer,O=o.prefix;return n.computeFormReadonly?e("div",{ref:"refElem",class:["vxe-table-select--readonly",a]},[e("span",{class:"vxe-table-select-label"},h)]):e("div",{ref:"refElem",class:["vxe-table-select",a?_xeUtils.default.isFunction(a)?a({$tableSelect:n}):a:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(v),v),"is--visible",d),"is--disabled",m),"is--loading",u),"is--active",c)]},[e(_input.default,{ref:"refInput",props:{clearable:i.clearable,placeholder:i.placeholder,readonly:!0,disabled:m,type:"text",prefixIcon:i.prefixIcon,suffixIcon:u?(0,_ui.getIcon)().TABLE_SELECT_LOADED:d?(0,_ui.getIcon)().TABLE_SELECT_OPEN:(0,_ui.getIcon)().TABLE_SELECT_CLOSE,value:u?(0,_ui.getI18n)("vxe.select.loadingText"):h},on:{clear:n.clearEvent,click:n.clickEvent,focus:n.focusEvent,blur:n.blurEvent,"suffix-click":n.togglePanelEvent},scopedSlots:O?{prefix:function(){return O({})}}:{}}),e("div",{ref:"refOptionPanel",class:["vxe-table--ignore-clear vxe-table-select--panel",b?_xeUtils.default.isFunction(b)?b({$tableSelect:n}):b:"",_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(v),v),"is--transfer",g),"ani--leave",!u&&p),"ani--enter",!u&&d)],attrs:{placement:l.panelPlacement},style:l.panelStyle},s?[e("div",{class:"vxe-table-select--panel-wrapper"},[E?e("div",{class:"vxe-table-select--panel-header"},E({})):(0,_ui.renderEmptyElement)(n),e("div",{class:"vxe-table-select--panel-body"},[e("div",{ref:"refGridWrapper",class:"vxe-table-select-grid--wrapper",style:y},[t?e(t,{ref:"refGrid",class:"vxe-table-select--grid",props:Object.assign(Object.assign({},_),{rowConfig:x,data:r,columns:f,height:"100%",autoResize:!0}),on:Object.assign(Object.assign({},n.gridEvents),{"radio-change":n.radioChangeEvent,"checkbox-change":n.checkboxChangeEvent,"checkbox-all":n.checkboxAllEvent}),scopedSlots:Object.assign({},o,{header:void 0,footer:void 0,prefixSlot:void 0})}):(0,_ui.renderEmptyElement)(n)])]),P?e("div",{class:"vxe-table-select--panel-footer"},P({})):(0,_ui.renderEmptyElement)(n)])]:[])])}},watch:{options:function(){this.cacheDataMap()},columns:function(e){this.loadTableColumn(e||[])},value:function(e){this.updateModel(e)}},created:function(){var n=this,e=n,i=n.gridEvents;["form-submit","form-reset","form-collapse","page-change"].forEach(function(t){i[(0,_vn.getOnName)(t)]=function(e){n.dispatchEvent(t,e,e.$event)}}),n.loadTableColumn(e.columns||[]),n.cacheDataMap()},mounted:function(){var e=this,t=_ui.VxeUI.getComponent("vxe-grid");e.$nextTick(function(){t||(0,_log.errLog)("vxe.error.reqComp",["vxe-grid"])}),_ui.globalEvents.on(e,"mousewheel",e.handleGlobalMousewheelEvent),_ui.globalEvents.on(e,"mousedown",e.handleGlobalMousedownEvent),_ui.globalEvents.on(e,"blur",e.handleGlobalBlurEvent),_ui.globalEvents.on(e,"resize",e.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this,t=e.$refs.refOptionPanel;t&&t.parentNode&&t.parentNode.removeChild(t),_ui.globalEvents.off(e,"mousewheel"),_ui.globalEvents.off(e,"mousedown"),_ui.globalEvents.off(e,"blur"),_ui.globalEvents.off(e,"resize")},render:function(e){return this.renderVN(e)}});
|
package/lib/tree/src/tree.js
CHANGED
|
@@ -40,6 +40,34 @@ function handleSetExpand(nodeid, expanded, expandedMaps) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
function handleScrollTo($xeTree, scrollLeft, scrollTop) {
|
|
44
|
+
var reactData = $xeTree.reactData;
|
|
45
|
+
var scrollBodyElem = $xeTree.$refs.refVirtualWrapper;
|
|
46
|
+
if (scrollLeft) {
|
|
47
|
+
if (!_xeUtils.default.isNumber(scrollLeft)) {
|
|
48
|
+
scrollTop = scrollLeft.top;
|
|
49
|
+
scrollLeft = scrollLeft.left;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (scrollBodyElem) {
|
|
53
|
+
if (_xeUtils.default.isNumber(scrollLeft)) {
|
|
54
|
+
scrollBodyElem.scrollLeft = scrollLeft;
|
|
55
|
+
}
|
|
56
|
+
if (_xeUtils.default.isNumber(scrollTop)) {
|
|
57
|
+
scrollBodyElem.scrollTop = scrollTop;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (reactData.scrollYLoad) {
|
|
61
|
+
return new Promise(function (resolve) {
|
|
62
|
+
setTimeout(function () {
|
|
63
|
+
$xeTree.$nextTick(function () {
|
|
64
|
+
resolve();
|
|
65
|
+
});
|
|
66
|
+
}, 50);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return $xeTree.$nextTick();
|
|
70
|
+
}
|
|
43
71
|
var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defineVxeComponent)({
|
|
44
72
|
name: 'VxeTree',
|
|
45
73
|
mixins: [_ui.globalMixins.sizeMixin],
|
|
@@ -892,32 +920,48 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
892
920
|
*/
|
|
893
921
|
scrollTo: function scrollTo(scrollLeft, scrollTop) {
|
|
894
922
|
var $xeTree = this;
|
|
895
|
-
|
|
923
|
+
return handleScrollTo($xeTree, scrollLeft, scrollTop);
|
|
924
|
+
},
|
|
925
|
+
scrollToNode: function scrollToNode(node) {
|
|
926
|
+
var $xeTree = this;
|
|
927
|
+
return $xeTree.scrollToNodeId($xeTree.getNodeId(node));
|
|
928
|
+
},
|
|
929
|
+
scrollToNodeId: function scrollToNodeId(nodeid) {
|
|
930
|
+
var $xeTree = this;
|
|
931
|
+
var props = $xeTree;
|
|
932
|
+
var internalData = $xeTree.internalData;
|
|
933
|
+
var transform = props.transform;
|
|
934
|
+
var scrollYStore = internalData.scrollYStore,
|
|
935
|
+
afterTreeList = internalData.afterTreeList;
|
|
936
|
+
var childrenField = $xeTree.computeChildrenField;
|
|
937
|
+
var mapChildrenField = $xeTree.computeMapChildrenField;
|
|
896
938
|
var scrollBodyElem = $xeTree.$refs.refVirtualWrapper;
|
|
897
|
-
if (
|
|
898
|
-
if (
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
setTimeout(function () {
|
|
914
|
-
$xeTree.$nextTick(function () {
|
|
915
|
-
resolve();
|
|
939
|
+
if (nodeid && scrollBodyElem) {
|
|
940
|
+
if (transform) {
|
|
941
|
+
var matchObj = _xeUtils.default.findTree(afterTreeList, function (item) {
|
|
942
|
+
return $xeTree.getNodeId(item) === nodeid;
|
|
943
|
+
}, {
|
|
944
|
+
children: transform ? mapChildrenField : childrenField
|
|
945
|
+
});
|
|
946
|
+
if (matchObj) {
|
|
947
|
+
return $xeTree.setExpandNode(matchObj.nodes, true).then(function () {
|
|
948
|
+
var itemIndex = _xeUtils.default.findIndexOf(internalData.afterVisibleList, function (item) {
|
|
949
|
+
return $xeTree.getNodeId(item) === nodeid;
|
|
950
|
+
});
|
|
951
|
+
if (itemIndex > -1) {
|
|
952
|
+
var targetTop = Math.max(0, (itemIndex - 1) * scrollYStore.rowHeight);
|
|
953
|
+
return handleScrollTo($xeTree, scrollBodyElem.scrollLeft, targetTop);
|
|
954
|
+
}
|
|
916
955
|
});
|
|
917
|
-
}
|
|
918
|
-
}
|
|
956
|
+
}
|
|
957
|
+
} else {
|
|
958
|
+
var itemEl = scrollBodyElem.querySelector(".vxe-tree--node-wrapper[nodeid=\"".concat(nodeid, "\"]"));
|
|
959
|
+
if (itemEl) {
|
|
960
|
+
return handleScrollTo($xeTree, scrollBodyElem.scrollLeft, itemEl.offsetTop);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
919
963
|
}
|
|
920
|
-
return $xeTree
|
|
964
|
+
return $xeTree.recalculate();
|
|
921
965
|
},
|
|
922
966
|
/**
|
|
923
967
|
* 刷新滚动条
|
|
@@ -1494,7 +1538,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
1494
1538
|
var reactData = $xeTree.reactData;
|
|
1495
1539
|
var internalData = $xeTree.internalData;
|
|
1496
1540
|
var nodeMaps = internalData.nodeMaps;
|
|
1497
|
-
var nodeItem = nodeMaps[nodeKey];
|
|
1541
|
+
var nodeItem = nodeMaps["".concat(nodeKey)];
|
|
1498
1542
|
reactData.currentNode = nodeItem ? nodeItem.item : null;
|
|
1499
1543
|
return $xeTree.$nextTick();
|
|
1500
1544
|
},
|
|
@@ -1626,7 +1670,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
1626
1670
|
nodeids = [nodeids];
|
|
1627
1671
|
}
|
|
1628
1672
|
nodeids.forEach(function (nodeid) {
|
|
1629
|
-
handleSetExpand(nodeid, expanded, treeExpandedMaps);
|
|
1673
|
+
handleSetExpand("".concat(nodeid), expanded, treeExpandedMaps);
|
|
1630
1674
|
});
|
|
1631
1675
|
reactData.updateExpandedFlag++;
|
|
1632
1676
|
}
|
|
@@ -1683,7 +1727,7 @@ var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defi
|
|
|
1683
1727
|
nodeids = [nodeids];
|
|
1684
1728
|
}
|
|
1685
1729
|
nodeids.forEach(function (nodeid) {
|
|
1686
|
-
handleSetExpand(nodeid, !treeExpandedMaps[nodeid], treeExpandedMaps);
|
|
1730
|
+
handleSetExpand("".concat(nodeid), !treeExpandedMaps["".concat(nodeid)], treeExpandedMaps);
|
|
1687
1731
|
});
|
|
1688
1732
|
reactData.updateExpandedFlag++;
|
|
1689
1733
|
}
|
package/lib/tree/src/tree.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_util=require("./util"),_log=require("../../ui/src/log"),_vn=require("../../ui/src/vn"),_dom=require("../../ui/src/dom"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function getNodeUniqueId(){return _xeUtils.default.uniqueId("node_")}function handleSetExpand(e,t,n){t?n[e]||(n[e]=!0):n[e]&&delete n[e]}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTree",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,autoResize:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.autoResize}},height:[String,Number],maxHeight:{type:[String,Number],default:function(){return(0,_ui.getConfig)().tree.maxHeight}},minHeight:{type:[String,Number],default:function(){return(0,_ui.getConfig)().tree.minHeight}},loading:Boolean,loadingConfig:Object,accordion:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.accordion}},childrenField:{type:String,default:function(){return(0,_ui.getConfig)().tree.childrenField}},valueField:{type:String,default:function(){return(0,_ui.getConfig)().tree.valueField}},keyField:{type:String,default:function(){return(0,_ui.getConfig)().tree.keyField}},parentField:{type:String,default:function(){return(0,_ui.getConfig)().tree.parentField}},titleField:{type:String,default:function(){return(0,_ui.getConfig)().tree.titleField}},hasChildField:{type:String,default:function(){return(0,_ui.getConfig)().tree.hasChildField}},mapChildrenField:{type:String,default:function(){return(0,_ui.getConfig)().tree.mapChildrenField}},transform:Boolean,isCurrent:Boolean,isHover:Boolean,expandAll:Boolean,showLine:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.showLine}},trigger:String,indent:{type:Number,default:function(){return(0,_ui.getConfig)().tree.indent}},showRadio:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.showRadio}},checkNodeKey:{type:[String,Number],default:function(){return(0,_ui.getConfig)().tree.checkNodeKey}},radioConfig:Object,showCheckbox:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.showCheckbox}},checkNodeKeys:{type:Array,default:function(){return(0,_ui.getConfig)().tree.checkNodeKeys}},checkboxConfig:Object,nodeConfig:Object,lazy:Boolean,toggleMethod:Function,loadMethod:Function,showIcon:{type:Boolean,default:!0},iconOpen:{type:String,default:function(){return(0,_ui.getConfig)().tree.iconOpen}},iconClose:{type:String,default:function(){return(0,_ui.getConfig)().tree.iconClose}},iconLoaded:{type:String,default:function(){return(0,_ui.getConfig)().tree.iconLoaded}},filterValue:[String,Number],filterConfig:Object,size:{type:String,default:function(){return(0,_ui.getConfig)().tree.size||(0,_ui.getConfig)().size}},virtualYConfig:Object},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{parentHeight:0,customHeight:0,customMinHeight:0,customMaxHeight:0,currentNode:null,scrollYLoad:!1,bodyHeight:0,topSpaceHeight:0,selectRadioKey:null,treeList:[],updateExpandedFlag:1,updateCheckboxFlag:1},internalData:{treeFullData:[],afterTreeList:[],afterVisibleList:[],nodeMaps:{},selectCheckboxMaps:{},indeterminateRowMaps:{},treeExpandedMaps:{},treeExpandLazyLoadedMaps:{},lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0},lastScrollTime:0}}},computed:Object.assign(Object.assign({},{}),{computeTitleField:function(){return this.titleField||"title"},computeKeyField:function(){return this.keyField||"id"},computeValueField:function(){var e=this.computeKeyField;return this.valueField||e},computeParentField:function(){return this.parentField||"parentId"},computeChildrenField:function(){return this.childrenField||"children"},computeMapChildrenField:function(){return this.mapChildrenField||"mapChildren"},computeHasChildField:function(){return this.hasChildField||"hasChild"},computeVirtualYOpts:function(){return Object.assign({},(0,_ui.getConfig)().tree.virtualYConfig,this.virtualYConfig)},computeIsRowCurrent:function(){var e=this.computeNodeOpts.isCurrent;return _xeUtils.default.isBoolean(e)?e:this.isCurrent},computeIsRowHover:function(){var e=this.computeNodeOpts.isHover;return _xeUtils.default.isBoolean(e)?e:this.isHover},computeRadioOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().tree.radioConfig,this.radioConfig)},computeCheckboxOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().tree.checkboxConfig,this.checkboxConfig)},computeNodeOpts:function(){return Object.assign({},(0,_ui.getConfig)().tree.nodeConfig,this.nodeConfig)},computeLoadingOpts:function(){return Object.assign({},(0,_ui.getConfig)().tree.loadingConfig,this.loadingConfig)},computeTreeStyle:function(){var e=this.reactData,t=e.customHeight,n=e.customMinHeight,e=e.customMaxHeight,a={};return t&&(a.height=(0,_dom.toCssUnit)(t)),n&&(a.minHeight=(0,_dom.toCssUnit)(n)),e&&(a.maxHeight=(0,_dom.toCssUnit)(e)),a},computeFilterOpts:function(){return Object.assign({},(0,_ui.getConfig)().tree.filterConfig,this.filterConfig)}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$tree:this},t))},getNodeId:function(e){var t=this.computeValueField,e=_xeUtils.default.get(e,t);return _xeUtils.default.eqNull(e)?"":encodeURIComponent(e)},getNodeById:function(e){var t=this.internalData.nodeMaps;if(e){t=t[e];if(t)return t.item}return null},isExpandByNode:function(e){var t=this.reactData,n=this.internalData,t=t.updateExpandedFlag,n=n.treeExpandedMaps,e=this.getNodeId(e);return!(!t||!n[e])},isCheckedByRadioNodeId:function(e){return this.reactData.selectRadioKey===e},isCheckedByRadioNode:function(e){return this.isCheckedByRadioNodeId(this.getNodeId(e))},isCheckedByCheckboxNodeId:function(e){var t=this.reactData,n=this.internalData,t=t.updateCheckboxFlag,n=n.selectCheckboxMaps;return!(!t||!n[e])},isCheckedByCheckboxNode:function(e){return this.isCheckedByCheckboxNodeId(this.getNodeId(e))},isIndeterminateByCheckboxNodeid:function(e){var t=this.reactData,n=this.internalData,t=t.updateCheckboxFlag,n=n.indeterminateRowMaps;return!(!t||!n[e])},isIndeterminateByCheckboxNode:function(e){return this.isIndeterminateByCheckboxNodeid(this.getNodeId(e))},emitCheckboxMode:function(e){this.$emit("update:checkNodeKeys",e)},emitRadioMode:function(e){this.$emit("update:checkNodeKey",e)},setRadioNode:function(e){var t=this.reactData;return e&&(t.selectRadioKey=this.getNodeId(e)),this.$nextTick()},setCheckboxNode:function(e,t){return e&&(_xeUtils.default.isArray(e)||(e=[e]),this.handleCheckedCheckboxNode(e,t)),this.$nextTick()},setCheckboxByNodeId:function(e,t){var n,a=this.internalData.nodeMaps;return e&&(_xeUtils.default.isArray(e)||(e=[e]),n=[],e.forEach(function(e){e=a[e];e&&n.push(e.item)}),this.handleCheckedCheckboxNode(n,t)),this.$nextTick()},handleCheckedCheckboxNode:function(e,n){function t(e){var t=a.getNodeId(e);n?o[t]||(o[t]=e):o[t]&&delete o[t]}var a=this,r=a.reactData,i=a.transform,o=a.internalData.selectCheckboxMaps,d=a.computeMapChildrenField,l=a.computeChildrenField;a.computeCheckboxOpts.checkStrictly?e.forEach(t):_xeUtils.default.eachTree(e,t,{children:i?d:l}),r.updateCheckboxFlag++,a.updateCheckboxStatus()},updateCheckboxChecked:function(e){this.setCheckboxByNodeId(e,!0)},handleSetExpand:function(e,t,n){t?n[e]||(n[e]=!0):n[e]&&delete n[e]},getParentElem:function(){var e=this.$refs.refElem;return e?e.parentElement:null},calcTableHeight:function(e){var t=this.reactData.parentHeight,e=this[e],n=0;return n=e?"100%"===e||"auto"===e?t:(n=(0,_dom.isScale)(e)?Math.floor((_xeUtils.default.toInteger(e)||1)/100*t):_xeUtils.default.toNumber(e),Math.max(40,n)):n},updateHeight:function(){var e=this.reactData;e.customHeight=this.calcTableHeight("height"),e.customMinHeight=this.calcTableHeight("minHeight"),e.customMaxHeight=this.calcTableHeight("maxHeight"),!e.scrollYLoad||e.customHeight||e.customMinHeight||(e.customHeight=300)},createNode:function(e){var n=this,a=n.computeValueField;return Promise.resolve(e.map(function(e){var t,e=Object.assign({},e);return n.getNodeId(e)||(t=getNodeUniqueId(),_xeUtils.default.set(e,a,t)),e}))},cacheNodeMap:function(){var d=this,e=d.internalData,t=e.treeFullData,l=d.computeValueField,c={};_xeUtils.default.eachTree(t,function(e,t,n,a,r,i){var o=d.getNodeId(e);o||(o=getNodeUniqueId(),_xeUtils.default.set(e,l,o)),c[o]={item:e,index:t,items:n,parent:r,nodes:i,level:i.length,treeIndex:t,lineCount:0,treeLoaded:!1}},{children:d.computeChildrenField}),e.nodeMaps=c},updateAfterDataIndex:function(){var i=this,e=i.internalData,t=i.transform,n=e.afterTreeList,o=e.nodeMaps;_xeUtils.default.eachTree(n,function(e,t,n){var a=i.getNodeId(e),r=o[a];r?(r.items=n,r.treeIndex=t):(r={item:e,index:t,items:n,parent:parent,nodes:[],level:0,treeIndex:t,lineCount:0,treeLoaded:!1},o[a]=r)},{children:t?i.computeMapChildrenField:i.computeChildrenField})},updateAfterFullData:function(){var e,t,n=this,a=n.internalData,r=n.transform,i=n.filterValue,o=a.treeFullData,d=a.lastFilterValue,l=n.computeTitleField,c=n.computeChildrenField,s=n.computeMapChildrenField,u=n.computeFilterOpts,h=u.autoExpandAll,f=u.beforeFilterMethod,p=u.filterMethod,g=u.afterFilterMethod,u=o,x=u,m="";i||0===i?(m="".concat(i),i=p?function(e){return p({$tree:n,node:e,filterValue:m})}:function(e){return-1<String(e[l]).toLowerCase().indexOf(m)},e={$tree:n,filterValue:m},f&&f(e),u=r?x=_xeUtils.default.searchTree(o,i,{children:c,mapChildren:s,isEvery:!0}):o.filter(i),a.lastFilterValue=m,n.$nextTick(function(){h?n.setAllExpandNode(!0).then(function(){g&&g(e)}):g&&g(e)})):(r&&(u=x=_xeUtils.default.searchTree(o,function(){return!0},{children:c,mapChildren:s,isEvery:!0}),d)&&(t={$tree:n,filterValue:m},f&&f(t),n.$nextTick(function(){h?n.clearAllExpandNode().then(function(){g&&g(t)}):g&&g(t)})),a.lastFilterValue=""),a.afterVisibleList=u,a.afterTreeList=x,n.updateAfterDataIndex()},handleTreeToList:function(){var d,l=this,e=l.internalData,t=l.transform,n=e.afterTreeList,c=e.treeExpandedMaps,s={};return t?(d=[],_xeUtils.default.eachTree(n,function(e,t,n,a,r){var i=l.getNodeId(e),o=l.getNodeId(r);(!r||s[o]&&c[o])&&(s[i]=1,d.push(e))},{children:l.computeMapChildrenField}),l.updateScrollYStatus(d),e.afterVisibleList=d):e.afterVisibleList},handleData:function(e){var t=this.reactData,n=this.internalData,a=t.scrollYLoad,r=n.scrollYStore,n=n.afterVisibleList,e=(e&&(this.updateAfterFullData(),n=this.handleTreeToList()),a?n.slice(r.startIndex,r.endIndex):n.slice(0));t.treeList=e},triggerSearchEvent:_xeUtils.default.debounce(function(){this.handleData(!0)},350,{trailing:!0}),loadData:function(e){var t=this,n=t,a=t.internalData,r=n.expandAll,i=a.initialized,o=a.scrollYStore,d=n.transform?_xeUtils.default.toArrayTree(e,{key:t.computeKeyField,parentKey:t.computeParentField,mapChildren:t.computeChildrenField}):e?e.slice(0):[],o=(a.treeFullData=d,Object.assign(o,{startIndex:0,endIndex:1,visibleSize:0}),t.updateScrollYStatus(d));return t.cacheNodeMap(),t.handleData(!0),!o||n.height||n.maxHeight||(0,_log.errLog)("vxe.error.reqProp",["height | max-height | virtual-y-config.enabled=false"]),t.computeScrollLoad().then(function(){i||e&&e.length&&(a.initialized=!0,r&&t.setAllExpandNode(!0),t.setCheckboxByNodeId(n.checkNodeKeys||[],!0)),t.updateHeight(),t.refreshScroll()})},updateScrollYStatus:function(e){var t=this.reactData,n=this.internalData,a=this.transform,r=this.computeVirtualYOpts,e=e||n.treeFullData,n=!!a&&!!r.enabled&&-1<r.gt&&(0===r.gt||r.gt<e.length);return t.scrollYLoad=n},updateYSpace:function(){var e=this.reactData,t=this.internalData,n=e.scrollYLoad,a=t.scrollYStore;e.bodyHeight=n?t.afterVisibleList.length*a.rowHeight:0,e.topSpaceHeight=n?Math.max(a.startIndex*a.rowHeight,0):0},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var o=this,d=o.reactData,l=o.internalData;return o.$nextTick().then(function(){var e,t=d.scrollYLoad,n=l.scrollYStore,a=o.$refs.refVirtualBody,r=o.computeVirtualYOpts,i=0;(e=a?e||a.children[0]:e)&&(i=e.offsetHeight),i=Math.max(20,i),n.rowHeight=i,t?(a=o.$refs.refVirtualWrapper,e=Math.max(8,a?Math.ceil(a.clientHeight/i):0),t=Math.max(0,Math.min(2,_xeUtils.default.toNumber(r.oSize))),n.offsetSize=t,n.visibleSize=e,n.endIndex=Math.max(n.startIndex,e+t,n.endIndex),o.updateYData()):o.updateYSpace()})},scrollTo:function(e,t){var n=this,a=n.reactData,r=n.$refs.refVirtualWrapper;return e&&!_xeUtils.default.isNumber(e)&&(t=e.top,e=e.left),r&&(_xeUtils.default.isNumber(e)&&(r.scrollLeft=e),_xeUtils.default.isNumber(t))&&(r.scrollTop=t),a.scrollYLoad?new Promise(function(e){setTimeout(function(){n.$nextTick(function(){e()})},50)}):n.$nextTick()},refreshScroll:function(){var e=this.internalData,t=e.lastScrollLeft,n=e.lastScrollTop;return this.clearScroll().then(function(){if(t||n)return e.lastScrollLeft=0,e.lastScrollTop=0,scrollTo(t,n)})},recalculate:function(){var e,t,n,a=this,r=a.reactData,i=a.internalData.scrollYStore.rowHeight,o=a.$refs.refElem;return o&&o.clientWidth&&o.clientHeight?(o=a.getParentElem(),e=a.$refs.refHeaderWrapperElem,t=a.$refs.refFooterWrapperElem,e=e?e.clientHeight:0,t=t?t.clientHeight:0,o&&(n=(0,_dom.getPaddingTopBottomSize)(o),r.parentHeight=Math.max(e+t+i,o.clientHeight-n-e-t)),a.updateHeight(),a.computeScrollLoad().then(function(){a.updateHeight(),a.updateYSpace()})):a.$nextTick()},loadYData:function(e){var t=this.internalData.scrollYStore,n=t.startIndex,a=t.endIndex,r=t.visibleSize,i=t.offsetSize,e=e.target.scrollTop,e=Math.floor(e/t.rowHeight),o=Math.max(0,e-1-i),i=e+r+i;!(e<=n||a-r-1<=e)||n===o&&a===i||(t.startIndex=o,t.endIndex=i,this.updateYData())},scrollEvent:function(e){var t=this.reactData,n=this.internalData,a=e.target,r=a.scrollTop,a=a.scrollLeft,i=a!==n.lastScrollLeft,o=r!==n.lastScrollTop;n.lastScrollTop=r,n.lastScrollLeft=a,t.scrollYLoad&&this.loadYData(e),n.lastScrollTime=Date.now(),this.dispatchEvent("scroll",{scrollLeft:a,scrollTop:r,isX:i,isY:o},e)},clearScroll:function(){var e=this.internalData,t=this.$refs.refVirtualWrapper;return t&&(t.scrollTop=0,t.scrollLeft=0),e.lastScrollTop=0,e.lastScrollLeft=0,this.$nextTick()},handleNodeClickEvent:function(e,t){var n=this,a=n.reactData,r=n.showRadio,i=n.showCheckbox,o=n.trigger,d=n.computeRadioOpts,l=n.computeCheckboxOpts,c=!1,s=!1,u=!1,h=!1;n.computeIsRowCurrent?(c=!0,n.changeCurrentEvent(e,t)):a.currentNode&&(a.currentNode=null),"node"===o&&(h=!0,n.toggleExpandEvent(e,t)),r&&"node"===d.trigger&&(s=!0,n.changeRadioEvent(e,t)),i&&"node"===l.trigger&&(u=!0,n.changeCheckboxEvent(e,t)),n.dispatchEvent("node-click",{node:t,triggerCurrent:c,triggerRadio:s,triggerCheckbox:u,triggerExpand:h},e)},handleNodeDblclickEvent:function(e,t){this.dispatchEvent("node-dblclick",{node:t},e)},handleAsyncTreeExpandChilds:function(i){var o=this,d=o.reactData,l=o.internalData,n=o.loadMethod,c=o.computeCheckboxOpts.checkStrictly;return new Promise(function(e){var t,a,r;n?(t=l.nodeMaps,a=o.getNodeId(i),r=t[a],l.treeExpandLazyLoadedMaps[a]=!0,Promise.resolve(n({$tree:o,node:i})).then(function(n){var e=l.treeExpandLazyLoadedMaps;if(r.treeLoaded=!0,e[a]&&(e[a]=!1),n=_xeUtils.default.isArray(n)?n:[])return o.loadChildrenNode(i,n).then(function(e){var t=l.treeExpandedMaps;return e.length&&!t[a]&&(t[a]=!0),d.updateExpandedFlag++,!c&&o.isCheckedByCheckboxNodeId(a)&&o.handleCheckedCheckboxNode(e,!0),o.dispatchEvent("load-success",{node:i,data:n},new Event("load-success")),o.$nextTick()});o.dispatchEvent("load-success",{node:i,data:n},new Event("load-success"))}).catch(function(e){var t=l.treeExpandLazyLoadedMaps;r.treeLoaded=!1,t[a]&&(t[a]=!1),o.dispatchEvent("load-error",{node:i,data:e},new Event("load-error"))}).finally(function(){return o.handleTreeToList(),o.handleData(),o.recalculate()})):e()})},handleBaseTreeExpand:function(e,t){var a=this,n=a.reactData,r=a.internalData,i=a.lazy,o=a.accordion,d=a.toggleMethod,l=r.treeExpandLazyLoadedMaps,c=r.treeExpandedMaps,s=r.nodeMaps,u=a.computeChildrenField,h=a.computeHasChildField,f=[],r=d?e.filter(function(e){return d({$tree:a,expanded:t,node:e})}):e,p=(o&&(r=r.length?[r[r.length-1]]:[],e=a.getNodeId(r[0]),o=s[e])&&o.items.forEach(function(e){e=a.getNodeId(e);c[e]&&delete c[e]}),[]);return t?r.forEach(function(e){var t,n=a.getNodeId(e);c[n]||(t=s[n],i&&e[h]&&!t.treeLoaded&&!l[n]?f.push(a.handleAsyncTreeExpandChilds(e)):e[u]&&e[u].length&&(c[n]=!0,p.push(e)))}):r.forEach(function(e){var t=a.getNodeId(e);c[t]&&(delete c[t],p.push(e))}),n.updateExpandedFlag++,a.handleTreeToList(),a.handleData(),Promise.all(f).then(function(){return a.recalculate()})},toggleExpandEvent:function(e,t){var n=this.internalData,a=this.lazy,r=n.treeExpandedMaps,n=n.treeExpandLazyLoadedMaps,i=this.getNodeId(t),r=!r[i];e.stopPropagation(),a&&n[i]||this.handleBaseTreeExpand([t],r)},updateCheckboxStatus:function(){var a,r,d=this,e=d.reactData,t=d.internalData,n=d.transform,l=t.selectCheckboxMaps,c=t.indeterminateRowMaps,i=d.computeChildrenField,o=d.computeCheckboxOpts,s=o.checkStrictly,u=o.checkMethod;s||(a={},r=[],_xeUtils.default.eachTree(t.afterTreeList,function(e){var t=d.getNodeId(e),n=e[i];n&&n.length&&!a[t]&&(a[t]=1,r.unshift([e,t,n]))},{children:n?d.computeMapChildrenField:i}),r.forEach(function(e){var t=e[0],n=e[1],e=e[2],a=0,r=0,i=0,o=e.length,e=(e.forEach(u?function(e){var t=d.getNodeId(e),n=l[t];u({$tree:d,node:e})?(n?a++:c[t]&&r++,i++):n?a++:c[t]&&r++}:function(e){e=d.getNodeId(e);l[e]?a++:c[e]&&r++,i++}),!1),o=!(e=0<o?0<i?(0<a||0<r)&&i<=a:0<a&&i<=a||!!l[n]:l[n])&&(0<a||0<r);e?(l[n]=t,c[n]&&delete c[n]):(l[n]&&delete l[n],o?c[n]=t:c[n]&&delete c[n])}),e.updateCheckboxFlag++)},changeCheckboxEvent:function(e,t){var n,a=this,r=a,i=a.reactData,o=a.internalData,r=(e.preventDefault(),e.stopPropagation(),r.transform),d=o.selectCheckboxMaps,o=a.computeChildrenField,l=a.computeMapChildrenField,c=a.computeCheckboxOpts,s=c.checkStrictly,c=c.checkMethod,u=!!c;(u=c?!c({$tree:a,node:t}):u)||(c=a.getNodeId(t),n=!1,d[c]?delete d[c]:(n=!0,d[c]=t),s||_xeUtils.default.eachTree(_xeUtils.default.get(t,r?l:o),function(e){e=a.getNodeId(e);n?d[e]||(d[e]=!0):d[e]&&delete d[e]},{children:r?l:o}),i.updateCheckboxFlag++,a.updateCheckboxStatus(),u=_xeUtils.default.keys(d),a.emitCheckboxMode(u),a.dispatchEvent("checkbox-change",{node:t,value:u,checked:n},e))},changeCurrentEvent:function(e,t){var n=this.reactData,a=(e.preventDefault(),this.computeNodeOpts),r=a.currentMethod,a=a.trigger,i=this.computeChildrenField,i=_xeUtils.default.get(t,i),i=i&&i.length,o=!!r;if("child"===a){if(i)return}else if("parent"===a&&!i)return;(o=r?!r({node:t}):o)||(n.currentNode=t,this.dispatchEvent("current-change",{node:t,checked:!0},e))},changeRadioEvent:function(e,t){var n=this,a=n.reactData;e.preventDefault(),e.stopPropagation();var r=n.computeRadioOpts.checkMethod,i=!!r;(i=r?!r({$tree:n,node:t}):i)||(r=n.getNodeId(t),a.selectRadioKey=r,n.emitRadioMode(r),n.dispatchEvent("radio-change",{node:t,value:r,checked:!0},e))},handleGlobalResizeEvent:function(){var e=this.$refs.refElem;e&&e.clientWidth&&this.recalculate()},reloadData:function(e){return this.loadData(e||[])},clearCurrentNode:function(){return this.reactData.currentNode=null,this.$nextTick()},getCurrentNodeId:function(){var e=this.reactData.currentNode;return e?this.getNodeId(e):null},getCurrentNode:function(){var e=this.reactData,t=this.internalData,e=e.currentNode,t=t.nodeMaps;if(e){t=t[this.getNodeId(e)];if(t)return t.item}return null},setCurrentNodeId:function(e){var t=this.reactData,e=this.internalData.nodeMaps[e];return t.currentNode=e?e.item:null,this.$nextTick()},setCurrentNode:function(e){return this.reactData.currentNode=e,this.$nextTick()},clearRadioNode:function(){return this.reactData.selectRadioKey=null,this.$nextTick()},getRadioNodeId:function(){return this.reactData.selectRadioKey||null},getRadioNode:function(){var e=this.reactData,t=this.internalData,e=e.selectRadioKey,t=t.nodeMaps;if(e){t=t[e];if(t)return t.item}return null},setRadioNodeId:function(e){return this.reactData.selectRadioKey=e,this.$nextTick()},getCheckboxNodeIds:function(){var e=this.internalData.selectCheckboxMaps;return Object.keys(e)},getCheckboxNodes:function(){var e=this.internalData,n=e.nodeMaps,a=[];return _xeUtils.default.each(e.selectCheckboxMaps,function(e,t){t=n[t];t&&a.push(t.item)}),a},clearCheckboxNode:function(){var e=this.reactData;return this.internalData.selectCheckboxMaps={},e.updateCheckboxFlag++,this.$nextTick().then(function(){return{checkNodeKeys:[]}})},setAllCheckboxNode:function(e){var t=this,n=t.reactData,a=t.internalData,r=t.transform,i={},o=[];return e&&_xeUtils.default.eachTree(a.afterTreeList,function(e){e=t.getNodeId(e);o.push(e),i[e]=!0},{children:r?t.computeMapChildrenField:t.computeChildrenField}),a.selectCheckboxMaps=i,n.updateCheckboxFlag++,t.$nextTick().then(function(){return{checkNodeKeys:o}})},clearExpandNode:function(){return this.clearAllExpandNode()},clearAllExpandNode:function(){var e=this,t=e.reactData,n=e.internalData,a=n.nodeMaps,r=n.scrollYStore;return _xeUtils.default.each(a,function(e){e.treeLoaded=!1}),n.treeExpandedMaps={},t.updateExpandedFlag++,t.topSpaceHeight=0,r.startIndex=0,r.endIndex=1,e.handleTreeToList(),e.handleData(),e.recalculate()},setExpandByNodeId:function(e,t){var n=this,a=n.reactData,r=n.internalData.treeExpandedMaps;return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){handleSetExpand(e,t,r)}),a.updateExpandedFlag++),n.handleTreeToList(),n.handleData(),n.recalculate()},getExpandNodeIds:function(){var e=this.internalData.treeExpandedMaps;return _xeUtils.default.keys(e)},getExpandNodes:function(){var e=this.internalData,n=e.nodeMaps,a=[];return _xeUtils.default.each(e.treeExpandedMaps,function(e,t){t=n[t];t&&a.push(t.item)}),a},setExpandNode:function(e,t){var n=this,a=n.reactData,r=n.internalData.treeExpandedMaps;return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){handleSetExpand(n.getNodeId(e),t,r)}),a.updateExpandedFlag++),n.handleTreeToList(),n.handleData(),n.recalculate()},toggleExpandByNodeId:function(e){var t=this,n=t.reactData,a=t.internalData.treeExpandedMaps;return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){handleSetExpand(e,!a[e],a)}),n.updateExpandedFlag++),t.handleTreeToList(),t.handleData(),t.recalculate()},toggleExpandNode:function(e){var t=this,n=t.reactData,a=t.internalData.treeExpandedMaps;return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){e=t.getNodeId(e);handleSetExpand(e,!a[e],a)}),n.updateExpandedFlag++),t.handleTreeToList(),t.handleData(),t.recalculate()},setAllExpandNode:function(e){var n=this,t=n.reactData,a=n.internalData,r=n.transform,i=a.treeExpandedMaps,o=n.computeChildrenField;return e?_xeUtils.default.eachTree(a.afterTreeList,function(e){var t=_xeUtils.default.get(e,o);t&&t.length&&(t=n.getNodeId(e),i[t]=!0)},{children:r?n.computeMapChildrenField:o}):a.treeExpandedMaps={},t.updateExpandedFlag++,n.handleTreeToList(),n.handleData(),n.recalculate()},reloadExpandNode:function(e){return this.lazy?(this.clearExpandLoaded(e),this.handleAsyncTreeExpandChilds(e)):this.recalculate()},clearExpandLoaded:function(e){var t=this.internalData,n=this.lazy,t=t.nodeMaps;return n&&(n=t[this.getNodeId(e)])&&(n.treeLoaded=!1),this.recalculate()},loadChildrenNode:function(o,e){var t,n,d,l,c,s=this,a=s.internalData,r=s.lazy,i=s.transform,u=a.nodeMaps;return r?(t=s.computeChildrenField,n=s.computeMapChildrenField,d=u[s.getNodeId(o)],l=d?d.level:0,c=d?d.nodes:[],s.createNode(e).then(function(e){return _xeUtils.default.eachTree(e,function(e,t,n,a,r,i){e=s.getNodeId(e);u[e]={item:o,index:-1,items:n,parent:r||d.item,nodes:c.concat(i),level:l+i.length,treeIndex:-1,lineCount:0,treeLoaded:!1}},{children:t}),o[t]=e,i&&(o[n]=e),s.updateAfterDataIndex(),e})):Promise.resolve([])},getCheckboxIndeterminateNodes:function(){var e=this.internalData,n=e.nodeMaps,a=[];return _xeUtils.default.each(e.indeterminateRowMaps,function(e,t){t=n[t];t&&a.push(t.item)}),a},renderRadio:function(e,t,n,a){var r=this,i=r.showRadio,o=r.computeRadioOpts,d=o.showIcon,l=o.checkMethod,o=o.visibleMethod,o=!o||o({$tree:r,node:t}),c=!!l;return i&&d&&o?e("div",{class:["vxe-tree--radio-option",{"is--checked":a,"is--disabled":c=l?!l({$tree:r,node:t}):c}],on:{click:function(e){c||r.changeRadioEvent(e,t)}}},[e("span",{class:["vxe-radio--icon",a?(0,_ui.getIcon)().RADIO_CHECKED:(0,_ui.getIcon)().RADIO_UNCHECKED]})]):(0,_ui.renderEmptyElement)(r)},renderCheckbox:function(e,t,n,a){var r=this,i=r.showCheckbox,o=r.computeCheckboxOpts,d=o.showIcon,l=o.checkMethod,o=o.visibleMethod,n=r.isIndeterminateByCheckboxNodeid(n),o=!o||o({$tree:r,node:t}),c=!!l;return i&&d&&o?e("div",{class:["vxe-tree--checkbox-option",{"is--checked":a,"is--indeterminate":n,"is--disabled":c=l?!l({$tree:r,node:t}):c}],on:{click:function(e){c||r.changeCheckboxEvent(e,t)}}},[e("span",{class:["vxe-checkbox--icon",n?(0,_ui.getIcon)().CHECKBOX_INDETERMINATE:a?(0,_ui.getIcon)().CHECKBOX_CHECKED:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})]):(0,_ui.renderEmptyElement)(r)},renderNode:function(e,t,n){var a=this,r=a.$scopedSlots,i=a.reactData,o=a.internalData,d=a.lazy,l=a.showRadio,c=a.showCheckbox,s=a.showLine,u=a.indent,h=a.iconOpen,f=a.iconClose,p=a.iconLoaded,g=a.showIcon,x=i.currentNode,m=i.selectRadioKey,i=i.updateExpandedFlag,v=o.afterTreeList,C=o.nodeMaps,y=o.treeExpandedMaps,o=o.treeExpandLazyLoadedMaps,E=a.computeTitleField,b=a.computeHasChildField,_=_xeUtils.default.get(t,a.computeChildrenField),_=_&&_.length,k=r.icon,N=r.title,r=r.extra,i=i&&y[n],y=C[n],C=_xeUtils.default.get(t,E),E=!1,l=(l&&(E=n===String(m)),!1),m=(c&&(l=a.isCheckedByCheckboxNodeId(n)),!1),c=!1,D=!1,o=(d&&(c=!!o[n],m=t[b],D=!!y.treeLoaded),y.items[y.treeIndex-1]),b={node:t,isExpand:i};return e("div",{key:n,class:["vxe-tree--node-wrapper","node--level-".concat(y.level)],attrs:{nodeid:n}},[e("div",{class:["vxe-tree--node-item",{"is--current":x&&n===a.getNodeId(x),"is-radio--checked":E,"is-checkbox--checked":l}],style:{paddingLeft:"".concat((y.level-1)*(u||1),"px")},on:{click:function(e){a.handleNodeClickEvent(e,t)},dblclick:function(e){a.handleNodeDblclickEvent(e,t)}}},[s?e("div",{class:"vxe-tree--node-line-wrapper"},[e("div",{class:"vxe-tree--node-line",style:{height:"".concat(a.getNodeId(v[0])===n?1:(0,_util.calcTreeLine)(a,t,o),"px")}})]):(0,_ui.renderEmptyElement)(a),e("div",{class:"vxe-tree--node-item-switcher"},g&&(!d||D?_:m)?[e("div",{class:"vxe-tree--node-item-icon",on:{click:function(e){a.toggleExpandEvent(e,t)}}},k?(0,_vn.getSlotVNs)(k(b)):[e("i",{class:c?p||(0,_ui.getIcon)().TREE_NODE_LOADED:i?h||(0,_ui.getIcon)().TREE_NODE_OPEN:f||(0,_ui.getIcon)().TREE_NODE_CLOSE})])]:[]),a.renderRadio(e,t,n,E),a.renderCheckbox(e,t,n,l),e("div",{class:"vxe-tree--node-item-inner"},[e("div",{class:"vxe-tree--node-item-title"},N?(0,_vn.getSlotVNs)(N(b)):"".concat(C)),r?e("div",{class:"vxe-tree--node-item-extra"},(0,_vn.getSlotVNs)(r(b))):(0,_ui.renderEmptyElement)(a)])])])},renderList:function(n,e){var a,r=this,t=r.internalData,i=r.transform,o=t.treeExpandedMaps,d=r.computeChildrenField;return e.length?(a=[],e.forEach(i?function(e){var t=r.getNodeId(e);a.push(r.renderNode(n,e,t))}:function(e){var t=r.getNodeId(e),e=(a.push(r.renderNode(n,e,t)),_xeUtils.default.get(e,d));e&&e.length&&o[t]&&a.push.apply(a,_toConsumableArray(r.renderList(n,e)))}),a):[n("div",{class:"vxe-tree--empty-placeholder"},(0,_ui.getI18n)("vxe.tree.searchEmpty"))]},renderVN:function(e){var t=this,n=t.$scopedSlots,a=t.reactData,r=t.loading,i=t.trigger,o=t.showLine,d=a.bodyHeight,l=a.topSpaceHeight,a=a.treeList,c=t.computeSize,s=t.computeRadioOpts,u=t.computeCheckboxOpts,h=t.computeLoadingOpts,f=t.computeIsRowHover,p=t.computeTreeStyle,g=n.loading,x=n.header,n=n.footer;return e("div",{ref:"refElem",class:["vxe-tree",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(c),c),"show--line",o),"checkbox--highlight",u.highlight),"radio--highlight",s.highlight),"node--hover",f),"node--trigger","node"===i),"is--loading",r)]},[x?e("div",{ref:"refHeaderWrapperElem",class:"vxe-tree--header-wrapper"},x({$tree:t})):(0,_ui.renderEmptyElement)(t),e("div",{ref:"refVirtualWrapper",class:"vxe-tree--node-list-wrapper",style:p,on:{scroll:t.scrollEvent}},[e("div",{class:"vxe-tree--y-space",style:{height:d?"".concat(d,"px"):""}}),e("div",{ref:"refVirtualBody",class:"vxe-tree--node-list-body",style:{transform:"translateY(".concat(l,"px)")}},t.renderList(e,a))]),n?e("div",{ref:"refFooterWrapperElem",class:"vxe-tree--footer-wrapper"},n({$tree:t})):(0,_ui.renderEmptyElement)(t),e(_loading.default,{class:"vxe-tree--loading",props:{value:r,icon:h.icon,text:h.text},scopedSlots:g?{default:function(){return g({$tree:t})}}:{}})])}},watch:{data:function(e){this.loadData(e||[])},checkNodeKey:function(e){this.reactData.selectRadioKey=e},checkNodeKeys:function(){this.updateCheckboxChecked(this.checkNodeKeys||[])},filterValue:function(){this.triggerSearchEvent(new Event("filter"))},height:function(){this.recalculate()},minHeight:function(){this.recalculate()},maxHeight:function(){this.recalculate()}},created:function(){this.reactData.selectRadioKey=this.checkNodeKey||null,this.loadData(this.data||[])},mounted:function(){var e,t,n,a=this,r=a,i=a.internalData;r.autoResize&&(e=a.$refs.refElem,t=a.getParentElem(),n=_ui.globalResize.create(function(){r.autoResize&&a.recalculate()}),e&&n.observe(e),t&&n.observe(t),i.resizeObserver=n),_ui.globalEvents.on(a,"resize",a.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this.internalData,t=e.resizeObserver;t&&t.disconnect(),e.treeExpandedMaps={},e.indeterminateRowMaps={},e.nodeMaps={},_ui.globalEvents.off(this,"resize")},render:function(e){return this.renderVN(e)}});
|
|
1
|
+
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_util=require("./util"),_log=require("../../ui/src/log"),_vn=require("../../ui/src/vn"),_dom=require("../../ui/src/dom"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function getNodeUniqueId(){return _xeUtils.default.uniqueId("node_")}function handleSetExpand(e,t,n){t?n[e]||(n[e]=!0):n[e]&&delete n[e]}function handleScrollTo(t,e,n){var a=t.reactData,r=t.$refs.refVirtualWrapper;return e&&!_xeUtils.default.isNumber(e)&&(n=e.top,e=e.left),r&&(_xeUtils.default.isNumber(e)&&(r.scrollLeft=e),_xeUtils.default.isNumber(n))&&(r.scrollTop=n),a.scrollYLoad?new Promise(function(e){setTimeout(function(){t.$nextTick(function(){e()})},50)}):t.$nextTick()}var _default2=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTree",mixins:[_ui.globalMixins.sizeMixin],props:{data:Array,autoResize:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.autoResize}},height:[String,Number],maxHeight:{type:[String,Number],default:function(){return(0,_ui.getConfig)().tree.maxHeight}},minHeight:{type:[String,Number],default:function(){return(0,_ui.getConfig)().tree.minHeight}},loading:Boolean,loadingConfig:Object,accordion:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.accordion}},childrenField:{type:String,default:function(){return(0,_ui.getConfig)().tree.childrenField}},valueField:{type:String,default:function(){return(0,_ui.getConfig)().tree.valueField}},keyField:{type:String,default:function(){return(0,_ui.getConfig)().tree.keyField}},parentField:{type:String,default:function(){return(0,_ui.getConfig)().tree.parentField}},titleField:{type:String,default:function(){return(0,_ui.getConfig)().tree.titleField}},hasChildField:{type:String,default:function(){return(0,_ui.getConfig)().tree.hasChildField}},mapChildrenField:{type:String,default:function(){return(0,_ui.getConfig)().tree.mapChildrenField}},transform:Boolean,isCurrent:Boolean,isHover:Boolean,expandAll:Boolean,showLine:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.showLine}},trigger:String,indent:{type:Number,default:function(){return(0,_ui.getConfig)().tree.indent}},showRadio:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.showRadio}},checkNodeKey:{type:[String,Number],default:function(){return(0,_ui.getConfig)().tree.checkNodeKey}},radioConfig:Object,showCheckbox:{type:Boolean,default:function(){return(0,_ui.getConfig)().tree.showCheckbox}},checkNodeKeys:{type:Array,default:function(){return(0,_ui.getConfig)().tree.checkNodeKeys}},checkboxConfig:Object,nodeConfig:Object,lazy:Boolean,toggleMethod:Function,loadMethod:Function,showIcon:{type:Boolean,default:!0},iconOpen:{type:String,default:function(){return(0,_ui.getConfig)().tree.iconOpen}},iconClose:{type:String,default:function(){return(0,_ui.getConfig)().tree.iconClose}},iconLoaded:{type:String,default:function(){return(0,_ui.getConfig)().tree.iconLoaded}},filterValue:[String,Number],filterConfig:Object,size:{type:String,default:function(){return(0,_ui.getConfig)().tree.size||(0,_ui.getConfig)().size}},virtualYConfig:Object},data:function(){return{xID:_xeUtils.default.uniqueId(),reactData:{parentHeight:0,customHeight:0,customMinHeight:0,customMaxHeight:0,currentNode:null,scrollYLoad:!1,bodyHeight:0,topSpaceHeight:0,selectRadioKey:null,treeList:[],updateExpandedFlag:1,updateCheckboxFlag:1},internalData:{treeFullData:[],afterTreeList:[],afterVisibleList:[],nodeMaps:{},selectCheckboxMaps:{},indeterminateRowMaps:{},treeExpandedMaps:{},treeExpandLazyLoadedMaps:{},lastScrollLeft:0,lastScrollTop:0,scrollYStore:{startIndex:0,endIndex:0,visibleSize:0,offsetSize:0,rowHeight:0},lastScrollTime:0}}},computed:Object.assign(Object.assign({},{}),{computeTitleField:function(){return this.titleField||"title"},computeKeyField:function(){return this.keyField||"id"},computeValueField:function(){var e=this.computeKeyField;return this.valueField||e},computeParentField:function(){return this.parentField||"parentId"},computeChildrenField:function(){return this.childrenField||"children"},computeMapChildrenField:function(){return this.mapChildrenField||"mapChildren"},computeHasChildField:function(){return this.hasChildField||"hasChild"},computeVirtualYOpts:function(){return Object.assign({},(0,_ui.getConfig)().tree.virtualYConfig,this.virtualYConfig)},computeIsRowCurrent:function(){var e=this.computeNodeOpts.isCurrent;return _xeUtils.default.isBoolean(e)?e:this.isCurrent},computeIsRowHover:function(){var e=this.computeNodeOpts.isHover;return _xeUtils.default.isBoolean(e)?e:this.isHover},computeRadioOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().tree.radioConfig,this.radioConfig)},computeCheckboxOpts:function(){return Object.assign({showIcon:!0},(0,_ui.getConfig)().tree.checkboxConfig,this.checkboxConfig)},computeNodeOpts:function(){return Object.assign({},(0,_ui.getConfig)().tree.nodeConfig,this.nodeConfig)},computeLoadingOpts:function(){return Object.assign({},(0,_ui.getConfig)().tree.loadingConfig,this.loadingConfig)},computeTreeStyle:function(){var e=this.reactData,t=e.customHeight,n=e.customMinHeight,e=e.customMaxHeight,a={};return t&&(a.height=(0,_dom.toCssUnit)(t)),n&&(a.minHeight=(0,_dom.toCssUnit)(n)),e&&(a.maxHeight=(0,_dom.toCssUnit)(e)),a},computeFilterOpts:function(){return Object.assign({},(0,_ui.getConfig)().tree.filterConfig,this.filterConfig)}}),methods:{dispatchEvent:function(e,t,n){this.$emit(e,(0,_ui.createEvent)(n,{$tree:this},t))},getNodeId:function(e){var t=this.computeValueField,e=_xeUtils.default.get(e,t);return _xeUtils.default.eqNull(e)?"":encodeURIComponent(e)},getNodeById:function(e){var t=this.internalData.nodeMaps;if(e){t=t[e];if(t)return t.item}return null},isExpandByNode:function(e){var t=this.reactData,n=this.internalData,t=t.updateExpandedFlag,n=n.treeExpandedMaps,e=this.getNodeId(e);return!(!t||!n[e])},isCheckedByRadioNodeId:function(e){return this.reactData.selectRadioKey===e},isCheckedByRadioNode:function(e){return this.isCheckedByRadioNodeId(this.getNodeId(e))},isCheckedByCheckboxNodeId:function(e){var t=this.reactData,n=this.internalData,t=t.updateCheckboxFlag,n=n.selectCheckboxMaps;return!(!t||!n[e])},isCheckedByCheckboxNode:function(e){return this.isCheckedByCheckboxNodeId(this.getNodeId(e))},isIndeterminateByCheckboxNodeid:function(e){var t=this.reactData,n=this.internalData,t=t.updateCheckboxFlag,n=n.indeterminateRowMaps;return!(!t||!n[e])},isIndeterminateByCheckboxNode:function(e){return this.isIndeterminateByCheckboxNodeid(this.getNodeId(e))},emitCheckboxMode:function(e){this.$emit("update:checkNodeKeys",e)},emitRadioMode:function(e){this.$emit("update:checkNodeKey",e)},setRadioNode:function(e){var t=this.reactData;return e&&(t.selectRadioKey=this.getNodeId(e)),this.$nextTick()},setCheckboxNode:function(e,t){return e&&(_xeUtils.default.isArray(e)||(e=[e]),this.handleCheckedCheckboxNode(e,t)),this.$nextTick()},setCheckboxByNodeId:function(e,t){var n,a=this.internalData.nodeMaps;return e&&(_xeUtils.default.isArray(e)||(e=[e]),n=[],e.forEach(function(e){e=a[e];e&&n.push(e.item)}),this.handleCheckedCheckboxNode(n,t)),this.$nextTick()},handleCheckedCheckboxNode:function(e,n){function t(e){var t=a.getNodeId(e);n?o[t]||(o[t]=e):o[t]&&delete o[t]}var a=this,r=a.reactData,i=a.transform,o=a.internalData.selectCheckboxMaps,d=a.computeMapChildrenField,l=a.computeChildrenField;a.computeCheckboxOpts.checkStrictly?e.forEach(t):_xeUtils.default.eachTree(e,t,{children:i?d:l}),r.updateCheckboxFlag++,a.updateCheckboxStatus()},updateCheckboxChecked:function(e){this.setCheckboxByNodeId(e,!0)},handleSetExpand:function(e,t,n){t?n[e]||(n[e]=!0):n[e]&&delete n[e]},getParentElem:function(){var e=this.$refs.refElem;return e?e.parentElement:null},calcTableHeight:function(e){var t=this.reactData.parentHeight,e=this[e],n=0;return n=e?"100%"===e||"auto"===e?t:(n=(0,_dom.isScale)(e)?Math.floor((_xeUtils.default.toInteger(e)||1)/100*t):_xeUtils.default.toNumber(e),Math.max(40,n)):n},updateHeight:function(){var e=this.reactData;e.customHeight=this.calcTableHeight("height"),e.customMinHeight=this.calcTableHeight("minHeight"),e.customMaxHeight=this.calcTableHeight("maxHeight"),!e.scrollYLoad||e.customHeight||e.customMinHeight||(e.customHeight=300)},createNode:function(e){var n=this,a=n.computeValueField;return Promise.resolve(e.map(function(e){var t,e=Object.assign({},e);return n.getNodeId(e)||(t=getNodeUniqueId(),_xeUtils.default.set(e,a,t)),e}))},cacheNodeMap:function(){var d=this,e=d.internalData,t=e.treeFullData,l=d.computeValueField,c={};_xeUtils.default.eachTree(t,function(e,t,n,a,r,i){var o=d.getNodeId(e);o||(o=getNodeUniqueId(),_xeUtils.default.set(e,l,o)),c[o]={item:e,index:t,items:n,parent:r,nodes:i,level:i.length,treeIndex:t,lineCount:0,treeLoaded:!1}},{children:d.computeChildrenField}),e.nodeMaps=c},updateAfterDataIndex:function(){var i=this,e=i.internalData,t=i.transform,n=e.afterTreeList,o=e.nodeMaps;_xeUtils.default.eachTree(n,function(e,t,n){var a=i.getNodeId(e),r=o[a];r?(r.items=n,r.treeIndex=t):(r={item:e,index:t,items:n,parent:parent,nodes:[],level:0,treeIndex:t,lineCount:0,treeLoaded:!1},o[a]=r)},{children:t?i.computeMapChildrenField:i.computeChildrenField})},updateAfterFullData:function(){var e,t,n=this,a=n.internalData,r=n.transform,i=n.filterValue,o=a.treeFullData,d=a.lastFilterValue,l=n.computeTitleField,c=n.computeChildrenField,s=n.computeMapChildrenField,u=n.computeFilterOpts,h=u.autoExpandAll,f=u.beforeFilterMethod,p=u.filterMethod,g=u.afterFilterMethod,u=o,x=u,m="";i||0===i?(m="".concat(i),i=p?function(e){return p({$tree:n,node:e,filterValue:m})}:function(e){return-1<String(e[l]).toLowerCase().indexOf(m)},e={$tree:n,filterValue:m},f&&f(e),u=r?x=_xeUtils.default.searchTree(o,i,{children:c,mapChildren:s,isEvery:!0}):o.filter(i),a.lastFilterValue=m,n.$nextTick(function(){h?n.setAllExpandNode(!0).then(function(){g&&g(e)}):g&&g(e)})):(r&&(u=x=_xeUtils.default.searchTree(o,function(){return!0},{children:c,mapChildren:s,isEvery:!0}),d)&&(t={$tree:n,filterValue:m},f&&f(t),n.$nextTick(function(){h?n.clearAllExpandNode().then(function(){g&&g(t)}):g&&g(t)})),a.lastFilterValue=""),a.afterVisibleList=u,a.afterTreeList=x,n.updateAfterDataIndex()},handleTreeToList:function(){var d,l=this,e=l.internalData,t=l.transform,n=e.afterTreeList,c=e.treeExpandedMaps,s={};return t?(d=[],_xeUtils.default.eachTree(n,function(e,t,n,a,r){var i=l.getNodeId(e),o=l.getNodeId(r);(!r||s[o]&&c[o])&&(s[i]=1,d.push(e))},{children:l.computeMapChildrenField}),l.updateScrollYStatus(d),e.afterVisibleList=d):e.afterVisibleList},handleData:function(e){var t=this.reactData,n=this.internalData,a=t.scrollYLoad,r=n.scrollYStore,n=n.afterVisibleList,e=(e&&(this.updateAfterFullData(),n=this.handleTreeToList()),a?n.slice(r.startIndex,r.endIndex):n.slice(0));t.treeList=e},triggerSearchEvent:_xeUtils.default.debounce(function(){this.handleData(!0)},350,{trailing:!0}),loadData:function(e){var t=this,n=t,a=t.internalData,r=n.expandAll,i=a.initialized,o=a.scrollYStore,d=n.transform?_xeUtils.default.toArrayTree(e,{key:t.computeKeyField,parentKey:t.computeParentField,mapChildren:t.computeChildrenField}):e?e.slice(0):[],o=(a.treeFullData=d,Object.assign(o,{startIndex:0,endIndex:1,visibleSize:0}),t.updateScrollYStatus(d));return t.cacheNodeMap(),t.handleData(!0),!o||n.height||n.maxHeight||(0,_log.errLog)("vxe.error.reqProp",["height | max-height | virtual-y-config.enabled=false"]),t.computeScrollLoad().then(function(){i||e&&e.length&&(a.initialized=!0,r&&t.setAllExpandNode(!0),t.setCheckboxByNodeId(n.checkNodeKeys||[],!0)),t.updateHeight(),t.refreshScroll()})},updateScrollYStatus:function(e){var t=this.reactData,n=this.internalData,a=this.transform,r=this.computeVirtualYOpts,e=e||n.treeFullData,n=!!a&&!!r.enabled&&-1<r.gt&&(0===r.gt||r.gt<e.length);return t.scrollYLoad=n},updateYSpace:function(){var e=this.reactData,t=this.internalData,n=e.scrollYLoad,a=t.scrollYStore;e.bodyHeight=n?t.afterVisibleList.length*a.rowHeight:0,e.topSpaceHeight=n?Math.max(a.startIndex*a.rowHeight,0):0},updateYData:function(){this.handleData(),this.updateYSpace()},computeScrollLoad:function(){var o=this,d=o.reactData,l=o.internalData;return o.$nextTick().then(function(){var e,t=d.scrollYLoad,n=l.scrollYStore,a=o.$refs.refVirtualBody,r=o.computeVirtualYOpts,i=0;(e=a?e||a.children[0]:e)&&(i=e.offsetHeight),i=Math.max(20,i),n.rowHeight=i,t?(a=o.$refs.refVirtualWrapper,e=Math.max(8,a?Math.ceil(a.clientHeight/i):0),t=Math.max(0,Math.min(2,_xeUtils.default.toNumber(r.oSize))),n.offsetSize=t,n.visibleSize=e,n.endIndex=Math.max(n.startIndex,e+t,n.endIndex),o.updateYData()):o.updateYSpace()})},scrollTo:function(e,t){return handleScrollTo(this,e,t)},scrollToNode:function(e){return this.scrollToNodeId(this.getNodeId(e))},scrollToNodeId:function(t){var n=this,a=n.internalData,e=n.transform,r=a.scrollYStore,i=n.$refs.refVirtualWrapper;if(t&&i)if(e){e=_xeUtils.default.findTree(a.afterTreeList,function(e){return n.getNodeId(e)===t},{children:e?n.computeMapChildrenField:n.computeChildrenField});if(e)return n.setExpandNode(e.nodes,!0).then(function(){var e=_xeUtils.default.findIndexOf(a.afterVisibleList,function(e){return n.getNodeId(e)===t});if(-1<e)return e=Math.max(0,(e-1)*r.rowHeight),handleScrollTo(n,i.scrollLeft,e)})}else{e=i.querySelector('.vxe-tree--node-wrapper[nodeid="'.concat(t,'"]'));if(e)return handleScrollTo(n,i.scrollLeft,e.offsetTop)}return n.recalculate()},refreshScroll:function(){var e=this.internalData,t=e.lastScrollLeft,n=e.lastScrollTop;return this.clearScroll().then(function(){if(t||n)return e.lastScrollLeft=0,e.lastScrollTop=0,scrollTo(t,n)})},recalculate:function(){var e,t,n,a=this,r=a.reactData,i=a.internalData.scrollYStore.rowHeight,o=a.$refs.refElem;return o&&o.clientWidth&&o.clientHeight?(o=a.getParentElem(),e=a.$refs.refHeaderWrapperElem,t=a.$refs.refFooterWrapperElem,e=e?e.clientHeight:0,t=t?t.clientHeight:0,o&&(n=(0,_dom.getPaddingTopBottomSize)(o),r.parentHeight=Math.max(e+t+i,o.clientHeight-n-e-t)),a.updateHeight(),a.computeScrollLoad().then(function(){a.updateHeight(),a.updateYSpace()})):a.$nextTick()},loadYData:function(e){var t=this.internalData.scrollYStore,n=t.startIndex,a=t.endIndex,r=t.visibleSize,i=t.offsetSize,e=e.target.scrollTop,e=Math.floor(e/t.rowHeight),o=Math.max(0,e-1-i),i=e+r+i;!(e<=n||a-r-1<=e)||n===o&&a===i||(t.startIndex=o,t.endIndex=i,this.updateYData())},scrollEvent:function(e){var t=this.reactData,n=this.internalData,a=e.target,r=a.scrollTop,a=a.scrollLeft,i=a!==n.lastScrollLeft,o=r!==n.lastScrollTop;n.lastScrollTop=r,n.lastScrollLeft=a,t.scrollYLoad&&this.loadYData(e),n.lastScrollTime=Date.now(),this.dispatchEvent("scroll",{scrollLeft:a,scrollTop:r,isX:i,isY:o},e)},clearScroll:function(){var e=this.internalData,t=this.$refs.refVirtualWrapper;return t&&(t.scrollTop=0,t.scrollLeft=0),e.lastScrollTop=0,e.lastScrollLeft=0,this.$nextTick()},handleNodeClickEvent:function(e,t){var n=this,a=n.reactData,r=n.showRadio,i=n.showCheckbox,o=n.trigger,d=n.computeRadioOpts,l=n.computeCheckboxOpts,c=!1,s=!1,u=!1,h=!1;n.computeIsRowCurrent?(c=!0,n.changeCurrentEvent(e,t)):a.currentNode&&(a.currentNode=null),"node"===o&&(h=!0,n.toggleExpandEvent(e,t)),r&&"node"===d.trigger&&(s=!0,n.changeRadioEvent(e,t)),i&&"node"===l.trigger&&(u=!0,n.changeCheckboxEvent(e,t)),n.dispatchEvent("node-click",{node:t,triggerCurrent:c,triggerRadio:s,triggerCheckbox:u,triggerExpand:h},e)},handleNodeDblclickEvent:function(e,t){this.dispatchEvent("node-dblclick",{node:t},e)},handleAsyncTreeExpandChilds:function(i){var o=this,d=o.reactData,l=o.internalData,n=o.loadMethod,c=o.computeCheckboxOpts.checkStrictly;return new Promise(function(e){var t,a,r;n?(t=l.nodeMaps,a=o.getNodeId(i),r=t[a],l.treeExpandLazyLoadedMaps[a]=!0,Promise.resolve(n({$tree:o,node:i})).then(function(n){var e=l.treeExpandLazyLoadedMaps;if(r.treeLoaded=!0,e[a]&&(e[a]=!1),n=_xeUtils.default.isArray(n)?n:[])return o.loadChildrenNode(i,n).then(function(e){var t=l.treeExpandedMaps;return e.length&&!t[a]&&(t[a]=!0),d.updateExpandedFlag++,!c&&o.isCheckedByCheckboxNodeId(a)&&o.handleCheckedCheckboxNode(e,!0),o.dispatchEvent("load-success",{node:i,data:n},new Event("load-success")),o.$nextTick()});o.dispatchEvent("load-success",{node:i,data:n},new Event("load-success"))}).catch(function(e){var t=l.treeExpandLazyLoadedMaps;r.treeLoaded=!1,t[a]&&(t[a]=!1),o.dispatchEvent("load-error",{node:i,data:e},new Event("load-error"))}).finally(function(){return o.handleTreeToList(),o.handleData(),o.recalculate()})):e()})},handleBaseTreeExpand:function(e,t){var a=this,n=a.reactData,r=a.internalData,i=a.lazy,o=a.accordion,d=a.toggleMethod,l=r.treeExpandLazyLoadedMaps,c=r.treeExpandedMaps,s=r.nodeMaps,u=a.computeChildrenField,h=a.computeHasChildField,f=[],r=d?e.filter(function(e){return d({$tree:a,expanded:t,node:e})}):e,p=(o&&(r=r.length?[r[r.length-1]]:[],e=a.getNodeId(r[0]),o=s[e])&&o.items.forEach(function(e){e=a.getNodeId(e);c[e]&&delete c[e]}),[]);return t?r.forEach(function(e){var t,n=a.getNodeId(e);c[n]||(t=s[n],i&&e[h]&&!t.treeLoaded&&!l[n]?f.push(a.handleAsyncTreeExpandChilds(e)):e[u]&&e[u].length&&(c[n]=!0,p.push(e)))}):r.forEach(function(e){var t=a.getNodeId(e);c[t]&&(delete c[t],p.push(e))}),n.updateExpandedFlag++,a.handleTreeToList(),a.handleData(),Promise.all(f).then(function(){return a.recalculate()})},toggleExpandEvent:function(e,t){var n=this.internalData,a=this.lazy,r=n.treeExpandedMaps,n=n.treeExpandLazyLoadedMaps,i=this.getNodeId(t),r=!r[i];e.stopPropagation(),a&&n[i]||this.handleBaseTreeExpand([t],r)},updateCheckboxStatus:function(){var a,r,d=this,e=d.reactData,t=d.internalData,n=d.transform,l=t.selectCheckboxMaps,c=t.indeterminateRowMaps,i=d.computeChildrenField,o=d.computeCheckboxOpts,s=o.checkStrictly,u=o.checkMethod;s||(a={},r=[],_xeUtils.default.eachTree(t.afterTreeList,function(e){var t=d.getNodeId(e),n=e[i];n&&n.length&&!a[t]&&(a[t]=1,r.unshift([e,t,n]))},{children:n?d.computeMapChildrenField:i}),r.forEach(function(e){var t=e[0],n=e[1],e=e[2],a=0,r=0,i=0,o=e.length,e=(e.forEach(u?function(e){var t=d.getNodeId(e),n=l[t];u({$tree:d,node:e})?(n?a++:c[t]&&r++,i++):n?a++:c[t]&&r++}:function(e){e=d.getNodeId(e);l[e]?a++:c[e]&&r++,i++}),!1),o=!(e=0<o?0<i?(0<a||0<r)&&i<=a:0<a&&i<=a||!!l[n]:l[n])&&(0<a||0<r);e?(l[n]=t,c[n]&&delete c[n]):(l[n]&&delete l[n],o?c[n]=t:c[n]&&delete c[n])}),e.updateCheckboxFlag++)},changeCheckboxEvent:function(e,t){var n,a=this,r=a,i=a.reactData,o=a.internalData,r=(e.preventDefault(),e.stopPropagation(),r.transform),d=o.selectCheckboxMaps,o=a.computeChildrenField,l=a.computeMapChildrenField,c=a.computeCheckboxOpts,s=c.checkStrictly,c=c.checkMethod,u=!!c;(u=c?!c({$tree:a,node:t}):u)||(c=a.getNodeId(t),n=!1,d[c]?delete d[c]:(n=!0,d[c]=t),s||_xeUtils.default.eachTree(_xeUtils.default.get(t,r?l:o),function(e){e=a.getNodeId(e);n?d[e]||(d[e]=!0):d[e]&&delete d[e]},{children:r?l:o}),i.updateCheckboxFlag++,a.updateCheckboxStatus(),u=_xeUtils.default.keys(d),a.emitCheckboxMode(u),a.dispatchEvent("checkbox-change",{node:t,value:u,checked:n},e))},changeCurrentEvent:function(e,t){var n=this.reactData,a=(e.preventDefault(),this.computeNodeOpts),r=a.currentMethod,a=a.trigger,i=this.computeChildrenField,i=_xeUtils.default.get(t,i),i=i&&i.length,o=!!r;if("child"===a){if(i)return}else if("parent"===a&&!i)return;(o=r?!r({node:t}):o)||(n.currentNode=t,this.dispatchEvent("current-change",{node:t,checked:!0},e))},changeRadioEvent:function(e,t){var n=this,a=n.reactData;e.preventDefault(),e.stopPropagation();var r=n.computeRadioOpts.checkMethod,i=!!r;(i=r?!r({$tree:n,node:t}):i)||(r=n.getNodeId(t),a.selectRadioKey=r,n.emitRadioMode(r),n.dispatchEvent("radio-change",{node:t,value:r,checked:!0},e))},handleGlobalResizeEvent:function(){var e=this.$refs.refElem;e&&e.clientWidth&&this.recalculate()},reloadData:function(e){return this.loadData(e||[])},clearCurrentNode:function(){return this.reactData.currentNode=null,this.$nextTick()},getCurrentNodeId:function(){var e=this.reactData.currentNode;return e?this.getNodeId(e):null},getCurrentNode:function(){var e=this.reactData,t=this.internalData,e=e.currentNode,t=t.nodeMaps;if(e){t=t[this.getNodeId(e)];if(t)return t.item}return null},setCurrentNodeId:function(e){var t=this.reactData,e=this.internalData.nodeMaps["".concat(e)];return t.currentNode=e?e.item:null,this.$nextTick()},setCurrentNode:function(e){return this.reactData.currentNode=e,this.$nextTick()},clearRadioNode:function(){return this.reactData.selectRadioKey=null,this.$nextTick()},getRadioNodeId:function(){return this.reactData.selectRadioKey||null},getRadioNode:function(){var e=this.reactData,t=this.internalData,e=e.selectRadioKey,t=t.nodeMaps;if(e){t=t[e];if(t)return t.item}return null},setRadioNodeId:function(e){return this.reactData.selectRadioKey=e,this.$nextTick()},getCheckboxNodeIds:function(){var e=this.internalData.selectCheckboxMaps;return Object.keys(e)},getCheckboxNodes:function(){var e=this.internalData,n=e.nodeMaps,a=[];return _xeUtils.default.each(e.selectCheckboxMaps,function(e,t){t=n[t];t&&a.push(t.item)}),a},clearCheckboxNode:function(){var e=this.reactData;return this.internalData.selectCheckboxMaps={},e.updateCheckboxFlag++,this.$nextTick().then(function(){return{checkNodeKeys:[]}})},setAllCheckboxNode:function(e){var t=this,n=t.reactData,a=t.internalData,r=t.transform,i={},o=[];return e&&_xeUtils.default.eachTree(a.afterTreeList,function(e){e=t.getNodeId(e);o.push(e),i[e]=!0},{children:r?t.computeMapChildrenField:t.computeChildrenField}),a.selectCheckboxMaps=i,n.updateCheckboxFlag++,t.$nextTick().then(function(){return{checkNodeKeys:o}})},clearExpandNode:function(){return this.clearAllExpandNode()},clearAllExpandNode:function(){var e=this,t=e.reactData,n=e.internalData,a=n.nodeMaps,r=n.scrollYStore;return _xeUtils.default.each(a,function(e){e.treeLoaded=!1}),n.treeExpandedMaps={},t.updateExpandedFlag++,t.topSpaceHeight=0,r.startIndex=0,r.endIndex=1,e.handleTreeToList(),e.handleData(),e.recalculate()},setExpandByNodeId:function(e,t){var n=this,a=n.reactData,r=n.internalData.treeExpandedMaps;return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){handleSetExpand("".concat(e),t,r)}),a.updateExpandedFlag++),n.handleTreeToList(),n.handleData(),n.recalculate()},getExpandNodeIds:function(){var e=this.internalData.treeExpandedMaps;return _xeUtils.default.keys(e)},getExpandNodes:function(){var e=this.internalData,n=e.nodeMaps,a=[];return _xeUtils.default.each(e.treeExpandedMaps,function(e,t){t=n[t];t&&a.push(t.item)}),a},setExpandNode:function(e,t){var n=this,a=n.reactData,r=n.internalData.treeExpandedMaps;return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){handleSetExpand(n.getNodeId(e),t,r)}),a.updateExpandedFlag++),n.handleTreeToList(),n.handleData(),n.recalculate()},toggleExpandByNodeId:function(e){var t=this,n=t.reactData,a=t.internalData.treeExpandedMaps;return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){handleSetExpand("".concat(e),!a["".concat(e)],a)}),n.updateExpandedFlag++),t.handleTreeToList(),t.handleData(),t.recalculate()},toggleExpandNode:function(e){var t=this,n=t.reactData,a=t.internalData.treeExpandedMaps;return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(function(e){e=t.getNodeId(e);handleSetExpand(e,!a[e],a)}),n.updateExpandedFlag++),t.handleTreeToList(),t.handleData(),t.recalculate()},setAllExpandNode:function(e){var n=this,t=n.reactData,a=n.internalData,r=n.transform,i=a.treeExpandedMaps,o=n.computeChildrenField;return e?_xeUtils.default.eachTree(a.afterTreeList,function(e){var t=_xeUtils.default.get(e,o);t&&t.length&&(t=n.getNodeId(e),i[t]=!0)},{children:r?n.computeMapChildrenField:o}):a.treeExpandedMaps={},t.updateExpandedFlag++,n.handleTreeToList(),n.handleData(),n.recalculate()},reloadExpandNode:function(e){return this.lazy?(this.clearExpandLoaded(e),this.handleAsyncTreeExpandChilds(e)):this.recalculate()},clearExpandLoaded:function(e){var t=this.internalData,n=this.lazy,t=t.nodeMaps;return n&&(n=t[this.getNodeId(e)])&&(n.treeLoaded=!1),this.recalculate()},loadChildrenNode:function(o,e){var t,n,d,l,c,s=this,a=s.internalData,r=s.lazy,i=s.transform,u=a.nodeMaps;return r?(t=s.computeChildrenField,n=s.computeMapChildrenField,d=u[s.getNodeId(o)],l=d?d.level:0,c=d?d.nodes:[],s.createNode(e).then(function(e){return _xeUtils.default.eachTree(e,function(e,t,n,a,r,i){e=s.getNodeId(e);u[e]={item:o,index:-1,items:n,parent:r||d.item,nodes:c.concat(i),level:l+i.length,treeIndex:-1,lineCount:0,treeLoaded:!1}},{children:t}),o[t]=e,i&&(o[n]=e),s.updateAfterDataIndex(),e})):Promise.resolve([])},getCheckboxIndeterminateNodes:function(){var e=this.internalData,n=e.nodeMaps,a=[];return _xeUtils.default.each(e.indeterminateRowMaps,function(e,t){t=n[t];t&&a.push(t.item)}),a},renderRadio:function(e,t,n,a){var r=this,i=r.showRadio,o=r.computeRadioOpts,d=o.showIcon,l=o.checkMethod,o=o.visibleMethod,o=!o||o({$tree:r,node:t}),c=!!l;return i&&d&&o?e("div",{class:["vxe-tree--radio-option",{"is--checked":a,"is--disabled":c=l?!l({$tree:r,node:t}):c}],on:{click:function(e){c||r.changeRadioEvent(e,t)}}},[e("span",{class:["vxe-radio--icon",a?(0,_ui.getIcon)().RADIO_CHECKED:(0,_ui.getIcon)().RADIO_UNCHECKED]})]):(0,_ui.renderEmptyElement)(r)},renderCheckbox:function(e,t,n,a){var r=this,i=r.showCheckbox,o=r.computeCheckboxOpts,d=o.showIcon,l=o.checkMethod,o=o.visibleMethod,n=r.isIndeterminateByCheckboxNodeid(n),o=!o||o({$tree:r,node:t}),c=!!l;return i&&d&&o?e("div",{class:["vxe-tree--checkbox-option",{"is--checked":a,"is--indeterminate":n,"is--disabled":c=l?!l({$tree:r,node:t}):c}],on:{click:function(e){c||r.changeCheckboxEvent(e,t)}}},[e("span",{class:["vxe-checkbox--icon",n?(0,_ui.getIcon)().CHECKBOX_INDETERMINATE:a?(0,_ui.getIcon)().CHECKBOX_CHECKED:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})]):(0,_ui.renderEmptyElement)(r)},renderNode:function(e,t,n){var a=this,r=a.$scopedSlots,i=a.reactData,o=a.internalData,d=a.lazy,l=a.showRadio,c=a.showCheckbox,s=a.showLine,u=a.indent,h=a.iconOpen,f=a.iconClose,p=a.iconLoaded,g=a.showIcon,x=i.currentNode,m=i.selectRadioKey,i=i.updateExpandedFlag,v=o.afterTreeList,C=o.nodeMaps,y=o.treeExpandedMaps,o=o.treeExpandLazyLoadedMaps,E=a.computeTitleField,b=a.computeHasChildField,_=_xeUtils.default.get(t,a.computeChildrenField),_=_&&_.length,N=r.icon,k=r.title,r=r.extra,i=i&&y[n],y=C[n],C=_xeUtils.default.get(t,E),E=!1,l=(l&&(E=n===String(m)),!1),m=(c&&(l=a.isCheckedByCheckboxNodeId(n)),!1),c=!1,D=!1,o=(d&&(c=!!o[n],m=t[b],D=!!y.treeLoaded),y.items[y.treeIndex-1]),b={node:t,isExpand:i};return e("div",{key:n,class:["vxe-tree--node-wrapper","node--level-".concat(y.level)],attrs:{nodeid:n}},[e("div",{class:["vxe-tree--node-item",{"is--current":x&&n===a.getNodeId(x),"is-radio--checked":E,"is-checkbox--checked":l}],style:{paddingLeft:"".concat((y.level-1)*(u||1),"px")},on:{click:function(e){a.handleNodeClickEvent(e,t)},dblclick:function(e){a.handleNodeDblclickEvent(e,t)}}},[s?e("div",{class:"vxe-tree--node-line-wrapper"},[e("div",{class:"vxe-tree--node-line",style:{height:"".concat(a.getNodeId(v[0])===n?1:(0,_util.calcTreeLine)(a,t,o),"px")}})]):(0,_ui.renderEmptyElement)(a),e("div",{class:"vxe-tree--node-item-switcher"},g&&(!d||D?_:m)?[e("div",{class:"vxe-tree--node-item-icon",on:{click:function(e){a.toggleExpandEvent(e,t)}}},N?(0,_vn.getSlotVNs)(N(b)):[e("i",{class:c?p||(0,_ui.getIcon)().TREE_NODE_LOADED:i?h||(0,_ui.getIcon)().TREE_NODE_OPEN:f||(0,_ui.getIcon)().TREE_NODE_CLOSE})])]:[]),a.renderRadio(e,t,n,E),a.renderCheckbox(e,t,n,l),e("div",{class:"vxe-tree--node-item-inner"},[e("div",{class:"vxe-tree--node-item-title"},k?(0,_vn.getSlotVNs)(k(b)):"".concat(C)),r?e("div",{class:"vxe-tree--node-item-extra"},(0,_vn.getSlotVNs)(r(b))):(0,_ui.renderEmptyElement)(a)])])])},renderList:function(n,e){var a,r=this,t=r.internalData,i=r.transform,o=t.treeExpandedMaps,d=r.computeChildrenField;return e.length?(a=[],e.forEach(i?function(e){var t=r.getNodeId(e);a.push(r.renderNode(n,e,t))}:function(e){var t=r.getNodeId(e),e=(a.push(r.renderNode(n,e,t)),_xeUtils.default.get(e,d));e&&e.length&&o[t]&&a.push.apply(a,_toConsumableArray(r.renderList(n,e)))}),a):[n("div",{class:"vxe-tree--empty-placeholder"},(0,_ui.getI18n)("vxe.tree.searchEmpty"))]},renderVN:function(e){var t=this,n=t.$scopedSlots,a=t.reactData,r=t.loading,i=t.trigger,o=t.showLine,d=a.bodyHeight,l=a.topSpaceHeight,a=a.treeList,c=t.computeSize,s=t.computeRadioOpts,u=t.computeCheckboxOpts,h=t.computeLoadingOpts,f=t.computeIsRowHover,p=t.computeTreeStyle,g=n.loading,x=n.header,n=n.footer;return e("div",{ref:"refElem",class:["vxe-tree",_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"size--".concat(c),c),"show--line",o),"checkbox--highlight",u.highlight),"radio--highlight",s.highlight),"node--hover",f),"node--trigger","node"===i),"is--loading",r)]},[x?e("div",{ref:"refHeaderWrapperElem",class:"vxe-tree--header-wrapper"},x({$tree:t})):(0,_ui.renderEmptyElement)(t),e("div",{ref:"refVirtualWrapper",class:"vxe-tree--node-list-wrapper",style:p,on:{scroll:t.scrollEvent}},[e("div",{class:"vxe-tree--y-space",style:{height:d?"".concat(d,"px"):""}}),e("div",{ref:"refVirtualBody",class:"vxe-tree--node-list-body",style:{transform:"translateY(".concat(l,"px)")}},t.renderList(e,a))]),n?e("div",{ref:"refFooterWrapperElem",class:"vxe-tree--footer-wrapper"},n({$tree:t})):(0,_ui.renderEmptyElement)(t),e(_loading.default,{class:"vxe-tree--loading",props:{value:r,icon:h.icon,text:h.text},scopedSlots:g?{default:function(){return g({$tree:t})}}:{}})])}},watch:{data:function(e){this.loadData(e||[])},checkNodeKey:function(e){this.reactData.selectRadioKey=e},checkNodeKeys:function(){this.updateCheckboxChecked(this.checkNodeKeys||[])},filterValue:function(){this.triggerSearchEvent(new Event("filter"))},height:function(){this.recalculate()},minHeight:function(){this.recalculate()},maxHeight:function(){this.recalculate()}},created:function(){this.reactData.selectRadioKey=this.checkNodeKey||null,this.loadData(this.data||[])},mounted:function(){var e,t,n,a=this,r=a,i=a.internalData;r.autoResize&&(e=a.$refs.refElem,t=a.getParentElem(),n=_ui.globalResize.create(function(){r.autoResize&&a.recalculate()}),e&&n.observe(e),t&&n.observe(t),i.resizeObserver=n),_ui.globalEvents.on(a,"resize",a.handleGlobalResizeEvent)},beforeDestroy:function(){var e=this.internalData,t=e.resizeObserver;t&&t.disconnect(),e.treeExpandedMaps={},e.indeterminateRowMaps={},e.nodeMaps={},_ui.globalEvents.off(this,"resize")},render:function(e){return this.renderVN(e)}});
|
package/lib/ui/index.js
CHANGED
|
@@ -26,7 +26,7 @@ Object.keys(_core).forEach(function (key) {
|
|
|
26
26
|
});
|
|
27
27
|
var _dynamics = require("../dynamics");
|
|
28
28
|
var _log = require("./src/log");
|
|
29
|
-
var version = exports.version = "3.8.
|
|
29
|
+
var version = exports.version = "3.8.2";
|
|
30
30
|
_core.VxeUI.uiVersion = version;
|
|
31
31
|
_core.VxeUI.dynamicApp = _dynamics.dynamicApp;
|
|
32
32
|
function config(options) {
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log"),version=exports.version="3.8.0";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxButton:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"rgb",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:!0,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:60}},loading:{showIcon:!0,showText:!0},menu:{},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},split:{resize:!0,itemConfig:{minWidth:40,minHeight:40}},splitPane:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{autoClose:!0,virtualYConfig:{enabled:!0,gt:0,oSize:2},treeConfig:{maxHeight:300,radioConfig:{},checkboxConfig:{},filterConfig:{autoExpandAll:!0}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0,autoSubmit:!0,maxSimultaneousUploads:5},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{}});var iconPrefix="vxe-icon-",_default=((0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",SELECT_ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_UPLOAD:iconPrefix+"upload",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_TOP:iconPrefix+"arrow-up",TABS_TAB_BUTTON_BOTTOM:iconPrefix+"arrow-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_PICKER_COLOR_COPY:iconPrefix+"copy",COLOR_PICKER_EYE_DROPPER:iconPrefix+"dropper",COLOR_PICKER_TPTY_OPEN:iconPrefix+"arrow-down rotate180",COLOR_PICKER_TPTY_CLOSE:iconPrefix+"arrow-down",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"}),exports.default=_core.VxeUI);
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log"),version=exports.version="3.8.2";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxButton:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"rgb",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:!0,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:60}},loading:{showIcon:!0,showText:!0},menu:{},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},split:{resize:!0,itemConfig:{minWidth:40,minHeight:40}},splitPane:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0},virtualYConfig:{enabled:!0,gt:50,oSize:2}},treeSelect:{autoClose:!0,virtualYConfig:{enabled:!0,gt:0,oSize:2},treeConfig:{maxHeight:300,radioConfig:{},checkboxConfig:{},filterConfig:{autoExpandAll:!0}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0,autoSubmit:!0,maxSimultaneousUploads:5},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{}});var iconPrefix="vxe-icon-",_default=((0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",SELECT_ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_UPLOAD:iconPrefix+"upload",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_TOP:iconPrefix+"arrow-up",TABS_TAB_BUTTON_BOTTOM:iconPrefix+"arrow-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_PICKER_COLOR_COPY:iconPrefix+"copy",COLOR_PICKER_EYE_DROPPER:iconPrefix+"dropper",COLOR_PICKER_TPTY_OPEN:iconPrefix+"arrow-down rotate180",COLOR_PICKER_TPTY_CLOSE:iconPrefix+"arrow-down",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"}),exports.default=_core.VxeUI);
|
package/lib/ui/src/log.js
CHANGED
|
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.warnLog = exports.errLog = void 0;
|
|
7
7
|
var _core = require("@vxe-ui/core");
|
|
8
|
-
var version = "ui v".concat("3.8.
|
|
8
|
+
var version = "ui v".concat("3.8.2");
|
|
9
9
|
var warnLog = exports.warnLog = _core.log.create('warn', version);
|
|
10
10
|
var errLog = exports.errLog = _core.log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core"),version="ui v".concat("3.8.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core"),version="ui v".concat("3.8.2"),warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
|
package/package.json
CHANGED
|
@@ -308,18 +308,34 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
308
308
|
|
|
309
309
|
const { multiple } = props
|
|
310
310
|
const tableCols: VxeTableSelectPropTypes.Columns = []
|
|
311
|
+
let hasRadioCol = false
|
|
312
|
+
let hasCheckboxCol = false
|
|
313
|
+
columns.forEach(column => {
|
|
314
|
+
if (!hasRadioCol && column.type === 'radio') {
|
|
315
|
+
hasRadioCol = true
|
|
316
|
+
} else if (!hasCheckboxCol && column.type === 'checkbox') {
|
|
317
|
+
hasCheckboxCol = true
|
|
318
|
+
}
|
|
319
|
+
tableCols.push(column)
|
|
320
|
+
})
|
|
311
321
|
if (multiple) {
|
|
312
|
-
|
|
322
|
+
if (!hasCheckboxCol) {
|
|
323
|
+
errLog('vxe.error.reqProp', ['{ type: "checkbox" }'])
|
|
324
|
+
}
|
|
325
|
+
tableCols.unshift({
|
|
313
326
|
type: 'checkbox',
|
|
314
327
|
width: 70
|
|
315
328
|
})
|
|
316
329
|
} else {
|
|
317
|
-
|
|
330
|
+
if (!hasRadioCol) {
|
|
331
|
+
errLog('vxe.error.reqProp', ['{ type: "radio" }'])
|
|
332
|
+
}
|
|
333
|
+
tableCols.unshift({
|
|
318
334
|
type: 'radio',
|
|
319
335
|
width: 70
|
|
320
336
|
})
|
|
321
337
|
}
|
|
322
|
-
reactData.tableColumns = tableCols
|
|
338
|
+
reactData.tableColumns = tableCols
|
|
323
339
|
},
|
|
324
340
|
cacheDataMap () {
|
|
325
341
|
const $xeTableSelect = this
|