text: "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.UtilTools=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../conf"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}var columnUniqueId=0,ColumnConfig=function e(l){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=t.renderHeader,n=t.renderCell,i=t.renderData;_classCallCheck(this,e),l.cellRender&&l.editRender&&console.warn("[vxe-table] Properties cell-render and edit-render cannot be used together."),Object.assign(this,{id:"col_".concat(++columnUniqueId),type:l.type,prop:l.prop,property:l.field||l.prop,title:l.title,label:l.label,width:l.width,minWidth:l.minWidth,resizable:l.resizable,fixed:l.fixed,align:l.align,headerAlign:l.headerAlign,showOverflow:l.showOverflow,showHeaderOverflow:l.showHeaderOverflow,indexMethod:l.indexMethod,formatter:l.formatter,sortable:l.sortable,sortBy:l.sortBy,remoteSort:l.remoteSort,filters:(l.filters||[]).map(function(e){var l=e.label,t=e.value,r=e.data;return{label:l,value:t,data:r,_data:r,checked:!!e.checked}}),filterMultiple:!_xeUtils.default.isBoolean(l.filterMultiple)||l.filterMultiple,filterMethod:l.filterMethod,filterRender:l.filterRender,treeNode:l.treeNode,cellRender:l.cellRender,editRender:l.editRender,params:l.params,visible:!0,level:1,rowSpan:1,colSpan:1,order:null,renderWidth:0,renderHeight:0,resizeWidth:0,renderLeft:0,model:{},renderHeader:r||l.renderHeader,renderCell:n||l.renderCell,renderData:i,slots:l.slots,own:l})},UtilTools={getSize:function(e){var l=e.size,t=e.$parent;return l||(t&&-1<["medium","small","mini"].indexOf(t.size)?t.size:null)},getFuncText:function(e){return _xeUtils.default.isFunction(e)?e():_conf.default.translate?_conf.default.translate(e):e},getRowkey:function(e){return e.rowId},getRowid:function(e,l){var t=_xeUtils.default.get(l,UtilTools.getRowkey(e));return t?encodeURIComponent(t):""},emitEvent:function(e,l,t){e.$listeners[l]&&e.$emit.apply(e,[l].concat(t))},getColumnList:function(e){var l=[];return e.forEach(function(e){l.push.apply(l,e.children&&e.children.length?UtilTools.getColumnList(e.children):[e])}),l},formatText:function(e,l){return""+(null==e?l?_conf.default.emptyCell:"":e)},getCellValue:function(e,l){return _xeUtils.default.get(e,l.property)},getCellLabel:function(e,l,t){var r=l.formatter,n=UtilTools.getCellValue(e,l),i=n;if(t&&r){var o,a,d=t.$table,u=l.id;if(d&&d.fullAllDataRowMap.has(e)&&((a=(o=d.fullAllDataRowMap.get(e)).formatData)||(a=d.fullAllDataRowMap.get(e).formatData={})),o&&a[u]&&a[u].value===n)return a[u].label;i=_xeUtils.default.isString(r)?_xeUtils.default[r](n):_xeUtils.default.isArray(r)?_xeUtils.default[r[0]].apply(_xeUtils.default,[n].concat(r.slice(1))):r(Object.assign({cellValue:n},t)),a&&(a[u]={value:n,label:i})}return i},setCellValue:function(e,l,t){return _xeUtils.default.set(e,l.property,t)},getColumnConfig:function(e,l){return e instanceof ColumnConfig?e:new ColumnConfig(e,l)},assemColumn:function(e){var l=e.$table,t=e.$parent,r=e.columnConfig,n=t.columnConfig;r.slots=e.$scopedSlots,n&&0<t.$children.length?(n.children||(n.children=[]),n.children.splice([].indexOf.call(t.$el.children,e.$el),0,r)):l.collectColumn.splice([].indexOf.call(l.$refs.hideColumn.children,e.$el),0,r)},destroyColumn:function(e){var l=e.$table,t=e.columnConfig,r=_xeUtils.default.findTree(l.collectColumn,function(e){return e===t});r&&r.items.splice(r.index,1)},hasChildrenList:function(e){return e&&e.children&&0<e.children.length}},_default=exports.UtilTools=UtilTools;exports.default=_default;