"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-unified");require("../../utils/index.js");const c=require("../../utils/is.js"),g=20,m=50,C=e=>e.some(i=>!!i.html);function b(e,i){const t={...u.omit(e,["columns","request","searchForm","dataSource","rowKey","value","round"])};return t.rowConfig={isHover:!0,keyField:e.rowKey,isCurrent:!!e.rowHighlightable},t.columnConfig={},C(e.columns||[])&&(t.rowConfig.useKey=!0,t.columnConfig.useKey=!0),e.adaptive&&(t.autoResize=!0,t.height="100%"),e.columnResizable&&(t.columnConfig.resizable=!0),i&&(i.type==="radio"?t.radioConfig={highlight:!0,checkMethod({row:r}){return i.disabled?!i.disabled(r):!0},visibleMethod({row:r}){return i.shown?i.shown(r):!0},checkRowKey:i.defaultSelectedRowKeys?.[0],reserve:i.preserveSelectedRowKeys||u.isUndefined(e.dataSource)}:t.checkboxConfig={highlight:!0,checkMethod({row:r}){return i.disabled?!i.disabled(r):!0},visibleMethod({row:r}){return i.shown?i.shown(r):!0},reserve:i.preserveSelectedRowKeys||u.isUndefined(e.dataSource),range:i.range||!1}),t.border=e.bordered===!1?"inner":!0,e.expandable&&(t.expandConfig=u.omit(e.expandable,["renderContent","width","title"])),e.footer&&(t.showFooter=!0,u.isFunction(e.footer)?t.footerMethod=e.footer:t.footerData=e.footer),e.virtual===!1?(t.virtualXConfig={enabled:!1},t.virtualYConfig={enabled:!1}):(f(t,"X",e.virtual),f(t,"Y",e.virtual)),t.round=c.isDef(e.round)?e.round:!e.card,t.headerCellConfig={height:36,...t.headerCellConfig||{}},t.treeConfig&&(t.treeConfig={...t.treeConfig||{},transform:!0}),t.resizableConfig={minWidth({cell:r}){return R(r,e.size)}},t}function f(e,i,t){const n=i==="X",r=n?"x":"y",d=n?"virtualXConfig":"virtualYConfig",o=t?.[r],a=o!==!1,s=n?g:m,h=u.isNumber(o)&&o>=0?o:s;e[d]={enabled:a,gt:h,oSize:t?.oSize||0}}function y(e){return e===!0?"left":e}function v(e,i,t){const n=e===!0||!e.type?"checkbox":e.type,r=(t==="mini"?18:24)+16,d=e===!0?r:e.columnWidth||r;let o=e===!0?void 0:y(e.fixed);return o||(o===!1?o=void 0:o=i.some(a=>a.fixed==="left"||a.fixed===!0)?"left":void 0),{type:n,width:d,fixed:o}}function x(e){const i=e?.width||"auto";return{type:"expand",title:e?.title,width:i}}function l(e){if(!e)return 0;const i=getComputedStyle(e);return e.offsetWidth+(Number.parseFloat(i.marginLeft)||0)+Number.parseFloat(i.marginRight)||0}function R(e,i){if(!e)return"auto";const t=getComputedStyle(e);let n=i==="medium"?24:18;const r=(Number.parseFloat(t.fontSize)||14)*1.6;return n+=r,e.querySelector("span.anticon-question-circle")&&(n+=20),n+=l(e.querySelector(".vxe-cell--sort"))+l(e.querySelector(".vxe-cell--filter")),Math.ceil(n)}exports.getRowExpandProps=x;exports.getRowSelectionProps=v;exports.toVxeProps=b;
