@farris/ui-vue 1.8.3 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/components/batch-editor/index.esm.js +7332 -7299
  2. package/components/batch-editor/index.umd.cjs +22 -22
  3. package/components/button/index.esm.js +7334 -7301
  4. package/components/button/index.umd.cjs +22 -22
  5. package/components/component/index.esm.js +880 -874
  6. package/components/component/index.umd.cjs +2 -2
  7. package/components/data-grid/index.esm.js +841 -835
  8. package/components/data-grid/index.umd.cjs +2 -2
  9. package/components/data-view/index.esm.js +14551 -14472
  10. package/components/data-view/index.umd.cjs +27 -27
  11. package/components/designer-canvas/index.esm.js +820 -814
  12. package/components/designer-canvas/index.umd.cjs +1 -1
  13. package/components/mapping-editor/index.esm.js +848 -842
  14. package/components/mapping-editor/index.umd.cjs +2 -2
  15. package/components/popover/index.esm.js +264 -243
  16. package/components/popover/index.umd.cjs +1 -1
  17. package/components/tree-grid/index.esm.js +315 -309
  18. package/components/tree-grid/index.umd.cjs +1 -1
  19. package/designer/data-grid/index.esm.js +8304 -8257
  20. package/designer/data-grid/index.umd.cjs +26 -26
  21. package/designer/farris-designer.all.esm.js +3235 -3223
  22. package/designer/farris-designer.all.umd.cjs +14 -14
  23. package/designer/radio-group/index.esm.js +80 -62
  24. package/designer/radio-group/index.umd.cjs +2 -2
  25. package/designer/tabs/index.esm.js +830 -824
  26. package/designer/tabs/index.umd.cjs +2 -2
  27. package/designer/tree-grid/index.esm.js +348 -342
  28. package/designer/tree-grid/index.umd.cjs +1 -1
  29. package/farris.all.esm.js +18917 -18820
  30. package/farris.all.umd.cjs +39 -39
  31. package/package.json +1 -1
  32. package/types/data-view/components/column-header/column-header.component.d.ts +2 -2
  33. package/types/data-view/composition/column/persist-column-widths.d.ts +15 -0
  34. package/types/data-view/composition/column/use-resize.d.ts +3 -2
  35. package/types/data-view/index.d.ts +1 -0
  36. package/types/popover/src/composition/measure-host.d.ts +10 -5
  37. package/types/popover/src/composition/types.d.ts +2 -2
  38. package/types/popover/src/composition/use-host.d.ts +1 -2
  39. package/types/radio-group/src/property-config/radio-group.property-config.d.ts +21 -0
  40. package/package.zip +0 -0
@@ -1,6 +1,6 @@
1
- (function(A,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("../../components/common/index.umd.js"),require("../../components/dynamic-resolver/index.umd.js"),require("../../components/radio-group/index.umd.js"),require("vue"),require("../../components/designer-canvas/index.umd.js"),require("lodash-es"),require("../../components/locale/index.umd.js"),require("../../components/property-panel/index.umd.js"),require("../../components/button/index.umd.js"),require("../../components/field-selector/index.umd.js"),require("../../components/collection-property-editor/index.umd.js/src/use-button-items.designer"),require("../../components/tags/index.umd.js"),require("../../components/common/index.umd.js/text-box/use-input-expand"),require("../../components/popover/index.umd.js"),require("../../components/drawer/index.umd.js"),require("../../components/data-grid/index.umd.js"),require("../../components/notify/index.umd.js"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","../../components/common/index.umd.js","../../components/dynamic-resolver/index.umd.js","../../components/radio-group/index.umd.js","vue","../../components/designer-canvas/index.umd.js","lodash-es","../../components/locale/index.umd.js","../../components/property-panel/index.umd.js","../../components/button/index.umd.js","../../components/field-selector/index.umd.js","../../components/collection-property-editor/index.umd.js/src/use-button-items.designer","../../components/tags/index.umd.js","../../components/common/index.umd.js/text-box/use-input-expand","../../components/popover/index.umd.js","../../components/drawer/index.umd.js","../../components/data-grid/index.umd.js","../../components/notify/index.umd.js","bignumber.js"],D):(A=typeof globalThis<"u"?globalThis:A||self,D(A["radio-group"]={},A.common,A.dynamicResolver,A.FRadioGroup,A.Vue,A.designerCanvas,A.LodashES,A.locale,null,null,null,null,A.FTags,A.useInputExpand,A.FPopover,A.Drawer,A.FDataGrid,A.notify))})(this,function(A,D,K,re,o,y,ie,Y,tn,nn,on,ln,Pe,Ne,Re,Oe,Le,De){"use strict";var Qt=Object.defineProperty;var en=(A,D,K)=>D in A?Qt(A,D,{enumerable:!0,configurable:!0,writable:!0,value:K}):A[D]=K;var k=(A,D,K)=>en(A,typeof D!="symbol"?D+"":D,K);const Ae={...D.radioCheckboxCommonProps,id:String,disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},enumData:{type:Array},data:{type:Array},modelValue:{type:String,default:""},name:{type:String,default:""},tabIndex:{type:Number,default:-1},textField:{type:String,default:"name"},valueField:{type:String,default:"value"}};function je(n,t,e){const l=o.computed(()=>!n.disabled),i=o.computed(()=>n.data||n.enumData||n.options||[]);function a(r){return r[n.valueField]}function s(r){return r[n.textField]}function d(r,c){if(l.value){const f=a(r);e.value!==f&&(e.value=f,t.emit("change",f),t.emit("changeValue",f),t.emit("update:modelValue",f))}c.stopPropagation()}return{enumData:i,getValue:a,getText:s,onClickRadio:d}}function ze(n){const{formSchemaUtils:t,formStateMachineUtils:e}=n;function l(r,c=""){return{path:c+r.code,field:r.id,fullPath:r.code}}function i(r,c=""){const f=t.getViewModelById(r);return f?f.states.map(u=>l(u,c)):[]}function a(r){const c=t.getRootViewModelId(),f=i(r);if(r===c)return f;const u=i(c,"root-component.");return[...f,...u]}function s(r){return r.binding&&r.binding.path||r.id||""}function d(){return e&&e.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:d}}class He{constructor(t){k(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);k(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});k(this,"getExpressionConverter",(t,e)=>({convertFrom:(l,i,a,s)=>{const d=a.getExpressionRuleValue(t,e||i);return d&&d.value||""},convertTo:(l,i,a,s,d)=>{var r;if(i==="dataPicking"&&(a!=null&&a.target)){const c=`${a.target}_dataPicking`;((r=a.rules)==null?void 0:r.some(u=>u.id===c&&u.value))?l.dictPickingExpressionId=c:delete l.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=t}getExpressionRule(t,e){const l=this.getExpressionData();if(!l)return"";const i=l.find(s=>s.target===t);if(!i)return"";const a=i.rules.find(s=>s.type===e);return a||""}getContextFormVariables(){const{module:t}=this.formSchemaService.getFormSchema();if(!t.viewmodels||t.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),l=this.formSchemaService.getViewModelById(e);if(!l||!l.states||l.states.length===0)return[];const i=[];return l.states.filter(a=>a.category==="remote").forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(t,e,l="label"){return{id:t.id,name:t.name,bindingPath:t[l],parents:e,type:"field"}}buildEntityFieldsTreeData(t=null,e){const l=[];return t==null||t.forEach(i=>{var d;const a=this.createTreeNode(i,e);let s=[];(d=i.type)!=null&&d.fields&&(s=this.buildEntityFieldsTreeData(i.type.fields,[...e,i.label])),l.push({data:a,children:s,expanded:!0})}),l}buildChildEntityTreeData(t=null,e){const l=[];return t==null||t.forEach(i=>{var r,c;const a=this.createTreeNode(i,e);a.type="entity";const s=this.buildEntityFieldsTreeData((r=i.type)==null?void 0:r.fields,[...e,i.label]),d=this.buildChildEntityTreeData((c=i.type)==null?void 0:c.entities,[...e,i.label]);d!=null&&d.length&&(s==null||s.push(...d)),l.push({data:a,children:s||[],expanded:!0})}),l}getEntitiesTreeData(){const t=this.formSchemaService.getSchemaEntities();if(!(t!=null&&t.length))return[];const e=t[0];if(!(e!=null&&e.type))return[];const l=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),i=this.buildChildEntityTreeData(e.type.entities,[e.code]);return i!=null&&i.length&&(l==null||l.push(...i)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:l||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(t,e,l){const i=l==="Field"?t.binding.field:t.id,a=this.getExpressionRule(i,e),s=this.getEntitiesAndVariables(),d={message:["validate","required","dataPicking"].includes(e)&&a?a.message:"",...s};return a.messageType!=null&&(d.messageType=a.messageType),d}buildRule(t,e,l,i){const{expression:a,message:s,messageType:d}=e,r={id:`${t}_${l}`,type:l,value:a};return(l==="validate"||l==="dataPicking"||l==="required")&&(r.message=s),l==="dataPicking"&&(r.messageType=d),l==="validate"&&i&&(r.elementId=i),r}getExpressionData(){const{expressions:t}=this.formSchemaService.getFormSchema().module;return t||[]}updateExpression(t,e,l,i){const a=e==="Field"?t.binding.field:t.id,s=this.buildRule(a,l,i,t.type==="form-group"?t.id:"");let r=this.getExpressionData().find(f=>f.targetType===e&&f.target===a);const c=f=>f.value.trim()==="";if(r){const f=r.rules.find(u=>u.id===s.id);if(f)c(s)?r.rules=r.rules.filter(u=>u.id!==s.id):(Object.assign(f,s),i==="validate"&&t.type==="form-group"&&(f.elementId=t.id));else{if(c(s))return null;r.rules=r.rules||[],r.rules.push(s)}}else{if(c(s))return null;r={target:`${a}`,rules:[s],targetType:e}}return r}getExpressionEditorOptions(t,e,l,i){return l.reduce((a,s)=>{var r,c;const d=e==="Field"?(r=t==null?void 0:t.binding)==null?void 0:r.field:t.id;return a[s]={hide:e==="Field"?!!((c=t==null?void 0:t.binding)!=null&&c.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(d),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(t,s,e),onSubmitModal:f=>{const u=this.updateExpression(t,e,f,s);if(i){const b=this.buildRule(d,f,s);i(b)}return u}}},a},{})}getExpressionInfo(t,e,l){const i=e==="Field"?t.binding.field:t.id,a=this.getExpressionRule(i,l),s={value:a&&a.value,targetId:i,targetType:e,expressionType:l};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(t,e,l=["compute","dependency","validate"],i){var a;return{description:"表达式",title:"表达式",hide:!(t.binding&&((a=t.binding)==null?void 0:a.type)==="Form"),properties:{...this.getExpressionEditorOptions(t,e,l,i)}}}getExpressionOptions(t,e,l){const i=this.getExpressionInfo(t,e,l);return{dialogTitle:`${this.expressionNames[l]||"表达式"}编辑器`,singleExpand:!1,showMessage:l==="required",beforeOpen:()=>this.onBeforeOpenExpression(t,l,e),expressionInfo:i}}}class $e{constructor(t,e){k(this,"componentId");k(this,"viewModelId");k(this,"eventsEditorUtils");k(this,"formSchemaUtils");k(this,"formMetadataConverter");k(this,"designViewModelUtils");k(this,"designViewModelField");k(this,"controlCreatorUtils");k(this,"designerHostService");k(this,"designerContext");k(this,"modalService",null);k(this,"formRule",null);k(this,"schemaService",null);k(this,"metadataService",null);k(this,"propertyConfig",{type:"object",categories:{}});k(this,"expressionProperty");var l;this.componentId=t,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((l=this.formSchemaUtils)==null?void 0:l.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService,this.designerContext=e.designerContext,this.modalService=e.modalService,this.expressionProperty=new He(this.formSchemaUtils)}inResponsiveForm(){var t;return!!((t=this.designerContext)!=null&&t.responsiveForm)}getFormDesignerInstance(){var t,e;return(e=(t=this.designerContext)==null?void 0:t.instances)==null?void 0:e.formDesigner.value}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var l;const e=t.binding&&t.binding.type==="Form"&&t.binding.field;if(e){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===e)}t.updateOn=(l=this.designViewModelField)==null?void 0:l.updateOn}}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:t.type,name:y.DgControl[t.type]&&y.DgControl[t.type].name}]}}}}}getAppearanceConfig(t=null,e={},l){const i={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const s in e)a[s]=Object.assign(a[s]||{},e[s]);return{...i,properties:{...a},setPropertyRelates(s,d){if(s){switch(s&&s.propertyID){case"class":case"style":{y.canvasChanged.value++;break}}l&&l(s,t,d)}}}}getPropertyEditorParams(t,e=[],l="visible",i={},a={},s=""){const{getVariables:d,getControlName:r,getStateMachines:c}=ze(this.designerHostService),f=this.getRealTargetType(t),u=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],b={type:"property-editor",propertyTypes:u};return u.map(h=>{switch(h){case"Const":Object.assign(b,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":b.expressionConfig=this.getExpressionOptions(t,f,s||l);break;case"StateMachine":b.stateMachines=c();break;case"Variable":Object.assign(b,{controlName:r(t),newVariablePrefix:"is",newVariableType:"Boolean",variables:d(this.viewModelId),parentComponentId:this.componentId==="root-component"?"":"root-component",onBeforeOpenVariables:m=>{m.value=d(this.viewModelId)}},a),this.designerContext.designerMode==="PC_RTC"&&(b.newVariablePrefix="ext_"+b.newVariablePrefix);break}}),b}getVisibleProperty(t,e=""){var a;let l=["Const","Variable","StateMachine","Expression"];return e==="gridFieldEditor"?l=["Const","Expression"]:e==="form-group"&&!((a=t.binding)!=null&&a.field)?l=["Const","Variable","StateMachine","Custom"]:e==="dataGrid"||e==="treeGrid"||e==="wizard"?l=["Const","Variable","Expression"]:(t.type.indexOf("toolbar-item")>-1||e==="form-group")&&(l=["Const","Variable","StateMachine","Custom","Expression"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(t,l,"visible")}}}getBehaviorConfig(t,e="",l={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(t,e);for(const r in l)s[r]=Object.assign(s[r]||{},l[r]);const d=this;return{...a,properties:{...s},setPropertyRelates(r,c){if(r){switch(r.propertyID){case"disabled":case"readonly":case"visible":d.afterMutilEditorChanged(t,r);break}i&&i(r,c)}}}}afterMutilEditorChanged(t,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e,t),this.clearExpression(e,t)}updateElementByParentContainer(t,e){const l=e&&e.parent&&e.parent.schema;if(!l)return;const i=l.contents.findIndex(s=>s.id===t),a=ie.cloneDeep(l.contents[i]);l.contents.splice(i,1),l.contents.splice(i,0,a),y.refreshCanvas()}addNewVariableToViewModel(t,e){const l=t.propertyValue;if(!(l&&typeof l=="object")||!(l.type==="Variable"&&l.isNewVariable))return;const s={id:l.field,category:"locale",code:l.fullPath,name:l.fullPath,type:l.newVariableType||"String",isRtcVariable:this.designerContext.designerMode==="PC_RTC"?!0:void 0};delete l.newVariableType,delete l.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(s)}getExpressions(){let t=[];return this.formRule?(this.formRule.expressions=this.formRule.expressions||[],t=this.formRule.expressions||[]):t=this.formSchemaUtils.getExpressions(),t}updateExpressionValue(t,e){const l=t.propertyValue;if(!((l&&l.type)==="Expression"&&l.expressionInfo))return;const{expressionId:s,expressionInfo:d}=l,{targetId:r,targetType:c,expressionType:f,value:u,message:b}=d,h=this.getExpressions();let m=h.find(V=>V.target===r);m||(m={target:r,rules:[],targetType:c},h.push(m));const p=m.rules.find(V=>V.type===f);if(p)p.id=s,p.value=u,p.message=b,(f==="minDate"||f==="maxDate"||f==="defaultTime")&&(p.elementId=e.id);else{const V={id:s,type:f,value:u,message:b,elementId:e.id};m.rules.push(V)}delete l.expressionInfo}clearExpression(t,e){const l=t.propertyValue;if(l&&l.type==="Expression")return;const a=t.propertyID,s=this.getExpressions(),d=e.binding?e.binding.field:e.id,r=s.find(c=>c.target===d);!r||!r.rules||(r.rules=r.rules.filter(c=>c.type!==a))}getExpressionOptions(t,e,l){return this.expressionProperty.getExpressionOptions(t,e,l)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item","drawer-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}createBaseEventProperty(t){const e={};return e[this.viewModelId]={type:"events-editor",editor:{initialData:t,viewSourceHandle:l=>{var i;((i=l.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(l)}}},e}}const ee=class ee{static getEditorTypesByMDataType(t,e=!1,l=""){if(e)return[{key:y.DgControl["language-textbox"].type,value:y.DgControl["language-textbox"].name}];let i=ee.fieldControlTypeMapping[t];if(l==="data-grid-column"&&(i!=null&&i.length)){const a=[y.DgControl["check-group"].type,y.DgControl["radio-group"].type,y.DgControl.image.type,y.DgControl["rich-text-editor"].type,y.DgControl.avatar.type];i=i.filter(s=>!a.includes(s.key))}if(l==="tree-grid-column"&&(i!=null&&i.length)){const a=[y.DgControl["check-group"].type,y.DgControl["radio-group"].type,y.DgControl.image.type,y.DgControl["rich-text-editor"].type,y.DgControl.avatar.type,y.DgControl.switch.type];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const t=[];for(const e in ee.fieldControlTypeMapping)ee.fieldControlTypeMapping[e].forEach(l=>{t.find(i=>i.key===l.key&&i.value===l.value)||t.push({key:l.key,value:l.value})});return t}static mappingDomPropAndSchemaProp(t,e){var a;const l=(a=t.editor)==null?void 0:a.type,i=[];return(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&i.push({domField:"title",schemaField:"name"}),i.push({domField:"label",schemaField:"name"}),i.push({domField:"editor.required",schemaField:"require"}),i.push({domField:"editor.readonly",schemaField:"readonly"}),(l===y.DgControl["input-group"].type||l===y.DgControl.textarea.type||l===y.DgControl["number-spinner"].type)&&i.push({domField:"editor.maxLength",schemaField:"type.length"}),l===y.DgControl["number-spinner"].type&&i.push({domField:"editor.precision",schemaField:"type.precision"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"formatter.precision",schemaField:"type.precision"}),(l===y.DgControl["combo-list"].type||l===y.DgControl["radio-group"].type)&&i.push({domField:"editor.data",schemaField:"type.enumValues"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"formatter.data",schemaField:"type.enumValues"}),l===y.DgControl["date-picker"].type&&(i.push({domField:"editor.displayFormat",schemaField:"editor.format"}),i.push({domField:"editor.fieldType",schemaField:"type.name"})),l===y.DgControl["number-spinner"].type&&(i.push({domField:"editor.max",schemaField:"editor.maxValue"}),i.push({domField:"editor.min",schemaField:"editor.minValue"})),l===y.DgControl.lookup.type&&(i.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),i.push({domField:"editor.valueField",schemaField:"editor.valueField"}),i.push({domField:"editor.textField",schemaField:"editor.textField"}),i.push({domField:"editor.displayType",schemaField:"editor.displayType"}),i.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),i.push({domField:"editor.helpId",schemaField:"editor.helpId"})),i.push({domField:"path",schemaField:"bindingPath"}),i.push({domField:"binding.path",schemaField:"bindingField"}),i.push({domField:"binding.fullPath",schemaField:"path"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"field",schemaField:"bindingPath"}),i}};k(ee,"fieldControlTypeMapping",{String:[{key:y.DgControl["input-group"].type,value:y.DgControl["input-group"].name},{key:y.DgControl.lookup.type,value:y.DgControl.lookup.name},{key:y.DgControl.image.type,value:y.DgControl.image.name},{key:y.DgControl["date-picker"].type,value:y.DgControl["date-picker"].name},{key:y.DgControl.switch.type,value:y.DgControl.switch.name},{key:y.DgControl["check-box"].type,value:y.DgControl["check-box"].name},{key:y.DgControl["check-group"].type,value:y.DgControl["check-group"].name},{key:y.DgControl["radio-group"].type,value:y.DgControl["radio-group"].name},{key:y.DgControl["combo-list"].type,value:y.DgControl["combo-list"].name},{key:y.DgControl.textarea.type,value:y.DgControl.textarea.name},{key:y.DgControl["time-picker"].type,value:y.DgControl["time-picker"].name},{key:y.DgControl["rich-text-editor"].type,value:y.DgControl["rich-text-editor"].name}],Text:[{key:y.DgControl.textarea.type,value:y.DgControl.textarea.name},{key:y.DgControl.lookup.type,value:y.DgControl.lookup.name},{key:y.DgControl.image.type,value:y.DgControl.image.name},{key:y.DgControl.avatar.type,value:y.DgControl.avatar.name},{key:y.DgControl["rich-text-editor"].type,value:y.DgControl["rich-text-editor"].name}],Decimal:[{key:y.DgControl["number-spinner"].type,value:y.DgControl["number-spinner"].name}],Integer:[{key:y.DgControl["number-spinner"].type,value:y.DgControl["number-spinner"].name}],Number:[{key:y.DgControl["number-spinner"].type,value:y.DgControl["number-spinner"].name},{key:y.DgControl.switch.type,value:y.DgControl.switch.name},{key:y.DgControl["check-box"].type,value:y.DgControl["check-box"].name}],BigNumber:[{key:y.DgControl["number-spinner"].type,value:y.DgControl["number-spinner"].name}],Date:[{key:y.DgControl["date-picker"].type,value:y.DgControl["date-picker"].name}],DateTime:[{key:y.DgControl["date-picker"].type,value:y.DgControl["date-picker"].name}],Boolean:[{key:y.DgControl.switch.type,value:y.DgControl.switch.name},{key:y.DgControl["check-box"].type,value:y.DgControl["check-box"].name}],Enum:[{key:y.DgControl["combo-list"].type,value:y.DgControl["combo-list"].name},{key:y.DgControl["radio-group"].type,value:y.DgControl["radio-group"].name}],Object:[{key:y.DgControl.lookup.type,value:y.DgControl.lookup.name},{key:y.DgControl["combo-list"].type,value:y.DgControl["combo-list"].name}]});let le=ee;var te=(n=>(n.Form="Form",n.Variable="Variable",n))(te||{});class he{constructor(){k(this,"label","");k(this,"id","");k(this,"columnInSM",12);k(this,"columnInMD",6);k(this,"columnInLG",3);k(this,"columnInEL",2);k(this,"displayWidthInSM",1);k(this,"displayWidthInMD",1);k(this,"displayWidthInLG",1);k(this,"displayWidthInEL",1);k(this,"displayColumnCountAtBreakPoint","md");k(this,"tagRow",0);k(this,"showTopBorder",0);k(this,"group",1);k(this,"isSupportedClass",!0);k(this,"fieldSetId","")}}function qe(n){let t,e;const l=new Map;let i=[];function a(f,u){const h=(f||"").split(" ").filter(x=>x.startsWith("col-"));if(h.length===0){u.isSupportedClass=!1;return}let m=h.find(x=>/^col-([1-9]|10|11|12)$/.test(x)),p=h.find(x=>/^col-md-([1-9]|10|11|12)$/.test(x)),V=h.find(x=>/^col-xl-([1-9]|10|11|12)$/.test(x)),E=h.find(x=>/^col-el-([1-9]|10|11|12)$/.test(x));m=m||"col-12",u.columnInSM=parseInt(m.replace("col-",""),10),u.displayWidthInSM=u.columnInSM/12,u.displayWidthInSM!==1&&(u.isSupportedClass=!1),p=p||"col-md-"+u.columnInSM,u.columnInMD=parseInt(p.replace("col-md-",""),10),u.displayWidthInMD=u.columnInMD/6,[1,2].includes(u.displayWidthInMD)||(u.isSupportedClass=!1),V=V||"col-xl-"+u.columnInMD,u.columnInLG=parseInt(V.replace("col-xl-",""),10),u.displayWidthInLG=u.columnInLG/3,[1,2,3,4].includes(u.displayWidthInLG)||(u.isSupportedClass=!1),E=E||"col-el-"+u.columnInLG,u.columnInEL=parseInt(E.replace("col-el-",""),10),u.displayWidthInEL=u.columnInEL/2,[1,2,3,4,5,6].includes(u.displayWidthInEL)||(u.isSupportedClass=!1)}function s(f,u,b,h=!1){let m=!1;if(!f.contents||f.contents.length===0){const p=new he;a(f.layout,p),u.push(p);return}f.contents.forEach(p=>{if(p.type==="fieldset"){b+=1,s(p,u,b,!0),m=!0;return}if(p.type==="dynamic-form")return;m&&(b+=1,m=!1);const V=p.appearance&&p.appearance.class,E=new he;V?a(V,E):E.isSupportedClass=!1,E.label=p.label||p.id,E.id=p.id,E.group=b,h&&(E.fieldSetId=f.id),e===p.id&&(t=b),l.set(p.id,p),u.push(E)})}function d(f){const u=n.getComponentById(f);if(!u||!u.componentType||!u.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const b=n.selectNode(u,h=>h.type===y.DgControl["response-form"].type);return!b||!b.contents||b.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:b}}function r(f,u){u=u||f.id;const{result:b,message:h,formNode:m}=d(u);if(!b)return{result:b,message:h};e=f.id,i=[],l.clear();const p=m.contents[0].type===y.DgControl.fieldset.type?0:1;s(m,i,p);const V=i.find(x=>!x.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:V?"customize":"standard"},importData:i}}function c(f,u){u=u;const{result:b,formNode:h}=d(u);if(!b)return"";const m=[];return f.forEach(p=>{var x;const V=l.get(p.id),E=V.appearance&&V.appearance.class;if(E){const R=E.split(" ").filter(N=>!N.startsWith("col-")),j="col-"+p.columnInSM,z="col-md-"+p.columnInMD,v="col-xl-"+p.columnInLG,C="col-el-"+p.columnInEL,I=[j,z,v,C].concat(R);V.appearance.class=I.join(" ")}if(p.fieldSetId){const B=h.contents.find(j=>j.id===p.fieldSetId),R=m.find(j=>j.id===p.fieldSetId);R?(x=R.contents)==null||x.push(V):(m.push(B),B.contents=[V])}else m.push(V)}),h.contents=m,h.id}return{checkCanFindFormNode:d,checkCanOpenLayoutEditor:r,changeFormControlsByResponseLayoutConfig:c,getResonseFormLayoutConfig:s}}const Ue=n=>o.createVNode(o.Fragment,null,[o.createVNode("h5",null,[o.createTextVNode("代码示例")]),o.createVNode("pre",{style:"background-color: #f5f5f5; padding: 10px; border-radius: 5px;"},[o.createVNode("code",null,[`
1
+ (function(A,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("../../components/common/index.umd.js"),require("../../components/dynamic-resolver/index.umd.js"),require("../../components/radio-group/index.umd.js"),require("vue"),require("../../components/designer-canvas/index.umd.js"),require("lodash-es"),require("../../components/locale/index.umd.js"),require("../../components/property-panel/index.umd.js"),require("../../components/button/index.umd.js"),require("../../components/field-selector/index.umd.js"),require("../../components/collection-property-editor/index.umd.js/src/use-button-items.designer"),require("../../components/tags/index.umd.js"),require("../../components/common/index.umd.js/text-box/use-input-expand"),require("../../components/popover/index.umd.js"),require("../../components/drawer/index.umd.js"),require("../../components/data-grid/index.umd.js"),require("../../components/notify/index.umd.js"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","../../components/common/index.umd.js","../../components/dynamic-resolver/index.umd.js","../../components/radio-group/index.umd.js","vue","../../components/designer-canvas/index.umd.js","lodash-es","../../components/locale/index.umd.js","../../components/property-panel/index.umd.js","../../components/button/index.umd.js","../../components/field-selector/index.umd.js","../../components/collection-property-editor/index.umd.js/src/use-button-items.designer","../../components/tags/index.umd.js","../../components/common/index.umd.js/text-box/use-input-expand","../../components/popover/index.umd.js","../../components/drawer/index.umd.js","../../components/data-grid/index.umd.js","../../components/notify/index.umd.js","bignumber.js"],D):(A=typeof globalThis<"u"?globalThis:A||self,D(A["radio-group"]={},A.common,A.dynamicResolver,A.FRadioGroup,A.Vue,A.designerCanvas,A.LodashES,A.locale,null,null,null,null,A.FTags,A.useInputExpand,A.FPopover,A.Drawer,A.FDataGrid,A.notify))})(this,function(A,D,K,re,o,y,ie,Y,tn,nn,on,ln,Pe,Ne,Re,Oe,Le,De){"use strict";var Qt=Object.defineProperty;var en=(A,D,K)=>D in A?Qt(A,D,{enumerable:!0,configurable:!0,writable:!0,value:K}):A[D]=K;var k=(A,D,K)=>en(A,typeof D!="symbol"?D+"":D,K);const Ae={...D.radioCheckboxCommonProps,id:String,disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},enumData:{type:Array},data:{type:Array},modelValue:{type:String,default:""},name:{type:String,default:""},tabIndex:{type:Number,default:-1},textField:{type:String,default:"name"},valueField:{type:String,default:"value"}};function je(n,t,e){const l=o.computed(()=>!n.disabled),i=o.computed(()=>n.data||n.enumData||n.options||[]);function a(r){return r[n.valueField]}function s(r){return r[n.textField]}function d(r,c){if(l.value){const f=a(r);e.value!==f&&(e.value=f,t.emit("change",f),t.emit("changeValue",f),t.emit("update:modelValue",f))}c.stopPropagation()}return{enumData:i,getValue:a,getText:s,onClickRadio:d}}function ze(n){const{formSchemaUtils:t,formStateMachineUtils:e}=n;function l(r,c=""){return{path:c+r.code,field:r.id,fullPath:r.code}}function i(r,c=""){const f=t.getViewModelById(r);return f?f.states.map(u=>l(u,c)):[]}function a(r){const c=t.getRootViewModelId(),f=i(r);if(r===c)return f;const u=i(c,"root-component.");return[...f,...u]}function s(r){return r.binding&&r.binding.path||r.id||""}function d(){return e&&e.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:d}}class He{constructor(t){k(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);k(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});k(this,"getExpressionConverter",(t,e)=>({convertFrom:(l,i,a,s)=>{const d=a.getExpressionRuleValue(t,e||i);return d&&d.value||""},convertTo:(l,i,a,s,d)=>{var r;if(i==="dataPicking"&&(a!=null&&a.target)){const c=`${a.target}_dataPicking`;((r=a.rules)==null?void 0:r.some(u=>u.id===c&&u.value))?l.dictPickingExpressionId=c:delete l.dictPickingExpressionId}s.updateExpression(a)}}));this.formSchemaService=t}getExpressionRule(t,e){const l=this.getExpressionData();if(!l)return"";const i=l.find(s=>s.target===t);if(!i)return"";const a=i.rules.find(s=>s.type===e);return a||""}getContextFormVariables(){const{module:t}=this.formSchemaService.getFormSchema();if(!t.viewmodels||t.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),l=this.formSchemaService.getViewModelById(e);if(!l||!l.states||l.states.length===0)return[];const i=[];return l.states.filter(a=>a.category==="remote").forEach(a=>{i.push({key:a.code,name:a.name,description:a.name,category:a.category})}),i}createTreeNode(t,e,l="label"){return{id:t.id,name:t.name,bindingPath:t[l],parents:e,type:"field"}}buildEntityFieldsTreeData(t=null,e){const l=[];return t==null||t.forEach(i=>{var d;const a=this.createTreeNode(i,e);let s=[];(d=i.type)!=null&&d.fields&&(s=this.buildEntityFieldsTreeData(i.type.fields,[...e,i.label])),l.push({data:a,children:s,expanded:!0})}),l}buildChildEntityTreeData(t=null,e){const l=[];return t==null||t.forEach(i=>{var r,c;const a=this.createTreeNode(i,e);a.type="entity";const s=this.buildEntityFieldsTreeData((r=i.type)==null?void 0:r.fields,[...e,i.label]),d=this.buildChildEntityTreeData((c=i.type)==null?void 0:c.entities,[...e,i.label]);d!=null&&d.length&&(s==null||s.push(...d)),l.push({data:a,children:s||[],expanded:!0})}),l}getEntitiesTreeData(){const t=this.formSchemaService.getSchemaEntities();if(!(t!=null&&t.length))return[];const e=t[0];if(!(e!=null&&e.type))return[];const l=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),i=this.buildChildEntityTreeData(e.type.entities,[e.code]);return i!=null&&i.length&&(l==null||l.push(...i)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:l||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(t,e,l){const i=l==="Field"?t.binding.field:t.id,a=this.getExpressionRule(i,e),s=this.getEntitiesAndVariables(),d={message:["validate","required","dataPicking"].includes(e)&&a?a.message:"",...s};return a.messageType!=null&&(d.messageType=a.messageType),d}buildRule(t,e,l,i){const{expression:a,message:s,messageType:d}=e,r={id:`${t}_${l}`,type:l,value:a};return(l==="validate"||l==="dataPicking"||l==="required")&&(r.message=s),l==="dataPicking"&&(r.messageType=d),l==="validate"&&i&&(r.elementId=i),r}getExpressionData(){const{expressions:t}=this.formSchemaService.getFormSchema().module;return t||[]}updateExpression(t,e,l,i){const a=e==="Field"?t.binding.field:t.id,s=this.buildRule(a,l,i,t.type==="form-group"?t.id:"");let r=this.getExpressionData().find(f=>f.targetType===e&&f.target===a);const c=f=>f.value.trim()==="";if(r){const f=r.rules.find(u=>u.id===s.id);if(f)c(s)?r.rules=r.rules.filter(u=>u.id!==s.id):(Object.assign(f,s),i==="validate"&&t.type==="form-group"&&(f.elementId=t.id));else{if(c(s))return null;r.rules=r.rules||[],r.rules.push(s)}}else{if(c(s))return null;r={target:`${a}`,rules:[s],targetType:e}}return r}getExpressionEditorOptions(t,e,l,i){return l.reduce((a,s)=>{var r,c;const d=e==="Field"?(r=t==null?void 0:t.binding)==null?void 0:r.field:t.id;return a[s]={hide:e==="Field"?!!((c=t==null?void 0:t.binding)!=null&&c.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(d),refreshPanelAfterChanged:!0,editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(t,s,e),onSubmitModal:f=>{const u=this.updateExpression(t,e,f,s);if(i){const b=this.buildRule(d,f,s);i(b)}return u}}},a},{})}getExpressionInfo(t,e,l){const i=e==="Field"?t.binding.field:t.id,a=this.getExpressionRule(i,l),s={value:a&&a.value,targetId:i,targetType:e,expressionType:l};return a&&a.message&&(s.message=a.message),s}getExpressionConfig(t,e,l=["compute","dependency","validate"],i){var a;return{description:"表达式",title:"表达式",hide:!(t.binding&&((a=t.binding)==null?void 0:a.type)==="Form"),properties:{...this.getExpressionEditorOptions(t,e,l,i)}}}getExpressionOptions(t,e,l){const i=this.getExpressionInfo(t,e,l);return{dialogTitle:`${this.expressionNames[l]||"表达式"}编辑器`,singleExpand:!1,showMessage:l==="required",beforeOpen:()=>this.onBeforeOpenExpression(t,l,e),expressionInfo:i}}}class $e{constructor(t,e){k(this,"componentId");k(this,"viewModelId");k(this,"eventsEditorUtils");k(this,"formSchemaUtils");k(this,"formMetadataConverter");k(this,"designViewModelUtils");k(this,"designViewModelField");k(this,"controlCreatorUtils");k(this,"designerHostService");k(this,"designerContext");k(this,"modalService",null);k(this,"formRule",null);k(this,"schemaService",null);k(this,"metadataService",null);k(this,"propertyConfig",{type:"object",categories:{}});k(this,"expressionProperty");var l;this.componentId=t,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((l=this.formSchemaUtils)==null?void 0:l.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService,this.designerContext=e.designerContext,this.modalService=e.modalService,this.expressionProperty=new He(this.formSchemaUtils)}inResponsiveForm(){var t;return!!((t=this.designerContext)!=null&&t.responsiveForm)}getFormDesignerInstance(){var t,e;return(e=(t=this.designerContext)==null?void 0:t.instances)==null?void 0:e.formDesigner.value}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var l;const e=t.binding&&t.binding.type==="Form"&&t.binding.field;if(e){if(!this.designViewModelField){const i=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=i.fields.find(a=>a.id===e)}t.updateOn=(l=this.designViewModelField)==null?void 0:l.updateOn}}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:t.type,name:y.DgControl[t.type]&&y.DgControl[t.type].name}]}}}}}getAppearanceConfig(t=null,e={},l){const i={title:"外观",description:"Appearance"},a={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"}};for(const s in e)a[s]=Object.assign(a[s]||{},e[s]);return{...i,properties:{...a},setPropertyRelates(s,d){if(s){switch(s&&s.propertyID){case"class":case"style":{y.canvasChanged.value++;break}}l&&l(s,t,d)}}}}getPropertyEditorParams(t,e=[],l="visible",i={},a={},s=""){const{getVariables:d,getControlName:r,getStateMachines:c}=ze(this.designerHostService),f=this.getRealTargetType(t),u=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],b={type:"property-editor",propertyTypes:u};return u.map(h=>{switch(h){case"Const":Object.assign(b,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":b.expressionConfig=this.getExpressionOptions(t,f,s||l);break;case"StateMachine":b.stateMachines=c();break;case"Variable":Object.assign(b,{controlName:r(t),newVariablePrefix:"is",newVariableType:"Boolean",variables:d(this.viewModelId),parentComponentId:this.componentId==="root-component"?"":"root-component",onBeforeOpenVariables:m=>{m.value=d(this.viewModelId)}},a),this.designerContext.designerMode==="PC_RTC"&&(b.newVariablePrefix="ext_"+b.newVariablePrefix);break}}),b}getVisibleProperty(t,e=""){var a;let l=["Const","Variable","StateMachine","Expression"];return e==="gridFieldEditor"?l=["Const","Expression"]:e==="form-group"&&!((a=t.binding)!=null&&a.field)?l=["Const","Variable","StateMachine","Custom"]:e==="dataGrid"||e==="treeGrid"||e==="wizard"?l=["Const","Variable","Expression"]:(t.type.indexOf("toolbar-item")>-1||e==="form-group")&&(l=["Const","Variable","StateMachine","Custom","Expression"]),{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(t,l,"visible")}}}getBehaviorConfig(t,e="",l={},i){const a={title:"行为",description:""},s=this.getVisibleProperty(t,e);for(const r in l)s[r]=Object.assign(s[r]||{},l[r]);const d=this;return{...a,properties:{...s},setPropertyRelates(r,c){if(r){switch(r.propertyID){case"disabled":case"readonly":case"visible":d.afterMutilEditorChanged(t,r);break}i&&i(r,c)}}}}afterMutilEditorChanged(t,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e,t),this.clearExpression(e,t)}updateElementByParentContainer(t,e){const l=e&&e.parent&&e.parent.schema;if(!l)return;const i=l.contents.findIndex(s=>s.id===t),a=ie.cloneDeep(l.contents[i]);l.contents.splice(i,1),l.contents.splice(i,0,a),y.refreshCanvas()}addNewVariableToViewModel(t,e){const l=t.propertyValue;if(!(l&&typeof l=="object")||!(l.type==="Variable"&&l.isNewVariable))return;const s={id:l.field,category:"locale",code:l.fullPath,name:l.fullPath,type:l.newVariableType||"String",isRtcVariable:this.designerContext.designerMode==="PC_RTC"?!0:void 0};delete l.newVariableType,delete l.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(s)}getExpressions(){let t=[];return this.formRule?(this.formRule.expressions=this.formRule.expressions||[],t=this.formRule.expressions||[]):t=this.formSchemaUtils.getExpressions(),t}updateExpressionValue(t,e){const l=t.propertyValue;if(!((l&&l.type)==="Expression"&&l.expressionInfo))return;const{expressionId:s,expressionInfo:d}=l,{targetId:r,targetType:c,expressionType:f,value:u,message:b}=d,h=this.getExpressions();let m=h.find(V=>V.target===r);m||(m={target:r,rules:[],targetType:c},h.push(m));const p=m.rules.find(V=>V.type===f);if(p)p.id=s,p.value=u,p.message=b,(f==="minDate"||f==="maxDate"||f==="defaultTime")&&(p.elementId=e.id);else{const V={id:s,type:f,value:u,message:b,elementId:e.id};m.rules.push(V)}delete l.expressionInfo}clearExpression(t,e){const l=t.propertyValue;if(l&&l.type==="Expression")return;const a=t.propertyID,s=this.getExpressions(),d=e.binding?e.binding.field:e.id,r=s.find(c=>c.target===d);!r||!r.rules||(r.rules=r.rules.filter(c=>c.type!==a))}getExpressionOptions(t,e,l){return this.expressionProperty.getExpressionOptions(t,e,l)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item","drawer-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}createBaseEventProperty(t){const e={};return e[this.viewModelId]={type:"events-editor",editor:{initialData:t,viewSourceHandle:l=>{var i;((i=l.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(l)}}},e}}const ee=class ee{static getEditorTypesByMDataType(t,e=!1,l=""){if(e)return[{key:y.DgControl["language-textbox"].type,value:y.DgControl["language-textbox"].name}];let i=ee.fieldControlTypeMapping[t];if(l==="data-grid-column"&&(i!=null&&i.length)){const a=[y.DgControl["check-group"].type,y.DgControl["radio-group"].type,y.DgControl.image.type,y.DgControl["rich-text-editor"].type,y.DgControl.avatar.type];i=i.filter(s=>!a.includes(s.key))}if(l==="tree-grid-column"&&(i!=null&&i.length)){const a=[y.DgControl["check-group"].type,y.DgControl["radio-group"].type,y.DgControl.image.type,y.DgControl["rich-text-editor"].type,y.DgControl.avatar.type,y.DgControl.switch.type];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const t=[];for(const e in ee.fieldControlTypeMapping)ee.fieldControlTypeMapping[e].forEach(l=>{t.find(i=>i.key===l.key&&i.value===l.value)||t.push({key:l.key,value:l.value})});return t}static mappingDomPropAndSchemaProp(t,e){var a;const l=(a=t.editor)==null?void 0:a.type,i=[];return(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&i.push({domField:"title",schemaField:"name"}),i.push({domField:"label",schemaField:"name"}),i.push({domField:"editor.required",schemaField:"require"}),i.push({domField:"editor.readonly",schemaField:"readonly"}),(l===y.DgControl["input-group"].type||l===y.DgControl.textarea.type||l===y.DgControl["number-spinner"].type)&&i.push({domField:"editor.maxLength",schemaField:"type.length"}),l===y.DgControl["number-spinner"].type&&i.push({domField:"editor.precision",schemaField:"type.precision"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"formatter.precision",schemaField:"type.precision"}),(l===y.DgControl["combo-list"].type||l===y.DgControl["radio-group"].type)&&i.push({domField:"editor.data",schemaField:"type.enumValues"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"formatter.data",schemaField:"type.enumValues"}),l===y.DgControl["date-picker"].type&&(i.push({domField:"editor.displayFormat",schemaField:"editor.format"}),i.push({domField:"editor.fieldType",schemaField:"type.name"})),l===y.DgControl["number-spinner"].type&&(i.push({domField:"editor.max",schemaField:"editor.maxValue"}),i.push({domField:"editor.min",schemaField:"editor.minValue"})),l===y.DgControl.lookup.type&&(i.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),i.push({domField:"editor.valueField",schemaField:"editor.valueField"}),i.push({domField:"editor.textField",schemaField:"editor.textField"}),i.push({domField:"editor.displayType",schemaField:"editor.displayType"}),i.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),i.push({domField:"editor.helpId",schemaField:"editor.helpId"})),i.push({domField:"path",schemaField:"bindingPath"}),i.push({domField:"binding.path",schemaField:"bindingField"}),i.push({domField:"binding.fullPath",schemaField:"path"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"field",schemaField:"bindingPath"}),i}};k(ee,"fieldControlTypeMapping",{String:[{key:y.DgControl["input-group"].type,value:y.DgControl["input-group"].name},{key:y.DgControl.lookup.type,value:y.DgControl.lookup.name},{key:y.DgControl.image.type,value:y.DgControl.image.name},{key:y.DgControl["date-picker"].type,value:y.DgControl["date-picker"].name},{key:y.DgControl.switch.type,value:y.DgControl.switch.name},{key:y.DgControl["check-box"].type,value:y.DgControl["check-box"].name},{key:y.DgControl["check-group"].type,value:y.DgControl["check-group"].name},{key:y.DgControl["radio-group"].type,value:y.DgControl["radio-group"].name},{key:y.DgControl["combo-list"].type,value:y.DgControl["combo-list"].name},{key:y.DgControl.textarea.type,value:y.DgControl.textarea.name},{key:y.DgControl["time-picker"].type,value:y.DgControl["time-picker"].name},{key:y.DgControl["rich-text-editor"].type,value:y.DgControl["rich-text-editor"].name}],Text:[{key:y.DgControl.textarea.type,value:y.DgControl.textarea.name},{key:y.DgControl.lookup.type,value:y.DgControl.lookup.name},{key:y.DgControl.image.type,value:y.DgControl.image.name},{key:y.DgControl.avatar.type,value:y.DgControl.avatar.name},{key:y.DgControl["rich-text-editor"].type,value:y.DgControl["rich-text-editor"].name}],Decimal:[{key:y.DgControl["number-spinner"].type,value:y.DgControl["number-spinner"].name}],Integer:[{key:y.DgControl["number-spinner"].type,value:y.DgControl["number-spinner"].name}],Number:[{key:y.DgControl["number-spinner"].type,value:y.DgControl["number-spinner"].name},{key:y.DgControl.switch.type,value:y.DgControl.switch.name},{key:y.DgControl["check-box"].type,value:y.DgControl["check-box"].name}],BigNumber:[{key:y.DgControl["number-spinner"].type,value:y.DgControl["number-spinner"].name}],Date:[{key:y.DgControl["date-picker"].type,value:y.DgControl["date-picker"].name}],DateTime:[{key:y.DgControl["date-picker"].type,value:y.DgControl["date-picker"].name}],Boolean:[{key:y.DgControl.switch.type,value:y.DgControl.switch.name},{key:y.DgControl["check-box"].type,value:y.DgControl["check-box"].name}],Enum:[{key:y.DgControl["combo-list"].type,value:y.DgControl["combo-list"].name},{key:y.DgControl["radio-group"].type,value:y.DgControl["radio-group"].name}],Object:[{key:y.DgControl.lookup.type,value:y.DgControl.lookup.name},{key:y.DgControl["combo-list"].type,value:y.DgControl["combo-list"].name}]});let le=ee;var te=(n=>(n.Form="Form",n.Variable="Variable",n))(te||{});class he{constructor(){k(this,"label","");k(this,"id","");k(this,"columnInSM",12);k(this,"columnInMD",6);k(this,"columnInLG",3);k(this,"columnInEL",2);k(this,"displayWidthInSM",1);k(this,"displayWidthInMD",1);k(this,"displayWidthInLG",1);k(this,"displayWidthInEL",1);k(this,"displayColumnCountAtBreakPoint","md");k(this,"tagRow",0);k(this,"showTopBorder",0);k(this,"group",1);k(this,"isSupportedClass",!0);k(this,"fieldSetId","")}}function qe(n){let t,e;const l=new Map;let i=[];function a(f,u){const h=(f||"").split(" ").filter(x=>x.startsWith("col-"));if(h.length===0){u.isSupportedClass=!1;return}let m=h.find(x=>/^col-([1-9]|10|11|12)$/.test(x)),p=h.find(x=>/^col-md-([1-9]|10|11|12)$/.test(x)),V=h.find(x=>/^col-xl-([1-9]|10|11|12)$/.test(x)),M=h.find(x=>/^col-el-([1-9]|10|11|12)$/.test(x));m=m||"col-12",u.columnInSM=parseInt(m.replace("col-",""),10),u.displayWidthInSM=u.columnInSM/12,u.displayWidthInSM!==1&&(u.isSupportedClass=!1),p=p||"col-md-"+u.columnInSM,u.columnInMD=parseInt(p.replace("col-md-",""),10),u.displayWidthInMD=u.columnInMD/6,[1,2].includes(u.displayWidthInMD)||(u.isSupportedClass=!1),V=V||"col-xl-"+u.columnInMD,u.columnInLG=parseInt(V.replace("col-xl-",""),10),u.displayWidthInLG=u.columnInLG/3,[1,2,3,4].includes(u.displayWidthInLG)||(u.isSupportedClass=!1),M=M||"col-el-"+u.columnInLG,u.columnInEL=parseInt(M.replace("col-el-",""),10),u.displayWidthInEL=u.columnInEL/2,[1,2,3,4,5,6].includes(u.displayWidthInEL)||(u.isSupportedClass=!1)}function s(f,u,b,h=!1){let m=!1;if(!f.contents||f.contents.length===0){const p=new he;a(f.layout,p),u.push(p);return}f.contents.forEach(p=>{if(p.type==="fieldset"){b+=1,s(p,u,b,!0),m=!0;return}if(p.type==="dynamic-form")return;m&&(b+=1,m=!1);const V=p.appearance&&p.appearance.class,M=new he;V?a(V,M):M.isSupportedClass=!1,M.label=p.label||p.id,M.id=p.id,M.group=b,h&&(M.fieldSetId=f.id),e===p.id&&(t=b),l.set(p.id,p),u.push(M)})}function d(f){const u=n.getComponentById(f);if(!u||!u.componentType||!u.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const b=n.selectNode(u,h=>h.type===y.DgControl["response-form"].type);return!b||!b.contents||b.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:b}}function r(f,u){u=u||f.id;const{result:b,message:h,formNode:m}=d(u);if(!b)return{result:b,message:h};e=f.id,i=[],l.clear();const p=m.contents[0].type===y.DgControl.fieldset.type?0:1;s(m,i,p);const V=i.find(x=>!x.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:V?"customize":"standard"},importData:i}}function c(f,u){u=u;const{result:b,formNode:h}=d(u);if(!b)return"";const m=[];return f.forEach(p=>{var x;const V=l.get(p.id),M=V.appearance&&V.appearance.class;if(M){const R=M.split(" ").filter(N=>!N.startsWith("col-")),j="col-"+p.columnInSM,z="col-md-"+p.columnInMD,v="col-xl-"+p.columnInLG,C="col-el-"+p.columnInEL,I=[j,z,v,C].concat(R);V.appearance.class=I.join(" ")}if(p.fieldSetId){const B=h.contents.find(j=>j.id===p.fieldSetId),R=m.find(j=>j.id===p.fieldSetId);R?(x=R.contents)==null||x.push(V):(m.push(B),B.contents=[V])}else m.push(V)}),h.contents=m,h.id}return{checkCanFindFormNode:d,checkCanOpenLayoutEditor:r,changeFormControlsByResponseLayoutConfig:c,getResonseFormLayoutConfig:s}}const Ue=n=>o.createVNode(o.Fragment,null,[o.createVNode("h5",null,[o.createTextVNode("代码示例")]),o.createVNode("pre",{style:"background-color: #f5f5f5; padding: 10px; border-radius: 5px;"},[o.createVNode("code",null,[`
2
2
  <h3>Tips:</h3>
3
3
  <span style="color: blue;">
4
4
  自定义提示内容
5
5
  </span>
6
- `])])]);class We extends $e{constructor(e,l){super(e,l);k(this,"responseLayoutEditorFunction");k(this,"bindingVarible");k(this,"formGroupEvents",[{label:"fieldValueChanging",name:"绑定字段值变化前事件"},{label:"fieldValueChanged",name:"绑定字段值变化后事件"},{label:"onClickLabel",name:"标签点击事件"}]);k(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});k(this,"showCustomValue",e=>{var i;const l=this.designViewModelField!=null&&((i=this.designViewModelField)==null?void 0:i.type.name)!=="Boolean";return this.formRule?e.dataType!=="boolean":l});this.responseLayoutEditorFunction=qe(this.formSchemaUtils)}getCommonPropertyConfig(e,l,i="Card"){if(this.propertyConfig.categories.basic=this.getBasicProperties(e,l,i),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,l),this.propertyConfig.categories.behavior=this.getBehaviorConfig(e,"form-group"),i==="Card"){const a=this.getTipsConfig(e);this.propertyConfig.categories.behavior.properties={...this.propertyConfig.categories.behavior.properties,...a},["time-picker","date-picker","lookup","combo-list","number-spinner","input-group","language-textbox"].includes(e.editor.type)&&(this.propertyConfig.categories.expansion=this.getExpandProperties(e,i))}}getPropertyConfig(e,l){return this.getCommonPropertyConfig(e,l,"Card"),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressions=this.getExpressionConfig(e,"Field"),this.propertyConfig.categories.eventsEditor=this.getEventPropertyConfig(e),this.propertyConfig}getGridFieldEdtiorPropConfig(e,l){return this.propertyConfig.categories={},this.getCommonPropertyConfig(e,l,"Grid"),this.getGridFieldEdtiorProperties?this.propertyConfig.categories.editor=this.getGridFieldEdtiorProperties(e):this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressons=this.getExpressionConfig(e,"Field"),this.propertyConfig.categories}getBasicProperties(e,l,i="Card"){var u;const a=this;this.setDesignViewModelField(e);const{canChangeControlType:s,editorTypeList:d}=this.getAvailableEditorType(e),r=this.getPropertyEditorParams(e,["Variable"],"label",{},{newVariablePrefix:"",newVariableType:"String"});let c=d;this.formRule&&(c=d.filter(b=>b.key!=="image"&&b.key!=="rich-text-editor"&&b.key!=="avatar"));const f={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",$converter:"/converter/change-editor.converter",parentPropertyID:"editor",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:c,readonly:!s}},titleSourceType:{description:"标签来源类型",title:"标签类型",type:"string",refreshPanelAfterChanged:!0,editor:{type:"combo-list",textField:"name",valueField:"id",idField:"id",editable:!1,data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},defaultValue:"static"},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter",visible:!e.titleSourceType||e.titleSourceType==="static"},titleDataSource:{description:"标签",title:"标签",type:"string",editor:r,visible:e.titleSourceType==="dynamic"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]},defaultValue:((u=e.editor)==null?void 0:u.type)==="image"?"none":"visible"},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!0},title:"绑定编辑器",editorParams:{componentSchema:e,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"},refreshPanelAfterChanged:!0,readonly:this.formSchemaUtils.designerMode==="PC_RTC"&&!e.isRtcControl}},setPropertyRelates(b,h,m){if(b)switch(b&&b.propertyID){case"type":{a.changeControlType(e,b,l);break}case"label":{b.needRefreshControlTree=!0;break}case"binding":{a.changeBindingField(e,b,m);break}case"titleDataSource":{a.afterMutilEditorChanged(e,b);break}}}};return i.toLocaleLowerCase()!=="card"&&(f.hide=!0,delete f.properties.showLabelType),f}getExpandProperties(e,l="Card"){const i=this,a=["Const","Variable"],s=this.getPropertyEditorParams(e,a,"expandable"),d=this.getPropertyEditorParams(e,a,"expandDisabled");return l==="Card"?{description:"Expand Information",hide:!!this.formRule,title:"扩展区域",properties:{expandable:{description:"扩展区域是指输入框右侧的区域,常用于展示自定义按钮或者文本,以便于丰富输入控件的展示内容。",title:"启用扩展区域",refreshPanelAfterChanged:!0,$converter:"/converter/property-editor.converter",editor:s},expandMode:{description:"静态文本:扩展内容不可点击;交互式按钮:扩展内容可以点击并配置交互事件。",title:"扩展模式",type:"enum",refreshPanelAfterChanged:!0,$converter:"/converter/property-editor.converter",editor:{data:[{id:"text",name:"静态文本"},{id:"button",name:"交互按钮"}]},defaultValue:"text",visible:!!e.editor.expandable},expandContent:{$converter:"/converter/property-editor.converter",description:"扩展区域内展示的文本内容",title:"扩展内容",type:"string",visible:!!e.editor.expandable,editor:{type:"code-editor",language:"html"}},expandDisabled:{$converter:"/converter/property-editor.converter",description:"是否动态隐藏扩展区域,常用于根据变量或自定义条件配置扩展区域的隐藏状态。",title:"隐藏扩展区域",editor:d,visible:!!e.editor.expandable}},setPropertyRelates(c,f){if(c)switch(c.propertyID){case"expandable":case"expandDisabled":i.afterMutilEditorChanged(e,c);break}}}:{properties:{}}}checkCanChangeControlType(e,l){if(!e.binding)return!1;if(e.binding.type==="Variable"){if(this.bindingVarible=this.formSchemaUtils.getVariableById(e.binding.field),!this.bindingVarible)return!1}else if(!this.designViewModelField||this.designViewModelField.$type!==D.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(e){var a,s;const l=this.checkCanChangeControlType(e,this.viewModelId);if(!l)return{canChangeControlType:!1,editorTypeList:[{key:e.editor.type,value:((a=y.DgControl[e.editor.type])==null?void 0:a.name)||e.editor.type}]};let i=[];return this.designViewModelField&&this.designViewModelField.$type===D.FormSchemaEntityField$Type.SimpleField?i=le.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(i=le.getEditorTypesByMDataType(this.bindingVarible.type,!!((s=this.designViewModelField)!=null&&s.multiLanguage))),{canChangeControlType:l,editorTypeList:i}}changeBindingField(e,l,i){l.needRefreshEntityTree=!0}getAppearanceProperties(e,l){const i=this;return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的内联样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},fill:{title:"填充宽度",description:"启用后,控件占满父容器宽度",type:"boolean",parentPropertyID:"appearance",defaultValue:!1},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!i.formRule,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",beforeOpen:()=>i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,i.componentId)}}},setPropertyRelates(a,s){if(a)switch(a&&a.propertyID){case"responseLayout":i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(a.propertyValue,i.componentId||e.id),i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId),i.updateElementByParentContainer(e.id,l),delete e.responseLayout;break;case"class":i.updateUnifiedLayoutAfterControlChanged(a.propertyValue,e.id,this.componentId),y.canvasChanged.value++;break;case"style":{y.canvasChanged.value++;break}}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,l,i){var m;const a=l.propertyValue,s=i&&i.parent&&i.parent.schema;if(!s)return;const d=s.contents.findIndex(p=>p.id===e.id);if(d===-1)return;const r=s.contents[d];let c;if(this.designViewModelField){const E=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(B=>B.id===this.designViewModelField.id).fieldSchema||{};E.editor||(E.editor={}),E.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,E,!1),c=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)}c||(c=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(c,{id:r.id,appearance:r.appearance,size:r.size,label:r.label,binding:r.binding}),Object.prototype.hasOwnProperty.call(r,"visible")&&Object.assign(c,{visible:r.visible}),r.editor&&["readonly","required","placeholder"].map(p=>{Object.prototype.hasOwnProperty.call(r.editor,p)&&(c.editor[p]=r.editor[p])});const f=["image","avatar"],u=r.editor.type&&f.indexOf(r.editor.type)>-1,b=((m=c.editor)==null?void 0:m.type)&&f.indexOf(c.editor.type)>-1;u&&r.showLabelType==="none"&&!b&&(c.showLabelType="visible"),i!=null&&i.updateContextSchema?i.updateContextSchema(c):(i.schema=Object.assign(r,c),Object.assign(e,c)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(p=>p.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(p=>p.classList.remove("dgComponentFocused")),["time-picker","date-picker","lookup","combo-list","number-spinner","input-group","textarea","rich-text-editor","language-textbox"].includes(e.editor.type)||(e.enableTips=!1),y.canvasChanged.value++,o.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getTipsConfig(e){return["time-picker","date-picker","lookup","combo-list","number-spinner","input-group","textarea","rich-text-editor","language-textbox"].includes(e.editor.type)?{enableTips:{refreshPanelAfterChanged:!0,description:"",title:"启用提示",type:"boolean",default:!1,visible:!this.formRule},tipsContent:{description:"提示内容",title:"提示内容",type:"string",editor:{type:"code-editor",language:"html",leftTemplate:Ue},visible:!!e.enableTips&&!this.formRule}}:{}}getComponentConfig(e,l={},i={},a){var b,h,m;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},l),d=(b=e.binding)!=null&&b.field?["Const","Variable","StateMachine","Custom","Expression"]:["Const","Variable","StateMachine","Custom"],r=this.getPropertyEditorParams(e,d,"readonly"),c=this.getPropertyEditorParams(e,d,"required"),f={readonly:{description:"",title:"只读",editor:r},required:{description:"",title:"必填",type:"boolean",editor:c,visible:!!((h=e.binding)!=null&&h.field)&&((m=e.binding)==null?void 0:m.type)==="Form"},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}};for(const p in i)f[p]=Object.assign(f[p]||{},i[p]);const u=this;return{...s,properties:{...f},setPropertyRelates(p,V){if(p){switch(p.propertyID){case"readonly":case"required":case"label":u.afterMutilEditorChanged(e,p);break}a&&a.bind(u)(p,e,V)}}}}updateUnifiedLayoutAfterControlChanged(e,l,i){const a=e.split(" ");let s=a.find(u=>/^col-([1-9]|10|11|12)$/.test(u)),d=a.find(u=>/^col-md-([1-9]|10|11|12)$/.test(u)),r=a.find(u=>/^col-xl-([1-9]|10|11|12)$/.test(u)),c=a.find(u=>/^col-el-([1-9]|10|11|12)$/.test(u));s=s||"col-12",d=d||"col-md-"+s.replace("col-",""),r=r||"col-xl-"+d.replace("col-md-",""),c=c||"col-el-"+r.replace("col-xl-","");const f={id:l,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(d.replace("col-md-",""),10),columnInLG:parseInt(r.replace("col-xl-",""),10),columnInEL:parseInt(c.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(i,f)}updateUnifiedLayoutAfterResponseLayoutChanged(e,l){const{formNode:i}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!i||!i.unifiedLayout)return;const a=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i,a,1),l){const m=a.find(p=>p.id===l.id);Object.assign(m||{},l)}const s=a.map(m=>m.columnInSM),d=a.map(m=>m.columnInMD),r=a.map(m=>m.columnInLG),c=a.map(m=>m.columnInEL),f=this.checkIsUniqueColumn(s)?s[0]:null,u=this.checkIsUniqueColumn(d)?d[0]:null,b=this.checkIsUniqueColumn(r)?r[0]:null,h=this.checkIsUniqueColumn(c)?c[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:f,uniqueColClassInMD:u,uniqueColClassInLG:b,uniqueColClassInEL:h})}checkIsUniqueColumn(e){const l=new Set(e);return Array.from(l).length===1}getItemCollectionEditor(e,l,i){return l=l||"value",i=i||"name",{editor:{columns:[{field:l,title:"值",dataType:"string"},{field:i,title:"名称",dataType:"string"}],type:"item-collection-editor",valueField:l,nameField:i,requiredFields:[l,i],uniqueFields:[l,i],readonly:this.checkEnumDataReadonly(e)}}}checkEnumDataReadonly(e){return!e.binding||e.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===D.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(e,l){e.binding&&e.binding.type===te.Form&&e.binding.field?(l.find(i=>i.label==="fieldValueChanging"),l.find(i=>i.label==="fieldValueChanged"),this.designViewModelField&&(e.fieldValueChanging=this.designViewModelField.valueChanging,e.fieldValueChanged=this.designViewModelField.valueChanged)):l=l.filter(i=>i.label!=="fieldValueChanging"&&i.label!=="fieldValueChanged")}getControlMethodType(e){if(!e.binding)return e.type;switch(e.binding.type){case te.Form:return e.binding.path||e.type;case te.Variable:return e.binding.fullPath||e.type}return e.type}updateLinkedLabel(e,l){if(e.boundEventsList&&e.boundEventsList.length>0){const i=e.boundEventsList.find(a=>a.boundEvents&&a.boundEvents.label==="onClickLabel");l.linkLabel=!!i}else l.linkLabel=!1}getInputCommonEvents(e){return!e.binding||e.binding.type===te.Variable?[{label:"onClickLabel",name:"标签点击事件"}]:this.formRule?[{label:"onClickLabel",name:"标签点击事件"}]:[...this.formGroupEvents]}getEventPropertyConfig(e,l="card",i,a){const s=this;let d=this.getInputCommonEvents(e);if(["time-picker","date-picker","lookup","combo-list","number-spinner","input-group"].includes(e.editor.type)&&d.push({label:"onClear",name:"清空事件"}),i&&(d=d.concat(i)),d.length===0)return{title:"事件",hideTitle:!0,properties:{},tabId:D.EVENT_PROPERTY_TAB_IDS,tabName:"交互",hide:!0};this.appendFieldValueChangeEvents(e,d);const c=s.eventsEditorUtils.formProperties(e,s.viewModelId,d);return{title:"事件",hideTitle:!0,properties:s.createBaseEventProperty(c),tabId:D.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(b,h){const m=b.propertyValue;delete e[s.viewModelId],m&&(m.setPropertyRelates=this.setPropertyRelates,m.controlInfo={type:s.getControlMethodType(e),name:e.title},s.eventsEditorUtils.saveRelatedParameters(e,s.viewModelId,m.events,m),s.updateLinkedLabel(m,e)),a&&a(b,e,m);const p=s.designViewModelUtils.getDgViewModel(s.viewModelId);p&&s.designViewModelField&&p.changeField(s.designViewModelField.id,{valueChanging:e.fieldValueChanging||"",valueChanged:e.fieldValueChanged||""})}}}getExpressionConfig(e,l,i=["compute","dependency","validate"],a){return this.expressionProperty.getExpressionConfig(e,l,i,a)}getBindingDataType(e){return this.formRule?(e==null?void 0:e.dataType)||"string":this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(e){return this.getBindingDataType(e)==="number"?this.numberEditorOptions:{}}updatePropertyValue(e,l,i){var a;e.editor[l]!==i?e.editor[l]=i:(a=this.getFormDesignerInstance())==null||a.reloadPropertyPanel()}setBooleanValue(e,l,i){let a=i;this.getBindingDataType()==="string"&&(a=(a||"").trim()||(l==="trueValue"?"true":"false"));const d=l==="trueValue"?"falseValue":"trueValue";e.editor[d]===a&&(a=a+1),this.updatePropertyValue(e,l,a)}getBooleanValueConverter(){return{convertFrom:(e,l)=>e.editor[l],convertTo:(e,l,i)=>{this.setBooleanValue(e,l,i)}}}}class Ge extends We{constructor(t,e){super(t,e)}getEditorProperties(t){const e=this;return e.getComponentConfig(t,{type:"radio-group"},{disabled:{visible:!1},placeholder:{visible:!1},direction:{description:"",title:"排列方向",type:"enum",editor:{data:[{id:"horizontal",name:"横向"},{id:"vertical",name:"纵向"}]}},dataSourceType:{description:"",title:"数据源类型",type:"enum",visible:!1,editor:{default:"static",data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},data:{description:"",title:"数据",type:"array",visible:!t.editor.dataSourceType||t.editor.dataSourceType==="static",...e.getItemCollectionEditor(t,t.editor.valueField,t.editor.textField),refreshPanelAfterChanged:!0},bindDataSource:{description:"",title:"绑定数据源",type:"string",visible:t.editor.dataSourceType==="dynamic"},textField:{description:"",title:"文本字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},valueField:{description:"",title:"值字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"}},this.setEditorPropertyRelates)}setEditorPropertyRelates(t,e,l){if(!t||!e.editor)return;const i=this;switch(t.propertyID){case"dataSourceType":{t.propertyValue==="static"&&(e.editor.valueField="value",e.editor.textField="name");break}case"data":{!i.checkEnumDataReadonly(e)&&e.formatter&&(e.formatter.data=[...t.propertyValue]);break}}}changeBindingField(t,e,l){var a;super.changeBindingField(t,e);const i=l;t.editor&&((a=i==null?void 0:i.type)==null?void 0:a.$type)===D.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=i.type.enumValues||[])}}function _e(n,t){const e=n.schema;function l(i,a){return new Ge(i,t).getPropertyConfig(e,a)}return{getPropsConfig:l}}const ne=o.defineComponent({name:"FRadioGroupDesign",props:Ae,emits:["changeValue","update:modelValue"],setup(n,t){const e=o.ref(n.modelValue),{enumData:l,getValue:i,getText:a}=je(n,t,e),s=o.computed(()=>({"farris-checkradio-hor":n.direction==="horizontal","farris-checkradio-ver":n.direction==="vertical"})),d=o.ref(),r=o.inject("designer-host-service"),c=o.inject("design-item-context"),f=_e(c,r),u=y.useDesignerComponent(d,c,f);o.onMounted(()=>{d.value.componentInstance=u});const b=o.computed(()=>{if(!l.value||l.value.length===0){const h=[];return[{value:"example1",name:"示例一"},{value:"example2",name:"示例二"}].map(m=>{const p={};p[n.valueField]=m.value,p[n.textField]=m.name,h.push(p)}),h}return l.value});return t.expose(u.value),()=>o.createVNode("div",{class:["farris-input-wrap",s.value],ref:d},[b.value.map((h,m)=>{const p="radio_"+n.name+m;return o.createVNode("div",{class:"custom-control custom-radio"},[o.createVNode("input",{type:"radio",class:"custom-control-input",name:n.name,id:p,value:i(h),disabled:!0},null),o.createVNode("label",{class:"custom-control-label",for:p},[a(h)])])})])}}),Ke={id:{type:String,default:""},buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},buttonBehavior:{type:String,default:"Popup"},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},showButtonWhenDisabled:{type:Boolean,default:!1},showAppendButton:{type:Boolean,default:!0},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:{type:Number},tabIndex:Number,popupHost:{type:Object},popupRightBoundary:{type:Object},popupOffsetX:{type:Object,default:0},popupOffsetY:{type:Object,default:0},popupOnInput:{type:Boolean,default:!1},popupOnFocus:{type:Boolean,default:!1},popupOnClick:{type:Boolean,default:!1},popupClass:{type:String,default:""},popupMinWidth:{type:Number,default:160},modalOptions:{type:Object,default:{}},wrapText:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","},textAlign:{type:String,default:"left"},beforeClickButton:{type:Function,default:null},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},beforeOpen:{type:Function,default:null},updateOn:{type:String,default:"change"},keepWidthWithReference:{type:Boolean,default:!0},placement:{type:String,default:"bottom-left"},limitContentBySpace:{type:Boolean,default:!1},beforeClosePopup:{type:Function,default:null},expandable:{type:Boolean,default:!1},expandMode:{type:String,default:"text"},expandContent:{type:String,default:""},expandDisabled:{type:Boolean,default:!1}},Xe={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object},backgroundColor:{type:String,default:""}};function Ye(){const n=o.ref(!1);return o.onMounted(()=>{n.value=!0}),n}const Je=o.defineComponent({name:"FOverlay",props:Xe,emits:["click"],setup(n,t){const e=o.ref(n.popupContentPosition),l=o.ref(n.host),i=Ye(),a=o.computed(()=>({backgroundColor:n.backgroundColor||"",pointerEvents:"auto"}));function s(r){t.emit("click"),r.preventDefault(),r.stopPropagation()}o.computed(()=>{const r=l.value;if(r){const c=r.getBoundingClientRect(),{left:f,top:u,height:b}=c;return{left:f,top:u+b}}return e.value});const d=o.computed(()=>({}));return()=>i.value?o.createVNode(o.Teleport,{to:"body"},{default:()=>{var r,c;return[o.createVNode("div",{class:"overlay-container",onClick:f=>s(f),style:a.value},[o.createVNode("div",{style:d.value},[(c=(r=t.slots).default)==null?void 0:c.call(r)])])]}}):null}});function Ze(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Qe(n){const t=document.createElement("div");t.style.display="contents";let e;const l=n.onClickCallback||(()=>{}),i=()=>{l(),e&&e.unmount()};return e=o.createApp({setup(){o.onUnmounted(()=>{document.body.removeChild(t)});const a=Ze(n);return()=>o.createVNode(Je,{"popup-content-position":n.popupPosition,host:n.host,onClick:i,backgroundColor:n.backgroundColor},{default:()=>[a&&a()]})}}),document.body.appendChild(t),e.mount(t),e}class et{static show(t){return Qe(t)}}const tt={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showFloatingClose:{type:Boolean,default:!1},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},openedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},position:{type:String,default:"center"},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},maximized:{type:Boolean,default:!1},useTransform:{type:Boolean,default:!0}};class q{constructor(t,e){this.x=t,this.y=e}static getTransformInfo(t){const l=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(l.length>=6){const i=parseInt(l[4],10),a=parseInt(l[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(t,e=null){if(this.isMouseEvent(t))return new q(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new q(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let l=0;l<t.changedTouches.length;l++)if(t.changedTouches[l].target===e)return new q(t.changedTouches[l].clientX,t.changedTouches[l].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const e=new q(0,0);if(window){const l=window.getComputedStyle(t);if(l){const i=parseInt(l.getPropertyValue("left"),10),a=parseInt(l.getPropertyValue("top"),10);e.x=isNaN(i)?0:i,e.y=isNaN(a)?0:a}return e}return null}static copy(t){return new q(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class J{constructor(t,e){this.width=t,this.height=e}static getCurrent(t){const e=new J(0,0);if(window){const l=window.getComputedStyle(t);return l&&(e.width=parseInt(l.getPropertyValue("width"),10),e.height=parseInt(l.getPropertyValue("height"),10)),e}return null}static copy(t){return new J(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function nt(n,t){const e=o.ref(),l=o.ref(),i=o.ref(),a=o.ref(),s=o.ref(),d=o.ref(),r=o.ref(),c=o.ref(),f=o.ref(),u=o.ref(),b=o.ref(),h=o.ref(n.resizeable),m=o.ref(),p=o.ref(n.draggable),V=o.ref(!1);function E(){const w=l.value||document.body,M=window.getComputedStyle(w);if(!M||!e.value)return;const P=q.getTransformInfo(e.value),L={};r.value&&(L.deltaL=e.value.offsetLeft-r.value.x,L.deltaT=e.value.offsetTop-r.value.y);const U=M.getPropertyValue("position");L.width=w.clientWidth,L.height=w.clientHeight,L.pr=parseInt(M.getPropertyValue("padding-right"),10),L.pb=parseInt(M.getPropertyValue("padding-bottom"),10),L.position=M.getPropertyValue("position"),U==="static"&&(w.style.position="relative"),L.translateX=P.x,L.translateY=P.y,u.value=L}function x(w){if(e.value){a.value=J.getCurrent(e.value),s.value=q.getCurrent(e.value),d.value=a.value?J.copy(a.value):null,r.value=s.value?q.copy(s.value):null,E();const M=w.target.getAttribute("type")||"";c.value={n:!!M.match(/n/),s:!!M.match(/s/),w:!!M.match(/w/),e:!!M.match(/e/)}}}function B(){var w,M,P,L;if(e.value){const U=e.value;c.value&&((c.value.n||c.value.s)&&((w=d.value)!=null&&w.height)&&(U.style.height=d.value.height+"px"),(c.value.w||c.value.e)&&((M=d.value)!=null&&M.width)&&(U.style.width=d.value.width+"px"),r.value&&((P=r.value)!=null&&P.x&&(U.style.left=r.value.x+"px"),(L=r.value)!=null&&L.y&&(U.style.top=r.value.y+"px")))}}function R(){const w=n.minHeight?n.minHeight:1,M=n.minWidth?n.minWidth:1;d.value&&r.value&&c.value&&a.value&&(d.value.height<w&&(d.value.height=w,c.value.n&&s.value&&(r.value.y=s.value.y+(a.value.height-w))),d.value.width<M&&(d.value.width=M,c.value.w&&s.value&&(r.value.x=s.value.x+(a.value.width-M))),n.maxHeight&&d.value.height>n.maxHeight&&(d.value.height=n.maxHeight,s.value&&c.value.n&&(r.value.y=s.value.y+(a.value.height-n.maxHeight))),n.maxWidth&&d.value.width>n.maxWidth&&(d.value.width=n.maxWidth,c.value.w&&s.value&&(r.value.x=s.value.x+(a.value.width-n.maxWidth))))}function j(){if(l.value){const w=u.value;if(r.value&&d.value&&c.value&&a.value){const M=w.width-w.pr-w.deltaL-w.translateX-r.value.x,P=w.height-w.pb-w.deltaT-w.translateY-r.value.y;c.value.n&&r.value.y+w.translateY<0&&s.value&&(r.value.y=-w.translateY,d.value.height=a.value.height+s.value.y+w.translateY),c.value.w&&r.value.x+w.translateX<0&&s.value&&(r.value.x=-w.translateX,d.value.width=a.value.width+s.value.x+w.translateX),d.value.width>M&&(d.value.width=M),d.value.height>P&&(d.value.height=P)}}}function z(w){if(!i.value||!a.value||!s.value||!c.value)return;w.subtract(i.value);const M=w.x,P=w.y;c.value.n?(r.value.y=s.value.y+P,d.value.height=a.value.height-P):c.value.s&&(d.value.height=a.value.height+P),c.value.e?d.value.width=a.value.width+M:c.value.w&&(d.value.width=a.value.width-M,r.value.x=s.value.x+M),j(),R(),B()}function v(w){if(!f.value)return;const M=q.fromEvent(w);M&&z(M)}function C(){if(e.value){const{width:w,height:M,x:P,y:L}=e.value.getBoundingClientRect(),U=q.getTransformInfo(e.value);return{size:{width:w,height:M},position:{x:P-U.x,y:L-U.y}}}return null}function I(w){if(e.value){const M=C();b.value=M}i.value=void 0,a.value=null,s.value=null,d.value=null,r.value=null,c.value=null,f.value=null,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",I)}function N(){document.addEventListener("mousemove",v),document.addEventListener("mouseup",I)}function F(w){w instanceof MouseEvent&&w.button===2||p.value&&(document.body.click(),w.stopPropagation(),w.preventDefault(),i.value=q.fromEvent(w),f.value=w.target,x(w),N())}function S(w){return e.value=w,h.value&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:M=>F(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:M=>F(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:M=>F(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:M=>F(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:M=>F(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:M=>F(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:M=>F(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:M=>F(M)},null)])}function O(w=!0){document.body.click();const M=l.value||document.body,P=J.getCurrent(M),L=e.value;w&&L&&(m.value=C(),m.value.transform=L.style.transform),P&&L&&(d.value=P,d.value.height-=14,d.value.width-=14,L.style.height=d.value.height+"px",L.style.width=d.value.width+"px",L.style.left="7px",L.style.top="7px",L.style.transform="",b.value={size:d.value,position:{x:0,y:0}},p.value=!1,V.value=!0)}function W(){var w,M;if(document.body.click(),m.value){const P={width:m.value.size.width||0,height:m.value.size.height||0},L={x:(window.innerWidth-P.width)/2,y:(window.innerHeight-P.height)/2};(w=d.value)==null||w.set(P),(M=r.value)==null||M.set(L);const U=e.value;U.style.height=P.height+"px",U.style.width=P.width+"px",U.style.left=`${L.x}px`,U.style.top=`${L.y}px`,U.style.transform="",b.value={size:P,position:L},p.value=n.draggable,V.value=!1}}function X(){if(e.value){const w=J.getCurrent(e.value);if(w){const{width:M,height:P}=w;e.value.style.left=`${(window.innerWidth-M)/2}px`,e.value.style.top=`${(window.innerHeight-P)/2}px`,e.value.style.transform=""}}}function G(){const w=()=>{V.value?O(!1):X(),document.body.click()};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}}const _=G();return{renderResizeBar:S,boundingElement:l,resizedEventParam:b,maximize:O,restore:W,allowDrag:p,isMaximized:V,unWindowResizeHandle:_,moveToCenter:X}}function ot(n,t,e){const l=o.ref(),i=o.ref(n.draggable),a=o.ref(n.lockAxis),s=o.ref(),d=o.ref(),r=o.ref(!1),c=o.ref(new q(0,0)),f=o.ref(new q(0,0)),u=o.ref(new q(0,0)),b=o.ref(new q(0,0));o.watch(()=>e.value,v=>{s.value.style.cursor=v?"move":"default"});function h(v,C){if(C.tagName==="BUTTON")return!1;if(C===v)return!0;for(const I in C.children)if(Object.prototype.hasOwnProperty.call(C.children,I)&&h(v,C.children[I]))return!0;return!1}function m(){var N,F;let v=u.value.x+f.value.x,C=u.value.y+f.value.y;a.value==="x"?(v=((N=c.value)==null?void 0:N.x)||0,u.value.x=0):a.value==="y"&&(C=((F=c.value)==null?void 0:F.y)||0,u.value.y=0);const I=`translate3d(${Math.round(v)}px, ${Math.round(C)}px, 0px)`;l.value&&(l.value.style.transform=I),b.value.x=v,b.value.y=C}function p(){if(!d.value||!l.value)return null;const v=d.value.getBoundingClientRect(),C=l.value.getBoundingClientRect(),I={top:v.top<C.top,right:v.right>C.right,bottom:v.bottom>C.bottom,left:v.left<C.left};return I.top||(u.value.y-=C.top-v.top),I.bottom||(u.value.y-=C.bottom-v.bottom),I.right||(u.value.x-=C.right-v.right),I.left||(u.value.x-=C.left-v.left),m(),I}function V(v){v&&(c.value&&v.subtract(c.value),u.value.set(v),m(),p())}function E(v){r.value&&i.value&&(v.stopPropagation(),v.preventDefault(),V(q.fromEvent(v,s.value)))}function x(){var v;if(r.value){if(r.value=!1,f.value.add(u.value),u.value.reset(),(v=l.value)==null||v.classList.remove("ng-dragging"),!n.useTransform&&l.value){const{left:C,top:I}=l.value.getBoundingClientRect();l.value.style.left=Math.ceil(C)+"px",l.value.style.top=Math.ceil(I)+"px",l.value.style.transform="none"}t.emit("stopMove"),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",x)}}function B(){!r.value&&s.value&&(r.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",E),document.addEventListener("mouseup",x))}function R(){if(l.value){const v=q.getTransformInfo(l.value);f.value.set(v);return}f.value.reset()}function j(v){if(!e.value||v instanceof MouseEvent&&v.button===2)return;const C=v.target||v.srcElement;s.value!==void 0&&C&&!h(C,s.value)||i.value!==!1&&(document.body.click(),v.stopPropagation(),v.preventDefault(),c.value=q.fromEvent(v,l.value),R(),B())}function z(v,C,I){if(i.value&&C){if(v)s.value=v;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const N=C.querySelector(n.dragHandle);N&&(s.value=N)}}l.value=C,d.value=I,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",j)):i.value=!1}}return{registerDraggle:z,resetTranslate:R}}function ge(n,t){if(n){const e=l=>{l.key.toLowerCase()===n.toLowerCase()&&t({event:l,key:n})};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}}function it(n,t){const e=o.ref(n.enableEsc);let l=null;return e.value?(l=ge("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:l}):null}function lt(n,t){const e=o.ref(n.enableEnter);let l=null;return e.value?(l=ge("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:l}):null}const oe=o.defineComponent({name:"FModal",props:tt,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove","buttonClick"],setup(n,t){const e=o.ref(n.width||300),l=o.ref(n.height||200),i=o.ref(n.modelValue),a=o.ref(""),s=o.ref(n.class),d=o.ref(n.fitContent),r=o.ref(n.showHeader),c=o.ref(""),f=o.ref(n.showCloseButton),u=o.ref(n.showMaxButton),b=o.ref(!1),h=o.ref(n.dialogType),m=o.ref(n.src),p=o.ref(""),V=o.ref(n.showButtons),E=o.ref(n.title),x=o.ref(n.containment||null),B=o.ref();E.value==="错误提示"&&(E.value=Y.LocaleService.getLocaleValue("messageBox.errorTitle"));const R=o.ref(!1);function j(){const g=document.querySelectorAll(".farris-modal").length;(!g||g-1<=0)&&B.value===document.querySelectorAll(".farris-modal")[0]&&document.body.classList.remove("modal-open"),B.value&&B.value.classList.remove("show")}function z(g,T){const H=T?"accept":"cancel";Promise.resolve().then(()=>{var $;return($=n.beforeClose)==null?void 0:$.call(n,{closeType:H})}).then($=>{$&&(i.value=!1,t.emit("update:modelValue",!1),T!=null&&t.emit(T?"accept":"cancel"),t.emit("closed",g),j())})}const v=[{name:"cancel",text:Y.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:g=>{z(g,!1)}},{name:"accept",text:Y.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:g=>{z(g,!0)}}],C=o.ref(n.buttons&&n.buttons.length?n.buttons:v),I=o.computed(()=>!!c.value),N=o.computed(()=>!!V.value&&!!C.value),F=o.ref(),S=o.ref(),O=o.ref(n.maximized||!1),{renderResizeBar:W,maximize:X,restore:G,boundingElement:_,resizedEventParam:w,allowDrag:M,unWindowResizeHandle:P,moveToCenter:L}=nt(n),{registerDraggle:U}=ot(n,t,M);function ke(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}o.watch(()=>n.title,(g,T)=>{g!==T&&(E.value=g)}),o.watch(()=>n.modelValue,(g,T)=>{g!==T&&(i.value=g,i.value&&n.draggable&&o.nextTick(()=>{S.value&&!x.value&&(x.value=S.value.parentElement,_.value=x.value,U(F.value,S.value,_.value),L())}),g||(x.value&&(x.value=null),j())),i.value?R.value=ke():(O.value=!1,M.value=n.draggable)}),o.watch(()=>n.showHeader,(g,T)=>{g!==T&&(r.value=g)}),o.watch(()=>n.showButtons,(g,T)=>{g!==T&&(V.value=g)}),o.watch(()=>w.value,(g,T)=>{const H=g||{},$=T||{};JSON.stringify(H)!==JSON.stringify($)&&t.emit("resize",{newSize:g,oldSize:T,isMaximized:O.value})}),o.watch([()=>n.width,()=>n.height],(g,T)=>{(g[0]!==T[0]||g[1]!==T[1])&&(e.value=g[0]||500,l.value=g[1]||600)}),o.watch(()=>n.class,(g,T)=>{s.value=g});const se=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),Bt=o.computed(()=>{var H;const g={modal:!0,"farris-modal":!0,fade:!0,"fe-cmp-page-modal":!!n.showFloatingClose};g["f-modal-fitContent"]=!!d.value,g.show=!!se.value;const T=(H=n.maskClass)==null?void 0:H.split(" ");return T==null||T.reduce(($,Q)=>($[Q]=!0,$),g),g}),St=o.computed(()=>{var H;const g={"modal-dialog":!0},T=(H=s.value)==null?void 0:H.split(" ");return T==null||T.reduce(($,Q)=>($[Q]=!0,$),g),g}),Pt=()=>D.isMobilePhone()&&!n.isMessager||!!n.fullscreen,Nt=o.computed(()=>{const g=document.documentElement.clientWidth,T=document.documentElement.clientHeight;if(O.value)return{position:"fixed",top:"0px",left:"0px",width:"100vw",height:"100vh",margin:"0"};const H=Math.min(e.value,g),$=n.position==="right"?"100%":d.value?"auto":`${Math.min(l.value,T-10)}px`,Q=`${(window.innerHeight-($==="100%"||$==="auto"?0:parseInt($)))/2}px`,Zt=n.position==="right"?`${window.innerWidth-H}px`:`${(window.innerWidth-H)/2}px`,Se={position:"absolute",top:Q,left:Zt,width:D.isMobilePhone()?"auto":`${H}px`,height:$};return n.mask||(Se.pointerEvents="auto"),Se}),Te=o.ref(D.getMaxZIndex()||1050),Rt=o.computed(()=>{const g={display:"block",overflow:"hidden"};return n.mask||(g.pointerEvents="none",g.backgroundColor="transparent"),R.value&&(g.backgroundColor="transparent"),g.zIndex=Te.value,g}),Ot=o.computed(()=>({"modal-content":!0,"modal-content-has-header":r.value,"is-mobile":Pt()})),Lt=o.computed(()=>{const g={display:r.value?"":"none"};return g["pointer-events"]=M.value?"auto":"none",g}),Dt=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:O.value})),At=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":h.value==="iframe","f-utils-fill":!0}));function jt(){return{height:`${n.footerHeight||60}px`}}const zt=o.computed(()=>{const g={textAlgin:p.value},T=jt();return Object.assign(g,T)});function fe(g){if(g==null||g.stopPropagation(),O.value){O.value=!1,G();return}X(),O.value=!0}async function Ht(g,T){g.handle?await g.handle(T,g)&&t.emit("closed",T):t.emit("buttonClick",{button:g,$event:T})}function $t(g){g.width&&(e.value=g.width),g.height&&(l.value=g.height),g.buttons&&(C.value=g.buttons),g.title&&(E.value=g.title)}let pe=null,me=null;o.onBeforeMount(()=>{R.value=ke()}),o.onMounted(()=>{S.value&&!x.value&&(x.value=S.value.parentElement,_.value=x.value,U(F.value,S.value,_.value)),se.value&&document.body.classList.add("modal-open"),pe=it(n,t),me=lt(n,t)}),o.onUnmounted(()=>{P&&P(),pe&&pe.remove(),me&&me.remove()}),t.expose({modalElementRef:S,updateModalOptions:$t,close:z,maxDialog:fe,isMaximized:O,disableButtons:(g,T=!0)=>{C.value.forEach(H=>{H.name&&g.includes(H.name)&&(H.disabled=T)})}});function qt(){return o.createVNode("div",{class:"action-wrapper",onClick:g=>z(g,!1)},[o.createVNode("span",{class:"close-icon"},[o.createVNode("i",{class:"f-icon f-icon-close"},null)])])}function Ut(){return o.createVNode("ul",null,[b.value&&o.createVNode("li",{class:"f-btn-icon f-bare"},[o.createVNode("span",{class:"f-icon modal_minimize"},null)]),u.value&&o.createVNode("li",{onClick:fe,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:Dt.value},null)]),f.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:g=>z(g,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}const Wt=g=>{g.preventDefault();const T=g.currentTarget,H=g.deltaY*.5;T.scrollLeft+=H};function Gt(){return o.createVNode("div",{class:"modal-footer",style:zt.value},[C.value&&o.createVNode("div",{class:"buttons",onWheel:Wt},[C.value.map(g=>{var $;const T=o.ref(g.disabled),H=g.class||(($=g.appearance)==null?void 0:$.class);return o.createVNode("button",{name:g.name,style:g.styles,type:"button",disabled:T.value,class:H+(g.iconClass?" btn-icontext":"")+(g.visible===!1?"d-none":""),onClick:Q=>{Ht(g,Q)}},[!!g.iconClass&&o.createVNode("i",{class:g.iconClass},null),g.text])})])])}function Be(g){u.value&&fe()}function _t(){return o.createVNode(o.Fragment,null,[O.value&&o.createVNode("div",{class:"modal-header",style:"position: absolute;background: transparent;height: 45px;width: 100%;",onDblclick:g=>Be()},null),o.createVNode("div",{ref:F,class:"modal-header",style:Lt.value,onDblclick:g=>Be()},[t.slots.headerTemplate?t.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[I.value&&o.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[E.value])]),o.createVNode("div",{class:"actions"},[Ut()])])])}function Kt(){return t.slots.footerTemplate?t.slots.footerTemplate():N.value&&Gt()}function Xt(g){if(g.stopPropagation(),n.allowClickMaskToClose){if(g.target!==B.value)return;z(g,!1)}}function Yt(){var g,T;return o.createVNode("div",{id:a.value,class:St.value,style:Nt.value,ref:S},[n.showFloatingClose&&qt(),o.createVNode("div",{class:Ot.value},[r.value&&_t(),o.createVNode("div",{class:At.value},[(T=(g=t.slots).default)==null?void 0:T.call(g),h.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:m.value},null)]),Kt()]),!d.value&&S.value&&!O.value&&W(S.value)])}function Jt(g){return g||"body"}return o.watchEffect(()=>{se.value&&(Te.value=D.getMaxZIndex()||1050)}),()=>o.createVNode(o.Teleport,{to:Jt(n.host)},{default:()=>[se.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:B,class:Bt.value,style:Rt.value,onClick:Xt},[Yt()])]})]})}});function ye(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function at(n){const t=document.createElement("div");t.style.display="contents";const e=o.createApp({setup(l,i){o.onUnmounted(()=>{document.body.removeChild(t)});const a=o.ref(),s=o.ref(n.class||""),d=o.ref(!!n.showButtons),r=o.ref(!!n.showHeader),c=o.ref(n.showCloseButton==null?!0:n.showCloseButton),f=o.ref(!!n.showFloatingClose),u=o.ref(!0),b=o.ref(n.title||""),h=n.acceptCallback||(()=>{}),m=n.rejectCallback||(()=>{}),p=n.closedCallback||(R=>{}),V=n.resizeHandle||(R=>{}),E=n.stopMoveHandle||(R=>{}),x=ye(n),B=R=>{u.value=!1,e.unmount(),p(R)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(oe,{ref:a,class:s.value,modelValue:u.value,"onUpdate:modelValue":R=>u.value=R,title:b.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":r.value,"show-buttons":d.value,"show-close-button":c.value,"show-max-button":!1,showFloatingClose:f.value,onAccept:h,onCancel:m,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:B,onResize:V,onStopMove:E},{default:()=>[x&&x(e)]})}});return document.body.appendChild(t),e.use(Y.LocaleService.i18n),e.mount(t),e}class st{constructor(t){k(this,"appContext",null);k(this,"modalRef",o.ref());k(this,"activeModalIndex",o.ref(0));k(this,"modalRefs",{});k(this,"isUseEscCloseModal",o.ref(!1));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.modalRefs[this.activeModalIndex.value]}adaptToWindow(t,e){const{width:l,height:i}={width:window.innerWidth,height:window.innerHeight};return l<t&&(t=l-14),i<e&&(e=i-14),{width:t,height:e}}static show(t){const e=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return at(e)}close(t){var e,l;t?(l=t.value)==null||l.close():(e=this.getCurrentModal())==null||e.close()}open(t){const e=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const l=o.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0,maximized:!1},t)),i=o.ref(!0),a=l.value.acceptCallback||(()=>{}),s=l.value.rejectCallback||(()=>{}),d=l.value.closedCallback||((C,I)=>{}),r=l.value.openedCallback||(C=>{}),c=l.value.resizeHandle||(C=>{}),f=t.stopMoveHandle||(C=>{});let u;const b=ye(l.value),h=C=>{var N;i.value=!1;const I=(N=C==null?void 0:C.target)==null?void 0:N.classList.contains("modal_close");d(C,this.isUseEscCloseModal.value?"esc":I?"icon":"button")},m=C=>{h(C),u&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,e),u=null,this.modalRef.value=null,this.modalRefs){const I=Object.keys(this.modalRefs).map(N=>Number(N));I.length>0?this.activeModalIndex.value=Math.max(...I):this.activeModalIndex.value=0,this.modalRefs[this.activeModalIndex.value]&&(this.modalRef.value=this.modalRefs[this.activeModalIndex.value])}this.isUseEscCloseModal.value=!1})},p=C=>{var I;this.isUseEscCloseModal.value=!0,(I=this.getCurrentModal())==null||I.close(C==null?void 0:C.event)},{width:V,height:E}=l.value,x=this.adaptToWindow(V||500,E||320);Object.assign(l.value,x);const B=o.ref(),R=()=>o.createVNode(oe,o.mergeProps({ref:B,modelValue:i.value,"onUpdate:modelValue":C=>i.value=C},l.value,{isMessager:l.value.class&&l.value.class.indexOf("modal-message")>-1,onAccept:a,onCancel:s,onClosed:m,onResize:c,onEsc:p,onStopMove:f,maximized:l.value.maximized}),{default:()=>[b&&b(this.app)]});u=(C=>{const I=o.h(R,C);return I.appContext=this.appContext,o.render(I,e),I})({...l.value}),this.activeModalIndex.value++;const z=this.activeModalIndex.value;this.modalRefs[z]=B.value;const v=C=>{l.value={...l.value,...C},u&&o.render(o.cloneVNode(u,{...l}),e)};return o.nextTick(()=>{this.modalRefs[z]=B.value,this.modalRef.value=B.value,r(new Event("opened"))}),{update:v,destroy:m,modalRef:B,close:()=>{var C;(C=B.value)==null||C.close()},disableButtons:(C,I=!0)=>{var N;(N=B.value)==null||N.disableButtons(C,I)}}}}const be=Symbol("FModalService");oe.install=n=>{n.component(oe.name,oe);const t=new st(n);n.provide(be,t),n.provide("FModalService",t)};function ve(n,t){function e(){const l=n.beforeOpen||n.beforeClickButton||null;let i=Promise.resolve(!0);if(l){const a=l(t.value);if(typeof a>"u")return i;typeof a=="boolean"?i=Promise.resolve(a):i=a}return i}return{judgeCanOpen:e}}function rt(n,t,e,l,i){const a=o.ref(n.buttonBehavior),s=o.ref(n.popupOnInput),d=o.computed(()=>({"input-group-append":!0,"append-force-show":n.showButtonWhenDisabled&&(n.readonly||n.disable)})),{judgeCanOpen:r}=ve(n,i),c=o.computed(()=>n.showButtonWhenDisabled||(!n.editable||!n.readonly)&&!n.disable),f=o.inject(be,null),u=o.ref();async function b(p){if(await r()&&c.value){const V=!!t.slots.default;if(a.value==="Modal"){const E=n.modalOptions,x=f==null?void 0:f.open({...E,render:()=>t.slots.default&&t.slots.default()});u.value=x==null?void 0:x.modalRef}a.value==="Overlay"&&et.show({host:document.body,backgroundColor:"rgba(0,0,0,.15)",render:()=>t.slots.default&&t.slots.default()}),V&&a.value==="Popup"&&l.togglePopup(!0),V&&s.value&&l.hidePopup(),t.emit("clickButton",{origin:p,value:n.modelValue})}}function h(p){t.emit("mouseEnterIcon",p)}function m(p){t.emit("mouseLeaveIcon",p)}return{buttonGroupClass:d,onClickButton:b,onMouseEnterButton:h,onMouseLeaveButton:m,modalRef:u}}function dt(n,t,e,l,i,a){const s=o.ref(!1),d=o.computed(()=>n.enableClear&&!n.readonly&&!n.disable&&!D.isMobilePhone()),{changeTextBoxValue:r,hasClearClass:c}=a,f=o.ref(!1);function u(V){s.value=V,c.value=V}const b=o.computed(()=>d.value&&!!(i!=null&&i.value)&&f.value);o.watch(i,()=>{u(b.value)});function h(V){const E=!n.readonly&&!n.disable&&n.editable,x=!n.editable;V==null||V.stopPropagation(),(E||x)&&(r(""),i.value="",u(!s.value),t.emit("clear"))}function m(V){if(f.value=!0,!!d.value){if(!e.value){u(!1);return}!n.disable&&!n.readonly&&u(!0)}}function p(V){f.value=!1,d.value&&u(!1)}return{enableClearButton:d,showClearButton:s,onClearValue:h,onMouseEnterTextBox:m,onMouseLeaveTextBox:p}}function ut(n,t,e,l,i){const a=o.computed(()=>n.popupOnInput),s=o.computed(()=>n.popupOnFocus),{shouldPopupContent:d,closeAllPopover:r}=i,c=o.ref(!1),f=o.computed(()=>n.enableTitle?e.value:""),u=o.computed(()=>(n.disable||n.readonly)&&!n.forcePlaceholder?"":n.placeholder),b=o.computed(()=>n.readonly||!n.editable||D.isMobilePhone()),h=o.ref(!1),m=o.computed(()=>!n.disable&&h.value),p=o.computed(()=>({"text-left":n.textAlign==="left","text-center":n.textAlign==="center","text-right":n.textAlign==="right","form-control":!0,"f-utils-fill":!0})),V=o.computed(()=>({"input-group":!0,"f-state-disabled":n.disable,"f-state-editable":n.editable&&!n.disable&&!n.readonly,"f-state-readonly":n.readonly,"f-state-focus":m.value,"input-group--has-clear":n.enableClear&&c.value}));function E(F,S=!0){e.value=F,S&&(t.emit("change",F),t.emit("update:modelValue",F))}function x(F){d.value=!1,E(F,!0)}o.watch(()=>n.modelValue,F=>{e.value=F});function B(F){h.value=!1,t.emit("blur",F),F.stopPropagation()}function R(F){t.emit("click",F),r(),t.slots.default&&!n.disable&&!n.readonly&&n.popupOnClick&&i.togglePopup()}function j(F){!n.disable&&!n.readonly&&(h.value=!0,b.value||(t.emit("focus",F),s.value&&!d.value&&i.popup()))}function z(F){t.emit("input",F);const S=F.target.value;l.value=S,e.value!==S&&E(S,n.updateOn==="change"),a.value&&!d.value&&i.popup()}function v(F){F.target.tagName!=="INPUT"&&F.preventDefault(),F.stopPropagation()}function C(F){t.emit("keydown",F)}function I(F){F.key==="Enter"&&(a.value||s.value)&&i.hidePopup(),t.emit("keyup",F)}function N(F){const S=F.target.value;F.stopPropagation(),E(S)}return{hasFocusedTextBox:m,isTextBoxReadonly:b,textBoxClass:p,textBoxPlaceholder:u,textBoxTitle:f,inputGroupClass:V,hasClearClass:c,changeTextBoxValue:E,commitValue:x,onBlurTextBox:B,onClickTextBox:R,onFocusTextBox:j,onInput:z,onKeyDownTextBox:C,onKeyUpTextBox:I,onMouseDownTextBox:v,onTextBoxValueChange:N}}const Z="FarrisVue_PopoverInstancesKey";function ct(n,t,e,l){const i=o.ref(),a=o.ref(!1),{judgeCanOpen:s}=ve(n,l);o.watch(()=>i.value,(h,m)=>{window[Z]=window[Z]||new WeakMap,h?window[Z].set(e.value,h):window[Z].delete(e.value)});function d(){if(window[Z]){const h=window[Z];document.querySelectorAll(".f-button-edit,.v-popover").forEach(m=>{const p=h.get(m);p&&m!==e.value&&!e.value.closest(".popover-fitcontent")&&p.hide()})}}function r(){const h=i.value;h&&(h.show?h.show(e.value):h.open&&h.open(e.value))}async function c(h=!1){if(!!t.slots.default){if(!h&&!a.value&&!await s())return;a.value=!a.value,a.value&&(await o.nextTick(),r())}}async function f(h=!1){if(!!t.slots.default){if(!h&&!await s())return;a.value=!0,await o.nextTick(),r()}}function u(){a.value=!1}function b(){a.value=!0,o.nextTick(()=>{r()})}return{hidePopup:u,showPopup:b,popup:f,shouldPopupContent:a,togglePopup:c,popoverRef:i,closeAllPopover:d}}function ft(n,t,e){const l=o.ref(),{isTextBoxReadonly:i,textBoxClass:a,textBoxPlaceholder:s,textBoxTitle:d,onBlurTextBox:r,onClickTextBox:c,onFocusTextBox:f,onInput:u,onKeyDownTextBox:b,onKeyUpTextBox:h,onMouseDownTextBox:m,onTextBoxValueChange:p}=e,V=o.ref(n.id),{uuid:E}=D.useGuid(),x=o.computed(()=>({}));o.onMounted(()=>{var v,C;n.selectOnCreated&&((v=l.value)==null||v.select()),n.focusOnCreated&&((C=l.value)==null||C.focus({preventScroll:!0})),V.value||(V.value="button-edit_"+E(8)),V.value=V.value+"-textbox"});const B=o.ref(!1),R=v=>{v.preventDefault(),B.value=!0},j=v=>{v.preventDefault(),B.value=!1,u(v)};function z(v){B.value||u(v)}return()=>o.createVNode("input",{id:n.id?n.id+"-textbox":void 0,ref:l,name:"input-group-value",autocomplete:n.autoComplete?"on":"off",class:a.value,style:x.value,disabled:n.disable,maxlength:n.maxLength,minlength:n.minLength,placeholder:s.value,readonly:i.value,tabindex:n.tabIndex,title:d.value,type:n.inputType,value:t.value,onBlur:r,onChange:p,onClick:c,onFocus:f,onInput:z,onKeydown:b,onKeyup:h,onMousedown:m,onCompositionend:j,onCompositionstart:R},null)}function pt(n,t,e){const l=o.ref(n.separator),i=o.computed(()=>n.readonly||n.disable),{changeTextBoxValue:a,onFocusTextBox:s,onBlurTextBox:d,onClickTextBox:r,textBoxPlaceholder:c}=e,f=o.computed(()=>t.value?t.value.split(l.value).map(m=>({name:m,selectable:!0})):[]);function u(m){a(m.map(p=>p.name).join(l.value),!0)}o.watch(()=>n.separator,m=>{l.value=m});const b=o.ref(!n.disable&&!n.readonly);o.watch([()=>n.disable,()=>n.readonly],([m,p],[V,E])=>{b.value=!m&&!p});function h(m){r(m)}return()=>o.createVNode(Pe,{tabindex:n.tabIndex,onFocus:s,onBlur:d,id:`${n.id}-tag-editor`,class:"form-control",placeholder:c.value,data:f.value,showClose:!i.value,showInput:!0,disable:i.value,onChange:u,onClick:h},null)}function mt(n,t,e,l){const{buttonGroupClass:i,onClickButton:a,onMouseEnterButton:s,onMouseLeaveButton:d}=e,{enableClearButton:r,showClearButton:c,onClearValue:f}=l,u=o.ref(),b=ie.debounce(p=>{a(p)},n.buttonBehavior==="Modal"?0:200),h=()=>{t.emit("beforeClearValue")},{renderExpandContent:m}=Ne.useInputExpand(n,t);return{renderButtonGroup:()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{id:n.id?`${n.id}-button-group`:void 0,class:i.value},[r.value&&o.withDirectives(o.createVNode("span",{class:"input-group-text input-group-clear",onClick:f,onMousedown:h},[o.createVNode("i",{class:"f-icon modal_close"},null)]),[[o.vShow,c.value]]),t.slots.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",onClick:b,onMouseenter:s,onMouseleave:d},[t.slots.buttonContent()]):n.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",innerHTML:n.buttonContent,ref:u,onClick:p=>b(p),onMouseenter:s,onMouseleave:d},null):null]),m()]),buttonHandleElement:u}}function ht(n,t,e){const l=o.ref(n.popupMinWidth),{hidePopup:i,popoverRef:a}=e,s=()=>{t.emit("shown")},d=()=>{i(),t.emit("hidden")};return()=>D.isMobilePhone()?o.createVNode(Oe,{id:`${n.id}-drawer`,ref:a,position:n.placement,width:"auto",height:"auto",host:n.popupHost,showHeader:!1,showFooter:!1,customClass:"f-drawer--no-padding","onUpdate:modelValue":r=>r?s():d()},{default:()=>{var r,c;return[o.createTextVNode(" "),(c=(r=t.slots).default)==null?void 0:c.call(r),o.createTextVNode(" ")]}}):o.createVNode(Re,{id:`${n.id}-popover`,ref:a,placement:n.placement,host:n.popupHost,"keep-width-with-reference":n.keepWidthWithReference,fitContent:!0,"right-boundary":n.popupRightBoundary,minWidth:l.value,class:n.popupClass,offsetX:n.popupOffsetX,offsetY:n.popupOffsetY,onHidden:d,onShown:s,beforeClose:n.beforeClosePopup,limitContentBySpace:n.limitContentBySpace},{default:()=>{var r,c;return[(c=(r=t.slots).default)==null?void 0:c.call(r)]}})}const gt=o.defineComponent({name:"FButtonEdit",props:Ke,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue","beforeClearValue","expandClick","hidden","shown"],setup(n,t){const e=o.ref(),l=o.ref(n.customClass),i=o.ref(n.modelValue),a=ct(n,t,e,i),{shouldPopupContent:s,hidePopup:d,showPopup:r,togglePopup:c}=a,f=rt(n,t,e,a,i),u=o.ref(""),b=ut(n,t,i,u,a),{hasFocusedTextBox:h,commitValue:m,inputGroupClass:p,changeTextBoxValue:V}=b,E=dt(n,t,i,h,u,b),{onMouseEnterTextBox:x,onMouseLeaveTextBox:B}=E,R=o.ref(!1),j=o.computed(()=>{const w={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!n.wrapText};return l.value&&l.value.split(" ").reduce((M,P)=>(M[P]=!0,M),w),w}),z=o.computed(()=>({overflow:n.wrapText?"hidden":""})),v=o.computed(()=>({})),C=o.ref(n.showAppendButton);function I(){if(!n.multiSelect||n.inputType!=="tag"||!e.value)return 0;let w=0;const M=Array.from(e.value.querySelectorAll(".farris-tag-item"));return M&&M.length&&(w=M.map(P=>P.offsetTop).filter(P=>P>20).length),w}const N=o.ref(I());o.onUpdated(()=>{N.value=I()});function F(){return n.multiSelect&&n.inputType==="tag"?()=>o.createVNode(o.Fragment,null,[pt(n,i,b)(),!!N.value&&o.createVNode("div",{class:"d-flex flex-row mr-2 more-tags","more-tags":!0},[o.createVNode("span",{class:"multi--more-text"},[o.createTextVNode("+"),N.value])])]):ft(n,i,b)}let S=F();o.watch([()=>n.multiSelect,()=>n.inputType],()=>{S=F()});const{renderButtonGroup:O,buttonHandleElement:W}=mt(n,t,f,E),X=ht(n,t,a),G=o.ref(s.value),_={displayText:u,commitValue:m,elementRef:e,hidePopup:d,showPopup:r,popoverRef:a.popoverRef,shouldPopupContent:s,togglePopup:c,openDialog:()=>{W.value&&n.buttonBehavior==="Modal"&&W.value.click(),t.slots.content&&ie.debounce(()=>{f.onClickButton(null)},n.buttonBehavior==="Modal"?0:200)()},getModal:()=>{var w;return n.buttonBehavior==="Modal"?(w=f.modalRef.value)==null?void 0:w.value:null},getTextbox:()=>{var w;return(w=e.value)==null?void 0:w.querySelector("input")},forceClosePopup:()=>{G.value=!1,R.value=!0,s.value=!1},clear:()=>{V(""),u.value=""},setText:w=>{V(w,!1),u.value=w}};return o.onMounted(()=>{e.value.componentInstance=_,window.onresize=()=>{document.body.click()}}),o.onBeforeUnmount(()=>{var w;window.onresize=null,(w=window[Z])==null||w.delete(e.value)}),t.expose(_),o.watch(()=>s.value,async(w,M)=>{if(R.value){G.value=w,R.value=!1;return}if(!w&&n.beforeClosePopup&&typeof n.beforeClosePopup=="function"){try{const P=await n.beforeClosePopup();G.value=!P,(!P||n.readonly)&&(s.value=!0)}catch(P){console.error("Error in beforeClosePopup:",P),G.value=M,s.value=M}return}G.value=w}),()=>{var w,M;return o.createVNode(o.Fragment,null,[o.createVNode("div",o.mergeProps(t.attrs,{ref:e,class:j.value,id:n.id?n.id:void 0,style:z.value}),[o.createVNode("div",{id:n.id?`${n.id}-input-group`:void 0,class:p.value,style:v.value,onMouseenter:x,onMouseleave:B},[(M=(w=t.slots).precontent)==null?void 0:M.call(w),t.slots.content?t.slots.content():S(),t.slots.content?null:C.value&&O()])]),G.value&&X()])}}});function Ce(n,t,e){return t}function we(n,t,e){return t}const xe=new Map([["appearance",K.resolveAppearance]]),Ve=new Map([]),Me={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-group.schema.json",title:"item-collection-editor",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a item-collection-editor",type:"string"},type:{description:"The type string of item-collection-editor component",type:"string",default:"item-collection-editor"},requiredFields:{description:"",type:"array",default:[]},uniqueFields:{description:"",type:"array",default:[]},dynamicMappingKeys:{type:"boolean",default:!1},columns:{description:"",type:"array",default:[]},modalTitle:{description:"",type:"string",default:""},canEmpty:{description:"",type:"boolean",default:!0},valueField:{description:"",type:"string",default:"value"},nameField:{description:"",type:"string",default:"name"},idField:{description:"",type:"string",default:"value"},readonly:{description:"",type:"boolean",default:!1},modelValue:{description:"",type:"string",default:""},beforeSubmit:{description:"",type:"object",default:null},title:{description:"",type:"string",default:"项编辑器"},modalWidth:{description:"",type:"number",default:900},modalHeight:{description:"",type:"number",default:600}},required:["id","type"],ignore:[]},de={requiredFields:{type:Array,default:[]},uniqueFields:{type:Array,default:[]},dynamicMappingKeys:{type:Boolean,default:!1},columns:{type:Array,default:[]},modalTitle:{type:String,default:"项编辑器"},canEmpty:{type:Boolean,default:!0},valueField:{type:String,default:"value"},nameField:{type:String,default:"name"},idField:{type:String,default:"value"},readonly:{type:Boolean,default:!1},modelValue:{type:Array,default:[]},beforeSubmit:{type:Function,default:null},title:{type:String,default:"项编辑器"},modalWidth:{type:Number,default:900},modalHeight:{type:Number,default:600}};K.createPropsResolver(de,Me,Ve,we);const yt=K.getPropsResolverGenerator(de,Me,Ve,we),bt={requiredFields:{type:Array,default:[]},uniqueFields:{type:Array,default:[]},dynamicMappingKeys:{type:Boolean,default:!1},columns:{type:Array,default:[]},canEmpty:{type:Boolean,default:!0},valueField:{type:String,default:"value"},nameField:{type:String,default:"value"},datas:{type:Array,default:[]},readonly:{type:Boolean,default:!1},commandOption:{type:Object,default:{enable:!1}}},vt=o.defineComponent({name:"FItemCollectionEditorInner",props:bt,emits:["change"],setup(n,t){let e="";const{guid:l}=D.useGuid(),i=new De.FNotifyService,a=o.ref(n.valueField),s=o.ref(n.nameField),d={editMode:"cell"},r={fitColumns:!0},c=o.ref(),f=n.columns;let u=n.datas;o.watch(()=>[n.datas],()=>{u=n.datas,c.value.updateDataSource(u)});function b(){const v={};return f.forEach(C=>{C.editor&&(C.editor.type==="checkbox"||C.editor.type==="switch")?v[C.field]=!1:v[C.field]=""}),v}function h(){if(n.dynamicMappingKeys){const v="请先填写XXX。",C=a.value.trim()?s.value.trim()?"":"枚举名称字段":"枚举值字段";return i.warning({position:"top-center",message:v.replace("XXX",C)}),!1}return!0}function m(v){const C="不允许重复。";if(!h())return!1;if(!v||v.length===0)return n.canEmpty?!0:(i.warning({position:"top-center",message:"请添加值。"}),!1);const I=n.requiredFields||[],N="不允许为空。";for(const S of v)for(const O of Object.keys(S)){const W=f.find(X=>X.field===O);if(W&&W.editor&&(W.editor.type==="checkbox"||W.editor.type==="switch")){if(I.includes(O)&&(S[O]===null||S[O]===void 0))return i.warning({position:"top-center",message:W.title+N}),!1}else if(I.includes(O)&&(S[O]===void 0||S[O]===""||S[O]===null))return i.warning({position:"top-center",message:W.title+N}),!1}const F=n.uniqueFields||[];for(const S of F){const O=v.map(G=>G[S]),W=new Set(O),X=Array.from(W);if(O.length!==X.length){const G=f.find(_=>_.field===S);return i.warning({position:"top-center",message:G.title+C}),!1}}return!0}function p(){if(n.readonly||!h())return;const v=b(),C=l();u.push({hId:C,...v}),c.value.updateDataSource(u),c.value.selectRowById(C)}function V(v){u&&u.length>0?(v||(v=u[0].hId),c.value.selectRowById(v)):e=""}function E(){if(!e){i.warning({position:"top-center",message:"请先选中行!"});return}const v=u.findIndex(N=>N.hId===e);u=[...u.filter(N=>N.hId!==e)],c.value.updateDataSource(u);let I="";v<u.length&&u.length>0&&(I=u[v].hId),V(I)}function x(v){if(!v||v.length===0)return v;const C=[];return v.forEach(I=>{const{value:N,name:F,...S}=I,O=Object.assign({},S);O[a.value.trim()]=N,O[s.value.trim()]=F,C.push(O)}),C}function B(){c.value.endEditCell();const v=[];return u.forEach(C=>{const{hId:I,...N}=C,F={};for(const S in N)S.startsWith("_")||(F[S]=N[S]);v.push(F)}),v}function R(){let v=B();return m(v)?(n.dynamicMappingKeys?(v=x(v),t.emit("change",v,void 0,{valueField:a.value.trim(),nameField:s.value.trim()})):t.emit("change",v,void 0,null),!0):!1}function j(){return u}t.expose({clickConfirm:R,getItems:B,getDataGridDatas:j}),o.onMounted(()=>{V()});function z(v){var C;e=(C=v[0])==null?void 0:C.hId}return()=>o.createVNode("div",{class:"f-utils-fill-flex-column h-100"},[!n.readonly&&o.createVNode("div",{class:"mb-1 py-1 ml-1"},[o.createVNode("button",{class:"btn f-rt-btn f-btn-ml btn-primary",onClick:()=>p()},[o.createTextVNode("新增")]),o.createVNode("button",{class:"btn f-rt-btn f-btn-ml btn-secondary",onClick:()=>E()},[o.createTextVNode("删除")])]),o.createVNode("div",{class:"f-utils-fill border",style:"margin:0 8px;border-radius:12px;"},[o.createVNode(Le,{ref:c,showBorder:!0,idField:"hId",columns:f,data:u,editable:!n.readonly,"edit-option":d,columnOption:r,commandOption:n.commandOption,fit:!0,onSelectionChange:z},null)])])}}),Ct={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},wt={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},ue=o.defineComponent({name:"Toast",props:wt,emits:["close","click"],setup:(n,t)=>{const e=o.ref(n.animate),l="fadeOut",i=o.computed(()=>n.options),a=o.ref(!1),s=o.computed(()=>i.value.title&&i.value.message),d=o.computed(()=>!i.value.title&&i.value.message),r=o.computed(()=>{const x={animated:a.value,toast:!0,"toast--only-content":!s.value};return x[n.animate]=!1,x[l]=a.value,x["toasty-type-"+i.value.type]=!0,i.value.theme&&(x[i.value.theme]=!0),x}),c=o.computed(()=>{const R=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,j={"f-icon":!0};return j[R]=!0,j}),f=o.computed(()=>i.value.title||i.value.message),u=o.computed(()=>n.showCloseButton),b=o.computed(()=>!!i.value.buttons||!!t.slots.default),h=o.computed(()=>Y.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function m(x){x.stopPropagation(),x.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function p(x,B){}function V(x){return`f-preten-link ${x.customClass?x.customClass:""}`}o.watch(e,()=>{e.value});const E=()=>{var x;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((x=i.value.buttons)==null?void 0:x.map(B=>o.createVNode("span",{class:V(B),onClick:R=>void 0},[B.text]))),t.slots.default&&t.slots.default()])])};return()=>o.createVNode("div",{class:r.value,style:"min-height:44px"},[u.value&&o.createVNode("button",{title:Y.LocaleService.getLocaleValue("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:m},[o.createVNode("span",{class:"f-icon modal_close"},null)]),f.value&&o.createVNode("section",{class:"modal-tips"},[!s.value&&o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:c.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[s.value&&o.createVNode(o.Fragment,null,[o.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:i.value.title},null),o.createVNode("p",{class:"toast-msg",innerHTML:i.value.message,style:h.value},null),b.value&&E()]),d.value&&(i.value.buttons?o.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:i.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[E()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:i.value.message},null))])])])}}),xt=["moz","ms","webkit"];function Vt(){let n=0;return t=>{const e=new Date().getTime(),l=Math.max(0,16-(e-n)),i=setTimeout(()=>{t(e+l)},l);return n=e+l,i}}function Mt(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const n=xt.filter(t=>`${t}RequestAnimationFrame`in window)[0];return n?window[`${n}RequestAnimationFrame`]:Vt()}Mt(),o.ref("");function Ee(){if(typeof window>"u"||typeof navigator>"u")return!1;const n=navigator.userAgent||navigator.vendor||window.opera,t=[/iPhone/i,/iPod/i,/Android.*Mobile/i,/webOS/i,/BlackBerry/i,/IEMobile/i,/Opera Mini/i,/Harmony/i],e=[/iPad/i,/Android(?!.*Mobile)/i,/Tablet/i,/PlayBook/i,/Kindle/i,/Silk/i];for(const r of e)if(r.test(n))return!1;for(const r of t)if(r.test(n))return!0;if(typeof screen>"u")return!1;const l="ontouchstart"in window||navigator.maxTouchPoints>0,i=screen.width,a=screen.height,s=Math.min(i,a);return!!(l&&s<=768)}function Et(){const n=Ee();return n&&document.body.classList.add("f-mobile"),n}typeof document<"u"&&Et();const ae=o.defineComponent({name:"Notify",props:Ct,emits:["close","empty"],setup(n,t){var p;const e=Ee(),i=`farris-notify-${(p=n.options)!=null&&p.type?n.options.type:"info"}}`,a=o.computed(()=>({"farris-notify":!0,[i]:e})),s={left:12,right:12,top:20,bottom:12},d=o.ref(),r=o.ref(n.options),c=o.ref(n.showCloseButton),f=o.computed(()=>n.position||"bottom-right"),u=o.computed(()=>n.timeout!=null?n.timeout:3e3),b=o.computed(()=>{const V=n.bottom?n.bottom:s.bottom,E=n.top?n.top:s.top,x={transition:"all 0.2s ease",left:f.value.indexOf("left")>-1?`${n.left?n.left:s.left}px`:"",right:f.value.indexOf("right")>-1?`${n.right?n.right:s.right}px`:"",top:f.value.indexOf("top")>-1?`${E}px`:"",bottom:f.value.indexOf("bottom")>-1?`${V}px`:""};return f.value.indexOf("center")>-1&&(x.left="50%",x.marginLeft="calc(-24rem / 2)",f.value==="center-center"&&(x.top="50%",x.transform="translate(-50%, -50%)")),x});function h(V){t.emit("close")}u.value&&setTimeout(()=>{h()},u.value),t.expose({closeToast:h,container:d,notifyPosition:f});function m(V,E){h()}return()=>{var V;return e?o.createVNode("div",{class:a.value,ref:d},[(V=n.options)==null?void 0:V.message]):o.createVNode("div",{class:a.value,style:b.value,ref:d},[o.createVNode(ue,{options:r.value,showCloseButton:c.value,animate:n.animate,onClose:E=>m(E,r.value)},null)])}}});class Ft{constructor(){k(this,"notifyRefs",[]);k(this,"globalConfig",o.reactive({}))}escapeAllHtml(t){if(typeof t!="string"||!t)return"";const e=document.createElement("div");return e.textContent=t||"",e.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(t){const e=this,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...t}),a=document.createElement("div");a.style.display="contents";const s=o.createApp({setup(){var c;const d=o.ref();function r(){d.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(i,d),s.unmount()},220)}if(i.position.indexOf("top")>-1){const f=e.getNotifyInstances(i.position),u=f[f.length-1];if(u){const b=u.value.container.getBoundingClientRect();i.top=b.bottom}}return i.safeHtml&&((c=i.options)!=null&&c.message)&&(i.options.message=e.escapeAllHtml(i.options.message)),o.onUnmounted(()=>{document.body.removeChild(a)}),o.onMounted(()=>{e.updateNotifyPositionForCreate(i,d)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(ae,o.mergeProps({ref:d},i,{onClose:r}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(Y.LocaleService.i18n),s.mount(a),s}getNotifyInstances(t){return this.notifyRefs.filter(e=>e.value.notifyPosition===t)}updateNotifyPositionForCreate(t,e){if(this.notifyRefs&&this.notifyRefs.length){const l=window.innerHeight;t.position.indexOf("bottom")>-1&&this.getNotifyInstances(t.position).forEach(i=>{const a=i.value.container.getBoundingClientRect();i.value.container.style.bottom=a.height+l-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,e]}updateNotifyPositionForClose(t,e){const l=this.notifyRefs.indexOf(e);if(t.position.indexOf("top")>-1){const i=this.getNotifyInstances(t.position),a=i.indexOf(e);i.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}l>-1&&this.notifyRefs.splice(l,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,e){let l="",i="",a,s,d;typeof e=="string"?l=e:e&&(l=e.message||"",i=e.title||"",s=e.position||null,d=e.showCloseButton!=null?e.showCloseButton:null,a=e.timeout!=null?e.timeout:null);const c={options:{type:t,message:l,title:i}};return s!=null&&(c.position=s),d!=null&&(c.showCloseButton=d),a!=null&&(c.timeout=a),c}info(t){const e=this.buildNotifyProps("info",t);return this.show(e)}success(t){const e=this.buildNotifyProps("success",t);return this.show(e)}warning(t){const e=this.buildNotifyProps("warning",t);return this.show(e)}error(t){const e=this.buildNotifyProps("error",t);return this.show(e)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const Fe=Symbol("NOTIFY_SERVICE_TOKEN");ae.install=n=>{n.component(ae.name,ae),n.component(ue.name,ue);const t=new Ft;n.provide(Fe,t),n.provide("FNotifyService",t)};const It=o.defineComponent({name:"FItemCollectionEditor",props:de,components:{},emits:["change"],setup(n,t){const e=o.inject(Fe),{guid:l}=D.useGuid(),i=o.ref(`共 ${(n.modelValue||[]).length} 项`),a=o.ref(n.valueField),s=o.ref(n.nameField),d=o.ref();function r(){let h=[];return n.dynamicMappingKeys?(h=[],a.value=a.value.trim(),s.value=s.value.trim(),(n.modelValue||[]).forEach(m=>{if(a.value&&s.value){const{[a.value]:p,[s.value]:V,...E}=m,x=E||{};x.value=p,x.name=V,x.hId=l(),h.push(x)}})):(h=ie.cloneDeep(n.modelValue||[]),h.forEach(m=>{m.hId=l()})),h}function c(){let h=[];return n.columns&&n.columns.length>0?h=n.columns:h=[{field:n.valueField,title:"值",dataType:"string"},{field:n.nameField,title:"名称",dataType:"string"}],h}function f(){}const u={fitContent:!1,width:n.modalWidth||900,height:n.modalHeight||600,title:n.title||"项编辑器",resizeable:!0,draggable:!0,minWidth:500,minHeight:300,buttons:[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:h=>!0},{name:"accept",text:"确定",class:"btn btn-primary",handle:async h=>{if(n.beforeSubmit&&typeof n.beforeSubmit=="function"){const p=d.value.getItems();if(!await n.beforeSubmit({notifyService:e,data:p}))return!1}return!!d.value.clickConfirm()}}]};function b(h,m,p){i.value=`共 ${h.length} 项`,t.emit("change",h,m,p)}return o.watch(()=>n.modelValue,h=>{i.value=`共 ${(n.modelValue||[]).length} 项`}),o.onMounted(()=>{}),()=>o.createVNode(gt,{"button-behavior":"Modal","modal-options":u,modelValue:i.value,"onUpdate:modelValue":h=>i.value=h,editable:!1,beforeOpen:f},{default:()=>[o.createVNode("div",{class:"f-utils-absolute-all f-utils-flex-column"},[n.dynamicMappingKeys&&o.createVNode("div",{class:"farris-form-controls-inline p-2 f-form-layout farris-form f-form-lable-auto"},[o.createVNode("div",{class:"farris-group-wrap mr-3"},[o.createVNode("div",{class:"form-group farris-form-group"},[o.createVNode("label",{class:"col-form-label"},[o.createVNode("span",{class:"farris-label-info text-danger"},[o.createTextVNode("*")]),o.createVNode("span",{class:"farris-label-text"},[o.createTextVNode("枚举值字段")])]),o.createVNode("div",{class:"farris-input-wrap"},[o.withDirectives(o.createVNode("input",{type:"input",class:"form-control","onUpdate:modelValue":h=>a.value=h,readonly:n.readonly},null),[[o.vModelText,a.value]])])])]),o.createVNode("div",{class:"farris-group-wrap"},[o.createVNode("div",{class:"form-group farris-form-group"},[o.createVNode("label",{class:"col-form-label"},[o.createVNode("span",{class:"farris-label-info text-danger"},[o.createTextVNode("*")]),o.createVNode("span",{class:"farris-label-text"},[o.createTextVNode("枚举名称字段")])]),o.createVNode("div",{class:"farris-input-wrap"},[o.withDirectives(o.createVNode("input",{type:"input",class:"form-control","onUpdate:modelValue":h=>s.value=h,readonly:n.readonly},null),[[o.vModelText,s.value]])])])])]),o.createVNode(vt,{ref:d,valueField:a.value,nameField:s.value,requiredFields:n.requiredFields,uniqueFields:n.uniqueFields,dynamicMappingKeys:n.dynamicMappingKeys,readonly:n.readonly,canEmpty:n.canEmpty,datas:r(),columns:c(),onChange:(h,m,p)=>b(h,m,p)},null)])]})}}),Ie={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-group.schema.json",title:"radio-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a radio-group",type:"string"},type:{description:"The type string of radio-group component",type:"string",default:"radio-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0},textField:{description:"",type:"string",default:"name"},valueField:{description:"",type:"string",default:"value"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},bindDataSource:{description:"",type:"string",default:""},direction:{description:"",type:"string",default:"horizontal"},onChange:{description:"值变化事件",type:"string"}},required:["type"],ignore:["id","appearance","binding","visible"]},kt=K.createPropsResolver(re.radioGroupProps,Ie,xe,Ce),ce=K.getPropsResolverGenerator(re.radioGroupProps,Ie,xe,Ce);ne.register=(n,t,e,l,i)=>{n["radio-group"]=re,t["radio-group"]=ce(i),n["item-collection-editor"]=It,t["item-collection-editor"]=yt(i)},ne.registerDesigner=(n,t,e,l)=>{n["radio-group"]=ne,t["radio-group"]=ce(l)};const Tt=D.withInstall(ne);A.FRadioGroupDesign=ne,A.default=Tt,A.propsResolver=kt,A.propsResolverGenerator=ce,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
6
+ `])])]);class We extends $e{constructor(e,l){super(e,l);k(this,"responseLayoutEditorFunction");k(this,"bindingVarible");k(this,"formGroupEvents",[{label:"fieldValueChanging",name:"绑定字段值变化前事件"},{label:"fieldValueChanged",name:"绑定字段值变化后事件"},{label:"onClickLabel",name:"标签点击事件"}]);k(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});k(this,"showCustomValue",e=>{var i;const l=this.designViewModelField!=null&&((i=this.designViewModelField)==null?void 0:i.type.name)!=="Boolean";return this.formRule?e.dataType!=="boolean":l});this.responseLayoutEditorFunction=qe(this.formSchemaUtils)}getCommonPropertyConfig(e,l,i="Card"){if(this.propertyConfig.categories.basic=this.getBasicProperties(e,l,i),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,l),this.propertyConfig.categories.behavior=this.getBehaviorConfig(e,"form-group"),i==="Card"){const a=this.getTipsConfig(e);this.propertyConfig.categories.behavior.properties={...this.propertyConfig.categories.behavior.properties,...a},["time-picker","date-picker","lookup","combo-list","number-spinner","input-group","language-textbox"].includes(e.editor.type)&&(this.propertyConfig.categories.expansion=this.getExpandProperties(e,i))}}getPropertyConfig(e,l){return this.getCommonPropertyConfig(e,l,"Card"),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressions=this.getExpressionConfig(e,"Field"),this.propertyConfig.categories.eventsEditor=this.getEventPropertyConfig(e),this.propertyConfig}getGridFieldEdtiorPropConfig(e,l){return this.propertyConfig.categories={},this.getCommonPropertyConfig(e,l,"Grid"),this.getGridFieldEdtiorProperties?this.propertyConfig.categories.editor=this.getGridFieldEdtiorProperties(e):this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig.categories.expressons=this.getExpressionConfig(e,"Field"),this.propertyConfig.categories}getBasicProperties(e,l,i="Card"){var u;const a=this;this.setDesignViewModelField(e);const{canChangeControlType:s,editorTypeList:d}=this.getAvailableEditorType(e),r=this.getPropertyEditorParams(e,["Variable"],"label",{},{newVariablePrefix:"",newVariableType:"String"});let c=d;this.formRule&&(c=d.filter(b=>b.key!=="image"&&b.key!=="rich-text-editor"&&b.key!=="avatar"));const f={description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",$converter:"/converter/change-editor.converter",parentPropertyID:"editor",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:c,readonly:!s}},titleSourceType:{description:"标签来源类型",title:"标签类型",type:"string",refreshPanelAfterChanged:!0,editor:{type:"combo-list",textField:"name",valueField:"id",idField:"id",editable:!1,data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},defaultValue:"static"},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter",visible:!e.titleSourceType||e.titleSourceType==="static"},titleDataSource:{description:"标签",title:"标签",type:"string",editor:r,visible:e.titleSourceType==="dynamic"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]},defaultValue:((u=e.editor)==null?void 0:u.type)==="image"?"none":"visible"},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!0},title:"绑定编辑器",editorParams:{componentSchema:e,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"},refreshPanelAfterChanged:!0,readonly:this.formSchemaUtils.designerMode==="PC_RTC"&&!e.isRtcControl}},setPropertyRelates(b,h,m){if(b)switch(b&&b.propertyID){case"type":{a.changeControlType(e,b,l);break}case"label":{b.needRefreshControlTree=!0;break}case"binding":{a.changeBindingField(e,b,m);break}case"titleDataSource":{a.afterMutilEditorChanged(e,b);break}}}};return i.toLocaleLowerCase()!=="card"&&(f.hide=!0,delete f.properties.showLabelType),f}getExpandProperties(e,l="Card"){const i=this,a=["Const","Variable"],s=this.getPropertyEditorParams(e,a,"expandable"),d=this.getPropertyEditorParams(e,a,"expandDisabled");return l==="Card"?{description:"Expand Information",hide:!!this.formRule,title:"扩展区域",properties:{expandable:{description:"扩展区域是指输入框右侧的区域,常用于展示自定义按钮或者文本,以便于丰富输入控件的展示内容。",title:"启用扩展区域",refreshPanelAfterChanged:!0,$converter:"/converter/property-editor.converter",editor:s},expandMode:{description:"静态文本:扩展内容不可点击;交互式按钮:扩展内容可以点击并配置交互事件。",title:"扩展模式",type:"enum",refreshPanelAfterChanged:!0,$converter:"/converter/property-editor.converter",editor:{data:[{id:"text",name:"静态文本"},{id:"button",name:"交互按钮"}]},defaultValue:"text",visible:!!e.editor.expandable},expandContent:{$converter:"/converter/property-editor.converter",description:"扩展区域内展示的文本内容",title:"扩展内容",type:"string",visible:!!e.editor.expandable,editor:{type:"code-editor",language:"html"}},expandDisabled:{$converter:"/converter/property-editor.converter",description:"是否动态隐藏扩展区域,常用于根据变量或自定义条件配置扩展区域的隐藏状态。",title:"隐藏扩展区域",editor:d,visible:!!e.editor.expandable}},setPropertyRelates(c,f){if(c)switch(c.propertyID){case"expandable":case"expandDisabled":i.afterMutilEditorChanged(e,c);break}}}:{properties:{}}}checkCanChangeControlType(e,l){if(!e.binding)return!1;if(e.binding.type==="Variable"){if(this.bindingVarible=this.formSchemaUtils.getVariableById(e.binding.field),!this.bindingVarible)return!1}else if(!this.designViewModelField||this.designViewModelField.$type!==D.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(e){var a,s;const l=this.checkCanChangeControlType(e,this.viewModelId);if(!l)return{canChangeControlType:!1,editorTypeList:[{key:e.editor.type,value:((a=y.DgControl[e.editor.type])==null?void 0:a.name)||e.editor.type}]};let i=[];return this.designViewModelField&&this.designViewModelField.$type===D.FormSchemaEntityField$Type.SimpleField?i=le.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(i=le.getEditorTypesByMDataType(this.bindingVarible.type,!!((s=this.designViewModelField)!=null&&s.multiLanguage))),{canChangeControlType:l,editorTypeList:i}}changeBindingField(e,l,i){l.needRefreshEntityTree=!0}getAppearanceProperties(e,l){const i=this;return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的内联样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},fill:{title:"填充宽度",description:"启用后,控件占满父容器宽度",type:"boolean",parentPropertyID:"appearance",defaultValue:!1},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!i.formRule,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",beforeOpen:()=>i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,i.componentId)}}},setPropertyRelates(a,s){if(a)switch(a&&a.propertyID){case"responseLayout":i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(a.propertyValue,i.componentId||e.id),i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId),i.updateElementByParentContainer(e.id,l),delete e.responseLayout;break;case"class":i.updateUnifiedLayoutAfterControlChanged(a.propertyValue,e.id,this.componentId),y.canvasChanged.value++;break;case"style":{y.canvasChanged.value++;break}}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,l,i){var m;const a=l.propertyValue,s=i&&i.parent&&i.parent.schema;if(!s)return;const d=s.contents.findIndex(p=>p.id===e.id);if(d===-1)return;const r=s.contents[d];let c;if(this.designViewModelField){const M=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(B=>B.id===this.designViewModelField.id).fieldSchema||{};M.editor||(M.editor={}),M.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,M,!1),c=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)}c||(c=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(c,{id:r.id,appearance:r.appearance,size:r.size,label:r.label,binding:r.binding}),Object.prototype.hasOwnProperty.call(r,"visible")&&Object.assign(c,{visible:r.visible}),r.editor&&["readonly","required","placeholder"].map(p=>{Object.prototype.hasOwnProperty.call(r.editor,p)&&(c.editor[p]=r.editor[p])});const f=["image","avatar"],u=r.editor.type&&f.indexOf(r.editor.type)>-1,b=((m=c.editor)==null?void 0:m.type)&&f.indexOf(c.editor.type)>-1;u&&r.showLabelType==="none"&&!b&&(c.showLabelType="visible"),i!=null&&i.updateContextSchema?i.updateContextSchema(c):(i.schema=Object.assign(r,c),Object.assign(e,c)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(p=>p.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(p=>p.classList.remove("dgComponentFocused")),["time-picker","date-picker","lookup","combo-list","number-spinner","input-group","textarea","rich-text-editor","language-textbox"].includes(e.editor.type)||(e.enableTips=!1),y.canvasChanged.value++,o.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getTipsConfig(e){return["time-picker","date-picker","lookup","combo-list","number-spinner","input-group","textarea","rich-text-editor","language-textbox"].includes(e.editor.type)?{enableTips:{refreshPanelAfterChanged:!0,description:"",title:"启用提示",type:"boolean",default:!1,visible:!this.formRule},tipsContent:{description:"提示内容",title:"提示内容",type:"string",editor:{type:"code-editor",language:"html",leftTemplate:Ue},visible:!!e.enableTips&&!this.formRule}}:{}}getComponentConfig(e,l={},i={},a){var b,h,m;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},l),d=(b=e.binding)!=null&&b.field?["Const","Variable","StateMachine","Custom","Expression"]:["Const","Variable","StateMachine","Custom"],r=this.getPropertyEditorParams(e,d,"readonly"),c=this.getPropertyEditorParams(e,d,"required"),f={readonly:{description:"",title:"只读",editor:r},required:{description:"",title:"必填",type:"boolean",editor:c,visible:!!((h=e.binding)!=null&&h.field)&&((m=e.binding)==null?void 0:m.type)==="Form"},placeholder:{description:"当控件没有值时在输入框中显示的文本",title:"提示文本",type:"string"}};for(const p in i)f[p]=Object.assign(f[p]||{},i[p]);const u=this;return{...s,properties:{...f},setPropertyRelates(p,V){if(p){switch(p.propertyID){case"readonly":case"required":case"label":u.afterMutilEditorChanged(e,p);break}a&&a.bind(u)(p,e,V)}}}}updateUnifiedLayoutAfterControlChanged(e,l,i){const a=e.split(" ");let s=a.find(u=>/^col-([1-9]|10|11|12)$/.test(u)),d=a.find(u=>/^col-md-([1-9]|10|11|12)$/.test(u)),r=a.find(u=>/^col-xl-([1-9]|10|11|12)$/.test(u)),c=a.find(u=>/^col-el-([1-9]|10|11|12)$/.test(u));s=s||"col-12",d=d||"col-md-"+s.replace("col-",""),r=r||"col-xl-"+d.replace("col-md-",""),c=c||"col-el-"+r.replace("col-xl-","");const f={id:l,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(d.replace("col-md-",""),10),columnInLG:parseInt(r.replace("col-xl-",""),10),columnInEL:parseInt(c.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(i,f)}updateUnifiedLayoutAfterResponseLayoutChanged(e,l){const{formNode:i}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!i||!i.unifiedLayout)return;const a=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i,a,1),l){const m=a.find(p=>p.id===l.id);Object.assign(m||{},l)}const s=a.map(m=>m.columnInSM),d=a.map(m=>m.columnInMD),r=a.map(m=>m.columnInLG),c=a.map(m=>m.columnInEL),f=this.checkIsUniqueColumn(s)?s[0]:null,u=this.checkIsUniqueColumn(d)?d[0]:null,b=this.checkIsUniqueColumn(r)?r[0]:null,h=this.checkIsUniqueColumn(c)?c[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:f,uniqueColClassInMD:u,uniqueColClassInLG:b,uniqueColClassInEL:h})}checkIsUniqueColumn(e){const l=new Set(e);return Array.from(l).length===1}getItemCollectionEditor(e,l,i){return l=l||"value",i=i||"name",{editor:{columns:[{field:l,title:"值",dataType:"string"},{field:i,title:"名称",dataType:"string"}],type:"item-collection-editor",valueField:l,nameField:i,requiredFields:[l,i],uniqueFields:[l,i],readonly:this.checkEnumDataReadonly(e)}}}checkEnumDataReadonly(e){return!e.binding||e.binding.type!=="Form"?!1:!!(this.designViewModelField&&this.designViewModelField.type&&this.designViewModelField.type.$type===D.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(e,l){e.binding&&e.binding.type===te.Form&&e.binding.field?(l.find(i=>i.label==="fieldValueChanging"),l.find(i=>i.label==="fieldValueChanged"),this.designViewModelField&&(e.fieldValueChanging=this.designViewModelField.valueChanging,e.fieldValueChanged=this.designViewModelField.valueChanged)):l=l.filter(i=>i.label!=="fieldValueChanging"&&i.label!=="fieldValueChanged")}getControlMethodType(e){if(!e.binding)return e.type;switch(e.binding.type){case te.Form:return e.binding.path||e.type;case te.Variable:return e.binding.fullPath||e.type}return e.type}updateLinkedLabel(e,l){if(e.boundEventsList&&e.boundEventsList.length>0){const i=e.boundEventsList.find(a=>a.boundEvents&&a.boundEvents.label==="onClickLabel");l.linkLabel=!!i}else l.linkLabel=!1}getInputCommonEvents(e){return!e.binding||e.binding.type===te.Variable?[{label:"onClickLabel",name:"标签点击事件"}]:this.formRule?[{label:"onClickLabel",name:"标签点击事件"}]:[...this.formGroupEvents]}getEventPropertyConfig(e,l="card",i,a){const s=this;let d=this.getInputCommonEvents(e);if(["time-picker","date-picker","lookup","combo-list","number-spinner","input-group"].includes(e.editor.type)&&d.push({label:"onClear",name:"清空事件"}),i&&(d=d.concat(i)),d.length===0)return{title:"事件",hideTitle:!0,properties:{},tabId:D.EVENT_PROPERTY_TAB_IDS,tabName:"交互",hide:!0};this.appendFieldValueChangeEvents(e,d);const c=s.eventsEditorUtils.formProperties(e,s.viewModelId,d);return{title:"事件",hideTitle:!0,properties:s.createBaseEventProperty(c),tabId:D.EVENT_PROPERTY_TAB_IDS,tabName:"交互",setPropertyRelates(b,h){const m=b.propertyValue;delete e[s.viewModelId],m&&(m.setPropertyRelates=this.setPropertyRelates,m.controlInfo={type:s.getControlMethodType(e),name:e.title},s.eventsEditorUtils.saveRelatedParameters(e,s.viewModelId,m.events,m),s.updateLinkedLabel(m,e)),a&&a(b,e,m);const p=s.designViewModelUtils.getDgViewModel(s.viewModelId);p&&s.designViewModelField&&p.changeField(s.designViewModelField.id,{valueChanging:e.fieldValueChanging||"",valueChanged:e.fieldValueChanged||""})}}}getExpressionConfig(e,l,i=["compute","dependency","validate"],a){return this.expressionProperty.getExpressionConfig(e,l,i,a)}getBindingDataType(e){return this.formRule?(e==null?void 0:e.dataType)||"string":this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(e){return this.getBindingDataType(e)==="number"?this.numberEditorOptions:{}}updatePropertyValue(e,l,i){var a;e.editor[l]!==i?e.editor[l]=i:(a=this.getFormDesignerInstance())==null||a.reloadPropertyPanel()}setBooleanValue(e,l,i){let a=i;this.getBindingDataType()==="string"&&(a=(a||"").trim()||(l==="trueValue"?"true":"false"));const d=l==="trueValue"?"falseValue":"trueValue";e.editor[d]===a&&(a=a+1),this.updatePropertyValue(e,l,a)}getBooleanValueConverter(){return{convertFrom:(e,l)=>e.editor[l],convertTo:(e,l,i)=>{this.setBooleanValue(e,l,i)}}}}class Ge extends We{constructor(t,e){super(t,e)}getEventPropertyConfig(t,e="card",l,i){const a=this.formRule?[]:[{label:"onChangeValue",name:"值变化事件"}];return super.getEventPropertyConfig(t,e,[...a,...l||[]],(s,d,r)=>{t.editor&&(t.editor.onChangeValue=t.onChangeValue),i==null||i(s,d,r)})}getEditorProperties(t){const e=this;return e.getComponentConfig(t,{type:"radio-group"},{disabled:{visible:!1},placeholder:{visible:!1},direction:{description:"",title:"排列方向",type:"enum",editor:{data:[{id:"horizontal",name:"横向"},{id:"vertical",name:"纵向"}]}},dataSourceType:{description:"",title:"数据源类型",type:"enum",visible:!1,editor:{default:"static",data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},data:{description:"",title:"数据",type:"array",visible:!t.editor.dataSourceType||t.editor.dataSourceType==="static",...e.getItemCollectionEditor(t,t.editor.valueField,t.editor.textField),refreshPanelAfterChanged:!0},bindDataSource:{description:"",title:"绑定数据源",type:"string",visible:t.editor.dataSourceType==="dynamic"},textField:{description:"",title:"文本字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},valueField:{description:"",title:"值字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"}},this.setEditorPropertyRelates)}setEditorPropertyRelates(t,e,l){if(!t||!e.editor)return;const i=this;switch(t.propertyID){case"dataSourceType":{t.propertyValue==="static"&&(e.editor.valueField="value",e.editor.textField="name");break}case"data":{!i.checkEnumDataReadonly(e)&&e.formatter&&(e.formatter.data=[...t.propertyValue]);break}}}changeBindingField(t,e,l){var a;super.changeBindingField(t,e);const i=l;t.editor&&((a=i==null?void 0:i.type)==null?void 0:a.$type)===D.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=i.type.enumValues||[])}}function _e(n,t){const e=n.schema;function l(i,a){return new Ge(i,t).getPropertyConfig(e,a)}return{getPropsConfig:l}}const ne=o.defineComponent({name:"FRadioGroupDesign",props:Ae,emits:["changeValue","update:modelValue"],setup(n,t){const e=o.ref(n.modelValue),{enumData:l,getValue:i,getText:a}=je(n,t,e),s=o.computed(()=>({"farris-checkradio-hor":n.direction==="horizontal","farris-checkradio-ver":n.direction==="vertical"})),d=o.ref(),r=o.inject("designer-host-service"),c=o.inject("design-item-context"),f=_e(c,r),u=y.useDesignerComponent(d,c,f);o.onMounted(()=>{d.value.componentInstance=u});const b=o.computed(()=>{if(!l.value||l.value.length===0){const h=[];return[{value:"example1",name:"示例一"},{value:"example2",name:"示例二"}].map(m=>{const p={};p[n.valueField]=m.value,p[n.textField]=m.name,h.push(p)}),h}return l.value});return t.expose(u.value),()=>o.createVNode("div",{class:["farris-input-wrap",s.value],ref:d},[b.value.map((h,m)=>{const p="radio_"+n.name+m;return o.createVNode("div",{class:"custom-control custom-radio"},[o.createVNode("input",{type:"radio",class:"custom-control-input",name:n.name,id:p,value:i(h),disabled:!0},null),o.createVNode("label",{class:"custom-control-label",for:p},[a(h)])])})])}}),Ke={id:{type:String,default:""},buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},buttonBehavior:{type:String,default:"Popup"},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},showButtonWhenDisabled:{type:Boolean,default:!1},showAppendButton:{type:Boolean,default:!0},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:{type:Number},tabIndex:Number,popupHost:{type:Object},popupRightBoundary:{type:Object},popupOffsetX:{type:Object,default:0},popupOffsetY:{type:Object,default:0},popupOnInput:{type:Boolean,default:!1},popupOnFocus:{type:Boolean,default:!1},popupOnClick:{type:Boolean,default:!1},popupClass:{type:String,default:""},popupMinWidth:{type:Number,default:160},modalOptions:{type:Object,default:{}},wrapText:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","},textAlign:{type:String,default:"left"},beforeClickButton:{type:Function,default:null},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},beforeOpen:{type:Function,default:null},updateOn:{type:String,default:"change"},keepWidthWithReference:{type:Boolean,default:!0},placement:{type:String,default:"bottom-left"},limitContentBySpace:{type:Boolean,default:!1},beforeClosePopup:{type:Function,default:null},expandable:{type:Boolean,default:!1},expandMode:{type:String,default:"text"},expandContent:{type:String,default:""},expandDisabled:{type:Boolean,default:!1}},Xe={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object},backgroundColor:{type:String,default:""}};function Ye(){const n=o.ref(!1);return o.onMounted(()=>{n.value=!0}),n}const Je=o.defineComponent({name:"FOverlay",props:Xe,emits:["click"],setup(n,t){const e=o.ref(n.popupContentPosition),l=o.ref(n.host),i=Ye(),a=o.computed(()=>({backgroundColor:n.backgroundColor||"",pointerEvents:"auto"}));function s(r){t.emit("click"),r.preventDefault(),r.stopPropagation()}o.computed(()=>{const r=l.value;if(r){const c=r.getBoundingClientRect(),{left:f,top:u,height:b}=c;return{left:f,top:u+b}}return e.value});const d=o.computed(()=>({}));return()=>i.value?o.createVNode(o.Teleport,{to:"body"},{default:()=>{var r,c;return[o.createVNode("div",{class:"overlay-container",onClick:f=>s(f),style:a.value},[o.createVNode("div",{style:d.value},[(c=(r=t.slots).default)==null?void 0:c.call(r)])])]}}):null}});function Ze(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Qe(n){const t=document.createElement("div");t.style.display="contents";let e;const l=n.onClickCallback||(()=>{}),i=()=>{l(),e&&e.unmount()};return e=o.createApp({setup(){o.onUnmounted(()=>{document.body.removeChild(t)});const a=Ze(n);return()=>o.createVNode(Je,{"popup-content-position":n.popupPosition,host:n.host,onClick:i,backgroundColor:n.backgroundColor},{default:()=>[a&&a()]})}}),document.body.appendChild(t),e.mount(t),e}class et{static show(t){return Qe(t)}}const tt={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showFloatingClose:{type:Boolean,default:!1},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},openedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60},position:{type:String,default:"center"},host:{type:Object,default:"body"},isMessager:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},maximized:{type:Boolean,default:!1},useTransform:{type:Boolean,default:!0}};class q{constructor(t,e){this.x=t,this.y=e}static getTransformInfo(t){const l=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(l.length>=6){const i=parseInt(l[4],10),a=parseInt(l[5],10);return{x:i,y:a}}return{x:0,y:0}}static fromEvent(t,e=null){if(this.isMouseEvent(t))return new q(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new q(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let l=0;l<t.changedTouches.length;l++)if(t.changedTouches[l].target===e)return new q(t.changedTouches[l].clientX,t.changedTouches[l].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const e=new q(0,0);if(window){const l=window.getComputedStyle(t);if(l){const i=parseInt(l.getPropertyValue("left"),10),a=parseInt(l.getPropertyValue("top"),10);e.x=isNaN(i)?0:i,e.y=isNaN(a)?0:a}return e}return null}static copy(t){return new q(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class J{constructor(t,e){this.width=t,this.height=e}static getCurrent(t){const e=new J(0,0);if(window){const l=window.getComputedStyle(t);return l&&(e.width=parseInt(l.getPropertyValue("width"),10),e.height=parseInt(l.getPropertyValue("height"),10)),e}return null}static copy(t){return new J(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function nt(n,t){const e=o.ref(),l=o.ref(),i=o.ref(),a=o.ref(),s=o.ref(),d=o.ref(),r=o.ref(),c=o.ref(),f=o.ref(),u=o.ref(),b=o.ref(),h=o.ref(n.resizeable),m=o.ref(),p=o.ref(n.draggable),V=o.ref(!1);function M(){const w=l.value||document.body,E=window.getComputedStyle(w);if(!E||!e.value)return;const P=q.getTransformInfo(e.value),L={};r.value&&(L.deltaL=e.value.offsetLeft-r.value.x,L.deltaT=e.value.offsetTop-r.value.y);const U=E.getPropertyValue("position");L.width=w.clientWidth,L.height=w.clientHeight,L.pr=parseInt(E.getPropertyValue("padding-right"),10),L.pb=parseInt(E.getPropertyValue("padding-bottom"),10),L.position=E.getPropertyValue("position"),U==="static"&&(w.style.position="relative"),L.translateX=P.x,L.translateY=P.y,u.value=L}function x(w){if(e.value){a.value=J.getCurrent(e.value),s.value=q.getCurrent(e.value),d.value=a.value?J.copy(a.value):null,r.value=s.value?q.copy(s.value):null,M();const E=w.target.getAttribute("type")||"";c.value={n:!!E.match(/n/),s:!!E.match(/s/),w:!!E.match(/w/),e:!!E.match(/e/)}}}function B(){var w,E,P,L;if(e.value){const U=e.value;c.value&&((c.value.n||c.value.s)&&((w=d.value)!=null&&w.height)&&(U.style.height=d.value.height+"px"),(c.value.w||c.value.e)&&((E=d.value)!=null&&E.width)&&(U.style.width=d.value.width+"px"),r.value&&((P=r.value)!=null&&P.x&&(U.style.left=r.value.x+"px"),(L=r.value)!=null&&L.y&&(U.style.top=r.value.y+"px")))}}function R(){const w=n.minHeight?n.minHeight:1,E=n.minWidth?n.minWidth:1;d.value&&r.value&&c.value&&a.value&&(d.value.height<w&&(d.value.height=w,c.value.n&&s.value&&(r.value.y=s.value.y+(a.value.height-w))),d.value.width<E&&(d.value.width=E,c.value.w&&s.value&&(r.value.x=s.value.x+(a.value.width-E))),n.maxHeight&&d.value.height>n.maxHeight&&(d.value.height=n.maxHeight,s.value&&c.value.n&&(r.value.y=s.value.y+(a.value.height-n.maxHeight))),n.maxWidth&&d.value.width>n.maxWidth&&(d.value.width=n.maxWidth,c.value.w&&s.value&&(r.value.x=s.value.x+(a.value.width-n.maxWidth))))}function j(){if(l.value){const w=u.value;if(r.value&&d.value&&c.value&&a.value){const E=w.width-w.pr-w.deltaL-w.translateX-r.value.x,P=w.height-w.pb-w.deltaT-w.translateY-r.value.y;c.value.n&&r.value.y+w.translateY<0&&s.value&&(r.value.y=-w.translateY,d.value.height=a.value.height+s.value.y+w.translateY),c.value.w&&r.value.x+w.translateX<0&&s.value&&(r.value.x=-w.translateX,d.value.width=a.value.width+s.value.x+w.translateX),d.value.width>E&&(d.value.width=E),d.value.height>P&&(d.value.height=P)}}}function z(w){if(!i.value||!a.value||!s.value||!c.value)return;w.subtract(i.value);const E=w.x,P=w.y;c.value.n?(r.value.y=s.value.y+P,d.value.height=a.value.height-P):c.value.s&&(d.value.height=a.value.height+P),c.value.e?d.value.width=a.value.width+E:c.value.w&&(d.value.width=a.value.width-E,r.value.x=s.value.x+E),j(),R(),B()}function v(w){if(!f.value)return;const E=q.fromEvent(w);E&&z(E)}function C(){if(e.value){const{width:w,height:E,x:P,y:L}=e.value.getBoundingClientRect(),U=q.getTransformInfo(e.value);return{size:{width:w,height:E},position:{x:P-U.x,y:L-U.y}}}return null}function I(w){if(e.value){const E=C();b.value=E}i.value=void 0,a.value=null,s.value=null,d.value=null,r.value=null,c.value=null,f.value=null,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",I)}function N(){document.addEventListener("mousemove",v),document.addEventListener("mouseup",I)}function F(w){w instanceof MouseEvent&&w.button===2||p.value&&(document.body.click(),w.stopPropagation(),w.preventDefault(),i.value=q.fromEvent(w),f.value=w.target,x(w),N())}function S(w){return e.value=w,h.value&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:E=>F(E)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:E=>F(E)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:E=>F(E)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:E=>F(E)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:E=>F(E)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:E=>F(E)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:E=>F(E)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:E=>F(E)},null)])}function O(w=!0){document.body.click();const E=l.value||document.body,P=J.getCurrent(E),L=e.value;w&&L&&(m.value=C(),m.value.transform=L.style.transform),P&&L&&(d.value=P,d.value.height-=14,d.value.width-=14,L.style.height=d.value.height+"px",L.style.width=d.value.width+"px",L.style.left="7px",L.style.top="7px",L.style.transform="",b.value={size:d.value,position:{x:0,y:0}},p.value=!1,V.value=!0)}function W(){var w,E;if(document.body.click(),m.value){const P={width:m.value.size.width||0,height:m.value.size.height||0},L={x:(window.innerWidth-P.width)/2,y:(window.innerHeight-P.height)/2};(w=d.value)==null||w.set(P),(E=r.value)==null||E.set(L);const U=e.value;U.style.height=P.height+"px",U.style.width=P.width+"px",U.style.left=`${L.x}px`,U.style.top=`${L.y}px`,U.style.transform="",b.value={size:P,position:L},p.value=n.draggable,V.value=!1}}function X(){if(e.value){const w=J.getCurrent(e.value);if(w){const{width:E,height:P}=w;e.value.style.left=`${(window.innerWidth-E)/2}px`,e.value.style.top=`${(window.innerHeight-P)/2}px`,e.value.style.transform=""}}}function G(){const w=()=>{V.value?O(!1):X(),document.body.click()};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}}const _=G();return{renderResizeBar:S,boundingElement:l,resizedEventParam:b,maximize:O,restore:W,allowDrag:p,isMaximized:V,unWindowResizeHandle:_,moveToCenter:X}}function ot(n,t,e){const l=o.ref(),i=o.ref(n.draggable),a=o.ref(n.lockAxis),s=o.ref(),d=o.ref(),r=o.ref(!1),c=o.ref(new q(0,0)),f=o.ref(new q(0,0)),u=o.ref(new q(0,0)),b=o.ref(new q(0,0));o.watch(()=>e.value,v=>{s.value.style.cursor=v?"move":"default"});function h(v,C){if(C.tagName==="BUTTON")return!1;if(C===v)return!0;for(const I in C.children)if(Object.prototype.hasOwnProperty.call(C.children,I)&&h(v,C.children[I]))return!0;return!1}function m(){var N,F;let v=u.value.x+f.value.x,C=u.value.y+f.value.y;a.value==="x"?(v=((N=c.value)==null?void 0:N.x)||0,u.value.x=0):a.value==="y"&&(C=((F=c.value)==null?void 0:F.y)||0,u.value.y=0);const I=`translate3d(${Math.round(v)}px, ${Math.round(C)}px, 0px)`;l.value&&(l.value.style.transform=I),b.value.x=v,b.value.y=C}function p(){if(!d.value||!l.value)return null;const v=d.value.getBoundingClientRect(),C=l.value.getBoundingClientRect(),I={top:v.top<C.top,right:v.right>C.right,bottom:v.bottom>C.bottom,left:v.left<C.left};return I.top||(u.value.y-=C.top-v.top),I.bottom||(u.value.y-=C.bottom-v.bottom),I.right||(u.value.x-=C.right-v.right),I.left||(u.value.x-=C.left-v.left),m(),I}function V(v){v&&(c.value&&v.subtract(c.value),u.value.set(v),m(),p())}function M(v){r.value&&i.value&&(v.stopPropagation(),v.preventDefault(),V(q.fromEvent(v,s.value)))}function x(){var v;if(r.value){if(r.value=!1,f.value.add(u.value),u.value.reset(),(v=l.value)==null||v.classList.remove("ng-dragging"),!n.useTransform&&l.value){const{left:C,top:I}=l.value.getBoundingClientRect();l.value.style.left=Math.ceil(C)+"px",l.value.style.top=Math.ceil(I)+"px",l.value.style.transform="none"}t.emit("stopMove"),document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",x)}}function B(){!r.value&&s.value&&(r.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",M),document.addEventListener("mouseup",x))}function R(){if(l.value){const v=q.getTransformInfo(l.value);f.value.set(v);return}f.value.reset()}function j(v){if(!e.value||v instanceof MouseEvent&&v.button===2)return;const C=v.target||v.srcElement;s.value!==void 0&&C&&!h(C,s.value)||i.value!==!1&&(document.body.click(),v.stopPropagation(),v.preventDefault(),c.value=q.fromEvent(v,l.value),R(),B())}function z(v,C,I){if(i.value&&C){if(v)s.value=v;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const N=C.querySelector(n.dragHandle);N&&(s.value=N)}}l.value=C,d.value=I,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",j)):i.value=!1}}return{registerDraggle:z,resetTranslate:R}}function ge(n,t){if(n){const e=l=>{l.key.toLowerCase()===n.toLowerCase()&&t({event:l,key:n})};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}}function it(n,t){const e=o.ref(n.enableEsc);let l=null;return e.value?(l=ge("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:l}):null}function lt(n,t){const e=o.ref(n.enableEnter);let l=null;return e.value?(l=ge("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:l}):null}const oe=o.defineComponent({name:"FModal",props:tt,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove","buttonClick"],setup(n,t){const e=o.ref(n.width||300),l=o.ref(n.height||200),i=o.ref(n.modelValue),a=o.ref(""),s=o.ref(n.class),d=o.ref(n.fitContent),r=o.ref(n.showHeader),c=o.ref(""),f=o.ref(n.showCloseButton),u=o.ref(n.showMaxButton),b=o.ref(!1),h=o.ref(n.dialogType),m=o.ref(n.src),p=o.ref(""),V=o.ref(n.showButtons),M=o.ref(n.title),x=o.ref(n.containment||null),B=o.ref();M.value==="错误提示"&&(M.value=Y.LocaleService.getLocaleValue("messageBox.errorTitle"));const R=o.ref(!1);function j(){const g=document.querySelectorAll(".farris-modal").length;(!g||g-1<=0)&&B.value===document.querySelectorAll(".farris-modal")[0]&&document.body.classList.remove("modal-open"),B.value&&B.value.classList.remove("show")}function z(g,T){const H=T?"accept":"cancel";Promise.resolve().then(()=>{var $;return($=n.beforeClose)==null?void 0:$.call(n,{closeType:H})}).then($=>{$&&(i.value=!1,t.emit("update:modelValue",!1),T!=null&&t.emit(T?"accept":"cancel"),t.emit("closed",g),j())})}const v=[{name:"cancel",text:Y.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:g=>{z(g,!1)}},{name:"accept",text:Y.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:g=>{z(g,!0)}}],C=o.ref(n.buttons&&n.buttons.length?n.buttons:v),I=o.computed(()=>!!c.value),N=o.computed(()=>!!V.value&&!!C.value),F=o.ref(),S=o.ref(),O=o.ref(n.maximized||!1),{renderResizeBar:W,maximize:X,restore:G,boundingElement:_,resizedEventParam:w,allowDrag:E,unWindowResizeHandle:P,moveToCenter:L}=nt(n),{registerDraggle:U}=ot(n,t,E);function ke(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}o.watch(()=>n.title,(g,T)=>{g!==T&&(M.value=g)}),o.watch(()=>n.modelValue,(g,T)=>{g!==T&&(i.value=g,i.value&&n.draggable&&o.nextTick(()=>{S.value&&!x.value&&(x.value=S.value.parentElement,_.value=x.value,U(F.value,S.value,_.value),L())}),g||(x.value&&(x.value=null),j())),i.value?R.value=ke():(O.value=!1,E.value=n.draggable)}),o.watch(()=>n.showHeader,(g,T)=>{g!==T&&(r.value=g)}),o.watch(()=>n.showButtons,(g,T)=>{g!==T&&(V.value=g)}),o.watch(()=>w.value,(g,T)=>{const H=g||{},$=T||{};JSON.stringify(H)!==JSON.stringify($)&&t.emit("resize",{newSize:g,oldSize:T,isMaximized:O.value})}),o.watch([()=>n.width,()=>n.height],(g,T)=>{(g[0]!==T[0]||g[1]!==T[1])&&(e.value=g[0]||500,l.value=g[1]||600)}),o.watch(()=>n.class,(g,T)=>{s.value=g});const se=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),Bt=o.computed(()=>{var H;const g={modal:!0,"farris-modal":!0,fade:!0,"fe-cmp-page-modal":!!n.showFloatingClose};g["f-modal-fitContent"]=!!d.value,g.show=!!se.value;const T=(H=n.maskClass)==null?void 0:H.split(" ");return T==null||T.reduce(($,Q)=>($[Q]=!0,$),g),g}),St=o.computed(()=>{var H;const g={"modal-dialog":!0},T=(H=s.value)==null?void 0:H.split(" ");return T==null||T.reduce(($,Q)=>($[Q]=!0,$),g),g}),Pt=()=>D.isMobilePhone()&&!n.isMessager||!!n.fullscreen,Nt=o.computed(()=>{const g=document.documentElement.clientWidth,T=document.documentElement.clientHeight;if(O.value)return{position:"fixed",top:"0px",left:"0px",width:"100vw",height:"100vh",margin:"0"};const H=Math.min(e.value,g),$=n.position==="right"?"100%":d.value?"auto":`${Math.min(l.value,T-10)}px`,Q=`${(window.innerHeight-($==="100%"||$==="auto"?0:parseInt($)))/2}px`,Zt=n.position==="right"?`${window.innerWidth-H}px`:`${(window.innerWidth-H)/2}px`,Se={position:"absolute",top:Q,left:Zt,width:D.isMobilePhone()?"auto":`${H}px`,height:$};return n.mask||(Se.pointerEvents="auto"),Se}),Te=o.ref(D.getMaxZIndex()||1050),Rt=o.computed(()=>{const g={display:"block",overflow:"hidden"};return n.mask||(g.pointerEvents="none",g.backgroundColor="transparent"),R.value&&(g.backgroundColor="transparent"),g.zIndex=Te.value,g}),Ot=o.computed(()=>({"modal-content":!0,"modal-content-has-header":r.value,"is-mobile":Pt()})),Lt=o.computed(()=>{const g={display:r.value?"":"none"};return g["pointer-events"]=E.value?"auto":"none",g}),Dt=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:O.value})),At=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":h.value==="iframe","f-utils-fill":!0}));function jt(){return{height:`${n.footerHeight||60}px`}}const zt=o.computed(()=>{const g={textAlgin:p.value},T=jt();return Object.assign(g,T)});function fe(g){if(g==null||g.stopPropagation(),O.value){O.value=!1,G();return}X(),O.value=!0}async function Ht(g,T){g.handle?await g.handle(T,g)&&t.emit("closed",T):t.emit("buttonClick",{button:g,$event:T})}function $t(g){g.width&&(e.value=g.width),g.height&&(l.value=g.height),g.buttons&&(C.value=g.buttons),g.title&&(M.value=g.title)}let pe=null,me=null;o.onBeforeMount(()=>{R.value=ke()}),o.onMounted(()=>{S.value&&!x.value&&(x.value=S.value.parentElement,_.value=x.value,U(F.value,S.value,_.value)),se.value&&document.body.classList.add("modal-open"),pe=it(n,t),me=lt(n,t)}),o.onUnmounted(()=>{P&&P(),pe&&pe.remove(),me&&me.remove()}),t.expose({modalElementRef:S,updateModalOptions:$t,close:z,maxDialog:fe,isMaximized:O,disableButtons:(g,T=!0)=>{C.value.forEach(H=>{H.name&&g.includes(H.name)&&(H.disabled=T)})}});function qt(){return o.createVNode("div",{class:"action-wrapper",onClick:g=>z(g,!1)},[o.createVNode("span",{class:"close-icon"},[o.createVNode("i",{class:"f-icon f-icon-close"},null)])])}function Ut(){return o.createVNode("ul",null,[b.value&&o.createVNode("li",{class:"f-btn-icon f-bare"},[o.createVNode("span",{class:"f-icon modal_minimize"},null)]),u.value&&o.createVNode("li",{onClick:fe,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:Dt.value},null)]),f.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:g=>z(g,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}const Wt=g=>{g.preventDefault();const T=g.currentTarget,H=g.deltaY*.5;T.scrollLeft+=H};function Gt(){return o.createVNode("div",{class:"modal-footer",style:zt.value},[C.value&&o.createVNode("div",{class:"buttons",onWheel:Wt},[C.value.map(g=>{var $;const T=o.ref(g.disabled),H=g.class||(($=g.appearance)==null?void 0:$.class);return o.createVNode("button",{name:g.name,style:g.styles,type:"button",disabled:T.value,class:H+(g.iconClass?" btn-icontext":"")+(g.visible===!1?"d-none":""),onClick:Q=>{Ht(g,Q)}},[!!g.iconClass&&o.createVNode("i",{class:g.iconClass},null),g.text])})])])}function Be(g){u.value&&fe()}function _t(){return o.createVNode(o.Fragment,null,[O.value&&o.createVNode("div",{class:"modal-header",style:"position: absolute;background: transparent;height: 45px;width: 100%;",onDblclick:g=>Be()},null),o.createVNode("div",{ref:F,class:"modal-header",style:Lt.value,onDblclick:g=>Be()},[t.slots.headerTemplate?t.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[I.value&&o.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[M.value])]),o.createVNode("div",{class:"actions"},[Ut()])])])}function Kt(){return t.slots.footerTemplate?t.slots.footerTemplate():N.value&&Gt()}function Xt(g){if(g.stopPropagation(),n.allowClickMaskToClose){if(g.target!==B.value)return;z(g,!1)}}function Yt(){var g,T;return o.createVNode("div",{id:a.value,class:St.value,style:Nt.value,ref:S},[n.showFloatingClose&&qt(),o.createVNode("div",{class:Ot.value},[r.value&&_t(),o.createVNode("div",{class:At.value},[(T=(g=t.slots).default)==null?void 0:T.call(g),h.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:m.value},null)]),Kt()]),!d.value&&S.value&&!O.value&&W(S.value)])}function Jt(g){return g||"body"}return o.watchEffect(()=>{se.value&&(Te.value=D.getMaxZIndex()||1050)}),()=>o.createVNode(o.Teleport,{to:Jt(n.host)},{default:()=>[se.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:B,class:Bt.value,style:Rt.value,onClick:Xt},[Yt()])]})]})}});function ye(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function at(n){const t=document.createElement("div");t.style.display="contents";const e=o.createApp({setup(l,i){o.onUnmounted(()=>{document.body.removeChild(t)});const a=o.ref(),s=o.ref(n.class||""),d=o.ref(!!n.showButtons),r=o.ref(!!n.showHeader),c=o.ref(n.showCloseButton==null?!0:n.showCloseButton),f=o.ref(!!n.showFloatingClose),u=o.ref(!0),b=o.ref(n.title||""),h=n.acceptCallback||(()=>{}),m=n.rejectCallback||(()=>{}),p=n.closedCallback||(R=>{}),V=n.resizeHandle||(R=>{}),M=n.stopMoveHandle||(R=>{}),x=ye(n),B=R=>{u.value=!1,e.unmount(),p(R)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(oe,{ref:a,class:s.value,modelValue:u.value,"onUpdate:modelValue":R=>u.value=R,title:b.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":r.value,"show-buttons":d.value,"show-close-button":c.value,"show-max-button":!1,showFloatingClose:f.value,onAccept:h,onCancel:m,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:B,onResize:V,onStopMove:M},{default:()=>[x&&x(e)]})}});return document.body.appendChild(t),e.use(Y.LocaleService.i18n),e.mount(t),e}class st{constructor(t){k(this,"appContext",null);k(this,"modalRef",o.ref());k(this,"activeModalIndex",o.ref(0));k(this,"modalRefs",{});k(this,"isUseEscCloseModal",o.ref(!1));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.modalRefs[this.activeModalIndex.value]}adaptToWindow(t,e){const{width:l,height:i}={width:window.innerWidth,height:window.innerHeight};return l<t&&(t=l-14),i<e&&(e=i-14),{width:t,height:e}}static show(t){const e=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return at(e)}close(t){var e,l;t?(l=t.value)==null||l.close():(e=this.getCurrentModal())==null||e.close()}open(t){const e=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const l=o.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0,maximized:!1},t)),i=o.ref(!0),a=l.value.acceptCallback||(()=>{}),s=l.value.rejectCallback||(()=>{}),d=l.value.closedCallback||((C,I)=>{}),r=l.value.openedCallback||(C=>{}),c=l.value.resizeHandle||(C=>{}),f=t.stopMoveHandle||(C=>{});let u;const b=ye(l.value),h=C=>{var N;i.value=!1;const I=(N=C==null?void 0:C.target)==null?void 0:N.classList.contains("modal_close");d(C,this.isUseEscCloseModal.value?"esc":I?"icon":"button")},m=C=>{h(C),u&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,e),u=null,this.modalRef.value=null,this.modalRefs){const I=Object.keys(this.modalRefs).map(N=>Number(N));I.length>0?this.activeModalIndex.value=Math.max(...I):this.activeModalIndex.value=0,this.modalRefs[this.activeModalIndex.value]&&(this.modalRef.value=this.modalRefs[this.activeModalIndex.value])}this.isUseEscCloseModal.value=!1})},p=C=>{var I;this.isUseEscCloseModal.value=!0,(I=this.getCurrentModal())==null||I.close(C==null?void 0:C.event)},{width:V,height:M}=l.value,x=this.adaptToWindow(V||500,M||320);Object.assign(l.value,x);const B=o.ref(),R=()=>o.createVNode(oe,o.mergeProps({ref:B,modelValue:i.value,"onUpdate:modelValue":C=>i.value=C},l.value,{isMessager:l.value.class&&l.value.class.indexOf("modal-message")>-1,onAccept:a,onCancel:s,onClosed:m,onResize:c,onEsc:p,onStopMove:f,maximized:l.value.maximized}),{default:()=>[b&&b(this.app)]});u=(C=>{const I=o.h(R,C);return I.appContext=this.appContext,o.render(I,e),I})({...l.value}),this.activeModalIndex.value++;const z=this.activeModalIndex.value;this.modalRefs[z]=B.value;const v=C=>{l.value={...l.value,...C},u&&o.render(o.cloneVNode(u,{...l}),e)};return o.nextTick(()=>{this.modalRefs[z]=B.value,this.modalRef.value=B.value,r(new Event("opened"))}),{update:v,destroy:m,modalRef:B,close:()=>{var C;(C=B.value)==null||C.close()},disableButtons:(C,I=!0)=>{var N;(N=B.value)==null||N.disableButtons(C,I)}}}}const be=Symbol("FModalService");oe.install=n=>{n.component(oe.name,oe);const t=new st(n);n.provide(be,t),n.provide("FModalService",t)};function ve(n,t){function e(){const l=n.beforeOpen||n.beforeClickButton||null;let i=Promise.resolve(!0);if(l){const a=l(t.value);if(typeof a>"u")return i;typeof a=="boolean"?i=Promise.resolve(a):i=a}return i}return{judgeCanOpen:e}}function rt(n,t,e,l,i){const a=o.ref(n.buttonBehavior),s=o.ref(n.popupOnInput),d=o.computed(()=>({"input-group-append":!0,"append-force-show":n.showButtonWhenDisabled&&(n.readonly||n.disable)})),{judgeCanOpen:r}=ve(n,i),c=o.computed(()=>n.showButtonWhenDisabled||(!n.editable||!n.readonly)&&!n.disable),f=o.inject(be,null),u=o.ref();async function b(p){if(await r()&&c.value){const V=!!t.slots.default;if(a.value==="Modal"){const M=n.modalOptions,x=f==null?void 0:f.open({...M,render:()=>t.slots.default&&t.slots.default()});u.value=x==null?void 0:x.modalRef}a.value==="Overlay"&&et.show({host:document.body,backgroundColor:"rgba(0,0,0,.15)",render:()=>t.slots.default&&t.slots.default()}),V&&a.value==="Popup"&&l.togglePopup(!0),V&&s.value&&l.hidePopup(),t.emit("clickButton",{origin:p,value:n.modelValue})}}function h(p){t.emit("mouseEnterIcon",p)}function m(p){t.emit("mouseLeaveIcon",p)}return{buttonGroupClass:d,onClickButton:b,onMouseEnterButton:h,onMouseLeaveButton:m,modalRef:u}}function dt(n,t,e,l,i,a){const s=o.ref(!1),d=o.computed(()=>n.enableClear&&!n.readonly&&!n.disable&&!D.isMobilePhone()),{changeTextBoxValue:r,hasClearClass:c}=a,f=o.ref(!1);function u(V){s.value=V,c.value=V}const b=o.computed(()=>d.value&&!!(i!=null&&i.value)&&f.value);o.watch(i,()=>{u(b.value)});function h(V){const M=!n.readonly&&!n.disable&&n.editable,x=!n.editable;V==null||V.stopPropagation(),(M||x)&&(r(""),i.value="",u(!s.value),t.emit("clear"))}function m(V){if(f.value=!0,!!d.value){if(!e.value){u(!1);return}!n.disable&&!n.readonly&&u(!0)}}function p(V){f.value=!1,d.value&&u(!1)}return{enableClearButton:d,showClearButton:s,onClearValue:h,onMouseEnterTextBox:m,onMouseLeaveTextBox:p}}function ut(n,t,e,l,i){const a=o.computed(()=>n.popupOnInput),s=o.computed(()=>n.popupOnFocus),{shouldPopupContent:d,closeAllPopover:r}=i,c=o.ref(!1),f=o.computed(()=>n.enableTitle?e.value:""),u=o.computed(()=>(n.disable||n.readonly)&&!n.forcePlaceholder?"":n.placeholder),b=o.computed(()=>n.readonly||!n.editable||D.isMobilePhone()),h=o.ref(!1),m=o.computed(()=>!n.disable&&h.value),p=o.computed(()=>({"text-left":n.textAlign==="left","text-center":n.textAlign==="center","text-right":n.textAlign==="right","form-control":!0,"f-utils-fill":!0})),V=o.computed(()=>({"input-group":!0,"f-state-disabled":n.disable,"f-state-editable":n.editable&&!n.disable&&!n.readonly,"f-state-readonly":n.readonly,"f-state-focus":m.value,"input-group--has-clear":n.enableClear&&c.value}));function M(F,S=!0){e.value=F,S&&(t.emit("change",F),t.emit("update:modelValue",F))}function x(F){d.value=!1,M(F,!0)}o.watch(()=>n.modelValue,F=>{e.value=F});function B(F){h.value=!1,t.emit("blur",F),F.stopPropagation()}function R(F){t.emit("click",F),r(),t.slots.default&&!n.disable&&!n.readonly&&n.popupOnClick&&i.togglePopup()}function j(F){!n.disable&&!n.readonly&&(h.value=!0,b.value||(t.emit("focus",F),s.value&&!d.value&&i.popup()))}function z(F){t.emit("input",F);const S=F.target.value;l.value=S,e.value!==S&&M(S,n.updateOn==="change"),a.value&&!d.value&&i.popup()}function v(F){F.target.tagName!=="INPUT"&&F.preventDefault(),F.stopPropagation()}function C(F){t.emit("keydown",F)}function I(F){F.key==="Enter"&&(a.value||s.value)&&i.hidePopup(),t.emit("keyup",F)}function N(F){const S=F.target.value;F.stopPropagation(),M(S)}return{hasFocusedTextBox:m,isTextBoxReadonly:b,textBoxClass:p,textBoxPlaceholder:u,textBoxTitle:f,inputGroupClass:V,hasClearClass:c,changeTextBoxValue:M,commitValue:x,onBlurTextBox:B,onClickTextBox:R,onFocusTextBox:j,onInput:z,onKeyDownTextBox:C,onKeyUpTextBox:I,onMouseDownTextBox:v,onTextBoxValueChange:N}}const Z="FarrisVue_PopoverInstancesKey";function ct(n,t,e,l){const i=o.ref(),a=o.ref(!1),{judgeCanOpen:s}=ve(n,l);o.watch(()=>i.value,(h,m)=>{window[Z]=window[Z]||new WeakMap,h?window[Z].set(e.value,h):window[Z].delete(e.value)});function d(){if(window[Z]){const h=window[Z];document.querySelectorAll(".f-button-edit,.v-popover").forEach(m=>{const p=h.get(m);p&&m!==e.value&&!e.value.closest(".popover-fitcontent")&&p.hide()})}}function r(){const h=i.value;h&&(h.show?h.show(e.value):h.open&&h.open(e.value))}async function c(h=!1){if(!!t.slots.default){if(!h&&!a.value&&!await s())return;a.value=!a.value,a.value&&(await o.nextTick(),r())}}async function f(h=!1){if(!!t.slots.default){if(!h&&!await s())return;a.value=!0,await o.nextTick(),r()}}function u(){a.value=!1}function b(){a.value=!0,o.nextTick(()=>{r()})}return{hidePopup:u,showPopup:b,popup:f,shouldPopupContent:a,togglePopup:c,popoverRef:i,closeAllPopover:d}}function ft(n,t,e){const l=o.ref(),{isTextBoxReadonly:i,textBoxClass:a,textBoxPlaceholder:s,textBoxTitle:d,onBlurTextBox:r,onClickTextBox:c,onFocusTextBox:f,onInput:u,onKeyDownTextBox:b,onKeyUpTextBox:h,onMouseDownTextBox:m,onTextBoxValueChange:p}=e,V=o.ref(n.id),{uuid:M}=D.useGuid(),x=o.computed(()=>({}));o.onMounted(()=>{var v,C;n.selectOnCreated&&((v=l.value)==null||v.select()),n.focusOnCreated&&((C=l.value)==null||C.focus({preventScroll:!0})),V.value||(V.value="button-edit_"+M(8)),V.value=V.value+"-textbox"});const B=o.ref(!1),R=v=>{v.preventDefault(),B.value=!0},j=v=>{v.preventDefault(),B.value=!1,u(v)};function z(v){B.value||u(v)}return()=>o.createVNode("input",{id:n.id?n.id+"-textbox":void 0,ref:l,name:"input-group-value",autocomplete:n.autoComplete?"on":"off",class:a.value,style:x.value,disabled:n.disable,maxlength:n.maxLength,minlength:n.minLength,placeholder:s.value,readonly:i.value,tabindex:n.tabIndex,title:d.value,type:n.inputType,value:t.value,onBlur:r,onChange:p,onClick:c,onFocus:f,onInput:z,onKeydown:b,onKeyup:h,onMousedown:m,onCompositionend:j,onCompositionstart:R},null)}function pt(n,t,e){const l=o.ref(n.separator),i=o.computed(()=>n.readonly||n.disable),{changeTextBoxValue:a,onFocusTextBox:s,onBlurTextBox:d,onClickTextBox:r,textBoxPlaceholder:c}=e,f=o.computed(()=>t.value?t.value.split(l.value).map(m=>({name:m,selectable:!0})):[]);function u(m){a(m.map(p=>p.name).join(l.value),!0)}o.watch(()=>n.separator,m=>{l.value=m});const b=o.ref(!n.disable&&!n.readonly);o.watch([()=>n.disable,()=>n.readonly],([m,p],[V,M])=>{b.value=!m&&!p});function h(m){r(m)}return()=>o.createVNode(Pe,{tabindex:n.tabIndex,onFocus:s,onBlur:d,id:`${n.id}-tag-editor`,class:"form-control",placeholder:c.value,data:f.value,showClose:!i.value,showInput:!0,disable:i.value,onChange:u,onClick:h},null)}function mt(n,t,e,l){const{buttonGroupClass:i,onClickButton:a,onMouseEnterButton:s,onMouseLeaveButton:d}=e,{enableClearButton:r,showClearButton:c,onClearValue:f}=l,u=o.ref(),b=ie.debounce(p=>{a(p)},n.buttonBehavior==="Modal"?0:200),h=()=>{t.emit("beforeClearValue")},{renderExpandContent:m}=Ne.useInputExpand(n,t);return{renderButtonGroup:()=>o.createVNode(o.Fragment,null,[o.createVNode("div",{id:n.id?`${n.id}-button-group`:void 0,class:i.value},[r.value&&o.withDirectives(o.createVNode("span",{class:"input-group-text input-group-clear",onClick:f,onMousedown:h},[o.createVNode("i",{class:"f-icon modal_close"},null)]),[[o.vShow,c.value]]),t.slots.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",onClick:b,onMouseenter:s,onMouseleave:d},[t.slots.buttonContent()]):n.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",innerHTML:n.buttonContent,ref:u,onClick:p=>b(p),onMouseenter:s,onMouseleave:d},null):null]),m()]),buttonHandleElement:u}}function ht(n,t,e){const l=o.ref(n.popupMinWidth),{hidePopup:i,popoverRef:a}=e,s=()=>{t.emit("shown")},d=()=>{i(),t.emit("hidden")};return()=>D.isMobilePhone()?o.createVNode(Oe,{id:`${n.id}-drawer`,ref:a,position:n.placement,width:"auto",height:"auto",host:n.popupHost,showHeader:!1,showFooter:!1,customClass:"f-drawer--no-padding","onUpdate:modelValue":r=>r?s():d()},{default:()=>{var r,c;return[o.createTextVNode(" "),(c=(r=t.slots).default)==null?void 0:c.call(r),o.createTextVNode(" ")]}}):o.createVNode(Re,{id:`${n.id}-popover`,ref:a,placement:n.placement,host:n.popupHost,"keep-width-with-reference":n.keepWidthWithReference,fitContent:!0,"right-boundary":n.popupRightBoundary,minWidth:l.value,class:n.popupClass,offsetX:n.popupOffsetX,offsetY:n.popupOffsetY,onHidden:d,onShown:s,beforeClose:n.beforeClosePopup,limitContentBySpace:n.limitContentBySpace},{default:()=>{var r,c;return[(c=(r=t.slots).default)==null?void 0:c.call(r)]}})}const gt=o.defineComponent({name:"FButtonEdit",props:Ke,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue","beforeClearValue","expandClick","hidden","shown"],setup(n,t){const e=o.ref(),l=o.ref(n.customClass),i=o.ref(n.modelValue),a=ct(n,t,e,i),{shouldPopupContent:s,hidePopup:d,showPopup:r,togglePopup:c}=a,f=rt(n,t,e,a,i),u=o.ref(""),b=ut(n,t,i,u,a),{hasFocusedTextBox:h,commitValue:m,inputGroupClass:p,changeTextBoxValue:V}=b,M=dt(n,t,i,h,u,b),{onMouseEnterTextBox:x,onMouseLeaveTextBox:B}=M,R=o.ref(!1),j=o.computed(()=>{const w={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!n.wrapText};return l.value&&l.value.split(" ").reduce((E,P)=>(E[P]=!0,E),w),w}),z=o.computed(()=>({overflow:n.wrapText?"hidden":""})),v=o.computed(()=>({})),C=o.ref(n.showAppendButton);function I(){if(!n.multiSelect||n.inputType!=="tag"||!e.value)return 0;let w=0;const E=Array.from(e.value.querySelectorAll(".farris-tag-item"));return E&&E.length&&(w=E.map(P=>P.offsetTop).filter(P=>P>20).length),w}const N=o.ref(I());o.onUpdated(()=>{N.value=I()});function F(){return n.multiSelect&&n.inputType==="tag"?()=>o.createVNode(o.Fragment,null,[pt(n,i,b)(),!!N.value&&o.createVNode("div",{class:"d-flex flex-row mr-2 more-tags","more-tags":!0},[o.createVNode("span",{class:"multi--more-text"},[o.createTextVNode("+"),N.value])])]):ft(n,i,b)}let S=F();o.watch([()=>n.multiSelect,()=>n.inputType],()=>{S=F()});const{renderButtonGroup:O,buttonHandleElement:W}=mt(n,t,f,M),X=ht(n,t,a),G=o.ref(s.value),_={displayText:u,commitValue:m,elementRef:e,hidePopup:d,showPopup:r,popoverRef:a.popoverRef,shouldPopupContent:s,togglePopup:c,openDialog:()=>{W.value&&n.buttonBehavior==="Modal"&&W.value.click(),t.slots.content&&ie.debounce(()=>{f.onClickButton(null)},n.buttonBehavior==="Modal"?0:200)()},getModal:()=>{var w;return n.buttonBehavior==="Modal"?(w=f.modalRef.value)==null?void 0:w.value:null},getTextbox:()=>{var w;return(w=e.value)==null?void 0:w.querySelector("input")},forceClosePopup:()=>{G.value=!1,R.value=!0,s.value=!1},clear:()=>{V(""),u.value=""},setText:w=>{V(w,!1),u.value=w}};return o.onMounted(()=>{e.value.componentInstance=_,window.onresize=()=>{document.body.click()}}),o.onBeforeUnmount(()=>{var w;window.onresize=null,(w=window[Z])==null||w.delete(e.value)}),t.expose(_),o.watch(()=>s.value,async(w,E)=>{if(R.value){G.value=w,R.value=!1;return}if(!w&&n.beforeClosePopup&&typeof n.beforeClosePopup=="function"){try{const P=await n.beforeClosePopup();G.value=!P,(!P||n.readonly)&&(s.value=!0)}catch(P){console.error("Error in beforeClosePopup:",P),G.value=E,s.value=E}return}G.value=w}),()=>{var w,E;return o.createVNode(o.Fragment,null,[o.createVNode("div",o.mergeProps(t.attrs,{ref:e,class:j.value,id:n.id?n.id:void 0,style:z.value}),[o.createVNode("div",{id:n.id?`${n.id}-input-group`:void 0,class:p.value,style:v.value,onMouseenter:x,onMouseleave:B},[(E=(w=t.slots).precontent)==null?void 0:E.call(w),t.slots.content?t.slots.content():S(),t.slots.content?null:C.value&&O()])]),G.value&&X()])}}});function Ce(n,t,e){return t}function we(n,t,e){return t}const xe=new Map([["appearance",K.resolveAppearance]]),Ve=new Map([]),Ee={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-group.schema.json",title:"item-collection-editor",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a item-collection-editor",type:"string"},type:{description:"The type string of item-collection-editor component",type:"string",default:"item-collection-editor"},requiredFields:{description:"",type:"array",default:[]},uniqueFields:{description:"",type:"array",default:[]},dynamicMappingKeys:{type:"boolean",default:!1},columns:{description:"",type:"array",default:[]},modalTitle:{description:"",type:"string",default:""},canEmpty:{description:"",type:"boolean",default:!0},valueField:{description:"",type:"string",default:"value"},nameField:{description:"",type:"string",default:"name"},idField:{description:"",type:"string",default:"value"},readonly:{description:"",type:"boolean",default:!1},modelValue:{description:"",type:"string",default:""},beforeSubmit:{description:"",type:"object",default:null},title:{description:"",type:"string",default:"项编辑器"},modalWidth:{description:"",type:"number",default:900},modalHeight:{description:"",type:"number",default:600}},required:["id","type"],ignore:[]},de={requiredFields:{type:Array,default:[]},uniqueFields:{type:Array,default:[]},dynamicMappingKeys:{type:Boolean,default:!1},columns:{type:Array,default:[]},modalTitle:{type:String,default:"项编辑器"},canEmpty:{type:Boolean,default:!0},valueField:{type:String,default:"value"},nameField:{type:String,default:"name"},idField:{type:String,default:"value"},readonly:{type:Boolean,default:!1},modelValue:{type:Array,default:[]},beforeSubmit:{type:Function,default:null},title:{type:String,default:"项编辑器"},modalWidth:{type:Number,default:900},modalHeight:{type:Number,default:600}};K.createPropsResolver(de,Ee,Ve,we);const yt=K.getPropsResolverGenerator(de,Ee,Ve,we),bt={requiredFields:{type:Array,default:[]},uniqueFields:{type:Array,default:[]},dynamicMappingKeys:{type:Boolean,default:!1},columns:{type:Array,default:[]},canEmpty:{type:Boolean,default:!0},valueField:{type:String,default:"value"},nameField:{type:String,default:"value"},datas:{type:Array,default:[]},readonly:{type:Boolean,default:!1},commandOption:{type:Object,default:{enable:!1}}},vt=o.defineComponent({name:"FItemCollectionEditorInner",props:bt,emits:["change"],setup(n,t){let e="";const{guid:l}=D.useGuid(),i=new De.FNotifyService,a=o.ref(n.valueField),s=o.ref(n.nameField),d={editMode:"cell"},r={fitColumns:!0},c=o.ref(),f=n.columns;let u=n.datas;o.watch(()=>[n.datas],()=>{u=n.datas,c.value.updateDataSource(u)});function b(){const v={};return f.forEach(C=>{C.editor&&(C.editor.type==="checkbox"||C.editor.type==="switch")?v[C.field]=!1:v[C.field]=""}),v}function h(){if(n.dynamicMappingKeys){const v="请先填写XXX。",C=a.value.trim()?s.value.trim()?"":"枚举名称字段":"枚举值字段";return i.warning({position:"top-center",message:v.replace("XXX",C)}),!1}return!0}function m(v){const C="不允许重复。";if(!h())return!1;if(!v||v.length===0)return n.canEmpty?!0:(i.warning({position:"top-center",message:"请添加值。"}),!1);const I=n.requiredFields||[],N="不允许为空。";for(const S of v)for(const O of Object.keys(S)){const W=f.find(X=>X.field===O);if(W&&W.editor&&(W.editor.type==="checkbox"||W.editor.type==="switch")){if(I.includes(O)&&(S[O]===null||S[O]===void 0))return i.warning({position:"top-center",message:W.title+N}),!1}else if(I.includes(O)&&(S[O]===void 0||S[O]===""||S[O]===null))return i.warning({position:"top-center",message:W.title+N}),!1}const F=n.uniqueFields||[];for(const S of F){const O=v.map(G=>G[S]),W=new Set(O),X=Array.from(W);if(O.length!==X.length){const G=f.find(_=>_.field===S);return i.warning({position:"top-center",message:G.title+C}),!1}}return!0}function p(){if(n.readonly||!h())return;const v=b(),C=l();u.push({hId:C,...v}),c.value.updateDataSource(u),c.value.selectRowById(C)}function V(v){u&&u.length>0?(v||(v=u[0].hId),c.value.selectRowById(v)):e=""}function M(){if(!e){i.warning({position:"top-center",message:"请先选中行!"});return}const v=u.findIndex(N=>N.hId===e);u=[...u.filter(N=>N.hId!==e)],c.value.updateDataSource(u);let I="";v<u.length&&u.length>0&&(I=u[v].hId),V(I)}function x(v){if(!v||v.length===0)return v;const C=[];return v.forEach(I=>{const{value:N,name:F,...S}=I,O=Object.assign({},S);O[a.value.trim()]=N,O[s.value.trim()]=F,C.push(O)}),C}function B(){c.value.endEditCell();const v=[];return u.forEach(C=>{const{hId:I,...N}=C,F={};for(const S in N)S.startsWith("_")||(F[S]=N[S]);v.push(F)}),v}function R(){let v=B();return m(v)?(n.dynamicMappingKeys?(v=x(v),t.emit("change",v,void 0,{valueField:a.value.trim(),nameField:s.value.trim()})):t.emit("change",v,void 0,null),!0):!1}function j(){return u}t.expose({clickConfirm:R,getItems:B,getDataGridDatas:j}),o.onMounted(()=>{V()});function z(v){var C;e=(C=v[0])==null?void 0:C.hId}return()=>o.createVNode("div",{class:"f-utils-fill-flex-column h-100"},[!n.readonly&&o.createVNode("div",{class:"mb-1 py-1 ml-1"},[o.createVNode("button",{class:"btn f-rt-btn f-btn-ml btn-primary",onClick:()=>p()},[o.createTextVNode("新增")]),o.createVNode("button",{class:"btn f-rt-btn f-btn-ml btn-secondary",onClick:()=>M()},[o.createTextVNode("删除")])]),o.createVNode("div",{class:"f-utils-fill border",style:"margin:0 8px;border-radius:12px;"},[o.createVNode(Le,{ref:c,showBorder:!0,idField:"hId",columns:f,data:u,editable:!n.readonly,"edit-option":d,columnOption:r,commandOption:n.commandOption,fit:!0,onSelectionChange:z},null)])])}}),Ct={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},wt={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},ue=o.defineComponent({name:"Toast",props:wt,emits:["close","click"],setup:(n,t)=>{const e=o.ref(n.animate),l="fadeOut",i=o.computed(()=>n.options),a=o.ref(!1),s=o.computed(()=>i.value.title&&i.value.message),d=o.computed(()=>!i.value.title&&i.value.message),r=o.computed(()=>{const x={animated:a.value,toast:!0,"toast--only-content":!s.value};return x[n.animate]=!1,x[l]=a.value,x["toasty-type-"+i.value.type]=!0,i.value.theme&&(x[i.value.theme]=!0),x}),c=o.computed(()=>{const R=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,j={"f-icon":!0};return j[R]=!0,j}),f=o.computed(()=>i.value.title||i.value.message),u=o.computed(()=>n.showCloseButton),b=o.computed(()=>!!i.value.buttons||!!t.slots.default),h=o.computed(()=>Y.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function m(x){x.stopPropagation(),x.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function p(x,B){}function V(x){return`f-preten-link ${x.customClass?x.customClass:""}`}o.watch(e,()=>{e.value});const M=()=>{var x;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((x=i.value.buttons)==null?void 0:x.map(B=>o.createVNode("span",{class:V(B),onClick:R=>void 0},[B.text]))),t.slots.default&&t.slots.default()])])};return()=>o.createVNode("div",{class:r.value,style:"min-height:44px"},[u.value&&o.createVNode("button",{title:Y.LocaleService.getLocaleValue("messageBox.close"),class:"toast-close f-btn-icon f-bare",onClick:m},[o.createVNode("span",{class:"f-icon modal_close"},null)]),f.value&&o.createVNode("section",{class:"modal-tips"},[!s.value&&o.createVNode("div",{class:"float-left modal-tips-iconwrap"},[o.createVNode("span",{class:c.value},null)]),o.createVNode("div",{class:"modal-tips-content"},[s.value&&o.createVNode(o.Fragment,null,[o.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:i.value.title},null),o.createVNode("p",{class:"toast-msg",innerHTML:i.value.message,style:h.value},null),b.value&&M()]),d.value&&(i.value.buttons?o.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:i.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[M()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:h.value,innerHTML:i.value.message},null))])])])}}),xt=["moz","ms","webkit"];function Vt(){let n=0;return t=>{const e=new Date().getTime(),l=Math.max(0,16-(e-n)),i=setTimeout(()=>{t(e+l)},l);return n=e+l,i}}function Et(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const n=xt.filter(t=>`${t}RequestAnimationFrame`in window)[0];return n?window[`${n}RequestAnimationFrame`]:Vt()}Et(),o.ref("");function Me(){if(typeof window>"u"||typeof navigator>"u")return!1;const n=navigator.userAgent||navigator.vendor||window.opera,t=[/iPhone/i,/iPod/i,/Android.*Mobile/i,/webOS/i,/BlackBerry/i,/IEMobile/i,/Opera Mini/i,/Harmony/i],e=[/iPad/i,/Android(?!.*Mobile)/i,/Tablet/i,/PlayBook/i,/Kindle/i,/Silk/i];for(const r of e)if(r.test(n))return!1;for(const r of t)if(r.test(n))return!0;if(typeof screen>"u")return!1;const l="ontouchstart"in window||navigator.maxTouchPoints>0,i=screen.width,a=screen.height,s=Math.min(i,a);return!!(l&&s<=768)}function Mt(){const n=Me();return n&&document.body.classList.add("f-mobile"),n}typeof document<"u"&&Mt();const ae=o.defineComponent({name:"Notify",props:Ct,emits:["close","empty"],setup(n,t){var p;const e=Me(),i=`farris-notify-${(p=n.options)!=null&&p.type?n.options.type:"info"}}`,a=o.computed(()=>({"farris-notify":!0,[i]:e})),s={left:12,right:12,top:20,bottom:12},d=o.ref(),r=o.ref(n.options),c=o.ref(n.showCloseButton),f=o.computed(()=>n.position||"bottom-right"),u=o.computed(()=>n.timeout!=null?n.timeout:3e3),b=o.computed(()=>{const V=n.bottom?n.bottom:s.bottom,M=n.top?n.top:s.top,x={transition:"all 0.2s ease",left:f.value.indexOf("left")>-1?`${n.left?n.left:s.left}px`:"",right:f.value.indexOf("right")>-1?`${n.right?n.right:s.right}px`:"",top:f.value.indexOf("top")>-1?`${M}px`:"",bottom:f.value.indexOf("bottom")>-1?`${V}px`:""};return f.value.indexOf("center")>-1&&(x.left="50%",x.marginLeft="calc(-24rem / 2)",f.value==="center-center"&&(x.top="50%",x.transform="translate(-50%, -50%)")),x});function h(V){t.emit("close")}u.value&&setTimeout(()=>{h()},u.value),t.expose({closeToast:h,container:d,notifyPosition:f});function m(V,M){h()}return()=>{var V;return e?o.createVNode("div",{class:a.value,ref:d},[(V=n.options)==null?void 0:V.message]):o.createVNode("div",{class:a.value,style:b.value,ref:d},[o.createVNode(ue,{options:r.value,showCloseButton:c.value,animate:n.animate,onClose:M=>m(M,r.value)},null)])}}});class Ft{constructor(){k(this,"notifyRefs",[]);k(this,"globalConfig",o.reactive({}))}escapeAllHtml(t){if(typeof t!="string"||!t)return"";const e=document.createElement("div");return e.textContent=t||"",e.innerHTML.replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(t){const e=this,i=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...t}),a=document.createElement("div");a.style.display="contents";const s=o.createApp({setup(){var c;const d=o.ref();function r(){d.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(i,d),s.unmount()},220)}if(i.position.indexOf("top")>-1){const f=e.getNotifyInstances(i.position),u=f[f.length-1];if(u){const b=u.value.container.getBoundingClientRect();i.top=b.bottom}}return i.safeHtml&&((c=i.options)!=null&&c.message)&&(i.options.message=e.escapeAllHtml(i.options.message)),o.onUnmounted(()=>{document.body.removeChild(a)}),o.onMounted(()=>{e.updateNotifyPositionForCreate(i,d)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(ae,o.mergeProps({ref:d},i,{onClose:r}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.use(Y.LocaleService.i18n),s.mount(a),s}getNotifyInstances(t){return this.notifyRefs.filter(e=>e.value.notifyPosition===t)}updateNotifyPositionForCreate(t,e){if(this.notifyRefs&&this.notifyRefs.length){const l=window.innerHeight;t.position.indexOf("bottom")>-1&&this.getNotifyInstances(t.position).forEach(i=>{const a=i.value.container.getBoundingClientRect();i.value.container.style.bottom=a.height+l-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,e]}updateNotifyPositionForClose(t,e){const l=this.notifyRefs.indexOf(e);if(t.position.indexOf("top")>-1){const i=this.getNotifyInstances(t.position),a=i.indexOf(e);i.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}l>-1&&this.notifyRefs.splice(l,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,e){let l="",i="",a,s,d;typeof e=="string"?l=e:e&&(l=e.message||"",i=e.title||"",s=e.position||null,d=e.showCloseButton!=null?e.showCloseButton:null,a=e.timeout!=null?e.timeout:null);const c={options:{type:t,message:l,title:i}};return s!=null&&(c.position=s),d!=null&&(c.showCloseButton=d),a!=null&&(c.timeout=a),c}info(t){const e=this.buildNotifyProps("info",t);return this.show(e)}success(t){const e=this.buildNotifyProps("success",t);return this.show(e)}warning(t){const e=this.buildNotifyProps("warning",t);return this.show(e)}error(t){const e=this.buildNotifyProps("error",t);return this.show(e)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const Fe=Symbol("NOTIFY_SERVICE_TOKEN");ae.install=n=>{n.component(ae.name,ae),n.component(ue.name,ue);const t=new Ft;n.provide(Fe,t),n.provide("FNotifyService",t)};const It=o.defineComponent({name:"FItemCollectionEditor",props:de,components:{},emits:["change"],setup(n,t){const e=o.inject(Fe),{guid:l}=D.useGuid(),i=o.ref(`共 ${(n.modelValue||[]).length} 项`),a=o.ref(n.valueField),s=o.ref(n.nameField),d=o.ref();function r(){let h=[];return n.dynamicMappingKeys?(h=[],a.value=a.value.trim(),s.value=s.value.trim(),(n.modelValue||[]).forEach(m=>{if(a.value&&s.value){const{[a.value]:p,[s.value]:V,...M}=m,x=M||{};x.value=p,x.name=V,x.hId=l(),h.push(x)}})):(h=ie.cloneDeep(n.modelValue||[]),h.forEach(m=>{m.hId=l()})),h}function c(){let h=[];return n.columns&&n.columns.length>0?h=n.columns:h=[{field:n.valueField,title:"值",dataType:"string"},{field:n.nameField,title:"名称",dataType:"string"}],h}function f(){}const u={fitContent:!1,width:n.modalWidth||900,height:n.modalHeight||600,title:n.title||"项编辑器",resizeable:!0,draggable:!0,minWidth:500,minHeight:300,buttons:[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:h=>!0},{name:"accept",text:"确定",class:"btn btn-primary",handle:async h=>{if(n.beforeSubmit&&typeof n.beforeSubmit=="function"){const p=d.value.getItems();if(!await n.beforeSubmit({notifyService:e,data:p}))return!1}return!!d.value.clickConfirm()}}]};function b(h,m,p){i.value=`共 ${h.length} 项`,t.emit("change",h,m,p)}return o.watch(()=>n.modelValue,h=>{i.value=`共 ${(n.modelValue||[]).length} 项`}),o.onMounted(()=>{}),()=>o.createVNode(gt,{"button-behavior":"Modal","modal-options":u,modelValue:i.value,"onUpdate:modelValue":h=>i.value=h,editable:!1,beforeOpen:f},{default:()=>[o.createVNode("div",{class:"f-utils-absolute-all f-utils-flex-column"},[n.dynamicMappingKeys&&o.createVNode("div",{class:"farris-form-controls-inline p-2 f-form-layout farris-form f-form-lable-auto"},[o.createVNode("div",{class:"farris-group-wrap mr-3"},[o.createVNode("div",{class:"form-group farris-form-group"},[o.createVNode("label",{class:"col-form-label"},[o.createVNode("span",{class:"farris-label-info text-danger"},[o.createTextVNode("*")]),o.createVNode("span",{class:"farris-label-text"},[o.createTextVNode("枚举值字段")])]),o.createVNode("div",{class:"farris-input-wrap"},[o.withDirectives(o.createVNode("input",{type:"input",class:"form-control","onUpdate:modelValue":h=>a.value=h,readonly:n.readonly},null),[[o.vModelText,a.value]])])])]),o.createVNode("div",{class:"farris-group-wrap"},[o.createVNode("div",{class:"form-group farris-form-group"},[o.createVNode("label",{class:"col-form-label"},[o.createVNode("span",{class:"farris-label-info text-danger"},[o.createTextVNode("*")]),o.createVNode("span",{class:"farris-label-text"},[o.createTextVNode("枚举名称字段")])]),o.createVNode("div",{class:"farris-input-wrap"},[o.withDirectives(o.createVNode("input",{type:"input",class:"form-control","onUpdate:modelValue":h=>s.value=h,readonly:n.readonly},null),[[o.vModelText,s.value]])])])])]),o.createVNode(vt,{ref:d,valueField:a.value,nameField:s.value,requiredFields:n.requiredFields,uniqueFields:n.uniqueFields,dynamicMappingKeys:n.dynamicMappingKeys,readonly:n.readonly,canEmpty:n.canEmpty,datas:r(),columns:c(),onChange:(h,m,p)=>b(h,m,p)},null)])]})}}),Ie={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-group.schema.json",title:"radio-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a radio-group",type:"string"},type:{description:"The type string of radio-group component",type:"string",default:"radio-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0},textField:{description:"",type:"string",default:"name"},valueField:{description:"",type:"string",default:"value"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},bindDataSource:{description:"",type:"string",default:""},direction:{description:"",type:"string",default:"horizontal"},onChange:{description:"值变化事件(兼容旧配置,对应 emit change)",type:"string"},onChangeValue:{description:"值变化事件(对应 emit changeValue)",type:"string"}},required:["type"],ignore:["id","appearance","binding","visible"]},kt=K.createPropsResolver(re.radioGroupProps,Ie,xe,Ce),ce=K.getPropsResolverGenerator(re.radioGroupProps,Ie,xe,Ce);ne.register=(n,t,e,l,i)=>{n["radio-group"]=re,t["radio-group"]=ce(i),n["item-collection-editor"]=It,t["item-collection-editor"]=yt(i)},ne.registerDesigner=(n,t,e,l)=>{n["radio-group"]=ne,t["radio-group"]=ce(l)};const Tt=D.withInstall(ne);A.FRadioGroupDesign=ne,A.default=Tt,A.propsResolver=kt,A.propsResolverGenerator=ce,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});