@farris/ui-vue 1.7.0-beta.3 → 1.7.0-beta.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 (99) hide show
  1. package/components/avatar/index.esm.js +10 -1
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/calendar/index.esm.js +178 -176
  4. package/components/calendar/index.umd.cjs +2 -2
  5. package/components/collection-property-editor/index.esm.js +48 -46
  6. package/components/collection-property-editor/index.umd.cjs +2 -2
  7. package/components/combo-list/index.esm.js +319 -300
  8. package/components/combo-list/index.umd.cjs +1 -1
  9. package/components/comment/index.esm.js +2287 -1161
  10. package/components/comment/index.umd.cjs +7 -7
  11. package/components/component/index.esm.js +3 -1
  12. package/components/component/index.umd.cjs +2 -2
  13. package/components/condition/index.esm.js +926 -901
  14. package/components/condition/index.umd.cjs +2 -2
  15. package/components/data-view/index.esm.js +898 -899
  16. package/components/data-view/index.umd.cjs +1 -1
  17. package/components/drawer/index.esm.js +3 -1
  18. package/components/drawer/index.umd.cjs +2 -2
  19. package/components/dynamic-form/index.esm.js +239 -221
  20. package/components/dynamic-form/index.umd.cjs +1 -1
  21. package/components/dynamic-resolver/index.esm.js +11 -9
  22. package/components/dynamic-resolver/index.umd.cjs +2 -2
  23. package/components/expression-editor/index.esm.js +1299 -1279
  24. package/components/expression-editor/index.umd.cjs +4 -4
  25. package/components/filter-bar/index.esm.js +731 -678
  26. package/components/filter-bar/index.umd.cjs +2 -2
  27. package/components/filter-condition-editor/index.esm.js +1792 -1772
  28. package/components/filter-condition-editor/index.umd.cjs +4 -4
  29. package/components/image/index.esm.js +246 -240
  30. package/components/image/index.umd.cjs +2 -2
  31. package/components/language-textbox/index.esm.js +9 -7
  32. package/components/language-textbox/index.umd.cjs +2 -2
  33. package/components/list-view/index.esm.js +1 -1
  34. package/components/list-view/index.umd.cjs +1 -1
  35. package/components/locale/index.esm.js +2009 -886
  36. package/components/locale/index.umd.cjs +6 -6
  37. package/components/number-range/index.esm.js +190 -181
  38. package/components/number-range/index.umd.cjs +1 -1
  39. package/components/order/index.esm.js +734 -714
  40. package/components/order/index.umd.cjs +5 -5
  41. package/components/property-panel/index.esm.js +60 -49
  42. package/components/property-panel/index.umd.cjs +3 -3
  43. package/components/query-solution/index.esm.js +2461 -2500
  44. package/components/query-solution/index.umd.cjs +6 -6
  45. package/components/radio-group/index.esm.js +30 -30
  46. package/components/radio-group/index.umd.cjs +1 -1
  47. package/components/schema-selector/index.esm.js +238 -238
  48. package/components/schema-selector/index.umd.cjs +4 -4
  49. package/components/section/index.esm.js +217 -302
  50. package/components/section/index.umd.cjs +2 -2
  51. package/components/sort-condition-editor/index.esm.js +1793 -1773
  52. package/components/sort-condition-editor/index.umd.cjs +4 -4
  53. package/components/transfer/index.esm.js +155 -155
  54. package/components/transfer/index.umd.cjs +3 -3
  55. package/designer/data-grid/index.esm.js +895 -867
  56. package/designer/data-grid/index.umd.cjs +5 -5
  57. package/designer/data-view/index.esm.js +145 -144
  58. package/designer/data-view/index.umd.cjs +2 -2
  59. package/designer/drawer/index.esm.js +73 -71
  60. package/designer/drawer/index.umd.cjs +2 -2
  61. package/designer/dynamic-form/index.esm.js +87 -65
  62. package/designer/dynamic-form/index.umd.cjs +2 -2
  63. package/designer/farris-designer.all.esm.js +14 -3
  64. package/designer/farris-designer.all.umd.cjs +3 -3
  65. package/designer/input-group/index.esm.js +34 -14
  66. package/designer/input-group/index.umd.cjs +1 -1
  67. package/designer/list-view/index.esm.js +1 -1
  68. package/designer/list-view/index.umd.cjs +1 -1
  69. package/designer/radio-group/index.esm.js +15 -2
  70. package/designer/radio-group/index.umd.cjs +1 -1
  71. package/designer/section/index.esm.js +129 -119
  72. package/designer/section/index.umd.cjs +1 -1
  73. package/designer/time-picker/index.esm.js +140 -131
  74. package/designer/time-picker/index.umd.cjs +1 -1
  75. package/farris.all.esm.js +13578 -12394
  76. package/farris.all.umd.cjs +26 -26
  77. package/index.css +1 -1
  78. package/locales/data-grid/ui/en.json +2 -1
  79. package/locales/data-grid/ui/zh-CHS.json +2 -1
  80. package/locales/data-grid/ui/zh-CHT.json +2 -1
  81. package/locales/designer/en.json +12 -10
  82. package/locales/designer/zh-CHS.json +19 -17
  83. package/locales/designer/zh-CHT.json +19 -17
  84. package/locales/ui/en.json +4 -2
  85. package/locales/ui/zh-CHS.json +11 -9
  86. package/locales/ui/zh-CHT.json +11 -9
  87. package/package.json +1 -1
  88. package/package.zip +0 -0
  89. package/types/combo-list/src/composition/types.d.ts +1 -0
  90. package/types/condition/src/composition/condition-value/number-spinner-value.d.ts +1 -1
  91. package/types/condition/src/composition/use-field-config.d.ts +1 -1
  92. package/types/condition/src/condition.props.d.ts +1 -1
  93. package/types/data-view/designer/property-config/use-command-option.d.ts +12 -0
  94. package/types/image/src/property-config/image.property-config.d.ts +5 -5
  95. package/types/locale/src/lib/locale.service.d.ts +2 -2
  96. package/types/property-panel/src/composition/entity/input-base-property.d.ts +7 -0
  97. package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +0 -20
  98. package/types/section/src/designer/section.design.props.d.ts +17 -0
  99. package/types/section/src/section.props.d.ts +0 -25
@@ -1 +1 @@
1
- (function(L,j){typeof exports=="object"&&typeof module<"u"?j(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/tags/index.umd.js"),require("../../components/popover/index.umd.js"),require("../../components/data-grid/index.umd.js"),require("../../components/notify/index.umd.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/tags/index.umd.js","../../components/popover/index.umd.js","../../components/data-grid/index.umd.js","../../components/notify/index.umd.js"],j):(L=typeof globalThis<"u"?globalThis:L||self,j(L["radio-group"]={},L.common,L.dynamicResolver,L.FRadioGroup,L.Vue,L.designerCanvas,L.LodashES,L.locale,null,L.FTags,L.FPopover,L.FDataGrid,L.notify))})(this,function(L,j,_,fe,o,y,ae,Y,Ht,we,xe,Ve,Me){"use strict";var Lt=Object.defineProperty;var zt=(L,j,_)=>j in L?Lt(L,j,{enumerable:!0,configurable:!0,writable:!0,value:_}):L[j]=_;var T=(L,j,_)=>zt(L,typeof j!="symbol"?j+"":j,_);const Ee={...j.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 Ie(n,t,e){const l=o.computed(()=>!n.disabled),i=o.computed(()=>n.data||n.enumData||n.options||[]);function a(d){return d[n.valueField]}function s(d){return d[n.textField]}function r(d,c){if(l.value){const f=a(d);e.value!==f&&(e.value=f,t.emit("changeValue",f),t.emit("update:modelValue",f))}c.stopPropagation()}return{enumData:i,getValue:a,getText:s,onClickRadio:r}}function Fe(n){const{formSchemaUtils:t,formStateMachineUtils:e}=n;function l(d,c=""){return{path:c+d.code,field:d.id,fullPath:d.code}}function i(d,c=""){return t.getViewModelById(d).states.map(u=>l(u,c))}function a(d){const c=t.getRootViewModelId(),f=i(d);if(d===c)return f;const u=i(c,"root-component.");return[...f,...u]}function s(d){return d.binding&&d.binding.path||d.id||""}function r(){return e&&e.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:r}}class pe{constructor(t){T(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'"}]);T(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});T(this,"getExpressionConverter",(t,e)=>({convertFrom:(l,i,a,s)=>{const r=a.getExpressionRuleValue(t,e||i);return r&&r.value||""},convertTo:(l,i,a,s,r)=>{var d;if(i==="dataPicking"&&(a!=null&&a.target)){const c=`${a.target}_dataPicking`;((d=a.rules)==null?void 0:d.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.formSchemaService.getExpressions();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 r;const a=this.createTreeNode(i,e);let s=[];(r=i.type)!=null&&r.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 d,c;const a=this.createTreeNode(i,e);a.type="entity";const s=this.buildEntityFieldsTreeData((d=i.type)==null?void 0:d.fields,[...e,i.label]),r=this.buildChildEntityTreeData((c=i.type)==null?void 0:c.entities,[...e,i.label]);r!=null&&r.length&&(s==null||s.push(...r)),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(),r={message:["validate","required","dataPicking"].includes(e)&&a?a.message:"",...s};return a.messageType!=null&&(r.messageType=a.messageType),r}buildRule(t,e,l,i){const{expression:a,message:s,messageType:r}=e,d={id:`${t}_${l}`,type:l,value:a};return(l==="validate"||l==="dataPicking"||l==="required")&&(d.message=s),l==="dataPicking"&&(d.messageType=r),l==="validate"&&i&&(d.elementId=i),d}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 d=this.getExpressionData().find(f=>f.targetType===e&&f.target===a);const c=f=>f.value.trim()==="";if(d){const f=d.rules.find(u=>u.id===s.id);if(f)c(s)?d.rules=d.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;d.rules=d.rules||[],d.rules.push(s)}}else{if(c(s))return null;d={target:`${a}`,rules:[s],targetType:e}}return d}getExpressionEditorOptions(t,e,l,i){return l.reduce((a,s)=>{var d,c;const r=e==="Field"?(d=t==null?void 0:t.binding)==null?void 0:d.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(r),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 h=this.buildRule(r,f,s);i(h)}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){return{description:"表达式",title:"表达式",hide:!t.binding,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 Se{constructor(t,e){T(this,"componentId");T(this,"viewModelId");T(this,"eventsEditorUtils");T(this,"formSchemaUtils");T(this,"formMetadataConverter");T(this,"designViewModelUtils");T(this,"designViewModelField");T(this,"controlCreatorUtils");T(this,"designerHostService");T(this,"designerContext");T(this,"schemaService",null);T(this,"metadataService",null);T(this,"propertyConfig",{type:"object",categories:{}});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}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,r){if(s){switch(s&&s.propertyID){case"class":case"style":{y.canvasChanged.value++;break}}l&&l(s,t,r)}}}}getPropertyEditorParams(t,e=[],l="visible",i={},a={},s=""){const{getVariables:r,getControlName:d,getStateMachines:c}=Fe(this.designerHostService),f=this.getRealTargetType(t),u=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],h={type:"property-editor",propertyTypes:u};return u.map(m=>{switch(m){case"Const":Object.assign(h,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":h.expressionConfig=this.getExpressionOptions(t,f,s||l);break;case"StateMachine":h.stateMachines=c();break;case"Variable":Object.assign(h,{controlName:d(t),newVariablePrefix:"is",newVariableType:"Boolean",variables:r(this.viewModelId),parentComponentId:this.componentId==="root-component"?"":"root-component",onBeforeOpenVariables:p=>{p.value=r(this.viewModelId)}},a),this.designerContext.designerMode==="PC_RTC"&&(h.newVariablePrefix="ext_"+h.newVariablePrefix);break}}),h}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"]),{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 d in l)s[d]=Object.assign(s[d]||{},l[d]);const r=this;return{...a,properties:{...s},setPropertyRelates(d,c){if(d){switch(d.propertyID){case"disabled":case"readonly":case"visible":r.afterMutilEditorChanged(t,d);break}i&&i(d,c)}}}}afterMutilEditorChanged(t,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e),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=ae.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)}updateExpressionValue(t){const e=t.propertyValue;if(!((e&&e.type)==="Expression"&&e.expressionInfo))return;const{expressionId:a,expressionInfo:s}=e,{targetId:r,targetType:d,expressionType:c,value:f,message:u}=s,h=this.formSchemaUtils.getModule();h.expressions=h.expressions||[];const{expressions:m}=h;let p=m.find(V=>V.target===r);p||(p={target:r,rules:[],targetType:d},m.push(p));const b=p.rules.find(V=>V.type===c);if(b)b.value=f,b.message=u;else{const V={id:a,type:c,value:f,message:u};p.rules.push(V)}delete e.expressionInfo}clearExpression(t,e){const l=t.propertyValue;if(l&&l.type==="Expression")return;const a=t.propertyID,s=this.formSchemaUtils.getExpressions(),r=e.binding?e.binding.field:e.id,d=s.find(c=>c.target===r);!d||!d.rules||(d.rules=d.rules.filter(c=>c.type!==a))}getExpressionOptions(t,e,l){return new pe(this.formSchemaUtils).getExpressionOptions(t,e,l)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-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 Q=class Q{static getEditorTypesByMDataType(t,e=!1,l=""){if(e)return[{key:y.DgControl["language-textbox"].type,value:y.DgControl["language-textbox"].name}];let i=Q.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];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const t=[];for(const e in Q.fieldControlTypeMapping)Q.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}};T(Q,"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}],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["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},{key:y.DgControl["radio-group"].type,value:y.DgControl["radio-group"].name}]});let oe=Q;var ie=(n=>(n.Form="Form",n.Variable="Variable",n))(ie||{});class Te{constructor(){T(this,"label","");T(this,"id","");T(this,"columnInSM",12);T(this,"columnInMD",6);T(this,"columnInLG",3);T(this,"columnInEL",2);T(this,"displayWidthInSM",1);T(this,"displayWidthInMD",1);T(this,"displayWidthInLG",1);T(this,"displayWidthInEL",1);T(this,"displayColumnCountAtBreakPoint","md");T(this,"tagRow",0);T(this,"showTopBorder",0);T(this,"group",1);T(this,"isSupportedClass",!0);T(this,"fieldSetId","")}}function ke(n){let t,e;const l=new Map;let i=[];function a(f,u){const m=f.split(" ").filter(x=>x.startsWith("col-"));if(m.length===0){u.isSupportedClass=!1;return}let p=m.find(x=>/^col-([1-9]|10|11|12)$/.test(x)),b=m.find(x=>/^col-md-([1-9]|10|11|12)$/.test(x)),V=m.find(x=>/^col-xl-([1-9]|10|11|12)$/.test(x)),I=m.find(x=>/^col-el-([1-9]|10|11|12)$/.test(x));p=p||"col-12",u.columnInSM=parseInt(p.replace("col-",""),10),u.displayWidthInSM=u.columnInSM/12,u.displayWidthInSM!==1&&(u.isSupportedClass=!1),b=b||"col-md-"+u.columnInSM,u.columnInMD=parseInt(b.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),I=I||"col-el-"+u.columnInLG,u.columnInEL=parseInt(I.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,h,m=!1){let p=!1;f.contents.forEach(b=>{if(b.type==="fieldset"){h+=1,s(b,u,h,!0),p=!0;return}p&&(h+=1,p=!1);const V=b.appearance&&b.appearance.class,I=new Te;V?a(V,I):I.isSupportedClass=!1,I.label=b.label||b.id,I.id=b.id,I.group=h,m&&(I.fieldSetId=f.id),e===b.id&&(t=h),l.set(b.id,b),u.push(I)})}function r(f){const u=n.getComponentById(f);if(!u||!u.componentType||!u.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const h=n.selectNode(u,m=>m.type===y.DgControl["response-form"].type);return!h||!h.contents||h.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:h}}function d(f,u){u=u||f.id;const{result:h,message:m,formNode:p}=r(u);if(!h)return{result:h,message:m};e=f.id,i=[],l.clear();const b=p.contents[0].type===y.DgControl.fieldset.type?0:1;s(p,i,b);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:h,formNode:m}=r(u);if(!h)return"";const p=[];return f.forEach(b=>{var x;const V=l.get(b.id),I=V.appearance&&V.appearance.class;if(I){const z=I.split(" ").filter(H=>!H.startsWith("col-")),S="col-"+b.columnInSM,E="col-md-"+b.columnInMD,g="col-xl-"+b.columnInLG,F="col-el-"+b.columnInEL,P=[S,E,g,F].concat(z);V.appearance.class=P.join(" ")}if(b.fieldSetId){const k=m.contents.find(S=>S.id===b.fieldSetId),z=p.find(S=>S.id===b.fieldSetId);z?(x=z.contents)==null||x.push(V):(p.push(k),k.contents=[V])}else p.push(V)}),m.contents=p,m.id}return{checkCanFindFormNode:r,checkCanOpenLayoutEditor:d,changeFormControlsByResponseLayoutConfig:c,getResonseFormLayoutConfig:s}}class Be extends Se{constructor(e,l){super(e,l);T(this,"responseLayoutEditorFunction");T(this,"bindingVarible");T(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});this.responseLayoutEditorFunction=ke(this.formSchemaUtils)}getCommonPropertyConfig(e,l,i="Card"){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")}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 c;const a=this;this.setDesignViewModelField(e);const{canChangeControlType:s,editorTypeList:r}=this.getAvailableEditorType(e),d={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:r,readonly:!s}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]},defaultValue:((c=e.editor)==null?void 0:c.type)==="image"?"none":"visible"},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},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(f,u,h){if(f)switch(f&&f.propertyID){case"type":{a.changeControlType(e,f,l);break}case"label":{f.needRefreshControlTree=!0;break}case"binding":{a.changeBindingField(e,f,h);break}}}};return i.toLocaleLowerCase()!=="card"&&delete d.properties.showLabelType,d}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!==j.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(e){var a;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===j.FormSchemaEntityField$Type.SimpleField?i=oe.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(i=oe.getEditorTypesByMDataType(this.bindingVarible.type,this.designViewModelField.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"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,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){const a=l.propertyValue,s=i&&i.parent&&i.parent.schema;if(!s)return;const r=s.contents.findIndex(f=>f.id===e.id);if(r===-1)return;const d=s.contents[r];let c;if(this.designViewModelField){const h=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};h.editor||(h.editor={}),h.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,h,!1),c=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)}c||(c=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(c,{id:d.id,appearance:d.appearance,size:d.size,label:d.label,binding:d.binding}),Object.prototype.hasOwnProperty.call(d,"visible")&&Object.assign(c,{visible:d.visible}),d.editor&&["readonly","required","placeholder"].map(f=>{Object.prototype.hasOwnProperty.call(d.editor,f)&&(c.editor[f]=d.editor[f])}),i!=null&&i.updateContextSchema?i.updateContextSchema(c):(i.schema=Object.assign(d,c),Object.assign(e,c)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(f=>f.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(f=>f.classList.remove("dgComponentFocused")),y.canvasChanged.value++,o.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getComponentConfig(e,l={},i={},a){var h,m;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},l),r=(h=e.binding)!=null&&h.field?[]:["Const","Variable","StateMachine"],d=this.getPropertyEditorParams(e,r,"readonly"),c=this.getPropertyEditorParams(e,r,"required"),f={readonly:{description:"",title:"只读",editor:d},required:{description:"",title:"必填",type:"boolean",editor:c,visible:!!((m=e.binding)!=null&&m.field)},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,b){if(p){switch(p.propertyID){case"readonly":case"required":u.afterMutilEditorChanged(e,p);break}a&&a.bind(u)(p,e,b)}}}}updateUnifiedLayoutAfterControlChanged(e,l,i){const a=e.split(" ");let s=a.find(u=>/^col-([1-9]|10|11|12)$/.test(u)),r=a.find(u=>/^col-md-([1-9]|10|11|12)$/.test(u)),d=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",r=r||"col-md-"+s.replace("col-",""),d=d||"col-xl-"+r.replace("col-md-",""),c=c||"col-el-"+d.replace("col-xl-","");const f={id:l,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(r.replace("col-md-",""),10),columnInLG:parseInt(d.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 p=a.find(b=>b.id===l.id);Object.assign(p||{},l)}const s=a.map(p=>p.columnInSM),r=a.map(p=>p.columnInMD),d=a.map(p=>p.columnInLG),c=a.map(p=>p.columnInEL),f=this.checkIsUniqueColumn(s)?s[0]:null,u=this.checkIsUniqueColumn(r)?r[0]:null,h=this.checkIsUniqueColumn(d)?d[0]:null,m=this.checkIsUniqueColumn(c)?c[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:f,uniqueColClassInMD:u,uniqueColClassInLG:h,uniqueColClassInEL:m})}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===j.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(e,l){e.binding&&e.binding.type===ie.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 ie.Form:return e.binding.path||e.type;case ie.Variable:return e.binding.fullPath||e.type}return e.type}getEventPropertyConfig(e,l="card",i,a){const s=this;let r=[];i&&(r=r.concat(i)),this.appendFieldValueChangeEvents(e,r);const d=s.eventsEditorUtils.formProperties(e,s.viewModelId,r);return{title:"事件",hideTitle:!0,properties:s.createBaseEventProperty(d),tabId:"commands",tabName:"交互",setPropertyRelates(u,h){const m=u.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)),a&&a(u,h,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 new pe(this.formSchemaUtils).getExpressionConfig(e,l,i,a)}getBindingDataType(){return this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(){return this.getBindingDataType()==="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 r=l==="trueValue"?"falseValue":"trueValue";e.editor[r]===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 Ne extends Be{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)===j.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=i.type.enumValues||[])}}function Pe(n,t){const e=n.schema;function l(i,a){return new Ne(i,t).getPropertyConfig(e,a)}return{getPropsConfig:l}}const te=o.defineComponent({name:"FRadioGroupDesign",props:Ee,emits:["changeValue","update:modelValue"],setup(n,t){const e=o.ref(n.modelValue),{enumData:l,getValue:i,getText:a}=Ie(n,t,e),s=o.computed(()=>({"farris-checkradio-hor":n.direction==="horizontal"})),r=o.ref(),d=o.inject("designer-host-service"),c=o.inject("design-item-context"),f=Pe(c,d),u=y.useDesignerComponent(r,c,f);o.onMounted(()=>{r.value.componentInstance=u});const h=o.computed(()=>{if(!l.value||l.value.length===0){const m=[];return[{value:"example1",name:"示例一"},{value:"example2",name:"示例二"}].map(p=>{const b={};b[n.valueField]=p.value,b[n.textField]=p.name,m.push(b)}),m}return l.value});return t.expose(u.value),()=>o.createVNode("div",{class:["farris-input-wrap",s.value],ref:r},[h.value.map((m,p)=>{const b="radio_"+n.name+p;return o.createVNode("div",{class:"custom-control custom-radio"},[o.createVNode("input",{type:"radio",class:"custom-control-input",name:n.name,id:b,value:i(m),disabled:!0},null),o.createVNode("label",{class:"custom-control-label",for:b},[a(m)])])})])}}),Oe={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},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},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}},De={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object},backgroundColor:{type:String,default:""}},Re=o.defineComponent({name:"FOverlay",props:De,emits:["click"],setup(n,t){const e=o.ref(n.popupContentPosition),l=o.ref(n.host),i=o.computed(()=>({backgroundColor:n.backgroundColor||"",pointerEvents:"auto"}));function a(r){t.emit("click"),r.preventDefault(),r.stopPropagation()}o.computed(()=>{const r=l.value;if(r){const d=r.getBoundingClientRect(),{left:c,top:f,height:u}=d;return{left:c,top:f+u}}return e.value});const s=o.computed(()=>({}));return()=>o.createVNode(o.Teleport,{to:"body"},{default:()=>{var r,d;return[o.createVNode("div",{class:"overlay-container",onClick:c=>a(c),style:i.value},[o.createVNode("div",{style:s.value},[(d=(r=t.slots).default)==null?void 0:d.call(r)])])]}})}});function Le(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function ze(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=Le(n);return()=>o.createVNode(Re,{"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 He{static show(t){return ze(t)}}const je={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},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},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},host:{type:Object,default:"body"}};class ${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 $(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new $(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 $(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 $(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 $(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 $e(n,t){const e=o.ref(),l=o.ref(),i=o.ref(),a=o.ref(),s=o.ref(),r=o.ref(),d=o.ref(),c=o.ref(),f=o.ref(),u=o.ref(),h=o.ref(),m=o.ref(n.resizeable),p=o.ref(),b=o.ref(n.draggable),V=o.ref(!1);function I(){const C=l.value||document.body,M=window.getComputedStyle(C);if(!M||!e.value)return;const R=$.getTransformInfo(e.value),O={};d.value&&(O.deltaL=e.value.offsetLeft-d.value.x,O.deltaT=e.value.offsetTop-d.value.y);const A=M.getPropertyValue("position");O.width=C.clientWidth,O.height=C.clientHeight,O.pr=parseInt(M.getPropertyValue("padding-right"),10),O.pb=parseInt(M.getPropertyValue("padding-bottom"),10),O.position=M.getPropertyValue("position"),A==="static"&&(C.style.position="relative"),O.translateX=R.x,O.translateY=R.y,u.value=O}function x(C){if(e.value){a.value=J.getCurrent(e.value),s.value=$.getCurrent(e.value),r.value=a.value?J.copy(a.value):null,d.value=s.value?$.copy(s.value):null,I();const M=C.target.getAttribute("type")||"";c.value={n:!!M.match(/n/),s:!!M.match(/s/),w:!!M.match(/w/),e:!!M.match(/e/)}}}function k(){var C,M,R,O;if(e.value){const A=e.value;c.value&&((c.value.n||c.value.s)&&((C=r.value)!=null&&C.height)&&(A.style.height=r.value.height+"px"),(c.value.w||c.value.e)&&((M=r.value)!=null&&M.width)&&(A.style.width=r.value.width+"px"),d.value&&((R=d.value)!=null&&R.x&&(A.style.left=d.value.x+"px"),(O=d.value)!=null&&O.y&&(A.style.top=d.value.y+"px")))}}function z(){const C=n.minHeight?n.minHeight:1,M=n.minWidth?n.minWidth:1;r.value&&d.value&&c.value&&a.value&&(r.value.height<C&&(r.value.height=C,c.value.n&&s.value&&(d.value.y=s.value.y+(a.value.height-C))),r.value.width<M&&(r.value.width=M,c.value.w&&s.value&&(d.value.x=s.value.x+(a.value.width-M))),n.maxHeight&&r.value.height>n.maxHeight&&(r.value.height=n.maxHeight,s.value&&c.value.n&&(d.value.y=s.value.y+(a.value.height-n.maxHeight))),n.maxWidth&&r.value.width>n.maxWidth&&(r.value.width=n.maxWidth,c.value.w&&s.value&&(d.value.x=s.value.x+(a.value.width-n.maxWidth))))}function S(){if(l.value){const C=u.value;if(d.value&&r.value&&c.value&&a.value){const M=C.width-C.pr-C.deltaL-C.translateX-d.value.x,R=C.height-C.pb-C.deltaT-C.translateY-d.value.y;c.value.n&&d.value.y+C.translateY<0&&s.value&&(d.value.y=-C.translateY,r.value.height=a.value.height+s.value.y+C.translateY),c.value.w&&d.value.x+C.translateX<0&&s.value&&(d.value.x=-C.translateX,r.value.width=a.value.width+s.value.x+C.translateX),r.value.width>M&&(r.value.width=M),r.value.height>R&&(r.value.height=R)}}}function E(C){if(!i.value||!a.value||!s.value||!c.value)return;C.subtract(i.value);const M=C.x,R=C.y;c.value.n?(d.value.y=s.value.y+R,r.value.height=a.value.height-R):c.value.s&&(r.value.height=a.value.height+R),c.value.e?r.value.width=a.value.width+M:c.value.w&&(r.value.width=a.value.width-M,d.value.x=s.value.x+M),S(),z(),k()}function g(C){if(!f.value)return;const M=$.fromEvent(C);M&&E(M)}function F(){if(e.value){const{width:C,height:M,x:R,y:O}=e.value.getBoundingClientRect(),A=$.getTransformInfo(e.value);return{size:{width:C,height:M},position:{x:R-A.x,y:O-A.y}}}return null}function P(C){if(e.value){const M=F();h.value=M}i.value=void 0,a.value=null,s.value=null,r.value=null,d.value=null,c.value=null,f.value=null,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",P)}function H(){document.addEventListener("mousemove",g),document.addEventListener("mouseup",P)}function w(C){C instanceof MouseEvent&&C.button===2||b.value&&(document.body.click(),C.stopPropagation(),C.preventDefault(),i.value=$.fromEvent(C),f.value=C.target,x(C),H())}function B(C){return e.value=C,m.value&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:M=>w(M)},null)])}function W(C=!0){document.body.click();const M=l.value||document.body,R=J.getCurrent(M),O=e.value;C&&O&&(p.value=F(),p.value.transform=O.style.transform),R&&O&&(r.value=R,r.value.height-=14,r.value.width-=14,O.style.height=r.value.height+"px",O.style.width=r.value.width+"px",O.style.left="7px",O.style.top="7px",O.style.transform="",h.value={size:r.value,position:{x:0,y:0}},b.value=!1,V.value=!0)}function K(){var C,M;if(document.body.click(),p.value){const R={width:p.value.size.width||0,height:p.value.size.height||0},O={x:(window.innerWidth-R.width)/2,y:(window.innerHeight-R.height)/2};(C=r.value)==null||C.set(R),(M=d.value)==null||M.set(O);const A=e.value;A.style.height=R.height+"px",A.style.width=R.width+"px",A.style.left=`${O.x}px`,A.style.top=`${O.y}px`,A.style.transform="",h.value={size:R,position:O},b.value=n.draggable,V.value=!1}}function X(){if(e.value){const C=J.getCurrent(e.value);if(C){const{width:M,height:R}=C;e.value.style.left=`${(window.innerWidth-M)/2}px`,e.value.style.top=`${(window.innerHeight-R)/2}px`,e.value.style.transform=""}}}function D(){const C=()=>{V.value?W(!1):X(),document.body.click()};return window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}}const U=D();return{renderResizeBar:B,boundingElement:l,resizedEventParam:h,maximize:W,restore:K,allowDrag:b,isMaximized:V,unWindowResizeHandle:U,moveToCenter:X}}function Ae(n,t,e){const l=o.ref(),i=o.ref(n.draggable),a=o.ref(n.lockAxis),s=o.ref(),r=o.ref(),d=o.ref(!1),c=o.ref(new $(0,0)),f=o.ref(new $(0,0)),u=o.ref(new $(0,0)),h=o.ref(new $(0,0));o.watch(()=>e.value,g=>{s.value.style.cursor=g?"move":"default"});function m(g,F){if(F.tagName==="BUTTON")return!1;if(F===g)return!0;for(const P in F.children)if(Object.prototype.hasOwnProperty.call(F.children,P)&&m(g,F.children[P]))return!0;return!1}function p(){var H,w;let g=u.value.x+f.value.x,F=u.value.y+f.value.y;a.value==="x"?(g=((H=c.value)==null?void 0:H.x)||0,u.value.x=0):a.value==="y"&&(F=((w=c.value)==null?void 0:w.y)||0,u.value.y=0);const P=`translate3d(${Math.round(g)}px, ${Math.round(F)}px, 0px)`;l.value&&(l.value.style.transform=P),h.value.x=g,h.value.y=F}function b(){if(!r.value||!l.value)return null;const g=r.value.getBoundingClientRect(),F=l.value.getBoundingClientRect(),P={top:g.top<F.top,right:g.right>F.right,bottom:g.bottom>F.bottom,left:g.left<F.left};return P.top||(u.value.y-=F.top-g.top),P.bottom||(u.value.y-=F.bottom-g.bottom),P.right||(u.value.x-=F.right-g.right),P.left||(u.value.x-=F.left-g.left),p(),P}function V(g){g&&(c.value&&g.subtract(c.value),u.value.set(g),p(),b())}function I(g){d.value&&i.value&&(g.stopPropagation(),g.preventDefault(),V($.fromEvent(g,s.value)))}function x(){var g;d.value&&(d.value=!1,f.value.add(u.value),u.value.reset(),(g=l.value)==null||g.classList.remove("ng-dragging"),t.emit("stopMove"),document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",x))}function k(){!d.value&&s.value&&(d.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",I),document.addEventListener("mouseup",x))}function z(){if(l.value){const g=$.getTransformInfo(l.value);f.value.set(g);return}f.value.reset()}function S(g){if(!e.value||g instanceof MouseEvent&&g.button===2)return;const F=g.target||g.srcElement;s.value!==void 0&&F&&!m(F,s.value)||i.value!==!1&&(document.body.click(),g.stopPropagation(),g.preventDefault(),c.value=$.fromEvent(g,l.value),z(),k())}function E(g,F,P){if(i.value&&F){if(g)s.value=g;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const H=F.querySelector(n.dragHandle);H&&(s.value=H)}}l.value=F,r.value=P,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",S)):i.value=!1}}return{registerDraggle:E,resetTranslate:z}}function me(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 Ue(n,t){const e=o.ref(n.enableEsc);let l=null;return e.value?(l=me("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:l}):null}function qe(n,t){const e=o.ref(n.enableEnter);let l=null;return e.value?(l=me("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:l}):null}const ne=o.defineComponent({name:"FModal",props:je,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],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),r=o.ref(n.fitContent),d=o.ref(n.showHeader),c=o.ref(""),f=o.ref(n.showCloseButton),u=o.ref(n.showMaxButton),h=o.ref(!1),m=o.ref(n.dialogType),p=o.ref(n.src),b=o.ref(""),V=o.ref(n.showButtons),I=o.ref(n.title),x=o.ref(n.containment||null),k=o.ref();I.value==="错误提示"&&(I.value=Y.LocaleService.getLocaleValue("messageBox.errorTitle"));const z=o.ref(!1);function S(v,N){const G=N?"accept":"cancel";Promise.resolve().then(()=>{var q;return(q=n.beforeClose)==null?void 0:q.call(n,{closeType:G})}).then(q=>{q&&(i.value=!1,t.emit("update:modelValue",!1),N!=null&&t.emit(N?"accept":"cancel"),t.emit("closed",v))})}const E=[{name:"cancel",text:Y.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:v=>{S(v,!1)}},{name:"accept",text:Y.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:v=>{S(v,!0)}}],g=o.ref(n.buttons&&n.buttons.length?n.buttons:E),F=o.computed(()=>!!c.value),P=o.computed(()=>!!V.value&&!!g.value),H=o.ref(),w=o.ref(),B=o.ref(!1),{renderResizeBar:W,maximize:K,restore:X,boundingElement:D,resizedEventParam:U,allowDrag:C,unWindowResizeHandle:M,moveToCenter:R}=$e(n),{registerDraggle:O}=Ae(n,t,C);function A(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function gt(){const v=document.querySelectorAll(".farris-modal").length;(!v||v-1<=0)&&document.body.classList.remove("modal-open"),k.value&&k.value.classList.remove("show")}o.watch(()=>n.title,(v,N)=>{v!==N&&(I.value=v)}),o.watch(()=>n.modelValue,(v,N)=>{v!==N&&(i.value=v,i.value&&n.draggable&&o.nextTick(()=>{w.value&&!x.value&&(x.value=w.value.parentElement,D.value=x.value,O(H.value,w.value,D.value),R())}),v||(x.value&&(x.value=null),gt())),i.value?z.value=A():(B.value=!1,C.value=n.draggable)}),o.watch(()=>n.showHeader,(v,N)=>{v!==N&&(d.value=v)}),o.watch(()=>n.showButtons,(v,N)=>{v!==N&&(V.value=v)}),o.watch(()=>U.value,(v,N)=>{const G=v||{},q=N||{};JSON.stringify(G)!==JSON.stringify(q)&&t.emit("resize",{newSize:v,oldSize:N,isMaximized:B.value})}),o.watch([()=>n.width,()=>n.height],(v,N)=>{(v[0]!==N[0]||v[1]!==N[1])&&(e.value=v[0]||500,l.value=v[1]||600)});const de=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),yt=o.computed(()=>{var G;const v={modal:!0,"farris-modal":!0,fade:!0};v["f-modal-fitContent"]=!!r.value,v.show=!!de.value;const N=(G=n.maskClass)==null?void 0:G.split(" ");return N==null||N.reduce((q,ee)=>(q[ee]=!0,q),v),v}),vt=o.computed(()=>{var G;const v={"modal-dialog":!0},N=(G=s.value)==null?void 0:G.split(" ");return N==null||N.reduce((q,ee)=>(q[ee]=!0,q),v),v}),bt=o.computed(()=>{const v=document.documentElement.clientWidth,N=document.documentElement.clientHeight,G=Math.min(e.value,v),q=r.value?"auto":`${Math.min(l.value,N-10)}px`,ee={position:"absolute",top:`${(window.innerHeight-parseInt(q==="auto"?"0":q))/2}px`,left:`${(window.innerWidth-G)/2}px`,width:`${G}px`,height:q};return n.mask||(ee.pointerEvents="auto"),ee}),Ct=()=>j.getMaxZIndex()||1040,wt=o.computed(()=>{const v={display:"block",zIndex:Ct()};return n.mask||(v.pointerEvents="none",v.backgroundColor="transparent"),z.value&&(v.backgroundColor="transparent"),v}),xt=o.computed(()=>({"modal-content":!0,"modal-content-has-header":d.value})),Vt=o.computed(()=>{const v={display:d.value?"":"none"};return v["pointer-events"]=C.value?"auto":"none",v}),Mt=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:B.value})),Et=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":m.value==="iframe","f-utils-fill":!0}));function It(){return{height:`${n.footerHeight||60}px`}}const Ft=o.computed(()=>{const v={textAlgin:b.value},N=It();return Object.assign(v,N)});function Ce(v){if(v==null||v.stopPropagation(),B.value){B.value=!1,X();return}K(),B.value=!0}async function St(v,N){v.handle&&await v.handle(N,v)&&t.emit("closed",N)}function Tt(v){v.width&&(e.value=v.width),v.height&&(l.value=v.height),v.buttons&&(g.value=v.buttons),v.title&&(I.value=v.title)}let ue=null,ce=null;o.onBeforeMount(()=>{z.value=A()}),o.onMounted(()=>{w.value&&!x.value&&(x.value=w.value.parentElement,D.value=x.value,O(H.value,w.value,D.value)),de.value&&document.body.classList.add("modal-open"),ue=Ue(n,t),ce=qe(n,t)}),o.onUnmounted(()=>{M&&M(),ue&&ue.remove(),ce&&ce.remove()}),t.expose({modalElementRef:w,updateModalOptions:Tt,close:S,maxDialog:Ce,isMaximized:B});function kt(){return o.createVNode("ul",null,[h.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:Ce,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:Mt.value},null)]),f.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:v=>S(v,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function Bt(){return o.createVNode("div",{class:"modal-footer",style:Ft.value},[g.value&&g.value.map(v=>{const N=o.ref(v.disabled);return o.createVNode("button",{name:v.name,type:"button",disabled:N.value,class:v.class+(v.iconClass?" btn-icontext":""),onClick:G=>{St(v,G)}},[!!v.iconClass&&o.createVNode("i",{class:v.iconClass},null),v.text])})])}function Nt(){return o.createVNode("div",{ref:H,class:"modal-header",style:Vt.value},[t.slots.headerTemplate?t.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[F.value&&o.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[I.value])]),o.createVNode("div",{class:"actions"},[kt()])])}function Pt(){return t.slots.footerTemplate?t.slots.footerTemplate():P.value&&Bt()}function Ot(v){if(v.stopPropagation(),n.allowClickMaskToClose){if(v.target!==k.value)return;S(v,!1)}}function Dt(){var v,N;return o.createVNode("div",{id:a.value,class:vt.value,style:bt.value,ref:w},[o.createVNode("div",{class:xt.value},[d.value&&Nt(),o.createVNode("div",{class:Et.value},[(N=(v=t.slots).default)==null?void 0:N.call(v),m.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),Pt()]),!r.value&&w.value&&!B.value&&W(w.value)])}function Rt(v){return v||"body"}return()=>o.createVNode(o.Teleport,{to:Rt(n.host)},{default:()=>[de.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:k,class:yt.value,style:wt.value,onClick:Ot},[Dt()])]})]})}});function he(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function We(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||""),r=o.ref(!!n.showButtons),d=o.ref(!!n.showHeader),c=o.ref(n.showCloseButton==null?!0:n.showCloseButton),f=o.ref(!0),u=o.ref(n.title||""),h=n.acceptCallback||(()=>{}),m=n.rejectCallback||(()=>{}),p=n.closedCallback||(k=>{}),b=n.resizeHandle||(k=>{}),V=n.stopMoveHandle||(k=>{}),I=he(n),x=k=>{f.value=!1,e.unmount(),p(k)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(ne,{ref:a,class:s.value,modelValue:f.value,"onUpdate:modelValue":k=>f.value=k,title:u.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":d.value,"show-buttons":r.value,"show-close-button":c.value,"show-max-button":!1,onAccept:h,onCancel:m,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:x,onResize:b,onStopMove:V},{default:()=>[I&&I(e)]})}});return document.body.appendChild(t),e.use(Y.LocaleService.i18n),e.mount(t),e}class Ge{constructor(t){T(this,"appContext",null);T(this,"modalRef",o.ref());T(this,"activeModalIndex",o.ref(0));T(this,"modalRefs",{});T(this,"isUseEscCloseModal",o.ref(!1));T(this,"activeModalInstance",o.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.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 We(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},t)),i=o.ref(!0),a=l.value.acceptCallback||(()=>{}),s=l.value.rejectCallback||(()=>{}),r=l.value.closedCallback||((S,E)=>{}),d=l.value.resizeHandle||(S=>{}),c=t.stopMoveHandle||(S=>{});let f;const u=he(l.value),h=S=>{var g;i.value=!1;const E=(g=S==null?void 0:S.target)==null?void 0:g.classList.contains("modal_close");r(S,this.isUseEscCloseModal.value?"esc":E?"icon":"button")},m=S=>{h(S),f&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,e),f=null,this.modalRef.value=null,this.modalRefs){const E=Object.keys(this.modalRefs).map(g=>Number(g));E.length>0?this.activeModalIndex.value=Math.max(...E):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=S=>{var E;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((E=this.activeModalInstance.value)==null||E.close(S==null?void 0:S.event))},{width:b,height:V}=l.value,I=this.adaptToWindow(b||500,V||320);Object.assign(l.value,I);const x=()=>o.createVNode(ne,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":S=>i.value=S},l.value,{onAccept:a,onCancel:s,onClosed:m,onResize:d,onEsc:p,onStopMove:c}),{default:()=>[u&&u(this.app)]});return f=(S=>{const E=o.h(x,S);return E.appContext=this.appContext,o.render(E,e),E})({...l.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:S=>{l.value={...l.value,...S},f&&o.render(o.cloneVNode(f,{...l}),e)},destroy:m,modalRef:this.activeModalInstance,close:()=>this.close()}}}const ge=Symbol("FModalService");ne.install=n=>{n.component(ne.name,ne);const t=new Ge(n);n.provide(ge,t),n.provide("FModalService",t)};function ye(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 Ke(n,t,e,l,i){const a=o.ref(n.buttonBehavior),s=o.ref(n.popupOnInput),r=o.computed(()=>({"input-group-append":!0,"append-force-show":n.showButtonWhenDisabled&&(n.readonly||n.disable)})),{judgeCanOpen:d}=ye(n,i),c=o.computed(()=>n.showButtonWhenDisabled||(!n.editable||!n.readonly)&&!n.disable),f=o.inject(ge,null),u=o.ref();async function h(b){if(await d()&&c.value){const V=!!t.slots.default;if(a.value==="Modal"){const I=n.modalOptions,x=f==null?void 0:f.open({...I,render:()=>t.slots.default&&t.slots.default()});u.value=x==null?void 0:x.modalRef}a.value==="Overlay"&&He.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:b,value:n.modelValue})}}function m(b){t.emit("mouseEnterIcon",b)}function p(b){t.emit("mouseLeaveIcon",b)}return{buttonGroupClass:r,onClickButton:h,onMouseEnterButton:m,onMouseLeaveButton:p,modalRef:u}}function Xe(n,t,e,l,i,a){const s=o.ref(!1),r=o.computed(()=>n.enableClear&&!n.readonly&&!n.disable),{changeTextBoxValue:d,hasClearClass:c}=a;function f(p){s.value=p,c.value=p}o.watch(i,()=>{f(!!i.value)});function u(p){const b=!n.readonly&&!n.disable&&n.editable,V=!n.editable;p.stopPropagation(),(b||V)&&(d(""),i.value="",f(!s.value),t.emit("clear"))}function h(p){if(r.value){if(!e.value){f(!1);return}!n.disable&&!n.readonly&&f(!0)}}function m(p){r.value&&f(!1)}return{enableClearButton:r,showClearButton:s,onClearValue:u,onMouseEnterTextBox:h,onMouseLeaveTextBox:m}}function _e(n,t,e,l,i){const a=o.computed(()=>n.popupOnInput),s=o.computed(()=>n.popupOnFocus),{shouldPopupContent:r,closeAllPopover:d}=i,c=o.ref(!1),f=o.computed(()=>n.enableTitle?e.value:""),u=o.computed(()=>(n.disable||n.readonly)&&!n.forcePlaceholder?"":n.placeholder),h=o.computed(()=>n.readonly||!n.editable),m=o.ref(!1),p=o.computed(()=>!n.disable&&m.value),b=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":p.value,"input-group--has-clear":n.enableClear&&c.value}));function I(w,B=!0){e.value=w,B&&(t.emit("change",w),t.emit("update:modelValue",w))}function x(w){r.value=!1,I(w,!0)}o.watch(()=>n.modelValue,w=>{e.value=w});function k(w){m.value=!1,t.emit("blur",w),w.stopPropagation()}function z(w){t.emit("click",w),d(),t.slots.default&&!n.disable&&!n.readonly&&n.popupOnClick&&i.togglePopup()}function S(w){!n.disable&&!n.readonly&&(m.value=!0,h.value||(t.emit("focus",w),s.value&&!r.value&&i.popup()))}function E(w){t.emit("input",w);const B=w.target.value;l.value=B,e.value!==B&&I(B,n.updateOn==="change"),a.value&&!r.value&&i.popup()}function g(w){w.target.tagName!=="INPUT"&&w.preventDefault(),w.stopPropagation()}function F(w){t.emit("keydown",w)}function P(w){w.key==="Enter"&&(a.value||s.value)&&i.hidePopup(),t.emit("keyup",w)}function H(w){const B=w.target.value;w.stopPropagation(),I(B)}return{hasFocusedTextBox:p,isTextBoxReadonly:h,textBoxClass:b,textBoxPlaceholder:u,textBoxTitle:f,inputGroupClass:V,hasClearClass:c,changeTextBoxValue:I,commitValue:x,onBlurTextBox:k,onClickTextBox:z,onFocusTextBox:S,onInput:E,onKeyDownTextBox:F,onKeyUpTextBox:P,onMouseDownTextBox:g,onTextBoxValueChange:H}}const Z="FarrisVue_PopoverInstancesKey";function Ye(n,t,e,l){const i=o.ref(),a=o.ref(!1),{judgeCanOpen:s}=ye(n,l);o.watch(()=>i.value,(m,p)=>{window[Z]=window[Z]||new WeakMap,m?window[Z].set(e.value,m):window[Z].delete(e.value)});function r(){if(window[Z]){const m=window[Z];document.querySelectorAll(".f-button-edit,.v-popover").forEach(p=>{const b=m.get(p);b&&p!==e.value&&!e.value.closest(".popover-fitcontent")&&b.hide()})}}function d(){const m=i.value;m&&m.show(e.value)}async function c(m=!1){if(!!t.slots.default){if(!m&&!a.value&&!await s())return;a.value=!a.value,a.value&&(await o.nextTick(),d())}}async function f(m=!1){if(!!t.slots.default){if(!m&&!await s())return;a.value=!0,await o.nextTick(),d()}}function u(){a.value=!1}function h(){a.value=!0,o.nextTick(()=>{d()})}return{hidePopup:u,showPopup:h,popup:f,shouldPopupContent:a,togglePopup:c,popoverRef:i,closeAllPopover:r}}function Je(n,t,e){const l=o.ref(),{isTextBoxReadonly:i,textBoxClass:a,textBoxPlaceholder:s,textBoxTitle:r,onBlurTextBox:d,onClickTextBox:c,onFocusTextBox:f,onInput:u,onKeyDownTextBox:h,onKeyUpTextBox:m,onMouseDownTextBox:p,onTextBoxValueChange:b}=e,V=o.ref(n.id),{uuid:I}=j.useGuid(),x=o.computed(()=>({}));o.onMounted(()=>{var g,F;n.selectOnCreated&&((g=l.value)==null||g.select()),n.focusOnCreated&&((F=l.value)==null||F.focus({preventScroll:!0})),V.value||(V.value="button-edit_"+I(8)),V.value=V.value+"-textbox"});const k=o.ref(!1),z=g=>{g.preventDefault(),k.value=!0},S=g=>{g.preventDefault(),k.value=!1,u(g)};function E(g){k.value||u(g)}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:r.value,type:n.inputType,value:t.value,onBlur:d,onChange:b,onClick:c,onFocus:f,onInput:E,onKeydown:h,onKeyup:m,onMousedown:p,onCompositionend:S,onCompositionstart:z},null)}function Ze(n,t,e){const l=o.ref(n.separator),i=o.computed(()=>n.readonly||n.disable),{changeTextBoxValue:a,onFocusTextBox:s,onBlurTextBox:r,onClickTextBox:d,textBoxPlaceholder:c}=e,f=o.computed(()=>t.value?t.value.split(l.value).map(p=>({name:p,selectable:!0})):[]);function u(p){a(p.map(b=>b.name).join(l.value),!0)}o.watch(()=>n.separator,p=>{l.value=p});const h=o.ref(!n.disable&&!n.readonly);o.watch([()=>n.disable,()=>n.readonly],([p,b],[V,I])=>{h.value=!p&&!b});function m(p){d(p)}return()=>o.createVNode(we,{tabindex:n.tabIndex,onFocus:s,onBlur:r,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:m},null)}function Qe(n,t,e,l){const{buttonGroupClass:i,onClickButton:a,onMouseEnterButton:s,onMouseLeaveButton:r}=e,{enableClearButton:d,showClearButton:c,onClearValue:f}=l,u=o.ref(),h=ae.debounce(p=>{a(p)},n.buttonBehavior==="Modal"?0:200),m=()=>{t.emit("beforeClearValue")};return{renderButtonGroup:()=>o.createVNode("div",{id:n.id?`${n.id}-button-group`:void 0,class:i.value},[d.value&&o.withDirectives(o.createVNode("span",{class:"input-group-text input-group-clear",onClick:f,onMousedown:m},[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:h,onMouseenter:s,onMouseleave:r},[t.slots.buttonContent()]):n.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",innerHTML:n.buttonContent,ref:u,onClick:p=>h(p),onMouseenter:s,onMouseleave:r},null):null]),buttonHandleElement:u}}function et(n,t,e){const l=o.ref(n.popupMinWidth),{hidePopup:i,popoverRef:a}=e,s=()=>{t.emit("shown")};return()=>o.createVNode(xe,{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,onHidden:i,onShown:s,beforeClose:n.beforeClosePopup,limitContentBySpace:n.limitContentBySpace},{default:()=>{var r,d;return[(d=(r=t.slots).default)==null?void 0:d.call(r)]}})}const tt=o.defineComponent({name:"FButtonEdit",props:Oe,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue","beforeClearValue"],setup(n,t){const e=o.ref(),l=o.ref(n.customClass),i=o.ref(n.modelValue),a=Ye(n,t,e,i),{shouldPopupContent:s,hidePopup:r,showPopup:d,togglePopup:c}=a,f=Ke(n,t,e,a,i),u=o.ref(""),h=_e(n,t,i,u,a),{hasFocusedTextBox:m,commitValue:p,inputGroupClass:b}=h,V=Xe(n,t,i,m,u,h),{onMouseEnterTextBox:I,onMouseLeaveTextBox:x}=V,k=o.ref(!1),z=o.computed(()=>{const D={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!n.wrapText};return l.value&&l.value.split(" ").reduce((U,C)=>(U[C]=!0,U),D),D}),S=o.computed(()=>({overflow:n.wrapText?"hidden":""})),E=o.computed(()=>({}));function g(){if(!n.multiSelect||n.inputType!=="tag"||!e.value)return 0;let D=0;const U=Array.from(e.value.querySelectorAll(".farris-tag-item"));return U&&U.length&&(D=U.map(C=>C.offsetTop).filter(C=>C>20).length),D}const F=o.ref(g());o.onUpdated(()=>{F.value=g()});function P(){return n.multiSelect&&n.inputType==="tag"?()=>o.createVNode(o.Fragment,null,[Ze(n,i,h)(),!!F.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("+"),F.value])])]):Je(n,i,h)}let H=P();o.watch([()=>n.multiSelect,()=>n.inputType],()=>{H=P()});const{renderButtonGroup:w,buttonHandleElement:B}=Qe(n,t,f,V),W=et(n,t,a),K=o.ref(s.value),X={displayText:u,commitValue:p,elementRef:e,hidePopup:r,showPopup:d,popoverRef:a.popoverRef,shouldPopupContent:s,togglePopup:c,openDialog:()=>{B.value&&n.buttonBehavior==="Modal"&&B.value.click()},getModal:()=>{var D;return n.buttonBehavior==="Modal"?(D=f.modalRef.value)==null?void 0:D.value:null},getTextbox:()=>{var D;return(D=e.value)==null?void 0:D.querySelector("input")},forceClosePopup:()=>{K.value=!1,k.value=!0,s.value=!1}};return o.onMounted(()=>{e.value.componentInstance=X,window.onresize=()=>{document.body.click()}}),o.onBeforeUnmount(()=>{var D;window.onresize=null,(D=window[Z])==null||D.delete(e.value)}),t.expose(X),o.watch(()=>s.value,async(D,U)=>{if(k.value){K.value=D,k.value=!1;return}if(!D&&n.beforeClosePopup&&typeof n.beforeClosePopup=="function"){try{const C=await n.beforeClosePopup();K.value=!C,(!C||n.readonly)&&(s.value=!0)}catch(C){console.error("Error in beforeClosePopup:",C),K.value=U,s.value=U}return}K.value=D}),()=>{var D,U;return o.createVNode(o.Fragment,null,[o.createVNode("div",o.mergeProps(t.attrs,{ref:e,class:z.value,id:n.id?n.id:void 0,style:S.value}),[o.createVNode("div",{id:n.id?`${n.id}-input-group`:void 0,class:b.value,style:E.value,onMouseenter:I,onMouseleave:x},[(U=(D=t.slots).precontent)==null?void 0:U.call(D),H(),w()])]),K.value&&W()])}}});function nt(n,t,e){return t}function ot(n,t,e){return t}const it=new Map([["appearance",_.resolveAppearance]]),lt=new Map([]),at={$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:[]},ve={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}},st=_.createPropsResolver(ve,at,lt,ot),rt={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}}},dt=o.defineComponent({name:"FItemCollectionEditorInner",props:rt,emits:["change"],setup(n,t){let e="";const{guid:l}=j.useGuid(),i=new Me.FNotifyService,a=o.ref(n.valueField),s=o.ref(n.nameField),r={editMode:"cell"},d={fitColumns:!0},c=o.ref(),f=n.columns;let u=n.datas;o.watch(()=>[n.datas],()=>{u=n.datas,c.value.updateDataSource(u)});function h(){const E={};return f.forEach(g=>{g.editor&&(g.editor.type==="checkbox"||g.editor.type==="switch")?E[g.field]=!1:E[g.field]=""}),E}function m(){if(n.dynamicMappingKeys){const E="请先填写XXX",g=a.value.trim()?s.value.trim()?"":"枚举名称字段":"枚举值字段";return i.warning({position:"top-center",message:E.replace("XXX",g)}),!1}return!0}function p(E){const g="不允许重复。";if(!m())return!1;if(!E||E.length===0)return n.canEmpty?!0:(i.warning({position:"top-center",message:"请添加值"}),!1);const F=n.requiredFields||[],P="不允许为空";for(const w of E)for(const B of Object.keys(w)){const W=f.find(K=>K.field===B);if(W&&W.editor&&(W.editor.type==="checkbox"||W.editor.type==="switch")){if(F.includes(B)&&(w[B]===null||w[B]===void 0))return i.warning({position:"top-center",message:W.title+P}),!1}else if(F.includes(B)&&(w[B]===void 0||w[B]===""||w[B]===null))return i.warning({position:"top-center",message:W.title+P}),!1}const H=n.uniqueFields||[];for(const w of H){const B=E.map(X=>X[w]),W=new Set(B),K=Array.from(W);if(B.length!==K.length){const X=f.find(D=>D.field===w);return i.warning({position:"top-center",message:X.title+g}),!1}}return!0}function b(){if(n.readonly||!m())return;const E=h(),g=l();u.push({hId:g,...E}),c.value.updateDataSource(u),c.value.selectRowById(g)}function V(){u&&u.length>0&&c.value.selectRowById(u[0].hId)}function I(){if(!e){i.warning({position:"top-center",message:"请先选中行!"});return}u=[...u.filter(g=>g.hId!==e)],c.value.updateDataSource(u),V()}function x(E){if(!E||E.length===0)return E;const g=[];return E.forEach(F=>{const{value:P,name:H,...w}=F,B=Object.assign({},w);B[a.value.trim()]=P,B[s.value.trim()]=H,g.push(B)}),g}function k(){c.value.endEditCell();const E=[];return u.forEach(g=>{const{hId:F,...P}=g,H={};for(const w in P)w.startsWith("_")||(H[w]=P[w]);E.push(H)}),E}function z(){let E=k();return p(E)?(n.dynamicMappingKeys?(E=x(E),t.emit("change",E,void 0,{valueField:a.value.trim(),nameField:s.value.trim()})):t.emit("change",E,void 0,null),!0):!1}t.expose({clickConfirm:z,getItems:k}),o.onMounted(()=>{V()});function S(E){var g;e=(g=E[0])==null?void 0:g.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:()=>b()},[o.createTextVNode("新增")]),o.createVNode("button",{class:"btn f-rt-btn f-btn-ml btn-secondary",onClick:()=>I()},[o.createTextVNode("删除")])]),o.createVNode("div",{class:"f-utils-fill border",style:"margin:0 8px;border-radius:12px;"},[o.createVNode(Ve,{ref:c,showBorder:!0,idField:"hId",columns:f,data:u,editable:!n.readonly,"edit-option":r,columnOption:d,commandOption:n.commandOption,fit:!0,onSelectionChange:S},null)])])}}),ut={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}},ct={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},se=o.defineComponent({name:"Toast",props:ct,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),r=o.computed(()=>!i.value.title&&i.value.message),d=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 z=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,S={"f-icon":!0};return S[z]=!0,S}),f=o.computed(()=>i.value.title||i.value.message),u=o.computed(()=>n.showCloseButton),h=o.computed(()=>!!i.value.buttons||!!t.slots.default),m=o.computed(()=>Y.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function p(x){x.stopPropagation(),x.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function b(x,k){}function V(x){return`f-preten-link ${x.customClass?x.customClass:""}`}o.watch(e,()=>{e.value});const I=()=>{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(k=>o.createVNode("span",{class:V(k),onClick:z=>void 0},[k.text]))),t.slots.default&&t.slots.default()])])};return()=>o.createVNode("div",{class:d.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:p},[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:m.value},null),h.value&&I()]),r.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:m.value,innerHTML:i.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[I()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:m.value,innerHTML:i.value.message},null))])])])}}),le=o.defineComponent({name:"Notify",props:ut,emits:["close","empty"],setup(n,t){const e=o.computed(()=>({"farris-notify":!0})),l={left:12,right:12,top:20,bottom:12},i=o.ref(),a=o.ref(n.options),s=o.ref(n.showCloseButton),r=o.computed(()=>n.position||"bottom-right"),d=o.computed(()=>n.timeout!=null?n.timeout:3e3),c=o.computed(()=>{const h=n.bottom?n.bottom:l.bottom,m=n.top?n.top:l.top,p={transition:"all 0.2s ease",left:r.value.indexOf("left")>-1?`${n.left?n.left:l.left}px`:"",right:r.value.indexOf("right")>-1?`${n.right?n.right:l.right}px`:"",top:r.value.indexOf("top")>-1?`${m}px`:"",bottom:r.value.indexOf("bottom")>-1?`${h}px`:""};return r.value.indexOf("center")>-1&&(p.left="50%",p.marginLeft="calc(-24rem / 2)",r.value==="center-center"&&(p.top="50%",p.transform="translate(-50%, -50%)")),p});function f(h){t.emit("close")}d.value&&setTimeout(()=>{f()},d.value),t.expose({closeToast:f,container:i,notifyPosition:r});function u(h,m){f()}return()=>o.createVNode("div",{class:e.value,style:c.value,ref:i},[o.createVNode(se,{options:a.value,showCloseButton:s.value,animate:n.animate,onClose:h=>u(h,a.value)},null)])}});class ft{constructor(){T(this,"notifyRefs",[]);T(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 r=o.ref();function d(){r.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(i,r),s.unmount()},220)}if(i.position.indexOf("top")>-1){const f=e.getNotifyInstances(i.position),u=f[f.length-1];if(u){const h=u.value.container.getBoundingClientRect();i.top=h.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,r)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(le,o.mergeProps({ref:r},i,{onClose:d}),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,r;typeof e=="string"?l=e:e&&(l=e.message||"",i=e.title||"",s=e.position||null,r=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),r!=null&&(c.showCloseButton=r),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 be=Symbol("NOTIFY_SERVICE_TOKEN");le.install=n=>{n.component(le.name,le),n.component(se.name,se);const t=new ft;n.provide(be,t),n.provide("FNotifyService",t)};const pt=o.defineComponent({name:"FItemCollectionEditor",props:ve,components:{},emits:["change"],setup(n,t){const e=o.inject(be),{guid:l}=j.useGuid(),i=o.ref(`共 ${(n.modelValue||[]).length} 项`),a=o.ref(n.valueField),s=o.ref(n.nameField),r=o.ref();function d(){let m=[];return n.dynamicMappingKeys?(m=[],a.value=a.value.trim(),s.value=s.value.trim(),(n.modelValue||[]).forEach(p=>{if(a.value&&s.value){const{[a.value]:b,[s.value]:V,...I}=p,x=I||{};x.value=b,x.name=V,x.hId=l(),m.push(x)}})):(m=ae.cloneDeep(n.modelValue||[]),m.forEach(p=>{p.hId=l()})),m}function c(){let m=[];return n.columns&&n.columns.length>0?m=n.columns:m=[{field:n.valueField,title:"值",dataType:"string"},{field:n.nameField,title:"名称",dataType:"string"}],m}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:m=>!0},{name:"accept",text:"确定",class:"btn btn-primary",handle:async m=>{if(n.beforeSubmit&&typeof n.beforeSubmit=="function"){const b=r.value.getItems();if(!await n.beforeSubmit({notifyService:e,data:b}))return!1}return!!r.value.clickConfirm()}}]};function h(m,p,b){i.value=`共 ${m.length} 项`,t.emit("change",m,p,b)}return o.watch(()=>n.modelValue,m=>{i.value=`共 ${(n.modelValue||[]).length} 项`}),o.onMounted(()=>{}),()=>o.createVNode(tt,{"button-behavior":"Modal","modal-options":u,modelValue:i.value,"onUpdate:modelValue":m=>i.value=m,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":m=>a.value=m,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":m=>s.value=m,readonly:n.readonly},null),[[o.vModelText,s.value]])])])])]),o.createVNode(dt,{ref:r,valueField:a.value,nameField:s.value,requiredFields:n.requiredFields,uniqueFields:n.uniqueFields,dynamicMappingKeys:n.dynamicMappingKeys,readonly:n.readonly,canEmpty:n.canEmpty,datas:d(),columns:c(),onChange:(m,p,b)=>h(m,p,b)},null)])]})}}),mt={$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"}},required:["type"],ignore:["id","appearance","binding","visible"]},re=_.createPropsResolver(fe.radioGroupProps,mt,it,nt);te.register=(n,t,e,l)=>{n["radio-group"]=fe,t["radio-group"]=re,n["item-collection-editor"]=pt,t["item-collection-editor"]=st},te.registerDesigner=(n,t,e)=>{n["radio-group"]=te,t["radio-group"]=re};const ht=j.withInstall(te);L.FRadioGroupDesign=te,L.default=ht,L.propsResolver=re,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(L,j){typeof exports=="object"&&typeof module<"u"?j(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/tags/index.umd.js"),require("../../components/popover/index.umd.js"),require("../../components/data-grid/index.umd.js"),require("../../components/notify/index.umd.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/tags/index.umd.js","../../components/popover/index.umd.js","../../components/data-grid/index.umd.js","../../components/notify/index.umd.js"],j):(L=typeof globalThis<"u"?globalThis:L||self,j(L["radio-group"]={},L.common,L.dynamicResolver,L.FRadioGroup,L.Vue,L.designerCanvas,L.LodashES,L.locale,null,L.FTags,L.FPopover,L.FDataGrid,L.notify))})(this,function(L,j,_,fe,o,y,ae,Y,Ht,we,xe,Ve,Me){"use strict";var Lt=Object.defineProperty;var zt=(L,j,_)=>j in L?Lt(L,j,{enumerable:!0,configurable:!0,writable:!0,value:_}):L[j]=_;var S=(L,j,_)=>zt(L,typeof j!="symbol"?j+"":j,_);const Ee={...j.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 Ie(n,t,e){const l=o.computed(()=>!n.disabled),i=o.computed(()=>n.data||n.enumData||n.options||[]);function a(d){return d[n.valueField]}function s(d){return d[n.textField]}function r(d,c){if(l.value){const f=a(d);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:r}}function Fe(n){const{formSchemaUtils:t,formStateMachineUtils:e}=n;function l(d,c=""){return{path:c+d.code,field:d.id,fullPath:d.code}}function i(d,c=""){return t.getViewModelById(d).states.map(u=>l(u,c))}function a(d){const c=t.getRootViewModelId(),f=i(d);if(d===c)return f;const u=i(c,"root-component.");return[...f,...u]}function s(d){return d.binding&&d.binding.path||d.id||""}function r(){return e&&e.getRenderStates()||[]}return{getVariables:a,getControlName:s,getStateMachines:r}}class pe{constructor(t){S(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'"}]);S(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});S(this,"getExpressionConverter",(t,e)=>({convertFrom:(l,i,a,s)=>{const r=a.getExpressionRuleValue(t,e||i);return r&&r.value||""},convertTo:(l,i,a,s,r)=>{var d;if(i==="dataPicking"&&(a!=null&&a.target)){const c=`${a.target}_dataPicking`;((d=a.rules)==null?void 0:d.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.formSchemaService.getExpressions();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 r;const a=this.createTreeNode(i,e);let s=[];(r=i.type)!=null&&r.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 d,c;const a=this.createTreeNode(i,e);a.type="entity";const s=this.buildEntityFieldsTreeData((d=i.type)==null?void 0:d.fields,[...e,i.label]),r=this.buildChildEntityTreeData((c=i.type)==null?void 0:c.entities,[...e,i.label]);r!=null&&r.length&&(s==null||s.push(...r)),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(),r={message:["validate","required","dataPicking"].includes(e)&&a?a.message:"",...s};return a.messageType!=null&&(r.messageType=a.messageType),r}buildRule(t,e,l,i){const{expression:a,message:s,messageType:r}=e,d={id:`${t}_${l}`,type:l,value:a};return(l==="validate"||l==="dataPicking"||l==="required")&&(d.message=s),l==="dataPicking"&&(d.messageType=r),l==="validate"&&i&&(d.elementId=i),d}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 d=this.getExpressionData().find(f=>f.targetType===e&&f.target===a);const c=f=>f.value.trim()==="";if(d){const f=d.rules.find(u=>u.id===s.id);if(f)c(s)?d.rules=d.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;d.rules=d.rules||[],d.rules.push(s)}}else{if(c(s))return null;d={target:`${a}`,rules:[s],targetType:e}}return d}getExpressionEditorOptions(t,e,l,i){return l.reduce((a,s)=>{var d,c;const r=e==="Field"?(d=t==null?void 0:t.binding)==null?void 0:d.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(r),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 h=this.buildRule(r,f,s);i(h)}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){return{description:"表达式",title:"表达式",hide:!t.binding,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 Te{constructor(t,e){S(this,"componentId");S(this,"viewModelId");S(this,"eventsEditorUtils");S(this,"formSchemaUtils");S(this,"formMetadataConverter");S(this,"designViewModelUtils");S(this,"designViewModelField");S(this,"controlCreatorUtils");S(this,"designerHostService");S(this,"designerContext");S(this,"schemaService",null);S(this,"metadataService",null);S(this,"propertyConfig",{type:"object",categories:{}});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}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,r){if(s){switch(s&&s.propertyID){case"class":case"style":{y.canvasChanged.value++;break}}l&&l(s,t,r)}}}}getPropertyEditorParams(t,e=[],l="visible",i={},a={},s=""){const{getVariables:r,getControlName:d,getStateMachines:c}=Fe(this.designerHostService),f=this.getRealTargetType(t),u=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],h={type:"property-editor",propertyTypes:u};return u.map(m=>{switch(m){case"Const":Object.assign(h,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":h.expressionConfig=this.getExpressionOptions(t,f,s||l);break;case"StateMachine":h.stateMachines=c();break;case"Variable":Object.assign(h,{controlName:d(t),newVariablePrefix:"is",newVariableType:"Boolean",variables:r(this.viewModelId),parentComponentId:this.componentId==="root-component"?"":"root-component",onBeforeOpenVariables:p=>{p.value=r(this.viewModelId)}},a),this.designerContext.designerMode==="PC_RTC"&&(h.newVariablePrefix="ext_"+h.newVariablePrefix);break}}),h}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"]),{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 d in l)s[d]=Object.assign(s[d]||{},l[d]);const r=this;return{...a,properties:{...s},setPropertyRelates(d,c){if(d){switch(d.propertyID){case"disabled":case"readonly":case"visible":r.afterMutilEditorChanged(t,d);break}i&&i(d,c)}}}}afterMutilEditorChanged(t,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e),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=ae.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)}updateExpressionValue(t){const e=t.propertyValue;if(!((e&&e.type)==="Expression"&&e.expressionInfo))return;const{expressionId:a,expressionInfo:s}=e,{targetId:r,targetType:d,expressionType:c,value:f,message:u}=s,h=this.formSchemaUtils.getModule();h.expressions=h.expressions||[];const{expressions:m}=h;let p=m.find(V=>V.target===r);p||(p={target:r,rules:[],targetType:d},m.push(p));const b=p.rules.find(V=>V.type===c);if(b)b.value=f,b.message=u;else{const V={id:a,type:c,value:f,message:u};p.rules.push(V)}delete e.expressionInfo}clearExpression(t,e){const l=t.propertyValue;if(l&&l.type==="Expression")return;const a=t.propertyID,s=this.formSchemaUtils.getExpressions(),r=e.binding?e.binding.field:e.id,d=s.find(c=>c.target===r);!d||!d.rules||(d.rules=d.rules.filter(c=>c.type!==a))}getExpressionOptions(t,e,l){return new pe(this.formSchemaUtils).getExpressionOptions(t,e,l)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-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 Q=class Q{static getEditorTypesByMDataType(t,e=!1,l=""){if(e)return[{key:y.DgControl["language-textbox"].type,value:y.DgControl["language-textbox"].name}];let i=Q.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];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const t=[];for(const e in Q.fieldControlTypeMapping)Q.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}};S(Q,"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}],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["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},{key:y.DgControl["radio-group"].type,value:y.DgControl["radio-group"].name}]});let oe=Q;var ie=(n=>(n.Form="Form",n.Variable="Variable",n))(ie||{});class Se{constructor(){S(this,"label","");S(this,"id","");S(this,"columnInSM",12);S(this,"columnInMD",6);S(this,"columnInLG",3);S(this,"columnInEL",2);S(this,"displayWidthInSM",1);S(this,"displayWidthInMD",1);S(this,"displayWidthInLG",1);S(this,"displayWidthInEL",1);S(this,"displayColumnCountAtBreakPoint","md");S(this,"tagRow",0);S(this,"showTopBorder",0);S(this,"group",1);S(this,"isSupportedClass",!0);S(this,"fieldSetId","")}}function ke(n){let t,e;const l=new Map;let i=[];function a(f,u){const m=f.split(" ").filter(x=>x.startsWith("col-"));if(m.length===0){u.isSupportedClass=!1;return}let p=m.find(x=>/^col-([1-9]|10|11|12)$/.test(x)),b=m.find(x=>/^col-md-([1-9]|10|11|12)$/.test(x)),V=m.find(x=>/^col-xl-([1-9]|10|11|12)$/.test(x)),I=m.find(x=>/^col-el-([1-9]|10|11|12)$/.test(x));p=p||"col-12",u.columnInSM=parseInt(p.replace("col-",""),10),u.displayWidthInSM=u.columnInSM/12,u.displayWidthInSM!==1&&(u.isSupportedClass=!1),b=b||"col-md-"+u.columnInSM,u.columnInMD=parseInt(b.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),I=I||"col-el-"+u.columnInLG,u.columnInEL=parseInt(I.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,h,m=!1){let p=!1;f.contents.forEach(b=>{if(b.type==="fieldset"){h+=1,s(b,u,h,!0),p=!0;return}p&&(h+=1,p=!1);const V=b.appearance&&b.appearance.class,I=new Se;V?a(V,I):I.isSupportedClass=!1,I.label=b.label||b.id,I.id=b.id,I.group=h,m&&(I.fieldSetId=f.id),e===b.id&&(t=h),l.set(b.id,b),u.push(I)})}function r(f){const u=n.getComponentById(f);if(!u||!u.componentType||!u.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const h=n.selectNode(u,m=>m.type===y.DgControl["response-form"].type);return!h||!h.contents||h.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:h}}function d(f,u){u=u||f.id;const{result:h,message:m,formNode:p}=r(u);if(!h)return{result:h,message:m};e=f.id,i=[],l.clear();const b=p.contents[0].type===y.DgControl.fieldset.type?0:1;s(p,i,b);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:h,formNode:m}=r(u);if(!h)return"";const p=[];return f.forEach(b=>{var x;const V=l.get(b.id),I=V.appearance&&V.appearance.class;if(I){const z=I.split(" ").filter(H=>!H.startsWith("col-")),T="col-"+b.columnInSM,E="col-md-"+b.columnInMD,g="col-xl-"+b.columnInLG,F="col-el-"+b.columnInEL,P=[T,E,g,F].concat(z);V.appearance.class=P.join(" ")}if(b.fieldSetId){const k=m.contents.find(T=>T.id===b.fieldSetId),z=p.find(T=>T.id===b.fieldSetId);z?(x=z.contents)==null||x.push(V):(p.push(k),k.contents=[V])}else p.push(V)}),m.contents=p,m.id}return{checkCanFindFormNode:r,checkCanOpenLayoutEditor:d,changeFormControlsByResponseLayoutConfig:c,getResonseFormLayoutConfig:s}}class Be extends Te{constructor(e,l){super(e,l);S(this,"responseLayoutEditorFunction");S(this,"bindingVarible");S(this,"numberEditorOptions",{type:"number-spinner",useThousands:!1,keyboard:!1,showButton:!1});this.responseLayoutEditorFunction=ke(this.formSchemaUtils)}getCommonPropertyConfig(e,l,i="Card"){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")}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 c;const a=this;this.setDesignViewModelField(e);const{canChangeControlType:s,editorTypeList:r}=this.getAvailableEditorType(e),d={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:r,readonly:!s}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},showLabelType:{description:"标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",title:"标签显示",type:"enum",editor:{data:[{id:"visible",name:"显示"},{id:"reserve-space",name:"占位"},{id:"none",name:"不显示"}]},defaultValue:((c=e.editor)==null?void 0:c.type)==="image"?"none":"visible"},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},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(f,u,h){if(f)switch(f&&f.propertyID){case"type":{a.changeControlType(e,f,l);break}case"label":{f.needRefreshControlTree=!0;break}case"binding":{a.changeBindingField(e,f,h);break}}}};return i.toLocaleLowerCase()!=="card"&&delete d.properties.showLabelType,d}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!==j.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(e){var a;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===j.FormSchemaEntityField$Type.SimpleField?i=oe.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(i=oe.getEditorTypesByMDataType(this.bindingVarible.type,this.designViewModelField.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"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,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){const a=l.propertyValue,s=i&&i.parent&&i.parent.schema;if(!s)return;const r=s.contents.findIndex(f=>f.id===e.id);if(r===-1)return;const d=s.contents[r];let c;if(this.designViewModelField){const h=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};h.editor||(h.editor={}),h.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,h,!1),c=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,a)}c||(c=this.controlCreatorUtils.createFormGroupWithoutField(a)),Object.assign(c,{id:d.id,appearance:d.appearance,size:d.size,label:d.label,binding:d.binding}),Object.prototype.hasOwnProperty.call(d,"visible")&&Object.assign(c,{visible:d.visible}),d.editor&&["readonly","required","placeholder"].map(f=>{Object.prototype.hasOwnProperty.call(d.editor,f)&&(c.editor[f]=d.editor[f])}),i!=null&&i.updateContextSchema?i.updateContextSchema(c):(i.schema=Object.assign(d,c),Object.assign(e,c)),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(f=>f.classList.remove("dgComponentSelected")),Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(f=>f.classList.remove("dgComponentFocused")),y.canvasChanged.value++,o.nextTick(()=>{this.getFormDesignerInstance().reloadPropertyPanel()})}getComponentConfig(e,l={},i={},a){var h,m;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},l),r=(h=e.binding)!=null&&h.field?[]:["Const","Variable","StateMachine"],d=this.getPropertyEditorParams(e,r,"readonly"),c=this.getPropertyEditorParams(e,r,"required"),f={readonly:{description:"",title:"只读",editor:d},required:{description:"",title:"必填",type:"boolean",editor:c,visible:!!((m=e.binding)!=null&&m.field)},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,b){if(p){switch(p.propertyID){case"readonly":case"required":u.afterMutilEditorChanged(e,p);break}a&&a.bind(u)(p,e,b)}}}}updateUnifiedLayoutAfterControlChanged(e,l,i){const a=e.split(" ");let s=a.find(u=>/^col-([1-9]|10|11|12)$/.test(u)),r=a.find(u=>/^col-md-([1-9]|10|11|12)$/.test(u)),d=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",r=r||"col-md-"+s.replace("col-",""),d=d||"col-xl-"+r.replace("col-md-",""),c=c||"col-el-"+d.replace("col-xl-","");const f={id:l,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(r.replace("col-md-",""),10),columnInLG:parseInt(d.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 p=a.find(b=>b.id===l.id);Object.assign(p||{},l)}const s=a.map(p=>p.columnInSM),r=a.map(p=>p.columnInMD),d=a.map(p=>p.columnInLG),c=a.map(p=>p.columnInEL),f=this.checkIsUniqueColumn(s)?s[0]:null,u=this.checkIsUniqueColumn(r)?r[0]:null,h=this.checkIsUniqueColumn(d)?d[0]:null,m=this.checkIsUniqueColumn(c)?c[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:f,uniqueColClassInMD:u,uniqueColClassInLG:h,uniqueColClassInEL:m})}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===j.FormSchemaEntityFieldType$Type.EnumType)}appendFieldValueChangeEvents(e,l){e.binding&&e.binding.type===ie.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 ie.Form:return e.binding.path||e.type;case ie.Variable:return e.binding.fullPath||e.type}return e.type}getEventPropertyConfig(e,l="card",i,a){const s=this;let r=[];if(i&&(r=r.concat(i)),r.length===0)return{title:"事件",hideTitle:!0,properties:{},tabId:"commands",tabName:"交互",hide:!0};this.appendFieldValueChangeEvents(e,r);const d=s.eventsEditorUtils.formProperties(e,s.viewModelId,r);return{title:"事件",hideTitle:!0,properties:s.createBaseEventProperty(d),tabId:"commands",tabName:"交互",setPropertyRelates(u,h){const m=u.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)),a&&a(u,h,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 new pe(this.formSchemaUtils).getExpressionConfig(e,l,i,a)}getBindingDataType(){return this.designViewModelField?this.designViewModelField.type.name==="Number"?"number":this.designViewModelField.type.name==="String"?"string":"boolean":"boolean"}getEditor(){return this.getBindingDataType()==="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 r=l==="trueValue"?"falseValue":"trueValue";e.editor[r]===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 Ne extends Be{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)===j.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=i.type.enumValues||[])}}function Pe(n,t){const e=n.schema;function l(i,a){return new Ne(i,t).getPropertyConfig(e,a)}return{getPropsConfig:l}}const te=o.defineComponent({name:"FRadioGroupDesign",props:Ee,emits:["changeValue","update:modelValue"],setup(n,t){const e=o.ref(n.modelValue),{enumData:l,getValue:i,getText:a}=Ie(n,t,e),s=o.computed(()=>({"farris-checkradio-hor":n.direction==="horizontal"})),r=o.ref(),d=o.inject("designer-host-service"),c=o.inject("design-item-context"),f=Pe(c,d),u=y.useDesignerComponent(r,c,f);o.onMounted(()=>{r.value.componentInstance=u});const h=o.computed(()=>{if(!l.value||l.value.length===0){const m=[];return[{value:"example1",name:"示例一"},{value:"example2",name:"示例二"}].map(p=>{const b={};b[n.valueField]=p.value,b[n.textField]=p.name,m.push(b)}),m}return l.value});return t.expose(u.value),()=>o.createVNode("div",{class:["farris-input-wrap",s.value],ref:r},[h.value.map((m,p)=>{const b="radio_"+n.name+p;return o.createVNode("div",{class:"custom-control custom-radio"},[o.createVNode("input",{type:"radio",class:"custom-control-input",name:n.name,id:b,value:i(m),disabled:!0},null),o.createVNode("label",{class:"custom-control-label",for:b},[a(m)])])})])}}),Oe={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},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},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}},De={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object},backgroundColor:{type:String,default:""}},Re=o.defineComponent({name:"FOverlay",props:De,emits:["click"],setup(n,t){const e=o.ref(n.popupContentPosition),l=o.ref(n.host),i=o.computed(()=>({backgroundColor:n.backgroundColor||"",pointerEvents:"auto"}));function a(r){t.emit("click"),r.preventDefault(),r.stopPropagation()}o.computed(()=>{const r=l.value;if(r){const d=r.getBoundingClientRect(),{left:c,top:f,height:u}=d;return{left:c,top:f+u}}return e.value});const s=o.computed(()=>({}));return()=>o.createVNode(o.Teleport,{to:"body"},{default:()=>{var r,d;return[o.createVNode("div",{class:"overlay-container",onClick:c=>a(c),style:i.value},[o.createVNode("div",{style:s.value},[(d=(r=t.slots).default)==null?void 0:d.call(r)])])]}})}});function Le(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function ze(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=Le(n);return()=>o.createVNode(Re,{"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 He{static show(t){return ze(t)}}const je={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},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},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},host:{type:Object,default:"body"}};class ${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 $(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new $(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 $(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 $(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 $(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 $e(n,t){const e=o.ref(),l=o.ref(),i=o.ref(),a=o.ref(),s=o.ref(),r=o.ref(),d=o.ref(),c=o.ref(),f=o.ref(),u=o.ref(),h=o.ref(),m=o.ref(n.resizeable),p=o.ref(),b=o.ref(n.draggable),V=o.ref(!1);function I(){const C=l.value||document.body,M=window.getComputedStyle(C);if(!M||!e.value)return;const R=$.getTransformInfo(e.value),O={};d.value&&(O.deltaL=e.value.offsetLeft-d.value.x,O.deltaT=e.value.offsetTop-d.value.y);const A=M.getPropertyValue("position");O.width=C.clientWidth,O.height=C.clientHeight,O.pr=parseInt(M.getPropertyValue("padding-right"),10),O.pb=parseInt(M.getPropertyValue("padding-bottom"),10),O.position=M.getPropertyValue("position"),A==="static"&&(C.style.position="relative"),O.translateX=R.x,O.translateY=R.y,u.value=O}function x(C){if(e.value){a.value=J.getCurrent(e.value),s.value=$.getCurrent(e.value),r.value=a.value?J.copy(a.value):null,d.value=s.value?$.copy(s.value):null,I();const M=C.target.getAttribute("type")||"";c.value={n:!!M.match(/n/),s:!!M.match(/s/),w:!!M.match(/w/),e:!!M.match(/e/)}}}function k(){var C,M,R,O;if(e.value){const A=e.value;c.value&&((c.value.n||c.value.s)&&((C=r.value)!=null&&C.height)&&(A.style.height=r.value.height+"px"),(c.value.w||c.value.e)&&((M=r.value)!=null&&M.width)&&(A.style.width=r.value.width+"px"),d.value&&((R=d.value)!=null&&R.x&&(A.style.left=d.value.x+"px"),(O=d.value)!=null&&O.y&&(A.style.top=d.value.y+"px")))}}function z(){const C=n.minHeight?n.minHeight:1,M=n.minWidth?n.minWidth:1;r.value&&d.value&&c.value&&a.value&&(r.value.height<C&&(r.value.height=C,c.value.n&&s.value&&(d.value.y=s.value.y+(a.value.height-C))),r.value.width<M&&(r.value.width=M,c.value.w&&s.value&&(d.value.x=s.value.x+(a.value.width-M))),n.maxHeight&&r.value.height>n.maxHeight&&(r.value.height=n.maxHeight,s.value&&c.value.n&&(d.value.y=s.value.y+(a.value.height-n.maxHeight))),n.maxWidth&&r.value.width>n.maxWidth&&(r.value.width=n.maxWidth,c.value.w&&s.value&&(d.value.x=s.value.x+(a.value.width-n.maxWidth))))}function T(){if(l.value){const C=u.value;if(d.value&&r.value&&c.value&&a.value){const M=C.width-C.pr-C.deltaL-C.translateX-d.value.x,R=C.height-C.pb-C.deltaT-C.translateY-d.value.y;c.value.n&&d.value.y+C.translateY<0&&s.value&&(d.value.y=-C.translateY,r.value.height=a.value.height+s.value.y+C.translateY),c.value.w&&d.value.x+C.translateX<0&&s.value&&(d.value.x=-C.translateX,r.value.width=a.value.width+s.value.x+C.translateX),r.value.width>M&&(r.value.width=M),r.value.height>R&&(r.value.height=R)}}}function E(C){if(!i.value||!a.value||!s.value||!c.value)return;C.subtract(i.value);const M=C.x,R=C.y;c.value.n?(d.value.y=s.value.y+R,r.value.height=a.value.height-R):c.value.s&&(r.value.height=a.value.height+R),c.value.e?r.value.width=a.value.width+M:c.value.w&&(r.value.width=a.value.width-M,d.value.x=s.value.x+M),T(),z(),k()}function g(C){if(!f.value)return;const M=$.fromEvent(C);M&&E(M)}function F(){if(e.value){const{width:C,height:M,x:R,y:O}=e.value.getBoundingClientRect(),A=$.getTransformInfo(e.value);return{size:{width:C,height:M},position:{x:R-A.x,y:O-A.y}}}return null}function P(C){if(e.value){const M=F();h.value=M}i.value=void 0,a.value=null,s.value=null,r.value=null,d.value=null,c.value=null,f.value=null,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",P)}function H(){document.addEventListener("mousemove",g),document.addEventListener("mouseup",P)}function w(C){C instanceof MouseEvent&&C.button===2||b.value&&(document.body.click(),C.stopPropagation(),C.preventDefault(),i.value=$.fromEvent(C),f.value=C.target,x(C),H())}function B(C){return e.value=C,m.value&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:M=>w(M)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:M=>w(M)},null)])}function W(C=!0){document.body.click();const M=l.value||document.body,R=J.getCurrent(M),O=e.value;C&&O&&(p.value=F(),p.value.transform=O.style.transform),R&&O&&(r.value=R,r.value.height-=14,r.value.width-=14,O.style.height=r.value.height+"px",O.style.width=r.value.width+"px",O.style.left="7px",O.style.top="7px",O.style.transform="",h.value={size:r.value,position:{x:0,y:0}},b.value=!1,V.value=!0)}function K(){var C,M;if(document.body.click(),p.value){const R={width:p.value.size.width||0,height:p.value.size.height||0},O={x:(window.innerWidth-R.width)/2,y:(window.innerHeight-R.height)/2};(C=r.value)==null||C.set(R),(M=d.value)==null||M.set(O);const A=e.value;A.style.height=R.height+"px",A.style.width=R.width+"px",A.style.left=`${O.x}px`,A.style.top=`${O.y}px`,A.style.transform="",h.value={size:R,position:O},b.value=n.draggable,V.value=!1}}function X(){if(e.value){const C=J.getCurrent(e.value);if(C){const{width:M,height:R}=C;e.value.style.left=`${(window.innerWidth-M)/2}px`,e.value.style.top=`${(window.innerHeight-R)/2}px`,e.value.style.transform=""}}}function D(){const C=()=>{V.value?W(!1):X(),document.body.click()};return window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}}const U=D();return{renderResizeBar:B,boundingElement:l,resizedEventParam:h,maximize:W,restore:K,allowDrag:b,isMaximized:V,unWindowResizeHandle:U,moveToCenter:X}}function Ae(n,t,e){const l=o.ref(),i=o.ref(n.draggable),a=o.ref(n.lockAxis),s=o.ref(),r=o.ref(),d=o.ref(!1),c=o.ref(new $(0,0)),f=o.ref(new $(0,0)),u=o.ref(new $(0,0)),h=o.ref(new $(0,0));o.watch(()=>e.value,g=>{s.value.style.cursor=g?"move":"default"});function m(g,F){if(F.tagName==="BUTTON")return!1;if(F===g)return!0;for(const P in F.children)if(Object.prototype.hasOwnProperty.call(F.children,P)&&m(g,F.children[P]))return!0;return!1}function p(){var H,w;let g=u.value.x+f.value.x,F=u.value.y+f.value.y;a.value==="x"?(g=((H=c.value)==null?void 0:H.x)||0,u.value.x=0):a.value==="y"&&(F=((w=c.value)==null?void 0:w.y)||0,u.value.y=0);const P=`translate3d(${Math.round(g)}px, ${Math.round(F)}px, 0px)`;l.value&&(l.value.style.transform=P),h.value.x=g,h.value.y=F}function b(){if(!r.value||!l.value)return null;const g=r.value.getBoundingClientRect(),F=l.value.getBoundingClientRect(),P={top:g.top<F.top,right:g.right>F.right,bottom:g.bottom>F.bottom,left:g.left<F.left};return P.top||(u.value.y-=F.top-g.top),P.bottom||(u.value.y-=F.bottom-g.bottom),P.right||(u.value.x-=F.right-g.right),P.left||(u.value.x-=F.left-g.left),p(),P}function V(g){g&&(c.value&&g.subtract(c.value),u.value.set(g),p(),b())}function I(g){d.value&&i.value&&(g.stopPropagation(),g.preventDefault(),V($.fromEvent(g,s.value)))}function x(){var g;d.value&&(d.value=!1,f.value.add(u.value),u.value.reset(),(g=l.value)==null||g.classList.remove("ng-dragging"),t.emit("stopMove"),document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",x))}function k(){!d.value&&s.value&&(d.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",I),document.addEventListener("mouseup",x))}function z(){if(l.value){const g=$.getTransformInfo(l.value);f.value.set(g);return}f.value.reset()}function T(g){if(!e.value||g instanceof MouseEvent&&g.button===2)return;const F=g.target||g.srcElement;s.value!==void 0&&F&&!m(F,s.value)||i.value!==!1&&(document.body.click(),g.stopPropagation(),g.preventDefault(),c.value=$.fromEvent(g,l.value),z(),k())}function E(g,F,P){if(i.value&&F){if(g)s.value=g;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const H=F.querySelector(n.dragHandle);H&&(s.value=H)}}l.value=F,r.value=P,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",T)):i.value=!1}}return{registerDraggle:E,resetTranslate:z}}function me(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 Ue(n,t){const e=o.ref(n.enableEsc);let l=null;return e.value?(l=me("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:l}):null}function qe(n,t){const e=o.ref(n.enableEnter);let l=null;return e.value?(l=me("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:l}):null}const ne=o.defineComponent({name:"FModal",props:je,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],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),r=o.ref(n.fitContent),d=o.ref(n.showHeader),c=o.ref(""),f=o.ref(n.showCloseButton),u=o.ref(n.showMaxButton),h=o.ref(!1),m=o.ref(n.dialogType),p=o.ref(n.src),b=o.ref(""),V=o.ref(n.showButtons),I=o.ref(n.title),x=o.ref(n.containment||null),k=o.ref();I.value==="错误提示"&&(I.value=Y.LocaleService.getLocaleValue("messageBox.errorTitle"));const z=o.ref(!1);function T(v,N){const G=N?"accept":"cancel";Promise.resolve().then(()=>{var q;return(q=n.beforeClose)==null?void 0:q.call(n,{closeType:G})}).then(q=>{q&&(i.value=!1,t.emit("update:modelValue",!1),N!=null&&t.emit(N?"accept":"cancel"),t.emit("closed",v))})}const E=[{name:"cancel",text:Y.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:v=>{T(v,!1)}},{name:"accept",text:Y.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:v=>{T(v,!0)}}],g=o.ref(n.buttons&&n.buttons.length?n.buttons:E),F=o.computed(()=>!!c.value),P=o.computed(()=>!!V.value&&!!g.value),H=o.ref(),w=o.ref(),B=o.ref(!1),{renderResizeBar:W,maximize:K,restore:X,boundingElement:D,resizedEventParam:U,allowDrag:C,unWindowResizeHandle:M,moveToCenter:R}=$e(n),{registerDraggle:O}=Ae(n,t,C);function A(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function gt(){const v=document.querySelectorAll(".farris-modal").length;(!v||v-1<=0)&&document.body.classList.remove("modal-open"),k.value&&k.value.classList.remove("show")}o.watch(()=>n.title,(v,N)=>{v!==N&&(I.value=v)}),o.watch(()=>n.modelValue,(v,N)=>{v!==N&&(i.value=v,i.value&&n.draggable&&o.nextTick(()=>{w.value&&!x.value&&(x.value=w.value.parentElement,D.value=x.value,O(H.value,w.value,D.value),R())}),v||(x.value&&(x.value=null),gt())),i.value?z.value=A():(B.value=!1,C.value=n.draggable)}),o.watch(()=>n.showHeader,(v,N)=>{v!==N&&(d.value=v)}),o.watch(()=>n.showButtons,(v,N)=>{v!==N&&(V.value=v)}),o.watch(()=>U.value,(v,N)=>{const G=v||{},q=N||{};JSON.stringify(G)!==JSON.stringify(q)&&t.emit("resize",{newSize:v,oldSize:N,isMaximized:B.value})}),o.watch([()=>n.width,()=>n.height],(v,N)=>{(v[0]!==N[0]||v[1]!==N[1])&&(e.value=v[0]||500,l.value=v[1]||600)});const de=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),yt=o.computed(()=>{var G;const v={modal:!0,"farris-modal":!0,fade:!0};v["f-modal-fitContent"]=!!r.value,v.show=!!de.value;const N=(G=n.maskClass)==null?void 0:G.split(" ");return N==null||N.reduce((q,ee)=>(q[ee]=!0,q),v),v}),vt=o.computed(()=>{var G;const v={"modal-dialog":!0},N=(G=s.value)==null?void 0:G.split(" ");return N==null||N.reduce((q,ee)=>(q[ee]=!0,q),v),v}),bt=o.computed(()=>{const v=document.documentElement.clientWidth,N=document.documentElement.clientHeight,G=Math.min(e.value,v),q=r.value?"auto":`${Math.min(l.value,N-10)}px`,ee={position:"absolute",top:`${(window.innerHeight-parseInt(q==="auto"?"0":q))/2}px`,left:`${(window.innerWidth-G)/2}px`,width:`${G}px`,height:q};return n.mask||(ee.pointerEvents="auto"),ee}),Ct=()=>j.getMaxZIndex()||1040,wt=o.computed(()=>{const v={display:"block",zIndex:Ct()};return n.mask||(v.pointerEvents="none",v.backgroundColor="transparent"),z.value&&(v.backgroundColor="transparent"),v}),xt=o.computed(()=>({"modal-content":!0,"modal-content-has-header":d.value})),Vt=o.computed(()=>{const v={display:d.value?"":"none"};return v["pointer-events"]=C.value?"auto":"none",v}),Mt=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:B.value})),Et=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":m.value==="iframe","f-utils-fill":!0}));function It(){return{height:`${n.footerHeight||60}px`}}const Ft=o.computed(()=>{const v={textAlgin:b.value},N=It();return Object.assign(v,N)});function Ce(v){if(v==null||v.stopPropagation(),B.value){B.value=!1,X();return}K(),B.value=!0}async function Tt(v,N){v.handle&&await v.handle(N,v)&&t.emit("closed",N)}function St(v){v.width&&(e.value=v.width),v.height&&(l.value=v.height),v.buttons&&(g.value=v.buttons),v.title&&(I.value=v.title)}let ue=null,ce=null;o.onBeforeMount(()=>{z.value=A()}),o.onMounted(()=>{w.value&&!x.value&&(x.value=w.value.parentElement,D.value=x.value,O(H.value,w.value,D.value)),de.value&&document.body.classList.add("modal-open"),ue=Ue(n,t),ce=qe(n,t)}),o.onUnmounted(()=>{M&&M(),ue&&ue.remove(),ce&&ce.remove()}),t.expose({modalElementRef:w,updateModalOptions:St,close:T,maxDialog:Ce,isMaximized:B});function kt(){return o.createVNode("ul",null,[h.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:Ce,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:Mt.value},null)]),f.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:v=>T(v,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function Bt(){return o.createVNode("div",{class:"modal-footer",style:Ft.value},[g.value&&g.value.map(v=>{const N=o.ref(v.disabled);return o.createVNode("button",{name:v.name,type:"button",disabled:N.value,class:v.class+(v.iconClass?" btn-icontext":""),onClick:G=>{Tt(v,G)}},[!!v.iconClass&&o.createVNode("i",{class:v.iconClass},null),v.text])})])}function Nt(){return o.createVNode("div",{ref:H,class:"modal-header",style:Vt.value},[t.slots.headerTemplate?t.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[F.value&&o.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[I.value])]),o.createVNode("div",{class:"actions"},[kt()])])}function Pt(){return t.slots.footerTemplate?t.slots.footerTemplate():P.value&&Bt()}function Ot(v){if(v.stopPropagation(),n.allowClickMaskToClose){if(v.target!==k.value)return;T(v,!1)}}function Dt(){var v,N;return o.createVNode("div",{id:a.value,class:vt.value,style:bt.value,ref:w},[o.createVNode("div",{class:xt.value},[d.value&&Nt(),o.createVNode("div",{class:Et.value},[(N=(v=t.slots).default)==null?void 0:N.call(v),m.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),Pt()]),!r.value&&w.value&&!B.value&&W(w.value)])}function Rt(v){return v||"body"}return()=>o.createVNode(o.Teleport,{to:Rt(n.host)},{default:()=>[de.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:k,class:yt.value,style:wt.value,onClick:Ot},[Dt()])]})]})}});function he(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function We(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||""),r=o.ref(!!n.showButtons),d=o.ref(!!n.showHeader),c=o.ref(n.showCloseButton==null?!0:n.showCloseButton),f=o.ref(!0),u=o.ref(n.title||""),h=n.acceptCallback||(()=>{}),m=n.rejectCallback||(()=>{}),p=n.closedCallback||(k=>{}),b=n.resizeHandle||(k=>{}),V=n.stopMoveHandle||(k=>{}),I=he(n),x=k=>{f.value=!1,e.unmount(),p(k)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(ne,{ref:a,class:s.value,modelValue:f.value,"onUpdate:modelValue":k=>f.value=k,title:u.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":d.value,"show-buttons":r.value,"show-close-button":c.value,"show-max-button":!1,onAccept:h,onCancel:m,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:x,onResize:b,onStopMove:V},{default:()=>[I&&I(e)]})}});return document.body.appendChild(t),e.use(Y.LocaleService.i18n),e.mount(t),e}class Ge{constructor(t){S(this,"appContext",null);S(this,"modalRef",o.ref());S(this,"activeModalIndex",o.ref(0));S(this,"modalRefs",{});S(this,"isUseEscCloseModal",o.ref(!1));S(this,"activeModalInstance",o.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.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 We(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},t)),i=o.ref(!0),a=l.value.acceptCallback||(()=>{}),s=l.value.rejectCallback||(()=>{}),r=l.value.closedCallback||((T,E)=>{}),d=l.value.resizeHandle||(T=>{}),c=t.stopMoveHandle||(T=>{});let f;const u=he(l.value),h=T=>{var g;i.value=!1;const E=(g=T==null?void 0:T.target)==null?void 0:g.classList.contains("modal_close");r(T,this.isUseEscCloseModal.value?"esc":E?"icon":"button")},m=T=>{h(T),f&&o.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],o.render(null,e),f=null,this.modalRef.value=null,this.modalRefs){const E=Object.keys(this.modalRefs).map(g=>Number(g));E.length>0?this.activeModalIndex.value=Math.max(...E):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=T=>{var E;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((E=this.activeModalInstance.value)==null||E.close(T==null?void 0:T.event))},{width:b,height:V}=l.value,I=this.adaptToWindow(b||500,V||320);Object.assign(l.value,I);const x=()=>o.createVNode(ne,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":T=>i.value=T},l.value,{onAccept:a,onCancel:s,onClosed:m,onResize:d,onEsc:p,onStopMove:c}),{default:()=>[u&&u(this.app)]});return f=(T=>{const E=o.h(x,T);return E.appContext=this.appContext,o.render(E,e),E})({...l.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:T=>{l.value={...l.value,...T},f&&o.render(o.cloneVNode(f,{...l}),e)},destroy:m,modalRef:this.activeModalInstance,close:()=>this.close()}}}const ge=Symbol("FModalService");ne.install=n=>{n.component(ne.name,ne);const t=new Ge(n);n.provide(ge,t),n.provide("FModalService",t)};function ye(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 Ke(n,t,e,l,i){const a=o.ref(n.buttonBehavior),s=o.ref(n.popupOnInput),r=o.computed(()=>({"input-group-append":!0,"append-force-show":n.showButtonWhenDisabled&&(n.readonly||n.disable)})),{judgeCanOpen:d}=ye(n,i),c=o.computed(()=>n.showButtonWhenDisabled||(!n.editable||!n.readonly)&&!n.disable),f=o.inject(ge,null),u=o.ref();async function h(b){if(await d()&&c.value){const V=!!t.slots.default;if(a.value==="Modal"){const I=n.modalOptions,x=f==null?void 0:f.open({...I,render:()=>t.slots.default&&t.slots.default()});u.value=x==null?void 0:x.modalRef}a.value==="Overlay"&&He.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:b,value:n.modelValue})}}function m(b){t.emit("mouseEnterIcon",b)}function p(b){t.emit("mouseLeaveIcon",b)}return{buttonGroupClass:r,onClickButton:h,onMouseEnterButton:m,onMouseLeaveButton:p,modalRef:u}}function Xe(n,t,e,l,i,a){const s=o.ref(!1),r=o.computed(()=>n.enableClear&&!n.readonly&&!n.disable),{changeTextBoxValue:d,hasClearClass:c}=a;function f(p){s.value=p,c.value=p}o.watch(i,()=>{f(!!i.value)});function u(p){const b=!n.readonly&&!n.disable&&n.editable,V=!n.editable;p.stopPropagation(),(b||V)&&(d(""),i.value="",f(!s.value),t.emit("clear"))}function h(p){if(r.value){if(!e.value){f(!1);return}!n.disable&&!n.readonly&&f(!0)}}function m(p){r.value&&f(!1)}return{enableClearButton:r,showClearButton:s,onClearValue:u,onMouseEnterTextBox:h,onMouseLeaveTextBox:m}}function _e(n,t,e,l,i){const a=o.computed(()=>n.popupOnInput),s=o.computed(()=>n.popupOnFocus),{shouldPopupContent:r,closeAllPopover:d}=i,c=o.ref(!1),f=o.computed(()=>n.enableTitle?e.value:""),u=o.computed(()=>(n.disable||n.readonly)&&!n.forcePlaceholder?"":n.placeholder),h=o.computed(()=>n.readonly||!n.editable),m=o.ref(!1),p=o.computed(()=>!n.disable&&m.value),b=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":p.value,"input-group--has-clear":n.enableClear&&c.value}));function I(w,B=!0){e.value=w,B&&(t.emit("change",w),t.emit("update:modelValue",w))}function x(w){r.value=!1,I(w,!0)}o.watch(()=>n.modelValue,w=>{e.value=w});function k(w){m.value=!1,t.emit("blur",w),w.stopPropagation()}function z(w){t.emit("click",w),d(),t.slots.default&&!n.disable&&!n.readonly&&n.popupOnClick&&i.togglePopup()}function T(w){!n.disable&&!n.readonly&&(m.value=!0,h.value||(t.emit("focus",w),s.value&&!r.value&&i.popup()))}function E(w){t.emit("input",w);const B=w.target.value;l.value=B,e.value!==B&&I(B,n.updateOn==="change"),a.value&&!r.value&&i.popup()}function g(w){w.target.tagName!=="INPUT"&&w.preventDefault(),w.stopPropagation()}function F(w){t.emit("keydown",w)}function P(w){w.key==="Enter"&&(a.value||s.value)&&i.hidePopup(),t.emit("keyup",w)}function H(w){const B=w.target.value;w.stopPropagation(),I(B)}return{hasFocusedTextBox:p,isTextBoxReadonly:h,textBoxClass:b,textBoxPlaceholder:u,textBoxTitle:f,inputGroupClass:V,hasClearClass:c,changeTextBoxValue:I,commitValue:x,onBlurTextBox:k,onClickTextBox:z,onFocusTextBox:T,onInput:E,onKeyDownTextBox:F,onKeyUpTextBox:P,onMouseDownTextBox:g,onTextBoxValueChange:H}}const Z="FarrisVue_PopoverInstancesKey";function Ye(n,t,e,l){const i=o.ref(),a=o.ref(!1),{judgeCanOpen:s}=ye(n,l);o.watch(()=>i.value,(m,p)=>{window[Z]=window[Z]||new WeakMap,m?window[Z].set(e.value,m):window[Z].delete(e.value)});function r(){if(window[Z]){const m=window[Z];document.querySelectorAll(".f-button-edit,.v-popover").forEach(p=>{const b=m.get(p);b&&p!==e.value&&!e.value.closest(".popover-fitcontent")&&b.hide()})}}function d(){const m=i.value;m&&m.show(e.value)}async function c(m=!1){if(!!t.slots.default){if(!m&&!a.value&&!await s())return;a.value=!a.value,a.value&&(await o.nextTick(),d())}}async function f(m=!1){if(!!t.slots.default){if(!m&&!await s())return;a.value=!0,await o.nextTick(),d()}}function u(){a.value=!1}function h(){a.value=!0,o.nextTick(()=>{d()})}return{hidePopup:u,showPopup:h,popup:f,shouldPopupContent:a,togglePopup:c,popoverRef:i,closeAllPopover:r}}function Je(n,t,e){const l=o.ref(),{isTextBoxReadonly:i,textBoxClass:a,textBoxPlaceholder:s,textBoxTitle:r,onBlurTextBox:d,onClickTextBox:c,onFocusTextBox:f,onInput:u,onKeyDownTextBox:h,onKeyUpTextBox:m,onMouseDownTextBox:p,onTextBoxValueChange:b}=e,V=o.ref(n.id),{uuid:I}=j.useGuid(),x=o.computed(()=>({}));o.onMounted(()=>{var g,F;n.selectOnCreated&&((g=l.value)==null||g.select()),n.focusOnCreated&&((F=l.value)==null||F.focus({preventScroll:!0})),V.value||(V.value="button-edit_"+I(8)),V.value=V.value+"-textbox"});const k=o.ref(!1),z=g=>{g.preventDefault(),k.value=!0},T=g=>{g.preventDefault(),k.value=!1,u(g)};function E(g){k.value||u(g)}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:r.value,type:n.inputType,value:t.value,onBlur:d,onChange:b,onClick:c,onFocus:f,onInput:E,onKeydown:h,onKeyup:m,onMousedown:p,onCompositionend:T,onCompositionstart:z},null)}function Ze(n,t,e){const l=o.ref(n.separator),i=o.computed(()=>n.readonly||n.disable),{changeTextBoxValue:a,onFocusTextBox:s,onBlurTextBox:r,onClickTextBox:d,textBoxPlaceholder:c}=e,f=o.computed(()=>t.value?t.value.split(l.value).map(p=>({name:p,selectable:!0})):[]);function u(p){a(p.map(b=>b.name).join(l.value),!0)}o.watch(()=>n.separator,p=>{l.value=p});const h=o.ref(!n.disable&&!n.readonly);o.watch([()=>n.disable,()=>n.readonly],([p,b],[V,I])=>{h.value=!p&&!b});function m(p){d(p)}return()=>o.createVNode(we,{tabindex:n.tabIndex,onFocus:s,onBlur:r,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:m},null)}function Qe(n,t,e,l){const{buttonGroupClass:i,onClickButton:a,onMouseEnterButton:s,onMouseLeaveButton:r}=e,{enableClearButton:d,showClearButton:c,onClearValue:f}=l,u=o.ref(),h=ae.debounce(p=>{a(p)},n.buttonBehavior==="Modal"?0:200),m=()=>{t.emit("beforeClearValue")};return{renderButtonGroup:()=>o.createVNode("div",{id:n.id?`${n.id}-button-group`:void 0,class:i.value},[d.value&&o.withDirectives(o.createVNode("span",{class:"input-group-text input-group-clear",onClick:f,onMousedown:m},[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:h,onMouseenter:s,onMouseleave:r},[t.slots.buttonContent()]):n.buttonContent?o.createVNode("span",{class:"input-group-text input-group-append-button",innerHTML:n.buttonContent,ref:u,onClick:p=>h(p),onMouseenter:s,onMouseleave:r},null):null]),buttonHandleElement:u}}function et(n,t,e){const l=o.ref(n.popupMinWidth),{hidePopup:i,popoverRef:a}=e,s=()=>{t.emit("shown")};return()=>o.createVNode(xe,{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,onHidden:i,onShown:s,beforeClose:n.beforeClosePopup,limitContentBySpace:n.limitContentBySpace},{default:()=>{var r,d;return[(d=(r=t.slots).default)==null?void 0:d.call(r)]}})}const tt=o.defineComponent({name:"FButtonEdit",props:Oe,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue","beforeClearValue"],setup(n,t){const e=o.ref(),l=o.ref(n.customClass),i=o.ref(n.modelValue),a=Ye(n,t,e,i),{shouldPopupContent:s,hidePopup:r,showPopup:d,togglePopup:c}=a,f=Ke(n,t,e,a,i),u=o.ref(""),h=_e(n,t,i,u,a),{hasFocusedTextBox:m,commitValue:p,inputGroupClass:b}=h,V=Xe(n,t,i,m,u,h),{onMouseEnterTextBox:I,onMouseLeaveTextBox:x}=V,k=o.ref(!1),z=o.computed(()=>{const D={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!n.wrapText};return l.value&&l.value.split(" ").reduce((U,C)=>(U[C]=!0,U),D),D}),T=o.computed(()=>({overflow:n.wrapText?"hidden":""})),E=o.computed(()=>({}));function g(){if(!n.multiSelect||n.inputType!=="tag"||!e.value)return 0;let D=0;const U=Array.from(e.value.querySelectorAll(".farris-tag-item"));return U&&U.length&&(D=U.map(C=>C.offsetTop).filter(C=>C>20).length),D}const F=o.ref(g());o.onUpdated(()=>{F.value=g()});function P(){return n.multiSelect&&n.inputType==="tag"?()=>o.createVNode(o.Fragment,null,[Ze(n,i,h)(),!!F.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("+"),F.value])])]):Je(n,i,h)}let H=P();o.watch([()=>n.multiSelect,()=>n.inputType],()=>{H=P()});const{renderButtonGroup:w,buttonHandleElement:B}=Qe(n,t,f,V),W=et(n,t,a),K=o.ref(s.value),X={displayText:u,commitValue:p,elementRef:e,hidePopup:r,showPopup:d,popoverRef:a.popoverRef,shouldPopupContent:s,togglePopup:c,openDialog:()=>{B.value&&n.buttonBehavior==="Modal"&&B.value.click()},getModal:()=>{var D;return n.buttonBehavior==="Modal"?(D=f.modalRef.value)==null?void 0:D.value:null},getTextbox:()=>{var D;return(D=e.value)==null?void 0:D.querySelector("input")},forceClosePopup:()=>{K.value=!1,k.value=!0,s.value=!1}};return o.onMounted(()=>{e.value.componentInstance=X,window.onresize=()=>{document.body.click()}}),o.onBeforeUnmount(()=>{var D;window.onresize=null,(D=window[Z])==null||D.delete(e.value)}),t.expose(X),o.watch(()=>s.value,async(D,U)=>{if(k.value){K.value=D,k.value=!1;return}if(!D&&n.beforeClosePopup&&typeof n.beforeClosePopup=="function"){try{const C=await n.beforeClosePopup();K.value=!C,(!C||n.readonly)&&(s.value=!0)}catch(C){console.error("Error in beforeClosePopup:",C),K.value=U,s.value=U}return}K.value=D}),()=>{var D,U;return o.createVNode(o.Fragment,null,[o.createVNode("div",o.mergeProps(t.attrs,{ref:e,class:z.value,id:n.id?n.id:void 0,style:T.value}),[o.createVNode("div",{id:n.id?`${n.id}-input-group`:void 0,class:b.value,style:E.value,onMouseenter:I,onMouseleave:x},[(U=(D=t.slots).precontent)==null?void 0:U.call(D),H(),w()])]),K.value&&W()])}}});function nt(n,t,e){return t}function ot(n,t,e){return t}const it=new Map([["appearance",_.resolveAppearance]]),lt=new Map([]),at={$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:[]},ve={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}},st=_.createPropsResolver(ve,at,lt,ot),rt={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}}},dt=o.defineComponent({name:"FItemCollectionEditorInner",props:rt,emits:["change"],setup(n,t){let e="";const{guid:l}=j.useGuid(),i=new Me.FNotifyService,a=o.ref(n.valueField),s=o.ref(n.nameField),r={editMode:"cell"},d={fitColumns:!0},c=o.ref(),f=n.columns;let u=n.datas;o.watch(()=>[n.datas],()=>{u=n.datas,c.value.updateDataSource(u)});function h(){const E={};return f.forEach(g=>{g.editor&&(g.editor.type==="checkbox"||g.editor.type==="switch")?E[g.field]=!1:E[g.field]=""}),E}function m(){if(n.dynamicMappingKeys){const E="请先填写XXX",g=a.value.trim()?s.value.trim()?"":"枚举名称字段":"枚举值字段";return i.warning({position:"top-center",message:E.replace("XXX",g)}),!1}return!0}function p(E){const g="不允许重复。";if(!m())return!1;if(!E||E.length===0)return n.canEmpty?!0:(i.warning({position:"top-center",message:"请添加值"}),!1);const F=n.requiredFields||[],P="不允许为空";for(const w of E)for(const B of Object.keys(w)){const W=f.find(K=>K.field===B);if(W&&W.editor&&(W.editor.type==="checkbox"||W.editor.type==="switch")){if(F.includes(B)&&(w[B]===null||w[B]===void 0))return i.warning({position:"top-center",message:W.title+P}),!1}else if(F.includes(B)&&(w[B]===void 0||w[B]===""||w[B]===null))return i.warning({position:"top-center",message:W.title+P}),!1}const H=n.uniqueFields||[];for(const w of H){const B=E.map(X=>X[w]),W=new Set(B),K=Array.from(W);if(B.length!==K.length){const X=f.find(D=>D.field===w);return i.warning({position:"top-center",message:X.title+g}),!1}}return!0}function b(){if(n.readonly||!m())return;const E=h(),g=l();u.push({hId:g,...E}),c.value.updateDataSource(u),c.value.selectRowById(g)}function V(){u&&u.length>0&&c.value.selectRowById(u[0].hId)}function I(){if(!e){i.warning({position:"top-center",message:"请先选中行!"});return}u=[...u.filter(g=>g.hId!==e)],c.value.updateDataSource(u),V()}function x(E){if(!E||E.length===0)return E;const g=[];return E.forEach(F=>{const{value:P,name:H,...w}=F,B=Object.assign({},w);B[a.value.trim()]=P,B[s.value.trim()]=H,g.push(B)}),g}function k(){c.value.endEditCell();const E=[];return u.forEach(g=>{const{hId:F,...P}=g,H={};for(const w in P)w.startsWith("_")||(H[w]=P[w]);E.push(H)}),E}function z(){let E=k();return p(E)?(n.dynamicMappingKeys?(E=x(E),t.emit("change",E,void 0,{valueField:a.value.trim(),nameField:s.value.trim()})):t.emit("change",E,void 0,null),!0):!1}t.expose({clickConfirm:z,getItems:k}),o.onMounted(()=>{V()});function T(E){var g;e=(g=E[0])==null?void 0:g.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:()=>b()},[o.createTextVNode("新增")]),o.createVNode("button",{class:"btn f-rt-btn f-btn-ml btn-secondary",onClick:()=>I()},[o.createTextVNode("删除")])]),o.createVNode("div",{class:"f-utils-fill border",style:"margin:0 8px;border-radius:12px;"},[o.createVNode(Ve,{ref:c,showBorder:!0,idField:"hId",columns:f,data:u,editable:!n.readonly,"edit-option":r,columnOption:d,commandOption:n.commandOption,fit:!0,onSelectionChange:T},null)])])}}),ut={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}},ct={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},se=o.defineComponent({name:"Toast",props:ct,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),r=o.computed(()=>!i.value.title&&i.value.message),d=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 z=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,T={"f-icon":!0};return T[z]=!0,T}),f=o.computed(()=>i.value.title||i.value.message),u=o.computed(()=>n.showCloseButton),h=o.computed(()=>!!i.value.buttons||!!t.slots.default),m=o.computed(()=>Y.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function p(x){x.stopPropagation(),x.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function b(x,k){}function V(x){return`f-preten-link ${x.customClass?x.customClass:""}`}o.watch(e,()=>{e.value});const I=()=>{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(k=>o.createVNode("span",{class:V(k),onClick:z=>void 0},[k.text]))),t.slots.default&&t.slots.default()])])};return()=>o.createVNode("div",{class:d.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:p},[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:m.value},null),h.value&&I()]),r.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:m.value,innerHTML:i.value.message},null),o.createVNode("div",{class:"after-toast-title text-right ml-auto"},[I()])]):o.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",style:m.value,innerHTML:i.value.message},null))])])])}}),le=o.defineComponent({name:"Notify",props:ut,emits:["close","empty"],setup(n,t){const e=o.computed(()=>({"farris-notify":!0})),l={left:12,right:12,top:20,bottom:12},i=o.ref(),a=o.ref(n.options),s=o.ref(n.showCloseButton),r=o.computed(()=>n.position||"bottom-right"),d=o.computed(()=>n.timeout!=null?n.timeout:3e3),c=o.computed(()=>{const h=n.bottom?n.bottom:l.bottom,m=n.top?n.top:l.top,p={transition:"all 0.2s ease",left:r.value.indexOf("left")>-1?`${n.left?n.left:l.left}px`:"",right:r.value.indexOf("right")>-1?`${n.right?n.right:l.right}px`:"",top:r.value.indexOf("top")>-1?`${m}px`:"",bottom:r.value.indexOf("bottom")>-1?`${h}px`:""};return r.value.indexOf("center")>-1&&(p.left="50%",p.marginLeft="calc(-24rem / 2)",r.value==="center-center"&&(p.top="50%",p.transform="translate(-50%, -50%)")),p});function f(h){t.emit("close")}d.value&&setTimeout(()=>{f()},d.value),t.expose({closeToast:f,container:i,notifyPosition:r});function u(h,m){f()}return()=>o.createVNode("div",{class:e.value,style:c.value,ref:i},[o.createVNode(se,{options:a.value,showCloseButton:s.value,animate:n.animate,onClose:h=>u(h,a.value)},null)])}});class ft{constructor(){S(this,"notifyRefs",[]);S(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 r=o.ref();function d(){r.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(i,r),s.unmount()},220)}if(i.position.indexOf("top")>-1){const f=e.getNotifyInstances(i.position),u=f[f.length-1];if(u){const h=u.value.container.getBoundingClientRect();i.top=h.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,r)}),()=>o.createVNode(o.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[o.createVNode(le,o.mergeProps({ref:r},i,{onClose:d}),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,r;typeof e=="string"?l=e:e&&(l=e.message||"",i=e.title||"",s=e.position||null,r=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),r!=null&&(c.showCloseButton=r),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 be=Symbol("NOTIFY_SERVICE_TOKEN");le.install=n=>{n.component(le.name,le),n.component(se.name,se);const t=new ft;n.provide(be,t),n.provide("FNotifyService",t)};const pt=o.defineComponent({name:"FItemCollectionEditor",props:ve,components:{},emits:["change"],setup(n,t){const e=o.inject(be),{guid:l}=j.useGuid(),i=o.ref(`共 ${(n.modelValue||[]).length} 项`),a=o.ref(n.valueField),s=o.ref(n.nameField),r=o.ref();function d(){let m=[];return n.dynamicMappingKeys?(m=[],a.value=a.value.trim(),s.value=s.value.trim(),(n.modelValue||[]).forEach(p=>{if(a.value&&s.value){const{[a.value]:b,[s.value]:V,...I}=p,x=I||{};x.value=b,x.name=V,x.hId=l(),m.push(x)}})):(m=ae.cloneDeep(n.modelValue||[]),m.forEach(p=>{p.hId=l()})),m}function c(){let m=[];return n.columns&&n.columns.length>0?m=n.columns:m=[{field:n.valueField,title:"值",dataType:"string"},{field:n.nameField,title:"名称",dataType:"string"}],m}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:m=>!0},{name:"accept",text:"确定",class:"btn btn-primary",handle:async m=>{if(n.beforeSubmit&&typeof n.beforeSubmit=="function"){const b=r.value.getItems();if(!await n.beforeSubmit({notifyService:e,data:b}))return!1}return!!r.value.clickConfirm()}}]};function h(m,p,b){i.value=`共 ${m.length} 项`,t.emit("change",m,p,b)}return o.watch(()=>n.modelValue,m=>{i.value=`共 ${(n.modelValue||[]).length} 项`}),o.onMounted(()=>{}),()=>o.createVNode(tt,{"button-behavior":"Modal","modal-options":u,modelValue:i.value,"onUpdate:modelValue":m=>i.value=m,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":m=>a.value=m,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":m=>s.value=m,readonly:n.readonly},null),[[o.vModelText,s.value]])])])])]),o.createVNode(dt,{ref:r,valueField:a.value,nameField:s.value,requiredFields:n.requiredFields,uniqueFields:n.uniqueFields,dynamicMappingKeys:n.dynamicMappingKeys,readonly:n.readonly,canEmpty:n.canEmpty,datas:d(),columns:c(),onChange:(m,p,b)=>h(m,p,b)},null)])]})}}),mt={$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"]},re=_.createPropsResolver(fe.radioGroupProps,mt,it,nt);te.register=(n,t,e,l)=>{n["radio-group"]=fe,t["radio-group"]=re,n["item-collection-editor"]=pt,t["item-collection-editor"]=st},te.registerDesigner=(n,t,e)=>{n["radio-group"]=te,t["radio-group"]=re};const ht=j.withInstall(te);L.FRadioGroupDesign=te,L.default=ht,L.propsResolver=re,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});