UNPKG

ll-package

Version:

2 lines (1 loc) 2.89 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("./form.js");require("../style/form.less.js");require("../../../../node_modules/ant-design-vue/es/form/index.js");const k=require("../../../../node_modules/ant-design-vue/es/form/Form.js"),y=require("../../../../node_modules/ant-design-vue/es/form/FormItem.js"),b=require("../../../../node_modules/ant-design-vue/es/theme/index.js"),w=require("../../../../node_modules/lodash-es/omit.js"),x=require("../../../../node_modules/ant-design-vue/es/row/index.js"),B=require("../../../../node_modules/ant-design-vue/es/col/index.js"),q={class:"ll-form-container"},F={key:0,class:"ll-form-group-tooltip-warpper"},N=e.defineComponent({name:"LlForm"}),V=e.defineComponent({...N,props:h.llFormProps,setup(d,{expose:f}){e.useCssVars(r=>({c563c46a:C.value}));const s=d,l=e.reactive(s.formData),n=e.ref(),{defaultSeed:i}=b.default,C=e.computed(()=>`${i.controlHeight}px`),g=async()=>await n.value.validateFields(),m=async()=>await n.value.resetFields(),u=r=>{let c={...r};return w.default(c,["label"])},v=(r={})=>s.formOptions.layout==="horizontal"?r.labelCol&&Number(r.labelCol.span)>=24?"label-top":"label-left":"label-top";return f({validate:g,resetFields:m}),(r,c)=>{const _=e.resolveComponent("ll-tooltip");return e.openBlock(),e.createElementBlock("div",q,[e.createVNode(e.unref(k.default),e.mergeProps({ref_key:"formRef",ref:n},r.formOptions,{model:l}),{default:e.withCtx(()=>[e.createVNode(e.unref(x.default),e.normalizeProps(e.guardReactiveProps(r.rowOptions)),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.formCols,(o,a)=>(e.openBlock(),e.createBlock(e.unref(B.default),{key:a,span:(o==null?void 0:o.spanCol)??24},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"formItem",{item:o},()=>[e.createVNode(e.unref(y.default),e.mergeProps({name:(o==null?void 0:o.key)??a,class:v(o)},u(o)),{label:e.withCtx(()=>{var t,p;return[e.createElementVNode("span",null,e.toDisplayString(o.label),1),o!=null&&o.tip?(e.openBlock(),e.createElementBlock("span",F,[e.createVNode(_,{style:{"margin-left":"8px"},extraOption:{overlayClassName:"ll-form-group-tooltip"},"max-width":((t=o==null?void 0:o.tipConfig)==null?void 0:t.maxWidth)??406,placement:((p=o==null?void 0:o.tipConfig)==null?void 0:p.placement)??"top",tip:o.tip,"font-size":"16px"},null,8,["max-width","placement","tip"])])):e.createCommentVNode("",!0)]}),default:e.withCtx(()=>[e.renderSlot(r.$slots,"content",{item:o,index:a},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(`ll-${o.type}`),e.mergeProps({value:l[o.key],"onUpdate:value":t=>l[o.key]=t},u(o),{onChange:o.change}),null,16,["value","onUpdate:value","onChange"]))],!0)]),_:2},1040,["name","class"])],!0)]),_:2},1032,["span"]))),128))]),_:3},16)]),_:3},16,["model"])])}}});exports.default=V;