@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1 lines • 88.5 kB
JavaScript
(function(L,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("../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","../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):(L=typeof globalThis<"u"?globalThis:L||self,W(L["dynamic-form"]={},L.dynamicForm,L.dynamicResolver,L.Vue,L.designerCanvas,L.common,L.propertyPanel,L.FResponseLayoutEditorSetting,L.designer,L.LodashES,L.dynamicView,L.locale,L.FSection,null,null,null,null,null,null,null,null,null,null,null,L.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,L.messageBox))})(this,function(L,W,ee,r,u,Y,se,Le,ke,ue,ae,Ae,Se,ln,sn,an,cn,dn,un,pn,mn,fn,yn,gn,Ce,bn,hn,Fn,Cn,xn,vn,jn,Tn,kn,wn,Dn,Vn,Pn,In,Nn,qn,Bn,En,Mn,$n,Rn,On,Ln,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,Fo,Co,xo,vo,jo,To,ko,wo,Do,Vo,Po,Io,No,Ue){"use strict";var on=Object.defineProperty;var rn=(L,W,ee)=>W in L?on(L,W,{enumerable:!0,configurable:!0,writable:!0,value:ee}):L[W]=ee;var Fe=(L,W,ee)=>rn(L,typeof W!="symbol"?W+"":W,ee);function Ge(e,t){function n(g,a=null){if(a)return a;const h=e.getComponentById(t);return e.selectNode(h,l=>l.id===g)}function o(g){const a=e.getComponentById(g);return!(!a||!a.componentType||!a.componentType.startsWith("form"))}function i(g){const a=new Set(g);return Array.from(a).length===1}function f(g){const a=n(g.id),h=Le.useResponseLayoutEditorSetting(e),l=[];h.getResonseFormLayoutConfig(a,l,1);const m=l.map(O=>O.columnInSM),C=l.map(O=>O.columnInMD),c=l.map(O=>O.columnInLG),y=l.map(O=>O.columnInEL),v=i(m)?m[0]:0,j=i(C)?C[0]:0,T=i(c)?c[0]:0,R=i(y)?y[0]:0;return{uniqueColClassInSM:v,uniqueColClassInMD:j,uniqueColClassInLG:T,uniqueColClassInEL:R}}function p(g,a){let h,l,m,C,c=[];if(g){const O=g.split(" "),U=O.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)),m=U.find(q=>/^col-xl-([1-9]|10|11|12)$/.test(q)),C=U.find(q=>/^col-el-([1-9]|10|11|12)$/.test(q)),c=O.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:m,T=a.uniqueColClassInEL?"col-el-"+a.uniqueColClassInEL:C;return[y,v,j,T].concat(c).join(" ")}function F(g,a,h){g=n(h,g),g.contents.forEach(l=>{if(l.type===u.DgControl["dynamic-form"].type)return;if(l.type===u.DgControl.fieldset.type){F(l,a,l.id);return}l.appearance||(l.appearance={});const m=l.appearance.class;l.appearance.class=p(m,a)})}return{checkIsInFormComponent:o,assembleUnifiedLayoutContext:f,changeFormControlsByUnifiedLayoutConfig:F,changeControlClassInByColumn:p}}class we extends se.BaseControlProperty{constructor(t,n){super(t,n)}getBaseFormAppearanceConfig(t,n,o){const i=this,{assembleUnifiedLayoutContext:f,changeFormControlsByUnifiedLayoutConfig:p,changeControlClassInByColumn:F}=Ge(this.formSchemaUtils,this.componentId),g=this.getAppearanceConfig(n);return g.properties.adaptForLanguage={title:"控件布局响应国际化",description:"启用国际化后:简体中文、繁体中文环境下控件标签与输入框在一行展示,其他语言环境下控件标签与输入框上下排列。",type:"boolean"},g.properties.labelAutoOverflow={title:"控件标签换行",description:"控件标签字数超长时,换行显示。控件标签与输入框在一行展示时,此属性有效。",type:"boolean"},g.properties.unifiedLayout={title:"统一布局配置",description:"统一配置卡片区域内所有控件的宽度,只支持标准模式",refreshPanelAfterChanged:!0,editor:{type:"response-form-layout-setting",initialState:f(n)}},g.setPropertyRelates=function(a,h){if(a)switch(a&&a.propertyID){case"unifiedLayout":{n.layout=F("",a.propertyValue),t==="dynamic"?n.layout=F("",a.propertyValue):(p(null,a.propertyValue,n.id),i.updateElementByParentContainer(n.id,o));break}case"labelAutoOverflow":{i.setLabelAutoOverflow(n,a.propertyValue),u.refreshCanvas();break}}},g}getBaseFormBehaviorConfig(t,n){const o=this,i=this.getPropertyEditorParams(n,["Variable","Custom"],"fields",{},{newVariablePrefix:"",newVariableType:"Array"}),f=this.getPropertyEditorParams(n,["Variable","Custom"],"formData",{},{newVariablePrefix:"",newVariableType:"Object"});let p={};return t==="dynamic"&&(p={fields:{title:"动态控件列表",type:"string",description:"动态控件列表",editor:i},formData:{title:"动态控件列表初始值",type:"string",description:"动态控件列表初始值",editor:f},mode:{description:"两种方式,快速模式下,控件属性写法支持组件的属性,可以直接写回调和事件,比如onClick: () => {}。完整模式下,控件属性写法与设计时schema一致。",title:"渲染模式",type:"enum",editor:{default:"quick",readonly:!0,data:[{id:"quick",name:"快速模式"},{id:"full",name:"完整模式"}]}}}),this.getBehaviorConfig(n,"",p,(F,g)=>{switch(F.propertyID){case"fields":case"formData":o.afterMutilEditorChanged(n,F);break}})}setLabelAutoOverflow(t,n,o){if(!o){const i=this.formSchemaUtils.getComponentById(this.componentId);o=this.formSchemaUtils.selectNode(i,f=>f.id===t.id)}o&&o.contents&&o.contents.length&&o.contents.forEach(i=>{if(i.type===u.DgControl.fieldset.type){this.setLabelAutoOverflow(null,n,i);return}i.appearance||(i.appearance={class:""}),i.appearance.class||(i.appearance.class=""),n?i.appearance.class.includes("farris-group-multi-label")||(i.appearance.class=i.appearance.class+" farris-group-multi-label"):i.appearance.class=i.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 Ze(e,t){const n=e.schema,o=new u.UseTemplateDragAndDropRules,{canMove:i,canAccept:f,canDelete:p}=o.getTemplateRule(e,t);function F(d,b){const{sourceElement:x}=d,{componentInstance:w}=x,D=t==null?void 0:t.formSchemaUtils;if(!D)return!0;const E=D.getComponentById(w.value.belongedComponentId),$=D.getViewModelById(E.viewModel),V=D.getComponentById(e.componentInstance.value.belongedComponentId),k=D.getViewModelById(V.viewModel);return b?$!=null&&$.id&&(k!=null&&k.id)&&$.id!==k.id?$.bindTo===k.bindTo:!0:($==null?void 0:$.id)===(k==null?void 0:k.id)}function g(d){const{bindingTargetId:b}=d;if(!t)return;const{formSchemaUtils:x,schemaService:w}=t,D=x.getComponentById(e.componentInstance.value.belongedComponentId),E=w.getFieldByIDAndVMID(b,D.viewModel);return!!(E!=null&&E.schemaField)}function a(d){const b=o.getComponentContext(e);if(b&&b.componentClassList&&b.componentClassList.includes("f-form-layout")&&b.componentClassList.includes("farris-form")){if(d.sourceType==="control"&&(d.componentCategory==="input"||d.componentType&&["fieldset","dynamic-form"].indexOf(d.componentType)>-1))return!0;if(d.sourceType==="move"){if(d.componentType==="form-group")return F(d,!0);if(d.componentType==="fieldset")return F(d,!1);if(d.componentType==="dynamic-form")return!0}return d.sourceType==="field"&&d.componentCategory==="input"?g(d):!1}return!0}function h(d){return!(!u.useDragulaCommonRule().basalDragulaRuleForContainer(d,t)||!f||!a(d))}function l(d){var k;const b=d.componentInstance,x=b.value.schema,w=t==null?void 0:t.formSchemaUtils,D=t==null?void 0:t.designViewModelUtils,E=w.getViewModelIdByComponentId(b.value.belongedComponentId),$=D.getDgViewModel(E),V=b.value.parent;if(V&&u.DgControl.fieldset&&((k=V.schema)==null?void 0:k.type)===u.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(E,x.binding.field,A,!0);break}}}}function m(d,b,x){const w=b.fields.find(k=>k.id===d),D=t==null?void 0:t.designViewModelUtils,E=D.getDgViewModel(b.id),$=E.fields.find(k=>k.id===d);E.removeField([d]);const V=D.getDgViewModel(x);V.addField($),w.fieldSchema&&V.changeField($.id,w.fieldSchema)}function C(d,b,x,w=[]){const D=b.id,E=d.binding.field,$=b.fields.findIndex(k=>k.id===E);if($>-1&&(x.fields.push(b.fields[$]),b.fields.splice($,1)),D==="root-viewmodel"&&x.id!=="root-viewmodel"){d.binding.path&&!d.binding.path.includes("root-component.")&&(d.binding.path="root-component."+d.binding.path);return}if(x.id==="root-viewmodel"&&D!=="root-viewmodel"&&d.binding.path&&d.binding.path.includes("root-component.")){d.binding.path=d.binding.path.replace("root-component.","");return}const V=b.states.find(k=>k.id===E);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 c(d,b,x,w=[]){var $;if(!d)return;const D=b.id==="root-viewmodel"&&x.id!=="root-viewmodel",E=x.id==="root-viewmodel"&&b.id!=="root-viewmodel";Object.keys(d).forEach(V=>{if(V==="binding")return;const k=d[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(E&&k.path&&k.path.includes("root-component.")){k.path=k.path.replace("root-component.","");return}const A=b.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(d,b,x){if(d&&(b(d,x),d.contents))for(const w of d.contents)y(w,b,x)}function v(d=[],b){if(!d.length)return;const x=t==null?void 0:t.formSchemaUtils,w=x.getComponentByViewModelId(b),D=[],E=(V,k)=>{V&&(Object.keys(V).forEach(A=>{const G=V[A];G&&typeof G=="object"&&G.type===se.FormBindingType.Variable&&d.includes(G.field)&&!k.includes(G.field)&&k.push(G.field)}),V.editor&&E(V.editor,k))};y(w,E,D);const $=x.getViewModelById(b);d.forEach(V=>{D.includes(V)||($.states=$.states.filter(k=>k.id!==V))})}function j(d){const b=Y.useGuid().guid(),x=Object.assign({},d,{id:b,code:d.code+b.slice(0,4),name:d.name+b.slice(0,4)}),E=(t==null?void 0:t.formSchemaUtils).getCommands().find($=>$.id===d.cmpId);return E&&E.refedHandlers.push({host:b,handler:d.handlerName}),x}function T(d,b,x){var A,G;const w={},E=(t==null?void 0:t.formSchemaUtils).resolveComponentEvents(ee.schemaMap,d);if(!E)return;Object.keys(d).forEach(S=>{const Z=Object.keys(E).find(ne=>ne===S);if(Z&&d[Z]){const ne=b.commands.find(K=>K.code===d[Z]);if(ne){let K=w[ne.code];K||(K=j(ne),w[ne.code]=K,x.commands.push(K)),d[Z]=K.code}}});const V=(t==null?void 0:t.designViewModelUtils).getDgViewModel(x.id),k=["valueChanging","valueChanged"];if(((A=d.binding)==null?void 0:A.type)===se.FormBindingType.Form){const S=(G=x.fields)==null?void 0:G.find(Z=>Z.id===d.binding.field);S&&k.forEach(Z=>{if(S[Z]){const ne=b.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(d){var k,A;const b=t==null?void 0:t.formSchemaUtils,x=d.componentInstance,w=x.value.schema,D=b.getViewModelIdByComponentId(x.value.belongedComponentId),E=b.getViewModelById(D),$=b.getComponentById(e.componentInstance.value.belongedComponentId),V=b.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:{m(S,E,V.id);break}case se.FormBindingType.Variable:{C(w,E,V,Z);break}}c(w,E,V,Z),c(w.editor,E,V,Z),T(w,E,V),D!=="root-viewmodel"&&v(Z,D)}}function O(d){var w;if(!d||!d.componentInstance)return;const x=d.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(d);return}!x.binding||!x.binding.field||(l(d),R(d))}function U(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function q(d){let b="";switch(d){case 1:{b="col-12 col-md-12 col-xl-12 col-el-12";break}case 2:{b="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{b="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{b="col-12 col-md-6 col-xl-3 col-el-2";break}}return b}function te(d,b){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(b,E=>E.type===u.DgControl["response-form"].type);D&&(x=D.labelAutoOverflow)}return x&&(d+=" farris-group-multi-label"),d}function J(d){const b=e.componentInstance.value.getBelongedComponentInstance(e.componentInstance);if(b&&b.schema&&b.schema.componentType){const{formColumns:x}=b.schema;let w=q(x);w=t==null?void 0:t.formSchemaUtils.getControlClassByFormUnifiedLayout(w,b.schema.id,e.schema),w=te(w,b.schema),d.appearance||(d.appearance={}),d.appearance.class=w}}function B(d,b,x,w){const{bindingSourceContext:D,parentComponentInstance:E}=d;if(D!=null&&D.entityFieldNode&&E){const $=t==null?void 0:t.designViewModelUtils,k=(t==null?void 0:t.formSchemaUtils).getViewModelIdByComponentId(E.belongedComponentId),A=$.getDgViewModel(k);A.removeField([D.entityFieldNode.id]),A.addField(D.designViewModelField),b&&A.changeField(D.entityFieldNode.id,{editor:{$type:b},groupId:x,groupName:w})}}function N(d,b){var E,$,V;const x=n;if((x.appearance&&x.appearance.class||"").split(" ").includes("f-form-layout")&&d.componentCategory==="input"){const{label:k}=d;let A;const G=t==null?void 0:t.controlCreatorUtils;return(E=d.bindingSourceContext)!=null&&E.entityFieldNode?A=G.setFormFieldProperty(($=d.bindingSourceContext)==null?void 0:$.entityFieldNode,b==null?void 0:b.type):(A=G.createFormGroupWithoutField(b==null?void 0:b.type),A.label=k),J(A),B(d,(V=A.editor)==null?void 0:V.type),A}return d.componentType==="dynamic-form"&&(b.appearance={class:"col-12",...b.appearance}),b}function Q(){return i}function H(){return p}function oe(){return!1}function X(d){return new ze(d,t).getPropertyConfig(n,e.componentInstance.value)}return{canAccepts:h,checkCanDeleteComponent:H,checkCanMoveComponent:Q,getStyles:U,getPropsConfig:X,hideNestedPaddingInDesginerView:oe,onAcceptMovedChildElement:O,onResolveNewComponentSchema:N,moveInputBetweenComponent:R,resolveFormGroupAppearance:J,syncFieldToViewModel:B}}const We="root-viewmodel";class _e{constructor(t,n){Fe(this,"formSchemaUtils");Fe(this,"controlCreatorUtils");Fe(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),i=this.createViewModeNode(t),f=this.formSchemaUtils.getFormSchema();return f.module.viewmodels.push(i),f.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,i;const{templateId:n}=this.formSchemaUtils.getFormSchema().module;if(n==="double-list-in-tab-template"&&((i=(o=t.parentComponentInstance)==null?void 0:o.schema)==null?void 0:i.type)==="tab-page"){const f=t.parentComponentInstance.parent&&t.parentComponentInstance.parent.schema;if((f==null?void 0:f.type)==="tabs"&&(f==null?void 0:f.fill)===!0)return"f-struct-wrapper f-utils-fill-flex-column"}return"f-struct-wrapper"}createFormComponentContents(t){var F,g;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"),i=[];Object.assign(o,{id:t.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:i,controlsInline:!0}),n.contents=[o];const{selectedFields:f}=t;f==null||f.forEach(a=>{if(a.$type===Y.FormSchemaEntityField$Type.SimpleField){const h=ue.cloneDeep(a),l=this.resolveControlClassByFormColumns(t),m=this.controlCreatorUtils.setFormFieldProperty(h,"",l);m&&i.push(m)}});const{templateId:p}=this.formSchemaUtils.getFormSchema().module;if(p==="double-list-in-tab-template"&&((g=(F=t.parentComponentInstance)==null?void 0:F.schema)==null?void 0:g.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:We,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const n=[],{selectedFields:o}=t;return o==null||o.forEach(i=>{if(i.$type===Y.FormSchemaEntityField$Type.SimpleField){let f="blur";const p=i.type.name;(p===Y.FormSchemaEntityFieldTypeName.Enum||p===Y.FormSchemaEntityFieldTypeName.Boolean)&&(f="change"),n.push({type:"Form",id:i.id,fieldName:i.bindingField,groupId:null,groupName:null,updateOn:f,fieldSchema:{}})}}),n}}function ve(e,t,n,o){var f,p,F,g,a,h;const i=n.parentComponentInstance;if(i&&o){const l=(f=i.schema)==null?void 0:f.type,C={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((p=n.bindingSourceContext)==null?void 0:p.entityTitle)||((g=(F=n.bindingSourceContext)==null?void 0:F.bindingEntity)==null?void 0:g.name)||"标题",componentType:"form",formColumns:l==="splitter-pane"?1:4,parentContainerId:i.schema.id,parentComponentInstance:i,bindTo:((a=n.bindingSourceContext)==null?void 0:a.bindTo)||"/",selectedFields:(h=n.bindingSourceContext)==null?void 0:h.bindingEntityFields};return new _e(e,o).createComponent(C)}else return t}function Je(e,t,n){return t}function Qe(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]]),Xe=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"}}),Ye=ee.createPropsResolver(ye,De,fe,ve),He=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 Ke=ke.createPropsResolver(ye,De,fe,ve),et=ke.createPropsResolver(ye,Ve,fe,Qe),he=r.defineComponent({name:"FResponseFormDesign",directives:{"area-response":Y.areaResponseDirective},props:Ie,emits:[],setup(e,t){const n=r.ref(),o=r.inject("design-item-context"),i=r.inject("designer-host-service"),f=Ze(o,i),p=u.useDesignerComponent(n,o,f);r.onMounted(()=>{n.value.componentInstance=p}),t.expose(p.value);const F=r.computed(()=>{const a={"drag-container":!0};return Y.getCustomClass(a,e.customClass)});function g(){return typeof e.fields=="string"&&e.fields||e.fields&&e.fields.path?r.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;"},[r.createTextVNode("动态表单")]):null}return()=>r.withDirectives(r.createVNode("div",{ref:n,class:F.value,style:e.customClass,"data-dragref":`${o.schema.id}-container`,"data-associate":`${o.schema.id}-component`},[t.slots.default&&t.slots.default(),g()]),[[r.resolveDirective("area-response")]])}});class tt 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,i=o.eventsEditorUtils.formProperties(t,o.viewModelId,n);return{title:"事件",hideTitle:!0,properties:o.createBaseEventProperty(i),refreshPanelAfterChanged:!0,tabId:Y.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(p,F){const g=p.propertyValue;delete t[o.viewModelId],g&&(g.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(t,o.viewModelId,g.events,g)),t.remoteSort=!!t.columnSorted}}}}function nt(e,t){function n(p){const F=e.schema;return new tt(p,t).getPropertyConfig(F,e.componentInstance.value)}function o(){return!1}function i(){return!0}function f(){return!0}return{getPropsConfig:n,canAccepts:o,checkCanDeleteComponent:i,checkCanMoveComponent:f}}const ot=r.defineComponent({name:"FDynamicFormDesign",props:Ie,emits:[],setup(e,t){const n=r.ref(),o=r.inject("design-item-context"),i=r.inject("designer-host-service"),f=nt(o,i),p=u.useDesignerComponent(n,o,f);r.onMounted(()=>{n.value.componentInstance=p}),t.expose(p.value);const F=r.computed(()=>{const g={"drag-container":!0};return Y.getCustomClass(g,e.customClass)});return()=>r.createVNode("div",{ref:n,class:F.value,style:e.customStyle},[r.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;"},[r.createTextVNode("动态表单")])])}});function rt(e,t){function n(p){return e.value&&e.value[p]}const o=[];function i(p){o.push(p)}function f(p,F,g){const a=e.value?e.value[p]:void 0;e.value&&(e.value[p]=g),F&&(t&&(t.emit("update:modelValue",{elementId:p,field:F,value:g,modelValue:e.value}),t.emit("change",{elementId:p,field:F,value:g,modelValue:e.value})),o.forEach(h=>{h({elementId:p,field:F,value:g,oldValue:a,modelValue:e.value})}))}return{getValue:n,setValue:f,onValueChange:i}}const it=r.defineComponent({name:"FDynamicForm",props:Pe,emits:["update:modelValue","change","event","click"],setup(e,t){const n=r.ref(e.fields),o=new Map,i=r.ref(e.callback);ae.loadRegister();const f=ae.useComponentManager(),p=r.ref(e.formData||{}),F=rt(p,t);ae.useEntityState(n.value).setup();const a=new Map,h=r.ref(e.canRenderForm);let l=[],m=[],C=[];const c=e.mode===xe.FULL?"contents":"fields",{mergeArray:y,resolveCallbacks:v,resolveEvents:j}=ae.useDynamicViewUtils(),T=r.computed(()=>{const s=Ae.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:M}=P||{},{field:z}=P.binding||{};return{modelValue:I.getValue(M),"onUpdate:modelValue":ie=>{I.setValue(M,z||M,ie)}}}return{resolve:s}}function O(s){const P=R();return F.getValue(s.id)===void 0&&Object.hasOwnProperty.call(s,"modelValue")&&F.setValue(s.id,void 0,s.modelValue),P.resolve(s,F)}function U(s){const P={};return s&&Object.entries(s).forEach(([I,M])=>{P[I]=()=>Array.isArray(M)?M.map(z=>N(z)):N(M)}),P}function q(s){return s.type?s.type:s[c]?"fieldset":"form-group"}function te(s){const P=q(s),I=s.customClass||"";return I||(P==="fieldset"?"col-12 px-0":l.length===0&&m.length===0||s.id&&C.find(M=>M[c]?M[c].find(z=>z.id===s.id):M.id===s.id)?e.layout:"unset-item")}function J(s){const P=q(s);let I={},M="",z={},ie={};if(e.mode===xe.FULL){z={...j(s,t,P)},ie={...v(s,i,P)};const _=ae.componentPropsConverter[P];I=_?_(s):{},M=te(I)}else{M=te(s);const{fields:_,customClass:re,...ce}=s;I=ce}return{props:{...{...I,customClass:M,...O(s)},key:s.id,ref:_=>{if(_&&s.id&&!f.has(s.id)){f.register(s.id,_);const re={token:s.id,name:"component:ready",type:q(s),payloads:[r.ref(_)],schema:s};t.emit("event",re)}},onVnodeUnmounted:_=>{if(s.id&&f.has(s.id)){f.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),M=ae.componentMap[I];if(s.id&&o.set(s.id,s),!M)return null;const z=()=>s[c]?s[c].map(_=>N(_)):null,ie=(_,re,ce)=>{let me;return ce&&ce.length>0?me=r.createVNode(_,{...re},ce):me=r.createVNode(_,{...re},null),me},pe=((de=a.get(s.id))==null?void 0:de.props)||{};return s[c]&&s[c].length>0?ie(M,pe,[z()]):s.slots?ie(M,pe,[...Object.values(U(s.slots))]):ie(M,pe)}function Q(s){const P=q(s);if(!ae.componentMap[P])return;const{props:M,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(M,_),ce&&Object.keys(ce).length>0&&Object.assign(M,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(M&&Object.keys(M).length>0){const le=a.get(s.id);le?ue.merge(le==null?void 0:le.props,M):a.set(s.id,r.reactive({props:M}))}!s[c]||!Array.isArray(s[c])||s[c].forEach(le=>Q(le))}function H(s){const P=q(s);ae.componentMap[P]&&(oe(s),!(!s[c]||!Array.isArray(s[c]))&&s[c].forEach(M=>H(M)))}function oe(s){const P=O(s);if(P&&Object.keys(P).length>0){const I=a.get(s.id);if(!I)a.set(s.id,r.reactive({props:P}));else{const M={...I==null?void 0:I.props};Object.keys(P).forEach(z=>{M[z]=P[z]}),Object.assign(I==null?void 0:I.props,M)}}}r.onMounted(()=>{}),r.watch(()=>e.formData,s=>{p.value=s}),r.watch(()=>p.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 d(s){s&&(l=X(s,be.Header),l.length&&B(l,Q),m=X(s,be.Footer),m.length&&B(m,Q),C=X(s),C.length&&B(C,Q))}r.watch(()=>e.fields,s=>{o.clear(),f.clear(),p.value=e.formData||{},a.clear(),n.value=s,d(s)}),d(e.fields);function b(s){s.$forceUpdate&&s.$forceUpdate()}function x(s){return F.getValue(s)}function w(){return p.value}function D(s,P){F.setValue(s,void 0,P);const I=o.get(s);I&&oe(I)}function E(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:f,rerender:b,getProps:E,setProps:$,getControlValue:x,setControlValue:D,getValues:w});function V(s=[]){return s.length>0&&B(s,N)}function k(s){return r.withDirectives(r.createVNode("div",{class:T.value,style:e.customStyle},[t.slots.default&&t.slots.default(),s.length>0&&B(s,N)]),[[r.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 M,z;return(z=(M=t.slots).headerTitle)==null?void 0:z.call(M)}),P+=e.headerContentRenderFunction||t.slots.headerContent?" f-dynamic-form-section--header-cotnent-tmpl":"",t.slots.headerContent?s.headerContent=()=>{var M,z;return(z=(M=t.slots).headerContent)==null?void 0:z.call(M)}:!e.headerContentRenderFunction&&l.length>0&&(s.headerContent=()=>r.withDirectives(r.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline f-dynamic-form-section--fields"},[V(l)]),[[r.resolveDirective("area-response")]]))),e.showFooter&&(I+=e.footerRenderFunction||t.slots.footer?" f-dynamic-form-section--footer-tmpl":0,t.slots.footer?s.footer=()=>{var M,z;return(z=(M=t.slots).footer)==null?void 0:z.call(M)}:!e.footerRenderFunction&&m.length>0&&(I+=m.length>0?" f-form-layout farris-form farris-form-controls-inline f-dynamic-form-section--fields":"",s.footer=()=>V(m))),{slots:s,footerClass:I,headerContentClass:P}}const G=r.computed(()=>typeof e.toolbar=="function"?e.toolbar():e.toolbar),S=r.computed(()=>e.headerStyle?typeof e.headerStyle=="function"?e.headerStyle():e.headerStyle:""),Z=r.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 r.createVNode(Se,{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(C),...s})}return()=>e.visible?e.showHeader||e.showFooter?K():h.value&&k(n.value)||!h.value&&V(n.value):null}}),lt={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}},st={},at={},{globalStorageKey:_o}=Y.useThirdComponent(),ct={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 dt(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 ut(e){var t;return"请输入正确的"+((t=Ne.find(n=>n.key===e))==null?void 0:t.value)}const pt={convertTo:(e,t,n,o)=>{e.editor.formatValidation||(e.editor.formatValidation={type:"none"}),e.editor.formatValidation.type=n,e.editor.formatValidation.expression=dt(n),e.editor.formatValidation.message=ut(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]},mt=["lookup","more-vertical","add","edit","x","search","image-edit","copy","source-code","top_developmenttool","reorder","reload"];function ft(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 yt=e=>r.createVNode(r.Fragment,null,[r.createVNode("h5",null,[r.createTextVNode("按钮图标示例")]),r.createVNode("ul",{class:"d-flex",style:"width: 200px; flex-wrap: wrap;align-items: center;height: 100px;"},[mt.map(t=>r.createVNode("li",{key:t,class:"btn",title:"双击添加到内容区域",onDblclick:n=>ft(n,t,e)},[r.createVNode("i",{class:`f-icon f-icon-${t}`},null)]))])]);class gt 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,i;let n;if(((o=t==null?void 0:t.binding)==null?void 0:o.type)==="Form"){const f=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(i=f==null?void 0:f.schemaField)!=null&&i.type&&(n=f.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:yt}}})}getGridFieldEdtiorProperties(t){return this.getEditorProperties(t)}getFormatValidation(t){var o,i,f,p,F;const n={title:"输入格式校验",description:"输入校验",hide:!((o=t.binding)!=null&&o.field&&((i=t.binding)==null?void 0:i.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:pt,parentPropertyID:"formatValidation"}}};return(f=t.editor.formatValidation)!=null&&f.type&&((p=t.editor.formatValidation)==null?void 0:p.type)!=="none"&&(n.properties.message={title:"输入错误提示",type:"string",description:"输入错误提示",$converter:qe,parentPropertyID:"formatValidation"}),((F=t.editor.formatValidation)==null?void 0:F.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 i=n.eventsEditorUtils.formProperties(t,n.viewModelId,o),f=n.createBaseEventProperty(i);return this.appendFieldValueChangeEvents(t,o),{title:"事件",hideTitle:!0,properties:f,refreshPanelAfterChanged:!0,tabId:Y.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(p,F){const g=p.propertyValue;delete t[n.viewModelId],g&&(g.setPropertyRelates=this.setPropertyRelates,n.eventsEditorUtils.saveRelatedParameters(t,n.viewModelId,g.events,g),n.updateLinkedLabel(g,t));const a=n.designViewModelUtils.getDgViewModel(n.viewModelId);a&&n.designViewModelField&&a.changeField(n.designViewModelField.id,{valueChanging:t.fieldValueChanging||"",valueChanged:t.fieldValueChanged||""})}}}}function bt(e,t){const n=e.schema;function o(i,f){return new gt(i,t).getPropertyConfig(n,f)}return{getPropsConfig:o}}const ht=r.defineComponent({name:"FInputGroupDesign",props:ct,emits:["updateExtendInfo","clear","valueChange","clickHandle","blurHandle","focusHandle","enterHandle","iconMouseEnter","iconMouseLeave","keyupHandle","keydownHandle","inputClick"],setup(e,t){const n=r.ref(e.modelValue),o=r.ref(e.modelValue),i=Y.useTextBoxDesign(e,t,n,o),{inputGroupClass:f,inputType:p,inputGroupStyle:F}=i,g=r.ref(),a=r.inject("designer-host-service"),h=r.inject("design-item-context"),l=bt(h,a),m=u.u