@farris/ui-vue 1.2.8 → 1.2.9
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 +129 -129
- package/components/accordion/index.umd.cjs +1 -0
- package/components/avatar/index.esm.js +166 -157
- package/components/avatar/index.umd.cjs +1 -0
- package/components/border-editor/index.umd.cjs +1 -0
- package/components/button/index.umd.cjs +1 -0
- package/components/button-edit/index.esm.js +343 -325
- package/components/button-edit/index.umd.cjs +1 -0
- package/components/button-group/index.umd.cjs +1 -0
- package/components/calculator/index.umd.cjs +1 -0
- package/components/calendar/index.esm.js +338 -338
- package/components/calendar/index.umd.cjs +1 -0
- package/components/capsule/index.esm.js +182 -182
- package/components/capsule/index.umd.cjs +1 -0
- package/components/checkbox/index.esm.js +326 -317
- package/components/checkbox/index.umd.cjs +1 -0
- package/components/color-picker/index.esm.js +118 -118
- package/components/color-picker/index.umd.cjs +3 -0
- package/components/combo-list/index.esm.js +338 -325
- package/components/combo-list/index.umd.cjs +1 -0
- package/components/combo-tree/index.esm.js +62 -62
- package/components/combo-tree/index.umd.cjs +1 -0
- package/components/common/index.umd.cjs +1 -0
- package/components/component/index.esm.js +382 -270
- package/components/component/index.umd.cjs +1 -0
- package/components/condition/index.esm.js +1018 -895
- package/components/condition/index.umd.cjs +1 -0
- package/components/content-container/index.esm.js +285 -212
- package/components/content-container/index.umd.cjs +1 -0
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +4761 -4319
- package/components/data-grid/index.umd.cjs +1 -0
- package/components/data-view/index.esm.js +2901 -2664
- package/components/data-view/index.umd.cjs +1 -0
- package/components/date-picker/index.esm.js +1502 -1488
- package/components/date-picker/index.umd.cjs +1 -0
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +938 -928
- package/components/designer-canvas/index.umd.cjs +1 -0
- package/components/designer-outline/index.css +1 -1
- package/components/designer-outline/index.esm.js +27 -27
- package/components/designer-outline/index.umd.cjs +1 -0
- package/components/designer-toolbox/index.esm.js +36 -12
- package/components/designer-toolbox/index.umd.cjs +1 -0
- package/components/discussion-editor/index.umd.cjs +3 -0
- package/components/discussion-list/index.umd.cjs +1 -0
- package/components/drawer/index.umd.cjs +1 -0
- package/components/dropdown/index.esm.js +241 -241
- package/components/dropdown/index.umd.cjs +2 -0
- package/components/dynamic-form/index.esm.js +1074 -885
- package/components/dynamic-form/index.umd.cjs +1 -0
- package/components/dynamic-resolver/index.esm.js +99 -94
- package/components/dynamic-resolver/index.umd.cjs +1 -0
- package/components/dynamic-view/index.umd.cjs +1 -0
- package/components/enum-editor/index.umd.cjs +1 -0
- package/components/events-editor/index.esm.js +577 -522
- package/components/events-editor/index.umd.cjs +1 -0
- package/components/expression-editor/index.esm.js +70 -70
- package/components/expression-editor/index.umd.cjs +1 -0
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +2938 -2619
- package/components/external-container/index.umd.cjs +1 -0
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +4766 -4325
- package/components/field-selector/index.umd.cjs +1 -0
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1231 -1215
- package/components/filter-bar/index.umd.cjs +1 -0
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +1062 -1052
- package/components/flow-canvas/index.umd.cjs +1 -0
- package/components/image-cropper/index.esm.js +373 -373
- package/components/image-cropper/index.umd.cjs +1 -0
- package/components/input-group/index.esm.js +398 -394
- package/components/input-group/index.umd.cjs +1 -0
- package/components/layout/index.esm.js +268 -268
- package/components/layout/index.umd.cjs +1 -0
- package/components/list-nav/index.esm.js +234 -161
- package/components/list-nav/index.umd.cjs +1 -0
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +2288 -2048
- package/components/list-view/index.umd.cjs +1 -0
- package/components/loading/index.umd.cjs +8 -0
- package/components/locale/index.umd.cjs +1 -0
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +5776 -5305
- package/components/lookup/index.umd.cjs +1 -0
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +5496 -5036
- package/components/mapping-editor/index.umd.cjs +1 -0
- package/components/message-box/index.umd.cjs +1 -0
- package/components/modal/index.umd.cjs +1 -0
- package/components/nav/index.esm.js +383 -322
- package/components/nav/index.umd.cjs +3 -0
- package/components/notify/index.umd.cjs +1 -0
- package/components/number-range/index.esm.js +273 -269
- package/components/number-range/index.umd.cjs +1 -0
- package/components/number-spinner/index.esm.js +292 -283
- package/components/number-spinner/index.umd.cjs +1 -0
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1008 -925
- package/components/order/index.umd.cjs +1 -0
- package/components/page-footer/index.esm.js +98 -98
- package/components/page-footer/index.umd.cjs +1 -0
- package/components/page-header/index.esm.js +949 -847
- package/components/page-header/index.umd.cjs +1 -0
- package/components/pagination/index.esm.js +464 -403
- package/components/pagination/index.umd.cjs +1 -0
- package/components/popover/index.umd.cjs +1 -0
- package/components/progress/index.esm.js +226 -226
- package/components/progress/index.umd.cjs +3 -0
- package/components/property-editor/index.esm.js +1110 -1092
- package/components/property-editor/index.umd.cjs +3 -0
- package/components/property-panel/index.esm.js +520 -513
- package/components/property-panel/index.umd.cjs +1 -0
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +1714 -1575
- package/components/query-solution/index.umd.cjs +1 -0
- package/components/radio-button/index.esm.js +67 -67
- package/components/radio-button/index.umd.cjs +1 -0
- package/components/radio-group/index.esm.js +298 -289
- package/components/radio-group/index.umd.cjs +1 -0
- package/components/rate/index.esm.js +195 -190
- package/components/rate/index.umd.cjs +1 -0
- package/components/response-layout/index.esm.js +112 -112
- package/components/response-layout/index.umd.cjs +1 -0
- package/components/response-layout-editor/index.esm.js +902 -877
- package/components/response-layout-editor/index.umd.cjs +1 -0
- package/components/response-toolbar/index.esm.js +874 -778
- package/components/response-toolbar/index.umd.cjs +1 -0
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +4594 -4289
- package/components/schema-selector/index.umd.cjs +8 -0
- package/components/search-box/index.esm.js +126 -126
- package/components/search-box/index.umd.cjs +1 -0
- package/components/section/index.esm.js +645 -503
- package/components/section/index.umd.cjs +1 -0
- package/components/smoke-detector/index.esm.js +120 -120
- package/components/smoke-detector/index.umd.cjs +1 -0
- package/components/spacing-editor/index.umd.cjs +1 -0
- package/components/splitter/index.esm.js +421 -348
- package/components/splitter/index.umd.cjs +1 -0
- package/components/step/index.esm.js +219 -219
- package/components/step/index.umd.cjs +1 -0
- package/components/switch/index.esm.js +232 -222
- package/components/switch/index.umd.cjs +1 -0
- package/components/tabs/index.esm.js +1823 -1744
- package/components/tabs/index.umd.cjs +1 -0
- package/components/tags/index.esm.js +399 -401
- package/components/tags/index.umd.cjs +1 -0
- package/components/text/index.esm.js +164 -164
- package/components/text/index.umd.cjs +1 -0
- package/components/textarea/index.esm.js +220 -215
- package/components/textarea/index.umd.cjs +1 -0
- package/components/time-picker/index.esm.js +693 -666
- package/components/time-picker/index.umd.cjs +1 -0
- package/components/tooltip/index.umd.cjs +1 -0
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +422 -413
- package/components/transfer/index.umd.cjs +1 -0
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +4799 -4358
- package/components/tree-grid/index.umd.cjs +1 -0
- package/components/tree-view/index.esm.js +2448 -2215
- package/components/tree-view/index.umd.cjs +1 -0
- package/components/uploader/index.esm.js +164 -164
- package/components/uploader/index.umd.cjs +2 -0
- package/components/verify-detail/index.esm.js +143 -143
- package/components/verify-detail/index.umd.cjs +1 -0
- package/components/video/index.esm.js +410 -331
- package/components/video/index.umd.cjs +1 -0
- package/components/weather/index.esm.js +901 -901
- package/components/weather/index.umd.cjs +16 -0
- package/farris.all.esm.js +12305 -11403
- package/farris.all.umd.cjs +8 -8
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/button-edit/src/designer/button-group.design.component.d.ts +7 -0
- package/types/combo-list/src/components/list-container.component.d.ts +3 -0
- package/types/combo-list/src/components/list-container.props.d.ts +5 -1
- package/types/common/entity/entity-schema.d.ts +258 -0
- package/types/component/src/component-ref.props.d.ts +4 -0
- package/types/component/src/composition/inner-component-build-info.d.ts +27 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-grid/index.d.ts +5 -2
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +33 -0
- package/types/data-grid/src/data-grid.component.d.ts +2 -1
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/use-group-column.d.ts +20 -0
- package/types/data-grid/src/property-config/data-grid.property-config.d.ts +4 -0
- package/types/data-grid/src/schema/schema-resolver.d.ts +2 -1
- package/types/data-view/components/column-format/boolean.component.d.ts +4 -0
- package/types/data-view/components/column-format/column-format.component.d.ts +4 -0
- package/types/data-view/components/column-format/date.component.d.ts +4 -0
- package/types/data-view/components/column-format/enum.component.d.ts +4 -0
- package/types/data-view/components/column-format/number.component.d.ts +4 -0
- package/types/data-view/composition/pagination/use-pagination.d.ts +1 -0
- package/types/data-view/composition/types.d.ts +18 -6
- package/types/data-view/composition/use-edit.d.ts +2 -1
- package/types/designer-canvas/src/composition/function/use-dragula.d.ts +2 -2
- package/types/designer-canvas/src/types.d.ts +2 -2
- package/types/dynamic-form/index.d.ts +2 -1
- package/types/dynamic-form/src/composition/response-form-component-creator.service.d.ts +31 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +2 -1
- package/types/dynamic-resolver/src/schema-resolver.d.ts +2 -1
- package/types/dynamic-resolver/src/types.d.ts +3 -2
- package/types/response-toolbar/src/response-toolbar.props.d.ts +2 -2
- package/types/response-toolbar/src/schema/schema-mapper.d.ts +4 -0
- package/types/section/src/property-config/section.property-config.d.ts +93 -0
- package/types/section/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/composition/types.d.ts +2 -2
- package/types/tabs/src/designer/tab-header-item.design.component.d.ts +3 -1
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +60 -0
- package/types/tabs/src/schema/schema-resolver.d.ts +2 -1
- package/types/tags/index.d.ts +36 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(P,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):(P=typeof globalThis<"u"?globalThis:P||self,o(P.section={},P.Vue,P.LodashES,P.FResponseToolbar,P.BigNumber,P.common))})(this,function(P,o,J,U,Se,Z){"use strict";const q={},z={};function $(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?$(e[h]):J.cloneDeep(e[h].default)),b),{});return(!c||!r.find(b=>b=="id"))&&(l.id=`${n}-${Date.now()}`),l}function x(t,e={},n){const r=q[t];if(r){let c=$(r);const l=z[t];return c=l?l({getSchemaByType:x},c,e,n):c,c}return null}function Q(t,e){const n=$(e);return Object.keys(t).reduce((r,c)=>(r[c]&&typeof r[c]=="object"?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"}},K={},ee={};R();function te(t,e,n=new Map,r=(b,h,j)=>h,c={},l=b=>b){return q[e.title]=e,z[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"]},O={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}},V=te(O,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 B(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 W(t,e,n,r,c,l){o.ref(t.subTitle);const b=o.computed(()=>t.buttonPosition),h=B(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,w)=>(g[w]=!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 E=o.defineComponent({name:"FSection",props:O,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=W(t,e,b,n,r,j),m=B(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"}}},F=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],F)})}function C(a,p){const s={canAccept:!0,fixed:!1,hidePadding:!0};return F.has(a)?F.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(" "):[],w=y.length?y.reduce((_,L)=>{const G=L&&L.appearance?L.appearance.class:"",Ae=G?G.split(" "):[];return _.push(...Ae),_},[]):[],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:w};const{canAccept:N,fixed:H,hidePadding:Te}=c.getRuleValue(A[0],h);return l=N,b=Te,j=H,!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 w=o.ref(g==null?void 0:g.value.parent),S=f(w);return S||null}function d(g=e){const{componentInstance:w,designerItemElementRef:S}=g;return!w||!w.value?null:w.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,w){w&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(w)}function u(g,w){const{componentType:S}=g;let M=x(S,g,w);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,w){const S=String(g.getAttribute("data-controltype")),M=g.getAttribute("data-feature"),D=M?JSON.parse(M):{};D.parentComponentInstance=b.value;let N=x(S,D);n&&n.onAcceptNewChildElement&&(N=n.onAcceptNewChildElement(g,w,N));const H=S.toLowerCase().replace("-","_");return N&&!N.id&&N.type===S&&(N.id=`${H}_${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:O,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=W(t,e,m,r,c,d),a=B(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()])}});E.register=(t,e,n,r)=>{t.section=E,e.section=V},E.registerDesigner=(t,e,n)=>{t.section=Ce,e.section=V};const je=Z.withInstall(E);P.Section=E,P.default=je,P.propsResolver=V,P.sectionProps=O,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import { defineComponent as B, createVNode as
|
|
1
|
+
import { defineComponent as B, createVNode as w, ref as k, inject as q, onMounted as W } from "vue";
|
|
2
2
|
import { cloneDeep as J } from "lodash-es";
|
|
3
3
|
const V = {}, F = {};
|
|
4
|
-
function
|
|
5
|
-
const { properties: e, title:
|
|
6
|
-
return n.id = `${
|
|
4
|
+
function O(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((h) => h == f)) && (l[f] = e[f].type === "object" && e[f].properties ? O(e[f]) : J(e[f].default)), l), {});
|
|
6
|
+
return (!o || !n.find((l) => l == "id")) && (p.id = `${a}-${Date.now()}`), p;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
return
|
|
8
|
+
function E(t, e = {}, a) {
|
|
9
|
+
const n = V[t];
|
|
10
|
+
if (n) {
|
|
11
|
+
let o = O(n);
|
|
12
|
+
const p = F[t];
|
|
13
|
+
return o = p ? p({ getSchemaByType: E }, o, e, a) : o, o;
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
function z(t, e) {
|
|
18
|
-
const
|
|
19
|
-
return Object.keys(t).reduce((n, o) => (n[o] && typeof n[o] == "object" ? Object.assign(n[o], t[o]) : n[o] = t[o], n),
|
|
18
|
+
const a = O(e);
|
|
19
|
+
return Object.keys(t).reduce((n, o) => (n[o] && typeof n[o] == "object" ? Object.assign(n[o], t[o]) : n[o] = t[o], n), a), a;
|
|
20
20
|
}
|
|
21
21
|
function G(t, e) {
|
|
22
22
|
return Object.keys(t).filter((n) => t[n] != null).reduce((n, o) => {
|
|
23
23
|
if (e.has(o)) {
|
|
24
|
-
const
|
|
25
|
-
if (typeof
|
|
26
|
-
n[
|
|
24
|
+
const p = e.get(o);
|
|
25
|
+
if (typeof p == "string")
|
|
26
|
+
n[p] = t[o];
|
|
27
27
|
else {
|
|
28
|
-
const
|
|
29
|
-
Object.assign(n,
|
|
28
|
+
const l = p(o, t[o], t);
|
|
29
|
+
Object.assign(n, l);
|
|
30
30
|
}
|
|
31
31
|
} else
|
|
32
32
|
n[o] = t[o];
|
|
33
33
|
return n;
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
36
|
-
function H(t, e,
|
|
36
|
+
function H(t, e, a = /* @__PURE__ */ new Map()) {
|
|
37
37
|
const n = z(t, e);
|
|
38
|
-
return G(n,
|
|
38
|
+
return G(n, a);
|
|
39
39
|
}
|
|
40
40
|
function Q(t = {}) {
|
|
41
|
-
function e(r,
|
|
42
|
-
if (typeof
|
|
43
|
-
return
|
|
44
|
-
if (typeof
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
return Number(
|
|
48
|
-
if (
|
|
49
|
-
return Number(
|
|
50
|
-
if (
|
|
51
|
-
return Number(
|
|
41
|
+
function e(r, s, c, i) {
|
|
42
|
+
if (typeof c == "number")
|
|
43
|
+
return i[r].length === c;
|
|
44
|
+
if (typeof c == "object") {
|
|
45
|
+
const m = Object.keys(c)[0], d = c[m];
|
|
46
|
+
if (m === "not")
|
|
47
|
+
return Number(i[r].length) !== Number(d);
|
|
48
|
+
if (m === "moreThan")
|
|
49
|
+
return Number(i[r].length) >= Number(d);
|
|
50
|
+
if (m === "lessThan")
|
|
51
|
+
return Number(i[r].length) <= Number(d);
|
|
52
52
|
}
|
|
53
53
|
return !1;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
55
|
+
function a(r, s, c, i) {
|
|
56
|
+
return i[r] && i[r].propertyValue && String(i[r].propertyValue.value) === String(c);
|
|
57
57
|
}
|
|
58
58
|
const n = /* @__PURE__ */ new Map([
|
|
59
59
|
["length", e],
|
|
60
|
-
["getProperty",
|
|
60
|
+
["getProperty", a]
|
|
61
61
|
]);
|
|
62
|
-
Object.keys(t).reduce((r,
|
|
63
|
-
function o(r,
|
|
64
|
-
const
|
|
65
|
-
return typeof
|
|
66
|
-
if (
|
|
67
|
-
return { target:
|
|
68
|
-
const
|
|
69
|
-
return { target:
|
|
62
|
+
Object.keys(t).reduce((r, s) => (r.set(s, t[s]), r), n);
|
|
63
|
+
function o(r, s) {
|
|
64
|
+
const c = r;
|
|
65
|
+
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) => {
|
|
66
|
+
if (i === "length")
|
|
67
|
+
return { target: c, operator: "length", param: null, value: s[i] };
|
|
68
|
+
const m = i, d = s[i];
|
|
69
|
+
return { target: c, operator: "getProperty", param: m, value: d };
|
|
70
70
|
}) : [];
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return Object.keys(r).reduce((
|
|
74
|
-
const
|
|
75
|
-
return
|
|
72
|
+
function p(r) {
|
|
73
|
+
return Object.keys(r).reduce((c, i) => {
|
|
74
|
+
const m = o(i, r[i]);
|
|
75
|
+
return c.push(...m), c;
|
|
76
76
|
}, []);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function l(r, s) {
|
|
79
79
|
if (n.has(r.operator)) {
|
|
80
|
-
const
|
|
81
|
-
return
|
|
80
|
+
const c = n.get(r.operator);
|
|
81
|
+
return c && c(r.target, r.param, r.value, s) || !1;
|
|
82
82
|
}
|
|
83
83
|
return !1;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function f(r, s) {
|
|
86
|
+
return p(r).reduce((m, d) => m && l(d, s), !0);
|
|
87
87
|
}
|
|
88
|
-
function h(r,
|
|
89
|
-
const
|
|
90
|
-
return
|
|
88
|
+
function h(r, s) {
|
|
89
|
+
const c = Object.keys(r), i = c.includes("allOf"), m = c.includes("anyOf"), d = i || m, D = (d ? r[d ? i ? "allOf" : "anyOf" : "allOf"] : [r]).map((A) => f(A, s));
|
|
90
|
+
return i ? !D.includes(!1) : D.includes(!0);
|
|
91
91
|
}
|
|
92
92
|
return { parseValueSchema: h };
|
|
93
93
|
}
|
|
94
94
|
const U = {}, X = {};
|
|
95
95
|
Q();
|
|
96
|
-
function Y(t, e,
|
|
97
|
-
return V[e.title] = e, F[e.title] = n, U[e.title] = o, X[e.title] =
|
|
98
|
-
const
|
|
99
|
-
return Object.assign(h,
|
|
96
|
+
function Y(t, e, a = /* @__PURE__ */ new Map(), n = (l, f, h) => f, o = {}, p = (l) => l) {
|
|
97
|
+
return V[e.title] = e, F[e.title] = n, U[e.title] = o, X[e.title] = p, (l = {}) => {
|
|
98
|
+
const f = H(l, e, a), h = Object.keys(t).reduce((r, s) => (r[s] = t[s].default, r), {});
|
|
99
|
+
return Object.assign(h, f);
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
function Z(t, e) {
|
|
@@ -105,7 +105,7 @@ function Z(t, e) {
|
|
|
105
105
|
const C = /* @__PURE__ */ new Map([
|
|
106
106
|
["appearance", Z]
|
|
107
107
|
]);
|
|
108
|
-
function K(t, e,
|
|
108
|
+
function K(t, e, a) {
|
|
109
109
|
return e;
|
|
110
110
|
}
|
|
111
111
|
const x = "https://json-schema.org/draft/2020-12/schema", I = "https://farris-design.gitee.io/smoke-detector.schema.json", ee = "smoke-detector", te = "A Farris Component", re = "object", ne = {
|
|
@@ -160,7 +160,7 @@ const x = "https://json-schema.org/draft/2020-12/schema", I = "https://farris-de
|
|
|
160
160
|
}, oe = [
|
|
161
161
|
"id",
|
|
162
162
|
"type"
|
|
163
|
-
],
|
|
163
|
+
], se = {
|
|
164
164
|
$schema: x,
|
|
165
165
|
$id: I,
|
|
166
166
|
title: ee,
|
|
@@ -168,7 +168,7 @@ const x = "https://json-schema.org/draft/2020-12/schema", I = "https://farris-de
|
|
|
168
168
|
type: re,
|
|
169
169
|
properties: ne,
|
|
170
170
|
required: oe
|
|
171
|
-
},
|
|
171
|
+
}, ce = "smoke-detector", ie = "A Farris Component", ae = "object", ue = {
|
|
172
172
|
basic: {
|
|
173
173
|
description: "Basic Infomation",
|
|
174
174
|
title: "基本信息",
|
|
@@ -244,29 +244,29 @@ const x = "https://json-schema.org/draft/2020-12/schema", I = "https://farris-de
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}, le = {
|
|
247
|
-
title:
|
|
248
|
-
description:
|
|
249
|
-
type:
|
|
247
|
+
title: ce,
|
|
248
|
+
description: ie,
|
|
249
|
+
type: ae,
|
|
250
250
|
categories: ue
|
|
251
|
-
},
|
|
251
|
+
}, R = {}, $ = Y(R, se, C, K, le), M = /* @__PURE__ */ B({
|
|
252
252
|
name: "FSmokeDetector",
|
|
253
|
-
props:
|
|
253
|
+
props: R,
|
|
254
254
|
emits: [""],
|
|
255
255
|
setup(t) {
|
|
256
|
-
return () =>
|
|
256
|
+
return () => w("div", {
|
|
257
257
|
class: "f-smoke-detector"
|
|
258
|
-
}, [
|
|
258
|
+
}, [w("img", {
|
|
259
259
|
title: "smoke-detector",
|
|
260
260
|
src: "./image/smoke-detector-2.png"
|
|
261
261
|
}, null)]);
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
|
-
function pe(t, e,
|
|
265
|
-
var
|
|
264
|
+
function pe(t, e, a) {
|
|
265
|
+
var N;
|
|
266
266
|
function n() {
|
|
267
267
|
}
|
|
268
|
-
const o = "",
|
|
269
|
-
function
|
|
268
|
+
const o = "", p = "", l = k();
|
|
269
|
+
function f() {
|
|
270
270
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
271
271
|
}
|
|
272
272
|
function h() {
|
|
@@ -275,86 +275,86 @@ function pe(t, e, i) {
|
|
|
275
275
|
function r() {
|
|
276
276
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function s() {
|
|
279
279
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function c(u) {
|
|
282
282
|
if (!u || !u.value)
|
|
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 g = k(u == null ? void 0 : u.value.parent), y = c(g);
|
|
287
|
+
return y || null;
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
const { componentInstance:
|
|
291
|
-
return !
|
|
289
|
+
function i(u = e) {
|
|
290
|
+
const { componentInstance: g, designerItemElementRef: y } = u;
|
|
291
|
+
return !g || !g.value ? null : g.value.canMove ? y : i(u.parent);
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
return !!
|
|
293
|
+
function m(u) {
|
|
294
|
+
return !!a;
|
|
295
295
|
}
|
|
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 T() {
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function S(u, g) {
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function D(u, g) {
|
|
304
304
|
const { componentType: y } = u;
|
|
305
|
-
let
|
|
306
|
-
const
|
|
307
|
-
return
|
|
305
|
+
let v = E(y, u, g);
|
|
306
|
+
const P = y.toLowerCase().replace("-", "_");
|
|
307
|
+
return v && !v.id && v.type === y && (v.id = `${P}_${Math.random().toString().slice(2, 6)}`), v;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
let
|
|
313
|
-
const
|
|
314
|
-
return
|
|
309
|
+
function j(u, g) {
|
|
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 = E(y, P);
|
|
313
|
+
const _ = y.toLowerCase().replace("-", "_");
|
|
314
|
+
return b && !b.id && b.type === y && (b.id = `${_}_${Math.random().toString().slice(2, 6)}`), b;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function A(u) {
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function L(...u) {
|
|
319
319
|
}
|
|
320
|
-
return
|
|
321
|
-
canMove:
|
|
320
|
+
return l.value = {
|
|
321
|
+
canMove: f(),
|
|
322
322
|
canSelectParent: h(),
|
|
323
323
|
canDelete: r(),
|
|
324
|
-
canNested: !
|
|
324
|
+
canNested: !s(),
|
|
325
325
|
contents: e == null ? void 0 : e.schema.contents,
|
|
326
326
|
elementRef: t,
|
|
327
|
-
parent: (
|
|
327
|
+
parent: (N = e == null ? void 0 : e.parent) == null ? void 0 : N.componentInstance,
|
|
328
328
|
schema: e == null ? void 0 : e.schema,
|
|
329
329
|
styles: o,
|
|
330
|
-
designerClass:
|
|
331
|
-
canAccepts:
|
|
332
|
-
getBelongedComponentInstance:
|
|
333
|
-
getDraggableDesignItemElement:
|
|
330
|
+
designerClass: p,
|
|
331
|
+
canAccepts: m,
|
|
332
|
+
getBelongedComponentInstance: c,
|
|
333
|
+
getDraggableDesignItemElement: i,
|
|
334
334
|
getDraggingDisplayText: d,
|
|
335
|
-
getPropConfig:
|
|
336
|
-
getDragScopeElement:
|
|
337
|
-
onAcceptMovedChildElement:
|
|
338
|
-
onAcceptNewChildElement:
|
|
339
|
-
onChildElementMovedOut:
|
|
340
|
-
addNewChildComponentSchema:
|
|
335
|
+
getPropConfig: L,
|
|
336
|
+
getDragScopeElement: T,
|
|
337
|
+
onAcceptMovedChildElement: S,
|
|
338
|
+
onAcceptNewChildElement: j,
|
|
339
|
+
onChildElementMovedOut: A,
|
|
340
|
+
addNewChildComponentSchema: D,
|
|
341
341
|
updateDragAndDropRules: n,
|
|
342
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
343
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
344
|
-
},
|
|
342
|
+
triggerBelongedComponentToMoveWhenMoved: k(!1),
|
|
343
|
+
triggerBelongedComponentToDeleteWhenDeleted: k(!1)
|
|
344
|
+
}, l;
|
|
345
345
|
}
|
|
346
346
|
const fe = /* @__PURE__ */ B({
|
|
347
347
|
name: "FSmokeDetectorDesign",
|
|
348
|
-
props:
|
|
348
|
+
props: R,
|
|
349
349
|
emits: [""],
|
|
350
350
|
setup(t, e) {
|
|
351
|
-
const
|
|
351
|
+
const a = k(), n = q("design-item-context"), o = pe(a, n);
|
|
352
352
|
return W(() => {
|
|
353
|
-
|
|
354
|
-
}), e.expose(o.value), () =>
|
|
355
|
-
ref:
|
|
353
|
+
a.value.componentInstance = o;
|
|
354
|
+
}), e.expose(o.value), () => w("div", {
|
|
355
|
+
ref: a,
|
|
356
356
|
class: "f-smoke-detector"
|
|
357
|
-
}, [
|
|
357
|
+
}, [w("img", {
|
|
358
358
|
title: "smoke-detector",
|
|
359
359
|
src: "../image/smoke-detector-2.png"
|
|
360
360
|
}, null)]);
|
|
@@ -363,10 +363,10 @@ const fe = /* @__PURE__ */ B({
|
|
|
363
363
|
install(t) {
|
|
364
364
|
t.component(M.name, M);
|
|
365
365
|
},
|
|
366
|
-
register(t, e,
|
|
366
|
+
register(t, e, a, n) {
|
|
367
367
|
t["smoke-detector"] = M, e["smoke-detector"] = $;
|
|
368
368
|
},
|
|
369
|
-
registerDesigner(t, e,
|
|
369
|
+
registerDesigner(t, e, a) {
|
|
370
370
|
t["smoke-detector"] = fe, e["smoke-detector"] = $;
|
|
371
371
|
}
|
|
372
372
|
};
|
|
@@ -374,5 +374,5 @@ export {
|
|
|
374
374
|
M as SmokeDetector,
|
|
375
375
|
ye as default,
|
|
376
376
|
$ as propsResolver,
|
|
377
|
-
|
|
377
|
+
R as smokeDetectorProps
|
|
378
378
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(h,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):(h=typeof globalThis<"u"?globalThis:h||self,l(h["smoke-detector"]={},h.Vue,h.LodashES))})(this,function(h,l,q){"use strict";const R={},j={};function A(t){const{properties:e,title:a,ignore:n}=t,o=n&&Array.isArray(n),f=Object.keys(e).reduce((p,d)=>((!o||!n.find(v=>v==d))&&(p[d]=e[d].type==="object"&&e[d].properties?A(e[d]):q.cloneDeep(e[d].default)),p),{});return(!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=A(n);const f=j[t];return o=f?f({getSchemaByType:S},o,e,a):o,o}return null}function F(t,e){const a=A(e);return Object.keys(t).reduce((n,o)=>(n[o]&&typeof n[o]=="object"?Object.assign(n[o],t[o]):n[o]=t[o],n),a),a}function _(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 L(t,e,a=new Map){const n=F(t,e);return _(n,a)}function W(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 v(r,s){const c=Object.keys(r),i=c.includes("allOf"),m=c.includes("anyOf"),y=i||m,M=(y?r[y?i?"allOf":"anyOf":"allOf"]:[r]).map(O=>d(O,s));return i?!M.includes(!1):M.includes(!0)}return{parseValueSchema:v}}const J={},z={};W();function G(t,e,a=new Map,n=(p,d,v)=>d,o={},f=p=>p){return R[e.title]=e,j[e.title]=n,J[e.title]=o,z[e.title]=f,(p={})=>{const d=L(p,e,a),v=Object.keys(t).reduce((r,s)=>(r[s]=t[s].default,r),{});return Object.assign(v,d)}}function H(t,e){return{customClass:e.class,customStyle:e.style}}const Q=new Map([["appearance",H]]);function U(t,e,a){return e}const X={$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"]},Y={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:"下发数据"}}}}},P={},$=G(P,X,Q,U,Y),T=l.defineComponent({name:"FSmokeDetector",props:P,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 Z(t,e,a){var V;function n(){}const o="",f="",p=l.ref();function d(){return(e==null?void 0:e.schema.componentType)!=="frame"}function v(){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 b=l.ref(u==null?void 0:u.value.parent),g=c(b);return g||null}function i(u=e){const{componentInstance:b,designerItemElementRef:g}=u;return!b||!b.value?null:b.value.canMove?g: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 E(){}function N(u,b){}function M(u,b){const{componentType:g}=u;let k=S(g,u,b);const w=g.toLowerCase().replace("-","_");return k&&!k.id&&k.type===g&&(k.id=`${w}_${Math.random().toString().slice(2,6)}`),k}function B(u,b){const g=String(u.getAttribute("data-controltype")),k=u.getAttribute("data-feature"),w=k?JSON.parse(k):{};w.parentComponentInstance=p.value;let D=S(g,w);const I=g.toLowerCase().replace("-","_");return D&&!D.id&&D.type===g&&(D.id=`${I}_${Math.random().toString().slice(2,6)}`),D}function O(u){}function x(...u){}return p.value={canMove:d(),canSelectParent:v(),canDelete:r(),canNested:!s(),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:o,designerClass:f,canAccepts:m,getBelongedComponentInstance:c,getDraggableDesignItemElement:i,getDraggingDisplayText:y,getPropConfig:x,getDragScopeElement:E,onAcceptMovedChildElement:N,onAcceptNewChildElement:B,onChildElementMovedOut:O,addNewChildComponentSchema:M,updateDragAndDropRules:n,triggerBelongedComponentToMoveWhenMoved:l.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:l.ref(!1)},p}const C=l.defineComponent({name:"FSmokeDetectorDesign",props:P,emits:[""],setup(t,e){const a=l.ref(),n=l.inject("design-item-context"),o=Z(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)])}}),K={install(t){t.component(T.name,T)},register(t,e,a,n){t["smoke-detector"]=T,e["smoke-detector"]=$},registerDesigner(t,e,a){t["smoke-detector"]=C,e["smoke-detector"]=$}};h.SmokeDetector=T,h.default=K,h.propsResolver=$,h.smokeDetectorProps=P,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../number-spinner/index.umd.js"),require("../combo-list/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../number-spinner/index.umd.js","../combo-list/index.umd.js"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i["spacing-editor"]={},i.Vue,i.FNumberSpinner,i.FComboList))})(this,function(i,e,y,h){"use strict";const S={defaultSpacings:{type:Array,default:[{id:"default",value:"4",name:"系统默认"},{id:"large",value:"20",name:"大(20px)"},{id:"middle",value:"16",name:"中(16px)"},{id:"small",value:"12",name:"小(12px)"},{id:"exsmall",value:"8",name:"超小(8px)"},{id:"none",value:"0",name:"无(0px)"},{id:"custom",value:"custom",name:"自定义"}]},directions:{type:Array,default:[{id:"top",title:"上"},{id:"right",title:"右"},{id:"bottom",title:"下"},{id:"left",title:"左"}]},margins:{type:Array,default:[4,4,4,4]},paddings:{type:Array,default:[4,4,4,4]}};function j(a,d){const{defaultSpacings:c}=a,{directions:s}=a,o=e.ref(a.margins),r=e.ref(a.paddings),t=e.ref(!1),l=e.ref("default"),m=e.computed(()=>({"f-icon":!0,"mr-1":!0,"f-spacing-editor-icon":!0,"f-icon-arrow-60-right":!t.value,"f-icon-arrow-60-down":t.value})),u=e.computed(()=>({margin:o.value.join("px ")+"px",padding:r.value.join("px ")+"px"}));function p(){t.value=!t.value}function V(n){n[0].name!=="自定义"?(o.value.fill(n[0].value),t.value=!1,e.nextTick(()=>{t.value=!0}),d.emit("valueChanged",u.value)):t.value=!0}function v(){l.value="custom",d.emit("valueChanged",u.value)}function x(){return t.value?e.createVNode("div",{class:"f-spacing-editor-custom-container"},[s.map((n,g)=>e.createVNode("div",null,[e.createVNode("div",{class:"f-spacing-editor-custom"},[e.createVNode("div",{class:"f-spacing-editor-title"},[n.title,e.createTextVNode("间距(px)")]),e.createVNode(y,{style:"flex: 1 1 0",min:0,modelValue:o.value[g],"onUpdate:modelValue":C=>o.value[g]=C,onChange:v},null)])]))]):""}function N(){return e.createVNode("div",{class:"f-spacing-editor-container"},[e.createVNode("div",{style:"display: flex"},[e.createVNode("div",{class:"f-spacing-editor-title"},[e.createVNode("div",{class:m.value,onClick:p},null),e.createVNode("div",null,[e.createTextVNode("外间距")])]),e.createVNode(h,{style:"flex: 1 1 0",data:c,modelValue:l.value,"onUpdate:modelValue":n=>l.value=n,onChange:V},null)]),x()])}return{renderSpacingEditorMargin:N}}function b(a,d){const{defaultSpacings:c}=a,{directions:s}=a,o=e.ref(a.margins),r=e.ref(a.paddings),t=e.ref(!1),l=e.ref("default"),m=e.computed(()=>({"f-icon":!0,"mr-1":!0,"f-spacing-editor-icon":!0,"f-icon-arrow-60-right":!t.value,"f-icon-arrow-60-down":t.value})),u=e.computed(()=>({margin:o.value.join("px ")+"px",padding:r.value.join("px ")+"px"}));function p(){t.value=!t.value}function V(n){n[0].name!=="自定义"?(r.value.fill(n[0].value),t.value=!1,e.nextTick(()=>{t.value=!0}),d.emit("valueChanged",u.value)):t.value=!0}function v(){l.value="custom",d.emit("valueChanged",u.value)}function x(){return t.value?e.createVNode("div",{class:"f-spacing-editor-custom-container"},[s.map((n,g)=>e.createVNode("div",null,[e.createVNode("div",{class:"f-spacing-editor-custom"},[e.createVNode("div",{class:"f-spacing-editor-title"},[n.title,e.createTextVNode("间距(px)")]),e.createVNode(y,{style:"flex: 1 1 0",min:0,modelValue:r.value[g],"onUpdate:modelValue":C=>r.value[g]=C,onChange:v},null)])]))]):""}function N(){return e.createVNode("div",{class:"f-spacing-editor-container"},[e.createVNode("div",{style:"display: flex"},[e.createVNode("div",{class:"f-spacing-editor-title"},[e.createVNode("div",{class:m.value,onClick:p},null),e.createVNode("div",null,[e.createTextVNode("内间距")])]),e.createVNode(h,{style:"flex: 1 1 0",data:c,modelValue:l.value,"onUpdate:modelValue":n=>l.value=n,onChange:V},null)]),x()])}return{renderSpacingEditorPadding:N}}const f=e.defineComponent({name:"FSpacingEditor",props:S,emits:["valueChanged"],setup(a,d){const{renderSpacingEditorMargin:c}=j(a,d),{renderSpacingEditorPadding:s}=b(a,d);return()=>e.createVNode("div",null,[c(),s()])}}),D={install(a){a.component(f.name,f)}};i.SpacingEditor=f,i.default=D,i.spacingEditorProps=S,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|