@farris/ui-vue 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +9 -7
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +746 -730
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +9 -7
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3096 -3069
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +78 -82
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +501 -487
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +487 -472
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +440 -433
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +594 -587
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +2766 -2739
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +314 -298
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +862 -843
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1031 -1015
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +776 -770
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +296 -283
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +634 -619
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +383 -376
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +595 -575
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +5492 -5470
- package/farris.all.umd.cjs +13 -13
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(L,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../notify/index.umd.js/src/notify.service"),require("../schema-selector/index.umd.js"),require("../modal/index.umd.js"),require("../combo-list/index.umd.js"),require("../event-parameter/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../notify/index.umd.js/src/notify.service","../schema-selector/index.umd.js","../modal/index.umd.js","../combo-list/index.umd.js","../event-parameter/index.umd.js"],e):(L=typeof globalThis<"u"?globalThis:L||self,e(L["events-editor"]={},L.Vue,L.LodashES,L.NotifyService,null,null,null,L.FEventParameter))})(this,function(L,e,C,se,je,Ae,Oe,le){"use strict";const H={},x={};function q(t){const{properties:n,title:r,ignore:a}=t,u=a&&Array.isArray(a),m=Object.keys(n).reduce((l,h)=>((!u||!a.find(p=>p===h))&&(l[h]=n[h].type==="object"&&n[h].properties?q(n[h]):C.cloneDeep(n[h].default)),l),{});if(r&&(!u||!a.find(l=>l==="id"))){const l=r.toLowerCase().replace(/-/g,"_");m.id=`${l}_${Math.random().toString().slice(2,6)}`}return m}function G(t,n={},r){const a=H[t];if(a){let u=q(a);const m=x[t];return u=m?m({getSchemaByType:G},u,n,r):u,u}return null}function ie(t,n){const r=q(n);return Object.keys(r).reduce((a,u)=>(a[u]&&C.isPlainObject(a[u])&&C.isPlainObject(t[u]||!t[u])?Object.assign(a[u],t[u]||{}):a[u]=t[u],a),r),r}function de(t,n){return Object.keys(t).filter(a=>t[a]!=null).reduce((a,u)=>{if(n.has(u)){const m=n.get(u);if(typeof m=="string")a[m]=t[u];else{const l=m(u,t[u],t);Object.assign(a,l)}}else a[u]=t[u];return a},{})}function ue(t,n,r=new Map){const a=ie(t,n);return de(a,r)}function fe(t={}){function n(s,d,o,c){if(typeof o=="number")return c[s].length===o;if(typeof o=="object"){const v=Object.keys(o)[0],f=o[v];if(v==="not")return Number(c[s].length)!==Number(f);if(v==="moreThan")return Number(c[s].length)>=Number(f);if(v==="lessThan")return Number(c[s].length)<=Number(f)}return!1}function r(s,d,o,c){return c[s]&&c[s].propertyValue&&String(c[s].propertyValue.value)===String(o)}const a=new Map([["length",n],["getProperty",r]]);Object.keys(t).reduce((s,d)=>(s.set(d,t[d]),s),a);function u(s,d){const o=s;return typeof d=="number"?[{target:o,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:o,operator:"getProperty",param:s,value:!!d}]:typeof d=="object"?Object.keys(d).map(c=>{if(c==="length")return{target:o,operator:"length",param:null,value:d[c]};const v=c,f=d[c];return{target:o,operator:"getProperty",param:v,value:f}}):[]}function m(s){return Object.keys(s).reduce((o,c)=>{const v=u(c,s[c]);return o.push(...v),o},[])}function l(s,d){if(a.has(s.operator)){const o=a.get(s.operator);return o&&o(s.target,s.param,s.value,d)||!1}return!1}function h(s,d){return m(s).reduce((v,f)=>v&&l(f,d),!0)}function p(s,d){const o=Object.keys(s),c=o.includes("allOf"),v=o.includes("anyOf"),f=c||v,b=(f?s[f?c?"allOf":"anyOf":"allOf"]:[s]).map(y=>h(y,d));return c?!b.includes(!1):b.includes(!0)}return{parseValueSchema:p}}const me={},pe={};fe();function he(t,n,r=new Map,a=(l,h,p,s)=>h,u={},m=l=>l){return H[n.title]=n,x[n.title]=a,me[n.title]=u,pe[n.title]=m,(l={})=>{const h=ue(l,n,r),p=Object.keys(t).reduce((s,d)=>(s[d]=t[d].default,s),{});return Object.assign(p,h)}}function ve(t,n){return{customClass:n.class,customStyle:n.style}}const we=new Map([["appearance",ve]]);function ge(t,n,r){return n}const be={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/events-editor.schema.json",title:"events-editor",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for events-editor",type:"string"},type:{description:"The type events of events-editor",type:"events",default:"events-editor"},initialData:{description:"",type:"object",default:{}}},required:["id","type"]},Ne={title:"events-editor",description:"A Farris Component",type:"object",categories:{}},U=[{label:"pageChange",name:"MockMock切换页码"},{label:"pageSizeChanged",name:"Mock分页条数变化事件"},{label:"scrollYLoad",name:"Mock滚动加载事件"},{label:"onEditClicked",name:"Mock操作列点击编辑"},{label:"onDeleteClicked",name:"Mock操作列点击删除"}],A={initialData:{type:Object,default:{propertyID:"data-grid-component-viewmodel",propertyType:"events",internalCommandList:[{controllerName:{id:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",label:"ListController",name:"列表控制器"},controllerList:[{id:"93ee1cd2-cf0b-40b3-b99f-958a3d1fad1c",label:"Load",name:"Mock加载数据",handlerName:"Load"},{id:"71ae8a4c-6202-4875-9246-2e2d959da37f",label:"Search",name:"Mock查询",handlerName:"Search"},{id:"77556491-41c0-4356-8ccf-25e39817060e",label:"Add",name:"Mock添加数据",handlerName:"Add"},{id:"52fdcac3-46c8-466e-aa5d-19920ece2076",label:"View",name:"Mock查看数据",handlerName:"View"},{id:"7ade9996-0531-4401-b1bc-fb9ec8ee3f8e",label:"Edit",name:"Mock编辑数据",handlerName:"Edit"},{id:"6d5a354f-871f-43e6-82bc-7837184380d3",label:"RemoveRows",name:"Mock删除选中行",handlerName:"RemoveRows"},{id:"1a1b7c33-38f0-469f-a017-223086ee6259",label:"ChangePage",name:"Mock切换页码",handlerName:"ChangePage"},{id:"debae2dd-3387-48cf-90ba-96e74ab5a8e5",label:"Remove",name:"Mock删除指定数据",handlerName:"Remove"}]}],events:U,boundEventsList:[],viewModel:[],componentLists:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],allComponentList:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],newController:[],isAddControllerMethod:!1,getEventList:()=>({events:U,boundEventsList:[]})}}},z=he(A,be,we,ge,Ne);function W(t,n){const r=e.ref([]),{boundEvents:a,unBoundEvent:u}=n;function m(o){return{event:{label:o.boundEvents.label,name:o.boundEvents.name},showSwitch:[{showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2}],command:C.cloneDeep(o.command),controller:C.cloneDeep(o.controller)}}function l(){var o;r.value=(o=a.value)==null?void 0:o.map(c=>m(c))}function h(o){const v=m({boundEvents:o,command:null,controller:{id:"",name:"",label:""}});v.showSwitch[0].showSwitchNumber=1,v.showSwitch[0].showSection[2][3]=!0,r.value.unshift(v)}function p(){var o;(o=r.value)==null||o.forEach(c=>{c.showSwitch.forEach(v=>{v.showSection[2][3]=!1})})}function s(o){r.value[o].showSwitch.forEach(c=>{c.showSection[2][3]=!c.showSection[2][3]})}function d(o){if(o>=0&&o<=r.value.length-1){const c=r.value[o];u(c.event),r.value.splice(o,1)}}return{addNewInteraction:h,collapseInteractions:p,deleteInteracton:d,toggleMethodInInteraction:s,interactions:r,loadInteractions:l}}function Y(t){const n=e.ref([]),r=e.ref([]),a=e.ref([]);function u(){const d=r.value.reduce((c,v)=>(c.set(v.boundEvents.label,!0),c),new Map);return n.value.filter(c=>!d.has(c.label))}function m(){var o;const d=((o=r.value)==null?void 0:o.length)>0;a.value=d?u():n.value}function l(){n.value=t.value.events,r.value=t.value.boundEventsList,m()}function h(d){a.value=a.value.filter(o=>o.label!==d.label)}function p(d){r.value=r.value.filter(o=>o.boundEvents.label!==d.label),m()}function s(){var c;const d=(c=t.value)==null?void 0:c.getEventList(),{events:o}=d;d&&(t.value.events=C.cloneDeep(o),t.value.boundEventsList=d.boundEventsList),t.value.boundEventsList&&(t.value.boundEventsList=t.value.boundEventsList.filter(function(v){return o.find(f=>f.label===v.boundEvents.label)}))}return{allEvents:n,boundEvents:r,candidateEvents:a,excludeFromCandidates:h,loadEvents:l,resetBoundEvents:s,unBoundEvent:p}}const Ce={},Se={events:{type:Array,default:[]}},Ee=e.defineComponent({name:"FEventList",props:Se,emits:["click"],setup(t,n){const r=e.ref(t.events);function a(m){n.emit("click",m)}function u(m){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>a(m),class:"f-page-events-editor-first-bound-event-name"},[m.name])])}return()=>e.createVNode("div",{class:"f-page-events-editor-events"},[r.value.map(m=>u(m))])}}),J=e.defineComponent({name:"FInteractionButton",props:Ce,emits:["click"],setup(t,n){const r=new se,a=e.inject("useEventsComposition"),u=e.inject("useInteractionCompostion"),{candidateEvents:m}=a,{collapseInteractions:l}=u,h=e.ref(!1);function p(c){m.value=m.value.filter(v=>v.label!==c.label)}function s(c=!1){h.value=c}function d(c){s(),p(c),n.emit("click",c)}function o(){if(m.value.length===0){r.info({position:"top-center",message:"事件已全部绑定"});return}l(),s(!h.value)}return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-page-events-editor-top-button"},[e.createVNode("button",{class:"f-page-events-editor-button",onClick:o},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),h.value&&e.createVNode(Ee,{events:m.value,onClick:d},null)])}}),Me={collapsed:{type:Boolean,default:!0},displayOrder:{type:Number,default:-1},interaction:{type:Object,default:{}},controllers:{type:Array,default:[]}},Ve={initialData:{Type:Object,default:{}},originalData:{Type:Object,default:{}},newImport:{Type:Boolean,default:!1},addInternalCommandList:{Type:Array,default:[]},outerLayerValue:{Type:Number,default:0},exit:{Type:Number,default:-1},haveBoundcommand:{Type:Boolean,default:!1}},ye={controllers:{type:Array,default:[]}},Be=e.defineComponent({name:"FCommandList",props:ye,emits:["selectMethod"],setup(t,n){const r=e.ref(t.controllers);function a(p){return p.controllerList.length!==0}function u(p){return a(p)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:p.controllerName.name},[p.controllerName.name])])}function m(p,s){n.emit("selectMethod",{method:p,controller:s})}function l(p){return p.controllerList.map(s=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>m(s,p)},[e.createVNode("div",{class:"f-page-internals-command-name",title:s.label},[s.name])]))}function h(p){return e.createVNode("div",null,[u(p),l(p)])}return()=>e.createVNode("div",{class:"f-page-internals"},[r.value.map(p=>h(p))])}}),Le=e.defineComponent({name:"FCommandSource",props:Ve,emits:["addInternalCommandListChanged","newImportChanged","currentCommandChanged","originalDataChanged","click","existChanged","newFunctionChanged","close","selectMethod"],setup(t,n){const r=e.inject("useMethodsComposition"),{controllers:a}=r,u=e.ref(!1),m=e.ref(t.canAddNewMethod),l=e.computed(()=>!m.value),h=e.computed(()=>u.value),p=e.computed(()=>({"font-size":"15px",margin:"5px",color:"#226eff",flex:1}));function s(){n.emit("newFunctionChanged")}function d(){}function o(){n.emit("close",null)}function c(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function v(){return e.createVNode("div",{class:"f-page-internals-new-command"},[l.value&&e.createVNode("div",{class:"f-page-internals-new-command-func2"},[e.createVNode("div",{class:"f-icon f-icon-new-edit",style:p.value},null),e.createVNode("div",{class:"f-function-class",onClick:()=>s()},[e.createTextVNode("添加新方法")])]),h.value&&void 0])}function f(E){n.emit("selectMethod",E)}function S(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(Be,{controllers:a.value,onSelectMethod:f},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[S(),c(),v(),c(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:o},[e.createTextVNode("取消")])])])}}),De={command:{type:Object,default:{}}},ke=e.defineComponent({name:"FParameterEditor",props:De,emits:["confirm","change"],setup(t,n){const r=e.ref(t.command),a=e.ref(0),u=e.ref(!1),m=e.ref(!1);e.ref(""),e.ref([]);const l=e.computed(()=>r.value!==null),h=e.computed(()=>u.value),p=e.computed(()=>m.value),s=e.computed(()=>!u.value&&!m.value),d=e.ref(!1);function o(){}function c(){return e.createVNode("div",null,[e.createVNode("div",{title:"'方法已被移除,请重新绑定'",class:"f-icon f-icon-flowline-warning",style:"font-size: 13px;margin-right:10px; color: red;width: 30px;height: 20px;text-align: center;",onClick:()=>void 0},null)])}function v(){}function f(){return e.createVNode("div",null,[e.createVNode("div",{title:"'方法已被删除,请绑定其他方法'",class:"f-icon f-icon-flowline-warning",style:"font-size: 13px;margin-right:10px; color: red;width: 30px;height: 20px;text-align: center;",onClick:()=>void 0},null)])}function S(w){d.value=!d.value}function E(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>S(a.value)},null)])}function b(w,D){D.value=w}function V(){n.emit("change",r.value)}function y(w){var F,R,$,k,Z,I,K,ee,ne,te,oe,ae,re,ce;w.context.generalData;const D=e.reactive(w.context.data),{assembleSchemaFieldsByComponent:P,assembleOutline:T,assembleStateVariables:_}=w.context.generalData;return e.createVNode(le,{modelValue:w.value,"onUpdate:modelValue":j=>w.value=j,data:D,fieldData:P(),formData:T(),varData:_(),editorType:((R=(F=w==null?void 0:w.origin)==null?void 0:F.controlSource)==null?void 0:R.type)||"Default",idField:((I=(Z=(k=($=w==null?void 0:w.origin)==null?void 0:$.controlSource)==null?void 0:k.context)==null?void 0:Z.valueField)==null?void 0:I.value)||((te=(ne=(ee=(K=w==null?void 0:w.origin)==null?void 0:K.controlSource)==null?void 0:ee.context)==null?void 0:ne.idField)==null?void 0:te.value)||"id",textField:((ce=(re=(ae=(oe=w==null?void 0:w.origin)==null?void 0:oe.controlSource)==null?void 0:ae.context)==null?void 0:re.textField)==null?void 0:ce.value)||"label",onConfirm:j=>{b(j,w),V()},onValueChange:j=>{b(j,w),V()}},null)}function M(){var w;return(w=r.value.property)==null?void 0:w.map((D,P)=>{const T=e.reactive({content:D.description,placement:"top"});return e.createVNode("div",{key:D.name+P},[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[D.shownName,D.description&&e.withDirectives(e.createVNode("div",{class:"ml-2 farris-label-tips"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),T]])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[y(D)])])})}function i(w){d.value=!1,n.emit("confirm")}function g(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-btn"},[e.createVNode("div",{class:"btn-finish",onClick:()=>i(a.value)},[e.createTextVNode("完成")])])])}function N(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[M()])}function B(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",title:r.value.label},[r.value.name]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[h.value&&c(),p.value&&f(),s.value&&E()])]),d.value&&N(),d.value&&g()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[l.value&&B()])}}),Q=e.defineComponent({name:"FInteractionItem",props:Me,emits:["addAction","delete","toggle"],setup(t,n){const r=e.inject("useMethodsComposition"),{toggleSelectingMethod:a,emitFinalState:u}=r,m=e.ref(t.controllers),l=e.ref(t.interaction),h=e.ref(t.displayOrder),p=e.computed(()=>{const i=l.value.showSwitch[0];return i.showSection[i.showSwitchNumber][2]}),s=e.computed(()=>{const i=!!l.value.command,g=l.value.showSwitch[0],N=g.showSection[g.showSwitchNumber][3];return i&&N}),d=e.computed(()=>({"f-icon":!0,"f-icon-arrow-chevron-down":s.value,"f-icon-arrow-chevron-left":!s.value}));function o(){n.emit("delete",h.value)}function c(){const i=l.value.showSwitch[0];i.showSection[i.showSwitchNumber][3]=!i.showSection[i.showSwitchNumber][3],n.emit("toggle",h.value)}function v(){if(l.value.command!==null){const g=l.value.showSwitch[0];a(g),n.emit("addAction",h.value)}}function f(i){i===null&&l.value.command===null&&n.emit("delete",h.value);const g=l.value.showSwitch[0];a(g)}function S(i){const{method:g,controller:N}=i,{id:B,label:w,name:D,handlerName:P,property:T,componentLists:_}=g,{controllerName:F}=N,R=!1,$=F.id;l.value.command={id:B,label:w,name:D,handlerName:P,hasPath:R,cmpId:$,property:T,componentLists:_},l.value.controller={id:F.id,label:F.label,name:F.name};const k=l.value.showSwitch[0];k.showSwitchNumber=2,k.showSection[k.showSwitchNumber][2]=!1,k.showSection[k.showSwitchNumber][3]=!0,u(!1,null)}function E(){l.value.command={id:"abandoned",label:"未绑定方法",name:"未绑定方法",property:[],hasPath:!1,handlerName:"未绑定方法",cmpId:"",shortcut:{},isRTCmd:void 0,isNewGenerated:void 0,extensions:[],isInvalid:!1},l.value.controller={label:"",name:"",id:""},u(!0,l.value.event);const i=l.value.showSwitch[0];a(i)}function b(){return e.createVNode(Le,{controllers:m.value,onClose:f,onSelectMethod:S,onNewFunctionChanged:()=>E()},null)}function V(){const i=l.value.showSwitch[0];i.showSection[i.showSwitchNumber][3]=!1}function y(i){l.value.command=C.cloneDeep(i),u(!1,null)}function M(){return e.createVNode(ke,{command:l.value.command,onConfirm:()=>V(),onChange:i=>y(i)},null)}return()=>e.createVNode("div",{class:"show-switch"},[e.createVNode("div",{class:"f-page-events-editor-bound-event"},[e.createVNode("div",{class:"f-page-events-editor-bound-event-name",title:l.value.event.label},[l.value.event.name]),e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:d.value,style:"font-size: 10px;",onClick:c},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",style:"font-size: 13px;float: right; margin:8px;",onClick:o},null),e.createVNode("div",{class:"f-icon f-icon-home-add",style:"float:right; font-size: 10px; margin:8px;",onClick:v},null)]),p.value&&b(),s.value&&M()])}});function X(t,n,r){const{interactions:a}=n,u=e.ref(t.value.internalCommandList);function m(f){a.value[f].showSwitch=[],a.value[f].showSwitch.push(C.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),a.value=C.cloneDeep(a.value)}function l(f,S,E){}function h(f){var E;const S=[];return(E=t.value.newController)==null||E.forEach(b=>{f.forEach(V=>{b.Code===V.controller.label&&S.push(C.cloneDeep(b))})}),S}function p(f=!1,S=null){var M;t.value.newFuncEvents=S?null:C.cloneDeep(S),t.value.isAddControllerMethod=f;const E=[],b=C.cloneDeep(t.value.internalCommandList);a.value.map(i=>{const g=C.cloneDeep(i.controller),N=C.cloneDeep(i.command),B=C.cloneDeep(i.event),w={controller:g,command:N,boundEvents:B};E.push(C.cloneDeep(w))});const V=(M=t.value.newController)!=null&&M.length&&E.length?C.cloneDeep(h(E)):[],y={viewModelId:t.value.viewModelId,savedCommand:C.cloneDeep(t.value.viewModel),boundEventsList:C.cloneDeep(E),events:C.cloneDeep(t.value.events),internalCommandList:C.cloneDeep(b),componentLists:[],relativePath:t.value.relativePath,envType:t.value.envType,newController:C.cloneDeep(V),isAddControllerMethod:t.value.isAddControllerMethod,repititionCommand:t.value.repititionCommand,preCommand:t.value.preCommand,newFuncEvents:t.value.newFuncEvents};r.emit("savedCommandListChanged",y)}function s(f){f.showSection[f.showSwitchNumber][2]=!0}function d(f){f.showSection[f.showSwitchNumber][2]=!1}function o(f){f.showSection[f.showSwitchNumber][3]=!0}function c(f){f.showSection[f.showSwitchNumber][3]=!1}function v(f){f.showSection[f.showSwitchNumber][2]?(d(f),o(f)):(s(f),c(f))}return{controllers:u,onClosed:m,emitFinalState:p,onCurrentCommandChanged:l,toggleSelectingMethod:v}}const O=e.defineComponent({name:"FEventsEditor",props:A,emits:["savedCommandListChanged"],setup(t,n){const r=e.ref(t.initialData),a=Y(r),{loadEvents:u,resetBoundEvents:m}=a,l=W(r,a),{addNewInteraction:h,deleteInteracton:p,interactions:s,loadInteractions:d}=l,o=X(r,l,n);e.provide("useEventsComposition",a),e.provide("useInteractionCompostion",l),e.provide("useMethodsComposition",o);function c(){r.value.isAddControllerMethod=!1}e.onMounted(()=>{c(),m(),u(),d()});function v(b){p(b)}function f(b,V){const y=b.showSwitch[0],M=y.showSection[y.showSwitchNumber][3];return e.createVNode(Q,{interaction:b,displayOrder:V,collapsed:M,onDelete:v},null)}function S(){var b;return(b=s.value)==null?void 0:b.map((V,y)=>e.createVNode("div",{class:"events-display-order",key:V.event.label},[f(V,y)]))}function E(b){h(b)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(J,{onClick:E},null),S()])])}});function Fe(t,n,r){var M;const a="",u="",m=e.ref();function l(){return(n==null?void 0:n.schema.componentType)!=="frame"}function h(){return!1}function p(){return(n==null?void 0:n.schema.componentType)!=="frame"}function s(){return(n==null?void 0:n.schema.componentType)==="frame"}function d(i){if(!i||!i.value)return null;if(i.value.schema&&i.value.schema.type==="component")return i.value;const g=e.ref(i==null?void 0:i.value.parent),N=d(g);return N||null}function o(i=n){const{componentInstance:g,designerItemElementRef:N}=i;return!g||!g.value?null:g.value.canMove?N:o(i.parent)}function c(i){return!!r}function v(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function f(){}function S(i,g){}function E(i,g){const{componentType:N}=i;let B=G(N,i,g);const w=N.toLowerCase().replace(/-/g,"_");return B&&!B.id&&B.type===N&&(B.id=`${w}_${Math.random().toString().slice(2,6)}`),B}function b(i){}function V(...i){}function y(){n!=null&&n.schema.contents&&n.schema.contents.map(i=>{var B;let g=i.id;i.type==="component-ref"&&(g=i.component);const N=t.value.querySelector(`#${g}-design-item`);(B=N==null?void 0:N.componentInstance)!=null&&B.value.onRemoveComponent&&N.componentInstance.value.onRemoveComponent()})}return m.value={canMove:l(),canSelectParent:h(),canDelete:p(),canNested:!s(),contents:n==null?void 0:n.schema.contents,elementRef:t,parent:(M=n==null?void 0:n.parent)==null?void 0:M.componentInstance,schema:n==null?void 0:n.schema,styles:a,designerClass:u,canAccepts:c,getBelongedComponentInstance:d,getDraggableDesignItemElement:o,getDraggingDisplayText:v,getPropConfig:V,getDragScopeElement:f,onAcceptMovedChildElement:S,onChildElementMovedOut:b,addNewChildComponentSchema:E,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1),onRemoveComponent:y},m}const Pe=e.defineComponent({name:"FEventsEditorDesign",props:A,emits:["savedCommandListChanged"],setup(t,n){const r=e.ref(t.initialData),a=Y(r),{loadEvents:u,resetBoundEvents:m}=a,l=W(r,a),{addNewInteraction:h,deleteInteracton:p,interactions:s,loadInteractions:d}=l,o=X(r,l,n);e.provide("useEventsComposition",a),e.provide("useInteractionCompostion",l),e.provide("useMethodsComposition",o);const c=e.ref(),v=e.inject("design-item-context"),f=Fe(c,v);e.onMounted(()=>{c.value.componentInstance=f,S(),m(),u(),d()}),n.expose(f.value);function S(){r.value.isAddControllerMethod=!1}function E(M){p(M)}function b(M,i){const g=M.showSwitch[0],N=g.showSection[g.showSwitchNumber][3];return e.createVNode(Q,{interaction:M,displayOrder:i,collapsed:N,onDelete:E},null)}function V(){var M;return(M=s.value)==null?void 0:M.map((i,g)=>e.createVNode("div",{class:"events-display-order",key:i.event.label},[b(i,g)]))}function y(M){h(M)}return()=>e.createVNode("div",{ref:c,class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(J,{onClick:y},null),V()])])}}),Te={install(t){t.component(O.name,O)},register(t,n,r,a){t["events-editor"]=O,n["events-editor"]=z},registerDesigner(t,n,r){t["events-editor"]=Pe,n["events-editor"]=z}};L.FEventsEditor=O,L.default=Te,L.eventsEditorProps=A,L.propsResolver=z,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(D,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("../notify/index.umd.js"),require("../schema-selector/index.umd.js"),require("../modal/index.umd.js"),require("../combo-list/index.umd.js"),require("../event-parameter/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../notify/index.umd.js","../schema-selector/index.umd.js","../modal/index.umd.js","../combo-list/index.umd.js","../event-parameter/index.umd.js"],e):(D=typeof globalThis<"u"?globalThis:D||self,e(D["events-editor"]={},D.Vue,D.LodashES,D.notify,null,null,null,D.FEventParameter))})(this,function(D,e,N,se,je,Oe,Re,le){"use strict";const H={},x={};function q(t){const{properties:n,title:a,ignore:o}=t,i=o&&Array.isArray(o),f=Object.keys(n).reduce((c,h)=>((!i||!o.find(p=>p===h))&&(c[h]=n[h].type==="object"&&n[h].properties?q(n[h]):N.cloneDeep(n[h].default)),c),{});if(a&&(!i||!o.find(c=>c==="id"))){const c=a.toLowerCase().replace(/-/g,"_");f.id=`${c}_${Math.random().toString().slice(2,6)}`}return f}function ie(t){const{properties:n,title:a,required:o}=t;if(o&&Array.isArray(o)){const i=o.reduce((f,c)=>(f[c]=n[c].type==="object"&&n[c].properties?q(n[c]):N.cloneDeep(n[c].default),f),{});if(a&&o.find(f=>f==="id")){const f=a.toLowerCase().replace(/-/g,"_");i.id=`${f}_${Math.random().toString().slice(2,6)}`}return i}return{type:a}}function G(t,n={},a){const o=H[t];if(o){let i=ie(o);const f=x[t];return i=f?f({getSchemaByType:G},i,n,a):i,i}return null}function de(t,n){const a=q(n);return Object.keys(a).reduce((o,i)=>(Object.prototype.hasOwnProperty.call(t,i)&&(o[i]&&N.isPlainObject(o[i])&&N.isPlainObject(t[i]||!t[i])?Object.assign(o[i],t[i]||{}):o[i]=t[i]),o),a),a}function ue(t,n){return Object.keys(t).filter(o=>t[o]!=null).reduce((o,i)=>{if(n.has(i)){const f=n.get(i);if(typeof f=="string")o[f]=t[i];else{const c=f(i,t[i],t);Object.assign(o,c)}}else o[i]=t[i];return o},{})}function fe(t,n,a=new Map){const o=de(t,n);return ue(o,a)}function me(t={}){function n(l,u,r,s){if(typeof r=="number")return s[l].length===r;if(typeof r=="object"){const v=Object.keys(r)[0],m=r[v];if(v==="not")return Number(s[l].length)!==Number(m);if(v==="moreThan")return Number(s[l].length)>=Number(m);if(v==="lessThan")return Number(s[l].length)<=Number(m)}return!1}function a(l,u,r,s){return s[l]&&s[l].propertyValue&&String(s[l].propertyValue.value)===String(r)}const o=new Map([["length",n],["getProperty",a]]);Object.keys(t).reduce((l,u)=>(l.set(u,t[u]),l),o);function i(l,u){const r=l;return typeof u=="number"?[{target:r,operator:"length",param:null,value:Number(u)}]:typeof u=="boolean"?[{target:r,operator:"getProperty",param:l,value:!!u}]:typeof u=="object"?Object.keys(u).map(s=>{if(s==="length")return{target:r,operator:"length",param:null,value:u[s]};const v=s,m=u[s];return{target:r,operator:"getProperty",param:v,value:m}}):[]}function f(l){return Object.keys(l).reduce((r,s)=>{const v=i(s,l[s]);return r.push(...v),r},[])}function c(l,u){if(o.has(l.operator)){const r=o.get(l.operator);return r&&r(l.target,l.param,l.value,u)||!1}return!1}function h(l,u){return f(l).reduce((v,m)=>v&&c(m,u),!0)}function p(l,u){const r=Object.keys(l),s=r.includes("allOf"),v=r.includes("anyOf"),m=s||v,b=(m?l[m?s?"allOf":"anyOf":"allOf"]:[l]).map(y=>h(y,u));return s?!b.includes(!1):b.includes(!0)}return{parseValueSchema:p}}const pe={},he={};me();function ve(t,n,a=new Map,o=(c,h,p,l)=>h,i={},f=c=>c){return H[n.title]=n,x[n.title]=o,pe[n.title]=i,he[n.title]=f,(c={})=>{const h=fe(c,n,a),p=Object.keys(t).reduce((l,u)=>(l[u]=t[u].default,l),{});return Object.assign(p,h)}}function we(t,n){return{customClass:n.class,customStyle:n.style}}const ge=new Map([["appearance",we]]);function be(t,n,a){return n}const Ne={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/events-editor.schema.json",title:"events-editor",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for events-editor",type:"string"},type:{description:"The type events of events-editor",type:"events",default:"events-editor"},initialData:{description:"",type:"object",default:{}}},required:["id","type"]},Ce={title:"events-editor",description:"A Farris Component",type:"object",categories:{}},U=[{label:"pageChange",name:"MockMock切换页码"},{label:"pageSizeChanged",name:"Mock分页条数变化事件"},{label:"scrollYLoad",name:"Mock滚动加载事件"},{label:"onEditClicked",name:"Mock操作列点击编辑"},{label:"onDeleteClicked",name:"Mock操作列点击删除"}],j={initialData:{type:Object,default:{propertyID:"data-grid-component-viewmodel",propertyType:"events",internalCommandList:[{controllerName:{id:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",label:"ListController",name:"列表控制器"},controllerList:[{id:"93ee1cd2-cf0b-40b3-b99f-958a3d1fad1c",label:"Load",name:"Mock加载数据",handlerName:"Load"},{id:"71ae8a4c-6202-4875-9246-2e2d959da37f",label:"Search",name:"Mock查询",handlerName:"Search"},{id:"77556491-41c0-4356-8ccf-25e39817060e",label:"Add",name:"Mock添加数据",handlerName:"Add"},{id:"52fdcac3-46c8-466e-aa5d-19920ece2076",label:"View",name:"Mock查看数据",handlerName:"View"},{id:"7ade9996-0531-4401-b1bc-fb9ec8ee3f8e",label:"Edit",name:"Mock编辑数据",handlerName:"Edit"},{id:"6d5a354f-871f-43e6-82bc-7837184380d3",label:"RemoveRows",name:"Mock删除选中行",handlerName:"RemoveRows"},{id:"1a1b7c33-38f0-469f-a017-223086ee6259",label:"ChangePage",name:"Mock切换页码",handlerName:"ChangePage"},{id:"debae2dd-3387-48cf-90ba-96e74ab5a8e5",label:"Remove",name:"Mock删除指定数据",handlerName:"Remove"}]}],events:U,boundEventsList:[],viewModel:[],componentLists:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],allComponentList:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],newController:[],isAddControllerMethod:!1,getEventList:()=>({events:U,boundEventsList:[]})}}},_=ve(j,Ne,ge,be,Ce);function W(t,n){const a=e.ref([]),{boundEvents:o,unBoundEvent:i}=n;function f(r){return{event:{label:r.boundEvents.label,name:r.boundEvents.name},showSwitch:[{showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2}],command:N.cloneDeep(r.command),controller:N.cloneDeep(r.controller)}}function c(){var r;a.value=(r=o.value)==null?void 0:r.map(s=>f(s))}function h(r){const v=f({boundEvents:r,command:null,controller:{id:"",name:"",label:""}});v.showSwitch[0].showSwitchNumber=1,v.showSwitch[0].showSection[2][3]=!0,a.value.unshift(v)}function p(){var r;(r=a.value)==null||r.forEach(s=>{s.showSwitch.forEach(v=>{v.showSection[2][3]=!1})})}function l(r){a.value[r].showSwitch.forEach(s=>{s.showSection[2][3]=!s.showSection[2][3]})}function u(r){if(r>=0&&r<=a.value.length-1){const s=a.value[r];i(s.event),a.value.splice(r,1)}}return{addNewInteraction:h,collapseInteractions:p,deleteInteracton:u,toggleMethodInInteraction:l,interactions:a,loadInteractions:c}}function Y(t){const n=e.ref([]),a=e.ref([]),o=e.ref([]);function i(){const u=a.value.reduce((s,v)=>(s.set(v.boundEvents.label,!0),s),new Map);return n.value.filter(s=>!u.has(s.label))}function f(){var r;const u=((r=a.value)==null?void 0:r.length)>0;o.value=u?i():n.value}function c(){n.value=t.value.events,a.value=t.value.boundEventsList,f()}function h(u){o.value=o.value.filter(r=>r.label!==u.label)}function p(u){a.value=a.value.filter(r=>r.boundEvents.label!==u.label),f()}function l(){var s;const u=(s=t.value)==null?void 0:s.getEventList(),{events:r}=u;u&&(t.value.events=N.cloneDeep(r),t.value.boundEventsList=u.boundEventsList),t.value.boundEventsList&&(t.value.boundEventsList=t.value.boundEventsList.filter(function(v){return r.find(m=>m.label===v.boundEvents.label)}))}return{allEvents:n,boundEvents:a,candidateEvents:o,excludeFromCandidates:h,loadEvents:c,resetBoundEvents:l,unBoundEvent:p}}const Se={},Ee={events:{type:Array,default:[]}},Me=e.defineComponent({name:"FEventList",props:Ee,emits:["click"],setup(t,n){const a=e.ref(t.events);function o(f){n.emit("click",f)}function i(f){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>o(f),class:"f-page-events-editor-first-bound-event-name"},[f.name])])}return()=>e.createVNode("div",{class:"f-page-events-editor-events"},[a.value.map(f=>i(f))])}}),J=e.defineComponent({name:"FInteractionButton",props:Se,emits:["click"],setup(t,n){const a=new se.FNotifyService,o=e.inject("useEventsComposition"),i=e.inject("useInteractionCompostion"),{candidateEvents:f}=o,{collapseInteractions:c}=i,h=e.ref(!1);function p(s){f.value=f.value.filter(v=>v.label!==s.label)}function l(s=!1){h.value=s}function u(s){l(),p(s),n.emit("click",s)}function r(){if(f.value.length===0){a.info({position:"top-center",message:"事件已全部绑定"});return}c(),l(!h.value)}return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-page-events-editor-top-button"},[e.createVNode("button",{class:"f-page-events-editor-button",onClick:r},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),h.value&&e.createVNode(Me,{events:f.value,onClick:u},null)])}}),Ve={collapsed:{type:Boolean,default:!0},displayOrder:{type:Number,default:-1},interaction:{type:Object,default:{}},controllers:{type:Array,default:[]}},ye={initialData:{Type:Object,default:{}},originalData:{Type:Object,default:{}},newImport:{Type:Boolean,default:!1},addInternalCommandList:{Type:Array,default:[]},outerLayerValue:{Type:Number,default:0},exit:{Type:Number,default:-1},haveBoundcommand:{Type:Boolean,default:!1}},Be={controllers:{type:Array,default:[]}},De=e.defineComponent({name:"FCommandList",props:Be,emits:["selectMethod"],setup(t,n){const a=e.ref(t.controllers);function o(p){return p.controllerList.length!==0}function i(p){return o(p)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:p.controllerName.name},[p.controllerName.name])])}function f(p,l){n.emit("selectMethod",{method:p,controller:l})}function c(p){return p.controllerList.map(l=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>f(l,p)},[e.createVNode("div",{class:"f-page-internals-command-name",title:l.label},[l.name])]))}function h(p){return e.createVNode("div",null,[i(p),c(p)])}return()=>e.createVNode("div",{class:"f-page-internals"},[a.value.map(p=>h(p))])}}),Le=e.defineComponent({name:"FCommandSource",props:ye,emits:["addInternalCommandListChanged","newImportChanged","currentCommandChanged","originalDataChanged","click","existChanged","newFunctionChanged","close","selectMethod"],setup(t,n){const a=e.inject("useMethodsComposition"),{controllers:o}=a,i=e.ref(!1),f=e.ref(t.canAddNewMethod),c=e.computed(()=>!f.value),h=e.computed(()=>i.value),p=e.computed(()=>({"font-size":"15px",margin:"5px",color:"#226eff",flex:1}));function l(){n.emit("newFunctionChanged")}function u(){}function r(){n.emit("close",null)}function s(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function v(){return e.createVNode("div",{class:"f-page-internals-new-command"},[c.value&&e.createVNode("div",{class:"f-page-internals-new-command-func2"},[e.createVNode("div",{class:"f-icon f-icon-new-edit",style:p.value},null),e.createVNode("div",{class:"f-function-class",onClick:()=>l()},[e.createTextVNode("添加新方法")])]),h.value&&void 0])}function m(E){n.emit("selectMethod",E)}function S(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(De,{controllers:o.value,onSelectMethod:m},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[S(),s(),v(),s(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:r},[e.createTextVNode("取消")])])])}}),ke={command:{type:Object,default:{}}},Fe=e.defineComponent({name:"FParameterEditor",props:ke,emits:["confirm","change"],setup(t,n){const a=e.ref(t.command),o=e.ref(0),i=e.ref(!1),f=e.ref(!1);e.ref(""),e.ref([]);const c=e.computed(()=>a.value!==null),h=e.computed(()=>i.value),p=e.computed(()=>f.value),l=e.computed(()=>!i.value&&!f.value),u=e.ref(!1);function r(){}function s(){return e.createVNode("div",null,[e.createVNode("div",{title:"'方法已被移除,请重新绑定'",class:"f-icon f-icon-flowline-warning",style:"font-size: 13px;margin-right:10px; color: red;width: 30px;height: 20px;text-align: center;",onClick:()=>void 0},null)])}function v(){}function m(){return e.createVNode("div",null,[e.createVNode("div",{title:"'方法已被删除,请绑定其他方法'",class:"f-icon f-icon-flowline-warning",style:"font-size: 13px;margin-right:10px; color: red;width: 30px;height: 20px;text-align: center;",onClick:()=>void 0},null)])}function S(w){u.value=!u.value}function E(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>S(o.value)},null)])}function b(w,L){L.value=w}function V(){n.emit("change",a.value)}function y(w){var F,R,$,k,Z,I,K,ee,ne,te,oe,re,ae,ce;w.context.generalData;const L=e.reactive(w.context.data),{assembleSchemaFieldsByComponent:P,assembleOutline:T,assembleStateVariables:z}=w.context.generalData;return e.createVNode(le,{modelValue:w.value,"onUpdate:modelValue":A=>w.value=A,data:L,fieldData:P(),formData:T(),varData:z(),editorType:((R=(F=w==null?void 0:w.origin)==null?void 0:F.controlSource)==null?void 0:R.type)||"Default",idField:((I=(Z=(k=($=w==null?void 0:w.origin)==null?void 0:$.controlSource)==null?void 0:k.context)==null?void 0:Z.valueField)==null?void 0:I.value)||((te=(ne=(ee=(K=w==null?void 0:w.origin)==null?void 0:K.controlSource)==null?void 0:ee.context)==null?void 0:ne.idField)==null?void 0:te.value)||"id",textField:((ce=(ae=(re=(oe=w==null?void 0:w.origin)==null?void 0:oe.controlSource)==null?void 0:re.context)==null?void 0:ae.textField)==null?void 0:ce.value)||"label",onConfirm:A=>{b(A,w),V()},onValueChange:A=>{b(A,w),V()}},null)}function M(){var w;return(w=a.value.property)==null?void 0:w.map((L,P)=>{const T=e.reactive({content:L.description,placement:"top"});return e.createVNode("div",{key:L.name+P},[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[L.shownName,L.description&&e.withDirectives(e.createVNode("div",{class:"ml-2 farris-label-tips"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),T]])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[y(L)])])})}function d(w){u.value=!1,n.emit("confirm")}function g(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-btn"},[e.createVNode("div",{class:"btn-finish",onClick:()=>d(o.value)},[e.createTextVNode("完成")])])])}function C(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[M()])}function B(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",title:a.value.label},[a.value.name]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[h.value&&s(),p.value&&m(),l.value&&E()])]),u.value&&C(),u.value&&g()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[c.value&&B()])}}),Q=e.defineComponent({name:"FInteractionItem",props:Ve,emits:["addAction","delete","toggle"],setup(t,n){const a=e.inject("useMethodsComposition"),{toggleSelectingMethod:o,emitFinalState:i}=a,f=e.ref(t.controllers),c=e.ref(t.interaction),h=e.ref(t.displayOrder),p=e.computed(()=>{const d=c.value.showSwitch[0];return d.showSection[d.showSwitchNumber][2]}),l=e.computed(()=>{const d=!!c.value.command,g=c.value.showSwitch[0],C=g.showSection[g.showSwitchNumber][3];return d&&C}),u=e.computed(()=>({"f-icon":!0,"f-icon-arrow-chevron-down":l.value,"f-icon-arrow-chevron-left":!l.value}));function r(){n.emit("delete",h.value)}function s(){const d=c.value.showSwitch[0];d.showSection[d.showSwitchNumber][3]=!d.showSection[d.showSwitchNumber][3],n.emit("toggle",h.value)}function v(){if(c.value.command!==null){const g=c.value.showSwitch[0];o(g),n.emit("addAction",h.value)}}function m(d){d===null&&c.value.command===null&&n.emit("delete",h.value);const g=c.value.showSwitch[0];o(g)}function S(d){const{method:g,controller:C}=d,{id:B,label:w,name:L,handlerName:P,property:T,componentLists:z}=g,{controllerName:F}=C,R=!1,$=F.id;c.value.command={id:B,label:w,name:L,handlerName:P,hasPath:R,cmpId:$,property:T,componentLists:z},c.value.controller={id:F.id,label:F.label,name:F.name};const k=c.value.showSwitch[0];k.showSwitchNumber=2,k.showSection[k.showSwitchNumber][2]=!1,k.showSection[k.showSwitchNumber][3]=!0,i(!1,null)}function E(){c.value.command={id:"abandoned",label:"未绑定方法",name:"未绑定方法",property:[],hasPath:!1,handlerName:"未绑定方法",cmpId:"",shortcut:{},isRTCmd:void 0,isNewGenerated:void 0,extensions:[],isInvalid:!1},c.value.controller={label:"",name:"",id:""},i(!0,c.value.event);const d=c.value.showSwitch[0];o(d)}function b(){return e.createVNode(Le,{controllers:f.value,onClose:m,onSelectMethod:S,onNewFunctionChanged:()=>E()},null)}function V(){const d=c.value.showSwitch[0];d.showSection[d.showSwitchNumber][3]=!1}function y(d){c.value.command=N.cloneDeep(d),i(!1,null)}function M(){return e.createVNode(Fe,{command:c.value.command,onConfirm:()=>V(),onChange:d=>y(d)},null)}return()=>e.createVNode("div",{class:"show-switch"},[e.createVNode("div",{class:"f-page-events-editor-bound-event"},[e.createVNode("div",{class:"f-page-events-editor-bound-event-name",title:c.value.event.label},[c.value.event.name]),e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:u.value,style:"font-size: 10px;",onClick:s},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",style:"font-size: 13px;float: right; margin:8px;",onClick:r},null),e.createVNode("div",{class:"f-icon f-icon-home-add",style:"float:right; font-size: 10px; margin:8px;",onClick:v},null)]),p.value&&b(),l.value&&M()])}});function X(t,n,a){const{interactions:o}=n,i=e.ref(t.value.internalCommandList);function f(m){o.value[m].showSwitch=[],o.value[m].showSwitch.push(N.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),o.value=N.cloneDeep(o.value)}function c(m,S,E){}function h(m){var E;const S=[];return(E=t.value.newController)==null||E.forEach(b=>{m.forEach(V=>{b.Code===V.controller.label&&S.push(N.cloneDeep(b))})}),S}function p(m=!1,S=null){var M;t.value.newFuncEvents=S?null:N.cloneDeep(S),t.value.isAddControllerMethod=m;const E=[],b=N.cloneDeep(t.value.internalCommandList);o.value.map(d=>{const g=N.cloneDeep(d.controller),C=N.cloneDeep(d.command),B=N.cloneDeep(d.event),w={controller:g,command:C,boundEvents:B};E.push(N.cloneDeep(w))});const V=(M=t.value.newController)!=null&&M.length&&E.length?N.cloneDeep(h(E)):[],y={viewModelId:t.value.viewModelId,savedCommand:N.cloneDeep(t.value.viewModel),boundEventsList:N.cloneDeep(E),events:N.cloneDeep(t.value.events),internalCommandList:N.cloneDeep(b),componentLists:[],relativePath:t.value.relativePath,envType:t.value.envType,newController:N.cloneDeep(V),isAddControllerMethod:t.value.isAddControllerMethod,repititionCommand:t.value.repititionCommand,preCommand:t.value.preCommand,newFuncEvents:t.value.newFuncEvents};a.emit("savedCommandListChanged",y)}function l(m){m.showSection[m.showSwitchNumber][2]=!0}function u(m){m.showSection[m.showSwitchNumber][2]=!1}function r(m){m.showSection[m.showSwitchNumber][3]=!0}function s(m){m.showSection[m.showSwitchNumber][3]=!1}function v(m){m.showSection[m.showSwitchNumber][2]?(u(m),r(m)):(l(m),s(m))}return{controllers:i,onClosed:f,emitFinalState:p,onCurrentCommandChanged:c,toggleSelectingMethod:v}}const O=e.defineComponent({name:"FEventsEditor",props:j,emits:["savedCommandListChanged"],setup(t,n){const a=e.ref(t.initialData),o=Y(a),{loadEvents:i,resetBoundEvents:f}=o,c=W(a,o),{addNewInteraction:h,deleteInteracton:p,interactions:l,loadInteractions:u}=c,r=X(a,c,n);e.provide("useEventsComposition",o),e.provide("useInteractionCompostion",c),e.provide("useMethodsComposition",r);function s(){a.value.isAddControllerMethod=!1}e.onMounted(()=>{s(),f(),i(),u()});function v(b){p(b)}function m(b,V){const y=b.showSwitch[0],M=y.showSection[y.showSwitchNumber][3];return e.createVNode(Q,{interaction:b,displayOrder:V,collapsed:M,onDelete:v},null)}function S(){var b;return(b=l.value)==null?void 0:b.map((V,y)=>e.createVNode("div",{class:"events-display-order",key:V.event.label},[m(V,y)]))}function E(b){h(b)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(J,{onClick:E},null),S()])])}});function Pe(t,n,a){var M;const o="",i="",f=e.ref();function c(){return(n==null?void 0:n.schema.componentType)!=="frame"}function h(){return!1}function p(){return(n==null?void 0:n.schema.componentType)!=="frame"}function l(){return(n==null?void 0:n.schema.componentType)==="frame"}function u(d){if(!d||!d.value)return null;if(d.value.schema&&d.value.schema.type==="component")return d.value;const g=e.ref(d==null?void 0:d.value.parent),C=u(g);return C||null}function r(d=n){const{componentInstance:g,designerItemElementRef:C}=d;return!g||!g.value?null:g.value.canMove?C:r(d.parent)}function s(d){return!!a}function v(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function m(){}function S(d,g){}function E(d,g){const{componentType:C}=d;let B=G(C,d,g);const w=C.toLowerCase().replace(/-/g,"_");return B&&!B.id&&B.type===C&&(B.id=`${w}_${Math.random().toString().slice(2,6)}`),B}function b(d){}function V(...d){}function y(){n!=null&&n.schema.contents&&n.schema.contents.map(d=>{var B;let g=d.id;d.type==="component-ref"&&(g=d.component);const C=t.value.querySelector(`#${g}-design-item`);(B=C==null?void 0:C.componentInstance)!=null&&B.value.onRemoveComponent&&C.componentInstance.value.onRemoveComponent()})}return f.value={canMove:c(),canSelectParent:h(),canDelete:p(),canNested:!l(),contents:n==null?void 0:n.schema.contents,elementRef:t,parent:(M=n==null?void 0:n.parent)==null?void 0:M.componentInstance,schema:n==null?void 0:n.schema,styles:o,designerClass:i,canAccepts:s,getBelongedComponentInstance:u,getDraggableDesignItemElement:r,getDraggingDisplayText:v,getPropConfig:V,getDragScopeElement:m,onAcceptMovedChildElement:S,onChildElementMovedOut:b,addNewChildComponentSchema:E,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1),onRemoveComponent:y},f}const Te=e.defineComponent({name:"FEventsEditorDesign",props:j,emits:["savedCommandListChanged"],setup(t,n){const a=e.ref(t.initialData),o=Y(a),{loadEvents:i,resetBoundEvents:f}=o,c=W(a,o),{addNewInteraction:h,deleteInteracton:p,interactions:l,loadInteractions:u}=c,r=X(a,c,n);e.provide("useEventsComposition",o),e.provide("useInteractionCompostion",c),e.provide("useMethodsComposition",r);const s=e.ref(),v=e.inject("design-item-context"),m=Pe(s,v);e.onMounted(()=>{s.value.componentInstance=m,S(),f(),i(),u()}),n.expose(m.value);function S(){a.value.isAddControllerMethod=!1}function E(M){p(M)}function b(M,d){const g=M.showSwitch[0],C=g.showSection[g.showSwitchNumber][3];return e.createVNode(Q,{interaction:M,displayOrder:d,collapsed:C,onDelete:E},null)}function V(){var M;return(M=l.value)==null?void 0:M.map((d,g)=>e.createVNode("div",{class:"events-display-order",key:d.event.label},[b(d,g)]))}function y(M){h(M)}return()=>e.createVNode("div",{ref:s,class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(J,{onClick:y},null),V()])])}}),Ae={install(t){t.component(O.name,O)},register(t,n,a,o){t["events-editor"]=O,n["events-editor"]=_},registerDesigner(t,n,a){t["events-editor"]=Te,n["events-editor"]=_}};D.FEventsEditor=O,D.default=Ae,D.eventsEditorProps=j,D.propsResolver=_,Object.defineProperties(D,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { defineComponent as F, ref as
|
|
1
|
+
import { defineComponent as F, ref as P, onMounted as D, createVNode as u, resolveComponent as y, createTextVNode as x, Fragment as N } from "vue";
|
|
2
2
|
import { isPlainObject as O, cloneDeep as R } from "lodash-es";
|
|
3
3
|
const $ = {}, T = {};
|
|
4
|
-
function M(
|
|
5
|
-
const { properties:
|
|
4
|
+
function M(t) {
|
|
5
|
+
const { properties: n, title: a, ignore: r } = t, s = r && Array.isArray(r), d = Object.keys(n).reduce((l, p) => ((!s || !r.find((m) => m === p)) && (l[p] = n[p].type === "object" && n[p].properties ? M(n[p]) : R(n[p].default)), l), {});
|
|
6
6
|
if (a && (!s || !r.find((l) => l === "id"))) {
|
|
7
7
|
const l = a.toLowerCase().replace(/-/g, "_");
|
|
8
8
|
d.id = `${l}_${Math.random().toString().slice(2, 6)}`;
|
|
9
9
|
}
|
|
10
10
|
return d;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const a = M(
|
|
14
|
-
return Object.keys(a).reduce((r, s) => (r[s] && O(r[s]) && O(
|
|
12
|
+
function w(t, n) {
|
|
13
|
+
const a = M(n);
|
|
14
|
+
return Object.keys(a).reduce((r, s) => (Object.prototype.hasOwnProperty.call(t, s) && (r[s] && O(r[s]) && O(t[s] || !t[s]) ? Object.assign(r[s], t[s] || {}) : r[s] = t[s]), r), a), a;
|
|
15
15
|
}
|
|
16
|
-
function v(
|
|
17
|
-
return Object.keys(
|
|
18
|
-
if (
|
|
19
|
-
const d =
|
|
16
|
+
function v(t, n) {
|
|
17
|
+
return Object.keys(t).filter((r) => t[r] != null).reduce((r, s) => {
|
|
18
|
+
if (n.has(s)) {
|
|
19
|
+
const d = n.get(s);
|
|
20
20
|
if (typeof d == "string")
|
|
21
|
-
r[d] =
|
|
21
|
+
r[d] = t[s];
|
|
22
22
|
else {
|
|
23
|
-
const l = d(s,
|
|
23
|
+
const l = d(s, t[s], t);
|
|
24
24
|
Object.assign(r, l);
|
|
25
25
|
}
|
|
26
26
|
} else
|
|
27
|
-
r[s] =
|
|
27
|
+
r[s] = t[s];
|
|
28
28
|
return r;
|
|
29
29
|
}, {});
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
const r =
|
|
31
|
+
function V(t, n, a = /* @__PURE__ */ new Map()) {
|
|
32
|
+
const r = w(t, n);
|
|
33
33
|
return v(r, a);
|
|
34
34
|
}
|
|
35
|
-
function k(
|
|
36
|
-
function
|
|
35
|
+
function k(t = {}) {
|
|
36
|
+
function n(e, o, i, c) {
|
|
37
37
|
if (typeof i == "number")
|
|
38
38
|
return c[e].length === i;
|
|
39
39
|
if (typeof i == "object") {
|
|
@@ -51,10 +51,10 @@ function k(n = {}) {
|
|
|
51
51
|
return c[e] && c[e].propertyValue && String(c[e].propertyValue.value) === String(i);
|
|
52
52
|
}
|
|
53
53
|
const r = /* @__PURE__ */ new Map([
|
|
54
|
-
["length",
|
|
54
|
+
["length", n],
|
|
55
55
|
["getProperty", a]
|
|
56
56
|
]);
|
|
57
|
-
Object.keys(
|
|
57
|
+
Object.keys(t).reduce((e, o) => (e.set(o, t[o]), e), r);
|
|
58
58
|
function s(e, o) {
|
|
59
59
|
const i = e;
|
|
60
60
|
return typeof o == "number" ? [{ target: i, operator: "length", param: null, value: Number(o) }] : typeof o == "boolean" ? [{ target: i, operator: "getProperty", param: e, value: !!o }] : typeof o == "object" ? Object.keys(o).map((c) => {
|
|
@@ -88,20 +88,20 @@ function k(n = {}) {
|
|
|
88
88
|
}
|
|
89
89
|
const q = {}, z = {};
|
|
90
90
|
k();
|
|
91
|
-
function B(
|
|
92
|
-
return $[
|
|
93
|
-
const p =
|
|
91
|
+
function B(t, n, a = /* @__PURE__ */ new Map(), r = (l, p, m, e) => p, s = {}, d = (l) => l) {
|
|
92
|
+
return $[n.title] = n, T[n.title] = r, q[n.title] = s, z[n.title] = d, (l = {}) => {
|
|
93
|
+
const p = V(l, n, a), m = Object.keys(t).reduce((e, o) => (e[o] = t[o].default, e), {});
|
|
94
94
|
return Object.assign(m, p);
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function I(
|
|
98
|
-
return { customClass:
|
|
97
|
+
function I(t, n) {
|
|
98
|
+
return { customClass: n.class, customStyle: n.style };
|
|
99
99
|
}
|
|
100
100
|
const L = /* @__PURE__ */ new Map([
|
|
101
101
|
["appearance", I]
|
|
102
102
|
]);
|
|
103
|
-
function H(
|
|
104
|
-
return
|
|
103
|
+
function H(t, n, a) {
|
|
104
|
+
return n;
|
|
105
105
|
}
|
|
106
106
|
const _ = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-design.gitee.io/expression-editor.schema.json", G = "expression-editor", J = "A Farris Expression Editor Component", Q = "object", S = {
|
|
107
107
|
id: {
|
|
@@ -165,9 +165,9 @@ const _ = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-de
|
|
|
165
165
|
name: "FExpressionEditor",
|
|
166
166
|
props: E,
|
|
167
167
|
emits: [],
|
|
168
|
-
setup(
|
|
169
|
-
const a =
|
|
170
|
-
return
|
|
168
|
+
setup(t, n) {
|
|
169
|
+
const a = P();
|
|
170
|
+
return D(() => {
|
|
171
171
|
}), () => u("div", {
|
|
172
172
|
ref: a,
|
|
173
173
|
class: "d-flex h-100 f-utils-flex-column",
|
|
@@ -213,18 +213,18 @@ const _ = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-de
|
|
|
213
213
|
name: "FExpressionEditorDesign",
|
|
214
214
|
props: E,
|
|
215
215
|
emits: [],
|
|
216
|
-
setup(
|
|
217
|
-
return () => u(
|
|
216
|
+
setup(t, n) {
|
|
217
|
+
return () => u(N, null, [x("expression editor design")]);
|
|
218
218
|
}
|
|
219
219
|
}), ce = {
|
|
220
|
-
install(
|
|
221
|
-
|
|
220
|
+
install(t) {
|
|
221
|
+
t.component(b.name, b);
|
|
222
222
|
},
|
|
223
|
-
register(
|
|
224
|
-
|
|
223
|
+
register(t, n, a, r) {
|
|
224
|
+
t["expression-editor"] = b, n["expression-editor"] = j;
|
|
225
225
|
},
|
|
226
|
-
registerDesigner(
|
|
227
|
-
|
|
226
|
+
registerDesigner(t, n, a) {
|
|
227
|
+
t["expression-editor"] = ne, n["expression-editor"] = j;
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
230
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f["expression-editor"]={},f.Vue,f.LodashES))})(this,function(f,e,
|
|
1
|
+
(function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f["expression-editor"]={},f.Vue,f.LodashES))})(this,function(f,e,h){"use strict";const O={},j={};function N(r){const{properties:n,title:l,ignore:o}=r,s=o&&Array.isArray(o),g=Object.keys(n).reduce((p,u)=>((!s||!o.find(y=>y===u))&&(p[u]=n[u].type==="object"&&n[u].properties?N(n[u]):h.cloneDeep(n[u].default)),p),{});if(l&&(!s||!o.find(p=>p==="id"))){const p=l.toLowerCase().replace(/-/g,"_");g.id=`${p}_${Math.random().toString().slice(2,6)}`}return g}function C(r,n){const l=N(n);return Object.keys(l).reduce((o,s)=>(Object.prototype.hasOwnProperty.call(r,s)&&(o[s]&&h.isPlainObject(o[s])&&h.isPlainObject(r[s]||!r[s])?Object.assign(o[s],r[s]||{}):o[s]=r[s]),o),l),l}function M(r,n){return Object.keys(r).filter(o=>r[o]!=null).reduce((o,s)=>{if(n.has(s)){const g=n.get(s);if(typeof g=="string")o[g]=r[s];else{const p=g(s,r[s],r);Object.assign(o,p)}}else o[s]=r[s];return o},{})}function T(r,n,l=new Map){const o=C(r,n);return M(o,l)}function $(r={}){function n(t,i,c,a){if(typeof c=="number")return a[t].length===c;if(typeof c=="object"){const d=Object.keys(c)[0],m=c[d];if(d==="not")return Number(a[t].length)!==Number(m);if(d==="moreThan")return Number(a[t].length)>=Number(m);if(d==="lessThan")return Number(a[t].length)<=Number(m)}return!1}function l(t,i,c,a){return a[t]&&a[t].propertyValue&&String(a[t].propertyValue.value)===String(c)}const o=new Map([["length",n],["getProperty",l]]);Object.keys(r).reduce((t,i)=>(t.set(i,r[i]),t),o);function s(t,i){const c=t;return typeof i=="number"?[{target:c,operator:"length",param:null,value:Number(i)}]:typeof i=="boolean"?[{target:c,operator:"getProperty",param:t,value:!!i}]:typeof i=="object"?Object.keys(i).map(a=>{if(a==="length")return{target:c,operator:"length",param:null,value:i[a]};const d=a,m=i[a];return{target:c,operator:"getProperty",param:d,value:m}}):[]}function g(t){return Object.keys(t).reduce((c,a)=>{const d=s(a,t[a]);return c.push(...d),c},[])}function p(t,i){if(o.has(t.operator)){const c=o.get(t.operator);return c&&c(t.target,t.param,t.value,i)||!1}return!1}function u(t,i){return g(t).reduce((d,m)=>d&&p(m,i),!0)}function y(t,i){const c=Object.keys(t),a=c.includes("allOf"),d=c.includes("anyOf"),m=a||d,V=(m?t[m?a?"allOf":"anyOf":"allOf"]:[t]).map(B=>u(B,i));return a?!V.includes(!1):V.includes(!0)}return{parseValueSchema:y}}const P={},F={};$();function A(r,n,l=new Map,o=(p,u,y,t)=>u,s={},g=p=>p){return O[n.title]=n,j[n.title]=o,P[n.title]=s,F[n.title]=g,(p={})=>{const u=T(p,n,l),y=Object.keys(r).reduce((t,i)=>(t[i]=r[i].default,t),{});return Object.assign(y,u)}}function R(r,n){return{customClass:n.class,customStyle:n.style}}const D=new Map([["appearance",R]]);function w(r,n,l){return n}const q={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/expression-editor.schema.json",title:"expression-editor",description:"A Farris Expression Editor Component",type:"object",properties:{id:{description:"The unique identifier for a Expression Editor",type:"string"},type:{description:"The type string of Expression Editor component",type:"string",default:"expression-editor"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}}},required:["id","type"]},k={title:"expression-editor",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"类型",title:"类型",type:"string",readonly:!0}}}}},x={},E=A(x,q,D,w,k),b=e.defineComponent({name:"FExpressionEditor",props:x,emits:[],setup(r,n){const l=e.ref();return e.onMounted(()=>{}),()=>e.createVNode("div",{ref:l,class:"d-flex h-100 f-utils-flex-column",style:"min-height:450px"},[e.createVNode(e.resolveComponent("f-layout"),{class:"flex-column"},{default:()=>[e.createVNode(e.resolveComponent("f-layout-pane"),{"custom-class":"position-relative",position:"top",minHeight:120},{default:()=>[e.createVNode("div",{class:"f-utils-absolute-all bg-info",style:"opacity:0.2;z-index: -1;"},null),e.createVNode("p",null,[e.createTextVNode("头部区域")])]}),e.createVNode(e.resolveComponent("f-layout-pane"),{position:"center"},{default:()=>[e.createVNode(e.resolveComponent("f-layout"),null,{default:()=>[e.createVNode(e.resolveComponent("f-layout-pane"),{position:"left",minWidth:200,width:400},{default:()=>[e.createVNode("div",{class:"f-utils-absolute-all bg-info",style:"opacity:0.2;z-index: -1;"},null),e.createVNode("p",null,[e.createTextVNode("左侧区域")])]}),e.createVNode(e.resolveComponent("f-layout-pane"),{position:"center"},{default:()=>[e.createVNode("div",{class:"f-utils-absolute-all bg-danger",style:"opacity:0.2;z-index:-1"},null),e.createVNode("p",null,[e.createTextVNode("右侧区域")])]})]})]})]})])}}),L=e.defineComponent({name:"FExpressionEditorDesign",props:x,emits:[],setup(r,n){return()=>e.createVNode(e.Fragment,null,[e.createTextVNode("expression editor design")])}}),_={install(r){r.component(b.name,b)},register(r,n,l,o){r["expression-editor"]=b,n["expression-editor"]=E},registerDesigner(r,n,l){r["expression-editor"]=L,n["expression-editor"]=E}};f.ExpressionEditor=b,f.default=_,f.expressionEditorProps=x,f.propsResolver=E,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|