@farris/ui-vue 1.3.3 → 1.3.4

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.
Files changed (66) hide show
  1. package/components/binding-selector/index.esm.js +15 -15
  2. package/components/binding-selector/index.umd.cjs +1 -1
  3. package/components/condition/index.esm.js +107 -106
  4. package/components/condition/index.umd.cjs +1 -1
  5. package/components/data-grid/index.esm.js +1078 -1077
  6. package/components/data-grid/index.umd.cjs +1 -1
  7. package/components/data-view/index.esm.js +1272 -1272
  8. package/components/data-view/index.umd.cjs +1 -1
  9. package/components/designer-canvas/index.esm.js +4355 -3954
  10. package/components/designer-canvas/index.umd.cjs +1 -1
  11. package/components/dynamic-form/index.esm.js +601 -593
  12. package/components/dynamic-form/index.umd.cjs +1 -1
  13. package/components/event-parameter/index.esm.js +161 -117
  14. package/components/event-parameter/index.umd.cjs +1 -1
  15. package/components/events-editor/index.css +1 -1
  16. package/components/events-editor/index.esm.js +594 -575
  17. package/components/events-editor/index.umd.cjs +1 -1
  18. package/components/external-container/index.esm.js +771 -771
  19. package/components/external-container/index.umd.cjs +1 -1
  20. package/components/field-selector/index.esm.js +1268 -1268
  21. package/components/field-selector/index.umd.cjs +1 -1
  22. package/components/filter-bar/index.css +1 -1
  23. package/components/filter-bar/index.esm.js +3768 -3700
  24. package/components/filter-bar/index.umd.cjs +1 -1
  25. package/components/flow-canvas/index.esm.js +4274 -3873
  26. package/components/flow-canvas/index.umd.cjs +1 -1
  27. package/components/list-view/index.esm.js +935 -935
  28. package/components/list-view/index.umd.cjs +1 -1
  29. package/components/lookup/index.esm.js +1672 -1671
  30. package/components/lookup/index.umd.cjs +1 -1
  31. package/components/mapping-editor/index.esm.js +1107 -1106
  32. package/components/mapping-editor/index.umd.cjs +1 -1
  33. package/components/property-panel/index.css +1 -1
  34. package/components/query-solution/index.css +1 -1
  35. package/components/query-solution/index.esm.js +5721 -5490
  36. package/components/query-solution/index.umd.cjs +6 -6
  37. package/components/schema-selector/index.esm.js +974 -972
  38. package/components/schema-selector/index.umd.cjs +2 -2
  39. package/components/section/index.esm.js +2107 -417
  40. package/components/section/index.umd.cjs +1 -1
  41. package/components/tabs/index.esm.js +577 -575
  42. package/components/tabs/index.umd.cjs +1 -1
  43. package/components/textarea/index.esm.js +84 -79
  44. package/components/textarea/index.umd.cjs +1 -1
  45. package/components/tree-grid/index.esm.js +1554 -1554
  46. package/components/tree-grid/index.umd.cjs +1 -1
  47. package/components/tree-view/index.esm.js +1269 -1269
  48. package/components/tree-view/index.umd.cjs +1 -1
  49. package/farris.all.esm.js +17526 -17071
  50. package/farris.all.umd.cjs +13 -13
  51. package/index.css +1 -1
  52. package/package.json +1 -1
  53. package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +1 -2
  54. package/types/entity-binding-selector/composition/use-entity-tree.d.ts +14 -3
  55. package/types/entity-binding-selector/composition/use-field-tree.d.ts +28 -0
  56. package/types/event-parameter/src/composition/use-general-editor.d.ts +26 -0
  57. package/types/event-parameter/src/event-parameter.props.d.ts +4 -4
  58. package/types/events-editor/src/composition/types.d.ts +1 -1
  59. package/types/query-solution/src/composition/types.d.ts +55 -0
  60. package/types/query-solution/src/composition/use-condition.d.ts +19 -0
  61. package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +3 -2
  62. package/types/query-solution/src/designer/query-solution-config/converter/query-solution-config-property.converter.d.ts +4 -0
  63. package/types/section/index.d.ts +15 -0
  64. package/types/section/src/designer/section-header.design.component.d.ts +4 -0
  65. package/types/section/src/designer/section-toolbar-item.props.d.ts +19 -0
  66. package/types/section/src/designer/section-toolbar.design.component.d.ts +3 -0
@@ -1 +1 @@
1
- (function(B,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")):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"],e):(B=typeof globalThis<"u"?globalThis:B||self,e(B["events-editor"]={},B.Vue,B.LodashES,B.NotifyService))})(this,function(B,e,N,W){"use strict";const O={},R={};function A(t){const{properties:n,title:a,ignore:r}=t,d=r&&Array.isArray(r),f=Object.keys(n).reduce((i,v)=>((!d||!r.find(m=>m===v))&&(i[v]=n[v].type==="object"&&n[v].properties?A(n[v]):N.cloneDeep(n[v].default)),i),{});if(a&&(!d||!r.find(i=>i==="id"))){const i=a.toLowerCase().replace(/-/g,"_");f.id=`${i}_${Math.random().toString().slice(2,6)}`}return f}function $(t,n={},a){const r=O[t];if(r){let d=A(r);const f=R[t];return d=f?f({getSchemaByType:$},d,n,a):d,d}return null}function U(t,n){const a=A(n);return Object.keys(a).reduce((r,d)=>(r[d]&&N.isPlainObject(r[d])&&N.isPlainObject(t[d]||!t[d])?Object.assign(r[d],t[d]||{}):r[d]=t[d],r),a),a}function Y(t,n){return Object.keys(t).filter(r=>t[r]!=null).reduce((r,d)=>{if(n.has(d)){const f=n.get(d);if(typeof f=="string")r[f]=t[d];else{const i=f(d,t[d],t);Object.assign(r,i)}}else r[d]=t[d];return r},{})}function J(t,n,a=new Map){const r=U(t,n);return Y(r,a)}function Q(t={}){function n(c,l,o,s){if(typeof o=="number")return s[c].length===o;if(typeof o=="object"){const w=Object.keys(o)[0],u=o[w];if(w==="not")return Number(s[c].length)!==Number(u);if(w==="moreThan")return Number(s[c].length)>=Number(u);if(w==="lessThan")return Number(s[c].length)<=Number(u)}return!1}function a(c,l,o,s){return s[c]&&s[c].propertyValue&&String(s[c].propertyValue.value)===String(o)}const r=new Map([["length",n],["getProperty",a]]);Object.keys(t).reduce((c,l)=>(c.set(l,t[l]),c),r);function d(c,l){const o=c;return typeof l=="number"?[{target:o,operator:"length",param:null,value:Number(l)}]:typeof l=="boolean"?[{target:o,operator:"getProperty",param:c,value:!!l}]:typeof l=="object"?Object.keys(l).map(s=>{if(s==="length")return{target:o,operator:"length",param:null,value:l[s]};const w=s,u=l[s];return{target:o,operator:"getProperty",param:w,value:u}}):[]}function f(c){return Object.keys(c).reduce((o,s)=>{const w=d(s,c[s]);return o.push(...w),o},[])}function i(c,l){if(r.has(c.operator)){const o=r.get(c.operator);return o&&o(c.target,c.param,c.value,l)||!1}return!1}function v(c,l){return f(c).reduce((w,u)=>w&&i(u,l),!0)}function m(c,l){const o=Object.keys(c),s=o.includes("allOf"),w=o.includes("anyOf"),u=s||w,g=(u?c[u?s?"allOf":"anyOf":"allOf"]:[c]).map(E=>v(E,l));return s?!g.includes(!1):g.includes(!0)}return{parseValueSchema:m}}const X={},Z={};Q();function x(t,n,a=new Map,r=(i,v,m,c)=>v,d={},f=i=>i){return O[n.title]=n,R[n.title]=r,X[n.title]=d,Z[n.title]=f,(i={})=>{const v=J(i,n,a),m=Object.keys(t).reduce((c,l)=>(c[l]=t[l].default,c),{});return Object.assign(m,v)}}function K(t,n){return{customClass:n.class,customStyle:n.style}}const ee=new Map([["appearance",K]]);function ne(t,n,a){return n}const te={$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"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},oe={title:"events-editor",description:"A Farris Component",type:"object",categories:{}},q=[{label:"pageChange",name:"MockMock切换页码"},{label:"pageSizeChanged",name:"Mock分页条数变化事件"},{label:"scrollYLoad",name:"Mock滚动加载事件"},{label:"onEditClicked",name:"Mock操作列点击编辑"},{label:"onDeleteClicked",name:"Mock操作列点击删除"}],P={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:q,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:q,boundEventsList:[]})}}},F=x(P,te,ee,ne,oe);function I(t,n){const a=e.ref([]),{boundEvents:r,unBoundEvent:d}=n;function f(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:N.cloneDeep(o.command),controller:N.cloneDeep(o.controller)}}function i(){var o;a.value=(o=r.value)==null?void 0:o.map(s=>f(s))}function v(o){const w=f({boundEvents:o,command:null,controller:{id:"",name:"",label:""}});w.showSwitch[0].showSwitchNumber=1,w.showSwitch[0].showSection[2][3]=!0,a.value.unshift(w)}function m(){var o;(o=a.value)==null||o.forEach(s=>{s.showSwitch.forEach(w=>{w.showSection[2][3]=!1})})}function c(o){a.value[o].showSwitch.forEach(s=>{s.showSection[2][3]=!s.showSection[2][3]})}function l(o){if(o>=0&&o<=a.value.length-1){const s=a.value[o];d(s.event),a.value.splice(o,1)}}return{addNewInteraction:v,collapseInteractions:m,deleteInteracton:l,toggleMethodInInteraction:c,interactions:a,loadInteractions:i}}function z(t){const n=e.ref([]),a=e.ref([]),r=e.ref([]);function d(){const l=a.value.reduce((s,w)=>(s.set(w.boundEvents.label,!0),s),new Map);return n.value.filter(s=>!l.has(s.label))}function f(){var o;const l=((o=a.value)==null?void 0:o.length)>0;r.value=l?d():n.value}function i(){n.value=t.value.events,a.value=t.value.boundEventsList,f()}function v(l){r.value=r.value.filter(o=>o.label!==l.label)}function m(l){a.value=a.value.filter(o=>o.boundEvents.label!==l.label),f()}function c(){var s;const l=(s=t.value)==null?void 0:s.getEventList(),{events:o}=l;l&&(t.value.events=N.cloneDeep(o),t.value.boundEventsList=l.boundEventsList),t.value.boundEventsList&&(t.value.boundEventsList=t.value.boundEventsList.filter(function(w){return o.find(u=>u.label===w.boundEvents.label)}))}return{allEvents:n,boundEvents:a,candidateEvents:r,excludeFromCandidates:v,loadEvents:i,resetBoundEvents:c,unBoundEvent:m}}const re={},ae={events:{type:Array,default:[]}},ce=e.defineComponent({name:"FEventList",props:ae,emits:["click"],setup(t,n){const a=e.ref(t.events);function r(f){n.emit("click",f)}function d(f){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>r(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=>d(f))])}}),_=e.defineComponent({name:"FInteractionButton",props:re,emits:["click"],setup(t,n){const a=new W,r=e.inject("useEventsComposition"),d=e.inject("useInteractionCompostion"),{candidateEvents:f}=r,{collapseInteractions:i}=d,v=e.ref(!1);function m(s){f.value=f.value.filter(w=>w.label!==s.label)}function c(s=!1){v.value=s}function l(s){c(),m(s),n.emit("click",s)}function o(){if(f.value.length===0){a.info({position:"top-center",message:"事件已全部绑定"});return}i(),c(!v.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("新建交互事件")])])]),v.value&&e.createVNode(ce,{events:f.value,onClick:l},null)])}}),se={collapsed:{type:Boolean,default:!0},displayOrder:{type:Number,default:-1},interaction:{type:Object,default:{}},controllers:{type:Array,default:[]}},le={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}},ie={controllers:{type:Array,default:[]}},de=e.defineComponent({name:"FCommandList",props:ie,emits:["selectMethod"],setup(t,n){const a=e.ref(t.controllers);function r(m){return m.controllerList.length!==0}function d(m){return r(m)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:m.controllerName.name},[m.controllerName.name])])}function f(m,c){n.emit("selectMethod",{method:m,controller:c})}function i(m){return m.controllerList.map(c=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>f(c,m)},[e.createVNode("div",{class:"f-page-internals-command-name",title:c.label},[c.name])]))}function v(m){return e.createVNode("div",null,[d(m),i(m)])}return()=>e.createVNode("div",{class:"f-page-internals"},[a.value.map(m=>v(m))])}}),ue=e.defineComponent({name:"FCommandSource",props:le,emits:["addInternalCommandListChanged","newImportChanged","currentCommandChanged","originalDataChanged","click","existChanged","newFucChanged","close","selectMethod"],setup(t,n){const a=e.inject("useMethodsComposition"),{controllers:r}=a,d=e.ref(!1),f=e.ref(t.canAddNewMethod);e.computed(()=>!f.value),e.computed(()=>d.value),e.computed(()=>({"font-size":"15px",margin:"5px",color:"#226eff",flex:1}));function i(){n.emit("close",null)}function v(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function m(l){n.emit("selectMethod",l)}function c(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(de,{controllers:r.value,onSelectMethod:m},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[c(),v(),v(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:i},[e.createTextVNode("取消")])])])}}),fe={command:{type:Object,default:{}}},me=e.defineComponent({name:"FParameterEditor",props:fe,emits:["confirm","change"],setup(t,n){const a=e.ref(t.command),r=e.ref(0),d=e.ref(!1),f=e.ref(!1);e.ref(""),e.ref([]);const i=e.computed(()=>a.value!==null),v=e.computed(()=>d.value),m=e.computed(()=>f.value),c=e.computed(()=>!d.value&&!f.value),l=e.ref(!1);function o(){}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 w(){}function u(){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 y(V){l.value=!l.value}function M(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>y(r.value)},null)])}function g(V,k){k.value=V.target.value}function S(){n.emit("change",a.value)}function E(V){return e.createVNode("div",null,[e.createVNode("input",{title:"ide-parameter-editor",class:"form-control f-utils-fill text-left",value:V.value,onChange:k=>g(k,V),onBlur:k=>S()},null)])}function p(){var V;return(V=a.value.property)==null?void 0:V.map(k=>e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[k.shownName,k.description&&e.createVNode("div",{class:"ml-2 farris-label-tips"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[E(k)])]))}function h(V){l.value=!1,n.emit("confirm")}function b(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-btn"},[e.createVNode("div",{class:"btn-finish",onClick:()=>h(r.value)},[e.createTextVNode("完成")])])])}function C(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[p()])}function L(){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"},[v.value&&s(),m.value&&u(),c.value&&M()])]),l.value&&C(),l.value&&b()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[i.value&&L()])}}),H=e.defineComponent({name:"FInteractionItem",props:se,emits:["addAction","delete","toggle"],setup(t,n){const a=e.inject("useMethodsComposition"),{toggleSelectingMethod:r,emitFinalState:d}=a,f=e.ref(t.controllers),i=e.ref(t.interaction),v=e.ref(t.displayOrder),m=e.computed(()=>{const p=i.value.showSwitch[0];return p.showSection[p.showSwitchNumber][2]}),c=e.computed(()=>{const p=!!i.value.command,h=i.value.showSwitch[0],b=h.showSection[h.showSwitchNumber][3];return p&&b}),l=e.computed(()=>({"f-icon":!0,"f-icon-arrow-chevron-down":c.value,"f-icon-arrow-chevron-left":!c.value}));function o(){n.emit("delete",v.value)}function s(){const p=i.value.showSwitch[0];p.showSection[p.showSwitchNumber][3]=!p.showSection[p.showSwitchNumber][3],n.emit("toggle",v.value)}function w(){if(i.value.command!==null){const h=i.value.showSwitch[0];r(h),n.emit("addAction",v.value)}}function u(p){p===null&&i.value.command===null&&n.emit("delete",v.value);const h=i.value.showSwitch[0];r(h)}function y(p){const{method:h,controller:b}=p,{id:C,label:L,name:V,handlerName:k,property:we,componentLists:ge}=h,{controllerName:T}=b,be=!1,Ne=T.id;i.value.command={id:C,label:L,name:V,handlerName:k,hasPath:be,cmpId:Ne,property:we,componentLists:ge},i.value.controller={id:T.id,label:T.label,name:T.name};const D=i.value.showSwitch[0];D.showSwitchNumber=2,D.showSection[D.showSwitchNumber][2]=!1,D.showSection[D.showSwitchNumber][3]=!0,d()}function M(){return e.createVNode(ue,{controllers:f.value,onClose:u,onSelectMethod:y},null)}function g(){const p=i.value.showSwitch[0];p.showSection[p.showSwitchNumber][3]=!1}function S(p){i.value.command=N.cloneDeep(p),d()}function E(){return e.createVNode(me,{command:i.value.command,onConfirm:()=>g(),onChange:p=>S(p)},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:i.value.event.label},[i.value.event.name]),e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:l.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:o},null),e.createVNode("div",{class:"f-icon f-icon-home-add",style:"float:right; font-size: 10px; margin:8px;",onClick:w},null)]),m.value&&M(),c.value&&E()])}});function G(t,n,a){const{interactions:r}=n,d=e.ref(t.value.internalCommandList);function f(u){r.value[u].showSwitch=[],r.value[u].showSwitch.push(N.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),r.value=N.cloneDeep(r.value)}function i(u,y,M){}function v(u){var M;const y=[];return(M=t.value.newController)==null||M.forEach(g=>{u.forEach(S=>{g.Code===S.controller.label&&y.push(N.cloneDeep(g))})}),y}function m(){var S;t.value.isAddControllerMethod=!!t.value.newFuncEvents;const u=[],y=N.cloneDeep(t.value.internalCommandList);r.value.map(E=>{const p=N.cloneDeep(E.controller),h=N.cloneDeep(E.command),b=N.cloneDeep(E.event),C={controller:p,command:h,boundEvents:b};u.push(N.cloneDeep(C))});const M=(S=t.value.newController)!=null&&S.length&&u.length?N.cloneDeep(v(u)):[],g={viewModelId:t.value.viewModelId,savedCommand:N.cloneDeep(t.value.viewModel),boundEventsList:N.cloneDeep(u),events:N.cloneDeep(t.value.events),internalCommandList:N.cloneDeep(y),componentLists:[],relativePath:t.value.relativePath,envType:t.value.envType,newController:N.cloneDeep(M),isAddControllerMethod:t.value.isAddControllerMethod,repititionCommand:t.value.repititionCommand,preCommand:t.value.preCommand,newFuncEvents:N.cloneDeep(t.value.newFuncEvents)};a.emit("savedCommandListChanged",g)}function c(u){u.showSection[u.showSwitchNumber][2]=!0}function l(u){u.showSection[u.showSwitchNumber][2]=!1}function o(u){u.showSection[u.showSwitchNumber][3]=!0}function s(u){u.showSection[u.showSwitchNumber][3]=!1}function w(u){u.showSection[u.showSwitchNumber][2]?(l(u),o(u)):(c(u),s(u))}return{controllers:d,onClosed:f,emitFinalState:m,onCurrentCommandChanged:i,toggleSelectingMethod:w}}const j=e.defineComponent({name:"FEventsEditor",props:P,emits:["savedCommandListChanged"],setup(t,n){const a=e.ref(t.initialData),r=z(a),{loadEvents:d,resetBoundEvents:f}=r,i=I(a,r),{addNewInteraction:v,deleteInteracton:m,interactions:c,loadInteractions:l}=i,o=G(a,i,n);e.provide("useEventsComposition",r),e.provide("useInteractionCompostion",i),e.provide("useMethodsComposition",o);function s(){a.value.isAddControllerMethod=!1}e.onMounted(()=>{s(),f(),d(),l()});function w(g){m(g)}function u(g,S){const E=g.showSwitch[0],p=E.showSection[E.showSwitchNumber][3];return e.createVNode(H,{interaction:g,displayOrder:S,collapsed:p,onDelete:w},null)}function y(){var g;return(g=c.value)==null?void 0:g.map((S,E)=>e.createVNode("div",{class:"events-display-order",key:S.event.label},[u(S,E)]))}function M(g){v(g)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(_,{onClick:M},null),y()])])}});function pe(t,n,a){var p;const r="",d="",f=e.ref();function i(){return(n==null?void 0:n.schema.componentType)!=="frame"}function v(){return!1}function m(){return(n==null?void 0:n.schema.componentType)!=="frame"}function c(){return(n==null?void 0:n.schema.componentType)==="frame"}function l(h){if(!h||!h.value)return null;if(h.value.schema&&h.value.schema.type==="component")return h.value;const b=e.ref(h==null?void 0:h.value.parent),C=l(b);return C||null}function o(h=n){const{componentInstance:b,designerItemElementRef:C}=h;return!b||!b.value?null:b.value.canMove?C:o(h.parent)}function s(h){return!!a}function w(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function u(){}function y(h,b){}function M(h,b){const{componentType:C}=h;let L=$(C,h,b);const V=C.toLowerCase().replace(/-/g,"_");return L&&!L.id&&L.type===C&&(L.id=`${V}_${Math.random().toString().slice(2,6)}`),L}function g(h){}function S(...h){}function E(){n!=null&&n.schema.contents&&n.schema.contents.map(h=>{var L;let b=h.id;h.type==="component-ref"&&(b=h.component);const C=t.value.querySelector(`#${b}-design-item`);(L=C==null?void 0:C.componentInstance)!=null&&L.value.onRemoveComponent&&C.componentInstance.value.onRemoveComponent()})}return f.value={canMove:i(),canSelectParent:v(),canDelete:m(),canNested:!c(),contents:n==null?void 0:n.schema.contents,elementRef:t,parent:(p=n==null?void 0:n.parent)==null?void 0:p.componentInstance,schema:n==null?void 0:n.schema,styles:r,designerClass:d,canAccepts:s,getBelongedComponentInstance:l,getDraggableDesignItemElement:o,getDraggingDisplayText:w,getPropConfig:S,getDragScopeElement:u,onAcceptMovedChildElement:y,onChildElementMovedOut:g,addNewChildComponentSchema:M,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1),onRemoveComponent:E},f}const he=e.defineComponent({name:"FEventsEditorDesign",props:P,emits:["savedCommandListChanged"],setup(t,n){const a=e.ref(t.initialData),r=z(a),{loadEvents:d,resetBoundEvents:f}=r,i=I(a,r),{addNewInteraction:v,deleteInteracton:m,interactions:c,loadInteractions:l}=i,o=G(a,i,n);e.provide("useEventsComposition",r),e.provide("useInteractionCompostion",i),e.provide("useMethodsComposition",o);const s=e.ref(),w=e.inject("design-item-context"),u=pe(s,w);e.onMounted(()=>{s.value.componentInstance=u,y(),f(),d(),l()}),n.expose(u.value);function y(){a.value.isAddControllerMethod=!1}function M(p){m(p)}function g(p,h){const b=p.showSwitch[0],C=b.showSection[b.showSwitchNumber][3];return e.createVNode(H,{interaction:p,displayOrder:h,collapsed:C,onDelete:M},null)}function S(){var p;return(p=c.value)==null?void 0:p.map((h,b)=>e.createVNode("div",{class:"events-display-order",key:h.event.label},[g(h,b)]))}function E(p){v(p)}return()=>e.createVNode("div",{ref:s,class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(_,{onClick:E},null),S()])])}}),ve={install(t){t.component(j.name,j)},register(t,n,a,r){t["events-editor"]=j,n["events-editor"]=F},registerDesigner(t,n,a){t["events-editor"]=he,n["events-editor"]=F}};B.FEventsEditor=j,B.default=ve,B.eventsEditorProps=P,B.propsResolver=F,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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"}})});