@farris/ui-vue 1.2.9 → 1.3.0
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 +63 -63
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +402 -323
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.css +1 -1
- package/components/button-edit/index.esm.js +98 -96
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +66 -66
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +118 -118
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +539 -460
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +135 -135
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.css +1 -0
- package/components/combo-list/index.esm.js +1007 -312
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +97 -97
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +778 -700
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +472 -329
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.css +1 -0
- package/components/condition/index.esm.js +2231 -1055
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +79 -79
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +6408 -5034
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.css +1 -0
- package/components/data-view/index.esm.js +4762 -3511
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.css +1 -1
- package/components/date-picker/index.esm.js +3442 -2742
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +14 -13
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +73 -73
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.css +1 -0
- package/components/dynamic-form/index.esm.js +2597 -1141
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +114 -71
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +303 -290
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +171 -171
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +65 -65
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3075 -2586
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5272 -8511
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1726 -1822
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +126 -126
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +620 -540
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +88 -88
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +71 -71
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +3582 -2356
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +10752 -8972
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +5601 -5329
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.css +1 -1
- package/components/message-box/index.esm.js +511 -471
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.css +1 -1
- package/components/modal/index.esm.js +438 -398
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +535 -452
- package/components/nav/index.umd.cjs +2 -2
- package/components/notify/index.esm.js +59 -53
- package/components/notify/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +556 -477
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +504 -425
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1833 -1054
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +100 -100
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +899 -870
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +576 -487
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +71 -70
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +73 -73
- package/components/progress/index.umd.cjs +2 -2
- package/components/property-editor/index.css +1 -1
- package/components/property-editor/index.esm.js +1916 -1220
- package/components/property-editor/index.umd.cjs +3 -3
- package/components/property-panel/index.esm.js +783 -886
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +3632 -2556
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +72 -72
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +484 -405
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +152 -152
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +73 -73
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.css +1 -1
- package/components/response-layout-editor/index.esm.js +1081 -1043
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +753 -738
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +4418 -4177
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +119 -119
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +92 -91
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +59 -59
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +103 -103
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +85 -85
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +457 -378
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.esm.js +1696 -1617
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +53 -53
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +268 -268
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +420 -341
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.css +1 -1
- package/components/time-picker/index.esm.js +1062 -981
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +381 -379
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5252 -9560
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.css +1 -0
- package/components/tree-view/index.esm.js +3920 -2692
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +373 -367
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +92 -92
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +597 -417
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +251 -251
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +17125 -16176
- package/farris.all.umd.cjs +8 -8
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/capsule/src/capsule.props.d.ts +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +0 -3
- package/types/combo-list/src/components/list-container.props.d.ts +0 -4
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +1 -1
- package/types/common/utils/encrypt.d.ts +2 -0
- package/types/component/src/component.props.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +1 -1
- package/types/component/src/property-config/component.property-config.d.ts +9 -0
- package/types/components.d.ts +1 -0
- package/types/data-grid/index.d.ts +5 -2
- package/types/data-grid/src/data-grid.component.d.ts +2 -1
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-view/composition/types.d.ts +18 -1
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/types.d.ts +1 -1
- package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +2 -2
- package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
- package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +12 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
- package/types/dynamic-resolver/src/types.d.ts +9 -0
- package/types/dynamic-view/index.d.ts +1 -0
- package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
- package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
- package/types/lookup/src/components/modal-container.component.d.ts +25 -0
- package/types/lookup/src/components/modal-container.props.d.ts +29 -0
- package/types/lookup/src/composition/types.d.ts +8 -0
- package/types/lookup/src/composition/use-check-props.d.ts +9 -2
- package/types/lookup/src/composition/use-dialog.d.ts +5 -1
- package/types/lookup/src/composition/use-favorite.d.ts +12 -0
- package/types/lookup/src/composition/use-http.d.ts +9 -5
- package/types/lookup/src/composition/use-input-change.d.ts +3 -0
- package/types/lookup/src/composition/use-user-data.d.ts +24 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
- package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
- package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
- package/types/modal/src/composition/use-draggable.d.ts +2 -1
- package/types/modal/src/composition/use-shortcut.d.ts +6 -0
- package/types/modal/src/modal.component.d.ts +3 -0
- package/types/modal/src/modal.props.d.ts +4 -0
- package/types/page-header/src/page-header.props.d.ts +1 -0
- package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
- package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
- package/types/response-layout-editor/src/type.d.ts +21 -0
- package/types/tabs/src/tabs.props.d.ts +1 -0
- package/types/tree-grid/index.d.ts +8 -2
- package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
- package/types/data-grid/src/designer/use-group-column.d.ts +0 -20
- package/types/modal/src/composition/use-esc.d.ts +0 -1
- package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
- package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(H,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):(H=typeof globalThis<"u"?globalThis:H||self,a(H.layout={},H.Vue,H.LodashES))})(this,function(H,a,G){"use strict";const k={},L={};function R(t){const{properties:e,title:n,ignore:o}=t,l=o&&Array.isArray(o),s=Object.keys(e).reduce((c,m)=>((!l||!o.find(P=>P==m))&&(c[m]=e[m].type==="object"&&e[m].properties?R(e[m]):G.cloneDeep(e[m].default)),c),{});return(!l||!o.find(c=>c=="id"))&&(s.id=`${n}-${Date.now()}`),s}function E(t,e={},n){const o=k[t];if(o){let l=R(o);const s=L[t];return l=s?s({getSchemaByType:E},l,e,n):l,l}return null}function Q(t,e){const n=R(e);return Object.keys(t).reduce((o,l)=>(o[l]&&typeof o[l]=="object"?Object.assign(o[l],t[l]):o[l]=t[l],o),n),n}function U(t,e){return Object.keys(t).filter(o=>t[o]!=null).reduce((o,l)=>{if(e.has(l)){const s=e.get(l);if(typeof s=="string")o[s]=t[l];else{const c=s(l,t[l],t);Object.assign(o,c)}}else o[l]=t[l];return o},{})}function Z(t,e,n=new Map){const o=Q(t,e);return U(o,n)}function K(t={}){function e(r,d,u,v){if(typeof u=="number")return v[r].length===u;if(typeof u=="object"){const $=Object.keys(u)[0],O=u[$];if($==="not")return Number(v[r].length)!==Number(O);if($==="moreThan")return Number(v[r].length)>=Number(O);if($==="lessThan")return Number(v[r].length)<=Number(O)}return!1}function n(r,d,u,v){return v[r]&&v[r].propertyValue&&String(v[r].propertyValue.value)===String(u)}const o=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((r,d)=>(r.set(d,t[d]),r),o);function l(r,d){const u=r;return typeof d=="number"?[{target:u,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:u,operator:"getProperty",param:r,value:!!d}]:typeof d=="object"?Object.keys(d).map(v=>{if(v==="length")return{target:u,operator:"length",param:null,value:d[v]};const $=v,O=d[v];return{target:u,operator:"getProperty",param:$,value:O}}):[]}function s(r){return Object.keys(r).reduce((u,v)=>{const $=l(v,r[v]);return u.push(...$),u},[])}function c(r,d){if(o.has(r.operator)){const u=o.get(r.operator);return u&&u(r.target,r.param,r.value,d)||!1}return!1}function m(r,d){return s(r).reduce(($,O)=>$&&c(O,d),!0)}function P(r,d){const u=Object.keys(r),v=u.includes("allOf"),$=u.includes("anyOf"),O=v||$,f=(O?r[O?v?"allOf":"anyOf":"allOf"]:[r]).map(g=>m(g,d));return v?!f.includes(!1):f.includes(!0)}return{parseValueSchema:P}}const x={},I={};K();function F(t,e,n=new Map,o=(c,m,P)=>m,l={},s=c=>c){return k[e.title]=e,L[e.title]=o,x[e.title]=l,I[e.title]=s,(c={})=>{const m=Z(c,e,n),P=Object.keys(t).reduce((r,d)=>(r[d]=t[d].default,r),{});return Object.assign(P,m)}}function ee(t,e){return{customClass:e.class,customStyle:e.style}}const q=new Map([["appearance",ee]]);function W(t,e,n){return e}const te={$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"]},ne={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:""}},T=F(D,te,q,W,ne);function _(t){const e=a.ref(-1),n=a.ref(-1),o=a.ref(0),l=a.ref(0),s=a.ref(!1),c=a.ref(!1),m=a.computed(()=>({display:s.value?"block":"none",left:`${o.value}px`,cursor:"e-resize"})),P=a.computed(()=>({display:c.value?"block":"none",top:`${l.value}px`,cursor:"n-resize"})),r=a.computed(()=>({display:c.value||s.value?"block":"none"}));function d(z,f,h,g){const S=t.value;if(S){const{left:b,right:i,width:y}=S.getBoundingClientRect();let p=z.clientX-b;g==="right"&&(p=i-z.clientX),p>f&&(p=f),p<h&&(p=h),g==="right"&&(p=y-p),o.value=p}}function u(z,f,h,g){const S=t.value;if(S){const{top:b,bottom:i,height:y}=S.getBoundingClientRect();let p=z.clientY-b;g==="bottom"&&(p=i-z.clientY),p>f&&(p=f),p<h&&(p=h),g==="bottom"&&(p=y-p),l.value=p}}function v(){const z=t.value;if(z){const{width:f,height:h}=z.getBoundingClientRect();return{width:f,height:h}}return null}function $(){const z=t.value;return z?Array.from(z.querySelectorAll("[data-position]")).reduce((f,h)=>{const g=h.getAttribute("data-position");return f=Object.assign(f,{[g]:h}),f},{}):null}function O(z,f){const h=v(),g=$();if(h&&g){const S=g==null?void 0:g.right,b=g==null?void 0:g.left;if(z==="left"&&b)return S?h.width-S.clientWidth-f:h.width-f;if(z==="right"&&S)return b?h.width-b.clientWidth-f:h.width-f}}function w(z,f){const h=v(),g=$();if(h&&g){const S=g==null?void 0:g.bottom,b=g==null?void 0:g.top;if(z==="top"&&b)return S?h.height-S.clientHeight-f:h.height-f;if(z==="bottom"&&S)return b?h.height-b.clientHeight-f:h.height-f}}return{horizontalResizeHandleStyle:m,verticalResizeHandleStyle:P,resizeOverlayStyle:r,showHorizontalResizeHandle:s,showVerticalResizeHandle:c,horizontalResizeBarPosition:e,verticalResizeBarPosition:n,verticalResizeHandleOffset:l,horizontalResizeHandleOffset:o,draggingHorizontalResizeHandle:d,draggingVerticalResizeHandle:u,getPanelMaxHeight:w,getPanelMaxWidth:O}}const oe=["moz","ms","webkit"];function ae(){let t=0;return e=>{const n=new Date().getTime(),o=Math.max(0,16-(n-t)),l=setTimeout(()=>{e(n+o)},o);return t=n+o,l}}function re(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=oe.filter(e=>`${e}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:ae()}re();function ie(t,e){return((e==null?void 0:e.split(" "))||[]).reduce((o,l)=>(l&&(o[l]=!0),o),t),t}function le(t,e){return((e==null?void 0:e.split(";"))||[]).reduce((o,l)=>{if(l){const s=l.split(":");o[s[0]]=s[1]}return o},t),t}const N=a.defineComponent({name:"FLayout",props:D,emits:[],setup(t,e){const n=a.ref(),o=_(n),{horizontalResizeHandleStyle:l,verticalResizeHandleStyle:s,resizeOverlayStyle:c}=o;a.provide("layout",{useResizeHandleComposition:o});const m=a.computed(()=>ie({"f-layout":!0},t==null?void 0:t.customClass)),P=a.computed(()=>le({},t==null?void 0:t.customStyle));return()=>a.createVNode("div",{class:m.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:l.value},null),a.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:s.value},null)])}}),se={$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}}},ce={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:"是否可见"}}}}},V={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}},Y=F(V,se,q,W,ce);function X(t,e,n,o,l){const{horizontalResizeBarPosition:s,horizontalResizeHandleOffset:c,showHorizontalResizeHandle:m,showVerticalResizeHandle:P,verticalResizeBarPosition:r,verticalResizeHandleOffset:d,draggingHorizontalResizeHandle:u,draggingVerticalResizeHandle:v,getPanelMaxHeight:$,getPanelMaxWidth:O}=l;let w="",z,f,h;function g(i){if((w==="left"||w==="right")&&f){const{left:y}=f.getBoundingClientRect(),{width:p}=z.getBoundingClientRect(),M=i.clientX-y;let C=w==="left"?(p||0)+(M-s.value):(p||0)-(M-s.value);C=n.value>0?Math.max(n.value,C):C;const j=O(w,n.value);j!=null&&(C=j>C?C:j),t.value=C}if((w==="top"||w==="bottom")&&f){const{top:y}=f.getBoundingClientRect(),{height:p}=z.getBoundingClientRect(),M=i.clientY-y;let C=w==="top"?(p||0)+(M-r.value):(p||0)-(M-r.value);C=o.value>0?Math.max(o.value,C):C;const j=$(w,o.value);j!=null&&(C=j>C?C:j),e.value=C}c.value=0,d.value=0,s.value=-1,r.value=-1,m.value=!1,P.value=!1,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",g),document.body.style.userSelect="",w="",z=null,f=null}function S(i,y,p){if(w=y,z=p,m.value=!0,f=i.composedPath().find(C=>(C.className||"").split(" ")[0]==="f-layout"),f){const{left:C}=f.getBoundingClientRect(),j=i.clientX-C;c.value=j,s.value=j;const B=O(w,n.value)||0;h=me=>u(me,B,n.value,w),document.addEventListener("mousemove",h),document.addEventListener("mouseup",g),document.body.style.userSelect="none"}}function b(i,y,p){if(w=y,z=p,P.value=!0,f=i.composedPath().find(C=>(C.className||"").split(" ")[0]==="f-layout"),f){const{top:C}=f.getBoundingClientRect();d.value=i.clientY-C,r.value=i.clientY-C;const j=$(w,o.value)||0;h=B=>v(B,j,o.value,w),document.addEventListener("mousemove",h),document.addEventListener("mouseup",g),document.body.style.userSelect="none"}}return{onClickHorizontalResizeBar:S,onClickVerticalResizeBar:b}}const A=a.defineComponent({name:"FLayoutPane",props:V,emits:[],setup(t,e){const n=a.ref(t.minHeight<=0?100:t.minHeight),o=a.ref(t.minWidth<=0?100:t.minWidth),l=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)),m=a.ref(Math.max(o.value,l.value)),P=a.ref(),r=a.ref(t.position),d=a.ref(t.resizable);a.watch(()=>t.resizable,b=>{d.value=b});const u=a.inject("layout"),{useResizeHandleComposition:v}=u,$=X(m,c,o,n,v),{onClickHorizontalResizeBar:O,onClickVerticalResizeBar:w}=$,z=a.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=a.computed(()=>r.value!=="center"&&d.value);function h(b,i){(i==="left"||i==="right")&&O(b,i,P.value),(i==="top"||i==="bottom")&&w(b,i,P.value)}const g=a.computed(()=>{const b={"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((i,y)=>(i[y]=!0,i),b),b}),S=a.computed(()=>{const b={};return(m.value&&r.value==="left"||r.value==="right")&&(b.width=`${m.value}px`),(c.value&&r.value==="bottom"||r.value==="top")&&(b.height=`${c.value}px`),t.visible||(b.display="none"),b});return()=>a.createVNode("div",{ref:P,class:g.value,style:S.value,"data-position":r.value},[e.slots.default&&e.slots.default(),f.value&&a.createVNode("span",{class:z.value,onMousedown:b=>h(b,r.value)},null)])}});function ue(t,e){function n(){return!1}return{canAccepts:n}}function J(t,e,n){var b;function o(){n!=null&&n.resolveComponentContext&&n.resolveComponentContext()}o();const l=n&&n.getStyles&&n.getStyles()||"",s=n&&n.getDesignerClass&&n.getDesignerClass()||"",c=a.ref();function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function P(){return!1}function r(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function d(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function u(i){if(!i||!i.value)return null;if(i.value.schema&&i.value.schema.type==="component")return i.value;const y=a.ref(i==null?void 0:i.value.parent),p=u(y);return p||null}function v(i=e){const{componentInstance:y,designerItemElementRef:p}=i;return!y||!y.value?null:y.value.canMove?p:v(i.parent)}function $(i){return!!n&&n.canAccepts(i)}function O(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function w(){}function z(i,y){y&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(y)}function f(i,y){const{componentType:p}=i;let M=E(p,i,y);n&&n.onResolveNewComponentSchema&&(M=n.onResolveNewComponentSchema(i,M));const C=p.toLowerCase().replace("-","_");return M&&!M.id&&M.type===p&&(M.id=`${C}_${Math.random().toString().slice(2,6)}`),M}function h(i,y){const p=String(i.getAttribute("data-controltype")),M=i.getAttribute("data-feature"),C=M?JSON.parse(M):{};C.parentComponentInstance=c.value;let j=E(p,C);n&&n.onAcceptNewChildElement&&(j=n.onAcceptNewChildElement(i,y,j));const B=p.toLowerCase().replace("-","_");return j&&!j.id&&j.type===p&&(j.id=`${B}_${Math.random().toString().slice(2,6)}`),j}function g(i){}function S(...i){if(n&&n.getPropsConfig)return n.getPropsConfig(...i)}return c.value={canMove:m(),canSelectParent:P(),canDelete:r(),canNested:!d(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(b=e==null?void 0:e.parent)==null?void 0:b.componentInstance,schema:e==null?void 0:e.schema,styles:l,designerClass:s,canAccepts:$,getBelongedComponentInstance:u,getDraggableDesignItemElement:v,getDraggingDisplayText:O,getPropConfig:S,getDragScopeElement:w,onAcceptMovedChildElement:z,onAcceptNewChildElement:h,onChildElementMovedOut:g,addNewChildComponentSchema:f,updateDragAndDropRules:o,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||a.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||a.ref(!1)},c}const fe=a.defineComponent({name:"FLayoutDesign",props:D,emits:[],setup(t,e){var d;const n=a.ref(),o=a.inject("design-item-context"),l=ue(o.schema,(d=o.parent)==null?void 0:d.schema),s=J(n,o,l);s.value.canNested=!1;const c=_(n),{horizontalResizeHandleStyle:m,verticalResizeHandleStyle:P,resizeOverlayStyle:r}=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:r.value},null),a.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:m.value},null),a.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:P.value},null)])}});function pe(){function t(e){var l,s;if(!e)return!1;const n=((l=e.targetContainer)==null?void 0:l.componentInstance)&&e.targetContainer.componentInstance.value;if(!n)return!1;const o=(s=n.schema.appearance)==null?void 0:s.class;if(e.controlCategory==="input"||e.controlType==="form-group"){const c=n.schema.type,m=(c==="response-form"||c==="content-container")&&o&&o.includes("farris-form");if(n.schema.type!=="response-layout-item"&&!m)return!1}return e.controlType!=="field-set"}return{basalDragulaRuleForContainer:t}}function de(t,e){function n(s){return!!pe().basalDragulaRuleForContainer(s)}function o(s,c,m){return m}function l(){const s=["f-layout-pane"];return(t.position==="left"||t.position==="right")&&s.push("f-page-content-nav"),t.position==="center"&&s.push("f-page-content-main"),s.join(" ")}return{canAccepts:n,getDesignerClass:l,onAcceptNewChildElement:o}}const ye=a.defineComponent({name:"FLayoutPaneDesign",props:V,emits:[],setup(t,e){var b;const n=a.ref(),o=a.ref(),l=a.inject("design-item-context"),s=de(l.schema,(b=l.parent)==null?void 0:b.schema),c=J(o,l,s);c.value.canNested=!1,c.value.canMove=!1,c.value.canDelete=!1,a.onMounted(()=>{o.value.componentInstance=c}),e.expose(c.value);const m=a.ref(Math.max(t.minHeight,t.height)),P=a.ref(Math.max(t.minWidth,t.width)),r=a.ref(t.minHeight),d=a.ref(t.minWidth),u=a.ref(t.position),v=a.inject("layout"),{useResizeHandleComposition:$}=v,O=X(P,m,d,r,$),{onClickHorizontalResizeBar:w,onClickVerticalResizeBar:z}=O,f=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 h(i,y){(y==="left"||y==="right")&&w(i,y,n.value),(y==="top"||y==="bottom")&&z(i,y,n.value)}const g=a.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((y,p)=>(y[p]=!0,y),i),i}),S=a.computed(()=>{const i={flex:"1"};return(P.value&&u.value==="left"||u.value==="right")&&(i.width=`${P.value}px`),(m.value&&u.value==="bottom"||u.value==="top")&&(i.height=`${m.value}px`),i});return()=>a.createVNode("div",{ref:n,class:g.value,style:S.value},[a.createVNode("div",{ref:o,class:"drag-container","data-dragref":`${l.schema.id}-container`},[e.slots.default&&e.slots.default()]),a.createVNode("span",{class:f.value,onMousedown:i=>h(i,u.value)},null)])}});N.install=t=>{t.component(N.name,N),t.component(A.name,A)},N.register=(t,e,n,o)=>{t.layout=N,e.layout=T,t["layout-pane"]=A,e["layout-pane"]=Y},N.registerDesigner=(t,e,n)=>{t.layout=fe,e.layout=T,t["layout-pane"]=ye,e["layout-pane"]=Y},H.FLayout=N,H.FLayoutPane=A,H.default=N,H.layoutProps=D,H.layoutPropsResolver=T,Object.defineProperties(H,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(H,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):(H=typeof globalThis<"u"?globalThis:H||self,a(H.layout={},H.Vue,H.LodashES))})(this,function(H,a,R){"use strict";const L={},F={};function T(t){const{properties:e,title:n,ignore:o}=t,l=o&&Array.isArray(o),s=Object.keys(e).reduce((c,m)=>((!l||!o.find(P=>P==m))&&(c[m]=e[m].type==="object"&&e[m].properties?T(e[m]):R.cloneDeep(e[m].default)),c),{});return(!l||!o.find(c=>c=="id"))&&(s.id=`${n}-${Date.now()}`),s}function E(t,e={},n){const o=L[t];if(o){let l=T(o);const s=F[t];return l=s?s({getSchemaByType:E},l,e,n):l,l}return null}function Q(t,e){const n=T(e);return Object.keys(t).reduce((o,l)=>(o[l]&&R.isPlainObject(o[l])&&R.isPlainObject(t[l])?Object.assign(o[l],t[l]):o[l]=t[l],o),n),n}function U(t,e){return Object.keys(t).filter(o=>t[o]!=null).reduce((o,l)=>{if(e.has(l)){const s=e.get(l);if(typeof s=="string")o[s]=t[l];else{const c=s(l,t[l],t);Object.assign(o,c)}}else o[l]=t[l];return o},{})}function Z(t,e,n=new Map){const o=Q(t,e);return U(o,n)}function K(t={}){function e(r,d,u,v){if(typeof u=="number")return v[r].length===u;if(typeof u=="object"){const O=Object.keys(u)[0],$=u[O];if(O==="not")return Number(v[r].length)!==Number($);if(O==="moreThan")return Number(v[r].length)>=Number($);if(O==="lessThan")return Number(v[r].length)<=Number($)}return!1}function n(r,d,u,v){return v[r]&&v[r].propertyValue&&String(v[r].propertyValue.value)===String(u)}const o=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((r,d)=>(r.set(d,t[d]),r),o);function l(r,d){const u=r;return typeof d=="number"?[{target:u,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:u,operator:"getProperty",param:r,value:!!d}]:typeof d=="object"?Object.keys(d).map(v=>{if(v==="length")return{target:u,operator:"length",param:null,value:d[v]};const O=v,$=d[v];return{target:u,operator:"getProperty",param:O,value:$}}):[]}function s(r){return Object.keys(r).reduce((u,v)=>{const O=l(v,r[v]);return u.push(...O),u},[])}function c(r,d){if(o.has(r.operator)){const u=o.get(r.operator);return u&&u(r.target,r.param,r.value,d)||!1}return!1}function m(r,d){return s(r).reduce((O,$)=>O&&c($,d),!0)}function P(r,d){const u=Object.keys(r),v=u.includes("allOf"),O=u.includes("anyOf"),$=v||O,f=($?r[$?v?"allOf":"anyOf":"allOf"]:[r]).map(g=>m(g,d));return v?!f.includes(!1):f.includes(!0)}return{parseValueSchema:P}}const x={},I={};K();function q(t,e,n=new Map,o=(c,m,P)=>m,l={},s=c=>c){return L[e.title]=e,F[e.title]=o,x[e.title]=l,I[e.title]=s,(c={})=>{const m=Z(c,e,n),P=Object.keys(t).reduce((r,d)=>(r[d]=t[d].default,r),{});return Object.assign(P,m)}}function ee(t,e){return{customClass:e.class,customStyle:e.style}}const W=new Map([["appearance",ee]]);function _(t,e,n){return e}const te={$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"]},ne={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:""}},k=q(D,te,W,_,ne);function Y(t){const e=a.ref(-1),n=a.ref(-1),o=a.ref(0),l=a.ref(0),s=a.ref(!1),c=a.ref(!1),m=a.computed(()=>({display:s.value?"block":"none",left:`${o.value}px`,cursor:"e-resize"})),P=a.computed(()=>({display:c.value?"block":"none",top:`${l.value}px`,cursor:"n-resize"})),r=a.computed(()=>({display:c.value||s.value?"block":"none"}));function d(z,f,h,g){const j=t.value;if(j){const{left:b,right:i,width:y}=j.getBoundingClientRect();let p=z.clientX-b;g==="right"&&(p=i-z.clientX),p>f&&(p=f),p<h&&(p=h),g==="right"&&(p=y-p),o.value=p}}function u(z,f,h,g){const j=t.value;if(j){const{top:b,bottom:i,height:y}=j.getBoundingClientRect();let p=z.clientY-b;g==="bottom"&&(p=i-z.clientY),p>f&&(p=f),p<h&&(p=h),g==="bottom"&&(p=y-p),l.value=p}}function v(){const z=t.value;if(z){const{width:f,height:h}=z.getBoundingClientRect();return{width:f,height:h}}return null}function O(){const z=t.value;return z?Array.from(z.querySelectorAll("[data-position]")).reduce((f,h)=>{const g=h.getAttribute("data-position");return f=Object.assign(f,{[g]:h}),f},{}):null}function $(z,f){const h=v(),g=O();if(h&&g){const j=g==null?void 0:g.right,b=g==null?void 0:g.left;if(z==="left"&&b)return j?h.width-j.clientWidth-f:h.width-f;if(z==="right"&&j)return b?h.width-b.clientWidth-f:h.width-f}}function w(z,f){const h=v(),g=O();if(h&&g){const j=g==null?void 0:g.bottom,b=g==null?void 0:g.top;if(z==="top"&&b)return j?h.height-j.clientHeight-f:h.height-f;if(z==="bottom"&&j)return b?h.height-b.clientHeight-f:h.height-f}}return{horizontalResizeHandleStyle:m,verticalResizeHandleStyle:P,resizeOverlayStyle:r,showHorizontalResizeHandle:s,showVerticalResizeHandle:c,horizontalResizeBarPosition:e,verticalResizeBarPosition:n,verticalResizeHandleOffset:l,horizontalResizeHandleOffset:o,draggingHorizontalResizeHandle:d,draggingVerticalResizeHandle:u,getPanelMaxHeight:w,getPanelMaxWidth:$}}const oe=["moz","ms","webkit"];function ae(){let t=0;return e=>{const n=new Date().getTime(),o=Math.max(0,16-(n-t)),l=setTimeout(()=>{e(n+o)},o);return t=n+o,l}}function re(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=oe.filter(e=>`${e}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:ae()}re();function ie(t,e){return((e==null?void 0:e.split(" "))||[]).reduce((o,l)=>(l&&(o[l]=!0),o),t),t}function le(t,e){return((e==null?void 0:e.split(";"))||[]).reduce((o,l)=>{if(l){const s=l.split(":");o[s[0]]=s[1]}return o},t),t}const N=a.defineComponent({name:"FLayout",props:D,emits:[],setup(t,e){const n=a.ref(),o=Y(n),{horizontalResizeHandleStyle:l,verticalResizeHandleStyle:s,resizeOverlayStyle:c}=o;a.provide("layout",{useResizeHandleComposition:o});const m=a.computed(()=>ie({"f-layout":!0},t==null?void 0:t.customClass)),P=a.computed(()=>le({},t==null?void 0:t.customStyle));return()=>a.createVNode("div",{class:m.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:l.value},null),a.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:s.value},null)])}}),se={$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}}},ce={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:"是否可见"}}}}},V={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=q(V,se,W,_,ce);function J(t,e,n,o,l){const{horizontalResizeBarPosition:s,horizontalResizeHandleOffset:c,showHorizontalResizeHandle:m,showVerticalResizeHandle:P,verticalResizeBarPosition:r,verticalResizeHandleOffset:d,draggingHorizontalResizeHandle:u,draggingVerticalResizeHandle:v,getPanelMaxHeight:O,getPanelMaxWidth:$}=l;let w="",z,f,h;function g(i){if((w==="left"||w==="right")&&f){const{left:y}=f.getBoundingClientRect(),{width:p}=z.getBoundingClientRect(),M=i.clientX-y;let C=w==="left"?(p||0)+(M-s.value):(p||0)-(M-s.value);C=n.value>0?Math.max(n.value,C):C;const S=$(w,n.value);S!=null&&(C=S>C?C:S),t.value=C}if((w==="top"||w==="bottom")&&f){const{top:y}=f.getBoundingClientRect(),{height:p}=z.getBoundingClientRect(),M=i.clientY-y;let C=w==="top"?(p||0)+(M-r.value):(p||0)-(M-r.value);C=o.value>0?Math.max(o.value,C):C;const S=O(w,o.value);S!=null&&(C=S>C?C:S),e.value=C}c.value=0,d.value=0,s.value=-1,r.value=-1,m.value=!1,P.value=!1,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",g),document.body.style.userSelect="",w="",z=null,f=null}function j(i,y,p){if(w=y,z=p,m.value=!0,f=i.composedPath().find(C=>(C.className||"").split(" ")[0]==="f-layout"),f){const{left:C}=f.getBoundingClientRect(),S=i.clientX-C;c.value=S,s.value=S;const B=$(w,n.value)||0;h=me=>u(me,B,n.value,w),document.addEventListener("mousemove",h),document.addEventListener("mouseup",g),document.body.style.userSelect="none"}}function b(i,y,p){if(w=y,z=p,P.value=!0,f=i.composedPath().find(C=>(C.className||"").split(" ")[0]==="f-layout"),f){const{top:C}=f.getBoundingClientRect();d.value=i.clientY-C,r.value=i.clientY-C;const S=O(w,o.value)||0;h=B=>v(B,S,o.value,w),document.addEventListener("mousemove",h),document.addEventListener("mouseup",g),document.body.style.userSelect="none"}}return{onClickHorizontalResizeBar:j,onClickVerticalResizeBar:b}}const A=a.defineComponent({name:"FLayoutPane",props:V,emits:[],setup(t,e){const n=a.ref(t.minHeight<=0?100:t.minHeight),o=a.ref(t.minWidth<=0?100:t.minWidth),l=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)),m=a.ref(Math.max(o.value,l.value)),P=a.ref(),r=a.ref(t.position),d=a.ref(t.resizable);a.watch(()=>t.resizable,b=>{d.value=b});const u=a.inject("layout"),{useResizeHandleComposition:v}=u,O=J(m,c,o,n,v),{onClickHorizontalResizeBar:$,onClickVerticalResizeBar:w}=O,z=a.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=a.computed(()=>r.value!=="center"&&d.value);function h(b,i){(i==="left"||i==="right")&&$(b,i,P.value),(i==="top"||i==="bottom")&&w(b,i,P.value)}const g=a.computed(()=>{const b={"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((i,y)=>(i[y]=!0,i),b),b}),j=a.computed(()=>{const b={};return(m.value&&r.value==="left"||r.value==="right")&&(b.width=`${m.value}px`),(c.value&&r.value==="bottom"||r.value==="top")&&(b.height=`${c.value}px`),t.visible||(b.display="none"),b});return()=>a.createVNode("div",{ref:P,class:g.value,style:j.value,"data-position":r.value},[e.slots.default&&e.slots.default(),f.value&&a.createVNode("span",{class:z.value,onMousedown:b=>h(b,r.value)},null)])}});function ue(t,e){function n(){return!1}return{canAccepts:n}}function G(t,e,n){var b;function o(){n!=null&&n.resolveComponentContext&&n.resolveComponentContext()}o();const l=n&&n.getStyles&&n.getStyles()||"",s=n&&n.getDesignerClass&&n.getDesignerClass()||"",c=a.ref();function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function P(){return!1}function r(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function d(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function u(i){if(!i||!i.value)return null;if(i.value.schema&&i.value.schema.type==="component")return i.value;const y=a.ref(i==null?void 0:i.value.parent),p=u(y);return p||null}function v(i=e){const{componentInstance:y,designerItemElementRef:p}=i;return!y||!y.value?null:y.value.canMove?p:v(i.parent)}function O(i){return!!n&&n.canAccepts(i)}function $(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function w(){}function z(i,y){y&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(y)}function f(i,y){const{componentType:p}=i;let M=E(p,i,y);n&&n.onResolveNewComponentSchema&&(M=n.onResolveNewComponentSchema(i,M));const C=p.toLowerCase().replace("-","_");return M&&!M.id&&M.type===p&&(M.id=`${C}_${Math.random().toString().slice(2,6)}`),M}function h(i,y){const p=String(i.getAttribute("data-controltype")),M=i.getAttribute("data-feature"),C=M?JSON.parse(M):{};C.parentComponentInstance=c.value;let S=E(p,C);n&&n.onAcceptNewChildElement&&(S=n.onAcceptNewChildElement(i,y,S));const B=p.toLowerCase().replace("-","_");return S&&!S.id&&S.type===p&&(S.id=`${B}_${Math.random().toString().slice(2,6)}`),S}function g(i){}function j(...i){if(n&&n.getPropsConfig)return n.getPropsConfig(...i)}return c.value={canMove:m(),canSelectParent:P(),canDelete:r(),canNested:!d(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(b=e==null?void 0:e.parent)==null?void 0:b.componentInstance,schema:e==null?void 0:e.schema,styles:l,designerClass:s,canAccepts:O,getBelongedComponentInstance:u,getDraggableDesignItemElement:v,getDraggingDisplayText:$,getPropConfig:j,getDragScopeElement:w,onAcceptMovedChildElement:z,onAcceptNewChildElement:h,onChildElementMovedOut:g,addNewChildComponentSchema:f,updateDragAndDropRules:o,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||a.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||a.ref(!1)},c}const fe=a.defineComponent({name:"FLayoutDesign",props:D,emits:[],setup(t,e){var d;const n=a.ref(),o=a.inject("design-item-context"),l=ue(o.schema,(d=o.parent)==null?void 0:d.schema),s=G(n,o,l);s.value.canNested=!1;const c=Y(n),{horizontalResizeHandleStyle:m,verticalResizeHandleStyle:P,resizeOverlayStyle:r}=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:r.value},null),a.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:m.value},null),a.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:P.value},null)])}});function pe(){function t(e){var l,s;if(!e)return!1;const n=((l=e.targetContainer)==null?void 0:l.componentInstance)&&e.targetContainer.componentInstance.value;if(!n)return!1;const o=(s=n.schema.appearance)==null?void 0:s.class;if(e.controlCategory==="input"||e.controlType==="form-group"){const c=n.schema.type,m=(c==="response-form"||c==="content-container")&&o&&o.includes("farris-form");if(n.schema.type!=="response-layout-item"&&!m)return!1}return e.controlType!=="field-set"}return{basalDragulaRuleForContainer:t}}function de(t,e){function n(s){return!!pe().basalDragulaRuleForContainer(s)}function o(s,c,m){return m}function l(){const s=["f-layout-pane"];return(t.position==="left"||t.position==="right")&&s.push("f-page-content-nav"),t.position==="center"&&s.push("f-page-content-main"),s.join(" ")}return{canAccepts:n,getDesignerClass:l,onAcceptNewChildElement:o}}const ye=a.defineComponent({name:"FLayoutPaneDesign",props:V,emits:[],setup(t,e){var b;const n=a.ref(),o=a.ref(),l=a.inject("design-item-context"),s=de(l.schema,(b=l.parent)==null?void 0:b.schema),c=G(o,l,s);c.value.canNested=!1,c.value.canMove=!1,c.value.canDelete=!1,a.onMounted(()=>{o.value.componentInstance=c}),e.expose(c.value);const m=a.ref(Math.max(t.minHeight,t.height)),P=a.ref(Math.max(t.minWidth,t.width)),r=a.ref(t.minHeight),d=a.ref(t.minWidth),u=a.ref(t.position),v=a.inject("layout"),{useResizeHandleComposition:O}=v,$=J(P,m,d,r,O),{onClickHorizontalResizeBar:w,onClickVerticalResizeBar:z}=$,f=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 h(i,y){(y==="left"||y==="right")&&w(i,y,n.value),(y==="top"||y==="bottom")&&z(i,y,n.value)}const g=a.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((y,p)=>(y[p]=!0,y),i),i}),j=a.computed(()=>{const i={flex:"1"};return(P.value&&u.value==="left"||u.value==="right")&&(i.width=`${P.value}px`),(m.value&&u.value==="bottom"||u.value==="top")&&(i.height=`${m.value}px`),i});return()=>a.createVNode("div",{ref:n,class:g.value,style:j.value},[a.createVNode("div",{ref:o,class:"drag-container","data-dragref":`${l.schema.id}-container`},[e.slots.default&&e.slots.default()]),a.createVNode("span",{class:f.value,onMousedown:i=>h(i,u.value)},null)])}});N.install=t=>{t.component(N.name,N),t.component(A.name,A)},N.register=(t,e,n,o)=>{t.layout=N,e.layout=k,t["layout-pane"]=A,e["layout-pane"]=X},N.registerDesigner=(t,e,n)=>{t.layout=fe,e.layout=k,t["layout-pane"]=ye,e["layout-pane"]=X},H.FLayout=N,H.FLayoutPane=A,H.default=N,H.layoutProps=D,H.layoutPropsResolver=k,Object.defineProperties(H,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cloneDeep as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as _, ref as D, computed as q, createVNode as A, nextTick as R, inject as K, onMounted as x } from "vue";
|
|
2
|
+
import { isPlainObject as H, cloneDeep as I } from "lodash-es";
|
|
3
|
+
const G = {}, J = {};
|
|
4
4
|
function k(n) {
|
|
5
|
-
const { properties: e, title: t, ignore: r } = n, s = r && Array.isArray(r), d = Object.keys(e).reduce((h, m) => ((!s || !r.find((v) => v == m)) && (h[m] = e[m].type === "object" && e[m].properties ? k(e[m]) :
|
|
5
|
+
const { properties: e, title: t, ignore: r } = n, s = r && Array.isArray(r), d = Object.keys(e).reduce((h, m) => ((!s || !r.find((v) => v == m)) && (h[m] = e[m].type === "object" && e[m].properties ? k(e[m]) : I(e[m].default)), h), {});
|
|
6
6
|
return (!s || !r.find((h) => h == "id")) && (d.id = `${t}-${Date.now()}`), d;
|
|
7
7
|
}
|
|
8
8
|
function S(n, e = {}, t) {
|
|
9
|
-
const r =
|
|
9
|
+
const r = G[n];
|
|
10
10
|
if (r) {
|
|
11
11
|
let s = k(r);
|
|
12
|
-
const d =
|
|
12
|
+
const d = J[n];
|
|
13
13
|
return s = d ? d({ getSchemaByType: S }, s, e, t) : s, s;
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function ee(n, e) {
|
|
18
18
|
const t = k(e);
|
|
19
|
-
return Object.keys(n).reduce((r, s) => (r[s] &&
|
|
19
|
+
return Object.keys(n).reduce((r, s) => (r[s] && H(r[s]) && H(n[s]) ? Object.assign(r[s], n[s]) : r[s] = n[s], r), t), t;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function te(n, e) {
|
|
22
22
|
return Object.keys(n).filter((r) => n[r] != null).reduce((r, s) => {
|
|
23
23
|
if (e.has(s)) {
|
|
24
24
|
const d = e.get(s);
|
|
@@ -33,11 +33,11 @@ function ee(n, e) {
|
|
|
33
33
|
return r;
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const r =
|
|
38
|
-
return
|
|
36
|
+
function ne(n, e, t = /* @__PURE__ */ new Map()) {
|
|
37
|
+
const r = ee(n, e);
|
|
38
|
+
return te(r, t);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function oe(n = {}) {
|
|
41
41
|
function e(c, y, u, b) {
|
|
42
42
|
if (typeof u == "number")
|
|
43
43
|
return b[c].length === u;
|
|
@@ -91,24 +91,24 @@ function ne(n = {}) {
|
|
|
91
91
|
}
|
|
92
92
|
return { parseValueSchema: v };
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
function
|
|
97
|
-
return
|
|
98
|
-
const m =
|
|
94
|
+
const re = {}, se = {};
|
|
95
|
+
oe();
|
|
96
|
+
function ae(n, e, t = /* @__PURE__ */ new Map(), r = (h, m, v) => m, s = {}, d = (h) => h) {
|
|
97
|
+
return G[e.title] = e, J[e.title] = r, re[e.title] = s, se[e.title] = d, (h = {}) => {
|
|
98
|
+
const m = ne(h, e, t), v = Object.keys(n).reduce((c, y) => (c[y] = n[y].default, c), {});
|
|
99
99
|
return Object.assign(v, m);
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function ce(n, e) {
|
|
103
103
|
return { customClass: e.class, customStyle: e.style };
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
["appearance",
|
|
105
|
+
const ie = /* @__PURE__ */ new Map([
|
|
106
|
+
["appearance", ce]
|
|
107
107
|
]);
|
|
108
|
-
function
|
|
108
|
+
function pe(n, e, t) {
|
|
109
109
|
return e;
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const le = "https://json-schema.org/draft/2020-12/schema", ue = "https://farris-design.gitee.io/list-nav.schema.json", fe = "list-nav", de = "A Farris Container Component", ye = "object", be = {
|
|
112
112
|
id: {
|
|
113
113
|
description: "The unique identifier for a list-nav",
|
|
114
114
|
type: "string"
|
|
@@ -154,19 +154,19 @@ const pe = "https://json-schema.org/draft/2020-12/schema", le = "https://farris-
|
|
|
154
154
|
type: "boolean",
|
|
155
155
|
default: !0
|
|
156
156
|
}
|
|
157
|
-
},
|
|
157
|
+
}, he = [
|
|
158
158
|
"id",
|
|
159
159
|
"type",
|
|
160
160
|
"contents"
|
|
161
|
-
],
|
|
162
|
-
$schema:
|
|
163
|
-
$id:
|
|
164
|
-
title:
|
|
165
|
-
description:
|
|
166
|
-
type:
|
|
167
|
-
properties:
|
|
168
|
-
required:
|
|
169
|
-
},
|
|
161
|
+
], me = {
|
|
162
|
+
$schema: le,
|
|
163
|
+
$id: ue,
|
|
164
|
+
title: fe,
|
|
165
|
+
description: de,
|
|
166
|
+
type: ye,
|
|
167
|
+
properties: be,
|
|
168
|
+
required: he
|
|
169
|
+
}, ve = "list-nav", ge = "A Farris Component", je = "object", Ce = {
|
|
170
170
|
basic: {
|
|
171
171
|
description: "Basic Infomation",
|
|
172
172
|
title: "基本信息",
|
|
@@ -185,11 +185,11 @@ const pe = "https://json-schema.org/draft/2020-12/schema", le = "https://farris-
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
},
|
|
189
|
-
title:
|
|
190
|
-
description:
|
|
191
|
-
type:
|
|
192
|
-
categories:
|
|
188
|
+
}, Pe = {
|
|
189
|
+
title: ve,
|
|
190
|
+
description: ge,
|
|
191
|
+
type: je,
|
|
192
|
+
categories: Ce
|
|
193
193
|
}, B = {
|
|
194
194
|
/** 位置 */
|
|
195
195
|
position: { Type: String, default: "left" },
|
|
@@ -205,7 +205,7 @@ const pe = "https://json-schema.org/draft/2020-12/schema", le = "https://farris-
|
|
|
205
205
|
disabled: { Type: Boolean, default: !1 },
|
|
206
206
|
/** 是否启用拖拽 TODO */
|
|
207
207
|
draggable: { Type: Boolean, default: !1 }
|
|
208
|
-
},
|
|
208
|
+
}, W = ae(B, me, ie, pe, Pe), L = /* @__PURE__ */ _({
|
|
209
209
|
name: "FListNav",
|
|
210
210
|
props: B,
|
|
211
211
|
emits: ["collapse"],
|
|
@@ -214,7 +214,7 @@ const pe = "https://json-schema.org/draft/2020-12/schema", le = "https://farris-
|
|
|
214
214
|
function h(v) {
|
|
215
215
|
v && v.stopPropagation(), !n.disabled && (d.value = !0, s.value = !s.value, e.emit("collapse", s.value));
|
|
216
216
|
}
|
|
217
|
-
const m =
|
|
217
|
+
const m = q(() => {
|
|
218
218
|
const v = {};
|
|
219
219
|
let c = ["top", "bottom"].indexOf(t.value) > -1 ? "height" : "width";
|
|
220
220
|
return v[c] = s.value ? "0px" : n.size + "px", v;
|
|
@@ -248,7 +248,7 @@ const pe = "https://json-schema.org/draft/2020-12/schema", le = "https://farris-
|
|
|
248
248
|
}, null)])])]);
|
|
249
249
|
}
|
|
250
250
|
});
|
|
251
|
-
function
|
|
251
|
+
function Ae(n, e, t) {
|
|
252
252
|
var O;
|
|
253
253
|
function r() {
|
|
254
254
|
t != null && t.resolveComponentContext && t.resolveComponentContext();
|
|
@@ -337,7 +337,7 @@ function Pe(n, e, t) {
|
|
|
337
337
|
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || D(!1)
|
|
338
338
|
}, h;
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function Te() {
|
|
341
341
|
function n(e) {
|
|
342
342
|
var s, d;
|
|
343
343
|
if (!e)
|
|
@@ -357,7 +357,7 @@ function Ae() {
|
|
|
357
357
|
basalDragulaRuleForContainer: n
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
|
-
const
|
|
360
|
+
const Ne = "https://json-schema.org/draft/2020-12/schema", De = "https://farris-design.gitee.io/dragging-rules.schema.json", Oe = "Dragging Rules", we = "The rules of designer canvas", Me = "object", Ee = {
|
|
361
361
|
"f-page": {
|
|
362
362
|
description: "The root class of page designed by farris.",
|
|
363
363
|
type: "object",
|
|
@@ -995,15 +995,15 @@ const Te = "https://json-schema.org/draft/2020-12/schema", Ne = "https://farris-
|
|
|
995
995
|
description: "",
|
|
996
996
|
type: "object"
|
|
997
997
|
}
|
|
998
|
-
},
|
|
999
|
-
$schema:
|
|
1000
|
-
$id:
|
|
1001
|
-
title:
|
|
1002
|
-
description:
|
|
1003
|
-
type:
|
|
1004
|
-
properties:
|
|
998
|
+
}, Se = {
|
|
999
|
+
$schema: Ne,
|
|
1000
|
+
$id: De,
|
|
1001
|
+
title: Oe,
|
|
1002
|
+
description: we,
|
|
1003
|
+
type: Me,
|
|
1004
|
+
properties: Ee
|
|
1005
1005
|
}, F = /* @__PURE__ */ new Map();
|
|
1006
|
-
function
|
|
1006
|
+
function $e() {
|
|
1007
1007
|
function n(o, l, a, f) {
|
|
1008
1008
|
var T;
|
|
1009
1009
|
if (typeof a == "number")
|
|
@@ -1082,7 +1082,7 @@ function Se() {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
1084
|
function b() {
|
|
1085
|
-
const { properties: o } =
|
|
1085
|
+
const { properties: o } = Se;
|
|
1086
1086
|
Object.keys(o).forEach((l) => {
|
|
1087
1087
|
u(l, o[l], F);
|
|
1088
1088
|
});
|
|
@@ -1093,21 +1093,21 @@ function Se() {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
return b(), { getRuleValue: j };
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1097
|
-
const t =
|
|
1096
|
+
function Le(n, e) {
|
|
1097
|
+
const t = $e(), r = D(!1), s = D(!1);
|
|
1098
1098
|
let d = !0, h = !1, m, v = !1;
|
|
1099
1099
|
function c(i) {
|
|
1100
1100
|
return m && m.componentClassList && m.componentClassList.includes("f-form-layout") && m.componentClassList.includes("farris-form") ? i.sourceType === "control" && i.controlCategory === "input" || i.sourceType === "move" && i.controlType === "form-group" : !0;
|
|
1101
1101
|
}
|
|
1102
1102
|
function y(i) {
|
|
1103
|
-
return !(!
|
|
1103
|
+
return !(!Te().basalDragulaRuleForContainer(i) || !d || !c(i));
|
|
1104
1104
|
}
|
|
1105
1105
|
function u() {
|
|
1106
1106
|
r.value = !1, s.value = !1;
|
|
1107
1107
|
const i = n, C = i.appearance && i.appearance.class || "", O = C.split(" "), p = i.contents || [], P = p.length ? p[0] : null, g = P && P.appearance ? P.appearance.class : "", N = g ? g.split(" ") : [], M = p.length ? p.reduce((V, $) => {
|
|
1108
|
-
const z = $ && $.appearance ? $.appearance.class : "",
|
|
1109
|
-
return V.push(...
|
|
1110
|
-
}, []) : [], w = e, E = w && w.appearance && w.appearance.class || "",
|
|
1108
|
+
const z = $ && $.appearance ? $.appearance.class : "", Z = z ? z.split(" ") : [];
|
|
1109
|
+
return V.push(...Z), V;
|
|
1110
|
+
}, []) : [], w = e, E = w && w.appearance && w.appearance.class || "", Q = E ? E.split(" ") : [];
|
|
1111
1111
|
m = {
|
|
1112
1112
|
componentClass: C,
|
|
1113
1113
|
componentClassList: O,
|
|
@@ -1117,15 +1117,15 @@ function $e(n, e) {
|
|
|
1117
1117
|
firstChildClassList: N,
|
|
1118
1118
|
parent: w,
|
|
1119
1119
|
parentClass: E,
|
|
1120
|
-
parentClassList:
|
|
1120
|
+
parentClassList: Q,
|
|
1121
1121
|
children: p,
|
|
1122
1122
|
childrenClassList: M
|
|
1123
1123
|
};
|
|
1124
|
-
const { canAccept:
|
|
1125
|
-
return d =
|
|
1124
|
+
const { canAccept: U, fixed: X, hidePadding: Y } = t.getRuleValue(O[0], m);
|
|
1125
|
+
return d = U, h = Y, v = X, !0;
|
|
1126
1126
|
}
|
|
1127
1127
|
function b(i) {
|
|
1128
|
-
|
|
1128
|
+
R();
|
|
1129
1129
|
}
|
|
1130
1130
|
function j() {
|
|
1131
1131
|
return n.componentType ? "display:inherit;flex-direction:inherit;margin-bottom:10px" : "";
|
|
@@ -1169,20 +1169,20 @@ function $e(n, e) {
|
|
|
1169
1169
|
hideNestedPaddingInDesginerView: T
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
|
-
const
|
|
1172
|
+
const Fe = /* @__PURE__ */ _({
|
|
1173
1173
|
name: "FListNavDesign",
|
|
1174
1174
|
props: B,
|
|
1175
1175
|
emits: [],
|
|
1176
1176
|
setup(n, e) {
|
|
1177
1177
|
var u;
|
|
1178
|
-
const t = D(), r =
|
|
1178
|
+
const t = D(), r = K("design-item-context"), s = Le(r.schema, (u = r.parent) == null ? void 0 : u.schema), d = Ae(t, r, s);
|
|
1179
1179
|
d.value.canMove = !1, d.value.canNested = !1;
|
|
1180
|
-
const h = D(n.position), m = D(n.title), v = D(!1), c = D(!1), y =
|
|
1180
|
+
const h = D(n.position), m = D(n.title), v = D(!1), c = D(!1), y = q(() => {
|
|
1181
1181
|
const b = {};
|
|
1182
1182
|
let j = ["top", "bottom"].indexOf(h.value) > -1 ? "height" : "width";
|
|
1183
1183
|
return b[j] = v.value ? "0px" : n.size + "px", b;
|
|
1184
1184
|
});
|
|
1185
|
-
return
|
|
1185
|
+
return x(() => {
|
|
1186
1186
|
t.value.componentInstance = d;
|
|
1187
1187
|
}), e.expose(d.value), () => A("div", {
|
|
1188
1188
|
class: `f-list-nav f-list-nav-${h.value}`
|
|
@@ -1211,20 +1211,20 @@ const Le = /* @__PURE__ */ W({
|
|
|
1211
1211
|
class: "triangle"
|
|
1212
1212
|
}, null)])])]);
|
|
1213
1213
|
}
|
|
1214
|
-
}),
|
|
1214
|
+
}), Ve = {
|
|
1215
1215
|
install(n) {
|
|
1216
1216
|
n.component(L.name, L);
|
|
1217
1217
|
},
|
|
1218
1218
|
register(n, e, t, r) {
|
|
1219
|
-
n["list-nav"] = L, e["list-nav"] =
|
|
1219
|
+
n["list-nav"] = L, e["list-nav"] = W;
|
|
1220
1220
|
},
|
|
1221
1221
|
registerDesigner(n, e, t) {
|
|
1222
|
-
n["list-nav"] =
|
|
1222
|
+
n["list-nav"] = Fe, e["list-nav"] = W;
|
|
1223
1223
|
}
|
|
1224
1224
|
};
|
|
1225
1225
|
export {
|
|
1226
1226
|
L as FListNav,
|
|
1227
|
-
|
|
1227
|
+
Ve as default,
|
|
1228
1228
|
B as listNavProps,
|
|
1229
|
-
|
|
1229
|
+
W as propsResolver
|
|
1230
1230
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function($,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],s):($=typeof globalThis<"u"?globalThis:$||self,s($["list-nav"]={},$.Vue,$.LodashES))})(this,function($,s,_){"use strict";const q={},z={};function L(n){const{properties:e,title:t,ignore:r}=n,a=r&&Array.isArray(r),y=Object.keys(e).reduce((m,g)=>((!a||!r.find(v=>v==g))&&(m[g]=e[g].type==="object"&&e[g].properties?L(e[g]):_.cloneDeep(e[g].default)),m),{});return(!a||!r.find(m=>m=="id"))&&(y.id=`${t}-${Date.now()}`),y}function M(n,e={},t){const r=q[n];if(r){let a=L(r);const y=z[n];return a=y?y({getSchemaByType:M},a,e,t):a,a}return null}function G(n,e){const t=L(e);return Object.keys(n).reduce((r,a)=>(r[a]&&typeof r[a]=="object"?Object.assign(r[a],n[a]):r[a]=n[a],r),t),t}function J(n,e){return Object.keys(n).filter(r=>n[r]!=null).reduce((r,a)=>{if(e.has(a)){const y=e.get(a);if(typeof y=="string")r[y]=n[a];else{const m=y(a,n[a],n);Object.assign(r,m)}}else r[a]=n[a];return r},{})}function Q(n,e,t=new Map){const r=G(n,e);return J(r,t)}function U(n={}){function e(i,b,u,h){if(typeof u=="number")return h[i].length===u;if(typeof u=="object"){const C=Object.keys(u)[0],o=u[C];if(C==="not")return Number(h[i].length)!==Number(o);if(C==="moreThan")return Number(h[i].length)>=Number(o);if(C==="lessThan")return Number(h[i].length)<=Number(o)}return!1}function t(i,b,u,h){return h[i]&&h[i].propertyValue&&String(h[i].propertyValue.value)===String(u)}const r=new Map([["length",e],["getProperty",t]]);Object.keys(n).reduce((i,b)=>(i.set(b,n[b]),i),r);function a(i,b){const u=i;return typeof b=="number"?[{target:u,operator:"length",param:null,value:Number(b)}]:typeof b=="boolean"?[{target:u,operator:"getProperty",param:i,value:!!b}]:typeof b=="object"?Object.keys(b).map(h=>{if(h==="length")return{target:u,operator:"length",param:null,value:b[h]};const C=h,o=b[h];return{target:u,operator:"getProperty",param:C,value:o}}):[]}function y(i){return Object.keys(i).reduce((u,h)=>{const C=a(h,i[h]);return u.push(...C),u},[])}function m(i,b){if(r.has(i.operator)){const u=r.get(i.operator);return u&&u(i.target,i.param,i.value,b)||!1}return!1}function g(i,b){return y(i).reduce((C,o)=>C&&m(o,b),!0)}function v(i,b){const u=Object.keys(i),h=u.includes("allOf"),C=u.includes("anyOf"),o=h||C,d=(o?i[o?h?"allOf":"anyOf":"allOf"]:[i]).map(p=>g(p,b));return h?!d.includes(!1):d.includes(!0)}return{parseValueSchema:v}}const X={},Y={};U();function Z(n,e,t=new Map,r=(m,g,v)=>g,a={},y=m=>m){return q[e.title]=e,z[e.title]=r,X[e.title]=a,Y[e.title]=y,(m={})=>{const g=Q(m,e,t),v=Object.keys(n).reduce((i,b)=>(i[b]=n[b].default,i),{});return Object.assign(v,g)}}function R(n,e){return{customClass:e.class,customStyle:e.style}}const K=new Map([["appearance",R]]);function x(n,e,t){return e}const I={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/list-nav.schema.json",title:"list-nav",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a list-nav",type:"string"},type:{description:"The type string of list-nav component",type:"string",default:"list-nav"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},ee={title:"list-nav",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}}}}},E={position:{Type:String,default:"left"},title:{Type:String,default:""},size:{Type:Number||String,default:218},collapsible:{Type:Boolean,default:!0},folded:{Type:Boolean,default:!1},disabled:{Type:Boolean,default:!1},draggable:{Type:Boolean,default:!1}},F=Z(E,I,K,x,ee),S=s.defineComponent({name:"FListNav",props:E,emits:["collapse"],setup(n,e){const t=s.ref(n.position),r=s.ref(n.title),a=s.ref(n.folded),y=s.ref(!1);function m(v){v&&v.stopPropagation(),!n.disabled&&(y.value=!0,a.value=!a.value,e.emit("collapse",a.value))}const g=s.computed(()=>{const v={};let i=["top","bottom"].indexOf(t.value)>-1?"height":"width";return v[i]=a.value?"0px":n.size+"px",v});return()=>s.createVNode("div",{class:`f-list-nav f-list-nav-${t.value}`},[s.createVNode("div",{class:"f-list-nav-in",style:g.value},[s.createVNode("div",{class:"f-list-nav-main"},[e.slots.navHeader&&s.createVNode("div",{class:"f-list-nav-header"},[e.slots.navHeader()]),!e.slots.navHeader&&r.value&&s.createVNode("div",{class:"f-list-nav-header"},[s.createVNode("div",{class:"f-list-nav-title"},[r.value])]),e.slots.navContent&&s.createVNode("div",{class:"f-list-nav-content"},[e.slots.navContent()]),e.slots.navFooter&&s.createVNode("div",{class:"f-list-nav-footer"},[e.slots.navFooter()])]),n.collapsible&&s.createVNode("div",{class:["f-list-nav-toggle-sidebar",{disabled:n.disabled,active:a.value,"splitter-pane-collapse-animate":y.value}],onClick:v=>m(v)},[s.createVNode("span",{class:"triangle"},null)])])])}});function te(n,e,t){var D;function r(){t!=null&&t.resolveComponentContext&&t.resolveComponentContext()}r();const a=t&&t.getStyles&&t.getStyles()||"",y=t&&t.getDesignerClass&&t.getDesignerClass()||"",m=s.ref();function g(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function v(){return!1}function i(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function b(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function u(l){if(!l||!l.value)return null;if(l.value.schema&&l.value.schema.type==="component")return l.value;const P=s.ref(l==null?void 0:l.value.parent),j=u(P);return j||null}function h(l=e){const{componentInstance:P,designerItemElementRef:j}=l;return!P||!P.value?null:P.value.canMove?j:h(l.parent)}function C(l){return!!t&&t.canAccepts(l)}function o(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function f(){}function c(l,P){P&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(P)}function d(l,P){const{componentType:j}=l;let A=M(j,l,P);t&&t.onResolveNewComponentSchema&&(A=t.onResolveNewComponentSchema(l,A));const V=j.toLowerCase().replace("-","_");return A&&!A.id&&A.type===j&&(A.id=`${V}_${Math.random().toString().slice(2,6)}`),A}function T(l,P){const j=String(l.getAttribute("data-controltype")),A=l.getAttribute("data-feature"),V=A?JSON.parse(A):{};V.parentComponentInstance=m.value;let O=M(j,V);t&&t.onAcceptNewChildElement&&(O=t.onAcceptNewChildElement(l,P,O));const w=j.toLowerCase().replace("-","_");return O&&!O.id&&O.type===j&&(O.id=`${w}_${Math.random().toString().slice(2,6)}`),O}function p(l){}function N(...l){if(t&&t.getPropsConfig)return t.getPropsConfig(...l)}return m.value={canMove:g(),canSelectParent:v(),canDelete:i(),canNested:!b(),contents:e==null?void 0:e.schema.contents,elementRef:n,parent:(D=e==null?void 0:e.parent)==null?void 0:D.componentInstance,schema:e==null?void 0:e.schema,styles:a,designerClass:y,canAccepts:C,getBelongedComponentInstance:u,getDraggableDesignItemElement:h,getDraggingDisplayText:o,getPropConfig:N,getDragScopeElement:f,onAcceptMovedChildElement:c,onAcceptNewChildElement:T,onChildElementMovedOut:p,addNewChildComponentSchema:d,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||s.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||s.ref(!1)},m}function ne(){function n(e){var a,y;if(!e)return!1;const t=((a=e.targetContainer)==null?void 0:a.componentInstance)&&e.targetContainer.componentInstance.value;if(!t)return!1;const r=(y=t.schema.appearance)==null?void 0:y.class;if(e.controlCategory==="input"||e.controlType==="form-group"){const m=t.schema.type,g=(m==="response-form"||m==="content-container")&&r&&r.includes("farris-form");if(t.schema.type!=="response-layout-item"&&!g)return!1}return e.controlType!=="field-set"}return{basalDragulaRuleForContainer:n}}const oe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"},"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}}},k=new Map;function re(){function n(o,f,c,d){var T;if(typeof c=="number")return((T=d[o])==null?void 0:T.length)===c;if(typeof c=="object"){const p=Object.keys(c)[0],N=c[p];if(p==="not")return Number(d[o].length)!==Number(N);if(p==="moreThan")return Number(d[o].length)>=Number(N);if(p==="lessThan")return Number(d[o].length)<=Number(N)}return!1}function e(o,f,c,d){return typeof c=="boolean"?d.childrenClassList.includes(f)===!!c:!1}function t(o,f,c,d){return typeof c=="boolean"?d.parentClassList.includes(f)===!!c:!1}function r(o,f,c,d){return typeof c=="boolean"?d.parentClassList.includes(f)===!!c:!1}const a=new Map([["length",n],["hasChildren",e],["hasSibling",r],["hasParent",t]]);function y(o,f){const c=o;return typeof f=="number"?[{target:c,operator:"length",param:null,value:Number(f)}]:typeof f=="object"?Object.keys(f).map(d=>{if(d==="length")return{target:c,operator:"length",param:null,value:f[d]};const T=d,p=f[d];return{target:c,operator:o==="children"?"hasChildren":o==="parent"?"hasParent":"hasSibling",param:T,value:p}}):[]}function m(o,f){if(a.has(o.operator)){const c=a.get(o.operator);return c&&c(o.target,o.param,o.value,f)||!1}return!1}function g(o,f){return Object.keys(o).reduce((p,N)=>{const D=y(N,o[N]);return p.push(...D),p},[]).reduce((p,N)=>p&&m(N,f),!0)}function v(o,f){const c=Object.keys(o),d=c.includes("allOf"),T=c.includes("anyOf"),p=d||T,l=(p?o[p?d?"allOf":"anyOf":"allOf"]:[o]).map(j=>g(j,f));return d?!l.includes(!1):l.includes(!0)}function i(o,f){const c=o.const;return c?typeof c=="boolean"?c:typeof c=="object"?v(c,f):!1:!1}function b(o){return f=>{const c={canAccept:!0,fixed:!1,hidePadding:!1};return o&&o.properties&&Object.keys(o.properties).reduce((d,T)=>{const p=o.properties[T];return d[T]=i(p,f),d},c),c}}function u(o,f,c){if(f.type==="object"&&f.properties){const{rules:d,contents:T}=f.properties;c.set(o,b(d)),T&&Object.keys(T.properties).forEach(p=>u(p,T.properties[p],c))}}function h(){const{properties:o}=oe;Object.keys(o).forEach(f=>{u(f,o[f],k)})}function C(o,f){const c={canAccept:!0,fixed:!1,hidePadding:!0};return k.has(o)?k.get(o)(f):c}return h(),{getRuleValue:C}}function se(n,e){const t=re(),r=s.ref(!1),a=s.ref(!1);let y=!0,m=!1,g,v=!1;function i(p){return g&&g.componentClassList&&g.componentClassList.includes("f-form-layout")&&g.componentClassList.includes("farris-form")?p.sourceType==="control"&&p.controlCategory==="input"||p.sourceType==="move"&&p.controlType==="form-group":!0}function b(p){return!(!ne().basalDragulaRuleForContainer(p)||!y||!i(p))}function u(){r.value=!1,a.value=!1;const p=n,N=p.appearance&&p.appearance.class||"",D=N.split(" "),l=p.contents||[],P=l.length?l[0]:null,j=P&&P.appearance?P.appearance.class:"",A=j?j.split(" "):[],V=l.length?l.reduce((H,B)=>{const W=B&&B.appearance?B.appearance.class:"",ue=W?W.split(" "):[];return H.push(...ue),H},[]):[],O=e,w=O&&O.appearance&&O.appearance.class||"",ie=w?w.split(" "):[];g={componentClass:N,componentClassList:D,childContents:l,firstChildContent:P,firstChildClass:j,firstChildClassList:A,parent:O,parentClass:w,parentClassList:ie,children:l,childrenClassList:V};const{canAccept:pe,fixed:le,hidePadding:fe}=t.getRuleValue(D[0],g);return y=pe,m=fe,v=le,!0}function h(p){s.nextTick()}function C(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function o(p,N){const D=n;if((D.appearance&&D.appearance.class||"").split(" ").includes("f-form-layout")){const{label:j}=p,A=M("form-group");return A.editor=N,A.label=j,A}return N}function f(p,N,D){const l=n;if((l.appearance&&l.appearance.class||"").split(" ").includes("f-form-layout")){const A=String(p.innerText),V=M("form-group");return V.editor=D,V.label=A,V}return D}function c(){return!v}function d(){return!v}function T(){return m}return{canAccepts:b,resolveComponentContext:u,getStyles:C,onAcceptNewChildElement:f,onAcceptMovedChildElement:h,onResolveNewComponentSchema:o,triggerBelongedComponentToMoveWhenMoved:r,triggerBelongedComponentToDeleteWhenDeleted:a,checkCanMoveComponent:c,checkCanDeleteComponent:d,hideNestedPaddingInDesginerView:T}}const ae=s.defineComponent({name:"FListNavDesign",props:E,emits:[],setup(n,e){var u;const t=s.ref(),r=s.inject("design-item-context"),a=se(r.schema,(u=r.parent)==null?void 0:u.schema),y=te(t,r,a);y.value.canMove=!1,y.value.canNested=!1;const m=s.ref(n.position),g=s.ref(n.title),v=s.ref(!1),i=s.ref(!1),b=s.computed(()=>{const h={};let C=["top","bottom"].indexOf(m.value)>-1?"height":"width";return h[C]=v.value?"0px":n.size+"px",h});return s.onMounted(()=>{t.value.componentInstance=y}),e.expose(y.value),()=>s.createVNode("div",{class:`f-list-nav f-list-nav-${m.value}`},[s.createVNode("div",{class:"f-list-nav-in",style:b.value},[s.createVNode("div",{class:"f-list-nav-main"},[e.slots.navHeader&&s.createVNode("div",{class:"f-list-nav-header"},[e.slots.navHeader()]),!e.slots.navHeader&&g.value&&s.createVNode("div",{class:"f-list-nav-header"},[s.createVNode("div",{class:"f-list-nav-title"},[g.value])]),e.slots.navContent&&s.createVNode("div",{class:"f-list-nav-content"},[e.slots.navContent()]),e.slots.navFooter&&s.createVNode("div",{class:"f-list-nav-footer"},[e.slots.navFooter()])]),n.collapsible&&s.createVNode("div",{class:["f-list-nav-toggle-sidebar",{disabled:n.disabled,active:v.value,"splitter-pane-collapse-animate":i.value}]},[s.createVNode("span",{class:"triangle"},null)])])])}}),ce={install(n){n.component(S.name,S)},register(n,e,t,r){n["list-nav"]=S,e["list-nav"]=F},registerDesigner(n,e,t){n["list-nav"]=ae,e["list-nav"]=F}};$.FListNav=S,$.default=ce,$.listNavProps=E,$.propsResolver=F,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function($,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],a):($=typeof globalThis<"u"?globalThis:$||self,a($["list-nav"]={},$.Vue,$.LodashES))})(this,function($,a,L){"use strict";const z={},H={};function F(n){const{properties:e,title:t,ignore:r}=n,s=r&&Array.isArray(r),y=Object.keys(e).reduce((m,g)=>((!s||!r.find(v=>v==g))&&(m[g]=e[g].type==="object"&&e[g].properties?F(e[g]):L.cloneDeep(e[g].default)),m),{});return(!s||!r.find(m=>m=="id"))&&(y.id=`${t}-${Date.now()}`),y}function M(n,e={},t){const r=z[n];if(r){let s=F(r);const y=H[n];return s=y?y({getSchemaByType:M},s,e,t):s,s}return null}function G(n,e){const t=F(e);return Object.keys(n).reduce((r,s)=>(r[s]&&L.isPlainObject(r[s])&&L.isPlainObject(n[s])?Object.assign(r[s],n[s]):r[s]=n[s],r),t),t}function J(n,e){return Object.keys(n).filter(r=>n[r]!=null).reduce((r,s)=>{if(e.has(s)){const y=e.get(s);if(typeof y=="string")r[y]=n[s];else{const m=y(s,n[s],n);Object.assign(r,m)}}else r[s]=n[s];return r},{})}function Q(n,e,t=new Map){const r=G(n,e);return J(r,t)}function U(n={}){function e(i,b,u,h){if(typeof u=="number")return h[i].length===u;if(typeof u=="object"){const C=Object.keys(u)[0],o=u[C];if(C==="not")return Number(h[i].length)!==Number(o);if(C==="moreThan")return Number(h[i].length)>=Number(o);if(C==="lessThan")return Number(h[i].length)<=Number(o)}return!1}function t(i,b,u,h){return h[i]&&h[i].propertyValue&&String(h[i].propertyValue.value)===String(u)}const r=new Map([["length",e],["getProperty",t]]);Object.keys(n).reduce((i,b)=>(i.set(b,n[b]),i),r);function s(i,b){const u=i;return typeof b=="number"?[{target:u,operator:"length",param:null,value:Number(b)}]:typeof b=="boolean"?[{target:u,operator:"getProperty",param:i,value:!!b}]:typeof b=="object"?Object.keys(b).map(h=>{if(h==="length")return{target:u,operator:"length",param:null,value:b[h]};const C=h,o=b[h];return{target:u,operator:"getProperty",param:C,value:o}}):[]}function y(i){return Object.keys(i).reduce((u,h)=>{const C=s(h,i[h]);return u.push(...C),u},[])}function m(i,b){if(r.has(i.operator)){const u=r.get(i.operator);return u&&u(i.target,i.param,i.value,b)||!1}return!1}function g(i,b){return y(i).reduce((C,o)=>C&&m(o,b),!0)}function v(i,b){const u=Object.keys(i),h=u.includes("allOf"),C=u.includes("anyOf"),o=h||C,d=(o?i[o?h?"allOf":"anyOf":"allOf"]:[i]).map(p=>g(p,b));return h?!d.includes(!1):d.includes(!0)}return{parseValueSchema:v}}const X={},Y={};U();function Z(n,e,t=new Map,r=(m,g,v)=>g,s={},y=m=>m){return z[e.title]=e,H[e.title]=r,X[e.title]=s,Y[e.title]=y,(m={})=>{const g=Q(m,e,t),v=Object.keys(n).reduce((i,b)=>(i[b]=n[b].default,i),{});return Object.assign(v,g)}}function R(n,e){return{customClass:e.class,customStyle:e.style}}const K=new Map([["appearance",R]]);function x(n,e,t){return e}const I={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/list-nav.schema.json",title:"list-nav",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a list-nav",type:"string"},type:{description:"The type string of list-nav component",type:"string",default:"list-nav"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},ee={title:"list-nav",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}}}}},E={position:{Type:String,default:"left"},title:{Type:String,default:""},size:{Type:Number||String,default:218},collapsible:{Type:Boolean,default:!0},folded:{Type:Boolean,default:!1},disabled:{Type:Boolean,default:!1},draggable:{Type:Boolean,default:!1}},k=Z(E,I,K,x,ee),S=a.defineComponent({name:"FListNav",props:E,emits:["collapse"],setup(n,e){const t=a.ref(n.position),r=a.ref(n.title),s=a.ref(n.folded),y=a.ref(!1);function m(v){v&&v.stopPropagation(),!n.disabled&&(y.value=!0,s.value=!s.value,e.emit("collapse",s.value))}const g=a.computed(()=>{const v={};let i=["top","bottom"].indexOf(t.value)>-1?"height":"width";return v[i]=s.value?"0px":n.size+"px",v});return()=>a.createVNode("div",{class:`f-list-nav f-list-nav-${t.value}`},[a.createVNode("div",{class:"f-list-nav-in",style:g.value},[a.createVNode("div",{class:"f-list-nav-main"},[e.slots.navHeader&&a.createVNode("div",{class:"f-list-nav-header"},[e.slots.navHeader()]),!e.slots.navHeader&&r.value&&a.createVNode("div",{class:"f-list-nav-header"},[a.createVNode("div",{class:"f-list-nav-title"},[r.value])]),e.slots.navContent&&a.createVNode("div",{class:"f-list-nav-content"},[e.slots.navContent()]),e.slots.navFooter&&a.createVNode("div",{class:"f-list-nav-footer"},[e.slots.navFooter()])]),n.collapsible&&a.createVNode("div",{class:["f-list-nav-toggle-sidebar",{disabled:n.disabled,active:s.value,"splitter-pane-collapse-animate":y.value}],onClick:v=>m(v)},[a.createVNode("span",{class:"triangle"},null)])])])}});function te(n,e,t){var D;function r(){t!=null&&t.resolveComponentContext&&t.resolveComponentContext()}r();const s=t&&t.getStyles&&t.getStyles()||"",y=t&&t.getDesignerClass&&t.getDesignerClass()||"",m=a.ref();function g(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function v(){return!1}function i(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function b(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function u(l){if(!l||!l.value)return null;if(l.value.schema&&l.value.schema.type==="component")return l.value;const P=a.ref(l==null?void 0:l.value.parent),j=u(P);return j||null}function h(l=e){const{componentInstance:P,designerItemElementRef:j}=l;return!P||!P.value?null:P.value.canMove?j:h(l.parent)}function C(l){return!!t&&t.canAccepts(l)}function o(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function f(){}function c(l,P){P&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(P)}function d(l,P){const{componentType:j}=l;let A=M(j,l,P);t&&t.onResolveNewComponentSchema&&(A=t.onResolveNewComponentSchema(l,A));const V=j.toLowerCase().replace("-","_");return A&&!A.id&&A.type===j&&(A.id=`${V}_${Math.random().toString().slice(2,6)}`),A}function T(l,P){const j=String(l.getAttribute("data-controltype")),A=l.getAttribute("data-feature"),V=A?JSON.parse(A):{};V.parentComponentInstance=m.value;let O=M(j,V);t&&t.onAcceptNewChildElement&&(O=t.onAcceptNewChildElement(l,P,O));const w=j.toLowerCase().replace("-","_");return O&&!O.id&&O.type===j&&(O.id=`${w}_${Math.random().toString().slice(2,6)}`),O}function p(l){}function N(...l){if(t&&t.getPropsConfig)return t.getPropsConfig(...l)}return m.value={canMove:g(),canSelectParent:v(),canDelete:i(),canNested:!b(),contents:e==null?void 0:e.schema.contents,elementRef:n,parent:(D=e==null?void 0:e.parent)==null?void 0:D.componentInstance,schema:e==null?void 0:e.schema,styles:s,designerClass:y,canAccepts:C,getBelongedComponentInstance:u,getDraggableDesignItemElement:h,getDraggingDisplayText:o,getPropConfig:N,getDragScopeElement:f,onAcceptMovedChildElement:c,onAcceptNewChildElement:T,onChildElementMovedOut:p,addNewChildComponentSchema:d,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||a.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||a.ref(!1)},m}function ne(){function n(e){var s,y;if(!e)return!1;const t=((s=e.targetContainer)==null?void 0:s.componentInstance)&&e.targetContainer.componentInstance.value;if(!t)return!1;const r=(y=t.schema.appearance)==null?void 0:y.class;if(e.controlCategory==="input"||e.controlType==="form-group"){const m=t.schema.type,g=(m==="response-form"||m==="content-container")&&r&&r.includes("farris-form");if(t.schema.type!=="response-layout-item"&&!g)return!1}return e.controlType!=="field-set"}return{basalDragulaRuleForContainer:n}}const oe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"},"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}}},B=new Map;function re(){function n(o,f,c,d){var T;if(typeof c=="number")return((T=d[o])==null?void 0:T.length)===c;if(typeof c=="object"){const p=Object.keys(c)[0],N=c[p];if(p==="not")return Number(d[o].length)!==Number(N);if(p==="moreThan")return Number(d[o].length)>=Number(N);if(p==="lessThan")return Number(d[o].length)<=Number(N)}return!1}function e(o,f,c,d){return typeof c=="boolean"?d.childrenClassList.includes(f)===!!c:!1}function t(o,f,c,d){return typeof c=="boolean"?d.parentClassList.includes(f)===!!c:!1}function r(o,f,c,d){return typeof c=="boolean"?d.parentClassList.includes(f)===!!c:!1}const s=new Map([["length",n],["hasChildren",e],["hasSibling",r],["hasParent",t]]);function y(o,f){const c=o;return typeof f=="number"?[{target:c,operator:"length",param:null,value:Number(f)}]:typeof f=="object"?Object.keys(f).map(d=>{if(d==="length")return{target:c,operator:"length",param:null,value:f[d]};const T=d,p=f[d];return{target:c,operator:o==="children"?"hasChildren":o==="parent"?"hasParent":"hasSibling",param:T,value:p}}):[]}function m(o,f){if(s.has(o.operator)){const c=s.get(o.operator);return c&&c(o.target,o.param,o.value,f)||!1}return!1}function g(o,f){return Object.keys(o).reduce((p,N)=>{const D=y(N,o[N]);return p.push(...D),p},[]).reduce((p,N)=>p&&m(N,f),!0)}function v(o,f){const c=Object.keys(o),d=c.includes("allOf"),T=c.includes("anyOf"),p=d||T,l=(p?o[p?d?"allOf":"anyOf":"allOf"]:[o]).map(j=>g(j,f));return d?!l.includes(!1):l.includes(!0)}function i(o,f){const c=o.const;return c?typeof c=="boolean"?c:typeof c=="object"?v(c,f):!1:!1}function b(o){return f=>{const c={canAccept:!0,fixed:!1,hidePadding:!1};return o&&o.properties&&Object.keys(o.properties).reduce((d,T)=>{const p=o.properties[T];return d[T]=i(p,f),d},c),c}}function u(o,f,c){if(f.type==="object"&&f.properties){const{rules:d,contents:T}=f.properties;c.set(o,b(d)),T&&Object.keys(T.properties).forEach(p=>u(p,T.properties[p],c))}}function h(){const{properties:o}=oe;Object.keys(o).forEach(f=>{u(f,o[f],B)})}function C(o,f){const c={canAccept:!0,fixed:!1,hidePadding:!0};return B.has(o)?B.get(o)(f):c}return h(),{getRuleValue:C}}function se(n,e){const t=re(),r=a.ref(!1),s=a.ref(!1);let y=!0,m=!1,g,v=!1;function i(p){return g&&g.componentClassList&&g.componentClassList.includes("f-form-layout")&&g.componentClassList.includes("farris-form")?p.sourceType==="control"&&p.controlCategory==="input"||p.sourceType==="move"&&p.controlType==="form-group":!0}function b(p){return!(!ne().basalDragulaRuleForContainer(p)||!y||!i(p))}function u(){r.value=!1,s.value=!1;const p=n,N=p.appearance&&p.appearance.class||"",D=N.split(" "),l=p.contents||[],P=l.length?l[0]:null,j=P&&P.appearance?P.appearance.class:"",A=j?j.split(" "):[],V=l.length?l.reduce((W,q)=>{const _=q&&q.appearance?q.appearance.class:"",ue=_?_.split(" "):[];return W.push(...ue),W},[]):[],O=e,w=O&&O.appearance&&O.appearance.class||"",ie=w?w.split(" "):[];g={componentClass:N,componentClassList:D,childContents:l,firstChildContent:P,firstChildClass:j,firstChildClassList:A,parent:O,parentClass:w,parentClassList:ie,children:l,childrenClassList:V};const{canAccept:pe,fixed:le,hidePadding:fe}=t.getRuleValue(D[0],g);return y=pe,m=fe,v=le,!0}function h(p){a.nextTick()}function C(){return n.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function o(p,N){const D=n;if((D.appearance&&D.appearance.class||"").split(" ").includes("f-form-layout")){const{label:j}=p,A=M("form-group");return A.editor=N,A.label=j,A}return N}function f(p,N,D){const l=n;if((l.appearance&&l.appearance.class||"").split(" ").includes("f-form-layout")){const A=String(p.innerText),V=M("form-group");return V.editor=D,V.label=A,V}return D}function c(){return!v}function d(){return!v}function T(){return m}return{canAccepts:b,resolveComponentContext:u,getStyles:C,onAcceptNewChildElement:f,onAcceptMovedChildElement:h,onResolveNewComponentSchema:o,triggerBelongedComponentToMoveWhenMoved:r,triggerBelongedComponentToDeleteWhenDeleted:s,checkCanMoveComponent:c,checkCanDeleteComponent:d,hideNestedPaddingInDesginerView:T}}const ae=a.defineComponent({name:"FListNavDesign",props:E,emits:[],setup(n,e){var u;const t=a.ref(),r=a.inject("design-item-context"),s=se(r.schema,(u=r.parent)==null?void 0:u.schema),y=te(t,r,s);y.value.canMove=!1,y.value.canNested=!1;const m=a.ref(n.position),g=a.ref(n.title),v=a.ref(!1),i=a.ref(!1),b=a.computed(()=>{const h={};let C=["top","bottom"].indexOf(m.value)>-1?"height":"width";return h[C]=v.value?"0px":n.size+"px",h});return a.onMounted(()=>{t.value.componentInstance=y}),e.expose(y.value),()=>a.createVNode("div",{class:`f-list-nav f-list-nav-${m.value}`},[a.createVNode("div",{class:"f-list-nav-in",style:b.value},[a.createVNode("div",{class:"f-list-nav-main"},[e.slots.navHeader&&a.createVNode("div",{class:"f-list-nav-header"},[e.slots.navHeader()]),!e.slots.navHeader&&g.value&&a.createVNode("div",{class:"f-list-nav-header"},[a.createVNode("div",{class:"f-list-nav-title"},[g.value])]),e.slots.navContent&&a.createVNode("div",{class:"f-list-nav-content"},[e.slots.navContent()]),e.slots.navFooter&&a.createVNode("div",{class:"f-list-nav-footer"},[e.slots.navFooter()])]),n.collapsible&&a.createVNode("div",{class:["f-list-nav-toggle-sidebar",{disabled:n.disabled,active:v.value,"splitter-pane-collapse-animate":i.value}]},[a.createVNode("span",{class:"triangle"},null)])])])}}),ce={install(n){n.component(S.name,S)},register(n,e,t,r){n["list-nav"]=S,e["list-nav"]=k},registerDesigner(n,e,t){n["list-nav"]=ae,e["list-nav"]=k}};$.FListNav=S,$.default=ce,$.listNavProps=E,$.propsResolver=k,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.f-navlookup-recommandLabel{height:18px;font-family:PingFangSC-Regular;font-size:13px;color:#3d4c6b;font-weight:400;cursor:pointer}.f-navlookup-recentHeader{height:32px;background:#fafaff;width:100%;display:flex;align-items:center;padding-left:10px;cursor:pointer;border:1px solid rgba(233,236,243,1)}.f-listview-item-active{background-color:#dae9ff!important}.f-listview-item{padding:0 .5rem 0 .3125rem;border-radius:3px}
|
|
1
|
+
.f-navlookup-recommandLabel{height:18px;font-family:PingFangSC-Regular;font-size:13px;color:#3d4c6b;font-weight:400;cursor:pointer}.f-navlookup-recentHeader{height:32px;background:#fafaff;width:100%;display:flex;align-items:center;padding-left:10px;cursor:pointer;border:1px solid rgba(233,236,243,1)}.f-listview-item-active,.f-listview-item-hover{background-color:#dae9ff!important}.f-listview-item{padding:0 .5rem 0 .3125rem;border-radius:3px}.fade-enter-active,.fade-leave-active{transition:opacity .5s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fv-resizable-handle{position:absolute;font-size:.1px;display:block;touch-action:none}.fv-resizable-handle:hover{background:#2a87ff12}.fv-resizable-handle.fv-resizable-n{cursor:n-resize;height:.4375rem;width:100%;top:-.3125rem;left:0}.fv-resizable-handle.fv-resizable-e{cursor:e-resize;width:.4375rem;right:-.3125rem;height:100%;top:0}.fv-resizable-handle.fv-resizable-s{cursor:s-resize;height:.4375rem;width:100%;bottom:-.3125rem;left:0}.fv-resizable-handle.fv-resizable-w{cursor:w-resize;height:100%;width:.4375rem;left:-.3125rem;top:0}.fv-resizable-handle.fv-resizable-ne{cursor:ne-resize;width:.75rem;height:.75rem;right:1px;top:1px}.fv-resizable-handle.fv-resizable-se{cursor:se-resize;width:.75rem;height:.75rem;right:1px;bottom:1px}.fv-resizable-handle.fv-resizable-nw{cursor:nw-resize;width:.75rem;height:.75rem;left:1px;top:1px}.fv-resizable-handle.fv-resizable-sw{cursor:sw-resize;width:.75rem;height:.75rem;left:1px;bottom:1px}.screenGroup{background:#ffffffe6;box-shadow:0 0 3px #024bc133;border-radius:8px;padding:2px 14px;margin:5px auto;flex:1 1 0!important}.screenGroup .screenName{width:90px;font-family:PingFangSC-Regular;font-size:14px;line-height:24px;color:#2a87ff;height:32px;padding:4px;text-align:left}.screenGroup .screen-input{flex:1 1 0}.screenGroup farris-combo-list{width:84px}.screenGroup .columnText{line-height:26px}.applyBtn{margin-top:5px;display:flex;justify-content:center}.applyBtn .btn{width:110px}.en .screenGroup{width:100%;flex-direction:column;align-items:flex-start}.en .screenGroup>div{width:100%;padding:0 10px 10px 0;margin-left:0!important}.en .screenGroup .screenName{width:auto}.en .screenGroup farris-combo-list{flex:1}.en .screenGroup .columnText{width:50px}
|