@farris/ui-vue 1.3.4 → 1.3.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/accordion/index.esm.js +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +9 -7
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +746 -730
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +9 -7
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3096 -3069
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +78 -82
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +501 -487
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +487 -472
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +440 -433
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +594 -587
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +2766 -2739
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +314 -298
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +862 -843
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1031 -1015
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +776 -770
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +296 -283
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +634 -619
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +383 -376
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +595 -575
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +5492 -5470
- package/farris.all.umd.cjs +13 -13
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function($,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("lodash-es"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","bignumber.js"],o):($=typeof globalThis<"u"?globalThis:$||self,o($.layout={},$.Vue,$.LodashES))})(this,function($,o,D){"use strict";const V={},F={};function N(t){const{properties:e,title:n,ignore:a}=t,l=a&&Array.isArray(a),s=Object.keys(e).reduce((p,g)=>((!l||!a.find(P=>P===g))&&(p[g]=e[g].type==="object"&&e[g].properties?N(e[g]):D.cloneDeep(e[g].default)),p),{});if(n&&(!l||!a.find(p=>p==="id"))){const p=n.toLowerCase().replace(/-/g,"_");s.id=`${p}_${Math.random().toString().slice(2,6)}`}return s}function q(t,e={},n){const a=V[t];if(a){let l=N(a);const s=F[t];return l=s?s({getSchemaByType:q},l,e,n):l,l}return null}function J(t,e){const n=N(e);return Object.keys(n).reduce((a,l)=>(a[l]&&D.isPlainObject(a[l])&&D.isPlainObject(t[l]||!t[l])?Object.assign(a[l],t[l]||{}):a[l]=t[l],a),n),n}function Z(t,e){return Object.keys(t).filter(a=>t[a]!=null).reduce((a,l)=>{if(e.has(l)){const s=e.get(l);if(typeof s=="string")a[s]=t[l];else{const p=s(l,t[l],t);Object.assign(a,p)}}else a[l]=t[l];return a},{})}function x(t,e,n=new Map){const a=J(t,e);return Z(a,n)}function K(t={}){function e(r,y,u,v){if(typeof u=="number")return v[r].length===u;if(typeof u=="object"){const C=Object.keys(u)[0],R=u[C];if(C==="not")return Number(v[r].length)!==Number(R);if(C==="moreThan")return Number(v[r].length)>=Number(R);if(C==="lessThan")return Number(v[r].length)<=Number(R)}return!1}function n(r,y,u,v){return v[r]&&v[r].propertyValue&&String(v[r].propertyValue.value)===String(u)}const a=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((r,y)=>(r.set(y,t[y]),r),a);function l(r,y){const u=r;return typeof y=="number"?[{target:u,operator:"length",param:null,value:Number(y)}]:typeof y=="boolean"?[{target:u,operator:"getProperty",param:r,value:!!y}]:typeof y=="object"?Object.keys(y).map(v=>{if(v==="length")return{target:u,operator:"length",param:null,value:y[v]};const C=v,R=y[v];return{target:u,operator:"getProperty",param:C,value:R}}):[]}function s(r){return Object.keys(r).reduce((u,v)=>{const C=l(v,r[v]);return u.push(...C),u},[])}function p(r,y){if(a.has(r.operator)){const u=a.get(r.operator);return u&&u(r.target,r.param,r.value,y)||!1}return!1}function g(r,y){return s(r).reduce((C,R)=>C&&p(R,y),!0)}function P(r,y){const u=Object.keys(r),v=u.includes("allOf"),C=u.includes("anyOf"),R=v||C,f=(R?r[R?v?"allOf":"anyOf":"allOf"]:[r]).map(h=>g(h,y));return v?!f.includes(!1):f.includes(!0)}return{parseValueSchema:P}}const T={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},I={},ee={};K();function W(t,e,n=new Map,a=(p,g,P,r)=>g,l={},s=p=>p){return V[e.title]=e,F[e.title]=a,I[e.title]=l,ee[e.title]=s,(p={})=>{const g=x(p,e,n),P=Object.keys(t).reduce((r,y)=>(r[y]=t[y].default,r),{});return Object.assign(P,g)}}function te(t,e){return{customClass:e.class,customStyle:e.style}}const _=new Map([["appearance",te]]);function G(t,e,n){return e}const ne={$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"]},oe={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"}}}}},k={customStyle:{type:String,defaut:""},customClass:{type:String,defaut:""}},L=W(k,ne,_,G,oe);function Y(t){const e=o.ref(-1),n=o.ref(-1),a=o.ref(0),l=o.ref(0),s=o.ref(!1),p=o.ref(!1),g=o.computed(()=>({display:s.value?"block":"none",left:`${a.value}px`,cursor:"e-resize"})),P=o.computed(()=>({display:p.value?"block":"none",top:`${l.value}px`,cursor:"n-resize"})),r=o.computed(()=>({display:p.value||s.value?"block":"none"}));function y(b,f,d,h){const O=t.value;if(O){const{left:i,right:c,width:z}=O.getBoundingClientRect();let m=b.clientX-i;h==="right"&&(m=c-b.clientX),m>f&&(m=f),m<d&&(m=d),h==="right"&&(m=z-m),a.value=m}}function u(b,f,d,h){const O=t.value;if(O){const{top:i,bottom:c,height:z}=O.getBoundingClientRect();let m=b.clientY-i;h==="bottom"&&(m=c-b.clientY),m>f&&(m=f),m<d&&(m=d),h==="bottom"&&(m=z-m),l.value=m}}function v(){const b=t.value;if(b){const{width:f,height:d}=b.getBoundingClientRect();return{width:f,height:d}}return null}function C(){const b=t.value;return b?Array.from(b.querySelectorAll("[data-position]")).reduce((f,d)=>{const h=d.getAttribute("data-position");return f=Object.assign(f,{[h]:d}),f},{}):null}function R(b,f){const d=v(),h=C();if(d&&h){const O=h==null?void 0:h.right,i=h==null?void 0:h.left;if(b==="left"&&i)return O?d.width-O.clientWidth-f:d.width-f;if(b==="right"&&O)return i?d.width-i.clientWidth-f:d.width-f}}function w(b,f){const d=v(),h=C();if(d&&h){const O=h==null?void 0:h.bottom,i=h==null?void 0:h.top;if(b==="top"&&i)return O?d.height-O.clientHeight-f:d.height-f;if(b==="bottom"&&O)return i?d.height-i.clientHeight-f:d.height-f}}return{horizontalResizeHandleStyle:g,verticalResizeHandleStyle:P,resizeOverlayStyle:r,showHorizontalResizeHandle:s,showVerticalResizeHandle:p,horizontalResizeBarPosition:e,verticalResizeBarPosition:n,verticalResizeHandleOffset:l,horizontalResizeHandleOffset:a,draggingHorizontalResizeHandle:y,draggingVerticalResizeHandle:u,getPanelMaxHeight:w,getPanelMaxWidth:R}}const ae=["moz","ms","webkit"];function ie(){let t=0;return e=>{const n=new Date().getTime(),a=Math.max(0,16-(n-t)),l=setTimeout(()=>{e(n+a)},a);return t=n+a,l}}function re(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=ae.filter(e=>`${e}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:ie()}re();function le(t,e){return((e==null?void 0:e.split(" "))||[]).reduce((a,l)=>(l&&(a[l]=!0),a),t),t}function se(t,e){return((e==null?void 0:e.split(";"))||[]).reduce((a,l)=>{if(l){const s=l.split(":");a[s[0]]=s[1]}return a},t),t}const M=o.defineComponent({name:"FLayout",props:k,emits:[],setup(t,e){const n=o.ref(),a=Y(n),{horizontalResizeHandleStyle:l,verticalResizeHandleStyle:s,resizeOverlayStyle:p}=a;o.provide("layout",{useResizeHandleComposition:a});const g=o.computed(()=>le({"f-layout":!0},t==null?void 0:t.customClass)),P=o.computed(()=>se({},t==null?void 0:t.customStyle));return()=>o.createVNode("div",{class:g.value,style:P.value,ref:n},[e.slots.default&&e.slots.default(),o.createVNode("div",{class:"f-layout-resize-overlay",style:p.value},null),o.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:l.value},null),o.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:s.value},null)])}}),ce={$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}}},ue={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:"是否可见"}}}}},E={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}},X=W(E,ce,_,G,ue);function U(t,e,n,a,l){const{horizontalResizeBarPosition:s,horizontalResizeHandleOffset:p,showHorizontalResizeHandle:g,showVerticalResizeHandle:P,verticalResizeBarPosition:r,verticalResizeHandleOffset:y,draggingHorizontalResizeHandle:u,draggingVerticalResizeHandle:v,getPanelMaxHeight:C,getPanelMaxWidth:R}=l;let w="",b,f,d;function h(c){if((w==="left"||w==="right")&&f){const{left:z}=f.getBoundingClientRect(),{width:m}=b.getBoundingClientRect(),S=c.clientX-z;let B=w==="left"?(m||0)+(S-s.value):(m||0)-(S-s.value);B=n.value>0?Math.max(n.value,B):B;const j=R(w,n.value);j!=null&&(B=j>B?B:j),t.value=B}if((w==="top"||w==="bottom")&&f){const{top:z}=f.getBoundingClientRect(),{height:m}=b.getBoundingClientRect(),S=c.clientY-z;let B=w==="top"?(m||0)+(S-r.value):(m||0)-(S-r.value);B=a.value>0?Math.max(a.value,B):B;const j=C(w,a.value);j!=null&&(B=j>B?B:j),e.value=B}p.value=0,y.value=0,s.value=-1,r.value=-1,g.value=!1,P.value=!1,document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",h),document.body.style.userSelect="",w="",b=null,f=null}function O(c,z,m){if(w=z,b=m,g.value=!0,f=c.composedPath().find(B=>(B.className||"").split(" ")[0]==="f-layout"),f){const{left:B}=f.getBoundingClientRect(),j=c.clientX-B;p.value=j,s.value=j;const A=R(w,n.value)||0;d=he=>u(he,A,n.value,w),document.addEventListener("mousemove",d),document.addEventListener("mouseup",h),document.body.style.userSelect="none"}}function i(c,z,m){if(w=z,b=m,P.value=!0,f=c.composedPath().find(B=>(B.className||"").split(" ")[0]==="f-layout"),f){const{top:B}=f.getBoundingClientRect();y.value=c.clientY-B,r.value=c.clientY-B;const j=C(w,a.value)||0;d=A=>v(A,j,a.value,w),document.addEventListener("mousemove",d),document.addEventListener("mouseup",h),document.body.style.userSelect="none"}}return{onClickHorizontalResizeBar:O,onClickVerticalResizeBar:i}}const H=o.defineComponent({name:"FLayoutPane",props:E,emits:[],setup(t,e){const n=o.ref(t.minHeight<=0?100:t.minHeight),a=o.ref(t.minWidth<=0?100:t.minWidth),l=o.ref(t.width<=0?100:t.width),s=o.ref(t.height<=100?100:t.height),p=o.ref(Math.max(n.value,s.value)),g=o.ref(Math.max(a.value,l.value)),P=o.ref(),r=o.ref(t.position),y=o.ref(t.resizable);o.watch(()=>t.resizable,i=>{y.value=i});const u=o.inject("layout"),{useResizeHandleComposition:v}=u,C=U(g,p,a,n,v),{onClickHorizontalResizeBar:R,onClickVerticalResizeBar:w}=C,b=o.computed(()=>({"f-layout-resize-bar":!0,"f-layout-resize-bar-e":r.value==="left","f-layout-resize-bar-n":r.value==="bottom","f-layout-resize-bar-s":r.value==="top","f-layout-resize-bar-w":r.value==="right"})),f=o.computed(()=>r.value!=="center"&&y.value);function d(i,c){(c==="left"||c==="right")&&R(i,c,P.value),(c==="top"||c==="bottom")&&w(i,c,P.value)}const h=o.computed(()=>{const i={"f-layout-pane":!0,"f-page-content-nav":r.value==="left"||r.value==="right","f-page-content-main":r.value==="center"};return t.customClass&&String(t.customClass).split(" ").reduce((c,z)=>(c[z]=!0,c),i),i}),O=o.computed(()=>{const i={};return(g.value&&r.value==="left"||r.value==="right")&&(i.width=`${g.value}px`),(p.value&&r.value==="bottom"||r.value==="top")&&(i.height=`${p.value}px`),t.visible||(i.display="none"),i});return()=>o.createVNode("div",{ref:P,class:h.value,style:O.value,"data-position":r.value},[e.slots.default&&e.slots.default(),f.value&&o.createVNode("span",{class:b.value,onMousedown:i=>d(i,r.value)},null)])}});function pe(t,e){function n(){return!1}return{canAccepts:n}}function Q(t,e,n){var O;const a=n&&n.getStyles&&n.getStyles()||"",l=n&&n.getDesignerClass&&n.getDesignerClass()||"",s=o.ref();function p(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function g(){return!1}function P(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function r(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function y(i){if(!i||!i.value)return null;if(i.value.schema&&i.value.schema.type==="component")return i.value;const c=o.ref(i==null?void 0:i.value.parent),z=y(c);return z||null}function u(i=e){const{componentInstance:c,designerItemElementRef:z}=i;return!c||!c.value?null:c.value.canMove?z:u(i.parent)}function v(i){return!!n&&n.canAccepts(i)}function C(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function R(){}function w(i,c){c&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(c)}function b(i,c){const{componentType:z}=i;let m=q(z,i,c);n&&n.onResolveNewComponentSchema&&(m=n.onResolveNewComponentSchema(i,m));const S=z.toLowerCase().replace(/-/g,"_");return m&&!m.id&&m.type===z&&(m.id=`${S}_${Math.random().toString().slice(2,6)}`),m}function f(i){}function d(...i){if(n&&n.getPropsConfig)return n.getPropsConfig(...i)}function h(){n&&n.onRemoveComponent&&n.onRemoveComponent(),e!=null&&e.schema.contents&&e.schema.contents.map(i=>{var m;let c=i.id;i.type==="component-ref"&&(c=i.component);const z=t.value.querySelector(`#${c}-design-item`);(m=z==null?void 0:z.componentInstance)!=null&&m.value.onRemoveComponent&&z.componentInstance.value.onRemoveComponent()})}return s.value={canMove:p(),canSelectParent:g(),canDelete:P(),canNested:!r(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(O=e==null?void 0:e.parent)==null?void 0:O.componentInstance,schema:e==null?void 0:e.schema,styles:a,designerClass:l,canAccepts:v,getBelongedComponentInstance:y,getDraggableDesignItemElement:u,getDraggingDisplayText:C,getPropConfig:d,getDragScopeElement:R,onAcceptMovedChildElement:w,onChildElementMovedOut:f,addNewChildComponentSchema:b,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||o.ref(!1),onRemoveComponent:h},s}const fe=o.defineComponent({name:"FLayoutDesign",props:k,emits:[],setup(t,e){var y;const n=o.ref(),a=o.inject("design-item-context"),l=pe(a.schema,(y=a.parent)==null?void 0:y.schema),s=Q(n,a,l);s.value.canNested=!1;const p=Y(n),{horizontalResizeHandleStyle:g,verticalResizeHandleStyle:P,resizeOverlayStyle:r}=p;return o.provide("layout",{useResizeHandleComposition:p}),o.onMounted(()=>{n.value.componentInstance=s}),e.expose(s.value),()=>o.createVNode("div",{class:"f-layout f-page-content",ref:n},[e.slots.default&&e.slots.default(),o.createVNode("div",{class:"f-layout-resize-overlay",style:r.value},null),o.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:g.value},null),o.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:P.value},null)])}});function ye(){function t(e,n){var p;if(!e)return!1;const a=((p=e.targetContainer)==null?void 0:p.componentInstance)&&e.targetContainer.componentInstance.value;if(!a)return!1;const l=a.schema.type,s=n==null?void 0:n.formSchemaUtils.getComponentById(a.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![T["response-layout-item"].type,T["response-form"].type].includes(l)||(e.componentType===T.tabs.type||e.componentType===T.section.type)&&((s==null?void 0:s.componentType)!=="frame"||![T["content-container"].type,T["splitter-pane"].type,T["response-layout-item"].type].includes(l)))}return{basalDragulaRuleForContainer:t}}function me(t,e){const n=t.schema;function a(s){return!!ye().basalDragulaRuleForContainer(s)}function l(){const s=["f-layout-pane"];return(n.position==="left"||n.position==="right")&&s.push("f-page-content-nav"),n.position==="center"&&s.push("f-page-content-main"),s.join(" ")}return{canAccepts:a,getDesignerClass:l}}const de=o.defineComponent({name:"FLayoutPaneDesign",props:E,emits:[],setup(t,e){const n=o.ref(),a=o.ref();o.inject("designer-host-service");const l=o.inject("design-item-context"),s=me(l),p=Q(a,l,s);p.value.canNested=!1,p.value.canMove=!1,p.value.canDelete=!1,o.onMounted(()=>{a.value.componentInstance=p}),e.expose(p.value);const g=o.ref(Math.max(t.minHeight,t.height)),P=o.ref(Math.max(t.minWidth,t.width)),r=o.ref(t.minHeight),y=o.ref(t.minWidth),u=o.ref(t.position),v=o.inject("layout"),{useResizeHandleComposition:C}=v,R=U(P,g,y,r,C),{onClickHorizontalResizeBar:w,onClickVerticalResizeBar:b}=R,f=o.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 d(i,c){(c==="left"||c==="right")&&w(i,c,n.value),(c==="top"||c==="bottom")&&b(i,c,n.value)}const h=o.computed(()=>{const i={"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((c,z)=>(c[z]=!0,c),i),i}),O=o.computed(()=>{const i={flex:"1"};return(P.value&&u.value==="left"||u.value==="right")&&(i.width=`${P.value}px`),(g.value&&u.value==="bottom"||u.value==="top")&&(i.height=`${g.value}px`),i});return()=>o.createVNode("div",{ref:n,class:h.value,style:O.value},[o.createVNode("div",{ref:a,class:"drag-container","data-dragref":`${l.schema.id}-container`},[e.slots.default&&e.slots.default()]),o.createVNode("span",{class:f.value,onMousedown:i=>d(i,u.value)},null)])}});M.install=t=>{t.component(M.name,M),t.component(H.name,H)},M.register=(t,e,n,a)=>{t.layout=M,e.layout=L,t["layout-pane"]=H,e["layout-pane"]=X},M.registerDesigner=(t,e,n)=>{t.layout=fe,e.layout=L,t["layout-pane"]=de,e["layout-pane"]=X},$.FLayout=M,$.FLayoutPane=H,$.default=M,$.layoutProps=k,$.layoutPropsResolver=L,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(O,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("lodash-es"),require("bignumber.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","bignumber.js"],a):(O=typeof globalThis<"u"?globalThis:O||self,a(O.layout={},O.Vue,O.LodashES))})(this,function(O,a,k){"use strict";const V={},F={};function N(t){const{properties:e,title:n,ignore:o}=t,r=o&&Array.isArray(o),s=Object.keys(e).reduce((c,g)=>((!r||!o.find(P=>P===g))&&(c[g]=e[g].type==="object"&&e[g].properties?N(e[g]):k.cloneDeep(e[g].default)),c),{});if(n&&(!r||!o.find(c=>c==="id"))){const c=n.toLowerCase().replace(/-/g,"_");s.id=`${c}_${Math.random().toString().slice(2,6)}`}return s}function J(t){const{properties:e,title:n,required:o}=t;if(o&&Array.isArray(o)){const r=o.reduce((s,c)=>(s[c]=e[c].type==="object"&&e[c].properties?N(e[c]):k.cloneDeep(e[c].default),s),{});if(n&&o.find(s=>s==="id")){const s=n.toLowerCase().replace(/-/g,"_");r.id=`${s}_${Math.random().toString().slice(2,6)}`}return r}return{type:n}}function q(t,e={},n){const o=V[t];if(o){let r=J(o);const s=F[t];return r=s?s({getSchemaByType:q},r,e,n):r,r}return null}function Z(t,e){const n=N(e);return Object.keys(n).reduce((o,r)=>(Object.prototype.hasOwnProperty.call(t,r)&&(o[r]&&k.isPlainObject(o[r])&&k.isPlainObject(t[r]||!t[r])?Object.assign(o[r],t[r]||{}):o[r]=t[r]),o),n),n}function x(t,e){return Object.keys(t).filter(o=>t[o]!=null).reduce((o,r)=>{if(e.has(r)){const s=e.get(r);if(typeof s=="string")o[s]=t[r];else{const c=s(r,t[r],t);Object.assign(o,c)}}else o[r]=t[r];return o},{})}function K(t,e,n=new Map){const o=Z(t,e);return x(o,n)}function I(t={}){function e(l,y,p,v){if(typeof p=="number")return v[l].length===p;if(typeof p=="object"){const C=Object.keys(p)[0],B=p[C];if(C==="not")return Number(v[l].length)!==Number(B);if(C==="moreThan")return Number(v[l].length)>=Number(B);if(C==="lessThan")return Number(v[l].length)<=Number(B)}return!1}function n(l,y,p,v){return v[l]&&v[l].propertyValue&&String(v[l].propertyValue.value)===String(p)}const o=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((l,y)=>(l.set(y,t[y]),l),o);function r(l,y){const p=l;return typeof y=="number"?[{target:p,operator:"length",param:null,value:Number(y)}]:typeof y=="boolean"?[{target:p,operator:"getProperty",param:l,value:!!y}]:typeof y=="object"?Object.keys(y).map(v=>{if(v==="length")return{target:p,operator:"length",param:null,value:y[v]};const C=v,B=y[v];return{target:p,operator:"getProperty",param:C,value:B}}):[]}function s(l){return Object.keys(l).reduce((p,v)=>{const C=r(v,l[v]);return p.push(...C),p},[])}function c(l,y){if(o.has(l.operator)){const p=o.get(l.operator);return p&&p(l.target,l.param,l.value,y)||!1}return!1}function g(l,y){return s(l).reduce((C,B)=>C&&c(B,y),!0)}function P(l,y){const p=Object.keys(l),v=p.includes("allOf"),C=p.includes("anyOf"),B=v||C,f=(B?l[B?v?"allOf":"anyOf":"allOf"]:[l]).map(h=>g(h,y));return v?!f.includes(!1):f.includes(!0)}return{parseValueSchema:P}}const T={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},ee={},te={};I();function W(t,e,n=new Map,o=(c,g,P,l)=>g,r={},s=c=>c){return V[e.title]=e,F[e.title]=o,ee[e.title]=r,te[e.title]=s,(c={})=>{const g=K(c,e,n),P=Object.keys(t).reduce((l,y)=>(l[y]=t[y].default,l),{});return Object.assign(P,g)}}function ne(t,e){return{customClass:e.class,customStyle:e.style}}const _=new Map([["appearance",ne]]);function G(t,e,n){return e}const oe={$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"]},ae={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"}}}}},D={customStyle:{type:String,defaut:""},customClass:{type:String,defaut:""}},L=W(D,oe,_,G,ae);function Y(t){const e=a.ref(-1),n=a.ref(-1),o=a.ref(0),r=a.ref(0),s=a.ref(!1),c=a.ref(!1),g=a.computed(()=>({display:s.value?"block":"none",left:`${o.value}px`,cursor:"e-resize"})),P=a.computed(()=>({display:c.value?"block":"none",top:`${r.value}px`,cursor:"n-resize"})),l=a.computed(()=>({display:c.value||s.value?"block":"none"}));function y(b,f,d,h){const S=t.value;if(S){const{left:i,right:u,width:z}=S.getBoundingClientRect();let m=b.clientX-i;h==="right"&&(m=u-b.clientX),m>f&&(m=f),m<d&&(m=d),h==="right"&&(m=z-m),o.value=m}}function p(b,f,d,h){const S=t.value;if(S){const{top:i,bottom:u,height:z}=S.getBoundingClientRect();let m=b.clientY-i;h==="bottom"&&(m=u-b.clientY),m>f&&(m=f),m<d&&(m=d),h==="bottom"&&(m=z-m),r.value=m}}function v(){const b=t.value;if(b){const{width:f,height:d}=b.getBoundingClientRect();return{width:f,height:d}}return null}function C(){const b=t.value;return b?Array.from(b.querySelectorAll("[data-position]")).reduce((f,d)=>{const h=d.getAttribute("data-position");return f=Object.assign(f,{[h]:d}),f},{}):null}function B(b,f){const d=v(),h=C();if(d&&h){const S=h==null?void 0:h.right,i=h==null?void 0:h.left;if(b==="left"&&i)return S?d.width-S.clientWidth-f:d.width-f;if(b==="right"&&S)return i?d.width-i.clientWidth-f:d.width-f}}function w(b,f){const d=v(),h=C();if(d&&h){const S=h==null?void 0:h.bottom,i=h==null?void 0:h.top;if(b==="top"&&i)return S?d.height-S.clientHeight-f:d.height-f;if(b==="bottom"&&S)return i?d.height-i.clientHeight-f:d.height-f}}return{horizontalResizeHandleStyle:g,verticalResizeHandleStyle:P,resizeOverlayStyle:l,showHorizontalResizeHandle:s,showVerticalResizeHandle:c,horizontalResizeBarPosition:e,verticalResizeBarPosition:n,verticalResizeHandleOffset:r,horizontalResizeHandleOffset:o,draggingHorizontalResizeHandle:y,draggingVerticalResizeHandle:p,getPanelMaxHeight:w,getPanelMaxWidth:B}}const ie=["moz","ms","webkit"];function re(){let t=0;return e=>{const n=new Date().getTime(),o=Math.max(0,16-(n-t)),r=setTimeout(()=>{e(n+o)},o);return t=n+o,r}}function le(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=ie.filter(e=>`${e}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:re()}le();function se(t,e){return((e==null?void 0:e.split(" "))||[]).reduce((o,r)=>(r&&(o[r]=!0),o),t),t}function ce(t,e){return((e==null?void 0:e.split(";"))||[]).reduce((o,r)=>{if(r){const s=r.split(":");o[s[0]]=s[1]}return o},t),t}const M=a.defineComponent({name:"FLayout",props:D,emits:[],setup(t,e){const n=a.ref(),o=Y(n),{horizontalResizeHandleStyle:r,verticalResizeHandleStyle:s,resizeOverlayStyle:c}=o;a.provide("layout",{useResizeHandleComposition:o});const g=a.computed(()=>se({"f-layout":!0},t==null?void 0:t.customClass)),P=a.computed(()=>ce({},t==null?void 0:t.customStyle));return()=>a.createVNode("div",{class:g.value,style:P.value,ref:n},[e.slots.default&&e.slots.default(),a.createVNode("div",{class:"f-layout-resize-overlay",style:c.value},null),a.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:r.value},null),a.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:s.value},null)])}}),ue={$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"]},pe={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:"是否可见"}}}}},A={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}},X=W(A,ue,_,G,pe);function U(t,e,n,o,r){const{horizontalResizeBarPosition:s,horizontalResizeHandleOffset:c,showHorizontalResizeHandle:g,showVerticalResizeHandle:P,verticalResizeBarPosition:l,verticalResizeHandleOffset:y,draggingHorizontalResizeHandle:p,draggingVerticalResizeHandle:v,getPanelMaxHeight:C,getPanelMaxWidth:B}=r;let w="",b,f,d;function h(u){if((w==="left"||w==="right")&&f){const{left:z}=f.getBoundingClientRect(),{width:m}=b.getBoundingClientRect(),j=u.clientX-z;let $=w==="left"?(m||0)+(j-s.value):(m||0)-(j-s.value);$=n.value>0?Math.max(n.value,$):$;const R=B(w,n.value);R!=null&&($=R>$?$:R),t.value=$}if((w==="top"||w==="bottom")&&f){const{top:z}=f.getBoundingClientRect(),{height:m}=b.getBoundingClientRect(),j=u.clientY-z;let $=w==="top"?(m||0)+(j-l.value):(m||0)-(j-l.value);$=o.value>0?Math.max(o.value,$):$;const R=C(w,o.value);R!=null&&($=R>$?$:R),e.value=$}c.value=0,y.value=0,s.value=-1,l.value=-1,g.value=!1,P.value=!1,document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",h),document.body.style.userSelect="",w="",b=null,f=null}function S(u,z,m){if(w=z,b=m,g.value=!0,f=u.composedPath().find($=>($.className||"").split(" ")[0]==="f-layout"),f){const{left:$}=f.getBoundingClientRect(),R=u.clientX-$;c.value=R,s.value=R;const E=B(w,n.value)||0;d=be=>p(be,E,n.value,w),document.addEventListener("mousemove",d),document.addEventListener("mouseup",h),document.body.style.userSelect="none"}}function i(u,z,m){if(w=z,b=m,P.value=!0,f=u.composedPath().find($=>($.className||"").split(" ")[0]==="f-layout"),f){const{top:$}=f.getBoundingClientRect();y.value=u.clientY-$,l.value=u.clientY-$;const R=C(w,o.value)||0;d=E=>v(E,R,o.value,w),document.addEventListener("mousemove",d),document.addEventListener("mouseup",h),document.body.style.userSelect="none"}}return{onClickHorizontalResizeBar:S,onClickVerticalResizeBar:i}}const H=a.defineComponent({name:"FLayoutPane",props:A,emits:[],setup(t,e){const n=a.ref(t.minHeight<=0?100:t.minHeight),o=a.ref(t.minWidth<=0?100:t.minWidth),r=a.ref(t.width<=0?100:t.width),s=a.ref(t.height<=100?100:t.height),c=a.ref(Math.max(n.value,s.value)),g=a.ref(Math.max(o.value,r.value)),P=a.ref(),l=a.ref(t.position),y=a.ref(t.resizable);a.watch(()=>t.resizable,i=>{y.value=i});const p=a.inject("layout"),{useResizeHandleComposition:v}=p,C=U(g,c,o,n,v),{onClickHorizontalResizeBar:B,onClickVerticalResizeBar:w}=C,b=a.computed(()=>({"f-layout-resize-bar":!0,"f-layout-resize-bar-e":l.value==="left","f-layout-resize-bar-n":l.value==="bottom","f-layout-resize-bar-s":l.value==="top","f-layout-resize-bar-w":l.value==="right"})),f=a.computed(()=>l.value!=="center"&&y.value);function d(i,u){(u==="left"||u==="right")&&B(i,u,P.value),(u==="top"||u==="bottom")&&w(i,u,P.value)}const h=a.computed(()=>{const i={"f-layout-pane":!0,"f-page-content-nav":l.value==="left"||l.value==="right","f-page-content-main":l.value==="center"};return t.customClass&&String(t.customClass).split(" ").reduce((u,z)=>(u[z]=!0,u),i),i}),S=a.computed(()=>{const i={};return(g.value&&l.value==="left"||l.value==="right")&&(i.width=`${g.value}px`),(c.value&&l.value==="bottom"||l.value==="top")&&(i.height=`${c.value}px`),t.visible||(i.display="none"),i});return()=>a.createVNode("div",{ref:P,class:h.value,style:S.value,"data-position":l.value},[e.slots.default&&e.slots.default(),f.value&&a.createVNode("span",{class:b.value,onMousedown:i=>d(i,l.value)},null)])}});function fe(t,e){function n(){return!1}return{canAccepts:n}}function Q(t,e,n){var S;const o=n&&n.getStyles&&n.getStyles()||"",r=n&&n.getDesignerClass&&n.getDesignerClass()||"",s=a.ref();function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function g(){return!1}function P(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function l(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function y(i){if(!i||!i.value)return null;if(i.value.schema&&i.value.schema.type==="component")return i.value;const u=a.ref(i==null?void 0:i.value.parent),z=y(u);return z||null}function p(i=e){const{componentInstance:u,designerItemElementRef:z}=i;return!u||!u.value?null:u.value.canMove?z:p(i.parent)}function v(i){return!!n&&n.canAccepts(i)}function C(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function B(){}function w(i,u){u&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(u)}function b(i,u){const{componentType:z}=i;let m=q(z,i,u);n&&n.onResolveNewComponentSchema&&(m=n.onResolveNewComponentSchema(i,m));const j=z.toLowerCase().replace(/-/g,"_");return m&&!m.id&&m.type===z&&(m.id=`${j}_${Math.random().toString().slice(2,6)}`),m}function f(i){}function d(...i){if(n&&n.getPropsConfig)return n.getPropsConfig(...i)}function h(){n&&n.onRemoveComponent&&n.onRemoveComponent(),e!=null&&e.schema.contents&&e.schema.contents.map(i=>{var m;let u=i.id;i.type==="component-ref"&&(u=i.component);const z=t.value.querySelector(`#${u}-design-item`);(m=z==null?void 0:z.componentInstance)!=null&&m.value.onRemoveComponent&&z.componentInstance.value.onRemoveComponent()})}return s.value={canMove:c(),canSelectParent:g(),canDelete:P(),canNested:!l(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(S=e==null?void 0:e.parent)==null?void 0:S.componentInstance,schema:e==null?void 0:e.schema,styles:o,designerClass:r,canAccepts:v,getBelongedComponentInstance:y,getDraggableDesignItemElement:p,getDraggingDisplayText:C,getPropConfig:d,getDragScopeElement:B,onAcceptMovedChildElement:w,onChildElementMovedOut:f,addNewChildComponentSchema:b,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||a.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||a.ref(!1),onRemoveComponent:h},s}const ye=a.defineComponent({name:"FLayoutDesign",props:D,emits:[],setup(t,e){var y;const n=a.ref(),o=a.inject("design-item-context"),r=fe(o.schema,(y=o.parent)==null?void 0:y.schema),s=Q(n,o,r);s.value.canNested=!1;const c=Y(n),{horizontalResizeHandleStyle:g,verticalResizeHandleStyle:P,resizeOverlayStyle:l}=c;return a.provide("layout",{useResizeHandleComposition:c}),a.onMounted(()=>{n.value.componentInstance=s}),e.expose(s.value),()=>a.createVNode("div",{class:"f-layout f-page-content",ref:n},[e.slots.default&&e.slots.default(),a.createVNode("div",{class:"f-layout-resize-overlay",style:l.value},null),a.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:g.value},null),a.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:P.value},null)])}});function me(){function t(e,n){var c;if(!e)return!1;const o=((c=e.targetContainer)==null?void 0:c.componentInstance)&&e.targetContainer.componentInstance.value;if(!o)return!1;const r=o.schema.type,s=n==null?void 0:n.formSchemaUtils.getComponentById(o.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![T["response-layout-item"].type,T["response-form"].type].includes(r)||(e.componentType===T.tabs.type||e.componentType===T.section.type)&&((s==null?void 0:s.componentType)!=="frame"||![T["content-container"].type,T["splitter-pane"].type,T["response-layout-item"].type].includes(r)))}return{basalDragulaRuleForContainer:t}}function de(t,e){const n=t.schema;function o(s){return!!me().basalDragulaRuleForContainer(s)}function r(){const s=["f-layout-pane"];return(n.position==="left"||n.position==="right")&&s.push("f-page-content-nav"),n.position==="center"&&s.push("f-page-content-main"),s.join(" ")}return{canAccepts:o,getDesignerClass:r}}const he=a.defineComponent({name:"FLayoutPaneDesign",props:A,emits:[],setup(t,e){const n=a.ref(),o=a.ref();a.inject("designer-host-service");const r=a.inject("design-item-context"),s=de(r),c=Q(o,r,s);c.value.canNested=!1,c.value.canMove=!1,c.value.canDelete=!1,a.onMounted(()=>{o.value.componentInstance=c}),e.expose(c.value);const g=a.ref(Math.max(t.minHeight,t.height)),P=a.ref(Math.max(t.minWidth,t.width)),l=a.ref(t.minHeight),y=a.ref(t.minWidth),p=a.ref(t.position),v=a.inject("layout"),{useResizeHandleComposition:C}=v,B=U(P,g,y,l,C),{onClickHorizontalResizeBar:w,onClickVerticalResizeBar:b}=B,f=a.computed(()=>({"f-layout-resize-bar":!0,"f-layout-resize-bar-e":p.value==="left","f-layout-resize-bar-n":p.value==="bottom","f-layout-resize-bar-s":p.value==="top","f-layout-resize-bar-w":p.value==="right"}));function d(i,u){(u==="left"||u==="right")&&w(i,u,n.value),(u==="top"||u==="bottom")&&b(i,u,n.value)}const h=a.computed(()=>{const i={"f-layout-pane":!0,"f-page-content-nav":p.value==="left"||p.value==="right","f-page-content-main":p.value==="center"};return t.customClass&&String(t.customClass).split(" ").reduce((u,z)=>(u[z]=!0,u),i),i}),S=a.computed(()=>{const i={flex:"1"};return(P.value&&p.value==="left"||p.value==="right")&&(i.width=`${P.value}px`),(g.value&&p.value==="bottom"||p.value==="top")&&(i.height=`${g.value}px`),i});return()=>a.createVNode("div",{ref:n,class:h.value,style:S.value},[a.createVNode("div",{ref:o,class:"drag-container","data-dragref":`${r.schema.id}-container`},[e.slots.default&&e.slots.default()]),a.createVNode("span",{class:f.value,onMousedown:i=>d(i,p.value)},null)])}});M.install=t=>{t.component(M.name,M),t.component(H.name,H)},M.register=(t,e,n,o)=>{t.layout=M,e.layout=L,t["layout-pane"]=H,e["layout-pane"]=X},M.registerDesigner=(t,e,n)=>{t.layout=ye,e.layout=L,t["layout-pane"]=he,e["layout-pane"]=X},O.FLayout=M,O.FLayoutPane=H,O.default=M,O.layoutProps=D,O.layoutPropsResolver=L,Object.defineProperties(O,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|