UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1 lines 85 kB
(function(O,Z){typeof exports=="object"&&typeof module<"u"?Z(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("../../components/avatar/index.umd.js"),require("../button-edit/index.umd.js"),require("../../components/button-group/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("../../components/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("../../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/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","../../components/avatar/index.umd.js","../button-edit/index.umd.js","../../components/button-group/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","../../components/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","../../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/message-box/index.umd.js"],Z):(O=typeof globalThis<"u"?globalThis:O||self,Z(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,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,O.messageBox))})(this,function(O,Z,H,i,m,te,ae,Oe,we,ue,ie,Ae,Se,tn,nn,on,rn,ln,sn,an,cn,dn,Ce,un,mn,pn,fn,yn,gn,bn,hn,Fn,Cn,xn,Tn,jn,vn,wn,kn,Dn,Vn,In,Pn,Nn,qn,Mn,Bn,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,mo,po,fo,yo,go,bo,ho,Fo,Co,xo,To,jo,Ue){"use strict";var Kt=Object.defineProperty;var en=(O,Z,H)=>Z in O?Kt(O,Z,{enumerable:!0,configurable:!0,writable:!0,value:H}):O[Z]=H;var Fe=(O,Z,H)=>en(O,typeof Z!="symbol"?Z+"":Z,H);function Ge(e,t){function n(h,a=null){if(a)return a;const b=e.getComponentById(t);return e.selectNode(b,r=>r.id===h)}function o(h){const a=e.getComponentById(h);return!(!a||!a.componentType||!a.componentType.startsWith("form"))}function l(h){const a=new Set(h);return Array.from(a).length===1}function p(h){const a=n(h.id),b=Oe.useResponseLayoutEditorSetting(e),r=[];b.getResonseFormLayoutConfig(a,r,1);const d=r.map(L=>L.columnInSM),F=r.map(L=>L.columnInMD),u=r.map(L=>L.columnInLG),f=r.map(L=>L.columnInEL),x=l(d)?d[0]:0,j=l(F)?F[0]:0,v=l(u)?u[0]:0,R=l(f)?f[0]:0;return{uniqueColClassInSM:x,uniqueColClassInMD:j,uniqueColClassInLG:v,uniqueColClassInEL:R}}function g(h,a){let b,r,d,F,u=[];if(h){const L=h.split(" "),S=L.filter(q=>q.startsWith("col-"));b=S.find(q=>/^col-([1-9]|10|11|12)$/.test(q)),r=S.find(q=>/^col-md-([1-9]|10|11|12)$/.test(q)),d=S.find(q=>/^col-xl-([1-9]|10|11|12)$/.test(q)),F=S.find(q=>/^col-el-([1-9]|10|11|12)$/.test(q)),u=L.filter(q=>!q.startsWith("col-"))}const f=a.uniqueColClassInSM?"col-"+a.uniqueColClassInSM:b,x=a.uniqueColClassInMD?"col-md-"+a.uniqueColClassInMD:r,j=a.uniqueColClassInLG?"col-xl-"+a.uniqueColClassInLG:d,v=a.uniqueColClassInEL?"col-el-"+a.uniqueColClassInEL:F;return[f,x,j,v].concat(u).join(" ")}function T(h,a,b){h=n(b,h),h.contents.forEach(r=>{if(r.type===m.DgControl["dynamic-form"].type)return;if(r.type===m.DgControl.fieldset.type){T(r,a,r.id);return}r.appearance||(r.appearance={});const d=r.appearance.class;r.appearance.class=g(d,a)})}return{checkIsInFormComponent:o,assembleUnifiedLayoutContext:p,changeFormControlsByUnifiedLayoutConfig:T,changeControlClassInByColumn:g}}class ke extends ae.BaseControlProperty{constructor(t,n){super(t,n)}getPropertyConfig(t,n){const o=this;this.propertyConfig.categories.basic=this.getBasicPropConfig(t);const{checkIsInFormComponent:l,assembleUnifiedLayoutContext:p,changeFormControlsByUnifiedLayoutConfig:g,changeControlClassInByColumn:T}=Ge(this.formSchemaUtils,this.componentId),h=this.getAppearanceConfig(t),a=l(this.componentId);h.properties.adaptForLanguage={title:"控件布局响应国际化",description:"启用国际化后:简体中文、繁体中文环境下控件标签与输入框在一行展示,其他语言环境下控件标签与输入框上下排列。",visible:t.formType==="dynamic"||a,type:"boolean"},h.properties.labelAutoOverflow={title:"控件标签换行",description:"控件标签字数超长时,换行显示。控件标签与输入框在一行展示时,此属性有效。",visible:t.formType==="dynamic"||a,type:"boolean"},h.properties.formType={title:"控件来源",description:"",type:"enum",editor:{readonly:t.type==="dynamic-form",type:"combo-list",textField:"name",valueField:"value",data:[{value:"static",name:"静态"},{value:"dynamic",name:"动态"},{value:"mixed",name:"混合"}]},refreshPanelAfterChanged:!0},h.properties.unifiedLayout={title:"统一布局配置",description:"统一配置卡片区域内所有控件的宽度,只支持标准模式",visible:t.formType==="dynamic"||a,refreshPanelAfterChanged:!0,editor:{type:"response-form-layout-setting",initialState:p(t)}},h.setPropertyRelates=function(r,d){if(r)switch(r&&r.propertyID){case"unifiedLayout":{t.formType==="dynamic"?t.layout=T("",r.propertyValue):(g(null,r.propertyValue,t.id),o.updateElementByParentContainer(t.id,n));break}case"labelAutoOverflow":{o.setLabelAutoOverflow(t,r.propertyValue),m.refreshCanvas();break}}},this.propertyConfig.categories.appearance=h;let b={};if(t.formType&&["dynamic","mixed"].indexOf(t.formType)>-1){const r=this.getPropertyEditorParams(t,["Variable","Custom"],"fields",{},{newVariablePrefix:"",newVariableType:"Array"}),d=this.getPropertyEditorParams(t,["Variable","Custom"],"formData",{},{newVariablePrefix:"",newVariableType:"Object"});b={fields:{title:"动态控件列表",type:"string",description:"动态控件列表",editor:r},formData:{title:"动态控件列表初始值",type:"string",description:"动态控件列表初始值",editor:d}}}return this.propertyConfig.categories.behavior=this.getBehaviorConfig(t,"",b,(r,d)=>{switch(r.propertyID){case"fields":case"formData":o.afterMutilEditorChanged(t,r);break}}),this.propertyConfig}setLabelAutoOverflow(t,n,o){if(!o){const l=this.formSchemaUtils.getComponentById(this.componentId);o=this.formSchemaUtils.selectNode(l,p=>p.id===t.id)}o&&o.contents&&o.contents.length&&o.contents.forEach(l=>{if(l.type===m.DgControl.fieldset.type){this.setLabelAutoOverflow(null,n,l);return}l.appearance||(l.appearance={class:""}),l.appearance.class||(l.appearance.class=""),n?l.appearance.class.includes("farris-group-multi-label")||(l.appearance.class=l.appearance.class+" farris-group-multi-label"):l.appearance.class=l.appearance.class.replace("farris-group-multi-label","").trim()})}}function ze(e,t){const n=e.schema,o=new m.UseTemplateDragAndDropRules,{canMove:l,canAccept:p,canDelete:g}=o.getTemplateRule(e,t);function T(c,y){const{sourceElement:C}=c,{componentInstance:D}=C,k=t==null?void 0:t.formSchemaUtils;if(!k)return!0;const B=k.getComponentById(D.value.belongedComponentId),$=k.getViewModelById(B.viewModel),V=k.getComponentById(e.componentInstance.value.belongedComponentId),w=k.getViewModelById(V.viewModel);return y?$!=null&&$.id&&(w!=null&&w.id)&&$.id!==w.id?$.bindTo===w.bindTo:!0:($==null?void 0:$.id)===(w==null?void 0:w.id)}function h(c){const{bindingTargetId:y}=c;if(!t)return;const{formSchemaUtils:C,schemaService:D}=t,k=C.getComponentById(e.componentInstance.value.belongedComponentId),B=D.getFieldByIDAndVMID(y,k.viewModel);return!!(B!=null&&B.schemaField)}function a(c){const y=o.getComponentContext(e);if(y&&y.componentClassList&&y.componentClassList.includes("f-form-layout")&&y.componentClassList.includes("farris-form")){if(c.sourceType==="control"&&(c.componentCategory==="input"||c.componentType&&["fieldset","dynamic-form"].indexOf(c.componentType)>-1))return!0;if(c.sourceType==="move"){if(c.componentType==="form-group")return T(c,!0);if(c.componentType==="fieldset")return T(c,!1);if(c.componentType==="dynamic-form")return!0}return c.sourceType==="field"&&c.componentCategory==="input"?h(c):!1}return!0}function b(c){return!(!m.useDragulaCommonRule().basalDragulaRuleForContainer(c,t)||!p||!a(c))}function r(c){var w;const y=c.componentInstance,C=y.value.schema,D=t==null?void 0:t.formSchemaUtils,k=t==null?void 0:t.designViewModelUtils,B=D.getViewModelIdByComponentId(y.value.belongedComponentId),$=k.getDgViewModel(B),V=y.value.parent;if(V&&m.DgControl.fieldset&&((w=V.schema)==null?void 0:w.type)===m.DgControl.fieldset.type&&$){const A={groupId:null,groupName:null};switch(C.binding.type){case ae.FormBindingType.Form:{$.changeField(C.binding.field,A);break}case ae.FormBindingType.Variable:{D.modifyViewModelFieldById(B,C.binding.field,A,!0);break}}}}function d(c,y,C){const D=y.fields.find(w=>w.id===c),k=t==null?void 0:t.designViewModelUtils,B=k.getDgViewModel(y.id),$=B.fields.find(w=>w.id===c);B.removeField([c]);const V=k.getDgViewModel(C);V.addField($),D.fieldSchema&&V.changeField($.id,D.fieldSchema)}function F(c,y,C,D=[]){const k=y.id,B=c.binding.field,$=y.fields.findIndex(w=>w.id===B);if($>-1&&(C.fields.push(y.fields[$]),y.fields.splice($,1)),k==="root-viewmodel"&&C.id!=="root-viewmodel"){c.binding.path&&!c.binding.path.includes("root-component.")&&(c.binding.path="root-component."+c.binding.path);return}if(C.id==="root-viewmodel"&&k!=="root-viewmodel"&&c.binding.path&&c.binding.path.includes("root-component.")){c.binding.path=c.binding.path.replace("root-component.","");return}const V=y.states.find(w=>w.id===B);V&&(C.states=C.states?C.states:[],C.states.findIndex(w=>w.id===V.id)<0&&(C.states.push(V),D.push(V.id)))}function u(c,y,C,D=[]){var $;if(!c)return;const k=y.id==="root-viewmodel"&&C.id!=="root-viewmodel",B=C.id==="root-viewmodel"&&y.id!=="root-viewmodel";Object.keys(c).forEach(V=>{if(V==="binding")return;const w=c[V];if(w&&typeof w=="object"&&w.type===ae.FormBindingType.Variable&&w.field){if(k){w.path&&!w.path.includes("root-component.")&&(w.path="root-component."+w.path);return}if(B&&w.path&&w.path.includes("root-component.")){w.path=w.path.replace("root-component.","");return}const A=y.states.find(U=>U.id===w.field);if(A){D.push(A.id),C.states=C.states?C.states:[];const U=C.states.find(z=>z.code===A.code);if(U)w.field=U.id;else{const z=Object.assign({},{newId:te.useGuid().guid()},A);C.states.push(z),w.field=z.newId}}}}),($=C.states)!=null&&$.length&&C.states.map(V=>{V.newId&&(V.id=V.newId,delete V.newId)})}function f(c,y,C){if(c&&(y(c,C),c.contents))for(const D of c.contents)f(D,y,C)}function x(c=[],y){if(!c.length)return;const C=t==null?void 0:t.formSchemaUtils,D=C.getComponentByViewModelId(y),k=[],B=(V,w)=>{V&&(Object.keys(V).forEach(A=>{const U=V[A];U&&typeof U=="object"&&U.type===ae.FormBindingType.Variable&&c.includes(U.field)&&!w.includes(U.field)&&w.push(U.field)}),V.editor&&B(V.editor,w))};f(D,B,k);const $=C.getViewModelById(y);c.forEach(V=>{k.includes(V)||($.states=$.states.filter(w=>w.id!==V))})}function j(c){const y=te.useGuid().guid(),C=Object.assign({},c,{id:y,code:c.code+y.slice(0,4),name:c.name+y.slice(0,4)}),B=(t==null?void 0:t.formSchemaUtils).getCommands().find($=>$.id===c.cmpId);return B&&B.refedHandlers.push({host:y,handler:c.handlerName}),C}function v(c,y,C){var A,U,z;const D={},k=c.type==="form-group"&&c.editor?c.editor.type:c.type,B=(A=H.schemaMap[k])==null?void 0:A.events;if(!B)return;Object.keys(c).forEach(X=>{const oe=Object.keys(B).find(ee=>ee===X);if(oe&&c[oe]){const ee=y.commands.find(s=>s.code===c[oe]);if(ee){let s=D[ee.code];s||(s=j(ee),D[ee.code]=s,C.commands.push(s)),c[oe]=s.code}}});const V=(t==null?void 0:t.designViewModelUtils).getDgViewModel(C.id),w=["valueChanging","valueChanged"];if(((U=c.binding)==null?void 0:U.type)===ae.FormBindingType.Form){const X=(z=C.fields)==null?void 0:z.find(oe=>oe.id===c.binding.field);X&&w.forEach(oe=>{if(X[oe]){const ee=y.commands.find(s=>s.code===X[oe]);if(!ee)return;if(D[ee.code])V.changeField(X.id,{[oe]:D[ee.code].code});else{const s=j(ee);D[ee.code]=s,C.commands.push(s),V.changeField(X.id,{[oe]:s.code})}}})}}function R(c){var w,A;const y=t==null?void 0:t.formSchemaUtils,C=c.componentInstance,D=C.value.schema,k=y.getViewModelIdByComponentId(C.value.belongedComponentId),B=y.getViewModelById(k),$=y.getComponentById(e.componentInstance.value.belongedComponentId),V=y.getViewModelById($.viewModel);if(k!==V.id){const U=(w=D.binding)==null?void 0:w.type,z=(A=D.binding)==null?void 0:A.field,X=[];switch(U){case ae.FormBindingType.Form:{d(z,B,V.id);break}case ae.FormBindingType.Variable:{F(D,B,V,X);break}}u(D,B,V,X),u(D.editor,B,V,X),v(D,B,V),k!=="root-viewmodel"&&x(X,k)}}function L(c){var D;if(!c||!c.componentInstance)return;const C=c.componentInstance.value.schema;if(C.type==="dynamic-form"){const k=((D=C==null?void 0:C.appearance)==null?void 0:D.class)||"";k.indexOf("col-12")<0&&(C.appearance={...C.appearance,class:k+" col-12 px-0"}),R(c);return}!C.binding||!C.binding.field||(r(c),R(c))}function S(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function q(c){let y="";switch(c){case 1:{y="col-12 col-md-12 col-xl-12 col-el-12";break}case 2:{y="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{y="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{y="col-12 col-md-6 col-xl-3 col-el-2";break}}return y}function K(c,y){let C=!1;if(e.schema&&Object.prototype.hasOwnProperty.call(e.schema,"labelAutoOverflow"))C=e.schema.labelAutoOverflow;else{const D=t==null?void 0:t.formSchemaUtils,k=D==null?void 0:D.selectNode(y,B=>B.type===m.DgControl["response-form"].type);k&&(C=k.labelAutoOverflow)}return C&&(c+=" farris-group-multi-label"),c}function _(c){const y=e.componentInstance.value.getBelongedComponentInstance(e.componentInstance);if(y&&y.schema&&y.schema.componentType){const{formColumns:C}=y.schema;let D=q(C);D=t==null?void 0:t.formSchemaUtils.getControlClassByFormUnifiedLayout(D,y.schema.id,e.schema),D=K(D,y.schema),c.appearance||(c.appearance={}),c.appearance.class=D}}function M(c,y,C,D){const{bindingSourceContext:k,parentComponentInstance:B}=c;if(k!=null&&k.entityFieldNode&&B){const $=t==null?void 0:t.designViewModelUtils,w=(t==null?void 0:t.formSchemaUtils).getViewModelIdByComponentId(B.belongedComponentId),A=$.getDgViewModel(w);A.removeField([k.entityFieldNode.id]),A.addField(k.designViewModelField),y&&A.changeField(k.entityFieldNode.id,{editor:{$type:y},groupId:C,groupName:D})}}function N(c,y){var B,$,V;const C=n;if((C.appearance&&C.appearance.class||"").split(" ").includes("f-form-layout")&&c.componentCategory==="input"){const{label:w}=c;let A;const U=t==null?void 0:t.controlCreatorUtils;return(B=c.bindingSourceContext)!=null&&B.entityFieldNode?A=U.setFormFieldProperty(($=c.bindingSourceContext)==null?void 0:$.entityFieldNode,y==null?void 0:y.type):(A=U.createFormGroupWithoutField(y==null?void 0:y.type),A.label=w),_(A),M(c,(V=A.editor)==null?void 0:V.type),A}return c.componentType==="dynamic-form"&&(y.appearance={class:"col-12",...y.appearance}),y}function J(){return l}function Y(){return g}function ne(){return!1}function Q(c){return new ke(c,t).getPropertyConfig(n,e.componentInstance.value)}return{canAccepts:b,checkCanDeleteComponent:Y,checkCanMoveComponent:J,getStyles:S,getPropsConfig:Q,hideNestedPaddingInDesginerView:ne,onAcceptMovedChildElement:L,onResolveNewComponentSchema:N,moveInputBetweenComponent:R,resolveFormGroupAppearance:_,syncFieldToViewModel:M}}const Ze="root-viewmodel";class We{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),l=this.createViewModeNode(t),p=this.formSchemaUtils.getFormSchema();return p.module.viewmodels.push(l),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,l;const{templateId:n}=this.formSchemaUtils.getFormSchema().module;if(n==="double-list-in-tab-template"&&((l=(o=t.parentComponentInstance)==null?void 0:o.schema)==null?void 0:l.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 T,h;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"),l=[];Object.assign(o,{id:t.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:l,controlsInline:!0}),n.contents=[o];const{selectedFields:p}=t;p==null||p.forEach(a=>{if(a.$type===te.FormSchemaEntityField$Type.SimpleField){const b=ue.cloneDeep(a),r=this.resolveControlClassByFormColumns(t),d=this.controlCreatorUtils.setFormFieldProperty(b,"",r);d&&l.push(d)}});const{templateId:g}=this.formSchemaUtils.getFormSchema().module;if(g==="double-list-in-tab-template"&&((h=(T=t.parentComponentInstance)==null?void 0:T.schema)==null?void 0:h.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:Ze,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const n=[],{selectedFields:o}=t;return o==null||o.forEach(l=>{if(l.$type===te.FormSchemaEntityField$Type.SimpleField){let p="blur";const g=l.type.name;(g===te.FormSchemaEntityFieldTypeName.Enum||g===te.FormSchemaEntityFieldTypeName.Boolean)&&(p="change"),n.push({type:"Form",id:l.id,fieldName:l.bindingField,groupId:null,groupName:null,updateOn:p,fieldSchema:{}})}}),n}}function Te(e,t,n,o){var p,g,T,h,a,b;const l=n.parentComponentInstance;if(l&&o){const r=(p=l.schema)==null?void 0:p.type,F={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((g=n.bindingSourceContext)==null?void 0:g.entityTitle)||((h=(T=n.bindingSourceContext)==null?void 0:T.bindingEntity)==null?void 0:h.name)||"标题",componentType:"form",formColumns:r==="splitter-pane"?1:4,parentContainerId:l.schema.id,parentComponentInstance:l,bindTo:((a=n.bindingSourceContext)==null?void 0:a.bindTo)||"/",selectedFields:(b=n.bindingSourceContext)==null?void 0:b.bindingEntityFields};return new We(e,o).createComponent(F)}else return t}function _e(e,t,n){return t}function Je(e,t,n,o){return t.formType="dynamic",t.layout="col-12 col-md-6 col-xl-3 col-el-2",t}const fe=new Map([["appearance",H.resolveAppearance]]),Qe=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"},formType:{description:"",type:"string",default:"static"}},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},formType:{description:"",type:"string",default:"dynamic"},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:""}},required:["id","type","contents"],events:{onClick:"点击事件","onUpdate:modelValue":"值变更事件",event:"事件"}};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"}},Xe=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=H.createPropsResolver(ye,De,fe,Te),He=H.createPropsResolver(ye,Ve,fe,Te),Ie=Object.assign({},ye,{componentId:{type:String,default:""},formType:{type:String,default:"static"}}),Ke=we.createPropsResolver(ye,De,fe,Te),et=we.createPropsResolver(ye,Ve,fe,Je),he=i.defineComponent({name:"FResponseFormDesign",directives:{"area-response":te.areaResponseDirective},props:Ie,emits:[],setup(e,t){const n=i.ref(),o=i.inject("design-item-context"),l=i.inject("designer-host-service"),p=ze(o,l),g=m.useDesignerComponent(n,o,p);i.onMounted(()=>{n.value.componentInstance=g}),t.expose(g.value);const T=i.computed(()=>{const h={"drag-container":!0};return te.getCustomClass(h,e.customClass)});return()=>i.withDirectives(i.createVNode("div",{ref:n,class:T.value,style:e.customClass,"data-dragref":`${o.schema.id}-container`,"data-associate":`${o.schema.id}-component`},[t.slots.default&&t.slots.default(),["dynamic","mixed"].indexOf(e.formType)>-1&&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("��̬����")])]),[[i.resolveDirective("area-response")]])}});function tt(e,t){function n(g){const T=e.schema;return new ke(g,t).getPropertyConfig(T,e.componentInstance.value)}function o(){return!1}function l(){return!0}function p(){return!0}return{getPropsConfig:n,canAccepts:o,checkCanDeleteComponent:l,checkCanMoveComponent:p}}const nt=i.defineComponent({name:"FDynamicFormDesign",props:Ie,emits:[],setup(e,t){const n=i.ref(),o=i.inject("design-item-context"),l=i.inject("designer-host-service"),p=tt(o,l),g=m.useDesignerComponent(n,o,p);i.onMounted(()=>{n.value.componentInstance=g}),t.expose(g.value);const T=i.computed(()=>{const h={"drag-container":!0};return te.getCustomClass(h,e.customClass)});return()=>i.createVNode("div",{ref:n,class:T.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("动态表单")])])}}),ot=i.defineComponent({name:"FDynamicForm",props:Xe,emits:["update:modelValue","event","click"],setup(e,t){const n=i.ref(e.fields),o=new Map,l=i.ref(e.callback);ie.loadRegister();const p=ie.useComponentManager(),g=i.ref(e.formData||{}),T=ie.useBindingData(g,t);ie.useEntityState(n.value).setup();const a=new Map,b=i.ref(e.canRenderForm);let r=[],d=[],F=[];const u=e.mode===xe.FULL?"contents":"fields",{mergeArray:f,resolveCallbacks:x,resolveEvents:j}=ie.useDynamicViewUtils(),v=i.computed(()=>{const s=Ae.LocaleService.getLocale(),I=e.fields&&e.fields.length>0;let P={"f-form-layout":I,"farris-form":I,"f-dynamic-form":!(e.showHeader||e.showFooter)};return P=te.getCustomClass(P,e.customClass),e.adaptForLanguage&&s&&(P["farris-form-controls-inline"]=s!=="en"),P});function R(){function s(I,P){const{id:E}=I||{},{field:G}=I.binding||{};return{modelValue:P.getValue(E),"onUpdate:modelValue":le=>{P.setValue(E,G||E,le)}}}return{resolve:s}}function L(s){const I=R();return T.getValue(s.id)===void 0&&Object.hasOwnProperty.call(s,"modelValue")&&T.setValue(s.id,void 0,s.modelValue),I.resolve(s,T)}function S(s){const I={};return s&&Object.entries(s).forEach(([P,E])=>{I[P]=()=>Array.isArray(E)?E.map(G=>N(G)):N(E)}),I}function q(s){return s.type?s.type:s[u]?"fieldset":"form-group"}function K(s){const I=q(s),P=s.customClass||"";return P||(I==="fieldset"?"col-12 px-0":r.length===0&&d.length===0||s.id&&F.find(E=>E[u]?E[u].find(G=>G.id===s.id):E.id===s.id)?e.layout:"unset-item")}function _(s){const I=q(s);let P={},E="",G={},le={};if(e.mode===xe.FULL){G={...j(s,t,I)},le={...x(s,l,I)};const W=ie.componentPropsConverter[I];P=W?W(s):{},E=K(P)}else{E=K(s);const{fields:W,customClass:re,...ce}=s;P=ce}return{props:{...{...P,customClass:E,...L(s)},key:s.id,ref:W=>{if(W&&s.id&&!p.has(s.id)){p.register(s.id,W);const re={token:s.id,name:"component:ready",type:q(s),payloads:[i.ref(W)],schema:s};t.emit("event",re)}},onVnodeUnmounted:W=>{if(s.id&&p.has(s.id)){p.remove(s.id);const re={token:s.id,name:"component:unmounted",type:q(s),payloads:[W],schema:s};t.emit("event",re)}}},eventProps:G,callbackProps:le}}function M(s,I){return Array.isArray(s)?s.map(P=>I(P)):I(s)}function N(s,I){var de;const P=q(s),E=ie.componentMap[P];if(s.id&&o.set(s.id,s),!E)return null;const G=()=>s[u]?s[u].map(W=>N(W)):null,le=(W,re,ce)=>{let pe;return ce&&ce.length>0?pe=i.createVNode(W,{...re},ce):pe=i.createVNode(W,{...re},null),pe},me=((de=a.get(s.id))==null?void 0:de.props)||{};return s[u]&&s[u].length>0?le(E,me,[G()]):s.slots?le(E,me,[...Object.values(S(s.slots))]):le(E,me)}function J(s){const I=q(s);if(!ie.componentMap[I])return;const{props:E,eventProps:G,callbackProps:le}=_(s),me=ie.resolverMap[I],de=me?me.editorResolver:null,{componentEventProps:W,editorEventProps:re}=G,{componentCallbackProps:ce,editorCallbackProps:pe}=le;if(W&&Object.keys(W).length>0&&Object.assign(E,W),ce&&Object.keys(ce).length>0&&Object.assign(E,ce),de&&re&&Object.keys(re).length>0){const se=de.resolve(s);Object.assign(se,re)}if(de&&pe&&Object.keys(pe).length>0){const se=de.resolve(s);Object.assign(se,pe)}if(E&&Object.keys(E).length>0){const se=a.get(s.id);se?ue.merge(se==null?void 0:se.props,E):a.set(s.id,i.reactive({props:E}))}!s[u]||!Array.isArray(s[u])||s[u].forEach(se=>J(se))}function Y(s){const I=q(s);ie.componentMap[I]&&(ne(s),!(!s[u]||!Array.isArray(s[u]))&&s[u].forEach(E=>Y(E)))}function ne(s){const I=L(s);if(I&&Object.keys(I).length>0){const P=a.get(s.id);if(!P)a.set(s.id,i.reactive({props:I}));else{const E={...P==null?void 0:P.props};Object.keys(I).forEach(G=>{E[G]=I[G]}),Object.assign(P==null?void 0:P.props,E)}}}i.onMounted(()=>{}),i.watch(()=>e.formData,s=>{g.value=s}),i.watch(()=>g.value,()=>{M(n.value,Y)},{deep:!0});function Q(s,I=""){return I?s.filter(P=>P.position===I):s.filter(P=>!P.position||[be.Header,be.Footer].indexOf(P.position)<0)}function c(s){s&&(r=Q(s,be.Header),r.length&&M(r,J),d=Q(s,be.Footer),d.length&&M(d,J),F=Q(s),F.length&&M(F,J))}i.watch(()=>e.fields,s=>{o.clear(),p.clear(),g.value=e.formData||{},a.clear(),n.value=s,c(s)}),c(e.fields);function y(s){s.$forceUpdate&&s.$forceUpdate()}function C(s){return T.getValue(s)}function D(){return g.value}function k(s,I){T.setValue(s,void 0,I);const P=o.get(s);P&&ne(P)}function B(s){var I;return(I=a.get(s))==null?void 0:I.props}function $(s,I){const P=a.get(s);ue.mergeWith(P==null?void 0:P.props,I,f)}t.expose({componentManager:p,rerender:y,getProps:B,setProps:$,getControlValue:C,setControlValue:k,getValues:D});function V(s=[]){return s.length>0&&M(s,N)}function w(s){return i.withDirectives(i.createVNode("div",{class:v.value,style:e.customStyle},[t.slots.default&&t.slots.default(),s.length>0&&M(s,N)]),[[i.resolveDirective("area-response")]])}function A(){const s={};let I="f-dynamic-form-section--header-content",P="f-dynamic-form-section--footer";return e.showHeader&&(t.slots.headerTitle&&(s.headerTitle=()=>{var E,G;return(G=(E=t.slots).headerTitle)==null?void 0:G.call(E)}),I+=e.headerContentRenderFunction||t.slots.headerContent?" f-dynamic-form-section--header-cotnent-tmpl":"",t.slots.headerContent?s.headerContent=()=>{var E,G;return(G=(E=t.slots).headerContent)==null?void 0:G.call(E)}:!e.headerContentRenderFunction&&r.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(r)]),[[i.resolveDirective("area-response")]]))),e.showFooter&&(P+=e.footerRenderFunction||t.slots.footer?" f-dynamic-form-section--footer-tmpl":0,t.slots.footer?s.footer=()=>{var E,G;return(G=(E=t.slots).footer)==null?void 0:G.call(E)}:!e.footerRenderFunction&&d.length>0&&(P+=d.length>0?" f-form-layout farris-form farris-form-controls-inline f-dynamic-form-section--fields":"",s.footer=()=>V(d))),{slots:s,footerClass:P,headerContentClass:I}}const U=i.computed(()=>typeof e.toolbar=="function"?e.toolbar():e.toolbar),z=i.computed(()=>e.headerStyle?typeof e.headerStyle=="function"?e.headerStyle():e.headerStyle:""),X=i.computed(()=>e.footerStyle?typeof e.footerStyle=="function"?e.footerStyle():e.footerStyle:"");function oe(s,I){t.emit("click",s,I)}function ee(){const{slots:s,footerClass:I,headerContentClass:P}=A();return i.createVNode(Se,{customClass:"f-dynamic-form-section",showHeader:e.showHeader,mainTitle:e.mainTitle,enableAccordion:e.enableAccordion?"default":"",headerContentClass:P,footerClass:I,buttons:U.value,headerStyle:z.value,footerStyle:X.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:oe,moreButtonClass:e.moreButtonClass},{default:()=>w(F),...s})}return()=>e.visible?e.showHeader||e.showFooter?ee():b.value&&w(n.value)||!b.value&&V(n.value):null}}),rt={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},linkLabel:{type:String,default:!1}},it={},lt={},{globalStorageKey:Oo}=te.useThirdComponent(),st={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}},Pe=[{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 at(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 ct(e){var t;return"请输入正确的"+((t=Pe.find(n=>n.key===e))==null?void 0:t.value)}const dt={convertTo:(e,t,n,o)=>{e.editor.formatValidation||(e.editor.formatValidation={type:"none"}),e.editor.formatValidation.type=n,e.editor.formatValidation.expression=at(n),e.editor.formatValidation.message=ct(n)},convertFrom:(e,t,n)=>e.editor.formatValidation?t==="type"?e.editor.formatValidation[t]||"none":e.editor.formatValidation[t]:"none"},Ne={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]},ut=["lookup","more-vertical","add","edit","x","search","image-edit","copy","source-code","top_developmenttool","reorder","reload"];function mt(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 qe=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;"},[ut.map(t=>i.createVNode("li",{key:t,class:"btn",title:"双击添加到内容区域",onDblclick:n=>mt(n,t,e)},[i.createVNode("i",{class:`f-icon f-icon-${t}`},null)]))])]);class pt extends ae.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,l;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);(l=p==null?void 0:p.schemaField)!=null&&l.type&&(n=p.schemaField.type.length)}return this.getComponentConfig(t,{},{maxLength:{description:"文本字数最大长度",title:"最大长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,max:n,needValid:!0}},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:qe}}})}getGridFieldEdtiorProperties(t){var o,l;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);(l=p==null?void 0:p.schemaField)!=null&&l.type&&(n=p.schemaField.type.length)}return this.getComponentConfig(t,{},{maxLength:{description:"文本字数最大长度",title:"最大长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,max:n}},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:qe}}})}getFormatValidation(t){var o,l,p,g;const n={title:"输入格式校验",description:"输入校验",hide:!((o=t.binding)!=null&&o.field)&&!!this.formRule,properties:{type:{title:"格式类型",type:"enum",description:"格式类型",defaultValue:"",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:Pe},refreshPanelAfterChanged:!0,$converter:dt,parentPropertyID:"formatValidation"}}};return(l=t.editor.formatValidation)!=null&&l.type&&((p=t.editor.formatValidation)==null?void 0:p.type)!=="none"&&(n.properties.message={title:"输入错误提示",type:"string",description:"输入错误提示",$converter:Ne,parentPropertyID:"formatValidation"}),((g=t.editor.formatValidation)==null?void 0:g.type)==="custom"&&(n.properties.expression={title:"匹配正则",type:"string",description:"匹配正则",$converter:Ne,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 l=n.eventsEditorUtils.formProperties(t,n.viewModelId,o);return{title:"事件",hideTitle:!0,properties:n.createBaseEventProperty(l),refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(g,T){const h=g.propertyValue;delete T[n.viewModelId],h&&(n.eventsEditorUtils.saveRelatedParameters(T,n.viewModelId,h.events,h),n.updateLinkedLabel(h,T));const a=n.designViewModelUtils.getDgViewModel(n.viewModelId);a&&n.designViewModelField&&a.changeField(n.designViewModelField.id,{valueChanging:T.fieldValueChanging,valueChanged:T.fieldValueChanged})}}}}function ft(e,t){const n=e.schema;function o(l,p){return new pt(l,t).getPropertyConfig(n,p)}return{getPropsConfig:o}}const yt=i.defineComponent({name:"FInputGroupDesign",props:st,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.modelValue),l=te.useTextBoxDesign(e,t,n,o),{inputGroupClass:p,inputType:g,inputGroupStyle:T}=l,h=i.ref(),a=i.inject("designer-host-service"),b=i.inject("design-item-context"),r=ft(b,a),d=m.useDesignerComponent(h,b,r),F=i.computed(()=>e.showType==="password"?"password":"");return i.onMounted(()=>{h.value.componentInstance=d}),t.expose(d.value),()=>i.createVNode("div",{id:"inputGroup",ref:h,class:p.value,style:T.value},[i.createVNode("input",{class:"form-control",type:e.showType,placeholder:e.placeholder,value:F.value,readonly:!0},null),e.showType==="password"&&e.enableViewPassword&&i.createVNode("span",{class:"input-group-append"},[i.createVNode("span",{class:"input-group-text"},[i.createVNode("span",{class:"f-icon f-icon-eye"},null)])]),e.showType==="text"&&e.groupText&&i.createVNode("span",{class:"input-group-append"},[i.createVNode("span",{class:"input-group-text",innerHTML:e.groupText},null)])])}});function gt(){function e(g,T){const h=lt[g];return h?h(T):{}}function t(g){return it[g]||yt}function n(g){}function o(g){}function l(g){}function p(g){}return{getChangeFunctionName:n,getClearFunctionName:o,resolveEditorProps:e,resolveEditorType:t,getMousedownFunctionName:l,getMouseupFunctionName:p}}function bt(e={}){function t(a,b,r,d){if(typeof r=="number")return d[a].length===r;if(typeof r=="object"){const F=Object.keys(r)[0],u=r[F];if(F==="not")return Number(d[a].length)!==Number(u);if(F==="moreThan")return Number(d[a].length)>=Number(u);if(F==="lessThan")return Number(d[a].length)<=Number(u)}return!1}function n(a,b,r,d){return d[a]&&d[a].propertyValue&&String(d[a].propertyValue.value)===String(r)}const o=new Map([["length",t],["getProperty",n]]);Object.keys(e).reduce((a,b)=>(a.set(b,e[b]),a),o);fun