@farris/ui-vue 1.2.9 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +63 -63
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +402 -323
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.css +1 -1
- package/components/button-edit/index.esm.js +98 -96
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +66 -66
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +118 -118
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +539 -460
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +135 -135
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.css +1 -0
- package/components/combo-list/index.esm.js +1007 -312
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +97 -97
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +778 -700
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +472 -329
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.css +1 -0
- package/components/condition/index.esm.js +2231 -1055
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +79 -79
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +6408 -5034
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.css +1 -0
- package/components/data-view/index.esm.js +4762 -3511
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.css +1 -1
- package/components/date-picker/index.esm.js +3442 -2742
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +14 -13
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +73 -73
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.css +1 -0
- package/components/dynamic-form/index.esm.js +2597 -1141
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +114 -71
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +303 -290
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +171 -171
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +65 -65
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3075 -2586
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5272 -8511
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1726 -1822
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +126 -126
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +620 -540
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +88 -88
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +71 -71
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +3582 -2356
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +10752 -8972
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +5601 -5329
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.css +1 -1
- package/components/message-box/index.esm.js +511 -471
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.css +1 -1
- package/components/modal/index.esm.js +438 -398
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +535 -452
- package/components/nav/index.umd.cjs +2 -2
- package/components/notify/index.esm.js +59 -53
- package/components/notify/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +556 -477
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +504 -425
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1833 -1054
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +100 -100
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +899 -870
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +576 -487
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +71 -70
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +73 -73
- package/components/progress/index.umd.cjs +2 -2
- package/components/property-editor/index.css +1 -1
- package/components/property-editor/index.esm.js +1916 -1220
- package/components/property-editor/index.umd.cjs +3 -3
- package/components/property-panel/index.esm.js +783 -886
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +3632 -2556
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +72 -72
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +484 -405
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +152 -152
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +73 -73
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.css +1 -1
- package/components/response-layout-editor/index.esm.js +1081 -1043
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +753 -738
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +4418 -4177
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +119 -119
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +92 -91
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +59 -59
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +103 -103
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +85 -85
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +457 -378
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.esm.js +1696 -1617
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +53 -53
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +268 -268
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +420 -341
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.css +1 -1
- package/components/time-picker/index.esm.js +1062 -981
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +381 -379
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5252 -9560
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.css +1 -0
- package/components/tree-view/index.esm.js +3920 -2692
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +373 -367
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +92 -92
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +597 -417
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +251 -251
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +17125 -16176
- package/farris.all.umd.cjs +8 -8
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/capsule/src/capsule.props.d.ts +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +0 -3
- package/types/combo-list/src/components/list-container.props.d.ts +0 -4
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +1 -1
- package/types/common/utils/encrypt.d.ts +2 -0
- package/types/component/src/component.props.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +1 -1
- package/types/component/src/property-config/component.property-config.d.ts +9 -0
- package/types/components.d.ts +1 -0
- package/types/data-grid/index.d.ts +5 -2
- package/types/data-grid/src/data-grid.component.d.ts +2 -1
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-view/composition/types.d.ts +18 -1
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/types.d.ts +1 -1
- package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +2 -2
- package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
- package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +12 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
- package/types/dynamic-resolver/src/types.d.ts +9 -0
- package/types/dynamic-view/index.d.ts +1 -0
- package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
- package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
- package/types/lookup/src/components/modal-container.component.d.ts +25 -0
- package/types/lookup/src/components/modal-container.props.d.ts +29 -0
- package/types/lookup/src/composition/types.d.ts +8 -0
- package/types/lookup/src/composition/use-check-props.d.ts +9 -2
- package/types/lookup/src/composition/use-dialog.d.ts +5 -1
- package/types/lookup/src/composition/use-favorite.d.ts +12 -0
- package/types/lookup/src/composition/use-http.d.ts +9 -5
- package/types/lookup/src/composition/use-input-change.d.ts +3 -0
- package/types/lookup/src/composition/use-user-data.d.ts +24 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
- package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
- package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
- package/types/modal/src/composition/use-draggable.d.ts +2 -1
- package/types/modal/src/composition/use-shortcut.d.ts +6 -0
- package/types/modal/src/modal.component.d.ts +3 -0
- package/types/modal/src/modal.props.d.ts +4 -0
- package/types/page-header/src/page-header.props.d.ts +1 -0
- package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
- package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
- package/types/response-layout-editor/src/type.d.ts +21 -0
- package/types/tabs/src/tabs.props.d.ts +1 -0
- package/types/tree-grid/index.d.ts +8 -2
- package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
- package/types/data-grid/src/designer/use-group-column.d.ts +0 -20
- package/types/modal/src/composition/use-esc.d.ts +0 -1
- package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
- package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),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","../schema-selector/index.umd.js","../modal/index.umd.js","../combo-list/index.umd.js"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k["events-editor"]={},k.Vue,k.LodashES,k.schemaSelector,k.modal))})(this,function(k,e,C,W,J){"use strict";const $={},I={};function F(t){const{properties:n,title:a,ignore:r}=t,u=r&&Array.isArray(r),f=Object.keys(n).reduce((s,v)=>((!u||!r.find(m=>m==v))&&(s[v]=n[v].type==="object"&&n[v].properties?F(n[v]):C.cloneDeep(n[v].default)),s),{});return(!u||!r.find(s=>s=="id"))&&(f.id=`${a}-${Date.now()}`),f}function j(t,n={},a){const r=$[t];if(r){let u=F(r);const f=I[t];return u=f?f({getSchemaByType:j},u,n,a):u,u}return null}function U(t,n){const a=F(n);return Object.keys(t).reduce((r,u)=>(r[u]&&typeof r[u]=="object"?Object.assign(r[u],t[u]):r[u]=t[u],r),a),a}function Y(t,n){return Object.keys(t).filter(r=>t[r]!=null).reduce((r,u)=>{if(n.has(u)){const f=n.get(u);if(typeof f=="string")r[f]=t[u];else{const s=f(u,t[u],t);Object.assign(r,s)}}else r[u]=t[u];return r},{})}function Q(t,n,a=new Map){const r=U(t,n);return Y(r,a)}function X(t={}){function n(c,i,o,l){if(typeof o=="number")return l[c].length===o;if(typeof o=="object"){const h=Object.keys(o)[0],d=o[h];if(h==="not")return Number(l[c].length)!==Number(d);if(h==="moreThan")return Number(l[c].length)>=Number(d);if(h==="lessThan")return Number(l[c].length)<=Number(d)}return!1}function a(c,i,o,l){return l[c]&&l[c].propertyValue&&String(l[c].propertyValue.value)===String(o)}const r=new Map([["length",n],["getProperty",a]]);Object.keys(t).reduce((c,i)=>(c.set(i,t[i]),c),r);function u(c,i){const o=c;return typeof i=="number"?[{target:o,operator:"length",param:null,value:Number(i)}]:typeof i=="boolean"?[{target:o,operator:"getProperty",param:c,value:!!i}]:typeof i=="object"?Object.keys(i).map(l=>{if(l==="length")return{target:o,operator:"length",param:null,value:i[l]};const h=l,d=i[l];return{target:o,operator:"getProperty",param:h,value:d}}):[]}function f(c){return Object.keys(c).reduce((o,l)=>{const h=u(l,c[l]);return o.push(...h),o},[])}function s(c,i){if(r.has(c.operator)){const o=r.get(c.operator);return o&&o(c.target,c.param,c.value,i)||!1}return!1}function v(c,i){return f(c).reduce((h,d)=>h&&s(d,i),!0)}function m(c,i){const o=Object.keys(c),l=o.includes("allOf"),h=o.includes("anyOf"),d=l||h,g=(d?c[d?l?"allOf":"anyOf":"allOf"]:[c]).map(y=>v(y,i));return l?!g.includes(!1):g.includes(!0)}return{parseValueSchema:m}}const Z={},K={};X();function ee(t,n,a=new Map,r=(s,v,m)=>v,u={},f=s=>s){return $[n.title]=n,I[n.title]=r,Z[n.title]=u,K[n.title]=f,(s={})=>{const v=Q(s,n,a),m=Object.keys(t).reduce((c,i)=>(c[i]=t[i].default,c),{});return Object.assign(m,v)}}function ne(t,n){return{customClass:n.class,customStyle:n.style}}const te=new Map([["appearance",ne]]);function oe(t,n,a){return n}const re={$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"]},ae={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操作列点击删除"}],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: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:[]})}}},O=ee(A,re,te,oe,ae);function z(t,n){const a=e.ref([]),{boundEvents:r,unBoundEvent:u}=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:C.cloneDeep(o.command),controller:C.cloneDeep(o.controller)}}function s(){var o;a.value=(o=r.value)==null?void 0:o.map(l=>f(l))}function v(o){const h=f({boundEvents:o,command:null,controller:{id:"",name:"",label:""}});h.showSwitch[0].showSwitchNumber=1,h.showSwitch[0].showSection[2][3]=!0,a.value.unshift(h)}function m(){var o;(o=a.value)==null||o.forEach(l=>{l.showSwitch.forEach(h=>{h.showSection[2][3]=!1})})}function c(o){a.value[o].showSwitch.forEach(l=>{l.showSection[2][3]=!l.showSection[2][3]})}function i(o){if(o>=0&&o<=a.value.length-1){const l=a.value[o];u(l.event),a.value.splice(o,1)}}return{addNewInteraction:v,collapseInteractions:m,deleteInteracton:i,toggleMethodInInteraction:c,interactions:a,loadInteractions:s}}function _(t){const n=e.ref([]),a=e.ref([]),r=e.ref([]);function u(){const i=a.value.reduce((l,h)=>(l.set(h.boundEvents.label,!0),l),new Map);return n.value.filter(l=>!i.has(l.label))}function f(){var o;const i=((o=a.value)==null?void 0:o.length)>0;r.value=i?u():n.value}function s(){n.value=t.value.events,a.value=t.value.boundEventsList,f()}function v(i){r.value=r.value.filter(o=>o.label!==i.label)}function m(i){a.value=a.value.filter(o=>o.boundEvents.label!==i.label),f()}function c(){var l;const i=(l=t.value)==null?void 0:l.getEventList(),{events:o}=i;i&&(t.value.events=C.cloneDeep(o),t.value.boundEventsList=i.boundEventsList),t.value.boundEventsList&&(t.value.boundEventsList=t.value.boundEventsList.filter(function(h){return o.find(d=>d.label==h.boundEvents.label)}))}return{allEvents:n,boundEvents:a,candidateEvents:r,excludeFromCandidates:v,loadEvents:s,resetBoundEvents:c,unBoundEvent:m}}const ce={},se={events:{type:Array,default:[]}},le=e.defineComponent({name:"FEventList",props:se,emits:["click"],setup(t,n){const a=e.ref(t.events);function r(f){n.emit("click",f)}function u(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=>u(f))])}}),H=e.defineComponent({name:"FInteractionButton",props:ce,emits:["click"],setup(t,n){const a=e.inject("useEventsComposition"),r=e.inject("useInteractionCompostion"),{candidateEvents:u}=a,{collapseInteractions:f}=r,s=e.ref(!1);function v(h){u.value=u.value.filter(d=>d.label!==h.label)}function m(){s.value=!1}function c(){s.value=!0}function i(h){m(),v(h),n.emit("click",h)}function o(){s.value?m():c()}function l(){f(),o()}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:l},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),s.value&&e.createVNode(le,{events:u.value,onClick:i},null)])}}),ie={collapsed:{type:Boolean,default:!0},displayOrder:{type:Number,default:-1},interaction:{type:Object,default:{}},controllers:{type:Array,default:[]}},de={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}},ue={controllers:{type:Array,default:[]}},fe=e.defineComponent({name:"FCommandList",props:ue,emits:["selectMethod"],setup(t,n){const a=e.ref(t.controllers);function r(m){return m.controllerList.length!==0}function u(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 s(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,[u(m),s(m)])}return()=>e.createVNode("div",{class:"f-page-internals"},[a.value.map(m=>v(m))])}}),me=e.defineComponent({name:"FCommandSource",props:de,emits:["addInternalCommandListChanged","newImportChanged","currentCommandChanged","originalDataChanged","click","existChanged","newFucChanged","close","selectMethod"],setup(t,n){const a=e.inject("useMethodsComposition"),{controllers:r}=a,u=e.ref(!1),f=e.ref(t.canAddNewMethod),s=e.computed(()=>!f.value),v=e.computed(()=>u.value),m=e.computed(()=>({"font-size":"15px",margin:"5px",color:"#226eff",flex:1})),c=Symbol("controller schema repository inject token");function i(){return e.createVNode(W.FSchemaSelector,{injectSymbolToken:c,"view-type":"NavList"},null)}function o(){J.FModalService.show({title:"选择控制器",width:950,render:i})}function l(){}function h(){}function d(){}function N(){n.emit("close",null)}function V(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function g(){return e.createVNode("div",{class:"f-page-internals-new-command"},[e.createVNode("div",{class:"f-page-internals-new-command-func1"},[e.createVNode("div",{class:"f-icon f-icon-panel-retraction",style:m.value},null),e.createVNode("div",{class:"f-function-class",onClick:()=>o()},[e.createTextVNode("引入控制器")])]),s.value&&e.createVNode("div",{class:"f-page-internals-new-command-func2"},[e.createVNode("div",{class:"f-icon f-icon-new-edit",style:m.value},null),e.createVNode("div",{class:"f-function-class",onClick:()=>void 0},[e.createTextVNode("添加新方法")])]),v.value&&void 0,e.createVNode("div",{class:"f-page-internals-new-command-func3"},[e.createVNode("div",{class:"f-icon f-icon-licensed",style:m.value},null),e.createVNode("div",{class:"f-function-class",onClick:()=>void 0},[e.createTextVNode("已有方法")])])])}function S(p){n.emit("selectMethod",p)}function y(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(fe,{controllers:r.value,onSelectMethod:S},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[y(),V(),g(),V(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:N},[e.createTextVNode("取消")])])])}}),pe={command:{type:Object,default:{}}},he=e.defineComponent({name:"FParameterEditor",props:pe,emits:["confirm","change"],setup(t,n){const a=e.ref(t.command),r=e.ref(0),u=e.ref(!1),f=e.ref(!1);e.ref(""),e.ref([]);const s=e.computed(()=>a.value!==null),v=e.computed(()=>u.value),m=e.computed(()=>f.value),c=e.computed(()=>!u.value&&!f.value),i=e.ref(!1);function o(){}function l(){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 h(){}function d(){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 N(E){i.value=!i.value}function V(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>N(r.value)},null)])}function g(E,L){L.value=E.target.value}function S(){n.emit("change",a.value)}function y(E){return e.createVNode("div",null,[e.createVNode("input",{class:"form-control f-utils-fill text-left",value:E.value,onChange:L=>g(L,E),onBlur:L=>S()},null)])}function p(){var E;return(E=a.value.property)==null?void 0:E.map(L=>e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[L.shownName,L.description&&e.createVNode("div",{class:"farris-label-tips"},[e.createVNode("i",{class:"f-icon f-icon-message_help",style:"color:#878D99;"},null)])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[y(L)])]))}function b(E){i.value=!1,n.emit("confirm")}function w(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-btn"},[e.createVNode("div",{class:"btn-finish",onClick:()=>b(r.value)},[e.createTextVNode("完成")])])])}function M(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[p()])}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"},[v.value&&l(),m.value&&d(),c.value&&V()])]),i.value&&M(),i.value&&w()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[s.value&&B()])}}),x=e.defineComponent({name:"FInteractionItem",props:ie,emits:["addAction","delete","toggle"],setup(t,n){const a=e.inject("useMethodsComposition"),{toggleSelectingMethod:r,emitFinalState:u}=a,f=e.ref(t.controllers),s=e.ref(t.interaction),v=e.ref(t.displayOrder),m=e.computed(()=>{const p=s.value.showSwitch[0];return p.showSection[p.showSwitchNumber][2]}),c=e.computed(()=>{const p=!!s.value.command,b=s.value.showSwitch[0],w=b.showSection[b.showSwitchNumber][3];return p&&w}),i=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 l(){const p=s.value.showSwitch[0];p.showSection[p.showSwitchNumber][3]=!p.showSection[p.showSwitchNumber][3],n.emit("toggle",v.value)}function h(){if(s.value.command!==null){const b=s.value.showSwitch[0];r(b),n.emit("addAction",v.value)}}function d(p){p===null&&s.value.command===null&&n.emit("delete",v.value);const b=s.value.showSwitch[0];r(b)}function N(p){const{method:b,controller:w}=p,{id:M,label:B,name:E,handlerName:L}=b,{controllerName:D}=w,R=!1,be=D.id;s.value.command={id:M,label:B,name:E,handlerName:L,hasPath:R,cmpId:be},s.value.controller={id:D.id,label:D.label,name:D.name};const P=s.value.showSwitch[0];P.showSwitchNumber=2,P.showSection[P.showSwitchNumber][2]=!1,P.showSection[P.showSwitchNumber][3]=!0,u()}function V(){return e.createVNode(me,{controllers:f.value,onClose:d,onSelectMethod:N},null)}function g(){const p=s.value.showSwitch[0];p.showSection[p.showSwitchNumber][3]=!1}function S(p){s.value.command=C.cloneDeep(p),u()}function y(){return e.createVNode(he,{command:s.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:s.value.event.label},[s.value.event.name]),e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:i.value,style:"font-size: 10px;",onClick:l},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:h},null)]),m.value&&V(),c.value&&y()])}});function G(t,n,a){const{interactions:r}=n,u=e.ref(t.value.internalCommandList);function f(d){r.value[d].showSwitch=[],r.value[d].showSwitch.push(C.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),r.value=C.cloneDeep(r.value)}function s(d,N,V){}function v(d){var V;const N=[];return(V=t.value.newController)==null||V.forEach(g=>{d.forEach(S=>{g.Code===S.controller.label&&N.push(C.cloneDeep(g))})}),N}function m(){var S;t.value.isAddControllerMethod=!!t.value.newFuncEvents;const d=[],N=C.cloneDeep(t.value.internalCommandList);r.value.map(y=>{const p=C.cloneDeep(y.controller),b=C.cloneDeep(y.command),w=C.cloneDeep(y.event),M={controller:p,command:b,boundEvents:w};d.push(C.cloneDeep(M))});const V=(S=t.value.newController)!=null&&S.length&&d.length?C.cloneDeep(v(d)):[],g={viewModelId:t.value.viewModelId,savedCommand:C.cloneDeep(t.value.viewModel),boundEventsList:C.cloneDeep(d),events:C.cloneDeep(t.value.events),internalCommandList:C.cloneDeep(N),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:C.cloneDeep(t.value.newFuncEvents)};a.emit("savedCommandListChanged",g)}function c(d){d.showSection[d.showSwitchNumber][2]=!0}function i(d){d.showSection[d.showSwitchNumber][2]=!1}function o(d){d.showSection[d.showSwitchNumber][3]=!0}function l(d){d.showSection[d.showSwitchNumber][3]=!1}function h(d){d.showSection[d.showSwitchNumber][2]?(i(d),o(d)):(c(d),l(d))}return{controllers:u,onClosed:f,emitFinalState:m,onCurrentCommandChanged:s,toggleSelectingMethod:h}}const T=e.defineComponent({name:"FEventsEditor",props:A,emits:["savedCommandListChanged"],setup(t,n){const a=e.ref(t.initialData),r=_(a),{loadEvents:u,resetBoundEvents:f}=r,s=z(a,r),{addNewInteraction:v,deleteInteracton:m,interactions:c,loadInteractions:i}=s,o=G(a,s,n);e.provide("useEventsComposition",r),e.provide("useInteractionCompostion",s),e.provide("useMethodsComposition",o);function l(){a.value.isAddControllerMethod=!1}e.onMounted(()=>{l(),f(),u(),i()});function h(g){m(g)}function d(g,S){const y=g.showSwitch[0],p=y.showSection[y.showSwitchNumber][3];return e.createVNode(x,{interaction:g,displayOrder:S,collapsed:p,onDelete:h},null)}function N(){var g;return(g=c.value)==null?void 0:g.map((S,y)=>e.createVNode("div",{class:"events-display-order",key:S.event.label},[d(S,y)]))}function V(g){v(g)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(H,{onClick:V},null),N()])])}});function ve(t,n,a){var b;function r(){}const u="",f="",s=e.ref();function v(){return(n==null?void 0:n.schema.componentType)!=="frame"}function m(){return!1}function c(){return(n==null?void 0:n.schema.componentType)!=="frame"}function i(){return(n==null?void 0:n.schema.componentType)==="frame"}function o(w){if(!w||!w.value)return null;if(w.value.schema&&w.value.schema.type==="component")return w.value;const M=e.ref(w==null?void 0:w.value.parent),B=o(M);return B||null}function l(w=n){const{componentInstance:M,designerItemElementRef:B}=w;return!M||!M.value?null:M.value.canMove?B:l(w.parent)}function h(w){return!!a}function d(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function N(){}function V(w,M){}function g(w,M){const{componentType:B}=w;let E=j(B,w,M);const L=B.toLowerCase().replace("-","_");return E&&!E.id&&E.type===B&&(E.id=`${L}_${Math.random().toString().slice(2,6)}`),E}function S(w,M){const B=String(w.getAttribute("data-controltype")),E=w.getAttribute("data-feature"),L=E?JSON.parse(E):{};L.parentComponentInstance=s.value;let D=j(B,L);const R=B.toLowerCase().replace("-","_");return D&&!D.id&&D.type===B&&(D.id=`${R}_${Math.random().toString().slice(2,6)}`),D}function y(w){}function p(...w){}return s.value={canMove:v(),canSelectParent:m(),canDelete:c(),canNested:!i(),contents:n==null?void 0:n.schema.contents,elementRef:t,parent:(b=n==null?void 0:n.parent)==null?void 0:b.componentInstance,schema:n==null?void 0:n.schema,styles:u,designerClass:f,canAccepts:h,getBelongedComponentInstance:o,getDraggableDesignItemElement:l,getDraggingDisplayText:d,getPropConfig:p,getDragScopeElement:N,onAcceptMovedChildElement:V,onAcceptNewChildElement:S,onChildElementMovedOut:y,addNewChildComponentSchema:g,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},s}const we=e.defineComponent({name:"FEventsEditorDesign",props:A,emits:["savedCommandListChanged"],setup(t,n){const a=e.ref(t.initialData),r=_(a),{loadEvents:u,resetBoundEvents:f}=r,s=z(a,r),{addNewInteraction:v,deleteInteracton:m,interactions:c,loadInteractions:i}=s,o=G(a,s,n);e.provide("useEventsComposition",r),e.provide("useInteractionCompostion",s),e.provide("useMethodsComposition",o);const l=e.ref(),h=e.inject("design-item-context"),d=ve(l,h);e.onMounted(()=>{l.value.componentInstance=d,N(),f(),u(),i()}),n.expose(d.value);function N(){a.value.isAddControllerMethod=!1}function V(p){m(p)}function g(p,b){const w=p.showSwitch[0],M=w.showSection[w.showSwitchNumber][3];return e.createVNode(x,{interaction:p,displayOrder:b,collapsed:M,onDelete:V},null)}function S(){var p;return(p=c.value)==null?void 0:p.map((b,w)=>e.createVNode("div",{class:"events-display-order",key:b.event.label},[g(b,w)]))}function y(p){v(p)}return()=>e.createVNode("div",{ref:l,class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(H,{onClick:y},null),S()])])}}),ge={install(t){t.component(T.name,T)},register(t,n,a,r){t["events-editor"]=T,n["events-editor"]=O},registerDesigner(t,n,a){t["events-editor"]=we,n["events-editor"]=O}};k.FEventsEditor=T,k.default=ge,k.eventsEditorProps=A,k.propsResolver=O,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),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","../schema-selector/index.umd.js","../modal/index.umd.js","../combo-list/index.umd.js"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k["events-editor"]={},k.Vue,k.LodashES,k.schemaSelector,k.modal))})(this,function(k,e,b,W,J){"use strict";const $={},I={};function F(t){const{properties:n,title:a,ignore:r}=t,d=r&&Array.isArray(r),f=Object.keys(n).reduce((s,v)=>((!d||!r.find(m=>m==v))&&(s[v]=n[v].type==="object"&&n[v].properties?F(n[v]):b.cloneDeep(n[v].default)),s),{});return(!d||!r.find(s=>s=="id"))&&(f.id=`${a}-${Date.now()}`),f}function j(t,n={},a){const r=$[t];if(r){let d=F(r);const f=I[t];return d=f?f({getSchemaByType:j},d,n,a):d,d}return null}function U(t,n){const a=F(n);return Object.keys(t).reduce((r,d)=>(r[d]&&b.isPlainObject(r[d])&&b.isPlainObject(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 s=f(d,t[d],t);Object.assign(r,s)}}else r[d]=t[d];return r},{})}function Q(t,n,a=new Map){const r=U(t,n);return Y(r,a)}function X(t={}){function n(c,i,o,l){if(typeof o=="number")return l[c].length===o;if(typeof o=="object"){const h=Object.keys(o)[0],u=o[h];if(h==="not")return Number(l[c].length)!==Number(u);if(h==="moreThan")return Number(l[c].length)>=Number(u);if(h==="lessThan")return Number(l[c].length)<=Number(u)}return!1}function a(c,i,o,l){return l[c]&&l[c].propertyValue&&String(l[c].propertyValue.value)===String(o)}const r=new Map([["length",n],["getProperty",a]]);Object.keys(t).reduce((c,i)=>(c.set(i,t[i]),c),r);function d(c,i){const o=c;return typeof i=="number"?[{target:o,operator:"length",param:null,value:Number(i)}]:typeof i=="boolean"?[{target:o,operator:"getProperty",param:c,value:!!i}]:typeof i=="object"?Object.keys(i).map(l=>{if(l==="length")return{target:o,operator:"length",param:null,value:i[l]};const h=l,u=i[l];return{target:o,operator:"getProperty",param:h,value:u}}):[]}function f(c){return Object.keys(c).reduce((o,l)=>{const h=d(l,c[l]);return o.push(...h),o},[])}function s(c,i){if(r.has(c.operator)){const o=r.get(c.operator);return o&&o(c.target,c.param,c.value,i)||!1}return!1}function v(c,i){return f(c).reduce((h,u)=>h&&s(u,i),!0)}function m(c,i){const o=Object.keys(c),l=o.includes("allOf"),h=o.includes("anyOf"),u=l||h,g=(u?c[u?l?"allOf":"anyOf":"allOf"]:[c]).map(y=>v(y,i));return l?!g.includes(!1):g.includes(!0)}return{parseValueSchema:m}}const Z={},K={};X();function ee(t,n,a=new Map,r=(s,v,m)=>v,d={},f=s=>s){return $[n.title]=n,I[n.title]=r,Z[n.title]=d,K[n.title]=f,(s={})=>{const v=Q(s,n,a),m=Object.keys(t).reduce((c,i)=>(c[i]=t[i].default,c),{});return Object.assign(m,v)}}function ne(t,n){return{customClass:n.class,customStyle:n.style}}const te=new Map([["appearance",ne]]);function oe(t,n,a){return n}const re={$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"]},ae={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操作列点击删除"}],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: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:[]})}}},O=ee(A,re,te,oe,ae);function z(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:b.cloneDeep(o.command),controller:b.cloneDeep(o.controller)}}function s(){var o;a.value=(o=r.value)==null?void 0:o.map(l=>f(l))}function v(o){const h=f({boundEvents:o,command:null,controller:{id:"",name:"",label:""}});h.showSwitch[0].showSwitchNumber=1,h.showSwitch[0].showSection[2][3]=!0,a.value.unshift(h)}function m(){var o;(o=a.value)==null||o.forEach(l=>{l.showSwitch.forEach(h=>{h.showSection[2][3]=!1})})}function c(o){a.value[o].showSwitch.forEach(l=>{l.showSection[2][3]=!l.showSection[2][3]})}function i(o){if(o>=0&&o<=a.value.length-1){const l=a.value[o];d(l.event),a.value.splice(o,1)}}return{addNewInteraction:v,collapseInteractions:m,deleteInteracton:i,toggleMethodInInteraction:c,interactions:a,loadInteractions:s}}function _(t){const n=e.ref([]),a=e.ref([]),r=e.ref([]);function d(){const i=a.value.reduce((l,h)=>(l.set(h.boundEvents.label,!0),l),new Map);return n.value.filter(l=>!i.has(l.label))}function f(){var o;const i=((o=a.value)==null?void 0:o.length)>0;r.value=i?d():n.value}function s(){n.value=t.value.events,a.value=t.value.boundEventsList,f()}function v(i){r.value=r.value.filter(o=>o.label!==i.label)}function m(i){a.value=a.value.filter(o=>o.boundEvents.label!==i.label),f()}function c(){var l;const i=(l=t.value)==null?void 0:l.getEventList(),{events:o}=i;i&&(t.value.events=b.cloneDeep(o),t.value.boundEventsList=i.boundEventsList),t.value.boundEventsList&&(t.value.boundEventsList=t.value.boundEventsList.filter(function(h){return o.find(u=>u.label==h.boundEvents.label)}))}return{allEvents:n,boundEvents:a,candidateEvents:r,excludeFromCandidates:v,loadEvents:s,resetBoundEvents:c,unBoundEvent:m}}const ce={},se={events:{type:Array,default:[]}},le=e.defineComponent({name:"FEventList",props:se,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))])}}),H=e.defineComponent({name:"FInteractionButton",props:ce,emits:["click"],setup(t,n){const a=e.inject("useEventsComposition"),r=e.inject("useInteractionCompostion"),{candidateEvents:d}=a,{collapseInteractions:f}=r,s=e.ref(!1);function v(h){d.value=d.value.filter(u=>u.label!==h.label)}function m(){s.value=!1}function c(){s.value=!0}function i(h){m(),v(h),n.emit("click",h)}function o(){s.value?m():c()}function l(){f(),o()}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:l},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),s.value&&e.createVNode(le,{events:d.value,onClick:i},null)])}}),ie={collapsed:{type:Boolean,default:!0},displayOrder:{type:Number,default:-1},interaction:{type:Object,default:{}},controllers:{type:Array,default:[]}},de={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}},ue={controllers:{type:Array,default:[]}},fe=e.defineComponent({name:"FCommandList",props:ue,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 s(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),s(m)])}return()=>e.createVNode("div",{class:"f-page-internals"},[a.value.map(m=>v(m))])}}),me=e.defineComponent({name:"FCommandSource",props:de,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),s=e.computed(()=>!f.value),v=e.computed(()=>d.value),m=e.computed(()=>({"font-size":"15px",margin:"5px",color:"#226eff",flex:1})),c=Symbol("controller schema repository inject token");function i(){return e.createVNode(W.FSchemaSelector,{injectSymbolToken:c,"view-type":"NavList"},null)}function o(){J.FModalService.show({title:"选择控制器",width:950,render:i})}function l(){}function h(){}function u(){}function N(){n.emit("close",null)}function M(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function g(){return e.createVNode("div",{class:"f-page-internals-new-command"},[e.createVNode("div",{class:"f-page-internals-new-command-func1"},[e.createVNode("div",{class:"f-icon f-icon-panel-retraction",style:m.value},null),e.createVNode("div",{class:"f-function-class",onClick:()=>o()},[e.createTextVNode("引入控制器")])]),s.value&&e.createVNode("div",{class:"f-page-internals-new-command-func2"},[e.createVNode("div",{class:"f-icon f-icon-new-edit",style:m.value},null),e.createVNode("div",{class:"f-function-class",onClick:()=>void 0},[e.createTextVNode("添加新方法")])]),v.value&&void 0,e.createVNode("div",{class:"f-page-internals-new-command-func3"},[e.createVNode("div",{class:"f-icon f-icon-licensed",style:m.value},null),e.createVNode("div",{class:"f-function-class",onClick:()=>void 0},[e.createTextVNode("已有方法")])])])}function S(p){n.emit("selectMethod",p)}function y(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(fe,{controllers:r.value,onSelectMethod:S},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[y(),M(),g(),M(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:N},[e.createTextVNode("取消")])])])}}),pe={command:{type:Object,default:{}}},he=e.defineComponent({name:"FParameterEditor",props:pe,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 s=e.computed(()=>a.value!==null),v=e.computed(()=>d.value),m=e.computed(()=>f.value),c=e.computed(()=>!d.value&&!f.value),i=e.ref(!1);function o(){}function l(){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 h(){}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 N(E){i.value=!i.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:()=>N(r.value)},null)])}function g(E,L){L.value=E.target.value}function S(){n.emit("change",a.value)}function y(E){return e.createVNode("div",null,[e.createVNode("input",{class:"form-control f-utils-fill text-left",value:E.value,onChange:L=>g(L,E),onBlur:L=>S()},null)])}function p(){var E;return(E=a.value.property)==null?void 0:E.map(L=>e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[L.shownName,L.description&&e.createVNode("div",{class:"farris-label-tips"},[e.createVNode("i",{class:"f-icon f-icon-message_help",style:"color:#878D99;"},null)])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[y(L)])]))}function C(E){i.value=!1,n.emit("confirm")}function w(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-btn"},[e.createVNode("div",{class:"btn-finish",onClick:()=>C(r.value)},[e.createTextVNode("完成")])])])}function V(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[p()])}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"},[v.value&&l(),m.value&&u(),c.value&&M()])]),i.value&&V(),i.value&&w()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[s.value&&B()])}}),x=e.defineComponent({name:"FInteractionItem",props:ie,emits:["addAction","delete","toggle"],setup(t,n){const a=e.inject("useMethodsComposition"),{toggleSelectingMethod:r,emitFinalState:d}=a,f=e.ref(t.controllers),s=e.ref(t.interaction),v=e.ref(t.displayOrder),m=e.computed(()=>{const p=s.value.showSwitch[0];return p.showSection[p.showSwitchNumber][2]}),c=e.computed(()=>{const p=!!s.value.command,C=s.value.showSwitch[0],w=C.showSection[C.showSwitchNumber][3];return p&&w}),i=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 l(){const p=s.value.showSwitch[0];p.showSection[p.showSwitchNumber][3]=!p.showSection[p.showSwitchNumber][3],n.emit("toggle",v.value)}function h(){if(s.value.command!==null){const C=s.value.showSwitch[0];r(C),n.emit("addAction",v.value)}}function u(p){p===null&&s.value.command===null&&n.emit("delete",v.value);const C=s.value.showSwitch[0];r(C)}function N(p){const{method:C,controller:w}=p,{id:V,label:B,name:E,handlerName:L}=C,{controllerName:D}=w,R=!1,be=D.id;s.value.command={id:V,label:B,name:E,handlerName:L,hasPath:R,cmpId:be},s.value.controller={id:D.id,label:D.label,name:D.name};const P=s.value.showSwitch[0];P.showSwitchNumber=2,P.showSection[P.showSwitchNumber][2]=!1,P.showSection[P.showSwitchNumber][3]=!0,d()}function M(){return e.createVNode(me,{controllers:f.value,onClose:u,onSelectMethod:N},null)}function g(){const p=s.value.showSwitch[0];p.showSection[p.showSwitchNumber][3]=!1}function S(p){s.value.command=b.cloneDeep(p),d()}function y(){return e.createVNode(he,{command:s.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:s.value.event.label},[s.value.event.name]),e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:i.value,style:"font-size: 10px;",onClick:l},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:h},null)]),m.value&&M(),c.value&&y()])}});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(b.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),r.value=b.cloneDeep(r.value)}function s(u,N,M){}function v(u){var M;const N=[];return(M=t.value.newController)==null||M.forEach(g=>{u.forEach(S=>{g.Code===S.controller.label&&N.push(b.cloneDeep(g))})}),N}function m(){var S;t.value.isAddControllerMethod=!!t.value.newFuncEvents;const u=[],N=b.cloneDeep(t.value.internalCommandList);r.value.map(y=>{const p=b.cloneDeep(y.controller),C=b.cloneDeep(y.command),w=b.cloneDeep(y.event),V={controller:p,command:C,boundEvents:w};u.push(b.cloneDeep(V))});const M=(S=t.value.newController)!=null&&S.length&&u.length?b.cloneDeep(v(u)):[],g={viewModelId:t.value.viewModelId,savedCommand:b.cloneDeep(t.value.viewModel),boundEventsList:b.cloneDeep(u),events:b.cloneDeep(t.value.events),internalCommandList:b.cloneDeep(N),componentLists:[],relativePath:t.value.relativePath,envType:t.value.envType,newController:b.cloneDeep(M),isAddControllerMethod:t.value.isAddControllerMethod,repititionCommand:t.value.repititionCommand,preCommand:t.value.preCommand,newFuncEvents:b.cloneDeep(t.value.newFuncEvents)};a.emit("savedCommandListChanged",g)}function c(u){u.showSection[u.showSwitchNumber][2]=!0}function i(u){u.showSection[u.showSwitchNumber][2]=!1}function o(u){u.showSection[u.showSwitchNumber][3]=!0}function l(u){u.showSection[u.showSwitchNumber][3]=!1}function h(u){u.showSection[u.showSwitchNumber][2]?(i(u),o(u)):(c(u),l(u))}return{controllers:d,onClosed:f,emitFinalState:m,onCurrentCommandChanged:s,toggleSelectingMethod:h}}const T=e.defineComponent({name:"FEventsEditor",props:A,emits:["savedCommandListChanged"],setup(t,n){const a=e.ref(t.initialData),r=_(a),{loadEvents:d,resetBoundEvents:f}=r,s=z(a,r),{addNewInteraction:v,deleteInteracton:m,interactions:c,loadInteractions:i}=s,o=G(a,s,n);e.provide("useEventsComposition",r),e.provide("useInteractionCompostion",s),e.provide("useMethodsComposition",o);function l(){a.value.isAddControllerMethod=!1}e.onMounted(()=>{l(),f(),d(),i()});function h(g){m(g)}function u(g,S){const y=g.showSwitch[0],p=y.showSection[y.showSwitchNumber][3];return e.createVNode(x,{interaction:g,displayOrder:S,collapsed:p,onDelete:h},null)}function N(){var g;return(g=c.value)==null?void 0:g.map((S,y)=>e.createVNode("div",{class:"events-display-order",key:S.event.label},[u(S,y)]))}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(H,{onClick:M},null),N()])])}});function ve(t,n,a){var C;function r(){}const d="",f="",s=e.ref();function v(){return(n==null?void 0:n.schema.componentType)!=="frame"}function m(){return!1}function c(){return(n==null?void 0:n.schema.componentType)!=="frame"}function i(){return(n==null?void 0:n.schema.componentType)==="frame"}function o(w){if(!w||!w.value)return null;if(w.value.schema&&w.value.schema.type==="component")return w.value;const V=e.ref(w==null?void 0:w.value.parent),B=o(V);return B||null}function l(w=n){const{componentInstance:V,designerItemElementRef:B}=w;return!V||!V.value?null:V.value.canMove?B:l(w.parent)}function h(w){return!!a}function u(){return(n==null?void 0:n.schema.label)||(n==null?void 0:n.schema.title)||(n==null?void 0:n.schema.name)}function N(){}function M(w,V){}function g(w,V){const{componentType:B}=w;let E=j(B,w,V);const L=B.toLowerCase().replace("-","_");return E&&!E.id&&E.type===B&&(E.id=`${L}_${Math.random().toString().slice(2,6)}`),E}function S(w,V){const B=String(w.getAttribute("data-controltype")),E=w.getAttribute("data-feature"),L=E?JSON.parse(E):{};L.parentComponentInstance=s.value;let D=j(B,L);const R=B.toLowerCase().replace("-","_");return D&&!D.id&&D.type===B&&(D.id=`${R}_${Math.random().toString().slice(2,6)}`),D}function y(w){}function p(...w){}return s.value={canMove:v(),canSelectParent:m(),canDelete:c(),canNested:!i(),contents:n==null?void 0:n.schema.contents,elementRef:t,parent:(C=n==null?void 0:n.parent)==null?void 0:C.componentInstance,schema:n==null?void 0:n.schema,styles:d,designerClass:f,canAccepts:h,getBelongedComponentInstance:o,getDraggableDesignItemElement:l,getDraggingDisplayText:u,getPropConfig:p,getDragScopeElement:N,onAcceptMovedChildElement:M,onAcceptNewChildElement:S,onChildElementMovedOut:y,addNewChildComponentSchema:g,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:e.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:e.ref(!1)},s}const we=e.defineComponent({name:"FEventsEditorDesign",props:A,emits:["savedCommandListChanged"],setup(t,n){const a=e.ref(t.initialData),r=_(a),{loadEvents:d,resetBoundEvents:f}=r,s=z(a,r),{addNewInteraction:v,deleteInteracton:m,interactions:c,loadInteractions:i}=s,o=G(a,s,n);e.provide("useEventsComposition",r),e.provide("useInteractionCompostion",s),e.provide("useMethodsComposition",o);const l=e.ref(),h=e.inject("design-item-context"),u=ve(l,h);e.onMounted(()=>{l.value.componentInstance=u,N(),f(),d(),i()}),n.expose(u.value);function N(){a.value.isAddControllerMethod=!1}function M(p){m(p)}function g(p,C){const w=p.showSwitch[0],V=w.showSection[w.showSwitchNumber][3];return e.createVNode(x,{interaction:p,displayOrder:C,collapsed:V,onDelete:M},null)}function S(){var p;return(p=c.value)==null?void 0:p.map((C,w)=>e.createVNode("div",{class:"events-display-order",key:C.event.label},[g(C,w)]))}function y(p){v(p)}return()=>e.createVNode("div",{ref:l,class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(H,{onClick:y},null),S()])])}}),ge={install(t){t.component(T.name,T)},register(t,n,a,r){t["events-editor"]=T,n["events-editor"]=O},registerDesigner(t,n,a){t["events-editor"]=we,n["events-editor"]=O}};k.FEventsEditor=T,k.default=ge,k.eventsEditorProps=A,k.propsResolver=O,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cloneDeep as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { properties: e, title: c, ignore: r } = n,
|
|
6
|
-
return (!
|
|
1
|
+
import { defineComponent as F, ref as D, onMounted as N, createVNode as l, resolveComponent as y, createTextVNode as x, Fragment as R } from "vue";
|
|
2
|
+
import { isPlainObject as O, cloneDeep as $ } from "lodash-es";
|
|
3
|
+
const P = {}, T = {};
|
|
4
|
+
function M(n) {
|
|
5
|
+
const { properties: e, title: c, ignore: r } = n, s = r && Array.isArray(r), d = Object.keys(e).reduce((u, p) => ((!s || !r.find((m) => m == p)) && (u[p] = e[p].type === "object" && e[p].properties ? M(e[p]) : $(e[p].default)), u), {});
|
|
6
|
+
return (!s || !r.find((u) => u == "id")) && (d.id = `${c}-${Date.now()}`), d;
|
|
7
7
|
}
|
|
8
8
|
function V(n, e) {
|
|
9
|
-
const c =
|
|
10
|
-
return Object.keys(n).reduce((r,
|
|
9
|
+
const c = M(e);
|
|
10
|
+
return Object.keys(n).reduce((r, s) => (r[s] && O(r[s]) && O(n[s]) ? Object.assign(r[s], n[s]) : r[s] = n[s], r), c), c;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return Object.keys(n).filter((r) => n[r] != null).reduce((r,
|
|
14
|
-
if (e.has(
|
|
15
|
-
const d = e.get(
|
|
12
|
+
function w(n, e) {
|
|
13
|
+
return Object.keys(n).filter((r) => n[r] != null).reduce((r, s) => {
|
|
14
|
+
if (e.has(s)) {
|
|
15
|
+
const d = e.get(s);
|
|
16
16
|
if (typeof d == "string")
|
|
17
|
-
r[d] = n[
|
|
17
|
+
r[d] = n[s];
|
|
18
18
|
else {
|
|
19
|
-
const u = d(
|
|
19
|
+
const u = d(s, n[s], n);
|
|
20
20
|
Object.assign(r, u);
|
|
21
21
|
}
|
|
22
22
|
} else
|
|
23
|
-
r[
|
|
23
|
+
r[s] = n[s];
|
|
24
24
|
return r;
|
|
25
25
|
}, {});
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function k(n, e, c = /* @__PURE__ */ new Map()) {
|
|
28
28
|
const r = V(n, e);
|
|
29
|
-
return
|
|
29
|
+
return w(r, c);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
function e(t,
|
|
31
|
+
function v(n = {}) {
|
|
32
|
+
function e(t, o, i, a) {
|
|
33
33
|
if (typeof i == "number")
|
|
34
34
|
return a[t].length === i;
|
|
35
35
|
if (typeof i == "object") {
|
|
@@ -43,63 +43,63 @@ function k(n = {}) {
|
|
|
43
43
|
}
|
|
44
44
|
return !1;
|
|
45
45
|
}
|
|
46
|
-
function c(t,
|
|
46
|
+
function c(t, o, i, a) {
|
|
47
47
|
return a[t] && a[t].propertyValue && String(a[t].propertyValue.value) === String(i);
|
|
48
48
|
}
|
|
49
49
|
const r = /* @__PURE__ */ new Map([
|
|
50
50
|
["length", e],
|
|
51
51
|
["getProperty", c]
|
|
52
52
|
]);
|
|
53
|
-
Object.keys(n).reduce((t,
|
|
54
|
-
function
|
|
53
|
+
Object.keys(n).reduce((t, o) => (t.set(o, n[o]), t), r);
|
|
54
|
+
function s(t, o) {
|
|
55
55
|
const i = t;
|
|
56
|
-
return typeof
|
|
56
|
+
return typeof o == "number" ? [{ target: i, operator: "length", param: null, value: Number(o) }] : typeof o == "boolean" ? [{ target: i, operator: "getProperty", param: t, value: !!o }] : typeof o == "object" ? Object.keys(o).map((a) => {
|
|
57
57
|
if (a === "length")
|
|
58
|
-
return { target: i, operator: "length", param: null, value:
|
|
59
|
-
const f = a, g =
|
|
58
|
+
return { target: i, operator: "length", param: null, value: o[a] };
|
|
59
|
+
const f = a, g = o[a];
|
|
60
60
|
return { target: i, operator: "getProperty", param: f, value: g };
|
|
61
61
|
}) : [];
|
|
62
62
|
}
|
|
63
63
|
function d(t) {
|
|
64
64
|
return Object.keys(t).reduce((i, a) => {
|
|
65
|
-
const f =
|
|
65
|
+
const f = s(a, t[a]);
|
|
66
66
|
return i.push(...f), i;
|
|
67
67
|
}, []);
|
|
68
68
|
}
|
|
69
|
-
function u(t,
|
|
69
|
+
function u(t, o) {
|
|
70
70
|
if (r.has(t.operator)) {
|
|
71
71
|
const i = r.get(t.operator);
|
|
72
|
-
return i && i(t.target, t.param, t.value,
|
|
72
|
+
return i && i(t.target, t.param, t.value, o) || !1;
|
|
73
73
|
}
|
|
74
74
|
return !1;
|
|
75
75
|
}
|
|
76
|
-
function p(t,
|
|
77
|
-
return d(t).reduce((f, g) => f && u(g,
|
|
76
|
+
function p(t, o) {
|
|
77
|
+
return d(t).reduce((f, g) => f && u(g, o), !0);
|
|
78
78
|
}
|
|
79
|
-
function m(t,
|
|
80
|
-
const i = Object.keys(t), a = i.includes("allOf"), f = i.includes("anyOf"), g = a || f, h = (g ? t[g ? a ? "allOf" : "anyOf" : "allOf"] : [t]).map((
|
|
79
|
+
function m(t, o) {
|
|
80
|
+
const i = Object.keys(t), a = i.includes("allOf"), f = i.includes("anyOf"), g = a || f, h = (g ? t[g ? a ? "allOf" : "anyOf" : "allOf"] : [t]).map((C) => p(C, o));
|
|
81
81
|
return a ? !h.includes(!1) : h.includes(!0);
|
|
82
82
|
}
|
|
83
83
|
return { parseValueSchema: m };
|
|
84
84
|
}
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
function
|
|
88
|
-
return
|
|
89
|
-
const p =
|
|
85
|
+
const q = {}, z = {};
|
|
86
|
+
v();
|
|
87
|
+
function B(n, e, c = /* @__PURE__ */ new Map(), r = (u, p, m) => p, s = {}, d = (u) => u) {
|
|
88
|
+
return P[e.title] = e, T[e.title] = r, q[e.title] = s, z[e.title] = d, (u = {}) => {
|
|
89
|
+
const p = k(u, e, c), m = Object.keys(n).reduce((t, o) => (t[o] = n[o].default, t), {});
|
|
90
90
|
return Object.assign(m, p);
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function I(n, e) {
|
|
94
94
|
return { customClass: e.class, customStyle: e.style };
|
|
95
95
|
}
|
|
96
|
-
const
|
|
97
|
-
["appearance",
|
|
96
|
+
const L = /* @__PURE__ */ new Map([
|
|
97
|
+
["appearance", I]
|
|
98
98
|
]);
|
|
99
|
-
function
|
|
99
|
+
function H(n, e, c) {
|
|
100
100
|
return e;
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const W = "https://json-schema.org/draft/2020-12/schema", G = "https://farris-design.gitee.io/expression-editor.schema.json", J = "expression-editor", Q = "A Farris Expression Editor Component", U = "object", X = {
|
|
103
103
|
id: {
|
|
104
104
|
description: "The unique identifier for a Expression Editor",
|
|
105
105
|
type: "string"
|
|
@@ -122,18 +122,18 @@ const H = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-de
|
|
|
122
122
|
},
|
|
123
123
|
default: {}
|
|
124
124
|
}
|
|
125
|
-
},
|
|
125
|
+
}, Y = [
|
|
126
126
|
"id",
|
|
127
127
|
"type"
|
|
128
|
-
],
|
|
129
|
-
$schema:
|
|
130
|
-
$id:
|
|
131
|
-
title:
|
|
132
|
-
description:
|
|
133
|
-
type:
|
|
134
|
-
properties:
|
|
135
|
-
required:
|
|
136
|
-
},
|
|
128
|
+
], Z = {
|
|
129
|
+
$schema: W,
|
|
130
|
+
$id: G,
|
|
131
|
+
title: J,
|
|
132
|
+
description: Q,
|
|
133
|
+
type: U,
|
|
134
|
+
properties: X,
|
|
135
|
+
required: Y
|
|
136
|
+
}, _ = "expression-editor", S = "A Farris Component", K = "object", ee = {
|
|
137
137
|
basic: {
|
|
138
138
|
description: "Basic Infomation",
|
|
139
139
|
title: "基本信息",
|
|
@@ -152,18 +152,18 @@ const H = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-de
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
},
|
|
156
|
-
title:
|
|
157
|
-
description:
|
|
158
|
-
type:
|
|
159
|
-
categories:
|
|
160
|
-
}, E = {}, j =
|
|
155
|
+
}, te = {
|
|
156
|
+
title: _,
|
|
157
|
+
description: S,
|
|
158
|
+
type: K,
|
|
159
|
+
categories: ee
|
|
160
|
+
}, E = {}, j = B(E, Z, L, H, te), b = /* @__PURE__ */ F({
|
|
161
161
|
name: "FExpressionEditor",
|
|
162
162
|
props: E,
|
|
163
163
|
emits: [],
|
|
164
164
|
setup(n, e) {
|
|
165
|
-
const c =
|
|
166
|
-
return
|
|
165
|
+
const c = D();
|
|
166
|
+
return N(() => {
|
|
167
167
|
}), () => l("div", {
|
|
168
168
|
ref: c,
|
|
169
169
|
class: "d-flex h-100 f-utils-flex-column",
|
|
@@ -205,14 +205,14 @@ const H = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-de
|
|
|
205
205
|
})]
|
|
206
206
|
})]);
|
|
207
207
|
}
|
|
208
|
-
}),
|
|
208
|
+
}), ne = /* @__PURE__ */ F({
|
|
209
209
|
name: "FExpressionEditorDesign",
|
|
210
210
|
props: E,
|
|
211
211
|
emits: [],
|
|
212
212
|
setup(n, e) {
|
|
213
|
-
return () => l(
|
|
213
|
+
return () => l(R, null, [x("expression editor design")]);
|
|
214
214
|
}
|
|
215
|
-
}),
|
|
215
|
+
}), ae = {
|
|
216
216
|
install(n) {
|
|
217
217
|
n.component(b.name, b);
|
|
218
218
|
},
|
|
@@ -220,12 +220,12 @@ const H = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-de
|
|
|
220
220
|
n["expression-editor"] = b, e["expression-editor"] = j;
|
|
221
221
|
},
|
|
222
222
|
registerDesigner(n, e, c) {
|
|
223
|
-
n["expression-editor"] =
|
|
223
|
+
n["expression-editor"] = ne, e["expression-editor"] = j;
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
export {
|
|
227
227
|
b as ExpressionEditor,
|
|
228
|
-
|
|
228
|
+
ae as default,
|
|
229
229
|
E as expressionEditorProps,
|
|
230
230
|
j as propsResolver
|
|
231
231
|
};
|
|
@@ -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 j={},O={};function N(r){const{properties:t,title:p,ignore:o}=r,s=o&&Array.isArray(o),g=Object.keys(t).reduce((l,u)=>((!s||!o.find(y=>y==u))&&(l[u]=t[u].type==="object"&&t[u].properties?N(t[u]):h.cloneDeep(t[u].default)),l),{});return(!s||!o.find(l=>l=="id"))&&(g.id=`${p}-${Date.now()}`),g}function C(r,t){const p=N(t);return Object.keys(r).reduce((o,s)=>(o[s]&&h.isPlainObject(o[s])&&h.isPlainObject(r[s])?Object.assign(o[s],r[s]):o[s]=r[s],o),p),p}function T(r,t){return Object.keys(r).filter(o=>r[o]!=null).reduce((o,s)=>{if(t.has(s)){const g=t.get(s);if(typeof g=="string")o[g]=r[s];else{const l=g(s,r[s],r);Object.assign(o,l)}}else o[s]=r[s];return o},{})}function $(r,t,p=new Map){const o=C(r,t);return T(o,p)}function M(r={}){function t(n,i,c,a){if(typeof c=="number")return a[n].length===c;if(typeof c=="object"){const d=Object.keys(c)[0],m=c[d];if(d==="not")return Number(a[n].length)!==Number(m);if(d==="moreThan")return Number(a[n].length)>=Number(m);if(d==="lessThan")return Number(a[n].length)<=Number(m)}return!1}function p(n,i,c,a){return a[n]&&a[n].propertyValue&&String(a[n].propertyValue.value)===String(c)}const o=new Map([["length",t],["getProperty",p]]);Object.keys(r).reduce((n,i)=>(n.set(i,r[i]),n),o);function s(n,i){const c=n;return typeof i=="number"?[{target:c,operator:"length",param:null,value:Number(i)}]:typeof i=="boolean"?[{target:c,operator:"getProperty",param:n,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(n){return Object.keys(n).reduce((c,a)=>{const d=s(a,n[a]);return c.push(...d),c},[])}function l(n,i){if(o.has(n.operator)){const c=o.get(n.operator);return c&&c(n.target,n.param,n.value,i)||!1}return!1}function u(n,i){return g(n).reduce((d,m)=>d&&l(m,i),!0)}function y(n,i){const c=Object.keys(n),a=c.includes("allOf"),d=c.includes("anyOf"),m=a||d,V=(m?n[m?a?"allOf":"anyOf":"allOf"]:[n]).map(L=>u(L,i));return a?!V.includes(!1):V.includes(!0)}return{parseValueSchema:y}}const F={},P={};M();function A(r,t,p=new Map,o=(l,u,y)=>u,s={},g=l=>l){return j[t.title]=t,O[t.title]=o,F[t.title]=s,P[t.title]=g,(l={})=>{const u=$(l,t,p),y=Object.keys(r).reduce((n,i)=>(n[i]=r[i].default,n),{});return Object.assign(y,u)}}function D(r,t){return{customClass:t.class,customStyle:t.style}}const R=new Map([["appearance",D]]);function q(r,t,p){return t}const w={$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,w,R,q,k),b=e.defineComponent({name:"FExpressionEditor",props:x,emits:[],setup(r,t){const p=e.ref();return e.onMounted(()=>{}),()=>e.createVNode("div",{ref:p,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("右侧区域")])]})]})]})]})])}}),z=e.defineComponent({name:"FExpressionEditorDesign",props:x,emits:[],setup(r,t){return()=>e.createVNode(e.Fragment,null,[e.createTextVNode("expression editor design")])}}),B={install(r){r.component(b.name,b)},register(r,t,p,o){r["expression-editor"]=b,t["expression-editor"]=E},registerDesigner(r,t,p){r["expression-editor"]=z,t["expression-editor"]=E}};f.ExpressionEditor=b,f.default=B,f.expressionEditorProps=x,f.propsResolver=E,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.fade{transition:opacity .
|
|
1
|
+
.fade-enter-active,.fade-leave-active{transition:opacity .5s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fv-resizable-handle{position:absolute;font-size:.1px;display:block;touch-action:none}.fv-resizable-handle:hover{background:#2a87ff12}.fv-resizable-handle.fv-resizable-n{cursor:n-resize;height:.4375rem;width:100%;top:-.3125rem;left:0}.fv-resizable-handle.fv-resizable-e{cursor:e-resize;width:.4375rem;right:-.3125rem;height:100%;top:0}.fv-resizable-handle.fv-resizable-s{cursor:s-resize;height:.4375rem;width:100%;bottom:-.3125rem;left:0}.fv-resizable-handle.fv-resizable-w{cursor:w-resize;height:100%;width:.4375rem;left:-.3125rem;top:0}.fv-resizable-handle.fv-resizable-ne{cursor:ne-resize;width:.75rem;height:.75rem;right:1px;top:1px}.fv-resizable-handle.fv-resizable-se{cursor:se-resize;width:.75rem;height:.75rem;right:1px;bottom:1px}.fv-resizable-handle.fv-resizable-nw{cursor:nw-resize;width:.75rem;height:.75rem;left:1px;top:1px}.fv-resizable-handle.fv-resizable-sw{cursor:sw-resize;width:.75rem;height:.75rem;left:1px;bottom:1px}.f-navlookup-recommandLabel{height:18px;font-family:PingFangSC-Regular;font-size:13px;color:#3d4c6b;font-weight:400;cursor:pointer}.f-navlookup-recentHeader{height:32px;background:#fafaff;width:100%;display:flex;align-items:center;padding-left:10px;cursor:pointer;border:1px solid rgba(233,236,243,1)}.f-listview-item-active,.f-listview-item-hover{background-color:#dae9ff!important}.f-listview-item{padding:0 .5rem 0 .3125rem;border-radius:3px}.screenGroup{background:#ffffffe6;box-shadow:0 0 3px #024bc133;border-radius:8px;padding:2px 14px;margin:5px auto;flex:1 1 0!important}.screenGroup .screenName{width:90px;font-family:PingFangSC-Regular;font-size:14px;line-height:24px;color:#2a87ff;height:32px;padding:4px;text-align:left}.screenGroup .screen-input{flex:1 1 0}.screenGroup farris-combo-list{width:84px}.screenGroup .columnText{line-height:26px}.applyBtn{margin-top:5px;display:flex;justify-content:center}.applyBtn .btn{width:110px}.en .screenGroup{width:100%;flex-direction:column;align-items:flex-start}.en .screenGroup>div{width:100%;padding:0 10px 10px 0;margin-left:0!important}.en .screenGroup .screenName{width:auto}.en .screenGroup farris-combo-list{flex:1}.en .screenGroup .columnText{width:50px}.f-import-exteranl-component-button{border:1px solid #cbd1e7;margin:5px;display:flex;position:relative;cursor:pointer}.f-import-exteranl-component-button-center{text-align:center;position:absolute;left:50%;transform:translate(-50%);width:100%}.f-import-exteranl-component-button-name{font-family:PingFangSC-Regular;font-size:14px;color:#a2a9b9;flex:90%;margin:2px 0}
|