@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1 lines • 405 kB
JavaScript
(function(X,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("../list-view/index.umd.js"),require("../button-edit/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../designer-canvas/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../modal/index.umd.js"),require("../transfer/index.umd.js"),require("../tabs/index.umd.js"),require("../order/index.umd.js"),require("../condition/index.umd.js"),require("../checkbox/index.umd.js"),require("../filter-bar/index.umd.js"),require("../tooltip/index.umd.js"),require("../pagination/index.umd.js"),require("../button/index.umd.js"),require("../search-box/index.umd.js"),require("../tags/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../events-editor/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../external-container/index.umd.js"),require("../notify/index.umd.js"),require("../popover/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","../list-view/index.umd.js","../button-edit/index.umd.js","../../designer/button-edit/index.umd.js","../designer-canvas/index.umd.js","@vueuse/core","../data-view/index.umd.js","../modal/index.umd.js","../transfer/index.umd.js","../tabs/index.umd.js","../order/index.umd.js","../condition/index.umd.js","../checkbox/index.umd.js","../filter-bar/index.umd.js","../tooltip/index.umd.js","../pagination/index.umd.js","../button/index.umd.js","../search-box/index.umd.js","../tags/index.umd.js","../dynamic-form/index.umd.js","../dynamic-resolver/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../events-editor/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../schema-selector/index.umd.js","../tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../external-container/index.umd.js","../notify/index.umd.js","../popover/index.umd.js"],a):(X=typeof globalThis<"u"?globalThis:X||self,a(X["expression-editor"]={},X.Vue,X.LodashES,X.common,X.FListView,X.FButtonEdit$1,X.FButtonEdit$2,X.designerCanvas,X.VueUseCore,X.dataView,null,X.FTransfer,X.FTabs,X.FOrder,null,X.checkbox,X.FFilterBar,X.FTooltip,X.FPagination,X.FButton,X.FSearchBox,X.FTags,X.FDynamicForm,X.dynamicResolver,null,X.FAccordion,X.FAvatar,X.FButtonGroup,X.FCalendar,X.FCapsule,X.FCheckbox,X.FCheckboxGroup,X.FComboList$1,X.FComboTree,X.FComponent,X.FColorPicker,X.FContentContainer,X.FDatePicker,X.FDataGrid,X.FDropdown,X.FEventsEditor,X.FFieldSelector,X.FBindingSelector,X.FImageCropper,X.FInputGroup,X.FLayout$1,X.FListNav,X.FLookup,X.FMappingEditor,X.FNav,X.FNumberRange,X.FNumberSpinner,X.FPageHeader,X.FPageFooter,X.FProgress,X.FQuerySolution,X.FRadioGroup,X.FRate,X.FResponseToolbar,X.FResponseLayout,X.FResponseLayoutEditorSetting,X.FSection,X.FSmokeDetector,X.FSplitter,X.FStep,X.FSwitch,X.FText,X.FTimePicker,X.FTreeview,X.FUploader,X.FVerifyDetail,X.FVideo,X.FTextArea,X.FSchemaSelector,X.FTreeGrid$1,X.FEventParameter,X.FFilterConditionEditor,X.FFieldset,X.FSortConditionEditor,X.FMenuLookup,X.FDrawer,X.FJsonEditor,X.FPropertyEditor,X.FExpressionEditor$1,X.FCodeEditor,X.FHtmlTemplate,null,null,X.FPopover))})(this,function(X,a,_e,Fe,jn,dn,Bn,fn,Rn,Te,_d,ho,yo,go,Nd,vo,bo,$n,wo,Co,xo,Ln,pn,ko,Ed,Fo,So,To,Mo,_o,Wn,Hn,mn,No,Eo,Oo,Vo,Do,Io,Po,jo,Bo,Ro,$o,Lo,Wo,Ho,Ao,qo,zo,Go,Yo,Uo,Xo,Qo,Ko,Jo,Zo,ea,ta,na,ra,oa,aa,ia,sa,la,ca,An,ua,da,fa,pa,ma,ha,ya,ga,va,ba,wa,Ca,xa,ka,Fa,Sa,Ta,Od,Vd,Ma){"use strict";var Td=Object.defineProperty;var Md=(X,a,_e)=>a in X?Td(X,a,{enumerable:!0,configurable:!0,writable:!0,value:_e}):X[a]=_e;var D=(X,a,_e)=>Md(X,typeof a!="symbol"?a+"":a,_e);const qn={modelValue:{type:String,default:""},singleExpand:{type:Boolean,default:!0},entities:{type:Array,default:[]},variables:{type:Array,default:[]},disabledFunctions:{type:Object,default:null},esprimaPath:{type:String,default:"assets/esprima-config.json"},showMessage:{type:Boolean,default:!1},validateMessage:{type:String,default:""},messageType:{type:String,default:"info"},showMessageType:{type:Boolean,default:!1}},zn={},Gn={};function hn(t){const{properties:n,title:e,ignore:r}=t,o=r&&Array.isArray(r),i=Object.keys(n).reduce((s,l)=>((!o||!r.find(c=>c===l))&&(s[l]=n[l].type==="object"&&n[l].properties?hn(n[l]):_e.cloneDeep(n[l].default)),s),{});if(e&&(!o||!r.find(s=>s==="id"))){const s=e.toLowerCase().replace(/-/g,"_");i.id=`${s}_${Math.random().toString().slice(2,6)}`}return i}function _a(t){const{properties:n,title:e,required:r}=t;if(r&&Array.isArray(r)){const o=r.reduce((i,s)=>(i[s]=n[s].type==="object"&&n[s].properties?hn(n[s]):_e.cloneDeep(n[s].default),i),{});if(e&&r.find(i=>i==="id")){const i=e.toLowerCase().replace(/-/g,"_");o.id=`${i}_${Math.random().toString().slice(2,6)}`}return o}return{type:e}}function Yn(t,n={},e){const r=zn[t];if(r){let o=_a(r);const i=Gn[t];return o=i?i({getSchemaByType:Yn},o,n,e):o,o}return null}function Na(t,n){const e=hn(n);return Object.keys(e).reduce((r,o)=>(Object.prototype.hasOwnProperty.call(t,o)&&(r[o]&&_e.isPlainObject(r[o])&&_e.isPlainObject(t[o]||!t[o])?Object.assign(r[o],t[o]||{}):r[o]=t[o]),r),e),e}function Un(t,n){return Object.keys(t).filter(r=>t[r]!=null).reduce((r,o)=>{if(n.has(o)){const i=n.get(o);if(typeof i=="string")r[i]=t[o];else{const s=i(o,t[o],t);Object.assign(r,s)}}else r[o]=t[o];return r},{})}function Ea(t,n,e=new Map){const r=Na(t,n);return Un(r,e)}function Oa(t={}){function n(d,f,u,p){if(typeof u=="number")return p[d].length===u;if(typeof u=="object"){const g=Object.keys(u)[0],y=u[g];if(g==="not")return Number(p[d].length)!==Number(y);if(g==="moreThan")return Number(p[d].length)>=Number(y);if(g==="lessThan")return Number(p[d].length)<=Number(y)}return!1}function e(d,f,u,p){return p[d]&&p[d].propertyValue&&String(p[d].propertyValue.value)===String(u)}const r=new Map([["length",n],["getProperty",e]]);Object.keys(t).reduce((d,f)=>(d.set(f,t[f]),d),r);function o(d,f){const u=d;return typeof f=="number"?[{target:u,operator:"length",param:null,value:Number(f)}]:typeof f=="boolean"?[{target:u,operator:"getProperty",param:d,value:!!f}]:typeof f=="object"?Object.keys(f).map(p=>{if(p==="length")return{target:u,operator:"length",param:null,value:f[p]};const g=p,y=f[p];return{target:u,operator:"getProperty",param:g,value:y}}):[]}function i(d){return Object.keys(d).reduce((u,p)=>{const g=o(p,d[p]);return u.push(...g),u},[])}function s(d,f){if(r.has(d.operator)){const u=r.get(d.operator);return u&&u(d.target,d.param,d.value,f)||!1}return!1}function l(d,f){return i(d).reduce((g,y)=>g&&s(y,f),!0)}function c(d,f){const u=Object.keys(d),p=u.includes("allOf"),g=u.includes("anyOf"),y=p||g,m=(y?d[y?p?"allOf":"anyOf":"allOf"]:[d]).map(w=>l(w,f));return p?!m.includes(!1):m.includes(!0)}return{parseValueSchema:c}}const oe={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"filter-bar":{type:"filter-bar",name:"筛选条"}},Va={},Da={};Oa();function lt(t,n,e=new Map,r=(s,l,c,d)=>l,o={},i=s=>s){return zn[n.title]=n,Gn[n.title]=r,Va[n.title]=o,Da[n.title]=i,(s={},l=!0)=>{if(!l)return Un(s,e);const c=Ea(s,n,e),d=Object.keys(t).reduce((f,u)=>(f[u]=t[u].default,f),{});return Object.assign(d,c)}}function Lt(t,n){return{customClass:n.class,customStyle:n.style}}function Ia(){function t(n,e){const{dataSource:r}=n||{};return r===void 0?{}:{}}return{resolve:t}}function Pa(){function t(n,e){return n.selectItemById(e)}return{selectItemById:t}}function ja(){function t(n,e){const{columns:r}=e;return n.updateColumns(r)}return{updateColumns:t}}const Xn=new Map([["appearance",Lt]]);function Qn(t,n,e){return n}const Ba={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/layout.schema.json",title:"layout",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for layout component",type:"string"},type:{description:"The type string of layout component",type:"string",default:"layout"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},collapsable:{description:"",type:"boolean",default:!1},resizable:{description:"",type:"boolean",default:!0},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},Ra={title:"layout",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"类型",title:"类型",type:"string",readonly:!0}}},behavior:{description:"Basic Infomation",title:"行为",properties:{collapsable:{description:"",title:"可收折",type:"boolean"},resizable:{description:"",title:"可调整尺寸",type:"boolean"}}}}},yn={customStyle:{type:String,defaut:""},customClass:{type:String,defaut:""}},Kn=lt(yn,Ba,Xn,Qn,Ra);function Jn(t){const n=a.ref(-1),e=a.ref(-1),r=a.ref(0),o=a.ref(0),i=a.ref(!1),s=a.ref(!1),l=a.computed(()=>({display:i.value?"block":"none",left:`${r.value}px`,cursor:"e-resize"})),c=a.computed(()=>({display:s.value?"block":"none",top:`${o.value}px`,cursor:"n-resize"})),d=a.computed(()=>{const h={display:s.value||i.value?"block":"none"};return o.value>0&&(h.cursor="n-resize"),h});function f(h,m,C,w){const F=t.value;if(F){const{left:x,right:k,width:v}=F.getBoundingClientRect();let S=h.clientX-x;w==="right"&&(S=k-h.clientX),S>m&&(S=m),S<C&&(S=C),w==="right"&&(S=v-S),r.value=S}}function u(h,m,C,w){const F=t.value;if(F){const{top:x,bottom:k,height:v}=F.getBoundingClientRect();let S=h.clientY-x;w==="bottom"&&(S=k-h.clientY),S>m&&(S=m),S<C&&(S=C),w==="bottom"&&(S=v-S),o.value=S}}function p(){const h=t.value;if(h){const{width:m,height:C}=h.getBoundingClientRect();return{width:m,height:C}}return null}function g(){const h=t.value;return h?Array.from(h.querySelectorAll("[data-position]")).reduce((m,C)=>{const w=C.getAttribute("data-position");return m=Object.assign(m,{[w]:C}),m},{}):null}function y(h,m){const C=p(),w=g();if(C&&w){const F=w==null?void 0:w.right,x=w==null?void 0:w.left;if(h==="left"&&x)return F?C.width-F.clientWidth-m:C.width-m;if(h==="right"&&F)return x?C.width-x.clientWidth-m:C.width-m}}function T(h,m){const C=p(),w=g();if(C&&w){const F=w==null?void 0:w.bottom,x=w==null?void 0:w.top;if(h==="top"&&x)return F?C.height-F.clientHeight-m:C.height-m;if(h==="bottom"&&F)return x?C.height-x.clientHeight-m:C.height-m}}return{horizontalResizeHandleStyle:l,verticalResizeHandleStyle:c,resizeOverlayStyle:d,showHorizontalResizeHandle:i,showVerticalResizeHandle:s,horizontalResizeBarPosition:n,verticalResizeBarPosition:e,verticalResizeHandleOffset:o,horizontalResizeHandleOffset:r,draggingHorizontalResizeHandle:f,draggingVerticalResizeHandle:u,getPanelMaxHeight:T,getPanelMaxWidth:y}}const vt=a.defineComponent({name:"FLayout",props:yn,emits:[],setup(t,n){const e=a.ref(),r=Jn(e),{horizontalResizeHandleStyle:o,verticalResizeHandleStyle:i,resizeOverlayStyle:s}=r;a.provide("layout",{useResizeHandleComposition:r});const l=a.computed(()=>{const d={"f-layout":!0};return Fe.getCustomClass(d,t==null?void 0:t.customClass)}),c=a.computed(()=>{const d={};return Fe.getCustomStyle(d,t==null?void 0:t.customStyle)});return()=>a.createVNode("div",{class:l.value,style:c.value,ref:e},[n.slots.default&&n.slots.default(),a.createVNode("div",{class:"f-layout-resize-overlay",style:s.value},null),a.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:o.value},null),a.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:i.value},null)])}}),$a={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/layout-pane.schema.json",title:"layout-pane",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a layout pane",type:"string"},type:{description:"The type string of layout paney",type:"string",default:"layout-pane"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},collapsable:{description:"",type:"boolean",default:!1},contents:{description:"",type:"array",default:[]},height:{description:"",type:"number"},position:{description:"",type:"string",default:"left",enum:["left","center","right","top","bottom"]},resizeable:{description:"",type:"boolean",default:!0},width:{description:"",type:"number"},visible:{description:"",type:"number",default:!0}},required:["id","type","contents"]},La={title:"layout-pane",description:"A Farris Container Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"enum"},width:{description:"",type:"number",title:"宽度"},height:{description:"",type:"number",title:"高度"}}},appearance:{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:""},style:{title:"style",type:"string",description:""}}},behavior:{description:"",title:"行为",properties:{collapsable:{description:"",type:"boolean",title:"允许收折"},position:{description:"",type:"enum",title:"位置",editor:{type:"combo-list",data:[{id:"left",name:"左侧"},{id:"center",name:"居中"},{id:"right",name:"右侧"},{id:"top",name:"顶部"},{id:"bottom",name:"底部"}]}},resizeable:{description:"",type:"boolean",title:"允许调整尺寸"},visible:{description:"运行时组件是否可见",type:"boolean",title:"是否可见"}}}}},gn={customClass:{type:String,defaut:""},customStyle:{type:String,defaut:""},width:{type:Number,default:-1},height:{type:Number,default:-1},position:{type:String,default:"left"},visible:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},collapsable:{type:Boolean,default:!1},minWidth:{type:Number,default:100},minHeight:{type:Number,default:100}},Zn=lt(gn,$a,Xn,Qn,La);function er(t,n,e,r,o){const{horizontalResizeBarPosition:i,horizontalResizeHandleOffset:s,showHorizontalResizeHandle:l,showVerticalResizeHandle:c,verticalResizeBarPosition:d,verticalResizeHandleOffset:f,draggingHorizontalResizeHandle:u,draggingVerticalResizeHandle:p,getPanelMaxHeight:g,getPanelMaxWidth:y}=o;let T="",h,m,C;function w(k){if((T==="left"||T==="right")&&m){const{left:v}=m.getBoundingClientRect(),{width:S}=h.getBoundingClientRect(),_=k.clientX-v;let M=T==="left"?(S||0)+(_-i.value):(S||0)-(_-i.value);M=e.value>0?Math.max(e.value,M):M;const b=y(T,e.value);b!=null&&(M=b>M?M:b),t.value=M}if((T==="top"||T==="bottom")&&m){const{top:v}=m.getBoundingClientRect(),{height:S}=h.getBoundingClientRect(),_=k.clientY-v;let M=T==="top"?(S||0)+(_-d.value):(S||0)-(_-d.value);M=r.value>0?Math.max(r.value,M):M;const b=g(T,r.value);b!=null&&(M=b>M?M:b),n.value=M}s.value=0,f.value=0,i.value=-1,d.value=-1,l.value=!1,c.value=!1,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",w),document.body.style.userSelect="",T="",h=null,m=null}function F(k,v,S){if(T=v,h=S,l.value=!0,m=k.composedPath().find(M=>(M.className||"").split(" ")[0]==="f-layout"),m){const{left:M}=m.getBoundingClientRect(),b=k.clientX-M;s.value=b,i.value=b;const O=y(T,e.value)||0;C=E=>u(E,O,e.value,T),document.addEventListener("mousemove",C),document.addEventListener("mouseup",w),document.body.style.userSelect="none"}}function x(k,v,S){if(T=v,h=S,c.value=!0,m=k.composedPath().find(M=>(M.className||"").split(" ")[0]==="f-layout"),m){const{top:M}=m.getBoundingClientRect();f.value=k.clientY-M,d.value=k.clientY-M;const b=g(T,r.value)||0;C=O=>p(O,b,r.value,T),document.addEventListener("mousemove",C),document.addEventListener("mouseup",w),document.body.style.userSelect="none"}}return{onClickHorizontalResizeBar:F,onClickVerticalResizeBar:x}}const mt=a.defineComponent({name:"FLayoutPane",props:gn,emits:[],setup(t,n){const e=a.ref(t.minHeight<=0?100:t.minHeight),r=a.ref(t.minWidth<=0?100:t.minWidth),o=a.ref(t.width<=0?100:t.width),i=a.ref(t.height<=0?100:t.height),s=a.ref(Math.max(e.value,i.value)),l=a.ref(Math.max(r.value,o.value)),c=a.ref(),d=a.ref(t.position),f=a.ref(t.resizable);a.watch(()=>t.resizable,x=>{f.value=x});const u=a.inject("layout"),{useResizeHandleComposition:p}=u,g=er(l,s,r,e,p),{onClickHorizontalResizeBar:y,onClickVerticalResizeBar:T}=g,h=a.computed(()=>({"f-layout-resize-bar":!0,"f-layout-resize-bar-e":d.value==="left","f-layout-resize-bar-n":d.value==="bottom","f-layout-resize-bar-s":d.value==="top","f-layout-resize-bar-w":d.value==="right"})),m=a.computed(()=>d.value!=="center"&&f.value);function C(x,k){(k==="left"||k==="right")&&y(x,k,c.value),(k==="top"||k==="bottom")&&T(x,k,c.value)}const w=a.computed(()=>{const x={"f-layout-pane":!0,"f-page-content-nav":d.value==="left"||d.value==="right","f-page-content-main":d.value==="center"};return t.customClass&&String(t.customClass).split(" ").reduce((k,v)=>(k[v]=!0,k),x),x}),F=a.computed(()=>{const x={};return(l.value&&d.value==="left"||d.value==="right")&&(x.width=`${l.value}px`),(s.value&&d.value==="bottom"||d.value==="top")&&(x.height=`${s.value}px`),t.visible||(x.display="none"),x});return()=>a.createVNode("div",{ref:c,class:w.value,style:F.value,"data-position":d.value},[n.slots.default&&n.slots.default(),m.value&&a.createVNode("span",{class:h.value,onMousedown:x=>C(x,d.value)},null)])}});function Wa(t,n){function e(){return!1}return{canAccepts:e}}function vn(t,n,e){var v;const r=e&&e.getStyles&&e.getStyles()||"",o=e&&e.getDesignerClass&&e.getDesignerClass()||"",i=a.ref();function s(){return(n==null?void 0:n.schema.componentType)==="frame"?!1:e&&e.checkCanMoveComponent?e.checkCanMoveComponent():!0}function l(){return!1}function c(){return(n==null?void 0:n.schema.componentType)==="frame"?!1:e&&e.checkCanDeleteComponent?e.checkCanDeleteComponent():!0}function d(){return(n==null?void 0:n.schema.componentType)==="frame"?!0:e&&e.hideNestedPaddingInDesginerView?e.hideNestedPaddingInDesginerView():!1}function f(S){if(!S||!S.value)return null;if(S.value.schema&&S.value.schema.type==="component")return S.value;const _=a.ref(S==null?void 0:S.value.parent),M=f(_);return M||null}function u(S=n){var O;if(e!=null&&e.getDraggableDesignItemElement)return e.getDraggableDesignItemElement(S);const{componentInstance:_,designerItemElementRef:M}=S;if(!_||!_.value)return null;const{getCustomButtons:b}=_.value;return _.value.canMove||b&&((O=b())!=null&&O.length)?M:u(S.parent)}function p(S){return!!e&&e.canAccepts(S)}function g(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function y(){}function T(S,_){var M;!S||!_||(e!=null&&e.onAcceptMovedChildElement&&e.onAcceptMovedChildElement(S,_),(M=n==null?void 0:n.setupContext)==null||M.emit("dragEnd"))}function h(S,_){const{componentType:M}=S;let b=Yn(M,S,_);e&&e.onResolveNewComponentSchema&&(b=e.onResolveNewComponentSchema(S,b));const O=M.toLowerCase().replace(/-/g,"_");return b&&!b.id&&b.type===M&&(b.id=`${O}_${Math.random().toString().slice(2,6)}`),b}function m(S){S&&e!=null&&e.onChildElementMovedOut&&e.onChildElementMovedOut(S)}function C(...S){if(e&&e.getPropsConfig)return e.getPropsConfig(...S)}function w(S){if(!S)return;const _=n==null?void 0:n.schema,{formSchemaUtils:M}=S;if(_&&M.getExpressions().length){const b=M.getExpressions().findIndex(O=>O.target===_.id);b>-1&&M.getExpressions().splice(b,1)}}function F(S){e&&e.onRemoveComponent&&e.onRemoveComponent(),w(S),n!=null&&n.schema.contents&&n.schema.contents.map(_=>{let M=_.id;_.type==="component-ref"&&(M=_.component);const b=t.value.querySelectorAll(`#${M}-design-item`);b!=null&&b.length&&Array.from(b).map(O=>{var E;(E=O==null?void 0:O.componentInstance)!=null&&E.value.onRemoveComponent&&O.componentInstance.value.onRemoveComponent(S)})})}function x(){if(e&&e.getCustomButtons)return e.getCustomButtons()}function k(S){if(e&&e.onPropertyChanged)return e.onPropertyChanged(S)}return i.value={canMove:s(),canSelectParent:l(),canDelete:c(),canNested:!d(),contents:n==null?void 0:n.schema.contents,elementRef:t,parent:(v=n==null?void 0:n.parent)==null?void 0:v.componentInstance,schema:n==null?void 0:n.schema,styles:r,designerClass:o,canAccepts:p,getBelongedComponentInstance:f,getDraggableDesignItemElement:u,getDraggingDisplayText:g,getPropConfig:C,getDragScopeElement:y,onAcceptMovedChildElement:T,onChildElementMovedOut:m,addNewChildComponentSchema:h,triggerBelongedComponentToMoveWhenMoved:!!e&&e.triggerBelongedComponentToMoveWhenMoved||a.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!e&&e.triggerBelongedComponentToDeleteWhenDeleted||a.ref(!1),onRemoveComponent:F,getCustomButtons:x,onPropertyChanged:k},i}const Ha=a.defineComponent({name:"FLayoutDesign",props:yn,emits:[],setup(t,n){var f;const e=a.ref(),r=a.inject("design-item-context"),o=Wa(r.schema,(f=r.parent)==null?void 0:f.schema),i=vn(e,r,o);i.value.canNested=!1;const s=Jn(e),{horizontalResizeHandleStyle:l,verticalResizeHandleStyle:c,resizeOverlayStyle:d}=s;return a.provide("layout",{useResizeHandleComposition:s}),a.onMounted(()=>{e.value.componentInstance=i}),n.expose(i.value),()=>a.createVNode("div",{class:"f-layout f-page-content",ref:e},[n.slots.default&&n.slots.default(),a.createVNode("div",{class:"f-layout-resize-overlay",style:d.value},null),a.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:l.value},null),a.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:c.value},null)])}});function Aa(){function t(n,e){var s;if(!n)return!1;const r=((s=n.targetContainer)==null?void 0:s.componentInstance)&&n.targetContainer.componentInstance.value;if(!r)return!1;const o=r.schema.type,i=e==null?void 0:e.formSchemaUtils.getComponentById(r.belongedComponentId);return!((n.componentCategory==="input"||n.componentType==="form-group")&&![oe["response-layout-item"].type,oe["response-form"].type,oe.fieldset.type].includes(o)||(n.componentType===oe.tabs.type||n.componentType===oe.section.type)&&((i==null?void 0:i.componentType)!=="frame"||![oe["content-container"].type,oe["splitter-pane"].type,oe["response-layout-item"].type].includes(o))||n.componentType===oe["query-solution"].type||n.componentType===oe.fieldset.type&&o!==oe["response-form"].type)}return{basalDragulaRuleForContainer:t}}function qa(t,n){const e=t.schema;function r(i){return!!Aa().basalDragulaRuleForContainer(i)}function o(){const i=["f-layout-pane"];return(e.position==="left"||e.position==="right")&&i.push("f-page-content-nav"),e.position==="center"&&i.push("f-page-content-main"),i.join(" ")}return{canAccepts:r,getDesignerClass:o}}const za=a.defineComponent({name:"FLayoutPaneDesign",props:gn,emits:[],setup(t,n){const e=a.ref(),r=a.ref();a.inject("designer-host-service");const o=a.inject("design-item-context"),i=qa(o),s=vn(r,o,i);s.value.canNested=!1,s.value.canMove=!1,s.value.canDelete=!1,a.onMounted(()=>{r.value.componentInstance=s}),n.expose(s.value);const l=a.ref(Math.max(t.minHeight,t.height)),c=a.ref(Math.max(t.minWidth,t.width)),d=a.ref(t.minHeight),f=a.ref(t.minWidth),u=a.ref(t.position),p=a.inject("layout"),{useResizeHandleComposition:g}=p,y=er(c,l,f,d,g),{onClickHorizontalResizeBar:T,onClickVerticalResizeBar:h}=y,m=a.computed(()=>({"f-layout-resize-bar":!0,"f-layout-resize-bar-e":u.value==="left","f-layout-resize-bar-n":u.value==="bottom","f-layout-resize-bar-s":u.value==="top","f-layout-resize-bar-w":u.value==="right"}));function C(x,k){(k==="left"||k==="right")&&T(x,k,e.value),(k==="top"||k==="bottom")&&h(x,k,e.value)}const w=a.computed(()=>{const x={"f-layout-pane":!0,"f-page-content-nav":u.value==="left"||u.value==="right","f-page-content-main":u.value==="center"};return t.customClass&&String(t.customClass).split(" ").reduce((k,v)=>(k[v]=!0,k),x),x}),F=a.computed(()=>{const x={flex:"1"};return(c.value&&u.value==="left"||u.value==="right")&&(x.width=`${c.value}px`),(l.value&&u.value==="bottom"||u.value==="top")&&(x.height=`${l.value}px`),x});return()=>a.createVNode("div",{ref:e,class:w.value,style:F.value},[a.createVNode("div",{ref:r,class:"drag-container","data-dragref":`${o.schema.id}-container`},[n.slots.default&&n.slots.default()]),a.createVNode("span",{class:m.value,onMousedown:x=>C(x,u.value)},null)])}});vt.install=t=>{t.component(vt.name,vt),t.component(mt.name,mt)},vt.register=(t,n,e,r)=>{t.layout=vt,n.layout=Kn,t["layout-pane"]=mt,n["layout-pane"]=Zn},vt.registerDesigner=(t,n,e)=>{t.layout=Ha,n.layout=Kn,t["layout-pane"]=za,n["layout-pane"]=Zn};const Ga=new Map([["appearance",Lt]]),Ya={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/combo-list.schema.json",title:"combo-list",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a combo list",type:"string"},type:{description:"The type string of number combo list component",type:"string",default:"combo-list"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{description:"",type:"boolean",default:!1},enableClear:{description:"",type:"boolean",default:!1},editable:{description:"",type:"boolean",default:!1},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:"请选择"},idField:{description:"",type:"string",default:"id"},valueField:{description:"",type:"string",default:"id"},titleField:{description:"",type:"string",default:"name"},textField:{description:"",type:"string",default:"name"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},remote:{description:"",type:"string"},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},multiSelect:{description:"",type:"boolean",default:!1},maxLength:{description:"",type:"number",default:null},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""},maxHeight:{description:"",type:"number",default:350},minPanelWidth:{description:"",type:"number",default:160},popupOnClick:{description:"",type:"boolean",default:!0},separator:{description:"",type:"string",default:","}},required:["type"],ignore:["id","appearance","binding","visible"]};function Ua(t,n,e){return n}const bn={id:{type:String},data:{type:Array,default:[]},disabled:{default:!1,type:Boolean},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-60-down"></span>'},editable:{default:!1,type:Boolean},enableClear:{default:!0,type:Boolean},enableSearch:{type:Boolean,default:!1},enableTitle:{default:!0,type:Boolean},fitEditor:{default:!1,type:Boolean},forcePlaceholder:{default:!1,type:Boolean},hidePanelOnClear:{default:!0,type:Boolean},idField:{default:"id",type:String},mapFields:{type:Object},maxHeight:{default:350,type:Number},maxLength:{type:Number},multiSelect:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String,default:"请选择"},placement:{type:String,default:"auto"},readonly:{default:!1,type:Boolean},remote:{default:null,type:Object},remoteSearch:{default:!1,type:Boolean},separator:{default:",",type:String},tabIndex:{type:Number,default:-1},textField:{default:"name",type:String},titleField:{default:"name",type:String},valueField:{default:"id",type:String},viewType:{default:"tag",type:String},change:{type:Function,default:()=>{}},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},autoHeight:{type:Boolean,default:!0},beforeOpen:{type:Function,default:null},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0},minPanelWidth:{type:Number,default:160},popupOnClick:{type:Boolean,default:!0}},Xa=Object.assign({},bn,{readonly:{}}),tr=lt(bn,Ya,Ga,Ua),Qa={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{type:Boolean,default:!1},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},maxHeight:{type:Number},valueField:{type:String,default:"id"},onSelectionChange:{type:Function,default:()=>{}},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0}},Ka=a.defineComponent({name:"FComboListContainer",props:Qa,emits:["selectionChange"],setup(t,n){const e=a.ref(),r=a.ref(t.dataSource),o=a.ref([]),i=a.ref(t.separator),s=a.ref(t.width),l=a.ref(t.maxHeight),c=a.ref(String(t.selectedValues).split(i.value)),d=a.computed(()=>t.multiSelect),f=a.computed(()=>({enableSelectRow:!0,multiSelect:t.multiSelect,multiSelectMode:"OnCheckAndClick",showCheckbox:d.value,showSelectAll:!1,showSelection:!0}));a.watch(t.dataSource,()=>{r.value=t.dataSource}),a.computed(()=>t.enableSearch?"SearchBar":"ContentHeader");const u=a.computed(()=>{const h={};return s.value!==void 0&&(h.width=`${s.value}px`),l.value!==void 0&&l.value>0&&(h.maxHeight=`${l.value}px`),h});function p(h){e.value.search(h)}function g(h){o.value=h.map(m=>Object.assign({},m)),c.value=h.map(m=>m[t.idField]),n.emit("selectionChange",o.value)}function y(h){if(t.enableHighlightSearch)return;let m=[];const{searchOption:C}=t;typeof C=="function"?m=r.value.filter(w=>C(h,w)):m=r.value.filter(w=>w[t.valueField].indexOf(h)>-1||w[t.textField].indexOf(h)>-1),e.value.updateDataSource(m)}a.watch([()=>t.selectedValues],([h])=>{t.multiSelect?c.value=h.split(i.value):c.value=[h]});function T(h){e.value.activeRowById(h)}return a.onMounted(()=>{var h,m;if(!t.multiSelect){const C=(h=c.value)==null?void 0:h[0];let w=C;if(!_e.isUndefined(C)){const F=typeof C,x=typeof((m=r.value[0])==null?void 0:m[t.valueField||t.idField]);x==="number"&&F!==x&&(w=Number(C)),x==="boolean"&&F!==x&&(w=C==="true"?!0:C==="false"?!1:C),T(w)}}}),n.expose({search:p,activeRowById:T}),()=>a.createVNode("div",{class:"f-combo-list-container",style:u.value},[a.createVNode(jn,{ref:e,size:"small",itemClass:"f-combo-list-item",itemContentClass:"text-truncate",header:"ContentHeader",headerClass:"f-combo-list-search-box",data:r.value,idField:t.idField,textField:t.textField,titleField:t.titleField,multiSelect:t.multiSelect,selection:f.value,enableHighlightSearch:t.enableHighlightSearch,selectionValues:c.value,onSelectionChange:g,onAfterSearch:y},null)])}});function Ja(t){const n=a.ref(""),e=a.ref(t.modelValue),r=a.ref(t.data||[]),o=a.ref(t.editable);function i(u){const p=t.multiSelect?String(u).split(t.separator):[String(u)],g=p.map(h=>[h,!0]),y=new Map(g);return r.value.filter(h=>y.has(String(h[t.valueField]))).sort((h,m)=>{const C=p.indexOf(h[t.valueField]),w=p.indexOf(m[t.valueField]);return C-w})}function s(u){const p=i(u).map(g=>g[t.textField]).join(t.separator);n.value=o.value?p||u:p}function l(u){if(t.multiSelect){const p=u.split(t.separator).map(y=>[y,!0]),g=new Map(p);return r.value.filter(y=>g.has(y[t.textField]))}return r.value.filter(p=>""+p[t.textField]===u)}function c(u){const p={};return p[t.idField]=u,p[t.textField]=u,[p]}function d(u){let p=l(u);const g=p&&p.length>0;return o.value&&!g&&(p=c(u)),p}function f(){const{url:u,method:p="GET",headers:g={},body:y=null}=t.remote,T=p.toLowerCase()==="get"?{method:p,headers:g}:{method:p,headers:g,body:y};let h=!1;fetch(u,T).then(m=>{var w,F;if(m.status===200)return h=!!((F=(w=m.headers)==null?void 0:w.get("content-type"))!=null&&F.includes("application/json")),h?m.text():m.json();throw new Error(m.statusText)}).then(m=>{r.value=h?JSON.parse(m):m}).catch(m=>{console.error(m)})}return t.remote&&f(),a.watch(()=>t.data,()=>{r.value=t.data}),a.watch([r],([u])=>{if(t.modelValue!=null){const p=u.find(g=>g[t.valueField]===t.modelValue);p&&(n.value=p[t.textField])}}),a.watch(()=>t.modelValue,u=>{e.value=u,s(u)}),s(t.modelValue),{dataSource:r,displayText:n,editable:o,modelValue:e,getItemsByDisplayText:l,getItemsByValue:i,getSelectedItemsByDisplayText:d}}const Wt=a.defineComponent({name:"FComboList",props:bn,emits:["clear","update:modelValue","change","input"],setup(t,n){const e=a.ref(),r=a.ref(),o=a.ref(t.disabled||t.readonly),i=a.ref(t.enableClear),s=a.ref(t.enableSearch),l=a.ref(t.readonly),{dataSource:c,displayText:d,editable:f,modelValue:u,getSelectedItemsByDisplayText:p,getItemsByDisplayText:g}=Ja(t),y=a.computed(()=>t.multiSelect),T=a.computed(()=>r.value?r.value.elementRef.getBoundingClientRect().width:0);function h(){!y.value&&r.value&&r.value.hidePopup()}function m(M){d.value=M.map(O=>O[t.textField]).join(t.separator);let b="";M.length===1?b=M[0][t.valueField]:b=M.map(O=>O[t.valueField]).join(t.separator),u.value!==b&&(u.value=b,n.emit("update:modelValue",u.value),n.emit("change",M,u.value))}function C(){const M=p(d.value);m(M)}function w(){l.value||d.value}function F(M){var b;u.value="",(b=e.value)==null||b.activeRowById(""),n.emit("update:modelValue",""),n.emit("change",[],""),n.emit("clear")}function x(M){var b,O;t.enableSearch?((b=e.value)==null||b.search(M),(O=e.value)==null||O.activeRowById(M)):(u.value=M,d.value=M,n.emit("update:modelValue",u.value),n.emit("change",[M],M))}function k(M){if(t.multiSelect){const b=g(M),E=b.map(N=>N[t.idField||t.valueField]).join(t.separator);u.value!==E&&(u.value=E,n.emit("update:modelValue",u.value),n.emit("change",b,u.value))}}function v(){return d.value}function S(M){x(M),n.emit("input",M)}function _(){r.value.hidePopup()}return n.expose({getDisplayText:v,hidePopup:_}),a.watch([()=>t.disabled,()=>t.editable,()=>t.enableClear,()=>t.enableSearch,()=>t.readonly],([M,b,O,E,N])=>{o.value=M,f.value=b,i.value=O,s.value=E,l.value=N}),()=>a.createVNode(dn,{ref:r,id:t.id,disable:o.value,readonly:l.value,forcePlaceholder:t.forcePlaceholder,editable:f.value,buttonContent:t.dropDownIcon,placeholder:t.placeholder,enableClear:i.value,maxLength:t.maxLength,tabIndex:t.tabIndex,enableTitle:t.enableTitle,multiSelect:t.multiSelect,inputType:t.multiSelect?t.viewType:"text",modelValue:d.value,"onUpdate:modelValue":M=>d.value=M,focusOnCreated:t.focusOnCreated,selectOnCreated:t.selectOnCreated,onClear:F,onClick:w,onChange:k,onBlur:C,onInput:S,beforeOpen:t.beforeOpen,placement:t.placement,popupMinWidth:t.minPanelWidth,popupClass:"f-combo-list-wrapper",popupOnClick:t.popupOnClick},{default:()=>[a.createVNode(Ka,{ref:e,idField:t.idField,valueField:t.valueField,textField:t.textField,titleField:t.titleField,dataSource:c.value,selectedValues:u.value,separator:t.separator,multiSelect:t.multiSelect,enableSearch:s.value,maxHeight:t.maxHeight,enableHighlightSearch:t.enableHighlightSearch,width:t.fitEditor?T.value:void 0,onSelectionChange:M=>{m(M),h()}},null)]})}}),Za=a.ref(0);function ei(){Za.value++}const Mt=a.ref(0);function ti(t,n){const e=n.getBoundingClientRect(),r=t.getBoundingClientRect(),o=r.top>=e.top,i=r.top<=e.bottom;return o&&i}function ni(t){const n=t.querySelector(".component-btn-group");if(!n)return;n.style.display="";const e=n.getBoundingClientRect();if(!(e.top===0&&e.left===0)){const r=n.querySelector("div");if(r){const o=r.getBoundingClientRect();r.style.top=e.top+"px";let i=e.left-o.width;const s=document.querySelector(".editorDiv");if(s){const l=s.getBoundingClientRect();i<l.left&&({left:i}=t.getBoundingClientRect())}r.style.left=i+"px"}}}function ri(t){if(!window.scrollContainerList)return;const n=Array.from(window.scrollContainerList);if(n.length&&n.length===1){const e=n[0],r=document.querySelector(`[id=${e}]`);if(r&&r.contains(t))return r}}function nr(t){if(!t)return;const n=t.getBoundingClientRect();if(n.width===0&&n.height===0)return;const e=t.querySelector(".component-btn-group");if(e){let r=!0;const o=ri(t);if(o&&(r=ti(t,o)),!r){e.style.display="none";return}ni(t)}}function oi(t){if(!t)return;let n;t.className.includes("dgComponentSelected")?n=t:n=t.querySelector(".dgComponentSelected"),n&&nr(n)}function ai(t){const{formSchemaUtils:n,formStateMachineUtils:e}=t;function r(c,d=""){return{path:d+c.code,field:c.id,fullPath:c.code}}function o(c,d=""){return n.getViewModelById(c).states.map(u=>r(u,d))}function i(c){const d=n.getRootViewModelId(),f=o(c);if(c===d)return f;const u=o(d,"root-component.");return[...f,...u]}function s(c){return c.binding&&c.binding.path||c.id||""}function l(){return e&&e.getRenderStates()||[]}return{getVariables:i,getControlName:s,getStateMachines:l}}class rr{constructor(n){D(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'"}]);D(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});D(this,"getExpressionConverter",(n,e)=>({convertFrom:(r,o,i,s)=>{const l=i.getExpressionRuleValue(n,e||o);return l&&l.value||""},convertTo:(r,o,i,s,l)=>{var c;if(o==="dataPicking"&&(i!=null&&i.target)){const d=`${i.target}_dataPicking`;((c=i.rules)==null?void 0:c.some(u=>u.id===d&&u.value))?r.dictPickingExpressionId=d:delete r.dictPickingExpressionId}s.updateExpression(i)}}));this.formSchemaService=n}getExpressionRule(n,e){const r=this.formSchemaService.getExpressions();if(!r)return"";const o=r.find(s=>s.target===n);if(!o)return"";const i=o.rules.find(s=>s.type===e);return i||""}getContextFormVariables(){const{module:n}=this.formSchemaService.getFormSchema();if(!n.viewmodels||n.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),r=this.formSchemaService.getViewModelById(e);if(!r||!r.states||r.states.length===0)return[];const o=[];return r.states.forEach(i=>{o.push({key:i.code,name:i.name,description:i.name,category:i.category})}),o}createTreeNode(n,e,r="label"){return{id:n.id,name:n.name,bindingPath:n[r],parents:e}}buildEntityFieldsTreeData(n=null,e){const r=[];return n==null||n.forEach(o=>{var l;const i=this.createTreeNode(o,e);let s=[];(l=o.type)!=null&&l.fields&&(s=this.buildEntityFieldsTreeData(o.type.fields,[...e,o.label])),r.push({data:i,children:s,expanded:!0})}),r}buildChildEntityTreeData(n=null,e){const r=[];return n==null||n.forEach(o=>{var c,d;const i=this.createTreeNode(o,e),s=this.buildEntityFieldsTreeData((c=o.type)==null?void 0:c.fields,[...e,o.label]),l=this.buildChildEntityTreeData((d=o.type)==null?void 0:d.entities,[...e,o.label]);l!=null&&l.length&&(s==null||s.push(...l)),r.push({data:i,children:s||[],expanded:!0})}),r}getEntitiesTreeData(){const n=this.formSchemaService.getSchemaEntities();if(!(n!=null&&n.length))return[];const e=n[0];if(!(e!=null&&e.type))return[];const r=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),o=this.buildChildEntityTreeData(e.type.entities,[e.code]);return o!=null&&o.length&&(r==null||r.push(...o)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:r||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(n,e,r){const o=r==="Field"?n.binding.field:n.id,i=this.getExpressionRule(o,e),s=this.getEntitiesAndVariables(),l={message:["validate","required","dataPicking"].includes(e)&&i?i.message:"",...s};return i.messageType!=null&&(l.messageType=i.messageType),l}buildRule(n,e,r,o){const{expression:i,message:s,messageType:l}=e,c={id:`${n}_${r}`,type:r,value:i};return(r==="validate"||r==="dataPicking"||r==="required")&&(c.message=s),r==="dataPicking"&&(c.messageType=l),r==="validate"&&o&&(c.elementId=o),c}getExpressionData(){const{expressions:n}=this.formSchemaService.getFormSchema().module;return n||[]}updateExpression(n,e,r,o){const i=e==="Field"?n.binding.field:n.id,s=this.buildRule(i,r,o,n.type==="form-group"?n.id:"");let c=this.getExpressionData().find(f=>f.targetType===e&&f.target===i);const d=f=>f.value.trim()==="";if(c){const f=c.rules.find(u=>u.id===s.id);if(f)d(s)?c.rules=c.rules.filter(u=>u.id!==s.id):(Object.assign(f,s),o==="validate"&&n.type==="form-group"&&(f.elementId=n.id));else{if(d(s))return null;c.rules=c.rules||[],c.rules.push(s)}}else{if(d(s))return null;c={target:`${i}`,rules:[s],targetType:e}}return c}getExpressionEditorOptions(n,e,r,o){return r.reduce((i,s)=>{var c,d;const l=e==="Field"?(c=n==null?void 0:n.binding)==null?void 0:c.field:n.id;return i[s]={hide:e==="Field"?!!((d=n==null?void 0:n.binding)!=null&&d.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(l),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(n,s,e),onSubmitModal:f=>{const u=this.updateExpression(n,e,f,s);if(o){const p=this.buildRule(l,f,s);o(p)}return u}}},i},{})}getExpressionInfo(n,e,r){const o=e==="Field"?n.binding.field:n.id,i=this.getExpressionRule(o,r),s={value:i&&i.value,targetId:o,targetType:e,expressionType:r};return i&&i.message&&(s.message=i.message),s}getExpressionConfig(n,e,r=["compute","dependency","validate"],o){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(n,e,r,o)}}}getExpressionOptions(n,e,r){const o=this.getExpressionInfo(n,e,r);return{dialogTitle:`${this.expressionNames[r]}编辑器`,singleExpand:!1,showMessage:r==="required",beforeOpen:()=>this.onBeforeOpenExpression(n,r,e),expressionInfo:o}}}class or{constructor(n,e){D(this,"componentId");D(this,"viewModelId");D(this,"eventsEditorUtils");D(this,"formSchemaUtils");D(this,"formMetadataConverter");D(this,"designViewModelUtils");D(this,"designViewModelField");D(this,"controlCreatorUtils");D(this,"designerHostService");D(this,"schemaService",null);D(this,"metadataService",null);D(this,"propertyConfig",{type:"object",categories:{}});var r;this.componentId=n,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(n))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService}getTableInfo(){var n;return(n=this.schemaService)==null?void 0:n.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(n){var r;const e=n.binding&&n.binding.type==="Form"&&n.binding.field;if(e){if(!this.designViewModelField){const o=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=o.fields.find(i=>i.id===e)}n.updateOn=(r=this.designViewModelField)==null?void 0:r.updateOn}}getBasicPropConfig(n){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:n.type,name:oe[n.type].name}]}}}}}getAppearanceConfig(n=null,e={},r){const o={title:"外观",description:"Appearance"},i={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const s in e)i[s]=Object.assign(i[s]||{},e[s]);return{...o,properties:{...i},setPropertyRelates(s,l){if(s){switch(s&&s.propertyID){case"class":case"style":{Mt.value++;break}}r&&r(s