"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@aplus-frontend/antdv/es/theme/internal"),v=require("clsx"),r=require("lodash-unified"),a=require("vue"),b=require("../../ap-table/utils.js");require("../../config-provider/index.js");const E=require("../../editable-table/utils.js"),A=require("../utils/editable.js"),R=require("../../config-provider/hooks/use-namespace.js"),f=(t,x)=>{const{em:g,be:q}=R.useNamespace("editable-grid"),h=a.useSlots(),[,m]=y.useToken();return a.computed(()=>{const i=t.columns;if(!i)return[];function o(N){return N.map(e=>({...e,children:o(e.children||[]),title:E.getEditableTableTitle(e,q("table-header","title"),g("header-cell","required"),h.headerCell,a.unref(m).colorTextTertiary),tooltip:void 0,customRender({value:u,originalNode:C,...n}){const s=r.isFunction(e.editable)?e.editable(n.text,n.record,n.index):!!e.editable;let d=C;if(s){const l=b.updateFormProps(e,b.getFieldProps(e.fieldProps,{value:u,...n})),c={};t.onFieldChange&&(c[`onUpdate:${l.valuePropName||"value"}`]=T=>t.onFieldChange?.(n.index,e.dataIndex,T));const F=r.isArray(e.dataIndex)?e.dataIndex:[e.dataIndex],I={name:[...r.isArray(t.name)?t.name:[t.name],n.index,...F],...l||{},field:{style:"width: 100%",...l?.field||{},...c,class:v.clsx("is-editable",l.class)}};d=A.getFinalEditableNode(e,I,n.record,a.unref(x))}return e.customRender?e.customRender({value:u,...n,editable:s,originalNode:d}):d}}))}return o(i)})};exports.default=f;exports.useGetEditableColumns=f;
