@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1 lines • 89.5 kB
JavaScript
(function(O,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("../../components/dynamic-form/index.umd.js"),require("../../components/dynamic-resolver/index.umd.js"),require("vue"),require("../../components/designer-canvas/index.umd.js"),require("../../components/common/index.umd.js"),require("../../components/property-panel/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../../components/designer/index.umd.js"),require("lodash-es"),require("../../components/dynamic-view/index.umd.js"),require("../../components/locale/index.umd.js"),require("../../components/section/index.umd.js"),require("../../components/accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../approval-logs/index.umd.js"),require("../button-edit/index.umd.js"),require("../../components/button-group/index.umd.js"),require("../../components/button/index.umd.js"),require("../../components/calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../checkbox/index.umd.js"),require("../checkbox-group/index.umd.js"),require("../../components/color-picker/index.umd.js"),require("../../components/combo-list/index.umd.js"),require("../../components/content-container/index.umd.js"),require("../../components/table/index.umd.js"),require("../data-grid/index.umd.js"),require("../date-picker/index.umd.js"),require("../../components/dropdown/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../../components/external-container/index.umd.js"),require("../../components/filter-bar/index.umd.js"),require("../../components/image-cropper/index.umd.js"),require("../input-group/index.umd.js"),require("../../components/layout/index.umd.js"),require("../../components/list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../../components/lookup/index.umd.js"),require("../../components/language-textbox/index.umd.js"),require("../nav/index.umd.js"),require("../number-spinner/index.umd.js"),require("../../components/number-range/index.umd.js"),require("../../components/order/index.umd.js"),require("../../components/page-header/index.umd.js"),require("../../components/page-footer/index.umd.js"),require("../../components/pagination/index.umd.js"),require("../../components/progress/index.umd.js"),require("../../components/query-solution/index.umd.js"),require("../radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../../components/response-layout/index.umd.js"),require("../../components/search-box/index.umd.js"),require("../section/index.umd.js"),require("../../components/smoke-detector/index.umd.js"),require("../../components/splitter/index.umd.js"),require("../../components/step/index.umd.js"),require("../switch/index.umd.js"),require("../tabs/index.umd.js"),require("../tags/index.umd.js"),require("../../components/text/index.umd.js"),require("../time-picker/index.umd.js"),require("../../components/transfer/index.umd.js"),require("../../components/tree-view/index.umd.js"),require("../../components/uploader/index.umd.js"),require("../../components/verify-detail/index.umd.js"),require("../../components/component/index.umd.js"),require("../../components/video/index.umd.js"),require("../textarea/index.umd.js"),require("../tree-grid/index.umd.js"),require("../../components/fieldset/index.umd.js"),require("../drawer/index.umd.js"),require("../../components/html-template/index.umd.js"),require("../../components/image/index.umd.js"),require("../../components/comment/index.umd.js"),require("../wizard/index.umd.js"),require("../../components/combo-tree/index.umd.js"),require("../../components/events-editor/index.umd.js"),require("../../components/field-selector/index.umd.js"),require("../../components/binding-selector/index.umd.js"),require("../../components/mapping-editor/index.umd.js"),require("../../components/schema-selector/index.umd.js"),require("../../components/event-parameter/index.umd.js"),require("../../components/filter-condition-editor/index.umd.js"),require("../../components/sort-condition-editor/index.umd.js"),require("../../components/menu-lookup/index.umd.js"),require("../../components/json-editor/index.umd.js"),require("../../components/property-editor/index.umd.js"),require("../../components/expression-editor/index.umd.js"),require("../../components/code-editor/index.umd.js"),require("../../components/collection-property-editor/index.umd.js"),require("../modal/index.umd.js"),require("../../components/tooltip/index.umd.js"),require("../../components/message-box/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","../../components/dynamic-form/index.umd.js","../../components/dynamic-resolver/index.umd.js","vue","../../components/designer-canvas/index.umd.js","../../components/common/index.umd.js","../../components/property-panel/index.umd.js","../response-layout-editor/index.umd.js","../../components/designer/index.umd.js","lodash-es","../../components/dynamic-view/index.umd.js","../../components/locale/index.umd.js","../../components/section/index.umd.js","../../components/accordion/index.umd.js","../avatar/index.umd.js","../approval-logs/index.umd.js","../button-edit/index.umd.js","../../components/button-group/index.umd.js","../../components/button/index.umd.js","../../components/calendar/index.umd.js","../capsule/index.umd.js","../checkbox/index.umd.js","../checkbox-group/index.umd.js","../../components/color-picker/index.umd.js","../../components/combo-list/index.umd.js","../../components/content-container/index.umd.js","../../components/table/index.umd.js","../data-grid/index.umd.js","../date-picker/index.umd.js","../../components/dropdown/index.umd.js","../dynamic-form/index.umd.js","../../components/external-container/index.umd.js","../../components/filter-bar/index.umd.js","../../components/image-cropper/index.umd.js","../input-group/index.umd.js","../../components/layout/index.umd.js","../../components/list-nav/index.umd.js","../list-view/index.umd.js","../../components/lookup/index.umd.js","../../components/language-textbox/index.umd.js","../nav/index.umd.js","../number-spinner/index.umd.js","../../components/number-range/index.umd.js","../../components/order/index.umd.js","../../components/page-header/index.umd.js","../../components/page-footer/index.umd.js","../../components/pagination/index.umd.js","../../components/progress/index.umd.js","../../components/query-solution/index.umd.js","../radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../../components/response-layout/index.umd.js","../../components/search-box/index.umd.js","../section/index.umd.js","../../components/smoke-detector/index.umd.js","../../components/splitter/index.umd.js","../../components/step/index.umd.js","../switch/index.umd.js","../tabs/index.umd.js","../tags/index.umd.js","../../components/text/index.umd.js","../time-picker/index.umd.js","../../components/transfer/index.umd.js","../../components/tree-view/index.umd.js","../../components/uploader/index.umd.js","../../components/verify-detail/index.umd.js","../../components/component/index.umd.js","../../components/video/index.umd.js","../textarea/index.umd.js","../tree-grid/index.umd.js","../../components/fieldset/index.umd.js","../drawer/index.umd.js","../../components/html-template/index.umd.js","../../components/image/index.umd.js","../../components/comment/index.umd.js","../wizard/index.umd.js","../../components/combo-tree/index.umd.js","../../components/events-editor/index.umd.js","../../components/field-selector/index.umd.js","../../components/binding-selector/index.umd.js","../../components/mapping-editor/index.umd.js","../../components/schema-selector/index.umd.js","../../components/event-parameter/index.umd.js","../../components/filter-condition-editor/index.umd.js","../../components/sort-condition-editor/index.umd.js","../../components/menu-lookup/index.umd.js","../../components/json-editor/index.umd.js","../../components/property-editor/index.umd.js","../../components/expression-editor/index.umd.js","../../components/code-editor/index.umd.js","../../components/collection-property-editor/index.umd.js","../modal/index.umd.js","../../components/tooltip/index.umd.js","../../components/message-box/index.umd.js"],W):(O=typeof globalThis<"u"?globalThis:O||self,W(O["dynamic-form"]={},O.dynamicForm,O.dynamicResolver,O.Vue,O.designerCanvas,O.common,O.propertyPanel,O.FResponseLayoutEditorSetting,O.designer,O.LodashES,O.dynamicView,O.locale,O.FSection,null,null,null,null,null,null,null,null,null,null,null,O.FComboList,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,O.messageBox))})(this,function(O,W,ee,i,c,Y,se,Ae,ke,ue,ae,Se,Ue,ln,sn,an,cn,dn,un,pn,mn,fn,yn,gn,Fe,bn,hn,Cn,Fn,xn,vn,jn,Tn,kn,wn,Dn,Vn,Pn,In,Nn,qn,Bn,Mn,En,$n,Rn,Ln,On,An,Sn,Un,Gn,zn,Zn,Wn,_n,Jn,Qn,Xn,Yn,Hn,Kn,eo,to,no,oo,ro,io,lo,so,ao,co,uo,po,mo,fo,yo,go,bo,ho,Co,Fo,xo,vo,jo,To,ko,wo,Do,Vo,Po,Io,No,qo,Ge){"use strict";var on=Object.defineProperty;var rn=(O,W,ee)=>W in O?on(O,W,{enumerable:!0,configurable:!0,writable:!0,value:ee}):O[W]=ee;var Ce=(O,W,ee)=>rn(O,typeof W!="symbol"?W+"":W,ee);function ze(e,t){function n(b,a=null){if(a)return a;const h=e.getComponentById(t);return e.selectNode(h,l=>l.id===b)}function o(b){const a=e.getComponentById(b);return!(!a||!a.componentType||!a.componentType.startsWith("form"))}function r(b){const a=new Set(b);return Array.from(a).length===1}function p(b){const a=n(b.id),h=Ae.useResponseLayoutEditorSetting(e),l=[];h.getResonseFormLayoutConfig(a,l,1);const f=l.map(L=>L.columnInSM),F=l.map(L=>L.columnInMD),d=l.map(L=>L.columnInLG),y=l.map(L=>L.columnInEL),v=r(f)?f[0]:0,j=r(F)?F[0]:0,T=r(d)?d[0]:0,R=r(y)?y[0]:0;return{uniqueColClassInSM:v,uniqueColClassInMD:j,uniqueColClassInLG:T,uniqueColClassInEL:R}}function m(b,a){let h,l,f,F,d=[];if(b){const L=b.split(" "),U=L.filter(q=>q.startsWith("col-"));h=U.find(q=>/^col-([1-9]|10|11|12)$/.test(q)),l=U.find(q=>/^col-md-([1-9]|10|11|12)$/.test(q)),f=U.find(q=>/^col-xl-([1-9]|10|11|12)$/.test(q)),F=U.find(q=>/^col-el-([1-9]|10|11|12)$/.test(q)),d=L.filter(q=>!q.startsWith("col-"))}const y=a.uniqueColClassInSM?"col-"+a.uniqueColClassInSM:h,v=a.uniqueColClassInMD?"col-md-"+a.uniqueColClassInMD:l,j=a.uniqueColClassInLG?"col-xl-"+a.uniqueColClassInLG:f,T=a.uniqueColClassInEL?"col-el-"+a.uniqueColClassInEL:F;return[y,v,j,T].concat(d).join(" ")}function C(b,a,h){b=n(h,b),b.contents.forEach(l=>{if(l.type===c.DgControl["dynamic-form"].type)return;if(l.type===c.DgControl.fieldset.type){C(l,a,l.id);return}l.appearance||(l.appearance={});const f=l.appearance.class;l.appearance.class=m(f,a)})}return{checkIsInFormComponent:o,assembleUnifiedLayoutContext:p,changeFormControlsByUnifiedLayoutConfig:C,changeControlClassInByColumn:m}}class we extends se.BaseControlProperty{constructor(t,n){super(t,n)}getBaseFormAppearanceConfig(t,n,o){const r=this,{assembleUnifiedLayoutContext:p,changeFormControlsByUnifiedLayoutConfig:m,changeControlClassInByColumn:C}=ze(this.formSchemaUtils,this.componentId),b=this.getAppearanceConfig(n);return b.properties.adaptForLanguage={title:"控件布局响应国际化",description:"启用国际化后:简体中文、繁体中文环境下控件标签与输入框在一行展示,其他语言环境下控件标签与输入框上下排列。",type:"boolean"},b.properties.labelAutoOverflow={title:"控件标签换行",description:"控件标签字数超长时,换行显示。控件标签与输入框在一行展示时,此属性有效。",type:"boolean"},b.properties.unifiedLayout={title:"统一布局配置",description:"统一配置卡片区域内所有控件的宽度,只支持标准模式",refreshPanelAfterChanged:!0,editor:{type:"response-form-layout-setting",initialState:p(n)}},b.setPropertyRelates=function(a,h){if(a)switch(a&&a.propertyID){case"unifiedLayout":{n.layout=C("",a.propertyValue),t==="dynamic"?n.layout=C("",a.propertyValue):(m(null,a.propertyValue,n.id),r.updateElementByParentContainer(n.id,o));break}case"labelAutoOverflow":{r.setLabelAutoOverflow(n,a.propertyValue),c.refreshCanvas();break}}},b}getBaseFormBehaviorConfig(t,n){const o=this,r=this.getPropertyEditorParams(n,["Variable","Custom"],"fields",{},{newVariablePrefix:"",newVariableType:"Array"}),p=this.getPropertyEditorParams(n,["Variable","Custom"],"formData",{},{newVariablePrefix:"",newVariableType:"Object"});let m={};return t==="dynamic"&&(m={fields:{title:"动态控件列表",type:"string",description:"动态控件列表",editor:r},formData:{title:"动态控件列表初始值",type:"string",description:"动态控件列表初始值",editor:p},mode:{description:"两种方式,快速模式下,控件属性写法支持组件的属性,可以直接写回调和事件,比如onClick: () => {}。完整模式下,控件属性写法与设计时schema一致。",title:"渲染模式",type:"enum",editor:{default:"quick",readonly:!0,data:[{id:"quick",name:"快速模式"},{id:"full",name:"完整模式"}]}}}),this.getBehaviorConfig(n,"",m,(C,b)=>{switch(C.propertyID){case"fields":case"formData":o.afterMutilEditorChanged(n,C);break}})}setLabelAutoOverflow(t,n,o){if(!o){const r=this.formSchemaUtils.getComponentById(this.componentId);o=this.formSchemaUtils.selectNode(r,p=>p.id===t.id)}o&&o.contents&&o.contents.length&&o.contents.forEach(r=>{if(r.type===c.DgControl.fieldset.type){this.setLabelAutoOverflow(null,n,r);return}r.appearance||(r.appearance={class:""}),r.appearance.class||(r.appearance.class=""),n?r.appearance.class.includes("farris-group-multi-label")||(r.appearance.class=r.appearance.class+" farris-group-multi-label"):r.appearance.class=r.appearance.class.replace("farris-group-multi-label","").trim()})}}class Ze extends we{constructor(t,n){super(t,n)}getPropertyConfig(t,n){return this.propertyConfig.categories.basic=this.getBasicPropConfig(t),this.propertyConfig.categories.appearance=this.getBaseFormAppearanceConfig("default",t,n),this.propertyConfig.categories.behavior=this.getBaseFormBehaviorConfig("default",t),this.propertyConfig}}function We(e,t){const n=e.schema,o=new c.UseTemplateDragAndDropRules,{canMove:r,canAccept:p,canDelete:m}=o.getTemplateRule(e,t);function C(u,g){const{sourceElement:x}=u,{componentInstance:w}=x,D=t==null?void 0:t.formSchemaUtils;if(!D)return!0;const M=D.getComponentById(w.value.belongedComponentId),$=D.getViewModelById(M.viewModel),V=D.getComponentById(e.componentInstance.value.belongedComponentId),k=D.getViewModelById(V.viewModel);return g?$!=null&&$.id&&(k!=null&&k.id)&&$.id!==k.id?$.bindTo===k.bindTo:!0:($==null?void 0:$.id)===(k==null?void 0:k.id)}function b(u){const{bindingTargetId:g}=u;if(!t)return;const{formSchemaUtils:x,schemaService:w}=t,D=x.getComponentById(e.componentInstance.value.belongedComponentId),M=w.getFieldByIDAndVMID(g,D.viewModel);return!!(M!=null&&M.schemaField)}function a(u){const g=o.getComponentContext(e);if(g&&g.componentClassList&&g.componentClassList.includes("f-form-layout")&&g.componentClassList.includes("farris-form")){if(u.sourceType==="control"&&(u.componentCategory==="input"||u.componentType&&["fieldset","dynamic-form"].indexOf(u.componentType)>-1))return!0;if(u.sourceType==="move"){if(u.componentType==="form-group")return C(u,!0);if(u.componentType==="fieldset")return C(u,!1);if(u.componentType==="dynamic-form")return!0}return u.sourceType==="field"&&u.componentCategory==="input"?b(u):!1}return!0}function h(u){return!(!c.useDragulaCommonRule().basalDragulaRuleForContainer(u,t)||!p||!a(u))}function l(u){var k;const g=u.componentInstance,x=g.value.schema,w=t==null?void 0:t.formSchemaUtils,D=t==null?void 0:t.designViewModelUtils,M=w.getViewModelIdByComponentId(g.value.belongedComponentId),$=D.getDgViewModel(M),V=g.value.parent;if(V&&c.DgControl.fieldset&&((k=V.schema)==null?void 0:k.type)===c.DgControl.fieldset.type&&$){const A={groupId:null,groupName:null};switch(x.binding.type){case se.FormBindingType.Form:{$.changeField(x.binding.field,A);break}case se.FormBindingType.Variable:{w.modifyViewModelFieldById(M,x.binding.field,A,!0);break}}}}function f(u,g,x){const w=g.fields.find(k=>k.id===u),D=t==null?void 0:t.designViewModelUtils,M=D.getDgViewModel(g.id),$=M.fields.find(k=>k.id===u);M.removeField([u]);const V=D.getDgViewModel(x);V.addField($),w.fieldSchema&&V.changeField($.id,w.fieldSchema)}function F(u,g,x,w=[]){const D=g.id,M=u.binding.field,$=g.fields.findIndex(k=>k.id===M);if($>-1&&(x.fields.push(g.fields[$]),g.fields.splice($,1)),D==="root-viewmodel"&&x.id!=="root-viewmodel"){u.binding.path&&!u.binding.path.includes("root-component.")&&(u.binding.path="root-component."+u.binding.path);return}if(x.id==="root-viewmodel"&&D!=="root-viewmodel"&&u.binding.path&&u.binding.path.includes("root-component.")){u.binding.path=u.binding.path.replace("root-component.","");return}const V=g.states.find(k=>k.id===M);V&&(x.states=x.states?x.states:[],x.states.findIndex(k=>k.id===V.id)<0&&(x.states.push(V),w.push(V.id)))}function d(u,g,x,w=[]){var $;if(!u)return;const D=g.id==="root-viewmodel"&&x.id!=="root-viewmodel",M=x.id==="root-viewmodel"&&g.id!=="root-viewmodel";Object.keys(u).forEach(V=>{if(V==="binding")return;const k=u[V];if(k&&typeof k=="object"&&k.type===se.FormBindingType.Variable&&k.field){if(D){k.path&&!k.path.includes("root-component.")&&(k.path="root-component."+k.path);return}if(M&&k.path&&k.path.includes("root-component.")){k.path=k.path.replace("root-component.","");return}const A=g.states.find(G=>G.id===k.field);if(A){w.push(A.id),x.states=x.states?x.states:[];const G=x.states.find(S=>S.code===A.code);if(G)k.field=G.id;else{const S=Object.assign({},{newId:Y.useGuid().guid()},A);x.states.push(S),k.field=S.newId}}}}),($=x.states)!=null&&$.length&&x.states.map(V=>{V.newId&&(V.id=V.newId,delete V.newId)})}function y(u,g,x){if(u&&(g(u,x),u.contents))for(const w of u.contents)y(w,g,x)}function v(u=[],g){if(!u.length)return;const x=t==null?void 0:t.formSchemaUtils,w=x.getComponentByViewModelId(g),D=[],M=(V,k)=>{V&&(Object.keys(V).forEach(A=>{const G=V[A];G&&typeof G=="object"&&G.type===se.FormBindingType.Variable&&u.includes(G.field)&&!k.includes(G.field)&&k.push(G.field)}),V.editor&&M(V.editor,k))};y(w,M,D);const $=x.getViewModelById(g);u.forEach(V=>{D.includes(V)||($.states=$.states.filter(k=>k.id!==V))})}function j(u){const g=Y.useGuid().guid(),x=Object.assign({},u,{id:g,code:u.code+g.slice(0,4),name:u.name+g.slice(0,4)}),M=(t==null?void 0:t.formSchemaUtils).getCommands().find($=>$.id===u.cmpId);return M&&M.refedHandlers.push({host:g,handler:u.handlerName}),x}function T(u,g,x){var A,G;const w={},M=(t==null?void 0:t.formSchemaUtils).resolveComponentEvents(ee.schemaMap,u);if(!M)return;Object.keys(u).forEach(S=>{const Z=Object.keys(M).find(ne=>ne===S);if(Z&&u[Z]){const ne=g.commands.find(K=>K.code===u[Z]);if(ne){let K=w[ne.code];K||(K=j(ne),w[ne.code]=K,x.commands.push(K)),u[Z]=K.code}}});const V=(t==null?void 0:t.designViewModelUtils).getDgViewModel(x.id),k=["valueChanging","valueChanged"];if(((A=u.binding)==null?void 0:A.type)===se.FormBindingType.Form){const S=(G=x.fields)==null?void 0:G.find(Z=>Z.id===u.binding.field);S&&k.forEach(Z=>{if(S[Z]){const ne=g.commands.find(K=>K.code===S[Z]);if(!ne)return;if(w[ne.code])V.changeField(S.id,{[Z]:w[ne.code].code});else{const K=j(ne);w[ne.code]=K,x.commands.push(K),V.changeField(S.id,{[Z]:K.code})}}})}}function R(u){var k,A;const g=t==null?void 0:t.formSchemaUtils,x=u.componentInstance,w=x.value.schema,D=g.getViewModelIdByComponentId(x.value.belongedComponentId),M=g.getViewModelById(D),$=g.getComponentById(e.componentInstance.value.belongedComponentId),V=g.getViewModelById($.viewModel);if(D!==V.id){const G=(k=w.binding)==null?void 0:k.type,S=(A=w.binding)==null?void 0:A.field,Z=[];switch(G){case se.FormBindingType.Form:{f(S,M,V.id);break}case se.FormBindingType.Variable:{F(w,M,V,Z);break}}d(w,M,V,Z),d(w.editor,M,V,Z),T(w,M,V),D!=="root-viewmodel"&&v(Z,D)}}function L(u){var w;if(!u||!u.componentInstance)return;const x=u.componentInstance.value.schema;if(x.type==="dynamic-form"){const D=((w=x==null?void 0:x.appearance)==null?void 0:w.class)||"";D.indexOf("col-12")<0&&(x.appearance={...x.appearance,class:D+" col-12 px-0"}),R(u);return}!x.binding||!x.binding.field||(l(u),R(u))}function U(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function q(u){let g="";switch(u){case 1:{g="col-12 col-md-12 col-xl-12 col-el-12";break}case 2:{g="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{g="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{g="col-12 col-md-6 col-xl-3 col-el-2";break}}return g}function te(u,g){let x=!1;if(e.schema&&Object.prototype.hasOwnProperty.call(e.schema,"labelAutoOverflow"))x=e.schema.labelAutoOverflow;else{const w=t==null?void 0:t.formSchemaUtils,D=w==null?void 0:w.selectNode(g,M=>M.type===c.DgControl["response-form"].type);D&&(x=D.labelAutoOverflow)}return x&&(u+=" farris-group-multi-label"),u}function J(u){const g=e.componentInstance.value.getBelongedComponentInstance(e.componentInstance);if(g&&g.schema&&g.schema.componentType){const{formColumns:x}=g.schema;let w=q(x);w=t==null?void 0:t.formSchemaUtils.getControlClassByFormUnifiedLayout(w,g.schema.id,e.schema),w=te(w,g.schema),u.appearance||(u.appearance={}),u.appearance.class=w}}function B(u,g,x,w){const{bindingSourceContext:D,parentComponentInstance:M}=u;if(D!=null&&D.entityFieldNode&&M){const $=t==null?void 0:t.designViewModelUtils,k=(t==null?void 0:t.formSchemaUtils).getViewModelIdByComponentId(M.belongedComponentId),A=$.getDgViewModel(k);A.removeField([D.entityFieldNode.id]),A.addField(D.designViewModelField),g&&A.changeField(D.entityFieldNode.id,{editor:{$type:g},groupId:x,groupName:w})}}function N(u,g){var M,$,V;const x=n;if((x.appearance&&x.appearance.class||"").split(" ").includes("f-form-layout")&&u.componentCategory==="input"){const{label:k}=u;let A;const G=t==null?void 0:t.controlCreatorUtils;return(M=u.bindingSourceContext)!=null&&M.entityFieldNode?A=G.setFormFieldProperty(($=u.bindingSourceContext)==null?void 0:$.entityFieldNode,g==null?void 0:g.type):(A=G.createFormGroupWithoutField(g==null?void 0:g.type),A.label=k),J(A),B(u,(V=A.editor)==null?void 0:V.type),A}return u.componentType==="dynamic-form"&&(g.appearance={class:"col-12",...g.appearance}),g}function Q(){return r}function H(){return m}function oe(){var u,g;return!!((g=(u=n.appearance)==null?void 0:u.class)!=null&&g.includes("f-form-is-table"))}function X(u){return new Ze(u,t).getPropertyConfig(n,e.componentInstance.value)}return{canAccepts:h,checkCanDeleteComponent:H,checkCanMoveComponent:Q,getStyles:U,getPropsConfig:X,hideNestedPaddingInDesginerView:oe,onAcceptMovedChildElement:L,onResolveNewComponentSchema:N,moveInputBetweenComponent:R,resolveFormGroupAppearance:J,syncFieldToViewModel:B}}const _e="root-viewmodel";class Je{constructor(t,n){Ce(this,"formSchemaUtils");Ce(this,"controlCreatorUtils");Ce(this,"designViewModelUtils");this.resolver=t,this.designerHostService=n,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(t){const n=this.createComponentRefNode(t),o=this.createComponentNode(t),r=this.createViewModeNode(t),p=this.formSchemaUtils.getFormSchema();return p.module.viewmodels.push(r),p.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),n}createComponentRefNode(t){const n=this.resolver.getSchemaByType("component-ref");return Object.assign(n,{id:`${t.componentId}-component-ref`,component:`${t.componentId}-component`}),n}createComponentNode(t){const n=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(t);return Object.assign(n,{id:`${t.componentId}-component`,viewModel:`${t.componentId}-component-viewmodel`,componentType:t.componentType,appearance:{class:this.getFormComponentClass(t)},formColumns:t.formColumns,contents:o}),n}getFormComponentClass(t){var o,r;const{templateId:n}=this.formSchemaUtils.getFormSchema().module;if(n==="double-list-in-tab-template"&&((r=(o=t.parentComponentInstance)==null?void 0:o.schema)==null?void 0:r.type)==="tab-page"){const p=t.parentComponentInstance.parent&&t.parentComponentInstance.parent.schema;if((p==null?void 0:p.type)==="tabs"&&(p==null?void 0:p.fill)===!0)return"f-struct-wrapper f-utils-fill-flex-column"}return"f-struct-wrapper"}createFormComponentContents(t){var C,b;const n=this.resolver.getSchemaByType("section");Object.assign(n,{id:t.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:t.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:t.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r,controlsInline:!0}),n.contents=[o];const{selectedFields:p}=t;p==null||p.forEach(a=>{if(a.$type===Y.FormSchemaEntityField$Type.SimpleField){const h=ue.cloneDeep(a),l=this.resolveControlClassByFormColumns(t),f=this.controlCreatorUtils.setFormFieldProperty(h,"",l);f&&r.push(f)}});const{templateId:m}=this.formSchemaUtils.getFormSchema().module;if(m==="double-list-in-tab-template"&&((b=(C=t.parentComponentInstance)==null?void 0:C.schema)==null?void 0:b.type)==="tab-page"){const a=t.parentComponentInstance.parent&&t.parentComponentInstance.parent.schema;(a==null?void 0:a.type)==="tabs"&&(a==null?void 0:a.fill)===!0&&(n.appearance.class="f-section-grid f-section-in-main px-0 pt-0",n.fill=!0)}return[n]}resolveControlClassByFormColumns(t){let n="";switch(t.formColumns){case 1:{n="col-12 col-md-12 col-xl-12 col-el-12";break}case 2:{n="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{n="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{n="col-12 col-md-6 col-xl-3 col-el-2";break}}return n}createViewModeNode(t){return{id:`${t.componentId}-component-viewmodel`,code:`${t.componentId}-component-viewmodel`,name:t.componentName,bindTo:t.bindTo,parent:_e,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const n=[],{selectedFields:o}=t;return o==null||o.forEach(r=>{if(r.$type===Y.FormSchemaEntityField$Type.SimpleField){let p="blur";const m=r.type.name;(m===Y.FormSchemaEntityFieldTypeName.Enum||m===Y.FormSchemaEntityFieldTypeName.Boolean)&&(p="change"),n.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:p,fieldSchema:{}})}}),n}}function ve(e,t,n,o){var p,m,C,b,a,h;const r=n.parentComponentInstance;if(r&&o){const l=(p=r.schema)==null?void 0:p.type,F={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((m=n.bindingSourceContext)==null?void 0:m.entityTitle)||((b=(C=n.bindingSourceContext)==null?void 0:C.bindingEntity)==null?void 0:b.name)||"标题",componentType:"form",formColumns:l==="splitter-pane"?1:4,parentContainerId:r.schema.id,parentComponentInstance:r,bindTo:((a=n.bindingSourceContext)==null?void 0:a.bindTo)||"/",selectedFields:(h=n.bindingSourceContext)==null?void 0:h.bindingEntityFields};return new Je(e,o).createComponent(F)}else return t}function Qe(e,t,n){return t}function Xe(e,t,n,o){return t.layout="col-12 col-md-6 col-xl-3 col-el-2",t}const fe=new Map([["appearance",ee.resolveAppearance]]),Ye=new Map([]),De={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"}},required:["id","type","contents"]},Ve={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dynamic-form.schema.json",title:"dynamic-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"dynamic-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"},headerTitleRenderFunction:{description:"",type:"function",default:null},headerContentRenderFunction:{description:"",type:"function",default:null},footerRenderFunction:{description:"",type:"function",default:null},mode:{description:"",type:"string",default:"quick"},footerStyle:{description:"",type:"string",default:""},headerStyle:{description:"",type:"string",default:""},toolbar:{description:"",type:"array",default:[]},moreButtonClass:{description:"",type:"string",default:"btn-link"},onClick:{description:"",type:"string",default:""},onChange:{description:"",type:"string"},callback:{description:"",type:"string"}},required:["id","type","contents"],events:{onClick:"点击事件",onChange:"ֵ值变化事件",event:"内部控件事件",callback:"内部控件属性回调事件"}};var be=(e=>(e.Header="header",e.Footer="footer",e))(be||{}),xe=(e=>(e.QUICK="quick",e.FULL="full",e))(xe||{});const ye={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0},fields:{type:Array,default:[]},formData:{type:Object,default:null},layout:{type:String,default:"col-12 col-md-6 col-xl-3 col-el-2"}},Pe=Object.assign({},ye,{canRenderForm:{type:Boolean,default:!0},callback:{type:Function},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!1},headerTitleRenderFunction:{type:Function},headerContentRenderFunction:{type:Function},footerRenderFunction:{type:Function},showFooter:{type:Boolean,default:!1},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},enableAccordion:{type:Boolean,default:!0},mode:{type:String,default:xe.QUICK},toolbar:{type:[Array,Function],default:[]},headerStyle:{type:[String,Function],default:""},footerStyle:{type:[String,Function],default:""},moreButtonClass:{type:String,default:"btn-link"}}),He=ee.createPropsResolver(ye,De,fe,ve),Ke=ee.createPropsResolver(ye,Ve,fe,ve),Ie=Object.assign({},ye,{componentId:{type:String,default:""},fields:{type:[Object,String]}});Object.assign({},Pe,{componentId:{type:String,default:""}});const et=ke.createPropsResolver(ye,De,fe,ve),tt=ke.createPropsResolver(ye,Ve,fe,Xe),he=i.defineComponent({name:"FResponseFormDesign",directives:{"area-response":Y.areaResponseDirective},props:Ie,emits:[],setup(e,t){const n=i.ref(),o=i.inject("design-item-context"),r=i.inject("designer-host-service"),p=We(o,r),m=c.useDesignerComponent(n,o,p);i.onMounted(()=>{n.value.componentInstance=m}),t.expose(m.value);const C=i.computed(()=>{const a={"drag-container":!0};return Y.getCustomClass(a,e.customClass)});function b(){return typeof e.fields=="string"&&e.fields||e.fields&&e.fields.path?i.createVNode("div",{class:"no-drag w-100 col-12",style:"height: 50px;display: flex;justify-content: center;align-items: center;overflow: hidden;margin-bottom: 0;color: #315585; background-color: #dfedff; border-color: #d2e6ff;"},[i.createTextVNode("动态表单")]):null}return()=>i.withDirectives(i.createVNode("div",{ref:n,class:C.value,style:e.customClass,"data-dragref":`${o.schema.id}-container`,"data-associate":`${o.schema.id}-component`},[t.slots.default&&t.slots.default(),b()]),[[i.resolveDirective("area-response")]])}});class nt extends we{constructor(t,n){super(t,n)}getPropertyConfig(t,n){return this.propertyConfig.categories.basic=this.getBasicPropConfig(t),this.propertyConfig.categories.appearance=this.getBaseFormAppearanceConfig("dynamic",t,n),this.propertyConfig.categories.behavior=this.getBaseFormBehaviorConfig("dynamic",t),this.propertyConfig.categories.eventsEditor=this.getEventPropConfig(t),this.propertyConfig}getEventPropConfig(t){const n=[{label:"onChange",name:"ֵ值变化事件"},{label:"event",name:"内部控件事件"}],o=this,r=o.eventsEditorUtils.formProperties(t,o.viewModelId,n);return{title:"事件",hideTitle:!0,properties:o.createBaseEventProperty(r),refreshPanelAfterChanged:!0,tabId:Y.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(m,C){const b=m.propertyValue;delete t[o.viewModelId],b&&(b.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(t,o.viewModelId,b.events,b)),t.remoteSort=!!t.columnSorted}}}}function ot(e,t){function n(m){const C=e.schema;return new nt(m,t).getPropertyConfig(C,e.componentInstance.value)}function o(){return!1}function r(){return!0}function p(){return!0}return{getPropsConfig:n,canAccepts:o,checkCanDeleteComponent:r,checkCanMoveComponent:p}}const rt=i.defineComponent({name:"FDynamicFormDesign",props:Ie,emits:[],setup(e,t){const n=i.ref(),o=i.inject("design-item-context"),r=i.inject("designer-host-service"),p=ot(o,r),m=c.useDesignerComponent(n,o,p);i.onMounted(()=>{n.value.componentInstance=m}),t.expose(m.value);const C=i.computed(()=>{const b={"drag-container":!0};return Y.getCustomClass(b,e.customClass)});return()=>i.createVNode("div",{ref:n,class:C.value,style:e.customStyle},[i.createVNode("div",{class:"no-drag w-100",style:"height: 50px;display: flex;justify-content: center;align-items: center;overflow: hidden;margin-bottom: 0;color: #315585; background-color: #dfedff; border-color: #d2e6ff;"},[i.createTextVNode("动态表单")])])}});function it(e,t){function n(m){return e.value&&e.value[m]}const o=[];function r(m){o.push(m)}function p(m,C,b){const a=e.value?e.value[m]:void 0;e.value&&(e.value[m]=b),C&&(t&&(t.emit("update:modelValue",{elementId:m,field:C,value:b,modelValue:e.value}),t.emit("change",{elementId:m,field:C,value:b,modelValue:e.value})),o.forEach(h=>{h({elementId:m,field:C,value:b,oldValue:a,modelValue:e.value})}))}return{getValue:n,setValue:p,onValueChange:r}}const lt=i.defineComponent({name:"FDynamicForm",props:Pe,emits:["update:modelValue","change","event","click"],setup(e,t){const n=i.ref(e.fields),o=new Map,r=i.ref(e.callback);ae.loadRegister();const p=ae.useComponentManager(),m=i.ref(e.formData||{}),C=it(m,t);ae.useEntityState(n.value).setup();const a=new Map,h=i.ref(e.canRenderForm);let l=[],f=[],F=[];const d=e.mode===xe.FULL?"contents":"fields",{mergeArray:y,resolveCallbacks:v,resolveEvents:j}=ae.useDynamicViewUtils(),T=i.computed(()=>{const s=Se.LocaleService.getLocale(),P=e.fields&&e.fields.length>0;let I={"f-form-layout":P,"farris-form":P,"f-dynamic-form":!(e.showHeader||e.showFooter)};return I=Y.getCustomClass(I,e.customClass),e.adaptForLanguage&&s&&(I["farris-form-controls-inline"]=s!=="en"),I});function R(){function s(P,I){const{id:E}=P||{},{field:z}=P.binding||{};return{modelValue:I.getValue(E),"onUpdate:modelValue":ie=>{I.setValue(E,z||E,ie)}}}return{resolve:s}}function L(s){const P=R();return C.getValue(s.id)===void 0&&Object.hasOwnProperty.call(s,"modelValue")&&C.setValue(s.id,void 0,s.modelValue),P.resolve(s,C)}function U(s){const P={};return s&&Object.entries(s).forEach(([I,E])=>{P[I]=()=>Array.isArray(E)?E.map(z=>N(z)):N(E)}),P}function q(s){return s.type?s.type:s[d]?"fieldset":"form-group"}function te(s){const P=q(s),I=s.customClass||"";return I||(P==="fieldset"?"col-12 px-0":l.length===0&&f.length===0||s.id&&F.find(E=>E[d]?E[d].find(z=>z.id===s.id):E.id===s.id)?e.layout:"unset-item")}function J(s){const P=q(s);let I={},E="",z={},ie={};if(e.mode===xe.FULL){z={...j(s,t,P)},ie={...v(s,r,P)};const _=ae.componentPropsConverter[P];I=_?_(s):{},E=te(I)}else{E=te(s);const{fields:_,customClass:re,...ce}=s;I=ce}return{props:{...{...I,customClass:E,...L(s)},key:s.id,ref:_=>{if(_&&s.id&&!p.has(s.id)){p.register(s.id,_);const re={token:s.id,name:"component:ready",type:q(s),payloads:[i.ref(_)],schema:s};t.emit("event",re)}},onVnodeUnmounted:_=>{if(s.id&&p.has(s.id)){p.remove(s.id);const re={token:s.id,name:"component:unmounted",type:q(s),payloads:[_],schema:s};t.emit("event",re)}}},eventProps:z,callbackProps:ie}}function B(s,P){return Array.isArray(s)?s.map(I=>P(I)):P(s)}function N(s,P){var de;const I=q(s),E=ae.componentMap[I];if(s.id&&o.set(s.id,s),!E)return null;const z=()=>s[d]?s[d].map(_=>N(_)):null,ie=(_,re,ce)=>{let me;return ce&&ce.length>0?me=i.createVNode(_,{...re},ce):me=i.createVNode(_,{...re},null),me},pe=((de=a.get(s.id))==null?void 0:de.props)||{};return s[d]&&s[d].length>0?ie(E,pe,[z()]):s.slots?ie(E,pe,[...Object.values(U(s.slots))]):ie(E,pe)}function Q(s){const P=q(s);if(!ae.componentMap[P])return;const{props:E,eventProps:z,callbackProps:ie}=J(s),pe=ae.resolverMap[P],de=pe?pe.editorResolver:null,{componentEventProps:_,editorEventProps:re}=z,{componentCallbackProps:ce,editorCallbackProps:me}=ie;if(_&&Object.keys(_).length>0&&Object.assign(E,_),ce&&Object.keys(ce).length>0&&Object.assign(E,ce),de&&re&&Object.keys(re).length>0){const le=de.resolve(s);Object.assign(le,re)}if(de&&me&&Object.keys(me).length>0){const le=de.resolve(s);Object.assign(le,me)}if(E&&Object.keys(E).length>0){const le=a.get(s.id);le?ue.merge(le==null?void 0:le.props,E):a.set(s.id,i.reactive({props:E}))}!s[d]||!Array.isArray(s[d])||s[d].forEach(le=>Q(le))}function H(s){const P=q(s);ae.componentMap[P]&&(oe(s),!(!s[d]||!Array.isArray(s[d]))&&s[d].forEach(E=>H(E)))}function oe(s){const P=L(s);if(P&&Object.keys(P).length>0){const I=a.get(s.id);if(!I)a.set(s.id,i.reactive({props:P}));else{const E={...I==null?void 0:I.props};Object.keys(P).forEach(z=>{E[z]=P[z]}),Object.assign(I==null?void 0:I.props,E)}}}i.onMounted(()=>{}),i.watch(()=>e.formData,s=>{m.value=s}),i.watch(()=>m.value,s=>{B(n.value,H)},{deep:!0});function X(s,P=""){return P?s.filter(I=>I.position===P):s.filter(I=>!I.position||[be.Header,be.Footer].indexOf(I.position)<0)}function u(s){s&&(l=X(s,be.Header),l.length&&B(l,Q),f=X(s,be.Footer),f.length&&B(f,Q),F=X(s),F.length&&B(F,Q))}i.watch(()=>e.fields,s=>{o.clear(),p.clear(),m.value=e.formData||{},a.clear(),n.value=s,u(s)}),u(e.fields);function g(s){s.$forceUpdate&&s.$forceUpdate()}function x(s){return C.getValue(s)}function w(){return m.value}function D(s,P){C.setValue(s,void 0,P);const I=o.get(s);I&&oe(I)}function M(s){var P;return(P=a.get(s))==null?void 0:P.props}function $(s,P){const I=a.get(s);ue.mergeWith(I==null?void 0:I.props,P,y)}t.expose({componentManager:p,rerender:g,getProps:M,setProps:$,getControlValue:x,setControlValue:D,getValues:w});function V(s=[]){return s.length>0&&B(s,N)}function k(s){return i.withDirectives(i.createVNode("div",{class:T.value,style:e.customStyle},[t.slots.default&&t.slots.default(),s.length>0&&B(s,N)]),[[i.resolveDirective("area-response")]])}function A(){const s={};let P="f-dynamic-form-section--header-content",I="f-dynamic-form-section--footer";return e.showHeader&&(t.slots.headerTitle&&(s.headerTitle=()=>{var E,z;return(z=(E=t.slots).headerTitle)==null?void 0:z.call(E)}),P+=e.headerContentRenderFunction||t.slots.headerContent?" f-dynamic-form-section--header-cotnent-tmpl":"",t.slots.headerContent?s.headerContent=()=>{var E,z;return(z=(E=t.slots).headerContent)==null?void 0:z.call(E)}:!e.headerContentRenderFunction&&l.length>0&&(s.headerContent=()=>i.withDirectives(i.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline f-dynamic-form-section--fields"},[V(l)]),[[i.resolveDirective("area-response")]]))),e.showFooter&&(I+=e.footerRenderFunction||t.slots.footer?" f-dynamic-form-section--footer-tmpl":0,t.slots.footer?s.footer=()=>{var E,z;return(z=(E=t.slots).footer)==null?void 0:z.call(E)}:!e.footerRenderFunction&&f.length>0&&(I+=f.length>0?" f-form-layout farris-form farris-form-controls-inline f-dynamic-form-section--fields":"",s.footer=()=>V(f))),{slots:s,footerClass:I,headerContentClass:P}}const G=i.computed(()=>typeof e.toolbar=="function"?e.toolbar():e.toolbar),S=i.computed(()=>e.headerStyle?typeof e.headerStyle=="function"?e.headerStyle():e.headerStyle:""),Z=i.computed(()=>e.footerStyle?typeof e.footerStyle=="function"?e.footerStyle():e.footerStyle:"");function ne(s,P){t.emit("click",s,P)}function K(){const{slots:s,footerClass:P,headerContentClass:I}=A();return i.createVNode(Ue,{customClass:"f-dynamic-form-section",showHeader:e.showHeader,mainTitle:e.mainTitle,enableAccordion:e.enableAccordion?"default":"",headerContentClass:I,footerClass:P,buttons:G.value,headerStyle:S.value,footerStyle:Z.value,headerTitleRenderFunction:e.showHeader&&e.headerTitleRenderFunction?()=>e.headerTitleRenderFunction():null,headerContentRenderFunction:e.showHeader&&e.headerContentRenderFunction?()=>e.headerContentRenderFunction():null,footerRenderFunction:e.showFooter&&e.footerRenderFunction?()=>e.footerRenderFunction():null,buttonsClass:"col-auto",onClick:ne,moreButtonClass:e.moreButtonClass},{default:()=>k(F),...s})}return()=>e.visible?e.showHeader||e.showFooter?K():h.value&&k(n.value)||!h.value&&V(n.value):null}}),st={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number],default:null},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},showLabelType:{type:String,default:"visible"},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null},fill:{type:Boolean,default:!1},enableTips:{type:Boolean,default:!1},tipsContent:{type:[Object,String],default:""},linkLabel:{type:String,default:!1}},at={},ct={},{globalStorageKey:Jo}=Y.useThirdComponent(),dt={id:{Type:String,default:""},autocomplete:{Type:String,default:"off"},customClass:{Type:String,default:""},disabled:{Type:Boolean,default:!1},editable:{Type:Boolean,default:!0},enableClear:{Type:Boolean,default:!0},enableTitle:{Type:Boolean,default:!0},enableViewPassword:{Type:Boolean,default:!0},forcePlaceholder:{Type:Boolean,default:!1},groupText:{Type:String,default:""},showType:{Type:String,default:"text"},type:{Type:String,default:"text"},max:{type:[Number,String]},min:{type:[Number,String]},maxLength:{Type:Number||void 0,default:void 0},minLength:{Type:Number||void 0,default:void 0},modelValue:{Type:String||Boolean,default:""},showBorder:{Type:Boolean,default:!0},step:{Type:Number,default:1},placeholder:{Type:String,default:""},precision:{Type:Number,default:0},readonly:{Type:Boolean,default:!1},showButtonWhenDisabled:{Type:Boolean,default:!1},tabIndex:{Type:Number,default:0},textAlign:{Type:String,default:"left"},useExtendInfo:{Type:Boolean,default:!1},extendInfo:{Type:String,default:""},value:{Type:String,default:""},autoHeight:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},rows:{type:Number,default:2},showCount:{type:Boolean,default:!1},showZero:{type:Boolean,default:!1},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},updateOn:{type:String,default:"blur"},formatValidation:{type:Object,default:{}},keyboard:{type:Boolean,default:!0},expandable:{type:Boolean,default:!1},expandMode:{type:String,default:"text"},expandContent:{type:String,default:""},expandDisabled:{type:Boolean,default:!1}},Ne=[{key:"none",value:"无"},{key:"cellNumber",value:"手机号"},{key:"tel",value:"座机号/传真号"},{key:"telOrCell",value:"手机号/座机号/传真号"},{key:"postCode",value:"邮编"},{key:"email",value:"电子邮箱"},{key:"idCode",value:"身份证号"},{key:"carCode",value:"车牌号"},{key:"subjectCode",value:"10位数字会计科目代码"},{key:"custom",value:"自定义"}];function ut(e){switch(e){case"none":return"";case"cellNumber":return"^1[0-9]{10}$";case"tel":return"^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$";case"telOrCell":return"^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$|^1[0-9]{10}$";case"postCode":return"^[1-9]\\d{5}(?!\\d)$";case"workCode":return"^\\d{8}$";case"email":return"^[A-Za-z\\d]+([-_.][A-Za-z\\d]+)*@([A-Za-z\\d]+[-.])+[A-Za-z]{2,5}$";case"idCode":return"^[1-9]\\d{5}[1-9]\\d{3}((0[1-9])|(1[0-2]))(0[1-9]|([1|2][0-9])|3[0-1])((\\d{4})|\\d{3}X)$";case"carCode":return"^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][·\\s]?[A-HJ-NP-Z0-9]{4,5}[挂学警港澳]?|粤[Z港澳][·\\s]?[港澳][0-9A-HJ-NP-Z]{4}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?([DF][0-9A-HJ-NP-Z][0-9]{4}|[0-9]{5}[DF])[挂港澳]?|[使领][0-9]{3}[·\\s]?[0-9]{3}|临[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?[0-9A-Z]{4,5}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z]?[·\\s]?警[0-9A-Z]{4}|[军海空][A-Z][·\\s]?[0-9]{4,5}|WJ(?:[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]|\\d{2})[·\\s]?[0-9A-Z]{4,5})$";case"carCodeNew":return"^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$";case"subjectCode":return"^\\d{10}$"}return""}function pt(e){var t;return"请输入正确的"+((t=Ne.find(n=>n.key===e))==null?void 0:t.value)}const mt={convertTo:(e,t,n,o)=>{e.editor.formatValidation||(e.editor.formatValidation={type:"none"}),e.editor.formatValidation.type=n,e.editor.formatValidation.expression=ut(n),e.editor.formatValidation.message=pt(n)},convertFrom:(e,t,n)=>e.editor.formatValidation?t==="type"?e.editor.formatValidation[t]||"none":e.editor.formatValidation[t]:"none"},qe={convertTo:(e,t,n,o)=>{e.editor.formatValidation||(e.editor.formatValidation={type:"none"}),e.editor.formatValidation[t]=n},convertFrom:(e,t,n)=>e.editor.formatValidation?e.editor.formatValidation[t]:e.editor[t]},ft=["lookup","more-vertical","add","edit","x","search","image-edit","copy","source-code","top_developmenttool","reorder","reload"];function yt(e,t,n){const o=`<i class="f-icon f-icon-${t}"></i>`;n.value.insertText?n.value.insertText(o):n.value.setValue(o)}const gt=e=>i.createVNode(i.Fragment,null,[i.createVNode("h5",null,[i.createTextVNode("按钮图标示例")]),i.createVNode("ul",{class:"d-flex",style:"width: 200px; flex-wrap: wrap;align-items: center;height: 100px;"},[ft.map(t=>i.createVNode("li",{key:t,class:"btn",title:"双击添加到内容区域",onDblclick:n=>yt(n,t,e)},[i.createVNode("i",{class:`f-icon f-icon-${t}`},null)]))])]);class bt extends se.InputBaseProperty{constructor(t,n){super(t,n)}getPropertyConfig(t,n){return super.getPropertyConfig(t,n),this.propertyConfig.categories.formatValidation=this.getFormatValidation(t),this.propertyConfig}getEditorProperties(t){var o,r;let n;if(((o=t==null?void 0:t.binding)==null?void 0:o.type)==="Form"){const p=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(r=p==null?void 0:p.schemaField)!=null&&r.type&&(n=p.schemaField.type.length)}return this.getComponentConfig(t,{},{enableClear:{description:"是否显示清除按钮",title:"启用清除按钮",type:"boolean"},maxLength:{description:"文本字数最大长度",title:"最大长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,max:n,needValid:!0}},textAlign:{description:"文本对齐方式",title:"文本对齐方式",type:"string",editor:{type:"combo-list",editable:!1,data:[{text:"左对齐",value:"left"},{text:"居中对齐",value:"center"},{text:"右对齐",value:"right"}],textField:"text",idField:"value",valueField:"value"}},showType:{description:"指定是文本框还是密码框",title:"展示类型",type:"enum",editor:{type:"combo-list",data:[{id:"text",name:"文本框"},{id:"password",name:"密码框"}]},refreshPanelAfterChanged:!0,defaultValue:"text"},enableViewPassword:{description:"",title:"能否查看密码",visible:t.editor.showType==="password",type:"boolean"},groupText:{description:"按钮文本",title:"按钮文本",type:"string",refreshPanelAfterChanged:!0,visible:t.editor.showType==="text"||!t.editor.showType,editor:{type:"code-editor",language:"html",leftTemplate:gt}}})}getGridFieldEdtiorProperties(t){return this.getEditorProperties(t)}getFormatValidation(t){var o,r,p,m,C;const n={title:"输入格式校验",description:"输入校验",hide:!((o=t.binding)!=null&&o.field&&((r=t.binding)==null?void 0:r.type)==="Form")&&!!this.formRule,properties:{type:{title:"格式类型",type:"enum",description:"格式类型",defaultValue:"",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:Ne},refreshPanelAfterChanged:!0,$converter:mt,parentPropertyID:"formatValidation"}}};return(p=t.editor.formatValidation)!=null&&p.type&&((m=t.editor.formatValidation)==null?void 0:m.type)!=="none"&&(n.properties.message={title:"输入错误提示",type:"string",description:"输入错误提示",$converter:qe,parentPropertyID:"formatValidation"}),((C=t.editor.formatValidation)==null?void 0:C.type)==="custom"&&(n.properties.expression={title:"匹配正则",type:"string",description:"匹配正则",$converter:qe,parentPropertyID:"formatValidation"}),n}getEventPropertyConfig(t){const n=this;let o=[...this.getInputCommonEvents(t)];(!t.editor.showType||t.editor.showType==="text")&&t.editor.groupText&&t.editor.groupText.trim().length>0&&(o=[...this.getInputCommonEvents(t),{label:"onClickHandle",name:"按钮点击事件"}]);const r=n.eventsEditorUtils.formProperties(t,n.viewModelId,o),p=n.createBaseEventProperty(r);return this.appendFieldValueChangeEvents(t,o),{title:"事件",hideTitle:!0,properties:p,refreshPanelAfterChanged:!0,tabId:Y.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(m,C){const b=m.propertyValue;delete t[n.viewModelId],b&&(b.setPropertyRelates=this.setPropertyRelates,n.eventsEditorUtils.saveRelatedParameters(t,n.viewModelId,b.events,b),n.updateLinkedLabel(b,t));const a=n.designViewModelUtils.getDgViewModel(n.viewModelId);a&&n.designViewModelField&&a.changeField(n.designViewModelField.id,{valueChanging:t.fieldValueChanging||"",valueChanged:t.fieldValueChanged||""})}}}}function ht(e,t){const n=e.schema;function o(r,p){return new bt(r,t).getPropertyConfig(n,p)}return{getPropsConfig:o}}const Ct=i.defineComponent({name:"FInputGroupDesign",props:dt,emits:["updateExtendInfo","clear","valueChange","clickHandle","blurHandle","focusHandle","enterHandle","iconMouseEnter","iconMouseLeave","keyupHandle","keydownHandle","inputClick"],setup(e,t){const n=i.ref(e.modelValue),o=i.ref(e.modelVal