@farris/ui-vue 1.3.0 → 1.3.1
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 +1 -1
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +472 -366
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +1 -1
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +472 -480
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +225 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +615 -517
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +325 -333
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +578 -472
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +49 -49
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +832 -722
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +303 -981
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +8 -8
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +335 -1002
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4429 -4312
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3037 -3020
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2216 -2119
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +914 -883
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +223 -231
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1691 -2187
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +143 -136
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +250 -258
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +1 -1
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +2672 -3438
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +2965 -2970
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +1650 -1602
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +684 -675
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +453 -461
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +604 -507
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +402 -378
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +348 -1019
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +1658 -1666
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +5209 -5088
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +4329 -4213
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +905 -1357
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +517 -420
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +588 -491
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1376 -1965
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +1 -1
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1073 -1905
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +809 -1237
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +198 -206
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1297 -1200
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +609 -507
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +3391 -3758
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +1 -1
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +544 -447
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +247 -255
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +146 -154
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +700 -675
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +956 -1786
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4963 -5617
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +158 -161
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +436 -1124
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +92 -100
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +571 -1210
- package/components/splitter/index.umd.cjs +1 -1
- package/components/splitter/style.js +2 -0
- package/components/step/index.esm.js +239 -247
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +445 -348
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +2278 -3031
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +311 -319
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +215 -223
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +468 -371
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +1271 -1174
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +469 -477
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3060 -3065
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2476 -2481
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +374 -382
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +248 -256
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +414 -1093
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +498 -506
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +20216 -21844
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/common/directive/area-response.d.ts +10 -0
- package/types/common/index.d.ts +8 -0
- package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
- package/types/common/utils/resolve-field.d.ts +2 -0
- package/types/common/utils/use-class.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/condition/src/types.d.ts +2 -1
- package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/data-grid/index.d.ts +8 -5
- package/types/data-grid/src/data-grid.component.d.ts +3 -2
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +7 -9
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/rule/use-dragula-common-rule.d.ts +4 -0
- package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
- package/types/designer-canvas/src/composition/types.d.ts +1 -2
- package/types/designer-canvas/src/types.d.ts +2 -1
- package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
- 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 +1 -1
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +1 -1
- package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
- package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
- package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -1
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +34 -27
- package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
- package/types/query-solution/src/designer/query-solution-config/composition/use-property.d.ts +19 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +60 -0
- package/types/query-solution/src/solutions.d.ts +108 -509
- package/types/response-layout-editor/index.d.ts +3 -1
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
- package/types/section/src/designer/use-designer-rules.d.ts +3 -3
- package/types/splitter/src/components/splitter-pane.component.d.ts +1 -1
- package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
- package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
- package/types/tree-grid/index.d.ts +3 -3
- package/types/tree-grid/src/tree-grid.component.d.ts +1 -1
- package/types/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
- package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
- package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
- package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(w,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("lodash-es"),require("../response-toolbar/index.umd.js"),require("bignumber.js"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../response-toolbar/index.umd.js","bignumber.js","../common/index.umd.js"],o):(w=typeof globalThis<"u"?globalThis:w||self,o(w.section={},w.Vue,w.LodashES,w.FResponseToolbar,w.BigNumber,w.common))})(this,function(w,o,$,U,Se,Z){"use strict";const z={},W={};function x(t){const{properties:e,title:n,ignore:r}=t,c=r&&Array.isArray(r),l=Object.keys(e).reduce((b,h)=>((!c||!r.find(j=>j==h))&&(b[h]=e[h].type==="object"&&e[h].properties?x(e[h]):$.cloneDeep(e[h].default)),b),{});return(!c||!r.find(b=>b=="id"))&&(l.id=`${n}-${Date.now()}`),l}function V(t,e={},n){const r=z[t];if(r){let c=x(r);const l=W[t];return c=l?l({getSchemaByType:V},c,e,n):c,c}return null}function Q(t,e){const n=x(e);return Object.keys(t).reduce((r,c)=>(r[c]&&$.isPlainObject(r[c])&&$.isPlainObject(t[c])?Object.assign(r[c],t[c]):r[c]=t[c],r),n),n}function X(t,e){return Object.keys(t).filter(r=>t[r]!=null).reduce((r,c)=>{if(e.has(c)){const l=e.get(c);if(typeof l=="string")r[l]=t[c];else{const b=l(c,t[c],t);Object.assign(r,b)}}else r[c]=t[c];return r},{})}function Y(t,e,n=new Map){const r=Q(t,e);return X(r,n)}function R(t={}){function e(i,m,f,d){if(typeof f=="number")return d[i].length===f;if(typeof f=="object"){const C=Object.keys(f)[0],a=f[C];if(C==="not")return Number(d[i].length)!==Number(a);if(C==="moreThan")return Number(d[i].length)>=Number(a);if(C==="lessThan")return Number(d[i].length)<=Number(a)}return!1}function n(i,m,f,d){return d[i]&&d[i].propertyValue&&String(d[i].propertyValue.value)===String(f)}const r=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((i,m)=>(i.set(m,t[m]),i),r);function c(i,m){const f=i;return typeof m=="number"?[{target:f,operator:"length",param:null,value:Number(m)}]:typeof m=="boolean"?[{target:f,operator:"getProperty",param:i,value:!!m}]:typeof m=="object"?Object.keys(m).map(d=>{if(d==="length")return{target:f,operator:"length",param:null,value:m[d]};const C=d,a=m[d];return{target:f,operator:"getProperty",param:C,value:a}}):[]}function l(i){return Object.keys(i).reduce((f,d)=>{const C=c(d,i[d]);return f.push(...C),f},[])}function b(i,m){if(r.has(i.operator)){const f=r.get(i.operator);return f&&f(i.target,i.param,i.value,m)||!1}return!1}function h(i,m){return l(i).reduce((C,a)=>C&&b(a,m),!0)}function j(i,m){const f=Object.keys(i),d=f.includes("allOf"),C=f.includes("anyOf"),a=d||C,u=(a?i[a?d?"allOf":"anyOf":"allOf"]:[i]).map(y=>h(y,m));return d?!u.includes(!1):u.includes(!0)}return{parseValueSchema:j}}const I={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"}},K={},ee={};R();function te(t,e,n=new Map,r=(b,h,j)=>h,c={},l=b=>b){return z[e.title]=e,W[e.title]=r,K[e.title]=c,ee[e.title]=l,(b={})=>{const h=Y(b,e,n),j=Object.keys(t).reduce((i,m)=>(i[m]=t[m].default,i),{});return Object.assign(j,h)}}function ne(t,e){return{customClass:e.class,customStyle:e.style}}function oe(t,e,n){return e?{enableAccordion:n.accordionMode}:{enableAccordion:""}}function re(t,e){return e&&e.contents&&e.contents.length&&e.contents.forEach(n=>{n.title&&(n.text=n.title)}),{buttons:e.contents,buttonPosition:e.position}}const ae=new Map([["appearance",ne],["expanded","expandStatus"],["enableAccordion",oe],["toolbar",re]]);function se(t,e,n,r){const c=Math.random().toString().slice(2,6),l=n.parentComponentInstance;Object.assign(e,{id:`section-${c}`,appearance:{class:"f-section-in-mainsubcard"},enableAccordion:!1,mainTitle:e.mainTitle||"标题"});const b=t.getSchemaByType("content-container");Object.assign(b,{id:`container-${c}`,appearance:{class:"f-struct-wrapper"},contents:[e]});const h=l.schema;switch(h&&h.type){case I.splitter.type:{e.appearance.class="f-section-in-main";break}}return b}function ce(t,e,n,r){return n.parentComponentInstance?se(t,e,n):e}const ie={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/section.schema.json",title:"section",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"section"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contentClass:{description:"",type:"string",default:""},contents:{description:"",type:"array",default:[]},enableAccordion:{description:"",type:"boolean",default:!1},accordionMode:{description:"",type:"string",default:"default"},enableMaximize:{description:"",type:"boolean",default:!1},expanded:{description:"",type:"boolean",default:!0},fill:{description:"",type:"boolean",default:!1},headerClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},showHeader:{description:"",type:"string",default:!0},mainTitle:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},headerContentClass:{description:"",type:"string",default:""},extendClass:{description:"",type:"string",default:""},visible:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{type:{type:"string",default:"SectionToolbar"},position:{type:"string",default:"inHead"},contents:{type:"array",default:[]}},default:null}},required:["id","type","contents"]},E={contentClass:{type:String,default:""},customClass:{type:String,default:""},enableAccordion:{type:String,default:""},expandStatus:{type:Boolean,default:!0},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!0},subTitle:{type:String,default:""},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},headerClass:{type:String,default:""},enableMaximize:{type:Boolean,default:!1},headerContentClass:{type:String,default:""},extendClass:{type:String,default:""},buttons:{type:Array,default:[]},buttonPosition:{type:String,default:"inHead"},fill:{type:Boolean,default:!1}},B=te(E,ie,ae,ce);function le(t,e,n){let r;function c(){!t||!e.value||(n.value=!n.value,n.value?l():b())}function l(){r=t.value.nextElementSibling;const j=document&&document.querySelector("body");j&&(j.appendChild(t.value),t.value.style.zIndex=h())}function b(){r?e.value.insertBefore(t.value,r):e.value.appendChild(t.value),t.value.style.zIndex=null}function h(j=1){const i=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],m=Array.from(document.body.querySelectorAll(i.join(","))).filter(d=>d).map(d=>{const{display:C,zIndex:a}=window.getComputedStyle(d);return C==="none"?0:parseInt(a,10)}).filter(d=>d);let f=Math.max(...m);return f<1040&&(f=1040),f+j}return{onClickMaxMinIcon:c}}function F(t,e){const n=o.ref(t.buttons),r=o.computed(()=>t.buttonPosition==="inHead"?"right":"left"),c=o.computed(()=>"f-section-toolbar"+(t.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),l=o.computed(()=>{t.buttons&&t.buttons.length>0&&t.buttonPosition});function b(h){e.emit("Click",h)}return()=>l&&o.createVNode(U,{customClass:c.value,items:n.value,onClick:b,alignment:r.value},null)}function _(t,e,n,r,c,l){o.ref(t.subTitle);const b=o.computed(()=>t.buttonPosition),h=F(t,e),{onClickMaxMinIcon:j}=le(r,c,l),i=o.computed(()=>!!t.subTitle),m=o.computed(()=>t.enableMaximize),f=o.computed(()=>t.enableAccordion!=""),d=o.computed(()=>{const y={"f-section-header":!0};return e.slots.header&&t.headerClass.split(" ").reduce((v,g)=>(v[g]=!0,v),y),y});function C(y){y.stopPropagation(),t.enableAccordion!==""&&(n.value=!n.value)}function a(){const y=o.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":n.value})),T=o.computed(()=>({"f-icon":!0,"f-icon-maximize":!l.value,"f-icon-minimize":l.value}));return o.createVNode("div",{class:"f-max-accordion"},[m.value?o.createVNode("span",{class:T.value,onClick:j},null):"",f.value?o.createVNode("button",{class:y.value,onClick:C},[o.createVNode("span",null,[n.value?t.collapseLabel:t.expandLabel])]):""])}function p(){return e.slots.header?o.createVNode("div",{class:d.value},[e.slots.header()]):""}function s(){return o.createVNode("div",{class:"f-title",onClick:C},[o.createVNode("h4",{class:"f-title-text"},[t.mainTitle]),i.value&&o.createVNode("span",null,[t.subTitle])])}function u(){const y=o.computed(()=>{const T={"f-content":!0};return t.headerContentClass&&t.headerContentClass.split(" ").reduce((g,P)=>(g[P]=!0,g),T),T});return e.slots.headerContent?o.createVNode("div",{class:y.value},[e.slots.headerContent()]):""}function A(){return o.createVNode("div",{class:d.value},[e.slots.headerTitle?e.slots.headerTitle():s(),u(),b.value==="inHead"&&h(),(m.value||f.value)&&a()])}return()=>t.showHeader&&(e.slots.header?p():A())}const pe=["moz","ms","webkit"];function ue(){let t=0;return e=>{const n=new Date().getTime(),r=Math.max(0,16-(n-t)),c=setTimeout(()=>{e(n+r)},r);return t=n+r,c}}function de(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=pe.filter(e=>`${e}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:ue()}de();function k(t,e){return((e==null?void 0:e.split(" "))||[]).reduce((r,c)=>(c&&(r[c]=!0),r),t),t}const O=o.defineComponent({name:"FSection",props:E,emits:[],setup(t,e){const n=o.ref();let r=o.ref();const c=o.ref(t.customClass),l=o.computed(()=>t.enableAccordion),b=o.ref(t.expandStatus),h=o.computed(()=>t.buttonPosition),j=o.ref(!1),i=_(t,e,b,n,r,j),m=F(t,e),f=o.computed(()=>{const s={"f-section":!0,"f-section-accordion":l.value==="default","f-state-collapse":(l.value==="default"||l.value==="custom")&&!b.value,"f-section-custom-accordion":l.value==="custom","f-section-fill":t.fill,"f-section-maximize":j.value};return k(s,c.value)}),d=o.computed(()=>k({"f-section-content":!0},t.contentClass)),C=o.computed(()=>k({"f-section-extend":!0},C.value));function a(){return e.slots.extend&&o.createVNode("div",{class:C.value},[e.slots.extend()])}function p(){return o.createVNode("div",{class:d.value},[h.value==="inContent"&&m(),e.slots.default&&e.slots.default()])}return o.watch(()=>t.expandStatus,(s,u)=>{s!==u&&(b.value=s)}),o.onMounted(()=>{n&&n.value&&(r.value=n.value.parentElement)}),()=>o.createVNode("div",{class:f.value,ref:n},[i(),a(),p()])}});function fe(){function t(e){var c,l;if(!e)return!1;const n=((c=e.targetContainer)==null?void 0:c.componentInstance)&&e.targetContainer.componentInstance.value;if(!n)return!1;const r=(l=n.schema.appearance)==null?void 0:l.class;if(e.controlCategory==="input"||e.controlType==="form-group"){const b=n.schema.type,h=(b==="response-form"||b==="content-container")&&r&&r.includes("farris-form");if(n.schema.type!=="response-layout-item"&&!h)return!1}return e.controlType!=="field-set"}return{basalDragulaRuleForContainer:t}}const ye={$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"}}},H=new Map;function be(){function t(a,p,s,u){var A;if(typeof s=="number")return((A=u[a])==null?void 0:A.length)===s;if(typeof s=="object"){const y=Object.keys(s)[0],T=s[y];if(y==="not")return Number(u[a].length)!==Number(T);if(y==="moreThan")return Number(u[a].length)>=Number(T);if(y==="lessThan")return Number(u[a].length)<=Number(T)}return!1}function e(a,p,s,u){return typeof s=="boolean"?u.childrenClassList.includes(p)===!!s:!1}function n(a,p,s,u){return typeof s=="boolean"?u.parentClassList.includes(p)===!!s:!1}function r(a,p,s,u){return typeof s=="boolean"?u.parentClassList.includes(p)===!!s:!1}const c=new Map([["length",t],["hasChildren",e],["hasSibling",r],["hasParent",n]]);function l(a,p){const s=a;return typeof p=="number"?[{target:s,operator:"length",param:null,value:Number(p)}]:typeof p=="object"?Object.keys(p).map(u=>{if(u==="length")return{target:s,operator:"length",param:null,value:p[u]};const A=u,y=p[u];return{target:s,operator:a==="children"?"hasChildren":a==="parent"?"hasParent":"hasSibling",param:A,value:y}}):[]}function b(a,p){if(c.has(a.operator)){const s=c.get(a.operator);return s&&s(a.target,a.param,a.value,p)||!1}return!1}function h(a,p){return Object.keys(a).reduce((y,T)=>{const v=l(T,a[T]);return y.push(...v),y},[]).reduce((y,T)=>y&&b(T,p),!0)}function j(a,p){const s=Object.keys(a),u=s.includes("allOf"),A=s.includes("anyOf"),y=u||A,g=(y?a[y?u?"allOf":"anyOf":"allOf"]:[a]).map(S=>h(S,p));return u?!g.includes(!1):g.includes(!0)}function i(a,p){const s=a.const;return s?typeof s=="boolean"?s:typeof s=="object"?j(s,p):!1:!1}function m(a){return p=>{const s={canAccept:!0,fixed:!1,hidePadding:!1};return a&&a.properties&&Object.keys(a.properties).reduce((u,A)=>{const y=a.properties[A];return u[A]=i(y,p),u},s),s}}function f(a,p,s){if(p.type==="object"&&p.properties){const{rules:u,contents:A}=p.properties;s.set(a,m(u)),A&&Object.keys(A.properties).forEach(y=>f(y,A.properties[y],s))}}function d(){const{properties:a}=ye;Object.keys(a).forEach(p=>{f(p,a[p],H)})}function C(a,p){const s={canAccept:!0,fixed:!1,hidePadding:!0};return H.has(a)?H.get(a)(p):s}return d(),{getRuleValue:C}}const me={title:"section",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"组件类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",textField:"value",valueField:"key",data:[{key:"section",value:"分组面板"}]}},mainTitle:{title:"主标题",type:"string",description:"",visible:{showHeader:!0}},subTitle:{title:"副标题",type:"string",description:"",visible:{showHeader:!0}}},setPropertyRelates(t,e){if(t)switch(t&&t.propertyID){case"mainTitle":{t.needRefreshControlTree=!0;break}}}},appearance:{title:"样式",description:"Appearance",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},showHeader:{title:"显示标题区域",type:"boolean",description:""},fill:{title:"填充内容区域",type:"boolean",description:"To fill the space of parent container in flex layout."},enableAccordion:{title:"允许收折",type:"boolean",description:"",visible:{showHeader:!0}}}},extends:{title:"扩展",description:"",properties:{contentClass:{title:"内容区域样式",type:"string",description:""}}}}};function he(t,e){const n=o.ref(!1),r=o.ref(!1),c=be();let l=!0,b=!1,h,j=!1;function i(s){return me}function m(s){return!(!fe().basalDragulaRuleForContainer(s)||!l)}function f(){return!j}function d(){return!j}function C(){return b}function a(s){}function p(){n.value=!1,r.value=!1,j=!1,l=!0;const s=t,u=s.appearance&&s.appearance.class||"",A=u?u.split(" "):[],y=s.contents||[],T=y.length?y[0]:null,v=T&&T.appearance&&T.appearance.class||"",g=v?v.split(" "):[],P=y.length?y.reduce((G,q)=>{const J=q&&q.appearance?q.appearance.class:"",Ae=J?J.split(" "):[];return G.push(...Ae),G},[]):[],S=e,M=S&&S.appearance&&S.appearance.class||"",D=M?M.split(" "):[];h={componentClass:u,componentClassList:A,childContents:y,firstChildContent:T,firstChildClass:v,firstChildClassList:g,parent:S,parentClass:M,parentClassList:D,children:y,childrenClassList:P};const{canAccept:N,fixed:L,hidePadding:Te}=c.getRuleValue(A[0],h);return l=N,b=Te,j=L,!0}return{canAccepts:m,checkCanDeleteComponent:f,checkCanMoveComponent:d,hideNestedPaddingInDesginerView:C,onAcceptMovedChildElement:a,resolveComponentContext:p,triggerBelongedComponentToMoveWhenMoved:n,triggerBelongedComponentToDeleteWhenDeleted:r,getPropsConfig:i}}function ge(t,e,n){var v;function r(){n!=null&&n.resolveComponentContext&&n.resolveComponentContext()}r();const c=n&&n.getStyles&&n.getStyles()||"",l=n&&n.getDesignerClass&&n.getDesignerClass()||"",b=o.ref();function h(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function j(){return!1}function i(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function f(g){if(!g||!g.value)return null;if(g.value.schema&&g.value.schema.type==="component")return g.value;const P=o.ref(g==null?void 0:g.value.parent),S=f(P);return S||null}function d(g=e){const{componentInstance:P,designerItemElementRef:S}=g;return!P||!P.value?null:P.value.canMove?S:d(g.parent)}function C(g){return!!n&&n.canAccepts(g)}function a(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function p(){}function s(g,P){P&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(P)}function u(g,P){const{componentType:S}=g;let M=V(S,g,P);n&&n.onResolveNewComponentSchema&&(M=n.onResolveNewComponentSchema(g,M));const D=S.toLowerCase().replace("-","_");return M&&!M.id&&M.type===S&&(M.id=`${D}_${Math.random().toString().slice(2,6)}`),M}function A(g,P){const S=String(g.getAttribute("data-controltype")),M=g.getAttribute("data-feature"),D=M?JSON.parse(M):{};D.parentComponentInstance=b.value;let N=V(S,D);n&&n.onAcceptNewChildElement&&(N=n.onAcceptNewChildElement(g,P,N));const L=S.toLowerCase().replace("-","_");return N&&!N.id&&N.type===S&&(N.id=`${L}_${Math.random().toString().slice(2,6)}`),N}function y(g){}function T(...g){if(n&&n.getPropsConfig)return n.getPropsConfig(...g)}return b.value={canMove:h(),canSelectParent:j(),canDelete:i(),canNested:!m(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(v=e==null?void 0:e.parent)==null?void 0:v.componentInstance,schema:e==null?void 0:e.schema,styles:c,designerClass:l,canAccepts:C,getBelongedComponentInstance:f,getDraggableDesignItemElement:d,getDraggingDisplayText:a,getPropConfig:T,getDragScopeElement:p,onAcceptMovedChildElement:s,onAcceptNewChildElement:A,onChildElementMovedOut:y,addNewChildComponentSchema:u,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||o.ref(!1)},b}const Ce=o.defineComponent({name:"FSectionDesign",props:E,emits:[],setup(t,e){var T;const n=o.ref(),r=o.ref();let c=o.ref();const l=o.inject("design-item-context"),b=he(l.schema,(T=l.parent)==null?void 0:T.schema),h=ge(n,l,b);h.value.styles="display: inherit;",o.onMounted(()=>{n.value.componentInstance=h}),e.expose(h.value);const j=o.ref(t.customClass),i=o.computed(()=>t.enableAccordion),m=o.ref(t.expandStatus),f=o.computed(()=>t.buttonPosition),d=o.ref(!1),C=_(t,e,m,r,c,d),a=F(t,e),p=o.computed(()=>{const v={"f-section":!0,"f-section-accordion":i.value==="default","f-state-collapse":(i.value==="default"||i.value==="custom")&&!m.value,"f-section-custom-accordion":i.value==="custom","f-section-fill":t.fill,"f-section-maximize":d.value,"f-utils-fill":!0,"p-0":!0};return k(v,j.value)}),s=o.computed(()=>k({"f-section-content":!0,"drag-container":!0},t.contentClass)),u=o.computed(()=>k({"f-section-extend":!0},u.value));function A(){return e.slots.extend&&o.createVNode("div",{class:u.value},[e.slots.extend()])}function y(){return o.createVNode("div",{class:s.value,ref:n,"data-dragref":`${l.schema.id}-container`},[f.value==="inContent"&&a(),e.slots.default&&e.slots.default()])}return()=>o.createVNode("div",{class:p.value,ref:r},[C(),A(),y()])}});O.register=(t,e,n,r)=>{t.section=O,e.section=B},O.registerDesigner=(t,e,n)=>{t.section=Ce,e.section=B};const je=Z.withInstall(O);w.Section=O,w.default=je,w.propsResolver=B,w.sectionProps=E,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(g,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("lodash-es"),require("../response-toolbar/index.umd.js"),require("bignumber.js"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../response-toolbar/index.umd.js","bignumber.js","../common/index.umd.js"],s):(g=typeof globalThis<"u"?globalThis:g||self,s(g.section={},g.Vue,g.LodashES,g.FResponseToolbar,g.BigNumber,g.common))})(this,function(g,s,V,H,fe,$){"use strict";const F={},O={};function j(n){const{properties:e,title:t,ignore:a}=n,r=a&&Array.isArray(a),i=Object.keys(e).reduce((o,d)=>((!r||!a.find(f=>f==d))&&(o[d]=e[d].type==="object"&&e[d].properties?j(e[d]):V.cloneDeep(e[d].default)),o),{});return t&&(!r||!a.find(o=>o=="id"))&&(i.id=`${t}-${Date.now()}`),i}function q(n,e={},t){const a=F[n];if(a){let r=j(a);const i=O[n];return r=i?i({getSchemaByType:q},r,e,t):r,r}return null}function R(n,e){const t=j(e);return Object.keys(n).reduce((a,r)=>(a[r]&&V.isPlainObject(a[r])&&V.isPlainObject(n[r])?Object.assign(a[r],n[r]):a[r]=n[r],a),t),t}function G(n,e){return Object.keys(n).filter(a=>n[a]!=null).reduce((a,r)=>{if(e.has(r)){const i=e.get(r);if(typeof i=="string")a[i]=n[r];else{const o=i(r,n[r],n);Object.assign(a,o)}}else a[r]=n[r];return a},{})}function x(n,e,t=new Map){const a=R(n,e);return G(a,t)}function W(n={}){function e(c,l,u,p){if(typeof u=="number")return p[c].length===u;if(typeof u=="object"){const m=Object.keys(u)[0],h=u[m];if(m==="not")return Number(p[c].length)!==Number(h);if(m==="moreThan")return Number(p[c].length)>=Number(h);if(m==="lessThan")return Number(p[c].length)<=Number(h)}return!1}function t(c,l,u,p){return p[c]&&p[c].propertyValue&&String(p[c].propertyValue.value)===String(u)}const a=new Map([["length",e],["getProperty",t]]);Object.keys(n).reduce((c,l)=>(c.set(l,n[l]),c),a);function r(c,l){const u=c;return typeof l=="number"?[{target:u,operator:"length",param:null,value:Number(l)}]:typeof l=="boolean"?[{target:u,operator:"getProperty",param:c,value:!!l}]:typeof l=="object"?Object.keys(l).map(p=>{if(p==="length")return{target:u,operator:"length",param:null,value:l[p]};const m=p,h=l[p];return{target:u,operator:"getProperty",param:m,value:h}}):[]}function i(c){return Object.keys(c).reduce((u,p)=>{const m=r(p,c[p]);return u.push(...m),u},[])}function o(c,l){if(a.has(c.operator)){const u=a.get(c.operator);return u&&u(c.target,c.param,c.value,l)||!1}return!1}function d(c,l){return i(c).reduce((m,h)=>m&&o(h,l),!0)}function f(c,l){const u=Object.keys(c),p=u.includes("allOf"),m=u.includes("anyOf"),h=p||m,T=(h?c[h?p?"allOf":"anyOf":"allOf"]:[c]).map(v=>d(v,l));return p?!T.includes(!1):T.includes(!0)}return{parseValueSchema:f}}const D={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"}},_={},U={};W();function Z(n,e,t=new Map,a=(o,d,f)=>d,r={},i=o=>o){return F[e.title]=e,O[e.title]=a,_[e.title]=r,U[e.title]=i,(o={})=>{const d=x(o,e,t),f=Object.keys(n).reduce((c,l)=>(c[l]=n[l].default,c),{});return Object.assign(f,d)}}function J(n,e){return{customClass:e.class,customStyle:e.style}}function Q(n,e,t){return e?{enableAccordion:t.accordionMode}:{enableAccordion:""}}function X(n,e){return e&&e.contents&&e.contents.length&&e.contents.forEach(t=>{t.title&&(t.text=t.title)}),{buttons:e.contents,buttonPosition:e.position}}const Y=new Map([["appearance",J],["expanded","expandStatus"],["enableAccordion",Q],["toolbar",X]]);function K(n,e,t,a){const r=Math.random().toString().slice(2,6),i=t.parentComponentInstance;Object.assign(e,{id:`section-${r}`,appearance:{class:"f-section-in-mainsubcard"},enableAccordion:!1,mainTitle:e.mainTitle||"标题"});const o=n.getSchemaByType("content-container");Object.assign(o,{id:`container-${r}`,appearance:{class:"f-struct-wrapper"},contents:[e]});const d=i.schema;switch(d&&d.type){case D["splitter-pane"].type:{e.appearance.class="f-section-in-main";break}}return o}function I(n,e,t,a){return t.parentComponentInstance?K(n,e,t):e}const ee={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/section.schema.json",title:"section",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"section"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contentClass:{description:"",type:"string",default:""},contents:{description:"",type:"array",default:[]},enableAccordion:{description:"",type:"boolean",default:!1},accordionMode:{description:"",type:"string",default:"default"},enableMaximize:{description:"",type:"boolean",default:!1},expanded:{description:"",type:"boolean",default:!0},fill:{description:"",type:"boolean",default:!1},headerClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},showHeader:{description:"",type:"string",default:!0},mainTitle:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},headerContentClass:{description:"",type:"string",default:""},extendClass:{description:"",type:"string",default:""},visible:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{type:{type:"string",default:"SectionToolbar"},position:{type:"string",default:"inHead"},contents:{type:"array",default:[]}},default:null}},required:["id","type","contents"]},N={contentClass:{type:String,default:""},customClass:{type:String,default:""},enableAccordion:{type:String,default:""},expandStatus:{type:Boolean,default:!0},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!0},subTitle:{type:String,default:""},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},headerClass:{type:String,default:""},enableMaximize:{type:Boolean,default:!1},headerContentClass:{type:String,default:""},extendClass:{type:String,default:""},buttons:{type:Array,default:[]},buttonPosition:{type:String,default:"inHead"},fill:{type:Boolean,default:!1}},B=Z(N,ee,Y,I);function te(n,e,t){let a;function r(){!n||!e.value||(t.value=!t.value,t.value?i():o())}function i(){a=n.value.nextElementSibling;const f=document&&document.querySelector("body");f&&(f.appendChild(n.value),n.value.style.zIndex=d())}function o(){a?e.value.insertBefore(n.value,a):e.value.appendChild(n.value),n.value.style.zIndex=null}function d(f=1){const c=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],l=Array.from(document.body.querySelectorAll(c.join(","))).filter(p=>p).map(p=>{const{display:m,zIndex:h}=window.getComputedStyle(p);return m==="none"?0:parseInt(h,10)}).filter(p=>p);let u=Math.max(...l);return u<1040&&(u=1040),u+f}return{onClickMaxMinIcon:r}}function E(n,e){const t=s.ref(n.buttons),a=s.computed(()=>n.buttonPosition==="inHead"?"right":"left"),r=s.computed(()=>"f-section-toolbar"+(n.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),i=s.computed(()=>{n.buttons&&n.buttons.length>0&&n.buttonPosition});function o(d){e.emit("Click",d)}return()=>i&&s.createVNode(H,{customClass:r.value,items:t.value,onClick:o,alignment:a.value},null)}function z(n,e,t,a,r,i){s.ref(n.subTitle);const o=s.computed(()=>n.buttonPosition),d=E(n,e),{onClickMaxMinIcon:f}=te(a,r,i),c=s.computed(()=>!!n.subTitle),l=s.computed(()=>n.enableMaximize),u=s.computed(()=>n.enableAccordion!=""),p=s.computed(()=>{const v={"f-section-header":!0};return e.slots.header&&n.headerClass.split(" ").reduce((y,C)=>(y[C]=!0,y),v),v});function m(v){v.stopPropagation(),n.enableAccordion!==""&&(t.value=!t.value)}function h(){const v=s.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":t.value})),w=s.computed(()=>({"f-icon":!0,"f-icon-maximize":!i.value,"f-icon-minimize":i.value}));return s.createVNode("div",{class:"f-max-accordion"},[l.value?s.createVNode("span",{class:w.value,onClick:f},null):"",u.value?s.createVNode("button",{class:v.value,onClick:m},[s.createVNode("span",null,[t.value?n.collapseLabel:n.expandLabel])]):""])}function S(){return e.slots.header?s.createVNode("div",{class:p.value},[e.slots.header()]):""}function b(){return s.createVNode("div",{class:"f-title",onClick:m},[s.createVNode("h4",{class:"f-title-text"},[n.mainTitle]),c.value&&s.createVNode("span",null,[n.subTitle])])}function T(){const v=s.computed(()=>{const w={"f-content":!0};return n.headerContentClass&&n.headerContentClass.split(" ").reduce((C,A)=>(C[A]=!0,C),w),w});return e.slots.headerContent?s.createVNode("div",{class:v.value},[e.slots.headerContent()]):""}function M(){return s.createVNode("div",{class:p.value},[e.slots.headerTitle?e.slots.headerTitle():b(),T(),o.value==="inHead"&&d(),(l.value||u.value)&&h()])}return()=>n.showHeader&&(e.slots.header?S():M())}const ne=["moz","ms","webkit"];function oe(){let n=0;return e=>{const t=new Date().getTime(),a=Math.max(0,16-(t-n)),r=setTimeout(()=>{e(t+a)},a);return n=t+a,r}}function ae(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const n=ne.filter(e=>`${e}RequestAnimationFrame`in window)[0];return n?window[`${n}RequestAnimationFrame`]:oe()}ae();function L(n,e){return((e==null?void 0:e.split(" "))||[]).reduce((a,r)=>(r&&(a[r]=!0),a),n),n}const P=s.defineComponent({name:"FSection",props:N,emits:[],setup(n,e){const t=s.ref();let a=s.ref();const r=s.ref(n.customClass),i=s.computed(()=>n.enableAccordion),o=s.ref(n.expandStatus),d=s.computed(()=>n.buttonPosition),f=s.ref(!1),c=z(n,e,o,t,a,f),l=E(n,e),u=s.computed(()=>{const b={"f-section":!0,"f-section-accordion":i.value==="default","f-state-collapse":(i.value==="default"||i.value==="custom")&&!o.value,"f-section-custom-accordion":i.value==="custom","f-section-fill":n.fill,"f-section-maximize":f.value};return L(b,r.value)}),p=s.computed(()=>L({"f-section-content":!0},n.contentClass)),m=s.computed(()=>L({"f-section-extend":!0},m.value));function h(){return e.slots.extend&&s.createVNode("div",{class:m.value},[e.slots.extend()])}function S(){return s.createVNode("div",{class:p.value},[d.value==="inContent"&&l(),e.slots.default&&e.slots.default()])}return s.watch(()=>n.expandStatus,(b,T)=>{b!==T&&(o.value=b)}),s.onMounted(()=>{t&&t.value&&(a.value=t.value.parentElement)}),()=>s.createVNode("div",{class:u.value,ref:t},[c(),h(),S()])}});function re(){function n(e,t){var o;if(!e)return!1;const a=((o=e.targetContainer)==null?void 0:o.componentInstance)&&e.targetContainer.componentInstance.value;if(!a)return!1;const r=a.schema.type,i=t==null?void 0:t.formSchemaUtils.getComponentById(a.belongedComponentId);return!((e.controlCategory==="input"||e.controlType==="form-group")&&![D["response-layout-item"].type,D["response-form"].type].includes(r)||(e.controlType===D.tabs.type||e.controlType===D.section.type)&&((i==null?void 0:i.componentType)!=="frame"||![D["content-container"].type,D["splitter-pane"].type,D["response-layout-item"].type].includes(r)))}return{basalDragulaRuleForContainer:n}}const ie={title:"section",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"组件类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",textField:"value",valueField:"key",data:[{key:"section",value:"分组面板"}]}},mainTitle:{title:"主标题",type:"string",description:"",visible:{showHeader:!0}},subTitle:{title:"副标题",type:"string",description:"",visible:{showHeader:!0}}},setPropertyRelates(n,e){if(n)switch(n&&n.propertyID){case"mainTitle":{n.needRefreshControlTree=!0;break}}}},appearance:{title:"样式",description:"Appearance",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},showHeader:{title:"显示标题区域",type:"boolean",description:""},fill:{title:"填充内容区域",type:"boolean",description:"To fill the space of parent container in flex layout."},enableAccordion:{title:"允许收折",type:"boolean",description:"",visible:{showHeader:!0}}}},extends:{title:"扩展",description:"",properties:{contentClass:{title:"内容区域样式",type:"string",description:""}}}}};class se{getTemplateRule(e,t){const a=t==null?void 0:t.formSchemaUtils,r=a==null?void 0:a.getFormTemplateRule(),i={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return i;const o=this.getComponentContext(e);return o.componentClassList.forEach(f=>{if(!f||!r[f])return;const{canMove:c,canDelete:l,canAccept:u}=r[f];i.canMove=i.canMove&&this.resolveRuleValue(c,o),i.canDelete=i.canDelete&&this.resolveRuleValue(l,o),i.canAccept=i.canAccept&&this.resolveRuleValue(u,o)}),i}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const a=e.invalidContext||[];let r=!0;for(const i of a){if(i.firstLevelChild){if(i.firstLevelChild.class){const o=t.firstLevelChildClassList;if(o&&!o.includes(i.firstLevelChild.class)){r=!1;continue}}if(i.firstLevelChild.type){const o=t.firstLevelChildSchema;if(o&&o.type!==i.firstLevelChild.type){r=!1;continue}}}if(i.secondLevelChild){if(i.secondLevelChild.class){const o=t.secondLevelChildClassList;if(o&&!o.includes(i.secondLevelChild.class)){r=!1;continue}}if(i.secondLevelChild.type){const o=t.secondLevelChildSchema;if(o&&o.type!==i.secondLevelChild.type){r=!1;continue}}}if(i.parent){if(i.parent.class){const o=t.parentClassList;if(o&&!o.includes(i.parent.class)){r=!1;continue}}if(i.parent.type){const o=t.parentSchema;if(o&&o.type!==i.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(e){var S,b,T,M;const t=e.schema,a=t.appearance&&t.appearance.class||"",r=a.split(" ")||[],i=t.contents||[],o=i.length?i[0]:null,d=o&&o.appearance?o.appearance.class:"",f=d?d.split(" "):[],c=(S=o==null?void 0:o.contents)!=null&&S.length?o==null?void 0:o.contents[0]:null,l=c&&c.appearance?c.appearance.class:"",u=l?l.split(" "):[],p=t.type==="component"?(T=(b=e.parent)==null?void 0:b.parent)==null?void 0:T.schema:(M=e.parent)==null?void 0:M.schema,m=p&&p.appearance&&p.appearance.class||"",h=m?m.split(" "):[];return{componentClass:a,componentClassList:r,childContents:i,firstLevelChildSchema:o,firstLevelChildClass:d,firstLevelChildClassList:f,secondLevelChildSchema:c,secondLevelChildClass:l,secondLevelChildClassList:u,parentSchema:p,parentClass:m,parentClassList:h}}}function ce(n,e){const t=new se,{canMove:a,canAccept:r,canDelete:i}=t.getTemplateRule(n,e);function o(u){return ie}function d(u){return re().basalDragulaRuleForContainer(u,e)?r:!1}function f(){return i}function c(){return a}function l(){return!a&&!i}return{canAccepts:d,checkCanDeleteComponent:f,checkCanMoveComponent:c,hideNestedPaddingInDesginerView:l,getPropsConfig:o}}function le(n,e,t){var w;function a(){t!=null&&t.resolveComponentContext&&t.resolveComponentContext()}a();const r=t&&t.getStyles&&t.getStyles()||"",i=t&&t.getDesignerClass&&t.getDesignerClass()||"",o=s.ref();function d(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function f(){return!1}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function l(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function u(y){if(!y||!y.value)return null;if(y.value.schema&&y.value.schema.type==="component")return y.value;const C=s.ref(y==null?void 0:y.value.parent),A=u(C);return A||null}function p(y=e){const{componentInstance:C,designerItemElementRef:A}=y;return!C||!C.value?null:C.value.canMove?A:p(y.parent)}function m(y){return!!t&&t.canAccepts(y)}function h(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function S(){}function b(y,C){C&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(C)}function T(y,C){const{componentType:A}=y;let k=q(A,y,C);t&&t.onResolveNewComponentSchema&&(k=t.onResolveNewComponentSchema(y,k));const de=A.toLowerCase().replace("-","_");return k&&!k.id&&k.type===A&&(k.id=`${de}_${Math.random().toString().slice(2,6)}`),k}function M(y){}function v(...y){if(t&&t.getPropsConfig)return t.getPropsConfig(...y)}return o.value={canMove:d(),canSelectParent:f(),canDelete:c(),canNested:!l(),contents:e==null?void 0:e.schema.contents,elementRef:n,parent:(w=e==null?void 0:e.parent)==null?void 0:w.componentInstance,schema:e==null?void 0:e.schema,styles:r,designerClass:i,canAccepts:m,getBelongedComponentInstance:u,getDraggableDesignItemElement:p,getDraggingDisplayText:h,getPropConfig:v,getDragScopeElement:S,onAcceptMovedChildElement:b,onChildElementMovedOut:M,addNewChildComponentSchema:T,updateDragAndDropRules:a,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||s.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||s.ref(!1)},o}const ue=s.defineComponent({name:"FSectionDesign",props:N,emits:[],setup(n,e){const t=s.ref(),a=s.ref();let r=s.ref();const i=s.inject("designer-host-service"),o=s.inject("design-item-context"),d=ce(o,i),f=le(t,o,d);f.value.styles="display: inherit;",s.onMounted(()=>{t.value.componentInstance=f}),e.expose(f.value);const c=s.ref(n.customClass),l=s.computed(()=>n.enableAccordion),u=s.ref(n.expandStatus),p=s.computed(()=>n.buttonPosition),m=s.ref(!1),h=z(n,e,u,a,r,m),S=E(n,e),b=s.computed(()=>{const y={"f-section":!0,"f-section-accordion":l.value==="default","f-state-collapse":(l.value==="default"||l.value==="custom")&&!u.value,"f-section-custom-accordion":l.value==="custom","f-section-fill":n.fill,"f-section-maximize":m.value,"f-utils-fill":!0,"p-0":!0};return L(y,c.value)}),T=s.computed(()=>L({"f-section-content":!0,"drag-container":!0},n.contentClass)),M=s.computed(()=>L({"f-section-extend":!0},M.value));function v(){return e.slots.extend&&s.createVNode("div",{class:M.value},[e.slots.extend()])}function w(){return s.createVNode("div",{class:T.value,ref:t,"data-dragref":`${o.schema.id}-container`},[p.value==="inContent"&&S(),e.slots.default&&e.slots.default()])}return()=>s.createVNode("div",{class:b.value,ref:a},[h(),v(),w()])}});P.register=(n,e,t,a)=>{n.section=P,e.section=B},P.registerDesigner=(n,e,t)=>{n.section=ue,e.section=B};const pe=$.withInstall(P);g.Section=P,g.default=pe,g.propsResolver=B,g.sectionProps=N,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isPlainObject as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { properties: e, title: a, ignore: n } = t, o = n && Array.isArray(n), p = Object.keys(e).reduce((l, f) => ((!o || !n.find((
|
|
6
|
-
return (!o || !n.find((l) => l == "id")) && (p.id = `${a}-${Date.now()}`), p;
|
|
1
|
+
import { defineComponent as N, createVNode as D, ref as b, inject as q, onMounted as L } from "vue";
|
|
2
|
+
import { isPlainObject as j, cloneDeep as W } from "lodash-es";
|
|
3
|
+
const S = {}, $ = {};
|
|
4
|
+
function M(t) {
|
|
5
|
+
const { properties: e, title: a, ignore: n } = t, o = n && Array.isArray(n), p = Object.keys(e).reduce((l, f) => ((!o || !n.find((g) => g == f)) && (l[f] = e[f].type === "object" && e[f].properties ? M(e[f]) : W(e[f].default)), l), {});
|
|
6
|
+
return a && (!o || !n.find((l) => l == "id")) && (p.id = `${a}-${Date.now()}`), p;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const n =
|
|
8
|
+
function V(t, e = {}, a) {
|
|
9
|
+
const n = S[t];
|
|
10
10
|
if (n) {
|
|
11
|
-
let o =
|
|
12
|
-
const p =
|
|
13
|
-
return o = p ? p({ getSchemaByType:
|
|
11
|
+
let o = M(n);
|
|
12
|
+
const p = $[t];
|
|
13
|
+
return o = p ? p({ getSchemaByType: V }, o, e, a) : o, o;
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const a =
|
|
19
|
-
return Object.keys(t).reduce((n, o) => (n[o] &&
|
|
17
|
+
function _(t, e) {
|
|
18
|
+
const a = M(e);
|
|
19
|
+
return Object.keys(t).reduce((n, o) => (n[o] && j(n[o]) && j(t[o]) ? Object.assign(n[o], t[o]) : n[o] = t[o], n), a), a;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function z(t, e) {
|
|
22
22
|
return Object.keys(t).filter((n) => t[n] != null).reduce((n, o) => {
|
|
23
23
|
if (e.has(o)) {
|
|
24
24
|
const p = e.get(o);
|
|
@@ -33,11 +33,11 @@ function H(t, e) {
|
|
|
33
33
|
return n;
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const n =
|
|
38
|
-
return
|
|
36
|
+
function G(t, e, a = /* @__PURE__ */ new Map()) {
|
|
37
|
+
const n = _(t, e);
|
|
38
|
+
return z(n, a);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function H(t = {}) {
|
|
41
41
|
function e(r, s, c, i) {
|
|
42
42
|
if (typeof c == "number")
|
|
43
43
|
return i[r].length === c;
|
|
@@ -85,30 +85,30 @@ function U(t = {}) {
|
|
|
85
85
|
function f(r, s) {
|
|
86
86
|
return p(r).reduce((m, d) => m && l(d, s), !0);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
const c = Object.keys(r), i = c.includes("allOf"), m = c.includes("anyOf"), d = i || m,
|
|
90
|
-
return i ? !
|
|
88
|
+
function g(r, s) {
|
|
89
|
+
const c = Object.keys(r), i = c.includes("allOf"), m = c.includes("anyOf"), d = i || m, k = (d ? r[d ? i ? "allOf" : "anyOf" : "allOf"] : [r]).map((T) => f(T, s));
|
|
90
|
+
return i ? !k.includes(!1) : k.includes(!0);
|
|
91
91
|
}
|
|
92
|
-
return { parseValueSchema:
|
|
92
|
+
return { parseValueSchema: g };
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
function
|
|
97
|
-
return
|
|
98
|
-
const f =
|
|
99
|
-
return Object.assign(
|
|
94
|
+
const J = {}, Q = {};
|
|
95
|
+
H();
|
|
96
|
+
function U(t, e, a = /* @__PURE__ */ new Map(), n = (l, f, g) => f, o = {}, p = (l) => l) {
|
|
97
|
+
return S[e.title] = e, $[e.title] = n, J[e.title] = o, Q[e.title] = p, (l = {}) => {
|
|
98
|
+
const f = G(l, e, a), g = Object.keys(t).reduce((r, s) => (r[s] = t[s].default, r), {});
|
|
99
|
+
return Object.assign(g, f);
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function X(t, e) {
|
|
103
103
|
return { customClass: e.class, customStyle: e.style };
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
["appearance",
|
|
105
|
+
const Y = /* @__PURE__ */ new Map([
|
|
106
|
+
["appearance", X]
|
|
107
107
|
]);
|
|
108
|
-
function
|
|
108
|
+
function Z(t, e, a) {
|
|
109
109
|
return e;
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const C = "https://json-schema.org/draft/2020-12/schema", K = "https://farris-design.gitee.io/smoke-detector.schema.json", x = "smoke-detector", I = "A Farris Component", ee = "object", te = {
|
|
112
112
|
id: {
|
|
113
113
|
description: "The unique identifier for smoke-detector",
|
|
114
114
|
type: "string"
|
|
@@ -157,18 +157,18 @@ const I = "https://json-schema.org/draft/2020-12/schema", ee = "https://farris-d
|
|
|
157
157
|
description: "下发数据",
|
|
158
158
|
type: "string"
|
|
159
159
|
}
|
|
160
|
-
},
|
|
160
|
+
}, re = [
|
|
161
161
|
"id",
|
|
162
162
|
"type"
|
|
163
|
-
],
|
|
164
|
-
$schema:
|
|
165
|
-
$id:
|
|
166
|
-
title:
|
|
167
|
-
description:
|
|
168
|
-
type:
|
|
169
|
-
properties:
|
|
170
|
-
required:
|
|
171
|
-
},
|
|
163
|
+
], ne = {
|
|
164
|
+
$schema: C,
|
|
165
|
+
$id: K,
|
|
166
|
+
title: x,
|
|
167
|
+
description: I,
|
|
168
|
+
type: ee,
|
|
169
|
+
properties: te,
|
|
170
|
+
required: re
|
|
171
|
+
}, oe = "smoke-detector", se = "A Farris Component", ce = "object", ie = {
|
|
172
172
|
basic: {
|
|
173
173
|
description: "Basic Infomation",
|
|
174
174
|
title: "基本信息",
|
|
@@ -243,33 +243,33 @@ const I = "https://json-schema.org/draft/2020-12/schema", ee = "https://farris-d
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
},
|
|
247
|
-
title:
|
|
248
|
-
description:
|
|
249
|
-
type:
|
|
250
|
-
categories:
|
|
251
|
-
},
|
|
246
|
+
}, ae = {
|
|
247
|
+
title: oe,
|
|
248
|
+
description: se,
|
|
249
|
+
type: ce,
|
|
250
|
+
categories: ie
|
|
251
|
+
}, A = {}, B = U(A, ne, Y, Z, ae), w = /* @__PURE__ */ N({
|
|
252
252
|
name: "FSmokeDetector",
|
|
253
|
-
props:
|
|
253
|
+
props: A,
|
|
254
254
|
emits: [""],
|
|
255
255
|
setup(t) {
|
|
256
|
-
return () =>
|
|
256
|
+
return () => D("div", {
|
|
257
257
|
class: "f-smoke-detector"
|
|
258
|
-
}, [
|
|
258
|
+
}, [D("img", {
|
|
259
259
|
title: "smoke-detector",
|
|
260
260
|
src: "./image/smoke-detector-2.png"
|
|
261
261
|
}, null)]);
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
|
-
function
|
|
265
|
-
var
|
|
264
|
+
function ue(t, e, a) {
|
|
265
|
+
var E;
|
|
266
266
|
function n() {
|
|
267
267
|
}
|
|
268
|
-
const o = "", p = "", l =
|
|
268
|
+
const o = "", p = "", l = b();
|
|
269
269
|
function f() {
|
|
270
270
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function g() {
|
|
273
273
|
return !1;
|
|
274
274
|
}
|
|
275
275
|
function r() {
|
|
@@ -283,12 +283,12 @@ function fe(t, e, a) {
|
|
|
283
283
|
return null;
|
|
284
284
|
if (u.value.schema && u.value.schema.type === "component")
|
|
285
285
|
return u.value;
|
|
286
|
-
const
|
|
287
|
-
return
|
|
286
|
+
const y = b(u == null ? void 0 : u.value.parent), h = c(y);
|
|
287
|
+
return h || null;
|
|
288
288
|
}
|
|
289
289
|
function i(u = e) {
|
|
290
|
-
const { componentInstance:
|
|
291
|
-
return !
|
|
290
|
+
const { componentInstance: y, designerItemElementRef: h } = u;
|
|
291
|
+
return !y || !y.value ? null : y.value.canMove ? h : i(u.parent);
|
|
292
292
|
}
|
|
293
293
|
function m(u) {
|
|
294
294
|
return !!a;
|
|
@@ -296,35 +296,28 @@ function fe(t, e, a) {
|
|
|
296
296
|
function d() {
|
|
297
297
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function P() {
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function O(u, y) {
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
const { componentType:
|
|
305
|
-
let v =
|
|
306
|
-
const
|
|
307
|
-
return v && !v.id && v.type ===
|
|
303
|
+
function k(u, y) {
|
|
304
|
+
const { componentType: h } = u;
|
|
305
|
+
let v = V(h, u, y);
|
|
306
|
+
const F = h.toLowerCase().replace("-", "_");
|
|
307
|
+
return v && !v.id && v.type === h && (v.id = `${F}_${Math.random().toString().slice(2, 6)}`), v;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
const y = String(u.getAttribute("data-controltype")), v = u.getAttribute("data-feature"), P = v ? JSON.parse(v) : {};
|
|
311
|
-
P.parentComponentInstance = l.value;
|
|
312
|
-
let b = O(y, P);
|
|
313
|
-
const q = y.toLowerCase().replace("-", "_");
|
|
314
|
-
return b && !b.id && b.type === y && (b.id = `${q}_${Math.random().toString().slice(2, 6)}`), b;
|
|
309
|
+
function R(u) {
|
|
315
310
|
}
|
|
316
|
-
function
|
|
317
|
-
}
|
|
318
|
-
function _(...u) {
|
|
311
|
+
function T(...u) {
|
|
319
312
|
}
|
|
320
313
|
return l.value = {
|
|
321
314
|
canMove: f(),
|
|
322
|
-
canSelectParent:
|
|
315
|
+
canSelectParent: g(),
|
|
323
316
|
canDelete: r(),
|
|
324
317
|
canNested: !s(),
|
|
325
318
|
contents: e == null ? void 0 : e.schema.contents,
|
|
326
319
|
elementRef: t,
|
|
327
|
-
parent: (
|
|
320
|
+
parent: (E = e == null ? void 0 : e.parent) == null ? void 0 : E.componentInstance,
|
|
328
321
|
schema: e == null ? void 0 : e.schema,
|
|
329
322
|
styles: o,
|
|
330
323
|
designerClass: p,
|
|
@@ -332,47 +325,46 @@ function fe(t, e, a) {
|
|
|
332
325
|
getBelongedComponentInstance: c,
|
|
333
326
|
getDraggableDesignItemElement: i,
|
|
334
327
|
getDraggingDisplayText: d,
|
|
335
|
-
getPropConfig:
|
|
336
|
-
getDragScopeElement:
|
|
337
|
-
onAcceptMovedChildElement:
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
addNewChildComponentSchema: D,
|
|
328
|
+
getPropConfig: T,
|
|
329
|
+
getDragScopeElement: P,
|
|
330
|
+
onAcceptMovedChildElement: O,
|
|
331
|
+
onChildElementMovedOut: R,
|
|
332
|
+
addNewChildComponentSchema: k,
|
|
341
333
|
updateDragAndDropRules: n,
|
|
342
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
343
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
334
|
+
triggerBelongedComponentToMoveWhenMoved: b(!1),
|
|
335
|
+
triggerBelongedComponentToDeleteWhenDeleted: b(!1)
|
|
344
336
|
}, l;
|
|
345
337
|
}
|
|
346
|
-
const
|
|
338
|
+
const le = /* @__PURE__ */ N({
|
|
347
339
|
name: "FSmokeDetectorDesign",
|
|
348
|
-
props:
|
|
340
|
+
props: A,
|
|
349
341
|
emits: [""],
|
|
350
342
|
setup(t, e) {
|
|
351
|
-
const a =
|
|
352
|
-
return
|
|
343
|
+
const a = b(), n = q("design-item-context"), o = ue(a, n);
|
|
344
|
+
return L(() => {
|
|
353
345
|
a.value.componentInstance = o;
|
|
354
|
-
}), e.expose(o.value), () =>
|
|
346
|
+
}), e.expose(o.value), () => D("div", {
|
|
355
347
|
ref: a,
|
|
356
348
|
class: "f-smoke-detector"
|
|
357
|
-
}, [
|
|
349
|
+
}, [D("img", {
|
|
358
350
|
title: "smoke-detector",
|
|
359
351
|
src: "../image/smoke-detector-2.png"
|
|
360
352
|
}, null)]);
|
|
361
353
|
}
|
|
362
|
-
}),
|
|
354
|
+
}), me = {
|
|
363
355
|
install(t) {
|
|
364
|
-
t.component(
|
|
356
|
+
t.component(w.name, w);
|
|
365
357
|
},
|
|
366
358
|
register(t, e, a, n) {
|
|
367
|
-
t["smoke-detector"] =
|
|
359
|
+
t["smoke-detector"] = w, e["smoke-detector"] = B;
|
|
368
360
|
},
|
|
369
361
|
registerDesigner(t, e, a) {
|
|
370
|
-
t["smoke-detector"] =
|
|
362
|
+
t["smoke-detector"] = le, e["smoke-detector"] = B;
|
|
371
363
|
}
|
|
372
364
|
};
|
|
373
365
|
export {
|
|
374
|
-
|
|
375
|
-
|
|
366
|
+
w as SmokeDetector,
|
|
367
|
+
me as default,
|
|
376
368
|
B as propsResolver,
|
|
377
|
-
|
|
369
|
+
A as smokeDetectorProps
|
|
378
370
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(g,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],l):(g=typeof globalThis<"u"?globalThis:g||self,l(g["smoke-detector"]={},g.Vue,g.LodashES))})(this,function(g,l,M){"use strict";const R={},$={};function w(t){const{properties:e,title:a,ignore:n}=t,o=n&&Array.isArray(n),f=Object.keys(e).reduce((p,d)=>((!o||!n.find(b=>b==d))&&(p[d]=e[d].type==="object"&&e[d].properties?w(e[d]):M.cloneDeep(e[d].default)),p),{});return a&&(!o||!n.find(p=>p=="id"))&&(f.id=`${a}-${Date.now()}`),f}function S(t,e={},a){const n=R[t];if(n){let o=w(n);const f=$[t];return o=f?f({getSchemaByType:S},o,e,a):o,o}return null}function V(t,e){const a=w(e);return Object.keys(t).reduce((n,o)=>(n[o]&&M.isPlainObject(n[o])&&M.isPlainObject(t[o])?Object.assign(n[o],t[o]):n[o]=t[o],n),a),a}function q(t,e){return Object.keys(t).filter(n=>t[n]!=null).reduce((n,o)=>{if(e.has(o)){const f=e.get(o);if(typeof f=="string")n[f]=t[o];else{const p=f(o,t[o],t);Object.assign(n,p)}}else n[o]=t[o];return n},{})}function F(t,e,a=new Map){const n=V(t,e);return q(n,a)}function L(t={}){function e(r,s,c,i){if(typeof c=="number")return i[r].length===c;if(typeof c=="object"){const m=Object.keys(c)[0],y=c[m];if(m==="not")return Number(i[r].length)!==Number(y);if(m==="moreThan")return Number(i[r].length)>=Number(y);if(m==="lessThan")return Number(i[r].length)<=Number(y)}return!1}function a(r,s,c,i){return i[r]&&i[r].propertyValue&&String(i[r].propertyValue.value)===String(c)}const n=new Map([["length",e],["getProperty",a]]);Object.keys(t).reduce((r,s)=>(r.set(s,t[s]),r),n);function o(r,s){const c=r;return typeof s=="number"?[{target:c,operator:"length",param:null,value:Number(s)}]:typeof s=="boolean"?[{target:c,operator:"getProperty",param:r,value:!!s}]:typeof s=="object"?Object.keys(s).map(i=>{if(i==="length")return{target:c,operator:"length",param:null,value:s[i]};const m=i,y=s[i];return{target:c,operator:"getProperty",param:m,value:y}}):[]}function f(r){return Object.keys(r).reduce((c,i)=>{const m=o(i,r[i]);return c.push(...m),c},[])}function p(r,s){if(n.has(r.operator)){const c=n.get(r.operator);return c&&c(r.target,r.param,r.value,s)||!1}return!1}function d(r,s){return f(r).reduce((m,y)=>m&&p(y,s),!0)}function b(r,s){const c=Object.keys(r),i=c.includes("allOf"),m=c.includes("anyOf"),y=i||m,T=(y?r[y?i?"allOf":"anyOf":"allOf"]:[r]).map(A=>d(A,s));return i?!T.includes(!1):T.includes(!0)}return{parseValueSchema:b}}const _={},W={};L();function z(t,e,a=new Map,n=(p,d,b)=>d,o={},f=p=>p){return R[e.title]=e,$[e.title]=n,_[e.title]=o,W[e.title]=f,(p={})=>{const d=F(p,e,a),b=Object.keys(t).reduce((r,s)=>(r[s]=t[s].default,r),{});return Object.assign(b,d)}}function G(t,e){return{customClass:e.class,customStyle:e.style}}const H=new Map([["appearance",G]]);function J(t,e,a){return e}const Q={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/smoke-detector.schema.json",title:"smoke-detector",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for smoke-detector",type:"string"},type:{description:"The type string of smoke-detector",type:"string",default:"smoke-detector"},voltageA:{description:"A相电压",type:"number",default:-1},voltageB:{description:"B相电压",type:"number",default:-1},voltageC:{description:"C相电压",type:"number",default:-1},forwardActiveTotalPower:{description:"正向有功总电量",type:"number",default:-1},totalPositiveReactivePower:{description:"正向无功总电量",type:"number",default:-1},reverseTotalActivePower:{description:"反向有功总电量",type:"number",default:-1},reverseTotalReactivePower:{description:"反向无功总电量",type:"number",default:-1},toDeliverData:{description:"下发数据",type:"string"}},required:["id","type"]},U={title:"smoke-detector",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},bussinessProperties:{description:"",title:"业务属性",properties:{voltageA:{description:"A相电压",type:"number",title:"A相电压",default:-1},voltageB:{description:"B相电压",type:"number",title:"B相电压",default:-1},voltageC:{description:"C相电压",type:"number",title:"C相电压",default:-1},forwardActiveTotalPower:{description:"正向有功总电量",type:"number",title:"正向有功总电量",default:-1},totalPositiveReactivePower:{description:"正向无功总电量",type:"number",title:"正向无功总电量",default:-1},reverseTotalActivePower:{description:"反向有功总电量",type:"number",title:"反向有功总电量",default:-1},reverseTotalReactivePower:{description:"反向无功总电量",type:"number",title:"反向无功总电量",default:-1},toDeliverData:{description:"下发数据",type:"string",title:"下发数据"}}}}},D={},O=z(D,Q,H,J,U),P=l.defineComponent({name:"FSmokeDetector",props:D,emits:[""],setup(t){return()=>l.createVNode("div",{class:"f-smoke-detector"},[l.createVNode("img",{title:"smoke-detector",src:"./image/smoke-detector-2.png"},null)])}});function X(t,e,a){var B;function n(){}const o="",f="",p=l.ref();function d(){return(e==null?void 0:e.schema.componentType)!=="frame"}function b(){return!1}function r(){return(e==null?void 0:e.schema.componentType)!=="frame"}function s(){return(e==null?void 0:e.schema.componentType)==="frame"}function c(u){if(!u||!u.value)return null;if(u.value.schema&&u.value.schema.type==="component")return u.value;const h=l.ref(u==null?void 0:u.value.parent),v=c(h);return v||null}function i(u=e){const{componentInstance:h,designerItemElementRef:v}=u;return!h||!h.value?null:h.value.canMove?v:i(u.parent)}function m(u){return!!a}function y(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function j(){}function E(u,h){}function T(u,h){const{componentType:v}=u;let k=S(v,u,h);const C=v.toLowerCase().replace("-","_");return k&&!k.id&&k.type===v&&(k.id=`${C}_${Math.random().toString().slice(2,6)}`),k}function N(u){}function A(...u){}return p.value={canMove:d(),canSelectParent:b(),canDelete:r(),canNested:!s(),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:o,designerClass:f,canAccepts:m,getBelongedComponentInstance:c,getDraggableDesignItemElement:i,getDraggingDisplayText:y,getPropConfig:A,getDragScopeElement:j,onAcceptMovedChildElement:E,onChildElementMovedOut:N,addNewChildComponentSchema:T,updateDragAndDropRules:n,triggerBelongedComponentToMoveWhenMoved:l.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:l.ref(!1)},p}const Y=l.defineComponent({name:"FSmokeDetectorDesign",props:D,emits:[""],setup(t,e){const a=l.ref(),n=l.inject("design-item-context"),o=X(a,n);return l.onMounted(()=>{a.value.componentInstance=o}),e.expose(o.value),()=>l.createVNode("div",{ref:a,class:"f-smoke-detector"},[l.createVNode("img",{title:"smoke-detector",src:"../image/smoke-detector-2.png"},null)])}}),Z={install(t){t.component(P.name,P)},register(t,e,a,n){t["smoke-detector"]=P,e["smoke-detector"]=O},registerDesigner(t,e,a){t["smoke-detector"]=Y,e["smoke-detector"]=O}};g.SmokeDetector=P,g.default=Z,g.propsResolver=O,g.smokeDetectorProps=D,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|