"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),h=require("@ant-design/icons-vue"),q=require("@aplus-frontend/antdv"),n=require("lodash-unified"),F=require("scroll-into-view-if-needed"),S=require("../ap-field/number/helper.js");require("../ap-form/index.js");const g=require("../ap-table/constants.js"),N=require("../ap-table/utils.js");require("../utils/index.js");const v=require("../utils/is.js"),T=require("../ap-form/item/index.vue.js");function b(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}function C(e){return g.apTableFormItemMap[e]}function V(e){if(e.markRequired)return!0;if(!e.fieldProps)return!1;const t=n.isFunction(e.fieldProps)?e.fieldProps({}):e.fieldProps;return v.isDef(t.required)?t.required:(n.isArray(t.rules)?t.rules:t.rules?[t.rules]:[]).some(o=>o.required)}function R(e,t){if(e.valueType==="text"||e.valueType==="textArea")return t||"--";if(e.valueType==="number"){const r=e.fieldProps?n.isFunction(e.fieldProps)?e.fieldProps({}):e.fieldProps:{};return S.getValueStr(t,r)||"--"}return N.objectToString(t)}function w(e,t=document.body,r={}){const o=t.querySelectorAll("tr.ant-table-row")[e];o&&F(o,{scrollMode:"if-needed",block:"nearest",behavior:"smooth",...r})}function x(e,t,r){return g.noRenderAsFormItemValueList.includes(e.valueType)?r:e.copyable||e.ellipsis?i.createVNode(q.Typography.Paragraph,{copyable:e.copyable?{text:t,tooltip:!1}:!1,ellipsis:e.ellipsis?n.isBoolean(e.ellipsis)?{tooltip:t}:{...e.ellipsis,tooltip:t}:!1,content:e.ellipsis?R(e,t):r},null):r}function P(e,t,r,o,u,s){if(t){if(e.customRenderFormItem){const a=e.customRenderFormItem(e,r.field,t,u);return i.createVNode(T.default,n.omit(r,["field"]),b(a)?a:{default:()=>[a]})}const f=C(e.valueType);if(f)return i.createVNode(f,r,null);const l=s?.[e.valueType]?.renderFormItem?.(r.field);return l?i.createVNode(T.default,r,b(l)?l:{default:()=>[l]}):null}let d;const c=N.getTableRenderType(e),p=g.apTableRenderItemMap[c];return p?d=i.createVNode(p,i.mergeProps(r.field,{mode:"read"}),null):d=s?.[c]?.render?.(o,u,r.field),d?x(e,o,d):null}function _(e,t,r,o,u){const s=o?.({title:e.title,column:e}),d=s?.filter(I=>I.type!==i.Comment)||[];if(s&&d.length>0)return s;const p=V(e),y=n.isString(e.title)?{class:t,title:e.title}:{},l=i.createVNode("div",y,[p?i.createVNode("span",{class:r},[i.createTextVNode("*")]):null,e.title]),a=e.tooltip?n.isFunction(e.tooltip)?e.tooltip(e):e.tooltip:null;return a?i.createVNode("span",{style:{display:"inline-flex",alignItems:"center",maxWidth:"100%"}},[l,i.createVNode(q.Tooltip,{title:a,placement:"bottom"},{default:()=>[i.createVNode(h.QuestionCircleOutlined,{style:{padding:"4px",color:u,verticalAlign:"middle"}},null)]})]):l}exports.getColumnIsRequired=V;exports.getEditableComponent=C;exports.getEditableTableTitle=_;exports.getFinalNode=P;exports.getRawDisplayValue=R;exports.scrollToRowIndex=w;
