@farris/ui-vue 1.7.4 → 1.7.6
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.
- package/components/avatar/index.esm.js +2 -2
- package/components/avatar/index.umd.cjs +1 -1
- package/components/component/index.esm.js +102 -102
- package/components/component/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4 -2
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +393 -392
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +102 -102
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +2 -2
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/image/index.esm.js +2 -2
- package/components/image/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +4 -2
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +156 -156
- package/components/number-range/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +2 -2
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +1 -1
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +1 -1
- package/components/tree-grid/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +62 -61
- package/designer/data-grid/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +351 -349
- package/designer/farris-designer.all.umd.cjs +4 -4
- package/designer/radio-group/index.esm.js +2 -2
- package/designer/radio-group/index.umd.cjs +1 -1
- package/designer/response-layout-editor/index.esm.js +1 -1
- package/designer/response-layout-editor/index.umd.cjs +1 -1
- package/designer/tabs/index.esm.js +142 -142
- package/designer/tabs/index.umd.cjs +1 -1
- package/designer/time-picker/index.esm.js +2 -2
- package/designer/time-picker/index.umd.cjs +1 -1
- package/designer/tree-grid/index.esm.js +1 -1
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/farris.all.esm.js +2821 -2819
- package/farris.all.umd.cjs +25 -25
- package/package.json +1 -1
- package/types/combo-list/src/property-config/combo-list.property-config.d.ts +2 -14
- package/types/data-view/composition/types.d.ts +1 -1
|
@@ -990,7 +990,7 @@ class Gt extends Wt {
|
|
|
990
990
|
* 获取可选的编辑器类型
|
|
991
991
|
*/
|
|
992
992
|
getAvailableEditorType(e) {
|
|
993
|
-
var l;
|
|
993
|
+
var l, a;
|
|
994
994
|
const o = this.checkCanChangeControlType(e, this.viewModelId);
|
|
995
995
|
if (!o)
|
|
996
996
|
return {
|
|
@@ -1001,7 +1001,7 @@ class Gt extends Wt {
|
|
|
1001
1001
|
}]
|
|
1002
1002
|
};
|
|
1003
1003
|
let i = [];
|
|
1004
|
-
return this.designViewModelField && this.designViewModelField.$type === Be.SimpleField ? i = fe.getEditorTypesByMDataType(this.designViewModelField.type.name, this.designViewModelField.multiLanguage) : this.bindingVarible && (i = fe.getEditorTypesByMDataType(this.bindingVarible.type, this.designViewModelField.multiLanguage)), { canChangeControlType: o, editorTypeList: i };
|
|
1004
|
+
return this.designViewModelField && this.designViewModelField.$type === Be.SimpleField ? i = fe.getEditorTypesByMDataType(this.designViewModelField.type.name, this.designViewModelField.multiLanguage) : this.bindingVarible && (i = fe.getEditorTypesByMDataType(this.bindingVarible.type, !!((a = this.designViewModelField) != null && a.multiLanguage))), { canChangeControlType: o, editorTypeList: i };
|
|
1005
1005
|
}
|
|
1006
1006
|
changeBindingField(e, o, i) {
|
|
1007
1007
|
o.needRefreshEntityTree = !0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(z,$){typeof exports=="object"&&typeof module<"u"?$(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"],$):(z=typeof globalThis<"u"?globalThis:z||self,$(z["radio-group"]={},z.common,z.dynamicResolver,z.FRadioGroup,z.Vue,z.designerCanvas,z.LodashES,z.locale,null,z.FTags,z.FPopover,z.FDataGrid,z.notify))})(this,function(z,$,_,se,o,y,re,J,jt,Te,ke,Be,Ne){"use strict";var Ht=Object.defineProperty;var $t=(z,$,_)=>$ in z?Ht(z,$,{enumerable:!0,configurable:!0,writable:!0,value:_}):z[$]=_;var S=(z,$,_)=>$t(z,typeof $!="symbol"?$+"":$,_);const Pe={...$.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 Oe(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 De(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=""){const f=t.getViewModelById(d);return f?f.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 me{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 g=this.buildRule(r,f,s);i(g)}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 Re{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}=De(this.designerHostService),f=this.getRealTargetType(t),u=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],g={type:"property-editor",propertyTypes:u};return u.map(m=>{switch(m){case"Const":Object.assign(g,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":g.expressionConfig=this.getExpressionOptions(t,f,s||l);break;case"StateMachine":g.stateMachines=c();break;case"Variable":Object.assign(g,{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"&&(g.newVariablePrefix="ext_"+g.newVariablePrefix);break}}),g}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=re.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,g=this.formSchemaUtils.getModule();g.expressions=g.expressions||[];const{expressions:m}=g;let p=m.find(M=>M.target===r);p||(p={target:r,rules:[],targetType:d},m.push(p));const b=p.rules.find(M=>M.type===c);if(b)b.value=f,b.message=u;else{const M={id:a,type:c,value:f,message:u};p.rules.push(M)}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 me(this.formSchemaUtils).getExpressionOptions(t,e,l)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item","drawer-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}createBaseEventProperty(t){const e={};return e[this.viewModelId]={type:"events-editor",editor:{initialData:t,viewSourceHandle:l=>{var i;((i=l.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(l)}}},e}}const ee=class ee{static getEditorTypesByMDataType(t,e=!1,l=""){if(e)return[{key:y.DgControl["language-textbox"].type,value:y.DgControl["language-textbox"].name}];let i=ee.fieldControlTypeMapping[t];if(l==="data-grid-column"&&(i!=null&&i.length)){const a=[y.DgControl["check-group"].type,y.DgControl["radio-group"].type,y.DgControl.image.type,y.DgControl["rich-text-editor"].type];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const t=[];for(const e in ee.fieldControlTypeMapping)ee.fieldControlTypeMapping[e].forEach(l=>{t.find(i=>i.key===l.key&&i.value===l.value)||t.push({key:l.key,value:l.value})});return t}static mappingDomPropAndSchemaProp(t,e){var a;const l=(a=t.editor)==null?void 0:a.type,i=[];return(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&i.push({domField:"title",schemaField:"name"}),i.push({domField:"label",schemaField:"name"}),i.push({domField:"editor.required",schemaField:"require"}),i.push({domField:"editor.readonly",schemaField:"readonly"}),(l===y.DgControl["input-group"].type||l===y.DgControl.textarea.type||l===y.DgControl["number-spinner"].type)&&i.push({domField:"editor.maxLength",schemaField:"type.length"}),l===y.DgControl["number-spinner"].type&&i.push({domField:"editor.precision",schemaField:"type.precision"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"formatter.precision",schemaField:"type.precision"}),(l===y.DgControl["combo-list"].type||l===y.DgControl["radio-group"].type)&&i.push({domField:"editor.data",schemaField:"type.enumValues"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"formatter.data",schemaField:"type.enumValues"}),l===y.DgControl["date-picker"].type&&(i.push({domField:"editor.displayFormat",schemaField:"editor.format"}),i.push({domField:"editor.fieldType",schemaField:"type.name"})),l===y.DgControl["number-spinner"].type&&(i.push({domField:"editor.max",schemaField:"editor.maxValue"}),i.push({domField:"editor.min",schemaField:"editor.minValue"})),l===y.DgControl.lookup.type&&(i.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),i.push({domField:"editor.valueField",schemaField:"editor.valueField"}),i.push({domField:"editor.textField",schemaField:"editor.textField"}),i.push({domField:"editor.displayType",schemaField:"editor.displayType"}),i.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),i.push({domField:"editor.helpId",schemaField:"editor.helpId"})),i.push({domField:"path",schemaField:"bindingPath"}),i.push({domField:"binding.path",schemaField:"bindingField"}),i.push({domField:"binding.fullPath",schemaField:"path"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"field",schemaField:"bindingPath"}),i}};S(ee,"fieldControlTypeMapping",{String:[{key:y.DgControl["input-group"].type,value:y.DgControl["input-group"].name},{key:y.DgControl.lookup.type,value:y.DgControl.lookup.name},{key:y.DgControl.image.type,value:y.DgControl.image.name},{key:y.DgControl["date-picker"].type,value:y.DgControl["date-picker"].name},{key:y.DgControl.switch.type,value:y.DgControl.switch.name},{key:y.DgControl["check-box"].type,value:y.DgControl["check-box"].name},{key:y.DgControl["check-group"].type,value:y.DgControl["check-group"].name},{key:y.DgControl["radio-group"].type,value:y.DgControl["radio-group"].name},{key:y.DgControl["combo-list"].type,value:y.DgControl["combo-list"].name},{key:y.DgControl.textarea.type,value:y.DgControl.textarea.name},{key:y.DgControl["time-picker"].type,value:y.DgControl["time-picker"].name}],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=ee;var ie=(n=>(n.Form="Form",n.Variable="Variable",n))(ie||{});class Le{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 ze(n){let t,e;const l=new Map;let i=[];function a(f,u){const m=f.split(" ").filter(w=>w.startsWith("col-"));if(m.length===0){u.isSupportedClass=!1;return}let p=m.find(w=>/^col-([1-9]|10|11|12)$/.test(w)),b=m.find(w=>/^col-md-([1-9]|10|11|12)$/.test(w)),M=m.find(w=>/^col-xl-([1-9]|10|11|12)$/.test(w)),E=m.find(w=>/^col-el-([1-9]|10|11|12)$/.test(w));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),M=M||"col-xl-"+u.columnInMD,u.columnInLG=parseInt(M.replace("col-xl-",""),10),u.displayWidthInLG=u.columnInLG/3,[1,2,3,4].includes(u.displayWidthInLG)||(u.isSupportedClass=!1),E=E||"col-el-"+u.columnInLG,u.columnInEL=parseInt(E.replace("col-el-",""),10),u.displayWidthInEL=u.columnInEL/2,[1,2,3,4,5,6].includes(u.displayWidthInEL)||(u.isSupportedClass=!1)}function s(f,u,g,m=!1){let p=!1;f.contents.forEach(b=>{if(b.type==="fieldset"){g+=1,s(b,u,g,!0),p=!0;return}p&&(g+=1,p=!1);const M=b.appearance&&b.appearance.class,E=new Le;M?a(M,E):E.isSupportedClass=!1,E.label=b.label||b.id,E.id=b.id,E.group=g,m&&(E.fieldSetId=f.id),e===b.id&&(t=g),l.set(b.id,b),u.push(E)})}function r(f){const u=n.getComponentById(f);if(!u||!u.componentType||!u.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const g=n.selectNode(u,m=>m.type===y.DgControl["response-form"].type);return!g||!g.contents||g.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:g}}function d(f,u){u=u||f.id;const{result:g,message:m,formNode:p}=r(u);if(!g)return{result:g,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 M=i.find(w=>!w.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:M?"customize":"standard"},importData:i}}function c(f,u){u=u;const{result:g,formNode:m}=r(u);if(!g)return"";const p=[];return f.forEach(b=>{var w;const M=l.get(b.id),E=M.appearance&&M.appearance.class;if(E){const H=E.split(" ").filter(D=>!D.startsWith("col-")),F="col-"+b.columnInSM,R="col-md-"+b.columnInMD,h="col-xl-"+b.columnInLG,x="col-el-"+b.columnInEL,N=[F,R,h,x].concat(H);M.appearance.class=N.join(" ")}if(b.fieldSetId){const T=m.contents.find(F=>F.id===b.fieldSetId),H=p.find(F=>F.id===b.fieldSetId);H?(w=H.contents)==null||w.push(M):(p.push(T),T.contents=[M])}else p.push(M)}),m.contents=p,m.id}return{checkCanFindFormNode:r,checkCanOpenLayoutEditor:d,changeFormControlsByResponseLayoutConfig:c,getResonseFormLayoutConfig:s}}class He extends Re{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=ze(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,g){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,g);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!==$.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===$.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 g=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};g.editor||(g.editor={}),g.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,g,!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 g,m;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},l),r=(g=e.binding)!=null&&g.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,g=this.checkIsUniqueColumn(d)?d[0]:null,m=this.checkIsUniqueColumn(c)?c[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:f,uniqueColClassInMD:u,uniqueColClassInLG:g,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===$.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,g){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,g,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 me(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 $e extends He{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)===$.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=i.type.enumValues||[])}}function je(n,t){const e=n.schema;function l(i,a){return new $e(i,t).getPropertyConfig(e,a)}return{getPropsConfig:l}}const te=o.defineComponent({name:"FRadioGroupDesign",props:Pe,emits:["changeValue","update:modelValue"],setup(n,t){const e=o.ref(n.modelValue),{enumData:l,getValue:i,getText:a}=Oe(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=je(c,d),u=y.useDesignerComponent(r,c,f);o.onMounted(()=>{r.value.componentInstance=u});const g=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},[g.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)])])})])}}),Ae={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}},Ue={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object},backgroundColor:{type:String,default:""}},qe=o.defineComponent({name:"FOverlay",props:Ue,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 We(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Ge(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=We(n);return()=>o.createVNode(qe,{"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 Ke{static show(t){return Ge(t)}}const Xe={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"},isMessager:{type:Boolean,default:!1}};class A{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 A(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new A(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 A(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 A(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 A(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 Z{constructor(t,e){this.width=t,this.height=e}static getCurrent(t){const e=new Z(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 Z(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(),g=o.ref(),m=o.ref(n.resizeable),p=o.ref(),b=o.ref(n.draggable),M=o.ref(!1);function E(){const C=l.value||document.body,I=window.getComputedStyle(C);if(!I||!e.value)return;const L=A.getTransformInfo(e.value),O={};d.value&&(O.deltaL=e.value.offsetLeft-d.value.x,O.deltaT=e.value.offsetTop-d.value.y);const W=I.getPropertyValue("position");O.width=C.clientWidth,O.height=C.clientHeight,O.pr=parseInt(I.getPropertyValue("padding-right"),10),O.pb=parseInt(I.getPropertyValue("padding-bottom"),10),O.position=I.getPropertyValue("position"),W==="static"&&(C.style.position="relative"),O.translateX=L.x,O.translateY=L.y,u.value=O}function w(C){if(e.value){a.value=Z.getCurrent(e.value),s.value=A.getCurrent(e.value),r.value=a.value?Z.copy(a.value):null,d.value=s.value?A.copy(s.value):null,E();const I=C.target.getAttribute("type")||"";c.value={n:!!I.match(/n/),s:!!I.match(/s/),w:!!I.match(/w/),e:!!I.match(/e/)}}}function T(){var C,I,L,O;if(e.value){const W=e.value;c.value&&((c.value.n||c.value.s)&&((C=r.value)!=null&&C.height)&&(W.style.height=r.value.height+"px"),(c.value.w||c.value.e)&&((I=r.value)!=null&&I.width)&&(W.style.width=r.value.width+"px"),d.value&&((L=d.value)!=null&&L.x&&(W.style.left=d.value.x+"px"),(O=d.value)!=null&&O.y&&(W.style.top=d.value.y+"px")))}}function H(){const C=n.minHeight?n.minHeight:1,I=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<I&&(r.value.width=I,c.value.w&&s.value&&(d.value.x=s.value.x+(a.value.width-I))),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 F(){if(l.value){const C=u.value;if(d.value&&r.value&&c.value&&a.value){const I=C.width-C.pr-C.deltaL-C.translateX-d.value.x,L=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>I&&(r.value.width=I),r.value.height>L&&(r.value.height=L)}}}function R(C){if(!i.value||!a.value||!s.value||!c.value)return;C.subtract(i.value);const I=C.x,L=C.y;c.value.n?(d.value.y=s.value.y+L,r.value.height=a.value.height-L):c.value.s&&(r.value.height=a.value.height+L),c.value.e?r.value.width=a.value.width+I:c.value.w&&(r.value.width=a.value.width-I,d.value.x=s.value.x+I),F(),H(),T()}function h(C){if(!f.value)return;const I=A.fromEvent(C);I&&R(I)}function x(){if(e.value){const{width:C,height:I,x:L,y:O}=e.value.getBoundingClientRect(),W=A.getTransformInfo(e.value);return{size:{width:C,height:I},position:{x:L-W.x,y:O-W.y}}}return null}function N(C){if(e.value){const I=x();g.value=I}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",h),document.removeEventListener("mouseup",N)}function D(){document.addEventListener("mousemove",h),document.addEventListener("mouseup",N)}function V(C){C instanceof MouseEvent&&C.button===2||b.value&&(document.body.click(),C.stopPropagation(),C.preventDefault(),i.value=A.fromEvent(C),f.value=C.target,w(C),D())}function k(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:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:I=>V(I)},null)])}function j(C=!0){document.body.click();const I=l.value||document.body,L=Z.getCurrent(I),O=e.value;C&&O&&(p.value=x(),p.value.transform=O.style.transform),L&&O&&(r.value=L,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="",g.value={size:r.value,position:{x:0,y:0}},b.value=!1,M.value=!0)}function U(){var C,I;if(document.body.click(),p.value){const L={width:p.value.size.width||0,height:p.value.size.height||0},O={x:(window.innerWidth-L.width)/2,y:(window.innerHeight-L.height)/2};(C=r.value)==null||C.set(L),(I=d.value)==null||I.set(O);const W=e.value;W.style.height=L.height+"px",W.style.width=L.width+"px",W.style.left=`${O.x}px`,W.style.top=`${O.y}px`,W.style.transform="",g.value={size:L,position:O},b.value=n.draggable,M.value=!1}}function X(){if(e.value){const C=Z.getCurrent(e.value);if(C){const{width:I,height:L}=C;e.value.style.left=`${(window.innerWidth-I)/2}px`,e.value.style.top=`${(window.innerHeight-L)/2}px`,e.value.style.transform=""}}}function P(){const C=()=>{M.value?j(!1):X(),document.body.click()};return window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}}const q=P();return{renderResizeBar:k,boundingElement:l,resizedEventParam:g,maximize:j,restore:U,allowDrag:b,isMaximized:M,unWindowResizeHandle:q,moveToCenter:X}}function Ye(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 A(0,0)),f=o.ref(new A(0,0)),u=o.ref(new A(0,0)),g=o.ref(new A(0,0));o.watch(()=>e.value,h=>{s.value.style.cursor=h?"move":"default"});function m(h,x){if(x.tagName==="BUTTON")return!1;if(x===h)return!0;for(const N in x.children)if(Object.prototype.hasOwnProperty.call(x.children,N)&&m(h,x.children[N]))return!0;return!1}function p(){var D,V;let h=u.value.x+f.value.x,x=u.value.y+f.value.y;a.value==="x"?(h=((D=c.value)==null?void 0:D.x)||0,u.value.x=0):a.value==="y"&&(x=((V=c.value)==null?void 0:V.y)||0,u.value.y=0);const N=`translate3d(${Math.round(h)}px, ${Math.round(x)}px, 0px)`;l.value&&(l.value.style.transform=N),g.value.x=h,g.value.y=x}function b(){if(!r.value||!l.value)return null;const h=r.value.getBoundingClientRect(),x=l.value.getBoundingClientRect(),N={top:h.top<x.top,right:h.right>x.right,bottom:h.bottom>x.bottom,left:h.left<x.left};return N.top||(u.value.y-=x.top-h.top),N.bottom||(u.value.y-=x.bottom-h.bottom),N.right||(u.value.x-=x.right-h.right),N.left||(u.value.x-=x.left-h.left),p(),N}function M(h){h&&(c.value&&h.subtract(c.value),u.value.set(h),p(),b())}function E(h){d.value&&i.value&&(h.stopPropagation(),h.preventDefault(),M(A.fromEvent(h,s.value)))}function w(){var h;d.value&&(d.value=!1,f.value.add(u.value),u.value.reset(),(h=l.value)==null||h.classList.remove("ng-dragging"),t.emit("stopMove"),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",w))}function T(){!d.value&&s.value&&(d.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",E),document.addEventListener("mouseup",w))}function H(){if(l.value){const h=A.getTransformInfo(l.value);f.value.set(h);return}f.value.reset()}function F(h){if(!e.value||h instanceof MouseEvent&&h.button===2)return;const x=h.target||h.srcElement;s.value!==void 0&&x&&!m(x,s.value)||i.value!==!1&&(document.body.click(),h.stopPropagation(),h.preventDefault(),c.value=A.fromEvent(h,l.value),H(),T())}function R(h,x,N){if(i.value&&x){if(h)s.value=h;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const D=x.querySelector(n.dragHandle);D&&(s.value=D)}}l.value=x,r.value=N,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",F)):i.value=!1}}return{registerDraggle:R,resetTranslate:H}}function he(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 Je(n,t){const e=o.ref(n.enableEsc);let l=null;return e.value?(l=he("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:l}):null}function Ze(n,t){const e=o.ref(n.enableEnter);let l=null;return e.value?(l=he("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:l}):null}const ne=o.defineComponent({name:"FModal",props:Xe,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),g=o.ref(!1),m=o.ref(n.dialogType),p=o.ref(n.src),b=o.ref(""),M=o.ref(n.showButtons),E=o.ref(n.title),w=o.ref(n.containment||null),T=o.ref();E.value==="错误提示"&&(E.value=J.LocaleService.getLocaleValue("messageBox.errorTitle"));const H=o.ref(!1);function F(v,B){const K=B?"accept":"cancel";Promise.resolve().then(()=>{var G;return(G=n.beforeClose)==null?void 0:G.call(n,{closeType:K})}).then(G=>{G&&(i.value=!1,t.emit("update:modelValue",!1),B!=null&&t.emit(B?"accept":"cancel"),t.emit("closed",v))})}const R=[{name:"cancel",text:J.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:v=>{F(v,!1)}},{name:"accept",text:J.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:v=>{F(v,!0)}}],h=o.ref(n.buttons&&n.buttons.length?n.buttons:R),x=o.computed(()=>!!c.value),N=o.computed(()=>!!M.value&&!!h.value),D=o.ref(),V=o.ref(),k=o.ref(!1),{renderResizeBar:j,maximize:U,restore:X,boundingElement:P,resizedEventParam:q,allowDrag:C,unWindowResizeHandle:I,moveToCenter:L}=_e(n),{registerDraggle:O}=Ye(n,t,C);function W(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function bt(){const v=document.querySelectorAll(".farris-modal").length;(!v||v-1<=0)&&document.body.classList.remove("modal-open"),T.value&&T.value.classList.remove("show")}o.watch(()=>n.title,(v,B)=>{v!==B&&(E.value=v)}),o.watch(()=>n.modelValue,(v,B)=>{v!==B&&(i.value=v,i.value&&n.draggable&&o.nextTick(()=>{V.value&&!w.value&&(w.value=V.value.parentElement,P.value=w.value,O(D.value,V.value,P.value),L())}),v||(w.value&&(w.value=null),bt())),i.value?H.value=W():(k.value=!1,C.value=n.draggable)}),o.watch(()=>n.showHeader,(v,B)=>{v!==B&&(d.value=v)}),o.watch(()=>n.showButtons,(v,B)=>{v!==B&&(M.value=v)}),o.watch(()=>q.value,(v,B)=>{const K=v||{},G=B||{};JSON.stringify(K)!==JSON.stringify(G)&&t.emit("resize",{newSize:v,oldSize:B,isMaximized:k.value})}),o.watch([()=>n.width,()=>n.height],(v,B)=>{(v[0]!==B[0]||v[1]!==B[1])&&(e.value=v[0]||500,l.value=v[1]||600)}),o.watch(()=>n.class,(v,B)=>{s.value=v});const ae=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),Ct=o.computed(()=>{var K;const v={modal:!0,"farris-modal":!0,fade:!0};v["f-modal-fitContent"]=!!r.value,v.show=!!ae.value;const B=(K=n.maskClass)==null?void 0:K.split(" ");return B==null||B.reduce((G,Y)=>(G[Y]=!0,G),v),v}),wt=o.computed(()=>{var K;const v={"modal-dialog":!0},B=(K=s.value)==null?void 0:K.split(" ");return B==null||B.reduce((G,Y)=>(G[Y]=!0,G),v),v}),Ee=()=>$.isMobilePhone()&&!n.isMessager,xt=o.computed(()=>{const v=document.documentElement.clientWidth,B=document.documentElement.clientHeight,K=Math.min(e.value,v),G=r.value?"auto":`${Math.min(l.value,B-10)}px`,Y={position:"absolute",top:`${(window.innerHeight-parseInt(G==="auto"?"0":G))/2}px`,left:`${(window.innerWidth-K)/2}px`,width:`${K}px`,height:G};return Ee()&&(Y.top="0px",Y.left="0px",Y.width=`${window.innerWidth}px`,Y.height=`${window.innerHeight}px`),n.mask||(Y.pointerEvents="auto"),Y}),Fe=o.ref($.getMaxZIndex()||1050),Vt=o.computed(()=>{const v={display:"block",overflow:"hidden"};return n.mask||(v.pointerEvents="none",v.backgroundColor="transparent"),H.value&&(v.backgroundColor="transparent"),v.zIndex=Fe.value,v}),Mt=o.computed(()=>({"modal-content":!0,"modal-content-has-header":d.value,"is-mobile":Ee()})),It=o.computed(()=>{const v={display:d.value?"":"none"};return v["pointer-events"]=C.value?"auto":"none",v}),Et=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:k.value})),Ft=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":m.value==="iframe","f-utils-fill":!0}));function St(){return{height:`${n.footerHeight||60}px`}}const Tt=o.computed(()=>{const v={textAlgin:b.value},B=St();return Object.assign(v,B)});function Se(v){if(v==null||v.stopPropagation(),k.value){k.value=!1,X();return}U(),k.value=!0}async function kt(v,B){v.handle&&await v.handle(B,v)&&t.emit("closed",B)}function Bt(v){v.width&&(e.value=v.width),v.height&&(l.value=v.height),v.buttons&&(h.value=v.buttons),v.title&&(E.value=v.title)}let fe=null,pe=null;o.onBeforeMount(()=>{H.value=W()}),o.onMounted(()=>{V.value&&!w.value&&(w.value=V.value.parentElement,P.value=w.value,O(D.value,V.value,P.value)),ae.value&&document.body.classList.add("modal-open"),fe=Je(n,t),pe=Ze(n,t)}),o.onUnmounted(()=>{I&&I(),fe&&fe.remove(),pe&&pe.remove()}),t.expose({modalElementRef:V,updateModalOptions:Bt,close:F,maxDialog:Se,isMaximized:k});function Nt(){return o.createVNode("ul",null,[g.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:Se,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:Et.value},null)]),f.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:v=>F(v,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function Pt(){return o.createVNode("div",{class:"modal-footer",style:Tt.value},[h.value&&h.value.map(v=>{const B=o.ref(v.disabled);return o.createVNode("button",{name:v.name,type:"button",disabled:B.value,class:v.class+(v.iconClass?" btn-icontext":""),onClick:K=>{kt(v,K)}},[!!v.iconClass&&o.createVNode("i",{class:v.iconClass},null),v.text])})])}function Ot(){return o.createVNode("div",{ref:D,class:"modal-header",style:It.value},[t.slots.headerTemplate?t.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[x.value&&o.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[E.value])]),o.createVNode("div",{class:"actions"},[Nt()])])}function Dt(){return t.slots.footerTemplate?t.slots.footerTemplate():N.value&&Pt()}function Rt(v){if(v.stopPropagation(),n.allowClickMaskToClose){if(v.target!==T.value)return;F(v,!1)}}function Lt(){var v,B;return o.createVNode("div",{id:a.value,class:wt.value,style:xt.value,ref:V},[o.createVNode("div",{class:Mt.value},[d.value&&Ot(),o.createVNode("div",{class:Ft.value},[(B=(v=t.slots).default)==null?void 0:B.call(v),m.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),Dt()]),!r.value&&V.value&&!k.value&&j(V.value)])}function zt(v){return v||"body"}return o.watchEffect(()=>{ae.value&&(Fe.value=$.getMaxZIndex()||1050)}),()=>o.createVNode(o.Teleport,{to:zt(n.host)},{default:()=>[ae.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:T,class:Ct.value,style:Vt.value,onClick:Rt},[Lt()])]})]})}});function ge(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Qe(n){const t=document.createElement("div");t.style.display="contents";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||""),g=n.acceptCallback||(()=>{}),m=n.rejectCallback||(()=>{}),p=n.closedCallback||(T=>{}),b=n.resizeHandle||(T=>{}),M=n.stopMoveHandle||(T=>{}),E=ge(n),w=T=>{f.value=!1,e.unmount(),p(T)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(ne,{ref:a,class:s.value,modelValue:f.value,"onUpdate:modelValue":T=>f.value=T,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:g,onCancel:m,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:w,onResize:b,onStopMove:M},{default:()=>[E&&E(e)]})}});return document.body.appendChild(t),e.use(J.LocaleService.i18n),e.mount(t),e}class et{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 Qe(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||((F,R)=>{}),d=l.value.resizeHandle||(F=>{}),c=t.stopMoveHandle||(F=>{});let f;const u=ge(l.value),g=F=>{var h;i.value=!1;const R=(h=F==null?void 0:F.target)==null?void 0:h.classList.contains("modal_close");r(F,this.isUseEscCloseModal.value?"esc":R?"icon":"button")},m=F=>{g(F),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 R=Object.keys(this.modalRefs).map(h=>Number(h));R.length>0?this.activeModalIndex.value=Math.max(...R):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=F=>{var R;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((R=this.activeModalInstance.value)==null||R.close(F==null?void 0:F.event))},{width:b,height:M}=l.value,E=this.adaptToWindow(b||500,M||320);Object.assign(l.value,E);const w=()=>o.createVNode(ne,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":F=>i.value=F},l.value,{isMessager:l.value.class&&l.value.class.indexOf("modal-message")>-1,onAccept:a,onCancel:s,onClosed:m,onResize:d,onEsc:p,onStopMove:c}),{default:()=>[u&&u(this.app)]});return f=(F=>{const R=o.h(w,F);return R.appContext=this.appContext,o.render(R,e),R})({...l.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:F=>{l.value={...l.value,...F},f&&o.render(o.cloneVNode(f,{...l}),e)},destroy:m,modalRef:this.activeModalInstance,close:()=>this.close()}}}const ye=Symbol("FModalService");ne.install=n=>{n.component(ne.name,ne);const t=new et(n);n.provide(ye,t),n.provide("FModalService",t)};function ve(n,t){function e(){const l=n.beforeOpen||n.beforeClickButton||null;let i=Promise.resolve(!0);if(l){const a=l(t.value);if(typeof a>"u")return i;typeof a=="boolean"?i=Promise.resolve(a):i=a}return i}return{judgeCanOpen:e}}function tt(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}=ve(n,i),c=o.computed(()=>n.showButtonWhenDisabled||(!n.editable||!n.readonly)&&!n.disable),f=o.inject(ye,null),u=o.ref();async function g(b){if(await d()&&c.value){const M=!!t.slots.default;if(a.value==="Modal"){const E=n.modalOptions,w=f==null?void 0:f.open({...E,render:()=>t.slots.default&&t.slots.default()});u.value=w==null?void 0:w.modalRef}a.value==="Overlay"&&Ke.show({host:document.body,backgroundColor:"rgba(0,0,0,.15)",render:()=>t.slots.default&&t.slots.default()}),M&&a.value==="Popup"&&l.togglePopup(!0),M&&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:g,onMouseEnterButton:m,onMouseLeaveButton:p,modalRef:u}}function nt(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,M=!n.editable;p.stopPropagation(),(b||M)&&(d(""),i.value="",f(!s.value),t.emit("clear"))}function g(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:g,onMouseLeaveTextBox:m}}function ot(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),g=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})),M=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 E(V,k=!0){e.value=V,k&&(t.emit("change",V),t.emit("update:modelValue",V))}function w(V){r.value=!1,E(V,!0)}o.watch(()=>n.modelValue,V=>{e.value=V});function T(V){m.value=!1,t.emit("blur",V),V.stopPropagation()}function H(V){t.emit("click",V),d(),t.slots.default&&!n.disable&&!n.readonly&&n.popupOnClick&&i.togglePopup()}function F(V){!n.disable&&!n.readonly&&(m.value=!0,g.value||(t.emit("focus",V),s.value&&!r.value&&i.popup()))}function R(V){t.emit("input",V);const k=V.target.value;l.value=k,e.value!==k&&E(k,n.updateOn==="change"),a.value&&!r.value&&i.popup()}function h(V){V.target.tagName!=="INPUT"&&V.preventDefault(),V.stopPropagation()}function x(V){t.emit("keydown",V)}function N(V){V.key==="Enter"&&(a.value||s.value)&&i.hidePopup(),t.emit("keyup",V)}function D(V){const k=V.target.value;V.stopPropagation(),E(k)}return{hasFocusedTextBox:p,isTextBoxReadonly:g,textBoxClass:b,textBoxPlaceholder:u,textBoxTitle:f,inputGroupClass:M,hasClearClass:c,changeTextBoxValue:E,commitValue:w,onBlurTextBox:T,onClickTextBox:H,onFocusTextBox:F,onInput:R,onKeyDownTextBox:x,onKeyUpTextBox:N,onMouseDownTextBox:h,onTextBoxValueChange:D}}const Q="FarrisVue_PopoverInstancesKey";function it(n,t,e,l){const i=o.ref(),a=o.ref(!1),{judgeCanOpen:s}=ve(n,l);o.watch(()=>i.value,(m,p)=>{window[Q]=window[Q]||new WeakMap,m?window[Q].set(e.value,m):window[Q].delete(e.value)});function r(){if(window[Q]){const m=window[Q];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 g(){a.value=!0,o.nextTick(()=>{d()})}return{hidePopup:u,showPopup:g,popup:f,shouldPopupContent:a,togglePopup:c,popoverRef:i,closeAllPopover:r}}function lt(n,t,e){const l=o.ref(),{isTextBoxReadonly:i,textBoxClass:a,textBoxPlaceholder:s,textBoxTitle:r,onBlurTextBox:d,onClickTextBox:c,onFocusTextBox:f,onInput:u,onKeyDownTextBox:g,onKeyUpTextBox:m,onMouseDownTextBox:p,onTextBoxValueChange:b}=e,M=o.ref(n.id),{uuid:E}=$.useGuid(),w=o.computed(()=>({}));o.onMounted(()=>{var h,x;n.selectOnCreated&&((h=l.value)==null||h.select()),n.focusOnCreated&&((x=l.value)==null||x.focus({preventScroll:!0})),M.value||(M.value="button-edit_"+E(8)),M.value=M.value+"-textbox"});const T=o.ref(!1),H=h=>{h.preventDefault(),T.value=!0},F=h=>{h.preventDefault(),T.value=!1,u(h)};function R(h){T.value||u(h)}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:w.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:R,onKeydown:g,onKeyup:m,onMousedown:p,onCompositionend:F,onCompositionstart:H},null)}function at(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 g=o.ref(!n.disable&&!n.readonly);o.watch([()=>n.disable,()=>n.readonly],([p,b],[M,E])=>{g.value=!p&&!b});function m(p){d(p)}return()=>o.createVNode(Te,{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 st(n,t,e,l){const{buttonGroupClass:i,onClickButton:a,onMouseEnterButton:s,onMouseLeaveButton:r}=e,{enableClearButton:d,showClearButton:c,onClearValue:f}=l,u=o.ref(),g=re.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:g,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=>g(p),onMouseenter:s,onMouseleave:r},null):null]),buttonHandleElement:u}}function rt(n,t,e){const l=o.ref(n.popupMinWidth),{hidePopup:i,popoverRef:a}=e,s=()=>{t.emit("shown")};return()=>o.createVNode(ke,{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 dt=o.defineComponent({name:"FButtonEdit",props:Ae,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=it(n,t,e,i),{shouldPopupContent:s,hidePopup:r,showPopup:d,togglePopup:c}=a,f=tt(n,t,e,a,i),u=o.ref(""),g=ot(n,t,i,u,a),{hasFocusedTextBox:m,commitValue:p,inputGroupClass:b}=g,M=nt(n,t,i,m,u,g),{onMouseEnterTextBox:E,onMouseLeaveTextBox:w}=M,T=o.ref(!1),H=o.computed(()=>{const P={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!n.wrapText};return l.value&&l.value.split(" ").reduce((q,C)=>(q[C]=!0,q),P),P}),F=o.computed(()=>({overflow:n.wrapText?"hidden":""})),R=o.computed(()=>({}));function h(){if(!n.multiSelect||n.inputType!=="tag"||!e.value)return 0;let P=0;const q=Array.from(e.value.querySelectorAll(".farris-tag-item"));return q&&q.length&&(P=q.map(C=>C.offsetTop).filter(C=>C>20).length),P}const x=o.ref(h());o.onUpdated(()=>{x.value=h()});function N(){return n.multiSelect&&n.inputType==="tag"?()=>o.createVNode(o.Fragment,null,[at(n,i,g)(),!!x.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("+"),x.value])])]):lt(n,i,g)}let D=N();o.watch([()=>n.multiSelect,()=>n.inputType],()=>{D=N()});const{renderButtonGroup:V,buttonHandleElement:k}=st(n,t,f,M),j=rt(n,t,a),U=o.ref(s.value),X={displayText:u,commitValue:p,elementRef:e,hidePopup:r,showPopup:d,popoverRef:a.popoverRef,shouldPopupContent:s,togglePopup:c,openDialog:()=>{k.value&&n.buttonBehavior==="Modal"&&k.value.click()},getModal:()=>{var P;return n.buttonBehavior==="Modal"?(P=f.modalRef.value)==null?void 0:P.value:null},getTextbox:()=>{var P;return(P=e.value)==null?void 0:P.querySelector("input")},forceClosePopup:()=>{U.value=!1,T.value=!0,s.value=!1}};return o.onMounted(()=>{e.value.componentInstance=X,window.onresize=()=>{document.body.click()}}),o.onBeforeUnmount(()=>{var P;window.onresize=null,(P=window[Q])==null||P.delete(e.value)}),t.expose(X),o.watch(()=>s.value,async(P,q)=>{if(T.value){U.value=P,T.value=!1;return}if(!P&&n.beforeClosePopup&&typeof n.beforeClosePopup=="function"){try{const C=await n.beforeClosePopup();U.value=!C,(!C||n.readonly)&&(s.value=!0)}catch(C){console.error("Error in beforeClosePopup:",C),U.value=q,s.value=q}return}U.value=P}),()=>{var P,q;return o.createVNode(o.Fragment,null,[o.createVNode("div",o.mergeProps(t.attrs,{ref:e,class:H.value,id:n.id?n.id:void 0,style:F.value}),[o.createVNode("div",{id:n.id?`${n.id}-input-group`:void 0,class:b.value,style:R.value,onMouseenter:E,onMouseleave:w},[(q=(P=t.slots).precontent)==null?void 0:q.call(P),D(),V()])]),U.value&&j()])}}});function be(n,t,e){return t}function Ce(n,t,e){return t}const we=new Map([["appearance",_.resolveAppearance]]),xe=new Map([]),Ve={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-group.schema.json",title:"item-collection-editor",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a item-collection-editor",type:"string"},type:{description:"The type string of item-collection-editor component",type:"string",default:"item-collection-editor"},requiredFields:{description:"",type:"array",default:[]},uniqueFields:{description:"",type:"array",default:[]},dynamicMappingKeys:{type:"boolean",default:!1},columns:{description:"",type:"array",default:[]},modalTitle:{description:"",type:"string",default:""},canEmpty:{description:"",type:"boolean",default:!0},valueField:{description:"",type:"string",default:"value"},nameField:{description:"",type:"string",default:"name"},idField:{description:"",type:"string",default:"value"},readonly:{description:"",type:"boolean",default:!1},modelValue:{description:"",type:"string",default:""},beforeSubmit:{description:"",type:"object",default:null},title:{description:"",type:"string",default:"项编辑器"},modalWidth:{description:"",type:"number",default:900},modalHeight:{description:"",type:"number",default:600}},required:["id","type"],ignore:[]},de={requiredFields:{type:Array,default:[]},uniqueFields:{type:Array,default:[]},dynamicMappingKeys:{type:Boolean,default:!1},columns:{type:Array,default:[]},modalTitle:{type:String,default:"项编辑器"},canEmpty:{type:Boolean,default:!0},valueField:{type:String,default:"value"},nameField:{type:String,default:"name"},idField:{type:String,default:"value"},readonly:{type:Boolean,default:!1},modelValue:{type:Array,default:[]},beforeSubmit:{type:Function,default:null},title:{type:String,default:"项编辑器"},modalWidth:{type:Number,default:900},modalHeight:{type:Number,default:600}};_.createPropsResolver(de,Ve,xe,Ce);const ut=_.getPropsResolverGenerator(de,Ve,xe,Ce),ct={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}}},ft=o.defineComponent({name:"FItemCollectionEditorInner",props:ct,emits:["change"],setup(n,t){let e="";const{guid:l}=$.useGuid(),i=new Ne.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 g(){const h={};return f.forEach(x=>{x.editor&&(x.editor.type==="checkbox"||x.editor.type==="switch")?h[x.field]=!1:h[x.field]=""}),h}function m(){if(n.dynamicMappingKeys){const h="请先填写XXX。",x=a.value.trim()?s.value.trim()?"":"枚举名称字段":"枚举值字段";return i.warning({position:"top-center",message:h.replace("XXX",x)}),!1}return!0}function p(h){const x="不允许重复。";if(!m())return!1;if(!h||h.length===0)return n.canEmpty?!0:(i.warning({position:"top-center",message:"请添加值。"}),!1);const N=n.requiredFields||[],D="不允许为空。";for(const k of h)for(const j of Object.keys(k)){const U=f.find(X=>X.field===j);if(U&&U.editor&&(U.editor.type==="checkbox"||U.editor.type==="switch")){if(N.includes(j)&&(k[j]===null||k[j]===void 0))return i.warning({position:"top-center",message:U.title+D}),!1}else if(N.includes(j)&&(k[j]===void 0||k[j]===""||k[j]===null))return i.warning({position:"top-center",message:U.title+D}),!1}const V=n.uniqueFields||[];for(const k of V){const j=h.map(P=>P[k]),U=new Set(j),X=Array.from(U);if(j.length!==X.length){const P=f.find(q=>q.field===k);return i.warning({position:"top-center",message:P.title+x}),!1}}return!0}function b(){if(n.readonly||!m())return;const h=g(),x=l();u.push({hId:x,...h}),c.value.updateDataSource(u),c.value.selectRowById(x)}function M(h){u&&u.length>0?(h||(h=u[0].hId),c.value.selectRowById(h)):e=""}function E(){if(!e){i.warning({position:"top-center",message:"请先选中行!"});return}const h=u.findIndex(D=>D.hId===e);u=[...u.filter(D=>D.hId!==e)],c.value.updateDataSource(u);let N="";h<u.length&&u.length>0&&(N=u[h].hId),M(N)}function w(h){if(!h||h.length===0)return h;const x=[];return h.forEach(N=>{const{value:D,name:V,...k}=N,j=Object.assign({},k);j[a.value.trim()]=D,j[s.value.trim()]=V,x.push(j)}),x}function T(){c.value.endEditCell();const h=[];return u.forEach(x=>{const{hId:N,...D}=x,V={};for(const k in D)k.startsWith("_")||(V[k]=D[k]);h.push(V)}),h}function H(){let h=T();return p(h)?(n.dynamicMappingKeys?(h=w(h),t.emit("change",h,void 0,{valueField:a.value.trim(),nameField:s.value.trim()})):t.emit("change",h,void 0,null),!0):!1}function F(){return u}t.expose({clickConfirm:H,getItems:T,getDataGridDatas:F}),o.onMounted(()=>{M()});function R(h){var x;e=(x=h[0])==null?void 0:x.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:()=>E()},[o.createTextVNode("删除")])]),o.createVNode("div",{class:"f-utils-fill border",style:"margin:0 8px;border-radius:12px;"},[o.createVNode(Be,{ref:c,showBorder:!0,idField:"hId",columns:f,data:u,editable:!n.readonly,"edit-option":r,columnOption:d,commandOption:n.commandOption,fit:!0,onSelectionChange:R},null)])])}}),pt={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}},mt={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},ue=o.defineComponent({name:"Toast",props:mt,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 w={animated:a.value,toast:!0,"toast--only-content":!s.value};return w[n.animate]=!1,w[l]=a.value,w["toasty-type-"+i.value.type]=!0,i.value.theme&&(w[i.value.theme]=!0),w}),c=o.computed(()=>{const H=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,F={"f-icon":!0};return F[H]=!0,F}),f=o.computed(()=>i.value.title||i.value.message),u=o.computed(()=>n.showCloseButton),g=o.computed(()=>!!i.value.buttons||!!t.slots.default),m=o.computed(()=>J.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function p(w){w.stopPropagation(),w.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function b(w,T){}function M(w){return`f-preten-link ${w.customClass?w.customClass:""}`}o.watch(e,()=>{e.value});const E=()=>{var w;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((w=i.value.buttons)==null?void 0:w.map(T=>o.createVNode("span",{class:M(T),onClick:H=>void 0},[T.text]))),t.slots.default&&t.slots.default()])])};return()=>o.createVNode("div",{class:d.value,style:"min-height:44px"},[u.value&&o.createVNode("button",{title:J.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),g.value&&E()]),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"},[E()])]):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:pt,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 g=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?`${g}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(g){t.emit("close")}d.value&&setTimeout(()=>{f()},d.value),t.expose({closeToast:f,container:i,notifyPosition:r});function u(g,m){f()}return()=>o.createVNode("div",{class:e.value,style:c.value,ref:i},[o.createVNode(ue,{options:a.value,showCloseButton:s.value,animate:n.animate,onClose:g=>u(g,a.value)},null)])}});class ht{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," ").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 g=u.value.container.getBoundingClientRect();i.top=g.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(J.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 Me=Symbol("NOTIFY_SERVICE_TOKEN");le.install=n=>{n.component(le.name,le),n.component(ue.name,ue);const t=new ht;n.provide(Me,t),n.provide("FNotifyService",t)};const gt=o.defineComponent({name:"FItemCollectionEditor",props:de,components:{},emits:["change"],setup(n,t){const e=o.inject(Me),{guid:l}=$.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]:M,...E}=p,w=E||{};w.value=b,w.name=M,w.hId=l(),m.push(w)}})):(m=re.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 g(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(dt,{"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(ft,{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)=>g(m,p,b)},null)])]})}}),Ie={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-group.schema.json",title:"radio-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a radio-group",type:"string"},type:{description:"The type string of radio-group component",type:"string",default:"radio-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0},textField:{description:"",type:"string",default:"name"},valueField:{description:"",type:"string",default:"value"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},bindDataSource:{description:"",type:"string",default:""},direction:{description:"",type:"string",default:"horizontal"},onChange:{description:"值变化事件",type:"string"}},required:["type"],ignore:["id","appearance","binding","visible"]},yt=_.createPropsResolver(se.radioGroupProps,Ie,we,be),ce=_.getPropsResolverGenerator(se.radioGroupProps,Ie,we,be);te.register=(n,t,e,l,i)=>{n["radio-group"]=se,t["radio-group"]=ce(i),n["item-collection-editor"]=gt,t["item-collection-editor"]=ut(i)},te.registerDesigner=(n,t,e,l)=>{n["radio-group"]=te,t["radio-group"]=ce(l)};const vt=$.withInstall(te);z.FRadioGroupDesign=te,z.default=vt,z.propsResolver=yt,z.propsResolverGenerator=ce,Object.defineProperties(z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(z,$){typeof exports=="object"&&typeof module<"u"?$(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"],$):(z=typeof globalThis<"u"?globalThis:z||self,$(z["radio-group"]={},z.common,z.dynamicResolver,z.FRadioGroup,z.Vue,z.designerCanvas,z.LodashES,z.locale,null,z.FTags,z.FPopover,z.FDataGrid,z.notify))})(this,function(z,$,_,se,o,y,re,J,jt,Te,ke,Be,Ne){"use strict";var Ht=Object.defineProperty;var $t=(z,$,_)=>$ in z?Ht(z,$,{enumerable:!0,configurable:!0,writable:!0,value:_}):z[$]=_;var S=(z,$,_)=>$t(z,typeof $!="symbol"?$+"":$,_);const Pe={...$.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 Oe(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 De(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=""){const f=t.getViewModelById(d);return f?f.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 me{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 g=this.buildRule(r,f,s);i(g)}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 Re{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}=De(this.designerHostService),f=this.getRealTargetType(t),u=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],g={type:"property-editor",propertyTypes:u};return u.map(m=>{switch(m){case"Const":Object.assign(g,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},i);break;case"Expression":g.expressionConfig=this.getExpressionOptions(t,f,s||l);break;case"StateMachine":g.stateMachines=c();break;case"Variable":Object.assign(g,{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"&&(g.newVariablePrefix="ext_"+g.newVariablePrefix);break}}),g}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=re.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,g=this.formSchemaUtils.getModule();g.expressions=g.expressions||[];const{expressions:m}=g;let p=m.find(M=>M.target===r);p||(p={target:r,rules:[],targetType:d},m.push(p));const b=p.rules.find(M=>M.type===c);if(b)b.value=f,b.message=u;else{const M={id:a,type:c,value:f,message:u};p.rules.push(M)}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 me(this.formSchemaUtils).getExpressionOptions(t,e,l)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item","drawer-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}createBaseEventProperty(t){const e={};return e[this.viewModelId]={type:"events-editor",editor:{initialData:t,viewSourceHandle:l=>{var i;((i=l.controller)==null?void 0:i.label.indexOf(this.formSchemaUtils.getModule().code))>-1&&this.eventsEditorUtils.jumpToMethod(l)}}},e}}const ee=class ee{static getEditorTypesByMDataType(t,e=!1,l=""){if(e)return[{key:y.DgControl["language-textbox"].type,value:y.DgControl["language-textbox"].name}];let i=ee.fieldControlTypeMapping[t];if(l==="data-grid-column"&&(i!=null&&i.length)){const a=[y.DgControl["check-group"].type,y.DgControl["radio-group"].type,y.DgControl.image.type,y.DgControl["rich-text-editor"].type];i=i.filter(s=>!a.includes(s.key))}return i}static getAllInputTypes(){const t=[];for(const e in ee.fieldControlTypeMapping)ee.fieldControlTypeMapping[e].forEach(l=>{t.find(i=>i.key===l.key&&i.value===l.value)||t.push({key:l.key,value:l.value})});return t}static mappingDomPropAndSchemaProp(t,e){var a;const l=(a=t.editor)==null?void 0:a.type,i=[];return(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&i.push({domField:"title",schemaField:"name"}),i.push({domField:"label",schemaField:"name"}),i.push({domField:"editor.required",schemaField:"require"}),i.push({domField:"editor.readonly",schemaField:"readonly"}),(l===y.DgControl["input-group"].type||l===y.DgControl.textarea.type||l===y.DgControl["number-spinner"].type)&&i.push({domField:"editor.maxLength",schemaField:"type.length"}),l===y.DgControl["number-spinner"].type&&i.push({domField:"editor.precision",schemaField:"type.precision"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"formatter.precision",schemaField:"type.precision"}),(l===y.DgControl["combo-list"].type||l===y.DgControl["radio-group"].type)&&i.push({domField:"editor.data",schemaField:"type.enumValues"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"formatter.data",schemaField:"type.enumValues"}),l===y.DgControl["date-picker"].type&&(i.push({domField:"editor.displayFormat",schemaField:"editor.format"}),i.push({domField:"editor.fieldType",schemaField:"type.name"})),l===y.DgControl["number-spinner"].type&&(i.push({domField:"editor.max",schemaField:"editor.maxValue"}),i.push({domField:"editor.min",schemaField:"editor.minValue"})),l===y.DgControl.lookup.type&&(i.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),i.push({domField:"editor.valueField",schemaField:"editor.valueField"}),i.push({domField:"editor.textField",schemaField:"editor.textField"}),i.push({domField:"editor.displayType",schemaField:"editor.displayType"}),i.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),i.push({domField:"editor.helpId",schemaField:"editor.helpId"})),i.push({domField:"path",schemaField:"bindingPath"}),i.push({domField:"binding.path",schemaField:"bindingField"}),i.push({domField:"binding.fullPath",schemaField:"path"}),(t.type===y.DgControl["data-grid-column"].type||t.type===y.DgControl["tree-grid-column"].type)&&i.push({domField:"field",schemaField:"bindingPath"}),i}};S(ee,"fieldControlTypeMapping",{String:[{key:y.DgControl["input-group"].type,value:y.DgControl["input-group"].name},{key:y.DgControl.lookup.type,value:y.DgControl.lookup.name},{key:y.DgControl.image.type,value:y.DgControl.image.name},{key:y.DgControl["date-picker"].type,value:y.DgControl["date-picker"].name},{key:y.DgControl.switch.type,value:y.DgControl.switch.name},{key:y.DgControl["check-box"].type,value:y.DgControl["check-box"].name},{key:y.DgControl["check-group"].type,value:y.DgControl["check-group"].name},{key:y.DgControl["radio-group"].type,value:y.DgControl["radio-group"].name},{key:y.DgControl["combo-list"].type,value:y.DgControl["combo-list"].name},{key:y.DgControl.textarea.type,value:y.DgControl.textarea.name},{key:y.DgControl["time-picker"].type,value:y.DgControl["time-picker"].name}],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=ee;var ie=(n=>(n.Form="Form",n.Variable="Variable",n))(ie||{});class Le{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 ze(n){let t,e;const l=new Map;let i=[];function a(f,u){const m=f.split(" ").filter(w=>w.startsWith("col-"));if(m.length===0){u.isSupportedClass=!1;return}let p=m.find(w=>/^col-([1-9]|10|11|12)$/.test(w)),b=m.find(w=>/^col-md-([1-9]|10|11|12)$/.test(w)),M=m.find(w=>/^col-xl-([1-9]|10|11|12)$/.test(w)),E=m.find(w=>/^col-el-([1-9]|10|11|12)$/.test(w));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),M=M||"col-xl-"+u.columnInMD,u.columnInLG=parseInt(M.replace("col-xl-",""),10),u.displayWidthInLG=u.columnInLG/3,[1,2,3,4].includes(u.displayWidthInLG)||(u.isSupportedClass=!1),E=E||"col-el-"+u.columnInLG,u.columnInEL=parseInt(E.replace("col-el-",""),10),u.displayWidthInEL=u.columnInEL/2,[1,2,3,4,5,6].includes(u.displayWidthInEL)||(u.isSupportedClass=!1)}function s(f,u,g,m=!1){let p=!1;f.contents.forEach(b=>{if(b.type==="fieldset"){g+=1,s(b,u,g,!0),p=!0;return}p&&(g+=1,p=!1);const M=b.appearance&&b.appearance.class,E=new Le;M?a(M,E):E.isSupportedClass=!1,E.label=b.label||b.id,E.id=b.id,E.group=g,m&&(E.fieldSetId=f.id),e===b.id&&(t=g),l.set(b.id,b),u.push(E)})}function r(f){const u=n.getComponentById(f);if(!u||!u.componentType||!u.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const g=n.selectNode(u,m=>m.type===y.DgControl["response-form"].type);return!g||!g.contents||g.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:g}}function d(f,u){u=u||f.id;const{result:g,message:m,formNode:p}=r(u);if(!g)return{result:g,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 M=i.find(w=>!w.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:M?"customize":"standard"},importData:i}}function c(f,u){u=u;const{result:g,formNode:m}=r(u);if(!g)return"";const p=[];return f.forEach(b=>{var w;const M=l.get(b.id),E=M.appearance&&M.appearance.class;if(E){const H=E.split(" ").filter(D=>!D.startsWith("col-")),F="col-"+b.columnInSM,R="col-md-"+b.columnInMD,h="col-xl-"+b.columnInLG,x="col-el-"+b.columnInEL,N=[F,R,h,x].concat(H);M.appearance.class=N.join(" ")}if(b.fieldSetId){const T=m.contents.find(F=>F.id===b.fieldSetId),H=p.find(F=>F.id===b.fieldSetId);H?(w=H.contents)==null||w.push(M):(p.push(T),T.contents=[M])}else p.push(M)}),m.contents=p,m.id}return{checkCanFindFormNode:r,checkCanOpenLayoutEditor:d,changeFormControlsByResponseLayoutConfig:c,getResonseFormLayoutConfig:s}}class He extends Re{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=ze(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,g){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,g);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!==$.FormSchemaEntityField$Type.SimpleField)return!1;return!0}getAvailableEditorType(e){var a,s;const l=this.checkCanChangeControlType(e,this.viewModelId);if(!l)return{canChangeControlType:!1,editorTypeList:[{key:e.editor.type,value:((a=y.DgControl[e.editor.type])==null?void 0:a.name)||e.editor.type}]};let i=[];return this.designViewModelField&&this.designViewModelField.$type===$.FormSchemaEntityField$Type.SimpleField?i=oe.getEditorTypesByMDataType(this.designViewModelField.type.name,this.designViewModelField.multiLanguage):this.bindingVarible&&(i=oe.getEditorTypesByMDataType(this.bindingVarible.type,!!((s=this.designViewModelField)!=null&&s.multiLanguage))),{canChangeControlType:l,editorTypeList:i}}changeBindingField(e,l,i){l.needRefreshEntityTree=!0}getAppearanceProperties(e,l){const i=this;return{title:"外观",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},style:{title:"style样式",type:"string",description:"组件的内联样式",$converter:"/converter/appearance.converter",parentPropertyID:"appearance"},fill:{title:"填充宽度",description:"启用后,控件占满父容器宽度",type:"boolean",parentPropertyID:"appearance"},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 g=this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find(p=>p.id===this.designViewModelField.id).fieldSchema||{};g.editor||(g.editor={}),g.editor.$type=a,this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,g,!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 g,m;const s=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter",parentPropertyID:"editor"},l),r=(g=e.binding)!=null&&g.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,g=this.checkIsUniqueColumn(d)?d[0]:null,m=this.checkIsUniqueColumn(c)?c[0]:null;Object.assign(i.unifiedLayout,{uniqueColClassInSM:f,uniqueColClassInMD:u,uniqueColClassInLG:g,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===$.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,g){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,g,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 me(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 $e extends He{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)===$.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=i.type.enumValues||[])}}function je(n,t){const e=n.schema;function l(i,a){return new $e(i,t).getPropertyConfig(e,a)}return{getPropsConfig:l}}const te=o.defineComponent({name:"FRadioGroupDesign",props:Pe,emits:["changeValue","update:modelValue"],setup(n,t){const e=o.ref(n.modelValue),{enumData:l,getValue:i,getText:a}=Oe(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=je(c,d),u=y.useDesignerComponent(r,c,f);o.onMounted(()=>{r.value.componentInstance=u});const g=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},[g.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)])])})])}}),Ae={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}},Ue={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object},backgroundColor:{type:String,default:""}},qe=o.defineComponent({name:"FOverlay",props:Ue,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 We(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Ge(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=We(n);return()=>o.createVNode(qe,{"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 Ke{static show(t){return Ge(t)}}const Xe={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"},isMessager:{type:Boolean,default:!1}};class A{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 A(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new A(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 A(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 A(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 A(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 Z{constructor(t,e){this.width=t,this.height=e}static getCurrent(t){const e=new Z(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 Z(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(),g=o.ref(),m=o.ref(n.resizeable),p=o.ref(),b=o.ref(n.draggable),M=o.ref(!1);function E(){const C=l.value||document.body,I=window.getComputedStyle(C);if(!I||!e.value)return;const L=A.getTransformInfo(e.value),O={};d.value&&(O.deltaL=e.value.offsetLeft-d.value.x,O.deltaT=e.value.offsetTop-d.value.y);const W=I.getPropertyValue("position");O.width=C.clientWidth,O.height=C.clientHeight,O.pr=parseInt(I.getPropertyValue("padding-right"),10),O.pb=parseInt(I.getPropertyValue("padding-bottom"),10),O.position=I.getPropertyValue("position"),W==="static"&&(C.style.position="relative"),O.translateX=L.x,O.translateY=L.y,u.value=O}function w(C){if(e.value){a.value=Z.getCurrent(e.value),s.value=A.getCurrent(e.value),r.value=a.value?Z.copy(a.value):null,d.value=s.value?A.copy(s.value):null,E();const I=C.target.getAttribute("type")||"";c.value={n:!!I.match(/n/),s:!!I.match(/s/),w:!!I.match(/w/),e:!!I.match(/e/)}}}function T(){var C,I,L,O;if(e.value){const W=e.value;c.value&&((c.value.n||c.value.s)&&((C=r.value)!=null&&C.height)&&(W.style.height=r.value.height+"px"),(c.value.w||c.value.e)&&((I=r.value)!=null&&I.width)&&(W.style.width=r.value.width+"px"),d.value&&((L=d.value)!=null&&L.x&&(W.style.left=d.value.x+"px"),(O=d.value)!=null&&O.y&&(W.style.top=d.value.y+"px")))}}function H(){const C=n.minHeight?n.minHeight:1,I=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<I&&(r.value.width=I,c.value.w&&s.value&&(d.value.x=s.value.x+(a.value.width-I))),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 F(){if(l.value){const C=u.value;if(d.value&&r.value&&c.value&&a.value){const I=C.width-C.pr-C.deltaL-C.translateX-d.value.x,L=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>I&&(r.value.width=I),r.value.height>L&&(r.value.height=L)}}}function R(C){if(!i.value||!a.value||!s.value||!c.value)return;C.subtract(i.value);const I=C.x,L=C.y;c.value.n?(d.value.y=s.value.y+L,r.value.height=a.value.height-L):c.value.s&&(r.value.height=a.value.height+L),c.value.e?r.value.width=a.value.width+I:c.value.w&&(r.value.width=a.value.width-I,d.value.x=s.value.x+I),F(),H(),T()}function h(C){if(!f.value)return;const I=A.fromEvent(C);I&&R(I)}function x(){if(e.value){const{width:C,height:I,x:L,y:O}=e.value.getBoundingClientRect(),W=A.getTransformInfo(e.value);return{size:{width:C,height:I},position:{x:L-W.x,y:O-W.y}}}return null}function N(C){if(e.value){const I=x();g.value=I}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",h),document.removeEventListener("mouseup",N)}function D(){document.addEventListener("mousemove",h),document.addEventListener("mouseup",N)}function V(C){C instanceof MouseEvent&&C.button===2||b.value&&(document.body.click(),C.stopPropagation(),C.preventDefault(),i.value=A.fromEvent(C),f.value=C.target,w(C),D())}function k(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:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:I=>V(I)},null),o.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:I=>V(I)},null)])}function j(C=!0){document.body.click();const I=l.value||document.body,L=Z.getCurrent(I),O=e.value;C&&O&&(p.value=x(),p.value.transform=O.style.transform),L&&O&&(r.value=L,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="",g.value={size:r.value,position:{x:0,y:0}},b.value=!1,M.value=!0)}function U(){var C,I;if(document.body.click(),p.value){const L={width:p.value.size.width||0,height:p.value.size.height||0},O={x:(window.innerWidth-L.width)/2,y:(window.innerHeight-L.height)/2};(C=r.value)==null||C.set(L),(I=d.value)==null||I.set(O);const W=e.value;W.style.height=L.height+"px",W.style.width=L.width+"px",W.style.left=`${O.x}px`,W.style.top=`${O.y}px`,W.style.transform="",g.value={size:L,position:O},b.value=n.draggable,M.value=!1}}function X(){if(e.value){const C=Z.getCurrent(e.value);if(C){const{width:I,height:L}=C;e.value.style.left=`${(window.innerWidth-I)/2}px`,e.value.style.top=`${(window.innerHeight-L)/2}px`,e.value.style.transform=""}}}function P(){const C=()=>{M.value?j(!1):X(),document.body.click()};return window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}}const q=P();return{renderResizeBar:k,boundingElement:l,resizedEventParam:g,maximize:j,restore:U,allowDrag:b,isMaximized:M,unWindowResizeHandle:q,moveToCenter:X}}function Ye(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 A(0,0)),f=o.ref(new A(0,0)),u=o.ref(new A(0,0)),g=o.ref(new A(0,0));o.watch(()=>e.value,h=>{s.value.style.cursor=h?"move":"default"});function m(h,x){if(x.tagName==="BUTTON")return!1;if(x===h)return!0;for(const N in x.children)if(Object.prototype.hasOwnProperty.call(x.children,N)&&m(h,x.children[N]))return!0;return!1}function p(){var D,V;let h=u.value.x+f.value.x,x=u.value.y+f.value.y;a.value==="x"?(h=((D=c.value)==null?void 0:D.x)||0,u.value.x=0):a.value==="y"&&(x=((V=c.value)==null?void 0:V.y)||0,u.value.y=0);const N=`translate3d(${Math.round(h)}px, ${Math.round(x)}px, 0px)`;l.value&&(l.value.style.transform=N),g.value.x=h,g.value.y=x}function b(){if(!r.value||!l.value)return null;const h=r.value.getBoundingClientRect(),x=l.value.getBoundingClientRect(),N={top:h.top<x.top,right:h.right>x.right,bottom:h.bottom>x.bottom,left:h.left<x.left};return N.top||(u.value.y-=x.top-h.top),N.bottom||(u.value.y-=x.bottom-h.bottom),N.right||(u.value.x-=x.right-h.right),N.left||(u.value.x-=x.left-h.left),p(),N}function M(h){h&&(c.value&&h.subtract(c.value),u.value.set(h),p(),b())}function E(h){d.value&&i.value&&(h.stopPropagation(),h.preventDefault(),M(A.fromEvent(h,s.value)))}function w(){var h;d.value&&(d.value=!1,f.value.add(u.value),u.value.reset(),(h=l.value)==null||h.classList.remove("ng-dragging"),t.emit("stopMove"),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",w))}function T(){!d.value&&s.value&&(d.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",E),document.addEventListener("mouseup",w))}function H(){if(l.value){const h=A.getTransformInfo(l.value);f.value.set(h);return}f.value.reset()}function F(h){if(!e.value||h instanceof MouseEvent&&h.button===2)return;const x=h.target||h.srcElement;s.value!==void 0&&x&&!m(x,s.value)||i.value!==!1&&(document.body.click(),h.stopPropagation(),h.preventDefault(),c.value=A.fromEvent(h,l.value),H(),T())}function R(h,x,N){if(i.value&&x){if(h)s.value=h;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const D=x.querySelector(n.dragHandle);D&&(s.value=D)}}l.value=x,r.value=N,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",F)):i.value=!1}}return{registerDraggle:R,resetTranslate:H}}function he(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 Je(n,t){const e=o.ref(n.enableEsc);let l=null;return e.value?(l=he("Escape",i=>{t.emit("esc",{event:i.event,type:"esc"})}),{remove:l}):null}function Ze(n,t){const e=o.ref(n.enableEnter);let l=null;return e.value?(l=he("Enter",i=>{t.emit("enter",{event:i.event,type:"enter"})}),{remove:l}):null}const ne=o.defineComponent({name:"FModal",props:Xe,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),g=o.ref(!1),m=o.ref(n.dialogType),p=o.ref(n.src),b=o.ref(""),M=o.ref(n.showButtons),E=o.ref(n.title),w=o.ref(n.containment||null),T=o.ref();E.value==="错误提示"&&(E.value=J.LocaleService.getLocaleValue("messageBox.errorTitle"));const H=o.ref(!1);function F(v,B){const K=B?"accept":"cancel";Promise.resolve().then(()=>{var G;return(G=n.beforeClose)==null?void 0:G.call(n,{closeType:K})}).then(G=>{G&&(i.value=!1,t.emit("update:modelValue",!1),B!=null&&t.emit(B?"accept":"cancel"),t.emit("closed",v))})}const R=[{name:"cancel",text:J.LocaleService.getLocaleValue("messageBox.cancel")||"取消",class:"btn btn-secondary",handle:v=>{F(v,!1)}},{name:"accept",text:J.LocaleService.getLocaleValue("messageBox.ok")||"确定",class:"btn btn-primary",handle:v=>{F(v,!0)}}],h=o.ref(n.buttons&&n.buttons.length?n.buttons:R),x=o.computed(()=>!!c.value),N=o.computed(()=>!!M.value&&!!h.value),D=o.ref(),V=o.ref(),k=o.ref(!1),{renderResizeBar:j,maximize:U,restore:X,boundingElement:P,resizedEventParam:q,allowDrag:C,unWindowResizeHandle:I,moveToCenter:L}=_e(n),{registerDraggle:O}=Ye(n,t,C);function W(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function bt(){const v=document.querySelectorAll(".farris-modal").length;(!v||v-1<=0)&&document.body.classList.remove("modal-open"),T.value&&T.value.classList.remove("show")}o.watch(()=>n.title,(v,B)=>{v!==B&&(E.value=v)}),o.watch(()=>n.modelValue,(v,B)=>{v!==B&&(i.value=v,i.value&&n.draggable&&o.nextTick(()=>{V.value&&!w.value&&(w.value=V.value.parentElement,P.value=w.value,O(D.value,V.value,P.value),L())}),v||(w.value&&(w.value=null),bt())),i.value?H.value=W():(k.value=!1,C.value=n.draggable)}),o.watch(()=>n.showHeader,(v,B)=>{v!==B&&(d.value=v)}),o.watch(()=>n.showButtons,(v,B)=>{v!==B&&(M.value=v)}),o.watch(()=>q.value,(v,B)=>{const K=v||{},G=B||{};JSON.stringify(K)!==JSON.stringify(G)&&t.emit("resize",{newSize:v,oldSize:B,isMaximized:k.value})}),o.watch([()=>n.width,()=>n.height],(v,B)=>{(v[0]!==B[0]||v[1]!==B[1])&&(e.value=v[0]||500,l.value=v[1]||600)}),o.watch(()=>n.class,(v,B)=>{s.value=v});const ae=o.computed(()=>(i.value&&document.body.classList.add("modal-open"),i.value)),Ct=o.computed(()=>{var K;const v={modal:!0,"farris-modal":!0,fade:!0};v["f-modal-fitContent"]=!!r.value,v.show=!!ae.value;const B=(K=n.maskClass)==null?void 0:K.split(" ");return B==null||B.reduce((G,Y)=>(G[Y]=!0,G),v),v}),wt=o.computed(()=>{var K;const v={"modal-dialog":!0},B=(K=s.value)==null?void 0:K.split(" ");return B==null||B.reduce((G,Y)=>(G[Y]=!0,G),v),v}),Ee=()=>$.isMobilePhone()&&!n.isMessager,xt=o.computed(()=>{const v=document.documentElement.clientWidth,B=document.documentElement.clientHeight,K=Math.min(e.value,v),G=r.value?"auto":`${Math.min(l.value,B-10)}px`,Y={position:"absolute",top:`${(window.innerHeight-parseInt(G==="auto"?"0":G))/2}px`,left:`${(window.innerWidth-K)/2}px`,width:`${K}px`,height:G};return Ee()&&(Y.top="0px",Y.left="0px",Y.width=`${window.innerWidth}px`,Y.height=`${window.innerHeight}px`),n.mask||(Y.pointerEvents="auto"),Y}),Fe=o.ref($.getMaxZIndex()||1050),Vt=o.computed(()=>{const v={display:"block",overflow:"hidden"};return n.mask||(v.pointerEvents="none",v.backgroundColor="transparent"),H.value&&(v.backgroundColor="transparent"),v.zIndex=Fe.value,v}),Mt=o.computed(()=>({"modal-content":!0,"modal-content-has-header":d.value,"is-mobile":Ee()})),It=o.computed(()=>{const v={display:d.value?"":"none"};return v["pointer-events"]=C.value?"auto":"none",v}),Et=o.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:k.value})),Ft=o.computed(()=>({"modal-body":!0,"f-utils-flex-column":m.value==="iframe","f-utils-fill":!0}));function St(){return{height:`${n.footerHeight||60}px`}}const Tt=o.computed(()=>{const v={textAlgin:b.value},B=St();return Object.assign(v,B)});function Se(v){if(v==null||v.stopPropagation(),k.value){k.value=!1,X();return}U(),k.value=!0}async function kt(v,B){v.handle&&await v.handle(B,v)&&t.emit("closed",B)}function Bt(v){v.width&&(e.value=v.width),v.height&&(l.value=v.height),v.buttons&&(h.value=v.buttons),v.title&&(E.value=v.title)}let fe=null,pe=null;o.onBeforeMount(()=>{H.value=W()}),o.onMounted(()=>{V.value&&!w.value&&(w.value=V.value.parentElement,P.value=w.value,O(D.value,V.value,P.value)),ae.value&&document.body.classList.add("modal-open"),fe=Je(n,t),pe=Ze(n,t)}),o.onUnmounted(()=>{I&&I(),fe&&fe.remove(),pe&&pe.remove()}),t.expose({modalElementRef:V,updateModalOptions:Bt,close:F,maxDialog:Se,isMaximized:k});function Nt(){return o.createVNode("ul",null,[g.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:Se,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[o.createVNode("span",{class:Et.value},null)]),f.value&&o.createVNode("li",{class:"f-btn-icon f-bare",onClick:v=>F(v,!1),style:"pointer-events: auto;"},[o.createVNode("span",{class:"f-icon modal_close"},null)])])}function Pt(){return o.createVNode("div",{class:"modal-footer",style:Tt.value},[h.value&&h.value.map(v=>{const B=o.ref(v.disabled);return o.createVNode("button",{name:v.name,type:"button",disabled:B.value,class:v.class+(v.iconClass?" btn-icontext":""),onClick:K=>{kt(v,K)}},[!!v.iconClass&&o.createVNode("i",{class:v.iconClass},null),v.text])})])}function Ot(){return o.createVNode("div",{ref:D,class:"modal-header",style:It.value},[t.slots.headerTemplate?t.slots.headerTemplate():o.createVNode("div",{class:"modal-title"},[x.value&&o.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),o.createVNode("span",{class:"modal-title-label"},[E.value])]),o.createVNode("div",{class:"actions"},[Nt()])])}function Dt(){return t.slots.footerTemplate?t.slots.footerTemplate():N.value&&Pt()}function Rt(v){if(v.stopPropagation(),n.allowClickMaskToClose){if(v.target!==T.value)return;F(v,!1)}}function Lt(){var v,B;return o.createVNode("div",{id:a.value,class:wt.value,style:xt.value,ref:V},[o.createVNode("div",{class:Mt.value},[d.value&&Ot(),o.createVNode("div",{class:Ft.value},[(B=(v=t.slots).default)==null?void 0:B.call(v),m.value==="iframe"&&o.createVNode("iframe",{title:a.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:p.value},null)]),Dt()]),!r.value&&V.value&&!k.value&&j(V.value)])}function zt(v){return v||"body"}return o.watchEffect(()=>{ae.value&&(Fe.value=$.getMaxZIndex()||1050)}),()=>o.createVNode(o.Teleport,{to:zt(n.host)},{default:()=>[ae.value&&o.createVNode(o.Transition,{name:"fade",appear:!0},{default:()=>[o.createVNode("div",{ref:T,class:Ct.value,style:Vt.value,onClick:Rt},[Lt()])]})]})}});function ge(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function Qe(n){const t=document.createElement("div");t.style.display="contents";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||""),g=n.acceptCallback||(()=>{}),m=n.rejectCallback||(()=>{}),p=n.closedCallback||(T=>{}),b=n.resizeHandle||(T=>{}),M=n.stopMoveHandle||(T=>{}),E=ge(n),w=T=>{f.value=!1,e.unmount(),p(T)};return o.onMounted(()=>{}),i.expose({modalRef:a}),()=>o.createVNode(ne,{ref:a,class:s.value,modelValue:f.value,"onUpdate:modelValue":T=>f.value=T,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:g,onCancel:m,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:w,onResize:b,onStopMove:M},{default:()=>[E&&E(e)]})}});return document.body.appendChild(t),e.use(J.LocaleService.i18n),e.mount(t),e}class et{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 Qe(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||((F,R)=>{}),d=l.value.resizeHandle||(F=>{}),c=t.stopMoveHandle||(F=>{});let f;const u=ge(l.value),g=F=>{var h;i.value=!1;const R=(h=F==null?void 0:F.target)==null?void 0:h.classList.contains("modal_close");r(F,this.isUseEscCloseModal.value?"esc":R?"icon":"button")},m=F=>{g(F),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 R=Object.keys(this.modalRefs).map(h=>Number(h));R.length>0?this.activeModalIndex.value=Math.max(...R):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},p=F=>{var R;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((R=this.activeModalInstance.value)==null||R.close(F==null?void 0:F.event))},{width:b,height:M}=l.value,E=this.adaptToWindow(b||500,M||320);Object.assign(l.value,E);const w=()=>o.createVNode(ne,o.mergeProps({ref:this.modalRef,modelValue:i.value,"onUpdate:modelValue":F=>i.value=F},l.value,{isMessager:l.value.class&&l.value.class.indexOf("modal-message")>-1,onAccept:a,onCancel:s,onClosed:m,onResize:d,onEsc:p,onStopMove:c}),{default:()=>[u&&u(this.app)]});return f=(F=>{const R=o.h(w,F);return R.appContext=this.appContext,o.render(R,e),R})({...l.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:F=>{l.value={...l.value,...F},f&&o.render(o.cloneVNode(f,{...l}),e)},destroy:m,modalRef:this.activeModalInstance,close:()=>this.close()}}}const ye=Symbol("FModalService");ne.install=n=>{n.component(ne.name,ne);const t=new et(n);n.provide(ye,t),n.provide("FModalService",t)};function ve(n,t){function e(){const l=n.beforeOpen||n.beforeClickButton||null;let i=Promise.resolve(!0);if(l){const a=l(t.value);if(typeof a>"u")return i;typeof a=="boolean"?i=Promise.resolve(a):i=a}return i}return{judgeCanOpen:e}}function tt(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}=ve(n,i),c=o.computed(()=>n.showButtonWhenDisabled||(!n.editable||!n.readonly)&&!n.disable),f=o.inject(ye,null),u=o.ref();async function g(b){if(await d()&&c.value){const M=!!t.slots.default;if(a.value==="Modal"){const E=n.modalOptions,w=f==null?void 0:f.open({...E,render:()=>t.slots.default&&t.slots.default()});u.value=w==null?void 0:w.modalRef}a.value==="Overlay"&&Ke.show({host:document.body,backgroundColor:"rgba(0,0,0,.15)",render:()=>t.slots.default&&t.slots.default()}),M&&a.value==="Popup"&&l.togglePopup(!0),M&&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:g,onMouseEnterButton:m,onMouseLeaveButton:p,modalRef:u}}function nt(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,M=!n.editable;p.stopPropagation(),(b||M)&&(d(""),i.value="",f(!s.value),t.emit("clear"))}function g(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:g,onMouseLeaveTextBox:m}}function ot(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),g=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})),M=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 E(V,k=!0){e.value=V,k&&(t.emit("change",V),t.emit("update:modelValue",V))}function w(V){r.value=!1,E(V,!0)}o.watch(()=>n.modelValue,V=>{e.value=V});function T(V){m.value=!1,t.emit("blur",V),V.stopPropagation()}function H(V){t.emit("click",V),d(),t.slots.default&&!n.disable&&!n.readonly&&n.popupOnClick&&i.togglePopup()}function F(V){!n.disable&&!n.readonly&&(m.value=!0,g.value||(t.emit("focus",V),s.value&&!r.value&&i.popup()))}function R(V){t.emit("input",V);const k=V.target.value;l.value=k,e.value!==k&&E(k,n.updateOn==="change"),a.value&&!r.value&&i.popup()}function h(V){V.target.tagName!=="INPUT"&&V.preventDefault(),V.stopPropagation()}function x(V){t.emit("keydown",V)}function N(V){V.key==="Enter"&&(a.value||s.value)&&i.hidePopup(),t.emit("keyup",V)}function D(V){const k=V.target.value;V.stopPropagation(),E(k)}return{hasFocusedTextBox:p,isTextBoxReadonly:g,textBoxClass:b,textBoxPlaceholder:u,textBoxTitle:f,inputGroupClass:M,hasClearClass:c,changeTextBoxValue:E,commitValue:w,onBlurTextBox:T,onClickTextBox:H,onFocusTextBox:F,onInput:R,onKeyDownTextBox:x,onKeyUpTextBox:N,onMouseDownTextBox:h,onTextBoxValueChange:D}}const Q="FarrisVue_PopoverInstancesKey";function it(n,t,e,l){const i=o.ref(),a=o.ref(!1),{judgeCanOpen:s}=ve(n,l);o.watch(()=>i.value,(m,p)=>{window[Q]=window[Q]||new WeakMap,m?window[Q].set(e.value,m):window[Q].delete(e.value)});function r(){if(window[Q]){const m=window[Q];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 g(){a.value=!0,o.nextTick(()=>{d()})}return{hidePopup:u,showPopup:g,popup:f,shouldPopupContent:a,togglePopup:c,popoverRef:i,closeAllPopover:r}}function lt(n,t,e){const l=o.ref(),{isTextBoxReadonly:i,textBoxClass:a,textBoxPlaceholder:s,textBoxTitle:r,onBlurTextBox:d,onClickTextBox:c,onFocusTextBox:f,onInput:u,onKeyDownTextBox:g,onKeyUpTextBox:m,onMouseDownTextBox:p,onTextBoxValueChange:b}=e,M=o.ref(n.id),{uuid:E}=$.useGuid(),w=o.computed(()=>({}));o.onMounted(()=>{var h,x;n.selectOnCreated&&((h=l.value)==null||h.select()),n.focusOnCreated&&((x=l.value)==null||x.focus({preventScroll:!0})),M.value||(M.value="button-edit_"+E(8)),M.value=M.value+"-textbox"});const T=o.ref(!1),H=h=>{h.preventDefault(),T.value=!0},F=h=>{h.preventDefault(),T.value=!1,u(h)};function R(h){T.value||u(h)}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:w.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:R,onKeydown:g,onKeyup:m,onMousedown:p,onCompositionend:F,onCompositionstart:H},null)}function at(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 g=o.ref(!n.disable&&!n.readonly);o.watch([()=>n.disable,()=>n.readonly],([p,b],[M,E])=>{g.value=!p&&!b});function m(p){d(p)}return()=>o.createVNode(Te,{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 st(n,t,e,l){const{buttonGroupClass:i,onClickButton:a,onMouseEnterButton:s,onMouseLeaveButton:r}=e,{enableClearButton:d,showClearButton:c,onClearValue:f}=l,u=o.ref(),g=re.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:g,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=>g(p),onMouseenter:s,onMouseleave:r},null):null]),buttonHandleElement:u}}function rt(n,t,e){const l=o.ref(n.popupMinWidth),{hidePopup:i,popoverRef:a}=e,s=()=>{t.emit("shown")};return()=>o.createVNode(ke,{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 dt=o.defineComponent({name:"FButtonEdit",props:Ae,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=it(n,t,e,i),{shouldPopupContent:s,hidePopup:r,showPopup:d,togglePopup:c}=a,f=tt(n,t,e,a,i),u=o.ref(""),g=ot(n,t,i,u,a),{hasFocusedTextBox:m,commitValue:p,inputGroupClass:b}=g,M=nt(n,t,i,m,u,g),{onMouseEnterTextBox:E,onMouseLeaveTextBox:w}=M,T=o.ref(!1),H=o.computed(()=>{const P={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!n.wrapText};return l.value&&l.value.split(" ").reduce((q,C)=>(q[C]=!0,q),P),P}),F=o.computed(()=>({overflow:n.wrapText?"hidden":""})),R=o.computed(()=>({}));function h(){if(!n.multiSelect||n.inputType!=="tag"||!e.value)return 0;let P=0;const q=Array.from(e.value.querySelectorAll(".farris-tag-item"));return q&&q.length&&(P=q.map(C=>C.offsetTop).filter(C=>C>20).length),P}const x=o.ref(h());o.onUpdated(()=>{x.value=h()});function N(){return n.multiSelect&&n.inputType==="tag"?()=>o.createVNode(o.Fragment,null,[at(n,i,g)(),!!x.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("+"),x.value])])]):lt(n,i,g)}let D=N();o.watch([()=>n.multiSelect,()=>n.inputType],()=>{D=N()});const{renderButtonGroup:V,buttonHandleElement:k}=st(n,t,f,M),j=rt(n,t,a),U=o.ref(s.value),X={displayText:u,commitValue:p,elementRef:e,hidePopup:r,showPopup:d,popoverRef:a.popoverRef,shouldPopupContent:s,togglePopup:c,openDialog:()=>{k.value&&n.buttonBehavior==="Modal"&&k.value.click()},getModal:()=>{var P;return n.buttonBehavior==="Modal"?(P=f.modalRef.value)==null?void 0:P.value:null},getTextbox:()=>{var P;return(P=e.value)==null?void 0:P.querySelector("input")},forceClosePopup:()=>{U.value=!1,T.value=!0,s.value=!1}};return o.onMounted(()=>{e.value.componentInstance=X,window.onresize=()=>{document.body.click()}}),o.onBeforeUnmount(()=>{var P;window.onresize=null,(P=window[Q])==null||P.delete(e.value)}),t.expose(X),o.watch(()=>s.value,async(P,q)=>{if(T.value){U.value=P,T.value=!1;return}if(!P&&n.beforeClosePopup&&typeof n.beforeClosePopup=="function"){try{const C=await n.beforeClosePopup();U.value=!C,(!C||n.readonly)&&(s.value=!0)}catch(C){console.error("Error in beforeClosePopup:",C),U.value=q,s.value=q}return}U.value=P}),()=>{var P,q;return o.createVNode(o.Fragment,null,[o.createVNode("div",o.mergeProps(t.attrs,{ref:e,class:H.value,id:n.id?n.id:void 0,style:F.value}),[o.createVNode("div",{id:n.id?`${n.id}-input-group`:void 0,class:b.value,style:R.value,onMouseenter:E,onMouseleave:w},[(q=(P=t.slots).precontent)==null?void 0:q.call(P),D(),V()])]),U.value&&j()])}}});function be(n,t,e){return t}function Ce(n,t,e){return t}const we=new Map([["appearance",_.resolveAppearance]]),xe=new Map([]),Ve={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-group.schema.json",title:"item-collection-editor",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a item-collection-editor",type:"string"},type:{description:"The type string of item-collection-editor component",type:"string",default:"item-collection-editor"},requiredFields:{description:"",type:"array",default:[]},uniqueFields:{description:"",type:"array",default:[]},dynamicMappingKeys:{type:"boolean",default:!1},columns:{description:"",type:"array",default:[]},modalTitle:{description:"",type:"string",default:""},canEmpty:{description:"",type:"boolean",default:!0},valueField:{description:"",type:"string",default:"value"},nameField:{description:"",type:"string",default:"name"},idField:{description:"",type:"string",default:"value"},readonly:{description:"",type:"boolean",default:!1},modelValue:{description:"",type:"string",default:""},beforeSubmit:{description:"",type:"object",default:null},title:{description:"",type:"string",default:"项编辑器"},modalWidth:{description:"",type:"number",default:900},modalHeight:{description:"",type:"number",default:600}},required:["id","type"],ignore:[]},de={requiredFields:{type:Array,default:[]},uniqueFields:{type:Array,default:[]},dynamicMappingKeys:{type:Boolean,default:!1},columns:{type:Array,default:[]},modalTitle:{type:String,default:"项编辑器"},canEmpty:{type:Boolean,default:!0},valueField:{type:String,default:"value"},nameField:{type:String,default:"name"},idField:{type:String,default:"value"},readonly:{type:Boolean,default:!1},modelValue:{type:Array,default:[]},beforeSubmit:{type:Function,default:null},title:{type:String,default:"项编辑器"},modalWidth:{type:Number,default:900},modalHeight:{type:Number,default:600}};_.createPropsResolver(de,Ve,xe,Ce);const ut=_.getPropsResolverGenerator(de,Ve,xe,Ce),ct={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}}},ft=o.defineComponent({name:"FItemCollectionEditorInner",props:ct,emits:["change"],setup(n,t){let e="";const{guid:l}=$.useGuid(),i=new Ne.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 g(){const h={};return f.forEach(x=>{x.editor&&(x.editor.type==="checkbox"||x.editor.type==="switch")?h[x.field]=!1:h[x.field]=""}),h}function m(){if(n.dynamicMappingKeys){const h="请先填写XXX。",x=a.value.trim()?s.value.trim()?"":"枚举名称字段":"枚举值字段";return i.warning({position:"top-center",message:h.replace("XXX",x)}),!1}return!0}function p(h){const x="不允许重复。";if(!m())return!1;if(!h||h.length===0)return n.canEmpty?!0:(i.warning({position:"top-center",message:"请添加值。"}),!1);const N=n.requiredFields||[],D="不允许为空。";for(const k of h)for(const j of Object.keys(k)){const U=f.find(X=>X.field===j);if(U&&U.editor&&(U.editor.type==="checkbox"||U.editor.type==="switch")){if(N.includes(j)&&(k[j]===null||k[j]===void 0))return i.warning({position:"top-center",message:U.title+D}),!1}else if(N.includes(j)&&(k[j]===void 0||k[j]===""||k[j]===null))return i.warning({position:"top-center",message:U.title+D}),!1}const V=n.uniqueFields||[];for(const k of V){const j=h.map(P=>P[k]),U=new Set(j),X=Array.from(U);if(j.length!==X.length){const P=f.find(q=>q.field===k);return i.warning({position:"top-center",message:P.title+x}),!1}}return!0}function b(){if(n.readonly||!m())return;const h=g(),x=l();u.push({hId:x,...h}),c.value.updateDataSource(u),c.value.selectRowById(x)}function M(h){u&&u.length>0?(h||(h=u[0].hId),c.value.selectRowById(h)):e=""}function E(){if(!e){i.warning({position:"top-center",message:"请先选中行!"});return}const h=u.findIndex(D=>D.hId===e);u=[...u.filter(D=>D.hId!==e)],c.value.updateDataSource(u);let N="";h<u.length&&u.length>0&&(N=u[h].hId),M(N)}function w(h){if(!h||h.length===0)return h;const x=[];return h.forEach(N=>{const{value:D,name:V,...k}=N,j=Object.assign({},k);j[a.value.trim()]=D,j[s.value.trim()]=V,x.push(j)}),x}function T(){c.value.endEditCell();const h=[];return u.forEach(x=>{const{hId:N,...D}=x,V={};for(const k in D)k.startsWith("_")||(V[k]=D[k]);h.push(V)}),h}function H(){let h=T();return p(h)?(n.dynamicMappingKeys?(h=w(h),t.emit("change",h,void 0,{valueField:a.value.trim(),nameField:s.value.trim()})):t.emit("change",h,void 0,null),!0):!1}function F(){return u}t.expose({clickConfirm:H,getItems:T,getDataGridDatas:F}),o.onMounted(()=>{M()});function R(h){var x;e=(x=h[0])==null?void 0:x.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:()=>E()},[o.createTextVNode("删除")])]),o.createVNode("div",{class:"f-utils-fill border",style:"margin:0 8px;border-radius:12px;"},[o.createVNode(Be,{ref:c,showBorder:!0,idField:"hId",columns:f,data:u,editable:!n.readonly,"edit-option":r,columnOption:d,commandOption:n.commandOption,fit:!0,onSelectionChange:R},null)])])}}),pt={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}},mt={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},ue=o.defineComponent({name:"Toast",props:mt,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 w={animated:a.value,toast:!0,"toast--only-content":!s.value};return w[n.animate]=!1,w[l]=a.value,w["toasty-type-"+i.value.type]=!0,i.value.theme&&(w[i.value.theme]=!0),w}),c=o.computed(()=>{const H=`f-icon-${i.value&&i.value.type?i.value.type.replace("toasty-type-",""):"default"}`,F={"f-icon":!0};return F[H]=!0,F}),f=o.computed(()=>i.value.title||i.value.message),u=o.computed(()=>n.showCloseButton),g=o.computed(()=>!!i.value.buttons||!!t.slots.default),m=o.computed(()=>J.LocaleService.getLocale()==="en"?{wordBreak:"keep-all",overflowWrap:"break-word"}:{});function p(w){w.stopPropagation(),w.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",i.value)},200)}function b(w,T){}function M(w){return`f-preten-link ${w.customClass?w.customClass:""}`}o.watch(e,()=>{e.value});const E=()=>{var w;return o.createVNode(o.Fragment,null,[o.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((w=i.value.buttons)==null?void 0:w.map(T=>o.createVNode("span",{class:M(T),onClick:H=>void 0},[T.text]))),t.slots.default&&t.slots.default()])])};return()=>o.createVNode("div",{class:d.value,style:"min-height:44px"},[u.value&&o.createVNode("button",{title:J.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),g.value&&E()]),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"},[E()])]):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:pt,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 g=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?`${g}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(g){t.emit("close")}d.value&&setTimeout(()=>{f()},d.value),t.expose({closeToast:f,container:i,notifyPosition:r});function u(g,m){f()}return()=>o.createVNode("div",{class:e.value,style:c.value,ref:i},[o.createVNode(ue,{options:a.value,showCloseButton:s.value,animate:n.animate,onClose:g=>u(g,a.value)},null)])}});class ht{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," ").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 g=u.value.container.getBoundingClientRect();i.top=g.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(J.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 Me=Symbol("NOTIFY_SERVICE_TOKEN");le.install=n=>{n.component(le.name,le),n.component(ue.name,ue);const t=new ht;n.provide(Me,t),n.provide("FNotifyService",t)};const gt=o.defineComponent({name:"FItemCollectionEditor",props:de,components:{},emits:["change"],setup(n,t){const e=o.inject(Me),{guid:l}=$.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]:M,...E}=p,w=E||{};w.value=b,w.name=M,w.hId=l(),m.push(w)}})):(m=re.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 g(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(dt,{"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(ft,{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)=>g(m,p,b)},null)])]})}}),Ie={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-group.schema.json",title:"radio-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a radio-group",type:"string"},type:{description:"The type string of radio-group component",type:"string",default:"radio-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0},textField:{description:"",type:"string",default:"name"},valueField:{description:"",type:"string",default:"value"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},bindDataSource:{description:"",type:"string",default:""},direction:{description:"",type:"string",default:"horizontal"},onChange:{description:"值变化事件",type:"string"}},required:["type"],ignore:["id","appearance","binding","visible"]},yt=_.createPropsResolver(se.radioGroupProps,Ie,we,be),ce=_.getPropsResolverGenerator(se.radioGroupProps,Ie,we,be);te.register=(n,t,e,l,i)=>{n["radio-group"]=se,t["radio-group"]=ce(i),n["item-collection-editor"]=gt,t["item-collection-editor"]=ut(i)},te.registerDesigner=(n,t,e,l)=>{n["radio-group"]=te,t["radio-group"]=ce(l)};const vt=$.withInstall(te);z.FRadioGroupDesign=te,z.default=vt,z.propsResolver=yt,z.propsResolverGenerator=ce,Object.defineProperties(z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -7,7 +7,7 @@ import { FModalService as te } from "../../components/modal/index.esm.js";
|
|
|
7
7
|
import { useDesignerComponent as ne, DgControl as X } from "../../components/designer-canvas/index.esm.js";
|
|
8
8
|
import { cloneDeep as G } from "lodash-es";
|
|
9
9
|
import ae from "../../components/capsule/index.esm.js";
|
|
10
|
-
import oe from "../../components/switch/index.esm.js
|
|
10
|
+
import oe from "../../components/switch/index.esm.js";
|
|
11
11
|
import le from "../../components/combo-list/index.esm.js";
|
|
12
12
|
import re from "../../components/radio-button/index.esm.js";
|
|
13
13
|
import ie from "../../components/rate/index.esm.js";
|