x-prop-tree 0.8.26 → 0.8.28
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/dist/i18n-en.iiploulp.js +19 -0
- package/dist/i18n-zhHans.bb5g1fpp.js +19 -0
- package/dist/index.js +3561 -1
- package/dist/rolldown-runtime.c6i0pdwe.js +18 -0
- package/dist/vendor.o2dszt6f.js +3079 -0
- package/package.json +10 -15
- package/dist/i18n-en.bjdqf6it.js +0 -1
- package/dist/i18n-zhHans.erc38kn7.js +0 -1
- package/dist/rolldown-runtime.mam1o4z7.js +0 -1
- package/dist/vendor.e8wfa9wu.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1,3561 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./vendor.e8wfa9wu.js";import{Fragment as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,createTextVNode as l,createVNode as u,defineComponent as d,h as f,inject as p,isRef as m,mergeModels as h,mergeProps as g,normalizeStyle as _,onBeforeUnmount as v,onMounted as y,onUnmounted as b,openBlock as x,provide as S,ref as C,renderList as w,renderSlot as T,resolveComponent as E,resolveDirective as D,toDisplayString as O,unref as k,useId as A,useModel as j,useTemplateRef as M,watch as N,watchEffect as P,withCtx as F,withDirectives as I,withKeys as L,withModifiers as R}from"vue";import{eventBus as z,globalObjects as ee,injectDark as te,injectLocale as ne,openNumberDlg as re,openPromptDlg as ie,useColor as B,useSystem as V,useViewStack as H}from"x-essential-lib";import{getElement as ae,getItems as oe,getPropertyDefault as U,getPropertyDefaultArray as W,getTag as se,getTypes as ce,isHexColor as le,isThemeColor as ue,makeSlotId as de,parseNumberUnit as fe,pkgs as pe,rules as me,themeColors as he,unwrapSlotId as ge}from"x-runtime-lib";import{getListEntry as G,setCollapse as _e,tidyList as ve}from"x-group-list";import{useI18n as K}from"vue-i18n";import{globalState as ye}from"x-state-lib";import{useDisplay as be}from"vuetify";import{XBlockly as xe}from"x-block-lib";function Se(e,t){let n={key:``,name:``,children:e};for(let e of t)if(typeof e!=`number`){if(!n)throw Error(`target must be valid`);if(n.ui)throw Error(`target ui must be invalid`);n=n.children.find(t=>t.key===e)}return n}function q(e,t){let n=e;for(let e of t){if(!n)throw Error(`target must be valid`);n=n[e]}return n}function Ce(t,n,r,i,a,o){if(i!==void 0&&!a){if(!(r[i]instanceof Array)){let a=W(n);e(a,r[i])||(r[i]=a,o(t,r[i]))}return r[i]}else{if(!(r[n.key]instanceof Array)){let i=W(n);e(i,r[n.key])||(r[n.key]=i,o(t,r[n.key]))}return r[n.key]}}function J(t,n,r,i,a,o){if(i!==void 0&&!a){if(r[i]===void 0){let a=U(n);e(a,r[i])||(r[i]=a,o(t,r[i]))}return r[i]}else{if(r[n.key]===void 0){let i=U(n);e(i,r[n.key])||(r[n.key]=i,o(t,r[n.key]))}return r[n.key]}}function Y(n,r,i,a,o,s,c){o!==void 0&&!s?e(a,i[o])||(i[o]=t(a),c(n,i[o])):e(a,i[r.key])||(i[r.key]=t(a),c(n,i[r.key]))}function X(e,t){let n=e.value;for(let e of t){if(!n.children[e])return!0;n=n.children[e]}return n.collapse}function we(e,t,n){let r=e.value;for(let e of t)r.children[e]||(r.children[e]={collapse:!0,children:{}}),r=r.children[e];r.collapse=n}const Te=[`key`,`name`,`children`,`default`,`arrayDefault`];function Ee(t,r){function i(t,r){if(!e(n(t,Te),n(r,Te)))return!1;if(t.ui||r.ui)return!0;if(t.children.length!==r.children.length)return!1;for(let e=0;e<t.children.length;e++)if(!i(t.children[e],r.children[e]))return!1;return!0}return i(t,r)}function De(e,t,n,r,i,a){function o(e,t,n,r,i){if(t.ui){if(t.readonly||t.static)return;Y(e,t,n,r,i,!1,a)}else if(t.array)Y(e,t,n,r,i,!1,a);else for(let i of t.children)typeof n==`object`&&typeof r==`object`&&o([...e,i.key],i,n[t.key],r[i.key],void 0)}o(e,t,n,r,i)}const Oe=[[`basic`,`id`],[`basic`,`name`]];function ke(t){return Oe.find(n=>e(t,n))}function Ae(e,n,r,i,a,o,s){return e=t(e),a===void 0?e.push(n.key):(e.push(a),o&&e.push(n.key)),e?.[0]===`runtime`?{change:!1,warning:!1}:ke(e)?(i.change=!1,i.warning=!1,{change:i.change,warning:i.warning}):n.ui?n.array&&!s?Ne(e,n,r,i,a,o):Pe(n,r,i,a,o):n.array?je(e,n,r,i,a,o):Me(e,n,r,i,a,o)}function je(t,n,r,i,a,o){if(n.ui)throw Error(`execPropertyBranchArray property ui must be invalid`);if(!n.array)throw Error(`execPropertyBranchArray property array must be valid`);let s;if(s=a!==void 0&&!o?r[a]:r[n.key],!(s instanceof Array))return i.change=!1,i.warning=!1,{change:!1,warning:!1};for(let e=0;e<s.length;e++){i.children[e]={change:!1,warning:!1,children:{}};let r=i.children[e];for(let a of n.children){r.children[a.key]={change:!1,warning:!1,children:{}};let{change:n,warning:o}=Ae(t,a,s[e],r.children[a.key],e,!0);!r.change&&n&&(r.change=n),!r.change&&o&&(r.warning=o),!i.change&&r.change&&(i.change=r.change),!i.warning&&r.warning&&(i.warning=r.warning)}}return i.change||(i.change=!e(s,W(n))),{change:i.change,warning:i.warning}}function Me(e,t,n,r,i,a){if(t.ui)throw Error(`execPropertyBranchScalar property ui must be invalid`);if(t.array)throw Error(`execPropertyBranchScalar property array must be invalid`);let o;if(o=i!==void 0&&!a?n[i]:n[t.key],o===void 0)return r.change=!1,r.warning=!1,{change:!1,warning:!1};for(let n=0;n<t.children.length;n++){let i=t.children[n];r.children[i.key]={change:!1,warning:!1,children:{}};let{change:a,warning:s}=Ae(e,i,o,r.children[i.key],void 0,!1);!r.change&&a&&(r.change=a),!r.warning&&s&&(r.warning=s)}return{change:r.change,warning:r.change}}function Ne(t,n,r,i,a,o){if(!n.ui)throw Error(`execPropertyLeafArray property ui must be valid`);if(!n.array)throw Error(`execPropertyLeafArray property aray must be valid`);let s;if(s=a!==void 0&&!o?r[a]:r[n.key],!(s instanceof Array))return i.change=!1,i.warning=!1,{change:!1,warning:!1};for(let e=0;e<s.length;e++){i.children[e]={change:!1,warning:!1,children:{}};let{change:r,warning:a}=Ae(t,n,s,i.children[e],e,!1,!0);!i.change&&r&&(i.change=r),!i.warning&&a&&(i.warning=a)}return i.change||(i.change=!e(s,W(n))),{change:i.change,warning:i.warning}}function Pe(t,n,r,i,a){if(!t.ui)throw Error(`execPropertyLeafScalar property ui must be valid`);let o;return o=i!==void 0&&!a?n[i]:n[t.key],r.change=!e(o,U(t)),t.ui===`comp`||t.ui===`slot`||t.ui,{change:r.change,warning:r.warning}}function Fe(e,t,n){if(t.length<=0||!n){e.value={change:!1,warning:!1,children:{}};return}let r={change:!1,warning:!1,children:{}};for(let e of t){let t={change:!1,warning:!1,children:{}};r.children[e.key]=t,Ae([],e,n,t,void 0,!1)}e.value=r}function Z(e,t){let n=e;for(let e of t){if(!n.children[e])return!1;n=n.children[e]}return n.change}function Q(e,t){let n=e;for(let e of t){if(!n.children[e])return!1;n=n.children[e]}return!!n.warning}const Ie=Symbol(),Le=Symbol(),Re=Symbol(),ze=Symbol(),Be=Symbol(),Ve=Symbol(),He=Symbol(),Ue=Symbol(),We=Symbol(),Ge=Symbol(),Ke=Symbol();function qe(e){S(Ie,e)}function Je(){return p(Ie)}function Ye(e){S(Le,e)}function Xe(){return p(Le)}function Ze(e){S(Re,e)}function Qe(){return p(Re)}function $e(e){S(ze,e)}function et(){return p(ze)}function tt(e){S(Be,e)}function nt(){return p(Be)}function rt(e){S(Ve,e)}function it(){return p(Ve)}function at(e){S(He,e)}function ot(){return p(He)}function st(e){S(Ue,e)}function $(){return p(Ue)}function ct(e){S(We,e)}function lt(){return p(We)}function ut(e){S(Ge,e)}function dt(){return p(Ge)}function ft(e){S(Ke,e)}function pt(){return p(Ke)}function mt(t,n,r,i){if(n.ui){if(n.readonly||n.static)return;if(n.array){let a=t[n.key],o=W(n);e(o,a)||(t[n.key]=o,i([...r,n.key],o))}else{let a=t[n.key],o=U(n);e(o,a)||(t[n.key]=o,i([...r,n.key],o))}}else if(n.array){let a=t[n.key],o=W(n);e(o,a)||(t[n.key]=o,i([...r,n.key],o))}else for(let e of n.children)mt(t[n.key],e,[...r,n.key],i)}function ht(t,n,r,i){let a=r.at(-1);if(a===void 0)return;let o=Se(n,r);if(o)if(o.ui){if(o.readonly||o.static)return;if(o.array)if(typeof a==`string`){let n=q(t,r.slice(0,-1));if(!n)return;let s=n[a],c=W(o);e(c,s)||(n[a]=c,i(r,c))}else{let n=q(t,r.slice(0,-1));if(!n)return;let s=n[a],c=U(o);e(c,s)||(n[a]=c,i(r,c))}else{let n=q(t,r.slice(0,-1));if(!n)return;let s=n[a],c=U(o);e(c,s)||(n[a]=c,i(r,c))}}else if(o.array)if(typeof a==`string`){let n=q(t,r.slice(0,-1));if(!n)return;let s=n[a],c=W(o);e(c,s)||(n[a]=c,i(r,c))}else{let e=q(t,r);if(!e)return;for(let t of o.children)mt(e,t,r,i)}else{let e=q(t,r);if(!e)return;for(let t of o.children)mt(e,t,r,i)}}function gt(e){let{t}=K(),n=et(),r=nt();function i(){return!0}function a(){let t=Se(n.value,e.value);if(!t)return;let i={property:t,object:q(r.value,e.value)};localStorage.setItem(`propTreeCopy`,JSON.stringify(i))}function o(e){i()&&e.push({title:t(`x-prop-tree.copy`),func:a})}return{tryPushCopy:o}}function _t(e){let{t}=K(),n=et(),r=nt(),i=$();function a(){if(e.value.length<=0)return!1;let t=Se(n.value,e.value);if(!t)return!1;let r=localStorage.getItem(`propTreeCopy`);if(!r)return!1;let i;try{i=JSON.parse(r)}catch(e){return console.error(`parse propTreeCopy failed`,e),!1}return!!Ee(t,i.property)}function o(){if(e.value.length<=0)return;let t=Se(n.value,e.value);if(!t)return;let a=localStorage.getItem(`propTreeCopy`);if(!a)return;let o;try{o=JSON.parse(a)}catch(e){console.error(`parse propTreeCopy failed`,e);return}if(!Ee(t,o.property))return;let s=q(r.value,e.value.slice(0,-1));if(!s)return;let c=e.value.at(-1);De(e.value,t,s,o.object,typeof c==`number`?c:void 0,i)}function s(e){a()&&e.push({title:t(`x-prop-tree.paste`),func:o})}return{tryPushPaste:s}}function vt(e){let{t}=K(),n=et(),r=nt(),i=ot(),a=$();function o(){return!(e.value.length<=0||!Z(i.value,e.value))}function s(){ht(r.value,n.value,e.value,a)}function c(e){o()&&e.push({title:t(`x-prop-tree.reset`),func:s})}return{tryPushReset:c}}var yt=d({__name:`index`,setup(e){let t=C(0),n=C(0),o=C([]),c=i(()=>[t.value,n.value]),{tryPushCopy:d}=gt(o),{tryPushPaste:f}=_t(o),{tryPushReset:p}=vt(o),h=i(()=>{let e=[];return d(e),f(e),p(e),e}),{open:g}=H(`propTreeMenu`,e=>{t.value=e.x,n.value=e.y,o.value=e.keys});return(e,t)=>{let n=E(`v-list-item-title`),i=E(`v-list-item`),o=E(`v-list`),d=E(`v-menu`);return x(),a(d,{modelValue:k(g),"onUpdate:modelValue":t[0]||(t[0]=e=>m(g)?g.value=e:null),"location-strategy":`connected`,scrim:`transparent`,target:c.value},{default:F(()=>[u(o,null,{default:F(()=>[(x(!0),s(r,null,w(h.value,(e,t)=>(x(),a(i,{key:t,link:``,onClick:e.func},{default:F(()=>[u(n,null,{default:F(()=>[l(O(e.title),1)]),_:2},1024)]),_:2},1032,[`onClick`]))),128))]),_:1})]),_:1},8,[`modelValue`,`target`])}}});const bt={style:{pointerEvents:`none`}};var xt=d({__name:`index`,props:{title:{type:String,required:!0},collapse:{type:Boolean,required:!0},hasCreate:{type:Boolean,required:!1,default:!1},hasDelete:{type:Boolean,required:!1,default:!1},index:{type:Number,required:!1,default:0}},emits:[`collapse`,`menu`,`create`,`delete`],setup(e,{emit:t}){let{backgroundColor2:n,highlightColor:r}=B(),l=t,d=C(!1),f=i(()=>({background:d.value?r.value:n.value,height:`36px`,marginBottom:`1px`,userSelect:`none`})),p=()=>{l(`collapse`,!e.collapse)},m=e=>{l(`menu`,e.clientX,e.clientY)};return(t,n)=>{let r=E(`v-icon`),i=E(`v-spacer`),h=E(`v-btn`),g=D(`ripple`);return I((x(),s(`div`,{class:`d-flex align-center cursor-pointer`,style:_(f.value),onClick:p,onContextmenu:R(m,[`self`,`prevent`]),onMouseout:n[2]||(n[2]=e=>d.value=!1),onMouseover:n[3]||(n[3]=e=>d.value=!0)},[u(r,{class:`mr-1`,icon:e.collapse?`mdi-chevron-right`:`mdi-chevron-down`},null,8,[`icon`]),c(`span`,bt,O(e.title),1),u(i),e.hasCreate?(x(),a(h,{key:0,class:`mx-3`,density:`compact`,icon:`mdi-plus`,variant:`text`,onClick:n[0]||(n[0]=R(e=>l(`create`),[`stop`]))})):o(`v-if`,!0),e.hasDelete?(x(),a(h,{key:1,class:`mx-3`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:n[1]||(n[1]=R(t=>l(`delete`,e.index),[`stop`]))})):o(`v-if`,!0)],36)),[[g]])}}});function St(){let e=Je(),t=Xe(),n=Qe(),{i18n:r}=ee,i=C([]);ft(i);let a=()=>{if(!e.value||!t.value||!n.value)return[];let a=pe[e.value];if(!a)return console.assert(!1,`invalid version=${e.value}`),[];let o=se(t.value,n.value),s=[];for(let e=0;e<a.groups[o].length;e++){let t=a.groups[o][e],n=G(i,t.key);s.push({id:t.key,type:0,name:r.global.t(t.name),position:e,collapse:n?.collapse??!0,count:0});let c=0;for(let e of t.items){let n=ae(e);if(n&&!n.internal&&n.slots)for(let e of n.slots){let i=de(`elementSlot`,n.key,e.key),a=`${r.global.t(n.name)} / ${r.global.t(e.name)}`;s.push({id:i,type:1,name:a,position:c++,group:t.key,names:[n.name,e.name]})}}}let{activeApp:c,depends:l}=ye.app;for(let{id:e,name:t,position:n}of c.compGroups){let r=G(i,e);s.push({id:e,type:0,name:t,position:n,collapse:r?.collapse??!0})}let u=0;for(let e of c.comps){let t=l[e.id];if(t&&t.meta.slots)for(let n of t.meta.slots){let t=de(`customSlot`,e.id,n.id),r=`${e.name} / ${n.name}`;s.push({id:t,type:1,name:r,position:u++,group:e.groupId,names:[e.name,n.name]})}}return ve(s,!0)},o=()=>{i.value=a()},s,c=()=>{clearTimeout(s),s=window.setTimeout(()=>{o(),s&&c()},1e3)},l=()=>{clearTimeout(s),s=void 0};y(()=>{c()}),v(()=>{l()}),N([e,t,n],()=>{o(),c()})}function Ct(){let e=C([]);ct(e);let t=()=>{let{activeApp:t,depends:n}=ye.app,r=[];for(let{id:n,name:i,position:a}of t.compGroups){let t=e.value.find(e=>e.id===n);r.push({id:n,type:0,name:i,position:a,collapse:t?.collapse??!0})}for(let{id:e,groupId:i,name:a,position:o}of t.comps)n[e]&&r.push({id:e,type:1,name:a,position:o,group:i});e.value=ve(r,!0)},n,r=()=>{clearTimeout(n),n=window.setTimeout(()=>{t(),n&&r()},1e3)},i=()=>{clearTimeout(n),n=void 0};y(()=>{r()}),v(()=>{i()})}function wt(){let e=C([]);ut(e);let t=()=>{let{activeObject:e,activeComp:t}=ye.app;if(e.type!==`comp`||!t.meta.slots)return[];let n=[];for(let{id:e,name:r}of t.meta.slots)n.push({id:e,name:r});return n},n=()=>{e.value=t()},r,i=()=>{clearTimeout(r),r=window.setTimeout(()=>{n(),r&&i()},1e3)},a=()=>{clearTimeout(r),r=void 0};y(()=>{i()}),v(()=>{a()})}const Tt={class:`text-label-large ml-1`},Et={class:`text-body-small text-grey ml-1`};var Dt=d({__name:`group`,props:{id:{type:String,required:!0},title:{type:String,required:!0},collapse:{type:Boolean,required:!0},count:{type:Number,required:!0}},emits:[`x-click`],setup(e,{emit:t}){let{backgroundColor2:n,highlightColor:r}=B(),a=t,o=C(!1),l=i(()=>({background:o.value?r.value:n.value,height:`30px`,marginTop:`1px`,userSelect:`none`}));return(t,n)=>{let r=E(`v-icon`),i=D(`ripple`);return I((x(),s(`div`,{class:`d-flex align-center cursor-pointer`,style:_(l.value),onClick:n[0]||(n[0]=t=>a(`x-click`,e.id)),onMouseout:n[1]||(n[1]=e=>o.value=!1),onMouseover:n[2]||(n[2]=e=>o.value=!0)},[u(r,{icon:e.collapse?`mdi-chevron-right`:`mdi-chevron-down`,size:`small`},null,8,[`icon`]),c(`span`,Tt,O(e.title),1),c(`span`,Et,O(e.count),1)],36)),[[i]])}}});const Ot={class:`text-body-large ml-6`};var kt=d({__name:`item`,props:{id:{type:String,required:!0},title:{type:String,required:!0}},emits:[`x-click`],setup(e,{emit:t}){let{backgroundColor2:n,highlightColor:r}=B(),a=t,o=C(!1),l=i(()=>({background:o.value?r.value:n.value,height:`48px`,marginTop:`1px`,userSelect:`none`}));return(t,n)=>{let r=D(`ripple`);return I((x(),s(`div`,{class:`d-flex align-center cursor-pointer`,style:_(l.value),onClick:n[0]||(n[0]=t=>a(`x-click`,e.id)),onMouseout:n[1]||(n[1]=e=>o.value=!1),onMouseover:n[2]||(n[2]=e=>o.value=!0)},[c(`span`,Ot,O(e.title),1)],36)),[[r]])}}});const At={key:0},jt={key:1,class:`text-body-medium text-grey ml-3`};var Mt=d({__name:`index`,props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:h([`x-select`],[`update:open`]),setup(e,{emit:t}){let{t:n}=K(),i=j(e,`open`),c=t,l=pt(),u=e=>{let t=G(l,e);t&&_e(l,e,!t.collapse)},d=e=>{i.value=!1,c(`x-select`,e)};return(e,t)=>k(l).length>0?(x(),s(`div`,At,[(x(!0),s(r,null,w(k(l),e=>(x(),s(r,{key:e.id},[e.type===0?(x(),a(Dt,{key:0,id:e.id,collapse:e.collapse,count:e.count??0,title:e.name,onXClick:u},null,8,[`id`,`collapse`,`count`,`title`])):o(`v-if`,!0),e.type===1&&e.show?(x(),a(kt,{key:1,id:e.id,title:e.name,onXClick:d},null,8,[`id`,`title`])):o(`v-if`,!0)],64))),128))])):(x(),s(`div`,jt,O(k(n)(`x-prop-tree.noAdaptSlot`)),1))}});const Nt={class:`text-body-large`};var Pt=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:[Object,null],default:null},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(n,{emit:r}){let{t:s}=K(),d=be(),{sysBarAvail:f}=V(),{backgroundColor1:p}=B(),h=j(n,`modelValue`),v=r,y=pt(),S=i(()=>{let e=`100%`;return d.mdAndUp.value&&(e=`400px`),{background:p.value,width:e,height:`100%`}}),C=i(()=>{let e=48;return f.value&&(e+=24),{position:`relative`,height:`calc(100% - ${e}px)`}}),w=i(()=>({height:`60px`}));P(()=>{if(!h.value)return;let n=G(y,h.value.id);n&&!e(n.names,h.value.names)&&(h.value={...h.value,names:t(n.names)})});let T=i(()=>{if(h.value){let{kind:e}=ge(h.value.id);return e===`elementSlot`||e===`multipleElementSlot`?h.value.names.map(e=>s(e)).join(` / `):h.value.names.join(` / `)}else return s(`x-runtime-lib.notSet`)}),{open:D}=H(`propTreeAdaptSlotSelectDlg${A()}`);b(()=>{D.value=!1});function M(e){if(!e){h.value=null;return}let t=G(y,e);if(!t){h.value=null;return}h.value={id:t.id,names:t.names}}return(e,t)=>{let r=E(`v-btn`),i=E(`v-sheet`),d=E(`v-dialog`);return x(),a(d,{modelValue:k(D),"onUpdate:modelValue":t[5]||(t[5]=e=>m(D)?D.value=e:null),fullscreen:``,"no-click-animation":``,persistent:``,transition:`scroll-x-reverse-transition`,onKeydown:t[6]||(t[6]=L(R(e=>D.value=!1,[`stop`,`prevent`]),[`esc`]))},{activator:F(({props:e})=>[u(r,g(e,{block:``,density:`comfortable`,readonly:n.readonly}),{default:F(()=>[l(O(T.value),1)]),_:1},16,[`readonly`]),n.hasDelete?(x(),a(r,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:t[0]||(t[0]=R(e=>v(`delete`),[`stop`]))})):o(`v-if`,!0)]),default:F(()=>[c(`div`,{class:`w-100 h-100 d-flex flex-row-reverse`,onClick:t[3]||(t[3]=R(e=>D.value=!1,[`self`])),onContextmenu:t[4]||(t[4]=R(e=>D.value=!1,[`self`,`prevent`]))},[c(`div`,{class:`elevation-2`,style:_(S.value)},[k(f)?(x(),a(i,{key:0,color:`transparent`,height:24})):o(`v-if`,!0),u(i,{class:`d-flex align-center px-3`,color:`transparent`,height:48},{default:F(()=>[u(r,{density:`comfortable`,icon:`mdi-close`,variant:`text`,onClick:t[1]||(t[1]=e=>D.value=!1)}),c(`span`,Nt,O(k(s)(`x-prop-tree.selectAdaptSlot`)),1)]),_:1}),c(`div`,{class:`overflow-y-auto`,style:_(C.value)},[u(Mt,{open:k(D),"onUpdate:open":t[2]||(t[2]=e=>m(D)?D.value=e:null),onXSelect:M},null,8,[`open`]),c(`div`,{style:_(w.value)},null,4)],4)],4)],32)]),_:1},8,[`modelValue`])}}});const Ft={class:`text-label-large ml-1`},It={class:`text-body-small text-grey ml-1`};var Lt=d({__name:`group`,props:{id:{type:String,required:!0},title:{type:String,required:!0},collapse:{type:Boolean,required:!0},count:{type:Number,required:!0}},emits:[`x-click`],setup(e,{emit:t}){let{backgroundColor2:n,highlightColor:r}=B(),a=t,o=C(!1),l=i(()=>({background:o.value?r.value:n.value,height:`30px`,marginTop:`1px`,userSelect:`none`}));return(t,n)=>{let r=E(`v-icon`),i=D(`ripple`);return I((x(),s(`div`,{class:`d-flex align-center cursor-pointer`,style:_(l.value),onClick:n[0]||(n[0]=t=>a(`x-click`,e.id)),onMouseout:n[1]||(n[1]=e=>o.value=!1),onMouseover:n[2]||(n[2]=e=>o.value=!0)},[u(r,{icon:e.collapse?`mdi-chevron-right`:`mdi-chevron-down`,size:`small`},null,8,[`icon`]),c(`span`,Ft,O(e.title),1),c(`span`,It,O(e.count),1)],36)),[[i]])}}});const Rt={class:`text-body-large ml-6`};var zt=d({__name:`item`,props:{id:{type:String,required:!0},title:{type:String,required:!0}},emits:[`x-click`],setup(e,{emit:t}){let{backgroundColor2:n,highlightColor:r}=B(),a=t,o=C(!1),l=i(()=>({background:o.value?r.value:n.value,height:`48px`,marginTop:`1px`,userSelect:`none`}));return(t,n)=>{let r=D(`ripple`);return I((x(),s(`div`,{class:`d-flex align-center cursor-pointer`,style:_(l.value),onClick:n[0]||(n[0]=t=>a(`x-click`,e.id)),onMouseout:n[1]||(n[1]=e=>o.value=!1),onMouseover:n[2]||(n[2]=e=>o.value=!0)},[c(`span`,Rt,O(e.title),1)],36)),[[r]])}}});const Bt={key:0},Vt={key:1,class:`text-body-medium text-grey ml-3`};var Ht=d({__name:`index`,props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:h([`x-select`],[`update:open`]),setup(e,{emit:t}){let{t:n}=K(),i=j(e,`open`),c=t,l=lt();function u(e){let t=G(l,e);t&&_e(l,e,!t.collapse)}function d(e){i.value=!1,c(`x-select`,e),z.emit(`refreshDepends`)}return(e,t)=>k(l).length>0?(x(),s(`div`,Bt,[(x(!0),s(r,null,w(k(l),e=>(x(),s(r,{key:e.id},[e.type===0?(x(),a(Lt,{key:0,id:e.id,collapse:e.collapse,count:e.count??0,title:e.name,onXClick:u},null,8,[`id`,`collapse`,`count`,`title`])):o(`v-if`,!0),e.type===1&&e.show?(x(),a(zt,{key:1,id:e.id,title:e.name,onXClick:d},null,8,[`id`,`title`])):o(`v-if`,!0)],64))),128))])):(x(),s(`div`,Vt,O(k(n)(`x-prop-tree.noComp`)),1))}});const Ut={class:`text-body-large`};var Wt=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:[Object,null],default:null},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{t:n}=K(),r=be(),{sysBarAvail:s}=V(),{backgroundColor1:d}=B(),f=j(e,`modelValue`),p=t,h=lt(),v=i(()=>{let e=`100%`;return r.mdAndUp.value&&(e=`400px`),{background:d.value,width:e,height:`100%`}}),y=i(()=>{let e=48;return s.value&&(e+=24),{position:`relative`,height:`calc(100% - ${e}px)`}}),S=i(()=>({height:`60px`}));P(()=>{if(!f.value)return;let e=G(h,f.value.id);e&&e.name!==f.value.name&&(f.value={...f.value,name:e.name})});let C=i(()=>f.value?f.value.name:n(`x-runtime-lib.notSet`)),{open:w}=H(`propTreeCompSelectDlg${A()}`);b(()=>{w.value=!1});function T(e){if(!e){f.value=null;return}let t=G(h,e);if(!t){f.value=null;return}f.value={id:t.id,name:t.name}}return(t,r)=>{let i=E(`v-btn`),d=E(`v-sheet`),f=E(`v-dialog`);return x(),a(f,{modelValue:k(w),"onUpdate:modelValue":r[5]||(r[5]=e=>m(w)?w.value=e:null),fullscreen:``,"no-click-animation":``,persistent:``,transition:`scroll-x-reverse-transition`,onKeydown:r[6]||(r[6]=L(R(e=>w.value=!1,[`stop`,`prevent`]),[`esc`]))},{activator:F(({props:t})=>[u(i,g(t,{block:``,density:`comfortable`,readonly:e.readonly}),{default:F(()=>[l(O(C.value),1)]),_:1},16,[`readonly`]),e.hasDelete?(x(),a(i,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:r[0]||(r[0]=R(e=>p(`delete`),[`stop`]))})):o(`v-if`,!0)]),default:F(()=>[c(`div`,{class:`w-100 h-100 d-flex flex-row-reverse`,onClick:r[3]||(r[3]=R(e=>w.value=!1,[`self`])),onContextmenu:r[4]||(r[4]=R(e=>w.value=!1,[`self`,`prevent`]))},[c(`div`,{class:`elevation-2`,style:_(v.value)},[k(s)?(x(),a(d,{key:0,color:`transparent`,height:24})):o(`v-if`,!0),u(d,{class:`d-flex align-center px-3`,color:`transparent`,height:48},{default:F(()=>[u(i,{density:`comfortable`,icon:`mdi-close`,variant:`text`,onClick:r[1]||(r[1]=e=>w.value=!1)}),c(`span`,Ut,O(k(n)(`x-prop-tree.selectComp`)),1)]),_:1}),c(`div`,{class:`overflow-y-auto`,style:_(y.value)},[u(Ht,{open:k(w),"onUpdate:open":r[2]||(r[2]=e=>m(w)?w.value=e:null),onXSelect:T},null,8,[`open`]),c(`div`,{style:_(S.value)},null,4)],4)],4)],32)]),_:1},8,[`modelValue`])}}});const Gt={class:`d-flex justify-space-between align-center`};var Kt=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:String,required:!0},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{isMobile:n}=V(),r=j(e,`modelValue`),i=t,c=async t=>{if(!t||e.readonly||!n())return;let i=await ie({title:``,value:r.value});i!==void 0&&(r.value=i)};return(t,n)=>{let l=E(`v-text-field`),d=E(`v-btn`),f=D(`ripple`);return x(),s(`div`,Gt,[I(u(l,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),density:`compact`,"hide-details":``,readonly:e.readonly,"single-line":``,"onUpdate:focused":c},null,8,[`modelValue`,`readonly`]),[[f,void 0,void 0,{stop:!0}]]),e.hasDelete?(x(),a(d,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:n[1]||(n[1]=R(e=>i(`delete`),[`stop`]))})):o(`v-if`,!0)])}}}),qt=d({__name:`editor`,props:{modelValue:{type:String,required:!0},modelModifiers:{},lock:{type:Boolean,required:!0},lockModifiers:{},scale:{type:Number,required:!0},scaleModifiers:{}},emits:[`update:modelValue`,`update:lock`,`update:scale`],setup(e,{expose:t}){let n=j(e,`modelValue`),r=j(e,`lock`),i=j(e,`scale`),o=te(),s=ne(),c=Je(),l=M(`target`),u=()=>{let e=JSON.parse(n.value);l.value?.load(e)};return t({save:()=>{let e=l.value.save();n.value=JSON.stringify(e,null,2)}}),(e,t)=>(x(),a(k(xe),{ref_key:`target`,ref:l,lock:r.value,"onUpdate:lock":t[0]||(t[0]=e=>r.value=e),scale:i.value,"onUpdate:scale":t[1]||(t[1]=e=>i.value=e),dark:k(o),locale:k(s),type:`json`,version:k(c),onReady:u},null,8,[`lock`,`scale`,`dark`,`locale`,`version`]))}});const Jt={class:`text-body-large`};var Yt=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:String,required:!0},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{t:n}=K(),{sysBarAvail:r}=V(),{backgroundColor0:s,backgroundColor1:d,backgroundColor2:f}=B(),p=j(e,`modelValue`),h=t,v=C(!1),y=C(1),S=i(()=>{let e=48;return r.value&&(e+=24),{position:`relative`,background:d.value,height:`calc(100% - ${e}px)`}}),w=i(()=>n(`x-prop-tree.jsonEditor`)),{open:T}=H(`propTreejsonEditorDlg${A()}`);b(()=>{T.value=!1});let D=M(`editor`);return N(T,e=>{e||D.value?.save()}),(t,n)=>{let i=E(`v-btn`),d=E(`v-sheet`),b=E(`v-spacer`),C=E(`v-dialog`);return x(),a(C,{modelValue:k(T),"onUpdate:modelValue":n[5]||(n[5]=e=>m(T)?T.value=e:null),attach:``,fullscreen:``,"no-click-animation":``,persistent:``,transition:`dialog-bottom-transition`,onKeydown:n[6]||(n[6]=L(R(e=>T.value=!1,[`stop`,`prevent`]),[`esc`]))},{activator:F(({props:t})=>[u(i,g(t,{block:``,density:`comfortable`,readonly:e.readonly}),{default:F(()=>[l(O(w.value),1)]),_:1},16,[`readonly`]),e.hasDelete?(x(),a(i,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:n[0]||(n[0]=R(e=>h(`delete`),[`stop`]))})):o(`v-if`,!0)]),default:F(()=>[u(d,{color:k(s),height:`100%`,width:`100%`},{default:F(()=>[k(r)?(x(),a(d,{key:0,color:k(f),height:24},null,8,[`color`])):o(`v-if`,!0),u(d,{class:`d-flex align-center px-2`,color:k(f),height:48},{default:F(()=>[u(i,{density:`comfortable`,icon:`mdi-close`,variant:`text`,onClick:n[1]||(n[1]=e=>T.value=!1)}),c(`span`,Jt,O(w.value),1),u(b)]),_:1},8,[`color`]),c(`div`,{style:_(S.value)},[u(qt,{ref_key:`editor`,ref:D,modelValue:p.value,"onUpdate:modelValue":n[2]||(n[2]=e=>p.value=e),lock:v.value,"onUpdate:lock":n[3]||(n[3]=e=>v.value=e),scale:y.value,"onUpdate:scale":n[4]||(n[4]=e=>y.value=e)},null,8,[`modelValue`,`lock`,`scale`])],4)]),_:1},8,[`color`])]),_:1},8,[`modelValue`])}}});const Xt={class:`d-flex justify-space-between align-center`};var Zt=d({__name:`color`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:String},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{t:n}=K(),r=j(e,`modelValue`),s=t,d=i(()=>{let t=`100%`;return e.hasDelete&&(t=`calc(100% - 37px)`),{width:t}}),f=i(()=>e.readonly),{open:p}=H(`propTreeColorPickerMenu${A()}`);return b(()=>{p.value=!1}),(t,i)=>{let h=E(`v-btn`),v=E(`v-color-picker`),y=E(`v-menu`);return x(),a(y,{modelValue:k(p),"onUpdate:modelValue":i[2]||(i[2]=e=>m(p)?p.value=e:null),"close-on-content-click":!1,scrim:`transparent`},{activator:F(({props:t})=>[c(`div`,Xt,[c(`div`,{class:`flex-grow-1`,style:_(d.value)},[u(h,g(t,{block:``,color:r.value,density:`comfortable`,disabled:f.value}),{default:F(()=>[l(O(r.value?r.value:k(n)(`x-runtime-lib.notSet`)),1)]),_:1},16,[`color`,`disabled`])],4),e.hasDelete?(x(),a(h,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:i[0]||(i[0]=R(e=>s(`delete`),[`stop`]))})):o(`v-if`,!0)])]),default:F(()=>[u(v,{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=e=>r.value=e),mode:`hexa`,"show-swatches":``,"swatches-max-height":`150px`},null,8,[`modelValue`])]),_:1},8,[`modelValue`])}}});const Qt={class:`d-flex justify-space-between align-center my-2`},$t={class:`flex-grow-1`};var en=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},types:{type:String,required:!0}},{modelValue:{type:null},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{t:n}=K(),{isMobile:r}=V(),l=j(e,`modelValue`),d=t,f=i(()=>ce(e.types)),p=C(``),m=i(()=>{let e=[];for(let{value:t,title:r}of f.value)e.push({value:t,title:n(r)});return e});P(()=>{for(let{value:e,validator:t}of f.value)if(t(l.value)){p.value=e;return}_()});let h=i(()=>f.value.find(e=>e.value===p.value));function g(){l.value=h.value?.default}function _(){p.value=f.value[0].value,g()}let v=C(0),y=async e=>{if(!e||!r()||!h.value||h.value.trait!==`number`&&h.value.trait!==`numberUnit`)return;let t=await re({title:``,value:v.value,precision:h.value.precision,min:h.value.min,max:h.value.max,step:h.value.step});t!==void 0&&(v.value=t)};P(()=>{h.value?.trait===`number`?v.value=l.value:h.value?.trait===`numberUnit`&&(v.value=fe(l.value,h.value.unit))}),N(v,e=>{h.value?.trait===`number`?l.value=e:h.value?.trait===`numberUnit`&&(l.value=e+h.value.unit)});let b=C(`#ff00ff`);P(()=>{h.value?.trait===`hexColor`&&le(l.value)&&(b.value=l.value)}),N(b,e=>{h.value?.trait===`hexColor`&&(l.value=e)});let S=C(`primary`),w=i(()=>{let e=[];if(h.value?.trait===`themeColor`)for(let{value:t,title:r}of he)e.push({value:t,title:n(r)});return e});return P(()=>{h.value?.trait===`themeColor`&&ue(l.value)&&(S.value=l.value)}),N(S,e=>{h.value?.trait===`themeColor`&&(l.value=e)}),(t,n)=>{let r=E(`v-select`),i=E(`v-number-input`),l=E(`v-btn`),f=D(`ripple`);return x(),s(`div`,Qt,[c(`div`,$t,[I(u(r,{modelValue:p.value,"onUpdate:modelValue":[n[0]||(n[0]=e=>p.value=e),g],density:`compact`,"hide-details":``,items:m.value,readonly:e.readonly,"single-line":``},null,8,[`modelValue`,`items`,`readonly`]),[[f,void 0,void 0,{stop:!0}]]),h.value?.trait===`number`||h.value?.trait===`numberUnit`?I((x(),a(i,{key:0,modelValue:v.value,"onUpdate:modelValue":n[1]||(n[1]=e=>v.value=e),"control-variant":`stacked`,density:`compact`,"hide-details":``,max:h.value.max,min:h.value.min,precision:h.value.precision,readonly:e.readonly,"single-line":``,step:h.value.step,"onUpdate:focused":y},null,8,[`modelValue`,`max`,`min`,`precision`,`readonly`,`step`])),[[f,void 0,void 0,{stop:!0}]]):o(`v-if`,!0),h.value?.trait===`hexColor`?(x(),a(Zt,{key:1,modelValue:b.value,"onUpdate:modelValue":n[2]||(n[2]=e=>b.value=e)},null,8,[`modelValue`])):o(`v-if`,!0),h.value?.trait===`themeColor`?I((x(),a(r,{key:2,modelValue:S.value,"onUpdate:modelValue":n[3]||(n[3]=e=>S.value=e),density:`compact`,"hide-details":``,items:w.value,"single-line":``},null,8,[`modelValue`,`items`])),[[f,void 0,void 0,{stop:!0}]]):o(`v-if`,!0)]),e.hasDelete?(x(),a(l,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:n[4]||(n[4]=R(e=>d(`delete`),[`stop`]))})):o(`v-if`,!0)])}}});const tn={class:`d-flex justify-space-between align-center`};var nn=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},precision:{type:Number,required:!1,default:()=>void 0},min:{type:Number,required:!1,default:()=>-1/0},max:{type:Number,required:!1,default:()=>1/0},step:{type:Number,required:!1,default:1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{isMobile:n}=V(),r=j(e,`modelValue`),i=t,c=async t=>{if(!t||e.readonly||!n())return;let i=await re({title:``,value:r.value,precision:e.precision,min:e.min,max:e.max,step:e.step});i!==void 0&&(r.value=i)};return(t,n)=>{let l=E(`v-number-input`),d=E(`v-btn`),f=D(`ripple`);return x(),s(`div`,tn,[I(u(l,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),"control-variant":`stacked`,density:`compact`,"hide-details":``,max:e.max,min:e.min,precision:e.precision,readonly:e.readonly,"single-line":``,step:e.step,"onUpdate:focused":c},null,8,[`modelValue`,`max`,`min`,`precision`,`readonly`,`step`]),[[f,void 0,void 0,{stop:!0}]]),e.hasDelete?(x(),a(d,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:n[1]||(n[1]=R(e=>i(`delete`),[`stop`]))})):o(`v-if`,!0)])}}});const rn={class:`d-flex justify-space-between align-center my-2`},an={class:`flex-grow-1`};var on=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:String,required:!0},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{t:n}=K(),{isMobile:r}=V(),l=j(e,`modelValue`),d=t,f=C(``),p=C(0);P(()=>{let e=l.value.split(`,`);e.length<1||(f.value=e[0],(e[0]===`minLength`||e[1]===`maxLength`||e[2]===`length`)&&(e.length>1?p.value=parseInt(e[1]):p.value=0))});function m(){f.value===`minLength`||f.value===`maxLength`||f.value===`length`?l.value=`${f.value},${p.value}`:l.value=f.value}let h=i(()=>{let e=[{value:``,title:n(`x-runtime-lib.notSet`)}];for(let t of me)e.push({value:t,title:n(`x-runtime-lib.${t}`)});return e});function g(){p.value=0,m()}P(()=>{let e=l.value.split(`,`);e.length>1&&(p.value=parseInt(e[1]))});async function _(e){if(!e||!r())return;let t=await re({title:``,value:p.value,precision:0,min:0,max:1/0,step:1});t!==void 0&&(p.value=t,m())}function v(){m()}return(t,n)=>{let r=E(`v-select`),i=E(`v-number-input`),l=E(`v-btn`),m=D(`ripple`);return x(),s(`div`,rn,[c(`div`,an,[I(u(r,{modelValue:f.value,"onUpdate:modelValue":[n[0]||(n[0]=e=>f.value=e),g],density:`compact`,"hide-details":``,items:h.value,readonly:e.readonly,"single-line":``},null,8,[`modelValue`,`items`,`readonly`]),[[m,void 0,void 0,{stop:!0}]]),f.value===`minLength`||f.value===`maxLength`||f.value===`length`?I((x(),a(i,{key:0,modelValue:p.value,"onUpdate:modelValue":[n[1]||(n[1]=e=>p.value=e),v],"control-variant":`stacked`,density:`compact`,"hide-details":``,max:1/0,min:0,precision:0,readonly:e.readonly,"single-line":``,step:1,"onUpdate:focused":_},null,8,[`modelValue`,`readonly`])),[[m,void 0,void 0,{stop:!0}]]):o(`v-if`,!0)]),e.hasDelete?(x(),a(l,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:n[2]||(n[2]=R(e=>d(`delete`),[`stop`]))})):o(`v-if`,!0)])}}});const sn={class:`d-flex justify-space-between align-center`};var cn=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},items:{type:String,required:!0}},{modelValue:{type:String},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{t:n}=K(),r=j(e,`modelValue`),c=t,l=i(()=>{let t=[];return oe(e.items)?.forEach(({value:e,title:r})=>{let i=e;r&&(i=n(r)),t.push({value:e,title:i})}),t});return(t,n)=>{let i=E(`v-select`),d=E(`v-btn`),f=D(`ripple`);return x(),s(`div`,sn,[I(u(i,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),density:`compact`,"hide-details":``,items:l.value,readonly:e.readonly,"single-line":``},null,8,[`modelValue`,`items`,`readonly`]),[[f,void 0,void 0,{stop:!0}]]),e.hasDelete?(x(),a(d,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:n[1]||(n[1]=R(e=>c(`delete`),[`stop`]))})):o(`v-if`,!0)])}}});const ln={class:`text-body-large ml-6`};var un=d({__name:`item`,props:{id:{type:String,required:!0},title:{type:String,required:!0}},emits:[`x-click`],setup(e,{emit:t}){let{backgroundColor2:n,highlightColor:r}=B(),a=t,o=C(!1),l=i(()=>({background:o.value?r.value:n.value,height:`48px`,marginTop:`1px`,userSelect:`none`}));return(t,n)=>{let r=D(`ripple`);return I((x(),s(`div`,{class:`d-flex align-center cursor-pointer`,style:_(l.value),onClick:n[0]||(n[0]=t=>a(`x-click`,e.id)),onMouseout:n[1]||(n[1]=e=>o.value=!1),onMouseover:n[2]||(n[2]=e=>o.value=!0)},[c(`span`,ln,O(e.title),1)],36)),[[r]])}}});const dn={key:0},fn={key:1,class:`text-body-medium text-grey ml-3`};var pn=d({__name:`index`,props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:h([`x-select`],[`update:open`]),setup(e,{emit:t}){let{t:n}=K(),i=j(e,`open`),o=t,c=dt(),l=e=>{i.value=!1,o(`x-select`,e)};return(e,t)=>k(c).length>0?(x(),s(`div`,dn,[(x(!0),s(r,null,w(k(c),e=>(x(),a(un,{key:e.id,id:e.id,title:e.name,onXClick:l},null,8,[`id`,`title`]))),128))])):(x(),s(`div`,fn,O(k(n)(`x-prop-tree.noSlot`)),1))}});const mn={class:`text-body-large`};var hn=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:[Object,null],default:null},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{t:n}=K(),r=be(),{sysBarAvail:s}=V(),{backgroundColor1:d}=B(),f=j(e,`modelValue`),p=t,h=dt(),v=i(()=>{let e=`100%`;return r.mdAndUp.value&&(e=`400px`),{background:d.value,width:e,height:`100%`}}),y=i(()=>{let e=48;return s.value&&(e+=24),{position:`relative`,height:`calc(100% - ${e}px)`}}),S=i(()=>({height:`60px`}));P(()=>{if(!f.value)return;let e=h.value.find(e=>e.id===f.value.id);e&&e.name!==f.value.name&&(f.value={...f.value,name:e.name})});let C=i(()=>f.value?f.value.name:n(`x-runtime-lib.notSet`)),{open:w}=H(`propTreeSlotSelectDlg${A()}`);b(()=>{w.value=!1});function T(e){if(!e){f.value=null;return}let t=h.value.find(t=>t.id===e);if(!t){f.value=null;return}f.value={id:t.id,name:t.name}}return(t,r)=>{let i=E(`v-btn`),d=E(`v-sheet`),f=E(`v-dialog`);return x(),a(f,{modelValue:k(w),"onUpdate:modelValue":r[5]||(r[5]=e=>m(w)?w.value=e:null),fullscreen:``,"no-click-animation":``,persistent:``,transition:`scroll-x-reverse-transition`,onKeydown:r[6]||(r[6]=L(R(e=>w.value=!1,[`stop`,`prevent`]),[`esc`]))},{activator:F(({props:t})=>[u(i,g(t,{block:``,density:`comfortable`,readonly:e.readonly}),{default:F(()=>[l(O(C.value),1)]),_:1},16,[`readonly`]),e.hasDelete?(x(),a(i,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:r[0]||(r[0]=R(e=>p(`delete`),[`stop`]))})):o(`v-if`,!0)]),default:F(()=>[c(`div`,{class:`w-100 h-100 d-flex flex-row-reverse`,onClick:r[3]||(r[3]=R(e=>w.value=!1,[`self`])),onContextmenu:r[4]||(r[4]=R(e=>w.value=!1,[`self`,`prevent`]))},[c(`div`,{class:`elevation-2`,style:_(v.value)},[k(s)?(x(),a(d,{key:0,color:`transparent`,height:24})):o(`v-if`,!0),u(d,{class:`d-flex align-center px-3`,color:`transparent`,height:48},{default:F(()=>[u(i,{density:`comfortable`,icon:`mdi-close`,variant:`text`,onClick:r[1]||(r[1]=e=>w.value=!1)}),c(`span`,mn,O(k(n)(`x-prop-tree.selectSlot`)),1)]),_:1}),c(`div`,{class:`overflow-y-auto`,style:_(y.value)},[u(pn,{open:k(w),"onUpdate:open":r[2]||(r[2]=e=>m(w)?w.value=e:null),onXSelect:T},null,8,[`open`]),c(`div`,{style:_(S.value)},null,4)],4)],4)],32)]),_:1},8,[`modelValue`])}}});const gn={class:`d-flex justify-space-between align-center`};var _n=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let n=j(e,`modelValue`),r=t;return(t,i)=>{let c=E(`v-switch`),l=E(`v-btn`);return x(),s(`div`,gn,[u(c,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=e=>n.value=e),class:`ml-1`,color:`primary`,density:`compact`,"hide-details":``,readonly:e.readonly},null,8,[`modelValue`,`readonly`]),e.hasDelete?(x(),a(l,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:i[1]||(i[1]=R(e=>r(`delete`),[`stop`]))})):o(`v-if`,!0)])}}});const vn={class:`d-flex justify-space-between align-center`};var yn=d({__name:`index`,props:h({hasDelete:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1}},{modelValue:{type:String,required:!0},modelModifiers:{}}),emits:h([`delete`],[`update:modelValue`]),setup(e,{emit:t}){let{isMobile:n}=V(),r=j(e,`modelValue`),i=t,c=async t=>{if(!t||e.readonly||!n())return;let i=await ie({title:``,value:r.value});i!==void 0&&(r.value=i)};return(t,n)=>{let l=E(`v-text-field`),d=E(`v-btn`),f=D(`ripple`);return x(),s(`div`,vn,[I(u(l,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),density:`compact`,"hide-details":``,readonly:e.readonly,"single-line":``,"onUpdate:focused":c},null,8,[`modelValue`,`readonly`]),[[f,void 0,void 0,{stop:!0}]]),e.hasDelete?(x(),a(d,{key:0,class:`mx-2`,density:`compact`,icon:`mdi-minus`,variant:`text`,onClick:n[1]||(n[1]=R(e=>i(`delete`),[`stop`]))})):o(`v-if`,!0)])}}});function bn(){let e=$();return{renderUiAdaptSlot:(t,n,r,i,a)=>{if(n.ui!==`adaptSlot`)throw Error(`useUiAdaptSlot property ui must be adaptSlot`);return f(Pt,{modelValue:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))},readonly:n.readonly})}}}function xn(){let e=$();return{renderUiComp:(t,n,r,i,a)=>{if(n.ui!==`comp`)throw Error(`renderUiComp property ui must be comp`);return f(Wt,{modelValue:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))},readonly:n.readonly})}}}function Sn(){let e=$();return{renderUiDummy:(t,n,r,i,a)=>{if(n.ui!==`dummy`)throw Error(`renderUiDummy property ui must be dummy`);J(t,n,r,i,a,e)}}}function Cn(){let e=$();return{renderUiIcon:(t,n,r,i,a)=>{if(n.ui!==`icon`)throw Error(`renderUiIcon property ui must be icon`);return f(Kt,{modelValue:n.static?n.value:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{n.static||Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))},readonly:n.static||n.readonly})}}}function wn(){let e=$();return{renderUiJson:(t,n,r,i,a)=>{if(n.ui!==`json`)throw Error(`renderUiJson property ui must be json`);return f(Yt,{modelValue:J(t,n,r,i,a,e)??`{}`,"onUpdate:modelValue":o=>{Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))},readonly:n.readonly})}}}function Tn(){let e=$();return{renderUiMultiTypes:(t,n,r,i,a)=>{if(n.ui!==`multiTypes`)throw Error(`renderUiMultiTypes property ui must be multiTypes`);return f(en,{modelValue:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))},types:n.types})}}}function En(){let e=$();return{renderUiNumber:(t,n,r,i,a)=>{if(n.ui!==`number`)throw Error(`renderUiNumber property ui must be number`);return f(nn,{modelValue:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))},precision:n.precision,min:n.min,max:n.max,step:n.step,readonly:n.readonly})}}}var Dn=d({__name:`index`,props:{minHeight:{type:String,required:!0}},emits:[`menu`],setup(e,{emit:t}){let{backgroundColor2:n,highlightColor:r}=B(),a=t,o=C(!1),c=i(()=>({background:o.value?r.value:n.value,minHeight:e.minHeight,paddingRight:`4px`,marginBottom:`1px`,userSelect:`none`})),l=e=>{a(`menu`,e.clientX,e.clientY)};return(e,t)=>{let n=D(`ripple`);return I((x(),s(`div`,{class:`d-flex justify-space-between align-center cursor-pointer`,style:_(c.value),onContextmenu:R(l,[`self`,`prevent`]),onMouseout:t[0]||(t[0]=e=>o.value=!1),onMouseover:t[1]||(t[1]=e=>o.value=!0)},[T(e.$slots,`default`)],36)),[[n]])}}});function On(){let{t:e}=K(),t=ot();return{renderProperty:(n,r,i)=>{let a=n[n.length-1],o=typeof a==`number`?`[${a+1}]`:e(r.name);return Q(t.value,n)?o+=` !`:Z(t.value,n)&&(o+=` *`),f(Dn,{minHeight:`56px`,onMenu:(e,t)=>{z.emit(`propTreeMenu`,{x:e,y:t,keys:n})}},()=>[f(`span`,{style:{marginLeft:`4px`,pointerEvents:`none`},innerHTML:o}),f(`div`,{style:{width:`200px`}},i)])}}}function kn(){let e=$();function t(t,n,r,i,a){if(n.ui!==`rule`)throw Error(`renderUiRule property ui must be rule`);return f(on,{modelValue:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))}})}return{renderUiRule:t}}function An(){let e=$();return{renderUiSelect:(t,n,r,i,a)=>{if(n.ui!==`select`)throw Error(`renderUiSelect property ui must be select`);return f(cn,{modelValue:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))},items:n.items,readonly:n.readonly})}}}function jn(){let e=$();return{renderUiSlot:(t,n,r,i,a)=>{if(n.ui!==`slot`)throw Error(`renderUiSlot property ui must be slot`);return f(hn,{modelValue:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))},readonly:n.readonly})}}}function Mn(){let e=$();return{renderUiSwitch:(t,n,r,i,a)=>{if(n.ui!==`switch`)throw Error(`renderUiSwitch property ui must be switch`);return f(_n,{modelValue:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,1),r))},readonly:n.readonly})}}}function Nn(){let e=$();return{renderUiText:(t,n,r,i,a)=>{if(n.ui!==`text`)throw Error(`renderUiText property ui must be text`);return f(yn,{modelValue:n.static?n.value:J(t,n,r,i,a,e),"onUpdate:modelValue":o=>{n.static||Y(t,n,r,o,i,a,e)},hasDelete:i!==void 0&&!a,onDelete:()=>{i===void 0||a||(r.splice(i,1),e(t.slice(0,-1),r))},readonly:n.static||n.readonly})}}}const Pn=`20px`;var Fn=d({__name:`main`,setup(e){let{t:n}=K(),{backgroundColor1:i}=B(),a=et(),o=nt(),c=it(),l=ot(),d=$();Ct(),wt(),St();let{renderProperty:p}=On(),{renderUiDummy:m}=Sn(),{renderUiText:h}=Nn(),{renderUiNumber:g}=En(),{renderUiSwitch:_}=Mn(),{renderUiSelect:v}=An(),{renderUiJson:y}=wn(),{renderUiIcon:b}=Cn(),{renderUiComp:S}=xn(),{renderUiSlot:C}=jn(),{renderUiAdaptSlot:w}=bn(),{renderUiRule:T}=kn(),{renderUiMultiTypes:E}=Tn(),D=(e,n,r,i,a,o)=>{if(e=t(e),i===void 0?e.push(n.key):(e.push(i),a&&e.push(n.key)),e?.[0]!==`runtime`)return n.ui?n.array&&!o?A(e,n,r,i,a):j(e,n,r,i,a):n.array?O(e,n,r,i,a):k(e,n,r,i,a)},O=(e,t,r,i,a)=>{if(t.ui)throw Error(`renderBranchArray property ui must be invalid`);if(!t.array)throw Error(`renderBranchArray property array must be valid`);let o=Ce(e,t,r,i,a,d),s=n(t.name);X(c,e)&&(Q(l.value,e)?s+=` !`:Z(l.value,e)&&(s+=` *`));let u=f(xt,{title:s,collapse:X(c,e),hasCreate:!0,onCollapse:t=>{we(c,e,t)},onMenu:(t,n)=>{z.emit(`propTreeMenu`,{x:t,y:n,keys:e})},onCreate:()=>{o.push({}),d(e,o)}}),p=f(`div`,{style:{paddingLeft:Pn}},(()=>{let n=[];for(let r=0;r<o.length;r++){let i=[...e,r],a=`[${r+1}]`;X(c,[...e,r])&&(Q(l.value,i)?a+=` !`:Z(l.value,i)&&(a+=` *`));let s=f(xt,{title:a,collapse:X(c,[...e,r]),hasDelete:!0,index:r,onCollapse:t=>{we(c,[...e,r],t)},onMenu:(e,t)=>{z.emit(`propTreeMenu`,{x:e,y:t,keys:i})},onDelete:t=>{o.splice(t,1),d(e,o)}});n.push(s);let u=f(`div`,{style:{paddingLeft:Pn}},(()=>{let n=[];for(let i of t.children)n.push(D(e,i,o[r],r,!0));return n})());X(c,[...e,r])||n.push(u)}return n})());return f(`div`,{style:{marginTop:`1px`}},(()=>{let t=[];return t.push(u),X(c,e)||t.push(p),t})())},k=(e,t,r,i,a)=>{if(t.ui)throw Error(`renderBranchScalar property ui must be invalid`);if(t.array)throw Error(`renderBranchScalar property array must be invalid`);let o=n(t.name);X(c,e)&&(Q(l.value,e)?o+=` !`:Z(l.value,e)&&(o+=` *`));let s=f(xt,{title:o,collapse:X(c,e),hasDelete:i!==void 0&&!a,onCollapse:t=>{we(c,e,t)},onMenu:(t,n)=>{z.emit(`propTreeMenu`,{x:t,y:n,keys:e})},onDelete:()=>{i===void 0||a||(r.splice(i,1),d(e.slice(0,-1),r))}}),u=f(`div`,{style:{paddingLeft:Pn}},(()=>{let n=[];for(let i of t.children)n.push(D(e,i,(typeof r[t.key]!=`object`&&(r[t.key]={},d(e,r[t.key])),r[t.key]),void 0,!1));return n})());return f(`div`,{style:{marginTop:`1px`}},(()=>{let t=[];return t.push(s),X(c,e)||t.push(u),t})())},A=(e,t,r,i,a)=>{if(!t.ui)throw Error(`renderLeafArray property ui must be valid`);if(!t.array)throw Error(`renderLeafArray property array must be valid`);let o=Ce(e,t,r,i,a,d),s=n(t.name);X(c,e)&&(Q(l.value,e)?s+=` !`:Z(l.value,e)&&(s+=` *`));let u=f(xt,{title:s,collapse:X(c,e),hasCreate:!0,onCollapse:t=>{we(c,e,t)},onMenu:(t,n)=>{z.emit(`propTreeMenu`,{x:t,y:n,keys:e})},onCreate:()=>{o.push(U(t)),d(e,o)}}),p=f(`div`,{style:{paddingLeft:Pn}},(()=>{let n=[];for(let r=0;r<o.length;r++)n.push(D(e,t,o,r,!1,!0));return n})());return f(`div`,{style:{marginTop:`1px`}},(()=>{let t=[];return t.push(u),X(c,e)||t.push(p),t})())},j=(e,t,n,r,i)=>{if(!t.ui)throw Error(`renderLeafScalar property ui must be valid`);let a;return t.ui===`dummy`?a=m(e,t,n,r,i):t.ui===`text`?a=h(e,t,n,r,i):t.ui===`number`?a=g(e,t,n,r,i):t.ui===`switch`?a=_(e,t,n,r,i):t.ui===`select`?a=v(e,t,n,r,i):t.ui===`json`?a=y(e,t,n,r,i):t.ui===`icon`?a=b(e,t,n,r,i):t.ui===`comp`?a=S(e,t,n,r,i):t.ui===`slot`?a=C(e,t,n,r,i):t.ui===`adaptSlot`?a=w(e,t,n,r,i):t.ui===`rule`?a=T(e,t,n,r,i):t.ui===`multiTypes`?a=E(e,t,n,r,i):console.assert(!1,`renderLeafScalar not implemented`),a?p(e,t,a):f(`div`)},M=()=>f(`div`,{class:`text-body-medium`,style:{background:i.value}},(()=>{let e=[];if(a.value.length>0&&o.value)for(let t of a.value)e.push(D([],t,o.value,void 0,!1));return e})());return(e,t)=>(x(),s(r,null,[u(M),u(yt)],64))}}),In=d({__name:`index`,props:{config:{type:Array,required:!0},object:{type:null,required:!0},version:{type:String,required:!0},type:{type:String,required:!0},subtype:{type:String,required:!0}},emits:[`change`],setup(e,{emit:t}){let n=t,r=C([]);$e(r),P(()=>{r.value=e.config});let i=C();tt(i),P(()=>{i.value=e.object});let o=C(``);qe(o),P(()=>{o.value=e.version});let s=C(e.type);Ye(s),P(()=>{s.value=e.type});let c=C(``);Ze(c),P(()=>{c.value=e.subtype}),rt(C({collapse:!0,children:{}}));let l=C({change:!1,warning:!1,children:{}});at(l);function u(t,r){Fe(l,e.config,e.object),n(`change`,t,r)}st(u);function d(){Fe(l,e.config,e.object)}return y(()=>{z.on(`refreshPropertyState`,d)}),v(()=>{z.off(`refreshPropertyState`,d)}),N([()=>e.config,()=>e.object],()=>{Fe(l,e.config,e.object)},{immediate:!0}),(e,t)=>(x(),a(Fn))}});const Ln=e=>{e.component(`XPropTree`,In)};async function Rn(e){if(e===`en`)return(await import(`./i18n-en.bjdqf6it.js`).then(e=>e.t)).default;if(e===`zhHans`)return(await import(`./i18n-zhHans.erc38kn7.js`).then(e=>e.t)).default;throw Error(`invalid locale=${e}`)}var zn={install:Ln};export{zn as default,Rn as loadLocaleMessagePropTree};
|
|
1
|
+
(function(){try{document.getElementById(`x-prop-tree`)?.remove();const e = document.createElement(`style`);e.setAttribute(`id`, `x-prop-tree`);const t = document.createTextNode(``);e.appendChild(t);document.head.appendChild(e);}catch(e){console.error('rolldown-plugin-inject-css', e);}})()
|
|
2
|
+
import { n as isEqual, r as cloneDeep, t as omit } from "./vendor.o2dszt6f.js";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, h, inject, isRef, mergeModels, mergeProps, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDirective, toDisplayString, unref, useId, useModel, useTemplateRef, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
4
|
+
import { eventBus, globalObjects, injectDark, injectLocale, openNumberDlg, openPromptDlg, useColor, useSystem, useViewStack } from "x-essential-lib";
|
|
5
|
+
import { getElement, getItems, getPropertyDefault, getPropertyDefaultArray, getTag, getTypes, isHexColor, isThemeColor, makeSlotId, parseNumberUnit, pkgs, rules, themeColors, unwrapSlotId } from "x-runtime-lib";
|
|
6
|
+
import { getListEntry, setCollapse, tidyList } from "x-group-list";
|
|
7
|
+
import { useI18n } from "vue-i18n";
|
|
8
|
+
import { globalState } from "x-state-lib";
|
|
9
|
+
import { useDisplay } from "vuetify";
|
|
10
|
+
import { XBlockly } from "x-block-lib";
|
|
11
|
+
|
|
12
|
+
//#region src/utils/common.ts
|
|
13
|
+
function unpkgProperty(properties, keys) {
|
|
14
|
+
let target = {
|
|
15
|
+
key: "",
|
|
16
|
+
name: "",
|
|
17
|
+
children: properties
|
|
18
|
+
};
|
|
19
|
+
for (const key of keys) {
|
|
20
|
+
if (typeof key === "number") continue;
|
|
21
|
+
if (!target) throw new Error(`target must be valid`);
|
|
22
|
+
if (target.ui) throw new Error(`target ui must be invalid`);
|
|
23
|
+
target = target.children.find((entry) => entry.key === key);
|
|
24
|
+
}
|
|
25
|
+
return target;
|
|
26
|
+
}
|
|
27
|
+
function unpkgObject(root, keys) {
|
|
28
|
+
let target = root;
|
|
29
|
+
for (const key of keys) {
|
|
30
|
+
if (!target) throw new Error(`target must be valid`);
|
|
31
|
+
target = target[key];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
}
|
|
35
|
+
function ensureArrayValue(keys, property, object, arrayIndex, isBranch, changeEvent) {
|
|
36
|
+
if (arrayIndex !== void 0 && !isBranch) {
|
|
37
|
+
if (!(object[arrayIndex] instanceof Array)) {
|
|
38
|
+
const d = getPropertyDefaultArray(property);
|
|
39
|
+
if (!isEqual(d, object[arrayIndex])) {
|
|
40
|
+
object[arrayIndex] = d;
|
|
41
|
+
changeEvent(keys, object[arrayIndex]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return object[arrayIndex];
|
|
45
|
+
} else {
|
|
46
|
+
if (!(object[property.key] instanceof Array)) {
|
|
47
|
+
const d = getPropertyDefaultArray(property);
|
|
48
|
+
if (!isEqual(d, object[property.key])) {
|
|
49
|
+
object[property.key] = d;
|
|
50
|
+
changeEvent(keys, object[property.key]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return object[property.key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent) {
|
|
57
|
+
if (arrayIndex !== void 0 && !isBranch) {
|
|
58
|
+
if (object[arrayIndex] === void 0) {
|
|
59
|
+
const val = getPropertyDefault(property);
|
|
60
|
+
if (!isEqual(val, object[arrayIndex])) {
|
|
61
|
+
object[arrayIndex] = val;
|
|
62
|
+
changeEvent(keys, object[arrayIndex]);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return object[arrayIndex];
|
|
66
|
+
} else {
|
|
67
|
+
if (object[property.key] === void 0) {
|
|
68
|
+
const val = getPropertyDefault(property);
|
|
69
|
+
if (!isEqual(val, object[property.key])) {
|
|
70
|
+
object[property.key] = val;
|
|
71
|
+
changeEvent(keys, object[property.key]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return object[property.key];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent) {
|
|
78
|
+
if (arrayIndex !== void 0 && !isBranch) {
|
|
79
|
+
if (!isEqual(val, object[arrayIndex])) {
|
|
80
|
+
object[arrayIndex] = cloneDeep(val);
|
|
81
|
+
changeEvent(keys, object[arrayIndex]);
|
|
82
|
+
}
|
|
83
|
+
} else if (!isEqual(val, object[property.key])) {
|
|
84
|
+
object[property.key] = cloneDeep(val);
|
|
85
|
+
changeEvent(keys, object[property.key]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/utils/collapseState.ts
|
|
91
|
+
function isCollapse(root, keys) {
|
|
92
|
+
let current = root.value;
|
|
93
|
+
for (const key of keys) {
|
|
94
|
+
if (!current.children[key]) return true;
|
|
95
|
+
current = current.children[key];
|
|
96
|
+
}
|
|
97
|
+
return current.collapse;
|
|
98
|
+
}
|
|
99
|
+
function setCollapse$1(root, keys, collapse) {
|
|
100
|
+
let current = root.value;
|
|
101
|
+
for (const key of keys) {
|
|
102
|
+
if (!current.children[key]) current.children[key] = {
|
|
103
|
+
collapse: true,
|
|
104
|
+
children: {}
|
|
105
|
+
};
|
|
106
|
+
current = current.children[key];
|
|
107
|
+
}
|
|
108
|
+
current.collapse = collapse;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/utils/copyPaste.ts
|
|
113
|
+
const ignoreFields = [
|
|
114
|
+
"key",
|
|
115
|
+
"name",
|
|
116
|
+
"children",
|
|
117
|
+
"default",
|
|
118
|
+
"arrayDefault"
|
|
119
|
+
];
|
|
120
|
+
function isPropertyCompatible(l, r) {
|
|
121
|
+
function execProperty(l, r) {
|
|
122
|
+
if (!isEqual(omit(l, ignoreFields), omit(r, ignoreFields))) return false;
|
|
123
|
+
if (l.ui || r.ui) return true;
|
|
124
|
+
if (l.children.length !== r.children.length) return false;
|
|
125
|
+
for (let i = 0; i < l.children.length; i++) if (!execProperty(l.children[i], r.children[i])) return false;
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
return execProperty(l, r);
|
|
129
|
+
}
|
|
130
|
+
function setProperty(keys, property, object, value, arrayIndex, changeEvent) {
|
|
131
|
+
function execProperty(keys, property, object, value, arrayIndex) {
|
|
132
|
+
if (property.ui) {
|
|
133
|
+
if (property.readonly || property.static) return;
|
|
134
|
+
setModelValue(keys, property, object, value, arrayIndex, false, changeEvent);
|
|
135
|
+
} else if (property.array) setModelValue(keys, property, object, value, arrayIndex, false, changeEvent);
|
|
136
|
+
else for (const child of property.children) {
|
|
137
|
+
if (typeof object !== "object") continue;
|
|
138
|
+
if (typeof value !== "object") continue;
|
|
139
|
+
execProperty([...keys, child.key], child, object[property.key], value[child.key], void 0);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
execProperty(keys, property, object, value, arrayIndex);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/utils/propertyState.ts
|
|
147
|
+
const propertyStateIgnores = [["basic", "id"], ["basic", "name"]];
|
|
148
|
+
function isPropertyStateIgnored(keys) {
|
|
149
|
+
return propertyStateIgnores.find((entry) => isEqual(keys, entry));
|
|
150
|
+
}
|
|
151
|
+
function execProperty$1(keys, property, object, state, arrayIndex, isBranch, leafArrayEntry) {
|
|
152
|
+
keys = cloneDeep(keys);
|
|
153
|
+
if (arrayIndex !== void 0) {
|
|
154
|
+
keys.push(arrayIndex);
|
|
155
|
+
if (isBranch) keys.push(property.key);
|
|
156
|
+
} else keys.push(property.key);
|
|
157
|
+
if (keys?.[0] === "runtime") return {
|
|
158
|
+
change: false,
|
|
159
|
+
warning: false
|
|
160
|
+
};
|
|
161
|
+
if (isPropertyStateIgnored(keys)) {
|
|
162
|
+
state.change = false;
|
|
163
|
+
state.warning = false;
|
|
164
|
+
return {
|
|
165
|
+
change: state.change,
|
|
166
|
+
warning: state.warning
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
if (property.ui) if (property.array && !leafArrayEntry) return execPropertyLeafArray(keys, property, object, state, arrayIndex, isBranch);
|
|
170
|
+
else return execPropertyLeafScalar(property, object, state, arrayIndex, isBranch);
|
|
171
|
+
else if (property.array) return execPropertyBranchArray(keys, property, object, state, arrayIndex, isBranch);
|
|
172
|
+
else return execPropertyBranchScalar(keys, property, object, state, arrayIndex, isBranch);
|
|
173
|
+
}
|
|
174
|
+
function execPropertyBranchArray(keys, property, object, state, arrayIndex, isBranch) {
|
|
175
|
+
if (property.ui) throw new Error(`execPropertyBranchArray property ui must be invalid`);
|
|
176
|
+
if (!property.array) throw new Error(`execPropertyBranchArray property array must be valid`);
|
|
177
|
+
let value;
|
|
178
|
+
if (arrayIndex !== void 0 && !isBranch) value = object[arrayIndex];
|
|
179
|
+
else value = object[property.key];
|
|
180
|
+
if (!(value instanceof Array)) {
|
|
181
|
+
state.change = false;
|
|
182
|
+
state.warning = false;
|
|
183
|
+
return {
|
|
184
|
+
change: false,
|
|
185
|
+
warning: false
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
for (let i = 0; i < value.length; i++) {
|
|
189
|
+
state.children[i] = {
|
|
190
|
+
change: false,
|
|
191
|
+
warning: false,
|
|
192
|
+
children: {}
|
|
193
|
+
};
|
|
194
|
+
const entryState = state.children[i];
|
|
195
|
+
for (const child of property.children) {
|
|
196
|
+
entryState.children[child.key] = {
|
|
197
|
+
change: false,
|
|
198
|
+
warning: false,
|
|
199
|
+
children: {}
|
|
200
|
+
};
|
|
201
|
+
const { change, warning } = execProperty$1(keys, child, value[i], entryState.children[child.key], i, true);
|
|
202
|
+
if (!entryState.change && change) entryState.change = change;
|
|
203
|
+
if (!entryState.change && warning) entryState.warning = warning;
|
|
204
|
+
if (!state.change && entryState.change) state.change = entryState.change;
|
|
205
|
+
if (!state.warning && entryState.warning) state.warning = entryState.warning;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (!state.change) state.change = !isEqual(value, getPropertyDefaultArray(property));
|
|
209
|
+
return {
|
|
210
|
+
change: state.change,
|
|
211
|
+
warning: state.warning
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function execPropertyBranchScalar(keys, property, object, state, arrayIndex, isBranch) {
|
|
215
|
+
if (property.ui) throw new Error(`execPropertyBranchScalar property ui must be invalid`);
|
|
216
|
+
if (property.array) throw new Error(`execPropertyBranchScalar property array must be invalid`);
|
|
217
|
+
let value;
|
|
218
|
+
if (arrayIndex !== void 0 && !isBranch) value = object[arrayIndex];
|
|
219
|
+
else value = object[property.key];
|
|
220
|
+
if (value === void 0) {
|
|
221
|
+
state.change = false;
|
|
222
|
+
state.warning = false;
|
|
223
|
+
return {
|
|
224
|
+
change: false,
|
|
225
|
+
warning: false
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
for (let i = 0; i < property.children.length; i++) {
|
|
229
|
+
const child = property.children[i];
|
|
230
|
+
state.children[child.key] = {
|
|
231
|
+
change: false,
|
|
232
|
+
warning: false,
|
|
233
|
+
children: {}
|
|
234
|
+
};
|
|
235
|
+
const { change, warning } = execProperty$1(keys, child, value, state.children[child.key], void 0, false);
|
|
236
|
+
if (!state.change && change) state.change = change;
|
|
237
|
+
if (!state.warning && warning) state.warning = warning;
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
change: state.change,
|
|
241
|
+
warning: state.change
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function execPropertyLeafArray(keys, property, object, state, arrayIndex, isBranch) {
|
|
245
|
+
if (!property.ui) throw new Error(`execPropertyLeafArray property ui must be valid`);
|
|
246
|
+
if (!property.array) throw new Error(`execPropertyLeafArray property aray must be valid`);
|
|
247
|
+
let value;
|
|
248
|
+
if (arrayIndex !== void 0 && !isBranch) value = object[arrayIndex];
|
|
249
|
+
else value = object[property.key];
|
|
250
|
+
if (!(value instanceof Array)) {
|
|
251
|
+
state.change = false;
|
|
252
|
+
state.warning = false;
|
|
253
|
+
return {
|
|
254
|
+
change: false,
|
|
255
|
+
warning: false
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
for (let i = 0; i < value.length; i++) {
|
|
259
|
+
state.children[i] = {
|
|
260
|
+
change: false,
|
|
261
|
+
warning: false,
|
|
262
|
+
children: {}
|
|
263
|
+
};
|
|
264
|
+
const { change, warning } = execProperty$1(keys, property, value, state.children[i], i, false, true);
|
|
265
|
+
if (!state.change && change) state.change = change;
|
|
266
|
+
if (!state.warning && warning) state.warning = warning;
|
|
267
|
+
}
|
|
268
|
+
if (!state.change) state.change = !isEqual(value, getPropertyDefaultArray(property));
|
|
269
|
+
return {
|
|
270
|
+
change: state.change,
|
|
271
|
+
warning: state.warning
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function execPropertyLeafScalar(property, object, state, arrayIndex, isBranch) {
|
|
275
|
+
if (!property.ui) throw new Error(`execPropertyLeafScalar property ui must be valid`);
|
|
276
|
+
let value;
|
|
277
|
+
if (arrayIndex !== void 0 && !isBranch) value = object[arrayIndex];
|
|
278
|
+
else value = object[property.key];
|
|
279
|
+
state.change = !isEqual(value, getPropertyDefault(property));
|
|
280
|
+
if (property.ui === "comp") {} else if (property.ui === "slot") {} else if (property.ui === "adaptSlot") {}
|
|
281
|
+
return {
|
|
282
|
+
change: state.change,
|
|
283
|
+
warning: state.warning
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function rebuildPropertyState(root, config, object) {
|
|
287
|
+
if (config.length <= 0 || !object) {
|
|
288
|
+
root.value = {
|
|
289
|
+
change: false,
|
|
290
|
+
warning: false,
|
|
291
|
+
children: {}
|
|
292
|
+
};
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const tmpRoot = {
|
|
296
|
+
change: false,
|
|
297
|
+
warning: false,
|
|
298
|
+
children: {}
|
|
299
|
+
};
|
|
300
|
+
for (const property of config) {
|
|
301
|
+
const state = {
|
|
302
|
+
change: false,
|
|
303
|
+
warning: false,
|
|
304
|
+
children: {}
|
|
305
|
+
};
|
|
306
|
+
tmpRoot.children[property.key] = state;
|
|
307
|
+
execProperty$1([], property, object, state, void 0, false);
|
|
308
|
+
}
|
|
309
|
+
root.value = tmpRoot;
|
|
310
|
+
}
|
|
311
|
+
function isPropertyChange(root, keys) {
|
|
312
|
+
let current = root;
|
|
313
|
+
for (const key of keys) {
|
|
314
|
+
if (!current.children[key]) return false;
|
|
315
|
+
current = current.children[key];
|
|
316
|
+
}
|
|
317
|
+
return current.change;
|
|
318
|
+
}
|
|
319
|
+
function isPropertyWarning(root, keys) {
|
|
320
|
+
let current = root;
|
|
321
|
+
for (const key of keys) {
|
|
322
|
+
if (!current.children[key]) return false;
|
|
323
|
+
current = current.children[key];
|
|
324
|
+
}
|
|
325
|
+
return !!current.warning;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region src/utils/provideInject.ts
|
|
330
|
+
const versionKey = Symbol();
|
|
331
|
+
const typeKey = Symbol();
|
|
332
|
+
const subtypeKey = Symbol();
|
|
333
|
+
const configKey = Symbol();
|
|
334
|
+
const objectKey = Symbol();
|
|
335
|
+
const collapseStateKey = Symbol();
|
|
336
|
+
const propertyStateKey = Symbol();
|
|
337
|
+
const changeEventKey = Symbol();
|
|
338
|
+
const compListKey = Symbol();
|
|
339
|
+
const slotListKey = Symbol();
|
|
340
|
+
const adaptSlotListKey = Symbol();
|
|
341
|
+
function provideVersion(version) {
|
|
342
|
+
provide(versionKey, version);
|
|
343
|
+
}
|
|
344
|
+
function injectVersion() {
|
|
345
|
+
return inject(versionKey);
|
|
346
|
+
}
|
|
347
|
+
function provideType(type) {
|
|
348
|
+
provide(typeKey, type);
|
|
349
|
+
}
|
|
350
|
+
function injectType() {
|
|
351
|
+
return inject(typeKey);
|
|
352
|
+
}
|
|
353
|
+
function provideSubtype(version) {
|
|
354
|
+
provide(subtypeKey, version);
|
|
355
|
+
}
|
|
356
|
+
function injectSubtype() {
|
|
357
|
+
return inject(subtypeKey);
|
|
358
|
+
}
|
|
359
|
+
function provideConfig(config) {
|
|
360
|
+
provide(configKey, config);
|
|
361
|
+
}
|
|
362
|
+
function injectConfig() {
|
|
363
|
+
return inject(configKey);
|
|
364
|
+
}
|
|
365
|
+
function provideObject(object) {
|
|
366
|
+
provide(objectKey, object);
|
|
367
|
+
}
|
|
368
|
+
function injectObject() {
|
|
369
|
+
return inject(objectKey);
|
|
370
|
+
}
|
|
371
|
+
function provideCollapseState(collapseState) {
|
|
372
|
+
provide(collapseStateKey, collapseState);
|
|
373
|
+
}
|
|
374
|
+
function injectCollapseState() {
|
|
375
|
+
return inject(collapseStateKey);
|
|
376
|
+
}
|
|
377
|
+
function providePropertyState(propertyState) {
|
|
378
|
+
provide(propertyStateKey, propertyState);
|
|
379
|
+
}
|
|
380
|
+
function injectPropertyState() {
|
|
381
|
+
return inject(propertyStateKey);
|
|
382
|
+
}
|
|
383
|
+
function provideChangeEvent(changeEvent) {
|
|
384
|
+
provide(changeEventKey, changeEvent);
|
|
385
|
+
}
|
|
386
|
+
function injectChangeEvent() {
|
|
387
|
+
return inject(changeEventKey);
|
|
388
|
+
}
|
|
389
|
+
function provideCompList(compList) {
|
|
390
|
+
provide(compListKey, compList);
|
|
391
|
+
}
|
|
392
|
+
function injectCompList() {
|
|
393
|
+
return inject(compListKey);
|
|
394
|
+
}
|
|
395
|
+
function provideSlotList(slotList) {
|
|
396
|
+
provide(slotListKey, slotList);
|
|
397
|
+
}
|
|
398
|
+
function injectSlotList() {
|
|
399
|
+
return inject(slotListKey);
|
|
400
|
+
}
|
|
401
|
+
function provideAdaptSlotList(adaptSlotList) {
|
|
402
|
+
provide(adaptSlotListKey, adaptSlotList);
|
|
403
|
+
}
|
|
404
|
+
function injectAdaptSlotList() {
|
|
405
|
+
return inject(adaptSlotListKey);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/utils/reset.ts
|
|
410
|
+
function execProperty(object, property, keys, changeEvent) {
|
|
411
|
+
if (property.ui) {
|
|
412
|
+
if (property.readonly || property.static) return;
|
|
413
|
+
if (property.array) {
|
|
414
|
+
const oldValue = object[property.key];
|
|
415
|
+
const newValue = getPropertyDefaultArray(property);
|
|
416
|
+
if (!isEqual(newValue, oldValue)) {
|
|
417
|
+
object[property.key] = newValue;
|
|
418
|
+
changeEvent([...keys, property.key], newValue);
|
|
419
|
+
}
|
|
420
|
+
} else {
|
|
421
|
+
const oldValue = object[property.key];
|
|
422
|
+
const newValue = getPropertyDefault(property);
|
|
423
|
+
if (!isEqual(newValue, oldValue)) {
|
|
424
|
+
object[property.key] = newValue;
|
|
425
|
+
changeEvent([...keys, property.key], newValue);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
} else if (property.array) {
|
|
429
|
+
const oldValue = object[property.key];
|
|
430
|
+
const newValue = getPropertyDefaultArray(property);
|
|
431
|
+
if (!isEqual(newValue, oldValue)) {
|
|
432
|
+
object[property.key] = newValue;
|
|
433
|
+
changeEvent([...keys, property.key], newValue);
|
|
434
|
+
}
|
|
435
|
+
} else for (const child of property.children) execProperty(object[property.key], child, [...keys, property.key], changeEvent);
|
|
436
|
+
}
|
|
437
|
+
function resetProperty(root, properties, keys, changeEvent) {
|
|
438
|
+
const lastKey = keys.at(-1);
|
|
439
|
+
if (lastKey === void 0) return;
|
|
440
|
+
const property = unpkgProperty(properties, keys);
|
|
441
|
+
if (!property) return;
|
|
442
|
+
if (property.ui) {
|
|
443
|
+
if (property.readonly || property.static) return;
|
|
444
|
+
if (property.array) if (typeof lastKey === "string") {
|
|
445
|
+
const object = unpkgObject(root, keys.slice(0, -1));
|
|
446
|
+
if (!object) return;
|
|
447
|
+
const oldValue = object[lastKey];
|
|
448
|
+
const newValue = getPropertyDefaultArray(property);
|
|
449
|
+
if (!isEqual(newValue, oldValue)) {
|
|
450
|
+
object[lastKey] = newValue;
|
|
451
|
+
changeEvent(keys, newValue);
|
|
452
|
+
}
|
|
453
|
+
} else {
|
|
454
|
+
const object = unpkgObject(root, keys.slice(0, -1));
|
|
455
|
+
if (!object) return;
|
|
456
|
+
const oldValue = object[lastKey];
|
|
457
|
+
const newValue = getPropertyDefault(property);
|
|
458
|
+
if (!isEqual(newValue, oldValue)) {
|
|
459
|
+
object[lastKey] = newValue;
|
|
460
|
+
changeEvent(keys, newValue);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
const object = unpkgObject(root, keys.slice(0, -1));
|
|
465
|
+
if (!object) return;
|
|
466
|
+
const oldValue = object[lastKey];
|
|
467
|
+
const newValue = getPropertyDefault(property);
|
|
468
|
+
if (!isEqual(newValue, oldValue)) {
|
|
469
|
+
object[lastKey] = newValue;
|
|
470
|
+
changeEvent(keys, newValue);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
} else if (property.array) if (typeof lastKey === "string") {
|
|
474
|
+
const object = unpkgObject(root, keys.slice(0, -1));
|
|
475
|
+
if (!object) return;
|
|
476
|
+
const oldValue = object[lastKey];
|
|
477
|
+
const newValue = getPropertyDefaultArray(property);
|
|
478
|
+
if (!isEqual(newValue, oldValue)) {
|
|
479
|
+
object[lastKey] = newValue;
|
|
480
|
+
changeEvent(keys, newValue);
|
|
481
|
+
}
|
|
482
|
+
} else {
|
|
483
|
+
const object = unpkgObject(root, keys);
|
|
484
|
+
if (!object) return;
|
|
485
|
+
for (const child of property.children) execProperty(object, child, keys, changeEvent);
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
const object = unpkgObject(root, keys);
|
|
489
|
+
if (!object) return;
|
|
490
|
+
for (const child of property.children) execProperty(object, child, keys, changeEvent);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/components/menu/func/copy.ts
|
|
496
|
+
function useFuncCopy(keys) {
|
|
497
|
+
const { t } = useI18n();
|
|
498
|
+
const configRef = injectConfig();
|
|
499
|
+
const objectRef = injectObject();
|
|
500
|
+
function condition() {
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
function handle() {
|
|
504
|
+
const property = unpkgProperty(configRef.value, keys.value);
|
|
505
|
+
if (!property) return;
|
|
506
|
+
const copy = {
|
|
507
|
+
property,
|
|
508
|
+
object: unpkgObject(objectRef.value, keys.value)
|
|
509
|
+
};
|
|
510
|
+
localStorage.setItem("propTreeCopy", JSON.stringify(copy));
|
|
511
|
+
}
|
|
512
|
+
function tryPushCopy(items) {
|
|
513
|
+
if (!condition()) return;
|
|
514
|
+
items.push({
|
|
515
|
+
title: t("x-prop-tree.copy"),
|
|
516
|
+
func: handle
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
return { tryPushCopy };
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/components/menu/func/paste.ts
|
|
524
|
+
function useFuncPaste(keys) {
|
|
525
|
+
const { t } = useI18n();
|
|
526
|
+
const configRef = injectConfig();
|
|
527
|
+
const objectRef = injectObject();
|
|
528
|
+
const changeEvent = injectChangeEvent();
|
|
529
|
+
function condition() {
|
|
530
|
+
if (keys.value.length <= 0) return false;
|
|
531
|
+
const property = unpkgProperty(configRef.value, keys.value);
|
|
532
|
+
if (!property) return false;
|
|
533
|
+
const item = localStorage.getItem("propTreeCopy");
|
|
534
|
+
if (!item) return false;
|
|
535
|
+
let copy;
|
|
536
|
+
try {
|
|
537
|
+
copy = JSON.parse(item);
|
|
538
|
+
} catch (e) {
|
|
539
|
+
console.error("parse propTreeCopy failed", e);
|
|
540
|
+
return false;
|
|
541
|
+
}
|
|
542
|
+
if (!isPropertyCompatible(property, copy.property)) return false;
|
|
543
|
+
return true;
|
|
544
|
+
}
|
|
545
|
+
function handle() {
|
|
546
|
+
if (keys.value.length <= 0) return;
|
|
547
|
+
const property = unpkgProperty(configRef.value, keys.value);
|
|
548
|
+
if (!property) return;
|
|
549
|
+
const item = localStorage.getItem("propTreeCopy");
|
|
550
|
+
if (!item) return;
|
|
551
|
+
let copy;
|
|
552
|
+
try {
|
|
553
|
+
copy = JSON.parse(item);
|
|
554
|
+
} catch (e) {
|
|
555
|
+
console.error("parse propTreeCopy failed", e);
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
if (!isPropertyCompatible(property, copy.property)) return;
|
|
559
|
+
const object = unpkgObject(objectRef.value, keys.value.slice(0, -1));
|
|
560
|
+
if (!object) return;
|
|
561
|
+
const lastKey = keys.value.at(-1);
|
|
562
|
+
setProperty(keys.value, property, object, copy.object, typeof lastKey === "number" ? lastKey : void 0, changeEvent);
|
|
563
|
+
}
|
|
564
|
+
function tryPushPaste(items) {
|
|
565
|
+
if (!condition()) return;
|
|
566
|
+
items.push({
|
|
567
|
+
title: t("x-prop-tree.paste"),
|
|
568
|
+
func: handle
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
return { tryPushPaste };
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
//#endregion
|
|
575
|
+
//#region src/components/menu/func/reset.ts
|
|
576
|
+
function useFuncReset(keys) {
|
|
577
|
+
const { t } = useI18n();
|
|
578
|
+
const configRef = injectConfig();
|
|
579
|
+
const objectRef = injectObject();
|
|
580
|
+
const propertyState = injectPropertyState();
|
|
581
|
+
const changeEvent = injectChangeEvent();
|
|
582
|
+
function condition() {
|
|
583
|
+
if (keys.value.length <= 0) return false;
|
|
584
|
+
if (!isPropertyChange(propertyState.value, keys.value)) return false;
|
|
585
|
+
return true;
|
|
586
|
+
}
|
|
587
|
+
function handle() {
|
|
588
|
+
resetProperty(objectRef.value, configRef.value, keys.value, changeEvent);
|
|
589
|
+
}
|
|
590
|
+
function tryPushReset(items) {
|
|
591
|
+
if (!condition()) return;
|
|
592
|
+
items.push({
|
|
593
|
+
title: t("x-prop-tree.reset"),
|
|
594
|
+
func: handle
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
return { tryPushReset };
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
//#endregion
|
|
601
|
+
//#region src/components/menu/index.vue?vue&type=script&setup=true&lang.ts
|
|
602
|
+
var index_vue_vue_type_script_setup_true_lang_default$17 = /*@__PURE__*/ defineComponent({
|
|
603
|
+
__name: "index",
|
|
604
|
+
setup(__props) {
|
|
605
|
+
const x = ref(0);
|
|
606
|
+
const y = ref(0);
|
|
607
|
+
const keys = ref([]);
|
|
608
|
+
const { tryPushCopy } = useFuncCopy(keys);
|
|
609
|
+
const { tryPushPaste } = useFuncPaste(keys);
|
|
610
|
+
const { tryPushReset } = useFuncReset(keys);
|
|
611
|
+
const items = computed(() => {
|
|
612
|
+
const items = [];
|
|
613
|
+
tryPushCopy(items);
|
|
614
|
+
tryPushPaste(items);
|
|
615
|
+
tryPushReset(items);
|
|
616
|
+
return items;
|
|
617
|
+
});
|
|
618
|
+
const onOpen = (params) => {
|
|
619
|
+
x.value = params.x;
|
|
620
|
+
y.value = params.y;
|
|
621
|
+
keys.value = params.keys;
|
|
622
|
+
};
|
|
623
|
+
const { open } = useViewStack("propTreeMenu", onOpen);
|
|
624
|
+
return (_ctx, _cache) => {
|
|
625
|
+
const _component_v_list_item_title = resolveComponent("v-list-item-title");
|
|
626
|
+
const _component_v_list_item = resolveComponent("v-list-item");
|
|
627
|
+
const _component_v_list = resolveComponent("v-list");
|
|
628
|
+
const _component_v_menu = resolveComponent("v-menu");
|
|
629
|
+
return openBlock(), createBlock(_component_v_menu, {
|
|
630
|
+
modelValue: unref(open),
|
|
631
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(open) ? open.value = $event : null),
|
|
632
|
+
"location-strategy": "connected",
|
|
633
|
+
scrim: "transparent",
|
|
634
|
+
target: [x.value, y.value]
|
|
635
|
+
}, {
|
|
636
|
+
default: withCtx(() => [createVNode(_component_v_list, null, {
|
|
637
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
|
|
638
|
+
return openBlock(), createBlock(_component_v_list_item, {
|
|
639
|
+
key: index,
|
|
640
|
+
link: "",
|
|
641
|
+
onClick: item.func
|
|
642
|
+
}, {
|
|
643
|
+
default: withCtx(() => [createVNode(_component_v_list_item_title, null, {
|
|
644
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.title), 1)]),
|
|
645
|
+
_: 2
|
|
646
|
+
}, 1024)]),
|
|
647
|
+
_: 2
|
|
648
|
+
}, 1032, ["onClick"]);
|
|
649
|
+
}), 128))]),
|
|
650
|
+
_: 1
|
|
651
|
+
})]),
|
|
652
|
+
_: 1
|
|
653
|
+
}, 8, ["modelValue", "target"]);
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
//#endregion
|
|
659
|
+
//#region src/components/menu/index.vue
|
|
660
|
+
var menu_default = index_vue_vue_type_script_setup_true_lang_default$17;
|
|
661
|
+
|
|
662
|
+
//#endregion
|
|
663
|
+
//#region src/components/title/index.vue?vue&type=script&setup=true&lang.ts
|
|
664
|
+
const _hoisted_1$20 = { style: { pointerEvents: "none" } };
|
|
665
|
+
var index_vue_vue_type_script_setup_true_lang_default$16 = /*@__PURE__*/ defineComponent({
|
|
666
|
+
__name: "index",
|
|
667
|
+
props: {
|
|
668
|
+
title: {
|
|
669
|
+
type: String,
|
|
670
|
+
required: true
|
|
671
|
+
},
|
|
672
|
+
collapse: {
|
|
673
|
+
type: Boolean,
|
|
674
|
+
required: true
|
|
675
|
+
},
|
|
676
|
+
hasCreate: {
|
|
677
|
+
type: Boolean,
|
|
678
|
+
required: false,
|
|
679
|
+
default: false
|
|
680
|
+
},
|
|
681
|
+
hasDelete: {
|
|
682
|
+
type: Boolean,
|
|
683
|
+
required: false,
|
|
684
|
+
default: false
|
|
685
|
+
},
|
|
686
|
+
index: {
|
|
687
|
+
type: Number,
|
|
688
|
+
required: false,
|
|
689
|
+
default: 0
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
emits: [
|
|
693
|
+
"collapse",
|
|
694
|
+
"menu",
|
|
695
|
+
"create",
|
|
696
|
+
"delete"
|
|
697
|
+
],
|
|
698
|
+
setup(__props, { emit: __emit }) {
|
|
699
|
+
const { backgroundColor2, highlightColor } = useColor();
|
|
700
|
+
const emit = __emit;
|
|
701
|
+
const mouseOver = ref(false);
|
|
702
|
+
const style = computed(() => {
|
|
703
|
+
return {
|
|
704
|
+
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
705
|
+
height: "36px",
|
|
706
|
+
userSelect: "none"
|
|
707
|
+
};
|
|
708
|
+
});
|
|
709
|
+
const onClick = () => {
|
|
710
|
+
emit("collapse", !__props.collapse);
|
|
711
|
+
};
|
|
712
|
+
const onContextMenu = (e) => {
|
|
713
|
+
emit("menu", e.clientX, e.clientY);
|
|
714
|
+
};
|
|
715
|
+
return (_ctx, _cache) => {
|
|
716
|
+
const _component_v_icon = resolveComponent("v-icon");
|
|
717
|
+
const _component_v_spacer = resolveComponent("v-spacer");
|
|
718
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
719
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
720
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
721
|
+
class: "d-flex align-center cursor-pointer",
|
|
722
|
+
style: normalizeStyle(style.value),
|
|
723
|
+
onClick,
|
|
724
|
+
onContextmenu: withModifiers(onContextMenu, ["self", "prevent"]),
|
|
725
|
+
onMouseout: _cache[2] || (_cache[2] = ($event) => mouseOver.value = false),
|
|
726
|
+
onMouseover: _cache[3] || (_cache[3] = ($event) => mouseOver.value = true)
|
|
727
|
+
}, [
|
|
728
|
+
createVNode(_component_v_icon, {
|
|
729
|
+
class: "mr-1",
|
|
730
|
+
icon: __props.collapse ? "mdi-chevron-right" : "mdi-chevron-down"
|
|
731
|
+
}, null, 8, ["icon"]),
|
|
732
|
+
createElementVNode("span", _hoisted_1$20, toDisplayString(__props.title), 1),
|
|
733
|
+
createVNode(_component_v_spacer),
|
|
734
|
+
__props.hasCreate ? (openBlock(), createBlock(_component_v_btn, {
|
|
735
|
+
key: 0,
|
|
736
|
+
class: "mx-3",
|
|
737
|
+
density: "compact",
|
|
738
|
+
icon: "mdi-plus",
|
|
739
|
+
variant: "text",
|
|
740
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("create"), ["stop"]))
|
|
741
|
+
})) : createCommentVNode("v-if", true),
|
|
742
|
+
__props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
743
|
+
key: 1,
|
|
744
|
+
class: "mx-3",
|
|
745
|
+
density: "compact",
|
|
746
|
+
icon: "mdi-minus",
|
|
747
|
+
variant: "text",
|
|
748
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("delete", __props.index), ["stop"]))
|
|
749
|
+
})) : createCommentVNode("v-if", true)
|
|
750
|
+
], 36)), [[_directive_ripple]]);
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
|
|
755
|
+
//#endregion
|
|
756
|
+
//#region src/components/title/index.vue
|
|
757
|
+
var title_default = index_vue_vue_type_script_setup_true_lang_default$16;
|
|
758
|
+
|
|
759
|
+
//#endregion
|
|
760
|
+
//#region src/composables/adaptSlotList/index.ts
|
|
761
|
+
function useAdaptSlotList() {
|
|
762
|
+
const version = injectVersion();
|
|
763
|
+
const type = injectType();
|
|
764
|
+
const subtype = injectSubtype();
|
|
765
|
+
const { i18n } = globalObjects;
|
|
766
|
+
const adaptSlotList = ref([]);
|
|
767
|
+
provideAdaptSlotList(adaptSlotList);
|
|
768
|
+
const getLatest = () => {
|
|
769
|
+
if (!version.value || !type.value || !subtype.value) return [];
|
|
770
|
+
const pkg = pkgs[version.value];
|
|
771
|
+
if (!pkg) {
|
|
772
|
+
console.assert(false, `invalid version=${version.value}`);
|
|
773
|
+
return [];
|
|
774
|
+
}
|
|
775
|
+
const tag = getTag(type.value, subtype.value);
|
|
776
|
+
const tmpSlotList = [];
|
|
777
|
+
for (let i = 0; i < pkg.groups[tag].length; i++) {
|
|
778
|
+
const group = pkg.groups[tag][i];
|
|
779
|
+
const last = getListEntry(adaptSlotList, group.key);
|
|
780
|
+
tmpSlotList.push({
|
|
781
|
+
id: group.key,
|
|
782
|
+
type: 0,
|
|
783
|
+
name: i18n.global.t(group.name),
|
|
784
|
+
position: i,
|
|
785
|
+
collapse: last?.collapse ?? true,
|
|
786
|
+
count: 0
|
|
787
|
+
});
|
|
788
|
+
let pos = 0;
|
|
789
|
+
for (const item of group.items) {
|
|
790
|
+
const element = getElement(item);
|
|
791
|
+
if (!element) continue;
|
|
792
|
+
if (element.internal) continue;
|
|
793
|
+
if (!element.slots) continue;
|
|
794
|
+
for (const slot of element.slots) {
|
|
795
|
+
const id = makeSlotId("elementSlot", element.key, slot.key);
|
|
796
|
+
const name = `${i18n.global.t(element.name)} / ${i18n.global.t(slot.name)}`;
|
|
797
|
+
tmpSlotList.push({
|
|
798
|
+
id,
|
|
799
|
+
type: 1,
|
|
800
|
+
name,
|
|
801
|
+
position: pos++,
|
|
802
|
+
group: group.key,
|
|
803
|
+
names: [element.name, slot.name]
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
const { activeApp, depends } = globalState.app;
|
|
809
|
+
for (const { id, name, position } of activeApp.compGroups) {
|
|
810
|
+
const last = getListEntry(adaptSlotList, id);
|
|
811
|
+
tmpSlotList.push({
|
|
812
|
+
id,
|
|
813
|
+
type: 0,
|
|
814
|
+
name,
|
|
815
|
+
position,
|
|
816
|
+
collapse: last?.collapse ?? true
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
let pos = 0;
|
|
820
|
+
for (const comp of activeApp.comps) {
|
|
821
|
+
const depend = depends[comp.id];
|
|
822
|
+
if (!depend) continue;
|
|
823
|
+
if (!depend.meta.slots) continue;
|
|
824
|
+
for (const slot of depend.meta.slots) {
|
|
825
|
+
const id = makeSlotId("customSlot", comp.id, slot.id);
|
|
826
|
+
const name = `${comp.name} / ${slot.name}`;
|
|
827
|
+
tmpSlotList.push({
|
|
828
|
+
id,
|
|
829
|
+
type: 1,
|
|
830
|
+
name,
|
|
831
|
+
position: pos++,
|
|
832
|
+
group: comp.groupId,
|
|
833
|
+
names: [comp.name, slot.name]
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
return tidyList(tmpSlotList, true);
|
|
838
|
+
};
|
|
839
|
+
const refresh = () => {
|
|
840
|
+
adaptSlotList.value = getLatest();
|
|
841
|
+
};
|
|
842
|
+
let handle;
|
|
843
|
+
const startTimer = () => {
|
|
844
|
+
clearTimeout(handle);
|
|
845
|
+
handle = window.setTimeout(() => {
|
|
846
|
+
refresh();
|
|
847
|
+
if (handle) startTimer();
|
|
848
|
+
}, 1e3);
|
|
849
|
+
};
|
|
850
|
+
const stopTimer = () => {
|
|
851
|
+
clearTimeout(handle);
|
|
852
|
+
handle = void 0;
|
|
853
|
+
};
|
|
854
|
+
onMounted(() => {
|
|
855
|
+
startTimer();
|
|
856
|
+
});
|
|
857
|
+
onBeforeUnmount(() => {
|
|
858
|
+
stopTimer();
|
|
859
|
+
});
|
|
860
|
+
watch([
|
|
861
|
+
version,
|
|
862
|
+
type,
|
|
863
|
+
subtype
|
|
864
|
+
], () => {
|
|
865
|
+
refresh();
|
|
866
|
+
startTimer();
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
//#endregion
|
|
871
|
+
//#region src/composables/compList/index.ts
|
|
872
|
+
function useCompList() {
|
|
873
|
+
const compList = ref([]);
|
|
874
|
+
provideCompList(compList);
|
|
875
|
+
const refresh = () => {
|
|
876
|
+
const { activeApp, depends } = globalState.app;
|
|
877
|
+
const tmpCompList = [];
|
|
878
|
+
for (const { id, name, position } of activeApp.compGroups) {
|
|
879
|
+
const last = compList.value.find((entry) => entry.id === id);
|
|
880
|
+
tmpCompList.push({
|
|
881
|
+
id,
|
|
882
|
+
type: 0,
|
|
883
|
+
name,
|
|
884
|
+
position,
|
|
885
|
+
collapse: last?.collapse ?? true
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
for (const { id, groupId: group, name, position } of activeApp.comps) {
|
|
889
|
+
if (!depends[id]) continue;
|
|
890
|
+
tmpCompList.push({
|
|
891
|
+
id,
|
|
892
|
+
type: 1,
|
|
893
|
+
name,
|
|
894
|
+
position,
|
|
895
|
+
group
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
compList.value = tidyList(tmpCompList, true);
|
|
899
|
+
};
|
|
900
|
+
let handle;
|
|
901
|
+
const startTimer = () => {
|
|
902
|
+
clearTimeout(handle);
|
|
903
|
+
handle = window.setTimeout(() => {
|
|
904
|
+
refresh();
|
|
905
|
+
if (handle) startTimer();
|
|
906
|
+
}, 1e3);
|
|
907
|
+
};
|
|
908
|
+
const stopTimer = () => {
|
|
909
|
+
clearTimeout(handle);
|
|
910
|
+
handle = void 0;
|
|
911
|
+
};
|
|
912
|
+
onMounted(() => {
|
|
913
|
+
startTimer();
|
|
914
|
+
});
|
|
915
|
+
onBeforeUnmount(() => {
|
|
916
|
+
stopTimer();
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
//#endregion
|
|
921
|
+
//#region src/composables/slotList/index.ts
|
|
922
|
+
function useSlotList() {
|
|
923
|
+
const slotList = ref([]);
|
|
924
|
+
provideSlotList(slotList);
|
|
925
|
+
const getLatest = () => {
|
|
926
|
+
const { activeObject, activeComp } = globalState.app;
|
|
927
|
+
if (activeObject.type !== "comp") return [];
|
|
928
|
+
if (!activeComp.meta.slots) return [];
|
|
929
|
+
const tmpSlotList = [];
|
|
930
|
+
for (const { id, name } of activeComp.meta.slots) tmpSlotList.push({
|
|
931
|
+
id,
|
|
932
|
+
name
|
|
933
|
+
});
|
|
934
|
+
return tmpSlotList;
|
|
935
|
+
};
|
|
936
|
+
const refresh = () => {
|
|
937
|
+
slotList.value = getLatest();
|
|
938
|
+
};
|
|
939
|
+
let handle;
|
|
940
|
+
const startTimer = () => {
|
|
941
|
+
clearTimeout(handle);
|
|
942
|
+
handle = window.setTimeout(() => {
|
|
943
|
+
refresh();
|
|
944
|
+
if (handle) startTimer();
|
|
945
|
+
}, 1e3);
|
|
946
|
+
};
|
|
947
|
+
const stopTimer = () => {
|
|
948
|
+
clearTimeout(handle);
|
|
949
|
+
handle = void 0;
|
|
950
|
+
};
|
|
951
|
+
onMounted(() => {
|
|
952
|
+
startTimer();
|
|
953
|
+
});
|
|
954
|
+
onBeforeUnmount(() => {
|
|
955
|
+
stopTimer();
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
//#endregion
|
|
960
|
+
//#region src/components/values/adaptSlot/adaptSlotList/group.vue?vue&type=script&setup=true&lang.ts
|
|
961
|
+
const _hoisted_1$19 = { class: "text-label-large ml-1" };
|
|
962
|
+
const _hoisted_2$6 = { class: "text-body-small text-grey ml-1" };
|
|
963
|
+
var group_vue_vue_type_script_setup_true_lang_default$1 = /*@__PURE__*/ defineComponent({
|
|
964
|
+
__name: "group",
|
|
965
|
+
props: {
|
|
966
|
+
id: {
|
|
967
|
+
type: String,
|
|
968
|
+
required: true
|
|
969
|
+
},
|
|
970
|
+
title: {
|
|
971
|
+
type: String,
|
|
972
|
+
required: true
|
|
973
|
+
},
|
|
974
|
+
collapse: {
|
|
975
|
+
type: Boolean,
|
|
976
|
+
required: true
|
|
977
|
+
},
|
|
978
|
+
count: {
|
|
979
|
+
type: Number,
|
|
980
|
+
required: true
|
|
981
|
+
}
|
|
982
|
+
},
|
|
983
|
+
emits: ["x-click"],
|
|
984
|
+
setup(__props, { emit: __emit }) {
|
|
985
|
+
const { backgroundColor2, highlightColor } = useColor();
|
|
986
|
+
const emit = __emit;
|
|
987
|
+
const mouseOver = ref(false);
|
|
988
|
+
const style = computed(() => {
|
|
989
|
+
return {
|
|
990
|
+
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
991
|
+
height: "30px",
|
|
992
|
+
userSelect: "none"
|
|
993
|
+
};
|
|
994
|
+
});
|
|
995
|
+
return (_ctx, _cache) => {
|
|
996
|
+
const _component_v_icon = resolveComponent("v-icon");
|
|
997
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
998
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
999
|
+
class: "d-flex align-center cursor-pointer",
|
|
1000
|
+
style: normalizeStyle(style.value),
|
|
1001
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("x-click", __props.id)),
|
|
1002
|
+
onMouseout: _cache[1] || (_cache[1] = ($event) => mouseOver.value = false),
|
|
1003
|
+
onMouseover: _cache[2] || (_cache[2] = ($event) => mouseOver.value = true)
|
|
1004
|
+
}, [
|
|
1005
|
+
createVNode(_component_v_icon, {
|
|
1006
|
+
icon: __props.collapse ? "mdi-chevron-right" : "mdi-chevron-down",
|
|
1007
|
+
size: "small"
|
|
1008
|
+
}, null, 8, ["icon"]),
|
|
1009
|
+
createElementVNode("span", _hoisted_1$19, toDisplayString(__props.title), 1),
|
|
1010
|
+
createElementVNode("span", _hoisted_2$6, toDisplayString(__props.count), 1)
|
|
1011
|
+
], 36)), [[_directive_ripple]]);
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
//#endregion
|
|
1017
|
+
//#region src/components/values/adaptSlot/adaptSlotList/group.vue
|
|
1018
|
+
var group_default$1 = group_vue_vue_type_script_setup_true_lang_default$1;
|
|
1019
|
+
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region src/components/values/adaptSlot/adaptSlotList/item.vue?vue&type=script&setup=true&lang.ts
|
|
1022
|
+
const _hoisted_1$18 = { class: "text-body-large ml-6" };
|
|
1023
|
+
var item_vue_vue_type_script_setup_true_lang_default$2 = /*@__PURE__*/ defineComponent({
|
|
1024
|
+
__name: "item",
|
|
1025
|
+
props: {
|
|
1026
|
+
id: {
|
|
1027
|
+
type: String,
|
|
1028
|
+
required: true
|
|
1029
|
+
},
|
|
1030
|
+
title: {
|
|
1031
|
+
type: String,
|
|
1032
|
+
required: true
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
emits: ["x-click"],
|
|
1036
|
+
setup(__props, { emit: __emit }) {
|
|
1037
|
+
const { backgroundColor2, highlightColor } = useColor();
|
|
1038
|
+
const emit = __emit;
|
|
1039
|
+
const mouseOver = ref(false);
|
|
1040
|
+
const style = computed(() => {
|
|
1041
|
+
return {
|
|
1042
|
+
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
1043
|
+
height: "48px",
|
|
1044
|
+
userSelect: "none"
|
|
1045
|
+
};
|
|
1046
|
+
});
|
|
1047
|
+
return (_ctx, _cache) => {
|
|
1048
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
1049
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
1050
|
+
class: "d-flex align-center cursor-pointer",
|
|
1051
|
+
style: normalizeStyle(style.value),
|
|
1052
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("x-click", __props.id)),
|
|
1053
|
+
onMouseout: _cache[1] || (_cache[1] = ($event) => mouseOver.value = false),
|
|
1054
|
+
onMouseover: _cache[2] || (_cache[2] = ($event) => mouseOver.value = true)
|
|
1055
|
+
}, [createElementVNode("span", _hoisted_1$18, toDisplayString(__props.title), 1)], 36)), [[_directive_ripple]]);
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
|
|
1060
|
+
//#endregion
|
|
1061
|
+
//#region src/components/values/adaptSlot/adaptSlotList/item.vue
|
|
1062
|
+
var item_default$2 = item_vue_vue_type_script_setup_true_lang_default$2;
|
|
1063
|
+
|
|
1064
|
+
//#endregion
|
|
1065
|
+
//#region src/components/values/adaptSlot/adaptSlotList/index.vue?vue&type=script&setup=true&lang.ts
|
|
1066
|
+
const _hoisted_1$17 = { key: 0 };
|
|
1067
|
+
const _hoisted_2$5 = {
|
|
1068
|
+
key: 1,
|
|
1069
|
+
class: "text-body-medium text-grey ml-3"
|
|
1070
|
+
};
|
|
1071
|
+
var index_vue_vue_type_script_setup_true_lang_default$15 = /*@__PURE__*/ defineComponent({
|
|
1072
|
+
__name: "index",
|
|
1073
|
+
props: {
|
|
1074
|
+
"open": {
|
|
1075
|
+
type: Boolean,
|
|
1076
|
+
required: true
|
|
1077
|
+
},
|
|
1078
|
+
"openModifiers": {}
|
|
1079
|
+
},
|
|
1080
|
+
emits: /*@__PURE__*/ mergeModels(["x-select"], ["update:open"]),
|
|
1081
|
+
setup(__props, { emit: __emit }) {
|
|
1082
|
+
const { t } = useI18n();
|
|
1083
|
+
const open = useModel(__props, "open");
|
|
1084
|
+
const emit = __emit;
|
|
1085
|
+
const adaptSlotList = injectAdaptSlotList();
|
|
1086
|
+
const onGroupClick = (id) => {
|
|
1087
|
+
const group = getListEntry(adaptSlotList, id);
|
|
1088
|
+
if (!group) return;
|
|
1089
|
+
setCollapse(adaptSlotList, id, !group.collapse);
|
|
1090
|
+
};
|
|
1091
|
+
const onItemClick = (id) => {
|
|
1092
|
+
open.value = false;
|
|
1093
|
+
emit("x-select", id);
|
|
1094
|
+
};
|
|
1095
|
+
return (_ctx, _cache) => {
|
|
1096
|
+
return unref(adaptSlotList).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$17, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(adaptSlotList), (item) => {
|
|
1097
|
+
return openBlock(), createElementBlock(Fragment, { key: item.id }, [item.type === 0 ? (openBlock(), createBlock(group_default$1, {
|
|
1098
|
+
key: 0,
|
|
1099
|
+
id: item.id,
|
|
1100
|
+
collapse: item.collapse,
|
|
1101
|
+
count: item.count ?? 0,
|
|
1102
|
+
title: item.name,
|
|
1103
|
+
onXClick: onGroupClick
|
|
1104
|
+
}, null, 8, [
|
|
1105
|
+
"id",
|
|
1106
|
+
"collapse",
|
|
1107
|
+
"count",
|
|
1108
|
+
"title"
|
|
1109
|
+
])) : createCommentVNode("v-if", true), item.type === 1 && item.show ? (openBlock(), createBlock(item_default$2, {
|
|
1110
|
+
key: 1,
|
|
1111
|
+
id: item.id,
|
|
1112
|
+
title: item.name,
|
|
1113
|
+
onXClick: onItemClick
|
|
1114
|
+
}, null, 8, ["id", "title"])) : createCommentVNode("v-if", true)], 64);
|
|
1115
|
+
}), 128))])) : (openBlock(), createElementBlock("div", _hoisted_2$5, toDisplayString(unref(t)("x-prop-tree.noAdaptSlot")), 1));
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
|
|
1120
|
+
//#endregion
|
|
1121
|
+
//#region src/components/values/adaptSlot/adaptSlotList/index.vue
|
|
1122
|
+
var adaptSlotList_default = index_vue_vue_type_script_setup_true_lang_default$15;
|
|
1123
|
+
|
|
1124
|
+
//#endregion
|
|
1125
|
+
//#region src/components/values/adaptSlot/index.vue?vue&type=script&setup=true&lang.ts
|
|
1126
|
+
const _hoisted_1$16 = { class: "text-body-large" };
|
|
1127
|
+
var index_vue_vue_type_script_setup_true_lang_default$14 = /*@__PURE__*/ defineComponent({
|
|
1128
|
+
__name: "index",
|
|
1129
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1130
|
+
hasDelete: {
|
|
1131
|
+
type: Boolean,
|
|
1132
|
+
required: false,
|
|
1133
|
+
default: false
|
|
1134
|
+
},
|
|
1135
|
+
readonly: {
|
|
1136
|
+
type: Boolean,
|
|
1137
|
+
required: false,
|
|
1138
|
+
default: false
|
|
1139
|
+
}
|
|
1140
|
+
}, {
|
|
1141
|
+
"modelValue": {
|
|
1142
|
+
type: [Object, null],
|
|
1143
|
+
default: null
|
|
1144
|
+
},
|
|
1145
|
+
"modelModifiers": {}
|
|
1146
|
+
}),
|
|
1147
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
1148
|
+
setup(__props, { emit: __emit }) {
|
|
1149
|
+
const { t } = useI18n();
|
|
1150
|
+
const display = useDisplay();
|
|
1151
|
+
const { sysBarAvail } = useSystem();
|
|
1152
|
+
const { backgroundColor1 } = useColor();
|
|
1153
|
+
const adaptSlot = useModel(__props, "modelValue");
|
|
1154
|
+
const emit = __emit;
|
|
1155
|
+
const adaptSlotList = injectAdaptSlotList();
|
|
1156
|
+
const wrapStyle = computed(() => {
|
|
1157
|
+
let width = "100%";
|
|
1158
|
+
if (display.mdAndUp.value) width = "400px";
|
|
1159
|
+
return {
|
|
1160
|
+
background: backgroundColor1.value,
|
|
1161
|
+
width,
|
|
1162
|
+
height: "100%"
|
|
1163
|
+
};
|
|
1164
|
+
});
|
|
1165
|
+
const contStyle = computed(() => {
|
|
1166
|
+
let h = 48;
|
|
1167
|
+
if (sysBarAvail.value) h += 24;
|
|
1168
|
+
return {
|
|
1169
|
+
position: "relative",
|
|
1170
|
+
height: `calc(100% - ${h}px)`
|
|
1171
|
+
};
|
|
1172
|
+
});
|
|
1173
|
+
const tailStyle = computed(() => {
|
|
1174
|
+
return { height: "60px" };
|
|
1175
|
+
});
|
|
1176
|
+
watchEffect(() => {
|
|
1177
|
+
if (!adaptSlot.value) return;
|
|
1178
|
+
const item = getListEntry(adaptSlotList, adaptSlot.value.id);
|
|
1179
|
+
if (item && !isEqual(item.names, adaptSlot.value.names)) adaptSlot.value = {
|
|
1180
|
+
...adaptSlot.value,
|
|
1181
|
+
names: cloneDeep(item.names)
|
|
1182
|
+
};
|
|
1183
|
+
});
|
|
1184
|
+
const title = computed(() => {
|
|
1185
|
+
if (adaptSlot.value) {
|
|
1186
|
+
const { kind } = unwrapSlotId(adaptSlot.value.id);
|
|
1187
|
+
if (kind === "elementSlot" || kind === "multipleElementSlot") return adaptSlot.value.names.map((v) => t(v)).join(" / ");
|
|
1188
|
+
else return adaptSlot.value.names.join(" / ");
|
|
1189
|
+
} else return t("x-runtime-lib.notSet");
|
|
1190
|
+
});
|
|
1191
|
+
const { open } = useViewStack(`propTreeAdaptSlotSelectDlg${useId()}`);
|
|
1192
|
+
onUnmounted(() => {
|
|
1193
|
+
open.value = false;
|
|
1194
|
+
});
|
|
1195
|
+
function onAdaptSlotSelect(id) {
|
|
1196
|
+
if (!id) {
|
|
1197
|
+
adaptSlot.value = null;
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
const item = getListEntry(adaptSlotList, id);
|
|
1201
|
+
if (!item) {
|
|
1202
|
+
adaptSlot.value = null;
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1205
|
+
adaptSlot.value = {
|
|
1206
|
+
id: item.id,
|
|
1207
|
+
names: item.names
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
return (_ctx, _cache) => {
|
|
1211
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
1212
|
+
const _component_v_sheet = resolveComponent("v-sheet");
|
|
1213
|
+
const _component_v_dialog = resolveComponent("v-dialog");
|
|
1214
|
+
return openBlock(), createBlock(_component_v_dialog, {
|
|
1215
|
+
modelValue: unref(open),
|
|
1216
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(open) ? open.value = $event : null),
|
|
1217
|
+
fullscreen: "",
|
|
1218
|
+
"no-click-animation": "",
|
|
1219
|
+
persistent: "",
|
|
1220
|
+
transition: "scroll-x-reverse-transition",
|
|
1221
|
+
onKeydown: _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => open.value = false, ["stop", "prevent"]), ["esc"]))
|
|
1222
|
+
}, {
|
|
1223
|
+
activator: withCtx(({ props: activatorProps }) => [createVNode(_component_v_btn, mergeProps(activatorProps, {
|
|
1224
|
+
block: "",
|
|
1225
|
+
density: "comfortable",
|
|
1226
|
+
readonly: __props.readonly
|
|
1227
|
+
}), {
|
|
1228
|
+
default: withCtx(() => [createTextVNode(toDisplayString(title.value), 1)]),
|
|
1229
|
+
_: 1
|
|
1230
|
+
}, 16, ["readonly"]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
1231
|
+
key: 0,
|
|
1232
|
+
class: "mx-2",
|
|
1233
|
+
density: "compact",
|
|
1234
|
+
icon: "mdi-minus",
|
|
1235
|
+
variant: "text",
|
|
1236
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
1237
|
+
})) : createCommentVNode("v-if", true)]),
|
|
1238
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
1239
|
+
class: "w-100 h-100 d-flex flex-row-reverse",
|
|
1240
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => open.value = false, ["self"])),
|
|
1241
|
+
onContextmenu: _cache[4] || (_cache[4] = withModifiers(($event) => open.value = false, ["self", "prevent"]))
|
|
1242
|
+
}, [createElementVNode("div", {
|
|
1243
|
+
class: "elevation-2",
|
|
1244
|
+
style: normalizeStyle(wrapStyle.value)
|
|
1245
|
+
}, [
|
|
1246
|
+
unref(sysBarAvail) ? (openBlock(), createBlock(_component_v_sheet, {
|
|
1247
|
+
key: 0,
|
|
1248
|
+
color: "transparent",
|
|
1249
|
+
height: 24
|
|
1250
|
+
})) : createCommentVNode("v-if", true),
|
|
1251
|
+
createVNode(_component_v_sheet, {
|
|
1252
|
+
class: "d-flex align-center px-3",
|
|
1253
|
+
color: "transparent",
|
|
1254
|
+
height: 48
|
|
1255
|
+
}, {
|
|
1256
|
+
default: withCtx(() => [createVNode(_component_v_btn, {
|
|
1257
|
+
density: "comfortable",
|
|
1258
|
+
icon: "mdi-close",
|
|
1259
|
+
variant: "text",
|
|
1260
|
+
onClick: _cache[1] || (_cache[1] = ($event) => open.value = false)
|
|
1261
|
+
}), createElementVNode("span", _hoisted_1$16, toDisplayString(unref(t)("x-prop-tree.selectAdaptSlot")), 1)]),
|
|
1262
|
+
_: 1
|
|
1263
|
+
}),
|
|
1264
|
+
createElementVNode("div", {
|
|
1265
|
+
class: "overflow-y-auto",
|
|
1266
|
+
style: normalizeStyle(contStyle.value)
|
|
1267
|
+
}, [createVNode(adaptSlotList_default, {
|
|
1268
|
+
open: unref(open),
|
|
1269
|
+
"onUpdate:open": _cache[2] || (_cache[2] = ($event) => isRef(open) ? open.value = $event : null),
|
|
1270
|
+
onXSelect: onAdaptSlotSelect
|
|
1271
|
+
}, null, 8, ["open"]), createElementVNode("div", { style: normalizeStyle(tailStyle.value) }, null, 4)], 4)
|
|
1272
|
+
], 4)], 32)]),
|
|
1273
|
+
_: 1
|
|
1274
|
+
}, 8, ["modelValue"]);
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
|
|
1279
|
+
//#endregion
|
|
1280
|
+
//#region src/components/values/adaptSlot/index.vue
|
|
1281
|
+
var adaptSlot_default = index_vue_vue_type_script_setup_true_lang_default$14;
|
|
1282
|
+
|
|
1283
|
+
//#endregion
|
|
1284
|
+
//#region src/components/values/comp/compList/group.vue?vue&type=script&setup=true&lang.ts
|
|
1285
|
+
const _hoisted_1$15 = { class: "text-label-large ml-1" };
|
|
1286
|
+
const _hoisted_2$4 = { class: "text-body-small text-grey ml-1" };
|
|
1287
|
+
var group_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
1288
|
+
__name: "group",
|
|
1289
|
+
props: {
|
|
1290
|
+
id: {
|
|
1291
|
+
type: String,
|
|
1292
|
+
required: true
|
|
1293
|
+
},
|
|
1294
|
+
title: {
|
|
1295
|
+
type: String,
|
|
1296
|
+
required: true
|
|
1297
|
+
},
|
|
1298
|
+
collapse: {
|
|
1299
|
+
type: Boolean,
|
|
1300
|
+
required: true
|
|
1301
|
+
},
|
|
1302
|
+
count: {
|
|
1303
|
+
type: Number,
|
|
1304
|
+
required: true
|
|
1305
|
+
}
|
|
1306
|
+
},
|
|
1307
|
+
emits: ["x-click"],
|
|
1308
|
+
setup(__props, { emit: __emit }) {
|
|
1309
|
+
const { backgroundColor2, highlightColor } = useColor();
|
|
1310
|
+
const emit = __emit;
|
|
1311
|
+
const mouseOver = ref(false);
|
|
1312
|
+
const style = computed(() => {
|
|
1313
|
+
return {
|
|
1314
|
+
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
1315
|
+
height: "30px",
|
|
1316
|
+
userSelect: "none"
|
|
1317
|
+
};
|
|
1318
|
+
});
|
|
1319
|
+
return (_ctx, _cache) => {
|
|
1320
|
+
const _component_v_icon = resolveComponent("v-icon");
|
|
1321
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
1322
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
1323
|
+
class: "d-flex align-center cursor-pointer",
|
|
1324
|
+
style: normalizeStyle(style.value),
|
|
1325
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("x-click", __props.id)),
|
|
1326
|
+
onMouseout: _cache[1] || (_cache[1] = ($event) => mouseOver.value = false),
|
|
1327
|
+
onMouseover: _cache[2] || (_cache[2] = ($event) => mouseOver.value = true)
|
|
1328
|
+
}, [
|
|
1329
|
+
createVNode(_component_v_icon, {
|
|
1330
|
+
icon: __props.collapse ? "mdi-chevron-right" : "mdi-chevron-down",
|
|
1331
|
+
size: "small"
|
|
1332
|
+
}, null, 8, ["icon"]),
|
|
1333
|
+
createElementVNode("span", _hoisted_1$15, toDisplayString(__props.title), 1),
|
|
1334
|
+
createElementVNode("span", _hoisted_2$4, toDisplayString(__props.count), 1)
|
|
1335
|
+
], 36)), [[_directive_ripple]]);
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
|
|
1340
|
+
//#endregion
|
|
1341
|
+
//#region src/components/values/comp/compList/group.vue
|
|
1342
|
+
var group_default = group_vue_vue_type_script_setup_true_lang_default;
|
|
1343
|
+
|
|
1344
|
+
//#endregion
|
|
1345
|
+
//#region src/components/values/comp/compList/item.vue?vue&type=script&setup=true&lang.ts
|
|
1346
|
+
const _hoisted_1$14 = { class: "text-body-large ml-6" };
|
|
1347
|
+
var item_vue_vue_type_script_setup_true_lang_default$1 = /*@__PURE__*/ defineComponent({
|
|
1348
|
+
__name: "item",
|
|
1349
|
+
props: {
|
|
1350
|
+
id: {
|
|
1351
|
+
type: String,
|
|
1352
|
+
required: true
|
|
1353
|
+
},
|
|
1354
|
+
title: {
|
|
1355
|
+
type: String,
|
|
1356
|
+
required: true
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
emits: ["x-click"],
|
|
1360
|
+
setup(__props, { emit: __emit }) {
|
|
1361
|
+
const { backgroundColor2, highlightColor } = useColor();
|
|
1362
|
+
const emit = __emit;
|
|
1363
|
+
const mouseOver = ref(false);
|
|
1364
|
+
const style = computed(() => {
|
|
1365
|
+
return {
|
|
1366
|
+
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
1367
|
+
height: "48px",
|
|
1368
|
+
userSelect: "none"
|
|
1369
|
+
};
|
|
1370
|
+
});
|
|
1371
|
+
return (_ctx, _cache) => {
|
|
1372
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
1373
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
1374
|
+
class: "d-flex align-center cursor-pointer",
|
|
1375
|
+
style: normalizeStyle(style.value),
|
|
1376
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("x-click", __props.id)),
|
|
1377
|
+
onMouseout: _cache[1] || (_cache[1] = ($event) => mouseOver.value = false),
|
|
1378
|
+
onMouseover: _cache[2] || (_cache[2] = ($event) => mouseOver.value = true)
|
|
1379
|
+
}, [createElementVNode("span", _hoisted_1$14, toDisplayString(__props.title), 1)], 36)), [[_directive_ripple]]);
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
});
|
|
1383
|
+
|
|
1384
|
+
//#endregion
|
|
1385
|
+
//#region src/components/values/comp/compList/item.vue
|
|
1386
|
+
var item_default$1 = item_vue_vue_type_script_setup_true_lang_default$1;
|
|
1387
|
+
|
|
1388
|
+
//#endregion
|
|
1389
|
+
//#region src/components/values/comp/compList/index.vue?vue&type=script&setup=true&lang.ts
|
|
1390
|
+
const _hoisted_1$13 = { key: 0 };
|
|
1391
|
+
const _hoisted_2$3 = {
|
|
1392
|
+
key: 1,
|
|
1393
|
+
class: "text-body-medium text-grey ml-3"
|
|
1394
|
+
};
|
|
1395
|
+
var index_vue_vue_type_script_setup_true_lang_default$13 = /*@__PURE__*/ defineComponent({
|
|
1396
|
+
__name: "index",
|
|
1397
|
+
props: {
|
|
1398
|
+
"open": {
|
|
1399
|
+
type: Boolean,
|
|
1400
|
+
required: true
|
|
1401
|
+
},
|
|
1402
|
+
"openModifiers": {}
|
|
1403
|
+
},
|
|
1404
|
+
emits: /*@__PURE__*/ mergeModels(["x-select"], ["update:open"]),
|
|
1405
|
+
setup(__props, { emit: __emit }) {
|
|
1406
|
+
const { t } = useI18n();
|
|
1407
|
+
const open = useModel(__props, "open");
|
|
1408
|
+
const emit = __emit;
|
|
1409
|
+
const compList = injectCompList();
|
|
1410
|
+
function onGroupClick(id) {
|
|
1411
|
+
const group = getListEntry(compList, id);
|
|
1412
|
+
if (!group) return;
|
|
1413
|
+
setCollapse(compList, id, !group.collapse);
|
|
1414
|
+
}
|
|
1415
|
+
function onItemClick(id) {
|
|
1416
|
+
open.value = false;
|
|
1417
|
+
emit("x-select", id);
|
|
1418
|
+
eventBus.emit("refreshDepends");
|
|
1419
|
+
}
|
|
1420
|
+
return (_ctx, _cache) => {
|
|
1421
|
+
return unref(compList).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$13, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(compList), (item) => {
|
|
1422
|
+
return openBlock(), createElementBlock(Fragment, { key: item.id }, [item.type === 0 ? (openBlock(), createBlock(group_default, {
|
|
1423
|
+
key: 0,
|
|
1424
|
+
id: item.id,
|
|
1425
|
+
collapse: item.collapse,
|
|
1426
|
+
count: item.count ?? 0,
|
|
1427
|
+
title: item.name,
|
|
1428
|
+
onXClick: onGroupClick
|
|
1429
|
+
}, null, 8, [
|
|
1430
|
+
"id",
|
|
1431
|
+
"collapse",
|
|
1432
|
+
"count",
|
|
1433
|
+
"title"
|
|
1434
|
+
])) : createCommentVNode("v-if", true), item.type === 1 && item.show ? (openBlock(), createBlock(item_default$1, {
|
|
1435
|
+
key: 1,
|
|
1436
|
+
id: item.id,
|
|
1437
|
+
title: item.name,
|
|
1438
|
+
onXClick: onItemClick
|
|
1439
|
+
}, null, 8, ["id", "title"])) : createCommentVNode("v-if", true)], 64);
|
|
1440
|
+
}), 128))])) : (openBlock(), createElementBlock("div", _hoisted_2$3, toDisplayString(unref(t)("x-prop-tree.noComp")), 1));
|
|
1441
|
+
};
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
|
|
1445
|
+
//#endregion
|
|
1446
|
+
//#region src/components/values/comp/compList/index.vue
|
|
1447
|
+
var compList_default = index_vue_vue_type_script_setup_true_lang_default$13;
|
|
1448
|
+
|
|
1449
|
+
//#endregion
|
|
1450
|
+
//#region src/components/values/comp/index.vue?vue&type=script&setup=true&lang.ts
|
|
1451
|
+
const _hoisted_1$12 = { class: "text-body-large" };
|
|
1452
|
+
var index_vue_vue_type_script_setup_true_lang_default$12 = /*@__PURE__*/ defineComponent({
|
|
1453
|
+
__name: "index",
|
|
1454
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1455
|
+
hasDelete: {
|
|
1456
|
+
type: Boolean,
|
|
1457
|
+
required: false,
|
|
1458
|
+
default: false
|
|
1459
|
+
},
|
|
1460
|
+
readonly: {
|
|
1461
|
+
type: Boolean,
|
|
1462
|
+
required: false,
|
|
1463
|
+
default: false
|
|
1464
|
+
}
|
|
1465
|
+
}, {
|
|
1466
|
+
"modelValue": {
|
|
1467
|
+
type: [Object, null],
|
|
1468
|
+
default: null
|
|
1469
|
+
},
|
|
1470
|
+
"modelModifiers": {}
|
|
1471
|
+
}),
|
|
1472
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
1473
|
+
setup(__props, { emit: __emit }) {
|
|
1474
|
+
const { t } = useI18n();
|
|
1475
|
+
const display = useDisplay();
|
|
1476
|
+
const { sysBarAvail } = useSystem();
|
|
1477
|
+
const { backgroundColor1 } = useColor();
|
|
1478
|
+
const comp = useModel(__props, "modelValue");
|
|
1479
|
+
const emit = __emit;
|
|
1480
|
+
const compList = injectCompList();
|
|
1481
|
+
const wrapStyle = computed(() => {
|
|
1482
|
+
let width = "100%";
|
|
1483
|
+
if (display.mdAndUp.value) width = "400px";
|
|
1484
|
+
return {
|
|
1485
|
+
background: backgroundColor1.value,
|
|
1486
|
+
width,
|
|
1487
|
+
height: "100%"
|
|
1488
|
+
};
|
|
1489
|
+
});
|
|
1490
|
+
const contStyle = computed(() => {
|
|
1491
|
+
let h = 48;
|
|
1492
|
+
if (sysBarAvail.value) h += 24;
|
|
1493
|
+
return {
|
|
1494
|
+
position: "relative",
|
|
1495
|
+
height: `calc(100% - ${h}px)`
|
|
1496
|
+
};
|
|
1497
|
+
});
|
|
1498
|
+
const tailStyle = computed(() => {
|
|
1499
|
+
return { height: "60px" };
|
|
1500
|
+
});
|
|
1501
|
+
watchEffect(() => {
|
|
1502
|
+
if (!comp.value) return;
|
|
1503
|
+
const item = getListEntry(compList, comp.value.id);
|
|
1504
|
+
if (item && item.name !== comp.value.name) comp.value = {
|
|
1505
|
+
...comp.value,
|
|
1506
|
+
name: item.name
|
|
1507
|
+
};
|
|
1508
|
+
});
|
|
1509
|
+
const title = computed(() => {
|
|
1510
|
+
if (comp.value) return comp.value.name;
|
|
1511
|
+
else return t("x-runtime-lib.notSet");
|
|
1512
|
+
});
|
|
1513
|
+
const { open } = useViewStack(`propTreeCompSelectDlg${useId()}`);
|
|
1514
|
+
onUnmounted(() => {
|
|
1515
|
+
open.value = false;
|
|
1516
|
+
});
|
|
1517
|
+
function onCompSelect(id) {
|
|
1518
|
+
if (!id) {
|
|
1519
|
+
comp.value = null;
|
|
1520
|
+
return;
|
|
1521
|
+
}
|
|
1522
|
+
const item = getListEntry(compList, id);
|
|
1523
|
+
if (!item) {
|
|
1524
|
+
comp.value = null;
|
|
1525
|
+
return;
|
|
1526
|
+
}
|
|
1527
|
+
comp.value = {
|
|
1528
|
+
id: item.id,
|
|
1529
|
+
name: item.name
|
|
1530
|
+
};
|
|
1531
|
+
}
|
|
1532
|
+
return (_ctx, _cache) => {
|
|
1533
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
1534
|
+
const _component_v_sheet = resolveComponent("v-sheet");
|
|
1535
|
+
const _component_v_dialog = resolveComponent("v-dialog");
|
|
1536
|
+
return openBlock(), createBlock(_component_v_dialog, {
|
|
1537
|
+
modelValue: unref(open),
|
|
1538
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(open) ? open.value = $event : null),
|
|
1539
|
+
fullscreen: "",
|
|
1540
|
+
"no-click-animation": "",
|
|
1541
|
+
persistent: "",
|
|
1542
|
+
transition: "scroll-x-reverse-transition",
|
|
1543
|
+
onKeydown: _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => open.value = false, ["stop", "prevent"]), ["esc"]))
|
|
1544
|
+
}, {
|
|
1545
|
+
activator: withCtx(({ props: activatorProps }) => [createVNode(_component_v_btn, mergeProps(activatorProps, {
|
|
1546
|
+
block: "",
|
|
1547
|
+
density: "comfortable",
|
|
1548
|
+
readonly: __props.readonly
|
|
1549
|
+
}), {
|
|
1550
|
+
default: withCtx(() => [createTextVNode(toDisplayString(title.value), 1)]),
|
|
1551
|
+
_: 1
|
|
1552
|
+
}, 16, ["readonly"]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
1553
|
+
key: 0,
|
|
1554
|
+
class: "mx-2",
|
|
1555
|
+
density: "compact",
|
|
1556
|
+
icon: "mdi-minus",
|
|
1557
|
+
variant: "text",
|
|
1558
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
1559
|
+
})) : createCommentVNode("v-if", true)]),
|
|
1560
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
1561
|
+
class: "w-100 h-100 d-flex flex-row-reverse",
|
|
1562
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => open.value = false, ["self"])),
|
|
1563
|
+
onContextmenu: _cache[4] || (_cache[4] = withModifiers(($event) => open.value = false, ["self", "prevent"]))
|
|
1564
|
+
}, [createElementVNode("div", {
|
|
1565
|
+
class: "elevation-2",
|
|
1566
|
+
style: normalizeStyle(wrapStyle.value)
|
|
1567
|
+
}, [
|
|
1568
|
+
unref(sysBarAvail) ? (openBlock(), createBlock(_component_v_sheet, {
|
|
1569
|
+
key: 0,
|
|
1570
|
+
color: "transparent",
|
|
1571
|
+
height: 24
|
|
1572
|
+
})) : createCommentVNode("v-if", true),
|
|
1573
|
+
createVNode(_component_v_sheet, {
|
|
1574
|
+
class: "d-flex align-center px-3",
|
|
1575
|
+
color: "transparent",
|
|
1576
|
+
height: 48
|
|
1577
|
+
}, {
|
|
1578
|
+
default: withCtx(() => [createVNode(_component_v_btn, {
|
|
1579
|
+
density: "comfortable",
|
|
1580
|
+
icon: "mdi-close",
|
|
1581
|
+
variant: "text",
|
|
1582
|
+
onClick: _cache[1] || (_cache[1] = ($event) => open.value = false)
|
|
1583
|
+
}), createElementVNode("span", _hoisted_1$12, toDisplayString(unref(t)("x-prop-tree.selectComp")), 1)]),
|
|
1584
|
+
_: 1
|
|
1585
|
+
}),
|
|
1586
|
+
createElementVNode("div", {
|
|
1587
|
+
class: "overflow-y-auto",
|
|
1588
|
+
style: normalizeStyle(contStyle.value)
|
|
1589
|
+
}, [createVNode(compList_default, {
|
|
1590
|
+
open: unref(open),
|
|
1591
|
+
"onUpdate:open": _cache[2] || (_cache[2] = ($event) => isRef(open) ? open.value = $event : null),
|
|
1592
|
+
onXSelect: onCompSelect
|
|
1593
|
+
}, null, 8, ["open"]), createElementVNode("div", { style: normalizeStyle(tailStyle.value) }, null, 4)], 4)
|
|
1594
|
+
], 4)], 32)]),
|
|
1595
|
+
_: 1
|
|
1596
|
+
}, 8, ["modelValue"]);
|
|
1597
|
+
};
|
|
1598
|
+
}
|
|
1599
|
+
});
|
|
1600
|
+
|
|
1601
|
+
//#endregion
|
|
1602
|
+
//#region src/components/values/comp/index.vue
|
|
1603
|
+
var comp_default = index_vue_vue_type_script_setup_true_lang_default$12;
|
|
1604
|
+
|
|
1605
|
+
//#endregion
|
|
1606
|
+
//#region src/components/values/icon/index.vue?vue&type=script&setup=true&lang.ts
|
|
1607
|
+
const _hoisted_1$11 = { class: "d-flex justify-space-between align-center" };
|
|
1608
|
+
var index_vue_vue_type_script_setup_true_lang_default$11 = /*@__PURE__*/ defineComponent({
|
|
1609
|
+
__name: "index",
|
|
1610
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1611
|
+
hasDelete: {
|
|
1612
|
+
type: Boolean,
|
|
1613
|
+
required: false,
|
|
1614
|
+
default: false
|
|
1615
|
+
},
|
|
1616
|
+
readonly: {
|
|
1617
|
+
type: Boolean,
|
|
1618
|
+
required: false,
|
|
1619
|
+
default: false
|
|
1620
|
+
}
|
|
1621
|
+
}, {
|
|
1622
|
+
"modelValue": {
|
|
1623
|
+
type: String,
|
|
1624
|
+
required: true
|
|
1625
|
+
},
|
|
1626
|
+
"modelModifiers": {}
|
|
1627
|
+
}),
|
|
1628
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
1629
|
+
setup(__props, { emit: __emit }) {
|
|
1630
|
+
const { isMobile } = useSystem();
|
|
1631
|
+
const input = useModel(__props, "modelValue");
|
|
1632
|
+
const emit = __emit;
|
|
1633
|
+
const onUpdateFocused = async (focus) => {
|
|
1634
|
+
if (!focus || __props.readonly || !isMobile()) return;
|
|
1635
|
+
const res = await openPromptDlg({
|
|
1636
|
+
title: "",
|
|
1637
|
+
value: input.value
|
|
1638
|
+
});
|
|
1639
|
+
if (res === void 0) return;
|
|
1640
|
+
input.value = res;
|
|
1641
|
+
};
|
|
1642
|
+
return (_ctx, _cache) => {
|
|
1643
|
+
const _component_v_text_field = resolveComponent("v-text-field");
|
|
1644
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
1645
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
1646
|
+
return openBlock(), createElementBlock("div", _hoisted_1$11, [withDirectives(createVNode(_component_v_text_field, {
|
|
1647
|
+
modelValue: input.value,
|
|
1648
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => input.value = $event),
|
|
1649
|
+
density: "compact",
|
|
1650
|
+
"hide-details": "",
|
|
1651
|
+
readonly: __props.readonly,
|
|
1652
|
+
"single-line": "",
|
|
1653
|
+
"onUpdate:focused": onUpdateFocused
|
|
1654
|
+
}, null, 8, ["modelValue", "readonly"]), [[
|
|
1655
|
+
_directive_ripple,
|
|
1656
|
+
void 0,
|
|
1657
|
+
void 0,
|
|
1658
|
+
{ stop: true }
|
|
1659
|
+
]]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
1660
|
+
key: 0,
|
|
1661
|
+
class: "mx-2",
|
|
1662
|
+
density: "compact",
|
|
1663
|
+
icon: "mdi-minus",
|
|
1664
|
+
variant: "text",
|
|
1665
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
1666
|
+
})) : createCommentVNode("v-if", true)]);
|
|
1667
|
+
};
|
|
1668
|
+
}
|
|
1669
|
+
});
|
|
1670
|
+
|
|
1671
|
+
//#endregion
|
|
1672
|
+
//#region src/components/values/icon/index.vue
|
|
1673
|
+
var icon_default = index_vue_vue_type_script_setup_true_lang_default$11;
|
|
1674
|
+
|
|
1675
|
+
//#endregion
|
|
1676
|
+
//#region src/components/values/json/editor.vue?vue&type=script&setup=true&lang.ts
|
|
1677
|
+
var editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
1678
|
+
__name: "editor",
|
|
1679
|
+
props: {
|
|
1680
|
+
"modelValue": {
|
|
1681
|
+
type: String,
|
|
1682
|
+
required: true
|
|
1683
|
+
},
|
|
1684
|
+
"modelModifiers": {},
|
|
1685
|
+
"lock": {
|
|
1686
|
+
type: Boolean,
|
|
1687
|
+
required: true
|
|
1688
|
+
},
|
|
1689
|
+
"lockModifiers": {},
|
|
1690
|
+
"scale": {
|
|
1691
|
+
type: Number,
|
|
1692
|
+
required: true
|
|
1693
|
+
},
|
|
1694
|
+
"scaleModifiers": {}
|
|
1695
|
+
},
|
|
1696
|
+
emits: [
|
|
1697
|
+
"update:modelValue",
|
|
1698
|
+
"update:lock",
|
|
1699
|
+
"update:scale"
|
|
1700
|
+
],
|
|
1701
|
+
setup(__props, { expose: __expose }) {
|
|
1702
|
+
const json = useModel(__props, "modelValue");
|
|
1703
|
+
const lock = useModel(__props, "lock");
|
|
1704
|
+
const scale = useModel(__props, "scale");
|
|
1705
|
+
const dark = injectDark();
|
|
1706
|
+
const locale = injectLocale();
|
|
1707
|
+
const version = injectVersion();
|
|
1708
|
+
const target = useTemplateRef("target");
|
|
1709
|
+
const onReady = () => {
|
|
1710
|
+
const object = JSON.parse(json.value);
|
|
1711
|
+
target.value?.load(object);
|
|
1712
|
+
};
|
|
1713
|
+
const save = () => {
|
|
1714
|
+
const object = target.value.save();
|
|
1715
|
+
json.value = JSON.stringify(object, null, 2);
|
|
1716
|
+
};
|
|
1717
|
+
__expose({ save });
|
|
1718
|
+
return (_ctx, _cache) => {
|
|
1719
|
+
return openBlock(), createBlock(unref(XBlockly), {
|
|
1720
|
+
ref_key: "target",
|
|
1721
|
+
ref: target,
|
|
1722
|
+
lock: lock.value,
|
|
1723
|
+
"onUpdate:lock": _cache[0] || (_cache[0] = ($event) => lock.value = $event),
|
|
1724
|
+
scale: scale.value,
|
|
1725
|
+
"onUpdate:scale": _cache[1] || (_cache[1] = ($event) => scale.value = $event),
|
|
1726
|
+
dark: unref(dark),
|
|
1727
|
+
locale: unref(locale),
|
|
1728
|
+
type: "json",
|
|
1729
|
+
version: unref(version),
|
|
1730
|
+
onReady
|
|
1731
|
+
}, null, 8, [
|
|
1732
|
+
"lock",
|
|
1733
|
+
"scale",
|
|
1734
|
+
"dark",
|
|
1735
|
+
"locale",
|
|
1736
|
+
"version"
|
|
1737
|
+
]);
|
|
1738
|
+
};
|
|
1739
|
+
}
|
|
1740
|
+
});
|
|
1741
|
+
|
|
1742
|
+
//#endregion
|
|
1743
|
+
//#region src/components/values/json/editor.vue
|
|
1744
|
+
var editor_default = editor_vue_vue_type_script_setup_true_lang_default;
|
|
1745
|
+
|
|
1746
|
+
//#endregion
|
|
1747
|
+
//#region src/components/values/json/index.vue?vue&type=script&setup=true&lang.ts
|
|
1748
|
+
const _hoisted_1$10 = { class: "text-body-large" };
|
|
1749
|
+
var index_vue_vue_type_script_setup_true_lang_default$10 = /*@__PURE__*/ defineComponent({
|
|
1750
|
+
__name: "index",
|
|
1751
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1752
|
+
hasDelete: {
|
|
1753
|
+
type: Boolean,
|
|
1754
|
+
required: false,
|
|
1755
|
+
default: false
|
|
1756
|
+
},
|
|
1757
|
+
readonly: {
|
|
1758
|
+
type: Boolean,
|
|
1759
|
+
required: false,
|
|
1760
|
+
default: false
|
|
1761
|
+
}
|
|
1762
|
+
}, {
|
|
1763
|
+
"modelValue": {
|
|
1764
|
+
type: String,
|
|
1765
|
+
required: true
|
|
1766
|
+
},
|
|
1767
|
+
"modelModifiers": {}
|
|
1768
|
+
}),
|
|
1769
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
1770
|
+
setup(__props, { emit: __emit }) {
|
|
1771
|
+
const { t } = useI18n();
|
|
1772
|
+
const { sysBarAvail } = useSystem();
|
|
1773
|
+
const { backgroundColor0, backgroundColor1, backgroundColor2 } = useColor();
|
|
1774
|
+
const json = useModel(__props, "modelValue");
|
|
1775
|
+
const emit = __emit;
|
|
1776
|
+
const lock = ref(false);
|
|
1777
|
+
const scale = ref(1);
|
|
1778
|
+
const contStyle = computed(() => {
|
|
1779
|
+
let h = 48;
|
|
1780
|
+
if (sysBarAvail.value) h += 24;
|
|
1781
|
+
return {
|
|
1782
|
+
position: "relative",
|
|
1783
|
+
background: backgroundColor1.value,
|
|
1784
|
+
height: `calc(100% - ${h}px)`
|
|
1785
|
+
};
|
|
1786
|
+
});
|
|
1787
|
+
const title = computed(() => {
|
|
1788
|
+
return t("x-prop-tree.jsonEditor");
|
|
1789
|
+
});
|
|
1790
|
+
const { open } = useViewStack(`propTreejsonEditorDlg${useId()}`);
|
|
1791
|
+
onUnmounted(() => {
|
|
1792
|
+
open.value = false;
|
|
1793
|
+
});
|
|
1794
|
+
const editor = useTemplateRef("editor");
|
|
1795
|
+
watch(open, (val) => {
|
|
1796
|
+
if (!val) editor.value?.save();
|
|
1797
|
+
});
|
|
1798
|
+
return (_ctx, _cache) => {
|
|
1799
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
1800
|
+
const _component_v_sheet = resolveComponent("v-sheet");
|
|
1801
|
+
const _component_v_spacer = resolveComponent("v-spacer");
|
|
1802
|
+
const _component_v_dialog = resolveComponent("v-dialog");
|
|
1803
|
+
return openBlock(), createBlock(_component_v_dialog, {
|
|
1804
|
+
modelValue: unref(open),
|
|
1805
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(open) ? open.value = $event : null),
|
|
1806
|
+
attach: "",
|
|
1807
|
+
fullscreen: "",
|
|
1808
|
+
"no-click-animation": "",
|
|
1809
|
+
persistent: "",
|
|
1810
|
+
transition: "dialog-bottom-transition",
|
|
1811
|
+
onKeydown: _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => open.value = false, ["stop", "prevent"]), ["esc"]))
|
|
1812
|
+
}, {
|
|
1813
|
+
activator: withCtx(({ props: activatorProps }) => [createVNode(_component_v_btn, mergeProps(activatorProps, {
|
|
1814
|
+
block: "",
|
|
1815
|
+
density: "comfortable",
|
|
1816
|
+
readonly: __props.readonly
|
|
1817
|
+
}), {
|
|
1818
|
+
default: withCtx(() => [createTextVNode(toDisplayString(title.value), 1)]),
|
|
1819
|
+
_: 1
|
|
1820
|
+
}, 16, ["readonly"]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
1821
|
+
key: 0,
|
|
1822
|
+
class: "mx-2",
|
|
1823
|
+
density: "compact",
|
|
1824
|
+
icon: "mdi-minus",
|
|
1825
|
+
variant: "text",
|
|
1826
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
1827
|
+
})) : createCommentVNode("v-if", true)]),
|
|
1828
|
+
default: withCtx(() => [createVNode(_component_v_sheet, {
|
|
1829
|
+
color: unref(backgroundColor0),
|
|
1830
|
+
height: "100%",
|
|
1831
|
+
width: "100%"
|
|
1832
|
+
}, {
|
|
1833
|
+
default: withCtx(() => [
|
|
1834
|
+
unref(sysBarAvail) ? (openBlock(), createBlock(_component_v_sheet, {
|
|
1835
|
+
key: 0,
|
|
1836
|
+
color: unref(backgroundColor2),
|
|
1837
|
+
height: 24
|
|
1838
|
+
}, null, 8, ["color"])) : createCommentVNode("v-if", true),
|
|
1839
|
+
createVNode(_component_v_sheet, {
|
|
1840
|
+
class: "d-flex align-center px-2",
|
|
1841
|
+
color: unref(backgroundColor2),
|
|
1842
|
+
height: 48
|
|
1843
|
+
}, {
|
|
1844
|
+
default: withCtx(() => [
|
|
1845
|
+
createVNode(_component_v_btn, {
|
|
1846
|
+
density: "comfortable",
|
|
1847
|
+
icon: "mdi-close",
|
|
1848
|
+
variant: "text",
|
|
1849
|
+
onClick: _cache[1] || (_cache[1] = ($event) => open.value = false)
|
|
1850
|
+
}),
|
|
1851
|
+
createElementVNode("span", _hoisted_1$10, toDisplayString(title.value), 1),
|
|
1852
|
+
createVNode(_component_v_spacer)
|
|
1853
|
+
]),
|
|
1854
|
+
_: 1
|
|
1855
|
+
}, 8, ["color"]),
|
|
1856
|
+
createElementVNode("div", { style: normalizeStyle(contStyle.value) }, [createVNode(editor_default, {
|
|
1857
|
+
ref_key: "editor",
|
|
1858
|
+
ref: editor,
|
|
1859
|
+
modelValue: json.value,
|
|
1860
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => json.value = $event),
|
|
1861
|
+
lock: lock.value,
|
|
1862
|
+
"onUpdate:lock": _cache[3] || (_cache[3] = ($event) => lock.value = $event),
|
|
1863
|
+
scale: scale.value,
|
|
1864
|
+
"onUpdate:scale": _cache[4] || (_cache[4] = ($event) => scale.value = $event)
|
|
1865
|
+
}, null, 8, [
|
|
1866
|
+
"modelValue",
|
|
1867
|
+
"lock",
|
|
1868
|
+
"scale"
|
|
1869
|
+
])], 4)
|
|
1870
|
+
]),
|
|
1871
|
+
_: 1
|
|
1872
|
+
}, 8, ["color"])]),
|
|
1873
|
+
_: 1
|
|
1874
|
+
}, 8, ["modelValue"]);
|
|
1875
|
+
};
|
|
1876
|
+
}
|
|
1877
|
+
});
|
|
1878
|
+
|
|
1879
|
+
//#endregion
|
|
1880
|
+
//#region src/components/values/json/index.vue
|
|
1881
|
+
var json_default = index_vue_vue_type_script_setup_true_lang_default$10;
|
|
1882
|
+
|
|
1883
|
+
//#endregion
|
|
1884
|
+
//#region src/components/values/multiTypes/color.vue?vue&type=script&setup=true&lang.ts
|
|
1885
|
+
const _hoisted_1$9 = { class: "d-flex justify-space-between align-center" };
|
|
1886
|
+
var color_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
1887
|
+
__name: "color",
|
|
1888
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1889
|
+
hasDelete: {
|
|
1890
|
+
type: Boolean,
|
|
1891
|
+
required: false,
|
|
1892
|
+
default: false
|
|
1893
|
+
},
|
|
1894
|
+
readonly: {
|
|
1895
|
+
type: Boolean,
|
|
1896
|
+
required: false,
|
|
1897
|
+
default: false
|
|
1898
|
+
}
|
|
1899
|
+
}, {
|
|
1900
|
+
"modelValue": { type: String },
|
|
1901
|
+
"modelModifiers": {}
|
|
1902
|
+
}),
|
|
1903
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
1904
|
+
setup(__props, { emit: __emit }) {
|
|
1905
|
+
const { t } = useI18n();
|
|
1906
|
+
const color = useModel(__props, "modelValue");
|
|
1907
|
+
const emit = __emit;
|
|
1908
|
+
const style = computed(() => {
|
|
1909
|
+
let width = "100%";
|
|
1910
|
+
if (__props.hasDelete) width = `calc(100% - 37px)`;
|
|
1911
|
+
return { width };
|
|
1912
|
+
});
|
|
1913
|
+
const disabled = computed(() => {
|
|
1914
|
+
return __props.readonly;
|
|
1915
|
+
});
|
|
1916
|
+
const { open } = useViewStack(`propTreeColorPickerMenu${useId()}`);
|
|
1917
|
+
onUnmounted(() => {
|
|
1918
|
+
open.value = false;
|
|
1919
|
+
});
|
|
1920
|
+
return (_ctx, _cache) => {
|
|
1921
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
1922
|
+
const _component_v_color_picker = resolveComponent("v-color-picker");
|
|
1923
|
+
const _component_v_menu = resolveComponent("v-menu");
|
|
1924
|
+
return openBlock(), createBlock(_component_v_menu, {
|
|
1925
|
+
modelValue: unref(open),
|
|
1926
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(open) ? open.value = $event : null),
|
|
1927
|
+
"close-on-content-click": false,
|
|
1928
|
+
scrim: "transparent"
|
|
1929
|
+
}, {
|
|
1930
|
+
activator: withCtx(({ props: activatorProps }) => [createElementVNode("div", _hoisted_1$9, [createElementVNode("div", {
|
|
1931
|
+
class: "flex-grow-1",
|
|
1932
|
+
style: normalizeStyle(style.value)
|
|
1933
|
+
}, [createVNode(_component_v_btn, mergeProps(activatorProps, {
|
|
1934
|
+
block: "",
|
|
1935
|
+
color: color.value,
|
|
1936
|
+
density: "comfortable",
|
|
1937
|
+
disabled: disabled.value
|
|
1938
|
+
}), {
|
|
1939
|
+
default: withCtx(() => [createTextVNode(toDisplayString(color.value ? color.value : unref(t)("x-runtime-lib.notSet")), 1)]),
|
|
1940
|
+
_: 1
|
|
1941
|
+
}, 16, ["color", "disabled"])], 4), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
1942
|
+
key: 0,
|
|
1943
|
+
class: "mx-2",
|
|
1944
|
+
density: "compact",
|
|
1945
|
+
icon: "mdi-minus",
|
|
1946
|
+
variant: "text",
|
|
1947
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
1948
|
+
})) : createCommentVNode("v-if", true)])]),
|
|
1949
|
+
default: withCtx(() => [createVNode(_component_v_color_picker, {
|
|
1950
|
+
modelValue: color.value,
|
|
1951
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => color.value = $event),
|
|
1952
|
+
mode: "hexa",
|
|
1953
|
+
"show-swatches": "",
|
|
1954
|
+
"swatches-max-height": "150px"
|
|
1955
|
+
}, null, 8, ["modelValue"])]),
|
|
1956
|
+
_: 1
|
|
1957
|
+
}, 8, ["modelValue"]);
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1960
|
+
});
|
|
1961
|
+
|
|
1962
|
+
//#endregion
|
|
1963
|
+
//#region src/components/values/multiTypes/color.vue
|
|
1964
|
+
var color_default = color_vue_vue_type_script_setup_true_lang_default;
|
|
1965
|
+
|
|
1966
|
+
//#endregion
|
|
1967
|
+
//#region src/components/values/multiTypes/index.vue?vue&type=script&setup=true&lang.ts
|
|
1968
|
+
const _hoisted_1$8 = { class: "d-flex justify-space-between align-center my-2" };
|
|
1969
|
+
const _hoisted_2$2 = { class: "flex-grow-1" };
|
|
1970
|
+
var index_vue_vue_type_script_setup_true_lang_default$9 = /*@__PURE__*/ defineComponent({
|
|
1971
|
+
__name: "index",
|
|
1972
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1973
|
+
hasDelete: {
|
|
1974
|
+
type: Boolean,
|
|
1975
|
+
required: false,
|
|
1976
|
+
default: false
|
|
1977
|
+
},
|
|
1978
|
+
readonly: {
|
|
1979
|
+
type: Boolean,
|
|
1980
|
+
required: false,
|
|
1981
|
+
default: false
|
|
1982
|
+
},
|
|
1983
|
+
types: {
|
|
1984
|
+
type: String,
|
|
1985
|
+
required: true
|
|
1986
|
+
}
|
|
1987
|
+
}, {
|
|
1988
|
+
"modelValue": { type: null },
|
|
1989
|
+
"modelModifiers": {}
|
|
1990
|
+
}),
|
|
1991
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
1992
|
+
setup(__props, { emit: __emit }) {
|
|
1993
|
+
const { t } = useI18n();
|
|
1994
|
+
const { isMobile } = useSystem();
|
|
1995
|
+
const input = useModel(__props, "modelValue");
|
|
1996
|
+
const emit = __emit;
|
|
1997
|
+
const types = computed(() => {
|
|
1998
|
+
return getTypes(__props.types);
|
|
1999
|
+
});
|
|
2000
|
+
const select = ref("");
|
|
2001
|
+
const selectItems = computed(() => {
|
|
2002
|
+
const items = [];
|
|
2003
|
+
for (const { value, title } of types.value) items.push({
|
|
2004
|
+
value,
|
|
2005
|
+
title: t(title)
|
|
2006
|
+
});
|
|
2007
|
+
return items;
|
|
2008
|
+
});
|
|
2009
|
+
watchEffect(() => {
|
|
2010
|
+
for (const { value, validator } of types.value) if (validator(input.value)) {
|
|
2011
|
+
select.value = value;
|
|
2012
|
+
return;
|
|
2013
|
+
}
|
|
2014
|
+
selectFirst();
|
|
2015
|
+
});
|
|
2016
|
+
const type = computed(() => {
|
|
2017
|
+
return types.value.find((entry) => entry.value === select.value);
|
|
2018
|
+
});
|
|
2019
|
+
function onSelectUpdate() {
|
|
2020
|
+
input.value = type.value?.default;
|
|
2021
|
+
}
|
|
2022
|
+
function selectFirst() {
|
|
2023
|
+
select.value = types.value[0].value;
|
|
2024
|
+
onSelectUpdate();
|
|
2025
|
+
}
|
|
2026
|
+
const number = ref(0);
|
|
2027
|
+
const onNumberFocused = async (focus) => {
|
|
2028
|
+
if (!focus || !isMobile()) return;
|
|
2029
|
+
if (!type.value) return;
|
|
2030
|
+
if (type.value.trait !== "number" && type.value.trait !== "numberUnit") return;
|
|
2031
|
+
const res = await openNumberDlg({
|
|
2032
|
+
title: "",
|
|
2033
|
+
value: number.value,
|
|
2034
|
+
precision: type.value.precision,
|
|
2035
|
+
min: type.value.min,
|
|
2036
|
+
max: type.value.max,
|
|
2037
|
+
step: type.value.step
|
|
2038
|
+
});
|
|
2039
|
+
if (res === void 0) return;
|
|
2040
|
+
number.value = res;
|
|
2041
|
+
};
|
|
2042
|
+
watchEffect(() => {
|
|
2043
|
+
if (type.value?.trait === "number") number.value = input.value;
|
|
2044
|
+
else if (type.value?.trait === "numberUnit") number.value = parseNumberUnit(input.value, type.value.unit);
|
|
2045
|
+
});
|
|
2046
|
+
watch(number, (val) => {
|
|
2047
|
+
if (type.value?.trait === "number") input.value = val;
|
|
2048
|
+
else if (type.value?.trait === "numberUnit") input.value = val + type.value.unit;
|
|
2049
|
+
});
|
|
2050
|
+
const hexColor = ref("#ff00ff");
|
|
2051
|
+
watchEffect(() => {
|
|
2052
|
+
if (type.value?.trait === "hexColor") {
|
|
2053
|
+
if (isHexColor(input.value)) hexColor.value = input.value;
|
|
2054
|
+
}
|
|
2055
|
+
});
|
|
2056
|
+
watch(hexColor, (val) => {
|
|
2057
|
+
if (type.value?.trait === "hexColor") input.value = val;
|
|
2058
|
+
});
|
|
2059
|
+
const themeColor = ref("primary");
|
|
2060
|
+
const themeColorItems = computed(() => {
|
|
2061
|
+
const items = [];
|
|
2062
|
+
if (type.value?.trait === "themeColor") for (const { value, title } of themeColors) items.push({
|
|
2063
|
+
value,
|
|
2064
|
+
title: t(title)
|
|
2065
|
+
});
|
|
2066
|
+
return items;
|
|
2067
|
+
});
|
|
2068
|
+
watchEffect(() => {
|
|
2069
|
+
if (type.value?.trait === "themeColor") {
|
|
2070
|
+
if (isThemeColor(input.value)) themeColor.value = input.value;
|
|
2071
|
+
}
|
|
2072
|
+
});
|
|
2073
|
+
watch(themeColor, (val) => {
|
|
2074
|
+
if (type.value?.trait === "themeColor") input.value = val;
|
|
2075
|
+
});
|
|
2076
|
+
return (_ctx, _cache) => {
|
|
2077
|
+
const _component_v_select = resolveComponent("v-select");
|
|
2078
|
+
const _component_v_number_input = resolveComponent("v-number-input");
|
|
2079
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
2080
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
2081
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [createElementVNode("div", _hoisted_2$2, [
|
|
2082
|
+
withDirectives(createVNode(_component_v_select, {
|
|
2083
|
+
modelValue: select.value,
|
|
2084
|
+
"onUpdate:modelValue": [_cache[0] || (_cache[0] = ($event) => select.value = $event), onSelectUpdate],
|
|
2085
|
+
density: "compact",
|
|
2086
|
+
"hide-details": "",
|
|
2087
|
+
items: selectItems.value,
|
|
2088
|
+
readonly: __props.readonly,
|
|
2089
|
+
"single-line": ""
|
|
2090
|
+
}, null, 8, [
|
|
2091
|
+
"modelValue",
|
|
2092
|
+
"items",
|
|
2093
|
+
"readonly"
|
|
2094
|
+
]), [[
|
|
2095
|
+
_directive_ripple,
|
|
2096
|
+
void 0,
|
|
2097
|
+
void 0,
|
|
2098
|
+
{ stop: true }
|
|
2099
|
+
]]),
|
|
2100
|
+
type.value?.trait === "number" || type.value?.trait === "numberUnit" ? withDirectives((openBlock(), createBlock(_component_v_number_input, {
|
|
2101
|
+
key: 0,
|
|
2102
|
+
modelValue: number.value,
|
|
2103
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => number.value = $event),
|
|
2104
|
+
"control-variant": "stacked",
|
|
2105
|
+
density: "compact",
|
|
2106
|
+
"hide-details": "",
|
|
2107
|
+
max: type.value.max,
|
|
2108
|
+
min: type.value.min,
|
|
2109
|
+
precision: type.value.precision,
|
|
2110
|
+
readonly: __props.readonly,
|
|
2111
|
+
"single-line": "",
|
|
2112
|
+
step: type.value.step,
|
|
2113
|
+
"onUpdate:focused": onNumberFocused
|
|
2114
|
+
}, null, 8, [
|
|
2115
|
+
"modelValue",
|
|
2116
|
+
"max",
|
|
2117
|
+
"min",
|
|
2118
|
+
"precision",
|
|
2119
|
+
"readonly",
|
|
2120
|
+
"step"
|
|
2121
|
+
])), [[
|
|
2122
|
+
_directive_ripple,
|
|
2123
|
+
void 0,
|
|
2124
|
+
void 0,
|
|
2125
|
+
{ stop: true }
|
|
2126
|
+
]]) : createCommentVNode("v-if", true),
|
|
2127
|
+
type.value?.trait === "hexColor" ? (openBlock(), createBlock(color_default, {
|
|
2128
|
+
key: 1,
|
|
2129
|
+
modelValue: hexColor.value,
|
|
2130
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => hexColor.value = $event)
|
|
2131
|
+
}, null, 8, ["modelValue"])) : createCommentVNode("v-if", true),
|
|
2132
|
+
type.value?.trait === "themeColor" ? withDirectives((openBlock(), createBlock(_component_v_select, {
|
|
2133
|
+
key: 2,
|
|
2134
|
+
modelValue: themeColor.value,
|
|
2135
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => themeColor.value = $event),
|
|
2136
|
+
density: "compact",
|
|
2137
|
+
"hide-details": "",
|
|
2138
|
+
items: themeColorItems.value,
|
|
2139
|
+
"single-line": ""
|
|
2140
|
+
}, null, 8, ["modelValue", "items"])), [[
|
|
2141
|
+
_directive_ripple,
|
|
2142
|
+
void 0,
|
|
2143
|
+
void 0,
|
|
2144
|
+
{ stop: true }
|
|
2145
|
+
]]) : createCommentVNode("v-if", true)
|
|
2146
|
+
]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
2147
|
+
key: 0,
|
|
2148
|
+
class: "mx-2",
|
|
2149
|
+
density: "compact",
|
|
2150
|
+
icon: "mdi-minus",
|
|
2151
|
+
variant: "text",
|
|
2152
|
+
onClick: _cache[4] || (_cache[4] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
2153
|
+
})) : createCommentVNode("v-if", true)]);
|
|
2154
|
+
};
|
|
2155
|
+
}
|
|
2156
|
+
});
|
|
2157
|
+
|
|
2158
|
+
//#endregion
|
|
2159
|
+
//#region src/components/values/multiTypes/index.vue
|
|
2160
|
+
var multiTypes_default = index_vue_vue_type_script_setup_true_lang_default$9;
|
|
2161
|
+
|
|
2162
|
+
//#endregion
|
|
2163
|
+
//#region src/components/values/number/index.vue?vue&type=script&setup=true&lang.ts
|
|
2164
|
+
const _hoisted_1$7 = { class: "d-flex justify-space-between align-center" };
|
|
2165
|
+
var index_vue_vue_type_script_setup_true_lang_default$8 = /*@__PURE__*/ defineComponent({
|
|
2166
|
+
__name: "index",
|
|
2167
|
+
props: /*@__PURE__*/ mergeModels({
|
|
2168
|
+
hasDelete: {
|
|
2169
|
+
type: Boolean,
|
|
2170
|
+
required: false,
|
|
2171
|
+
default: false
|
|
2172
|
+
},
|
|
2173
|
+
precision: {
|
|
2174
|
+
type: Number,
|
|
2175
|
+
required: false,
|
|
2176
|
+
default: () => void 0
|
|
2177
|
+
},
|
|
2178
|
+
min: {
|
|
2179
|
+
type: Number,
|
|
2180
|
+
required: false,
|
|
2181
|
+
default: () => -Infinity
|
|
2182
|
+
},
|
|
2183
|
+
max: {
|
|
2184
|
+
type: Number,
|
|
2185
|
+
required: false,
|
|
2186
|
+
default: () => Infinity
|
|
2187
|
+
},
|
|
2188
|
+
step: {
|
|
2189
|
+
type: Number,
|
|
2190
|
+
required: false,
|
|
2191
|
+
default: 1
|
|
2192
|
+
},
|
|
2193
|
+
readonly: {
|
|
2194
|
+
type: Boolean,
|
|
2195
|
+
required: false,
|
|
2196
|
+
default: false
|
|
2197
|
+
}
|
|
2198
|
+
}, {
|
|
2199
|
+
"modelValue": {
|
|
2200
|
+
type: Number,
|
|
2201
|
+
required: true
|
|
2202
|
+
},
|
|
2203
|
+
"modelModifiers": {}
|
|
2204
|
+
}),
|
|
2205
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
2206
|
+
setup(__props, { emit: __emit }) {
|
|
2207
|
+
const { isMobile } = useSystem();
|
|
2208
|
+
const input = useModel(__props, "modelValue");
|
|
2209
|
+
const emit = __emit;
|
|
2210
|
+
const onUpdateFocused = async (focus) => {
|
|
2211
|
+
if (!focus || __props.readonly || !isMobile()) return;
|
|
2212
|
+
const res = await openNumberDlg({
|
|
2213
|
+
title: "",
|
|
2214
|
+
value: input.value,
|
|
2215
|
+
precision: __props.precision,
|
|
2216
|
+
min: __props.min,
|
|
2217
|
+
max: __props.max,
|
|
2218
|
+
step: __props.step
|
|
2219
|
+
});
|
|
2220
|
+
if (res === void 0) return;
|
|
2221
|
+
input.value = res;
|
|
2222
|
+
};
|
|
2223
|
+
return (_ctx, _cache) => {
|
|
2224
|
+
const _component_v_number_input = resolveComponent("v-number-input");
|
|
2225
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
2226
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
2227
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [withDirectives(createVNode(_component_v_number_input, {
|
|
2228
|
+
modelValue: input.value,
|
|
2229
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => input.value = $event),
|
|
2230
|
+
"control-variant": "stacked",
|
|
2231
|
+
density: "compact",
|
|
2232
|
+
"hide-details": "",
|
|
2233
|
+
max: __props.max,
|
|
2234
|
+
min: __props.min,
|
|
2235
|
+
precision: __props.precision,
|
|
2236
|
+
readonly: __props.readonly,
|
|
2237
|
+
"single-line": "",
|
|
2238
|
+
step: __props.step,
|
|
2239
|
+
"onUpdate:focused": onUpdateFocused
|
|
2240
|
+
}, null, 8, [
|
|
2241
|
+
"modelValue",
|
|
2242
|
+
"max",
|
|
2243
|
+
"min",
|
|
2244
|
+
"precision",
|
|
2245
|
+
"readonly",
|
|
2246
|
+
"step"
|
|
2247
|
+
]), [[
|
|
2248
|
+
_directive_ripple,
|
|
2249
|
+
void 0,
|
|
2250
|
+
void 0,
|
|
2251
|
+
{ stop: true }
|
|
2252
|
+
]]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
2253
|
+
key: 0,
|
|
2254
|
+
class: "mx-2",
|
|
2255
|
+
density: "compact",
|
|
2256
|
+
icon: "mdi-minus",
|
|
2257
|
+
variant: "text",
|
|
2258
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
2259
|
+
})) : createCommentVNode("v-if", true)]);
|
|
2260
|
+
};
|
|
2261
|
+
}
|
|
2262
|
+
});
|
|
2263
|
+
|
|
2264
|
+
//#endregion
|
|
2265
|
+
//#region src/components/values/number/index.vue
|
|
2266
|
+
var number_default = index_vue_vue_type_script_setup_true_lang_default$8;
|
|
2267
|
+
|
|
2268
|
+
//#endregion
|
|
2269
|
+
//#region src/components/values/rule/index.vue?vue&type=script&setup=true&lang.ts
|
|
2270
|
+
const _hoisted_1$6 = { class: "d-flex justify-space-between align-center my-2" };
|
|
2271
|
+
const _hoisted_2$1 = { class: "flex-grow-1" };
|
|
2272
|
+
var index_vue_vue_type_script_setup_true_lang_default$7 = /*@__PURE__*/ defineComponent({
|
|
2273
|
+
__name: "index",
|
|
2274
|
+
props: /*@__PURE__*/ mergeModels({
|
|
2275
|
+
hasDelete: {
|
|
2276
|
+
type: Boolean,
|
|
2277
|
+
required: false,
|
|
2278
|
+
default: false
|
|
2279
|
+
},
|
|
2280
|
+
readonly: {
|
|
2281
|
+
type: Boolean,
|
|
2282
|
+
required: false,
|
|
2283
|
+
default: false
|
|
2284
|
+
}
|
|
2285
|
+
}, {
|
|
2286
|
+
"modelValue": {
|
|
2287
|
+
type: String,
|
|
2288
|
+
required: true
|
|
2289
|
+
},
|
|
2290
|
+
"modelModifiers": {}
|
|
2291
|
+
}),
|
|
2292
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
2293
|
+
setup(__props, { emit: __emit }) {
|
|
2294
|
+
const { t } = useI18n();
|
|
2295
|
+
const { isMobile } = useSystem();
|
|
2296
|
+
const rule = useModel(__props, "modelValue");
|
|
2297
|
+
const emit = __emit;
|
|
2298
|
+
const select = ref("");
|
|
2299
|
+
const number = ref(0);
|
|
2300
|
+
watchEffect(() => {
|
|
2301
|
+
const parts = rule.value.split(",");
|
|
2302
|
+
if (parts.length < 1) return;
|
|
2303
|
+
select.value = parts[0];
|
|
2304
|
+
if (parts[0] === "minLength" || parts[1] === "maxLength" || parts[2] === "length") if (parts.length > 1) number.value = parseInt(parts[1]);
|
|
2305
|
+
else number.value = 0;
|
|
2306
|
+
});
|
|
2307
|
+
function syncRule() {
|
|
2308
|
+
if (select.value === "minLength" || select.value === "maxLength" || select.value === "length") rule.value = `${select.value},${number.value}`;
|
|
2309
|
+
else rule.value = select.value;
|
|
2310
|
+
}
|
|
2311
|
+
const selectItems = computed(() => {
|
|
2312
|
+
const items = [{
|
|
2313
|
+
value: "",
|
|
2314
|
+
title: t(`x-runtime-lib.notSet`)
|
|
2315
|
+
}];
|
|
2316
|
+
for (const rule of rules) items.push({
|
|
2317
|
+
value: rule,
|
|
2318
|
+
title: t(`x-runtime-lib.${rule}`)
|
|
2319
|
+
});
|
|
2320
|
+
return items;
|
|
2321
|
+
});
|
|
2322
|
+
function onSelectUpdate() {
|
|
2323
|
+
number.value = 0;
|
|
2324
|
+
syncRule();
|
|
2325
|
+
}
|
|
2326
|
+
watchEffect(() => {
|
|
2327
|
+
const parts = rule.value.split(",");
|
|
2328
|
+
if (parts.length > 1) number.value = parseInt(parts[1]);
|
|
2329
|
+
});
|
|
2330
|
+
async function onNumberFocused(focus) {
|
|
2331
|
+
if (!focus || !isMobile()) return;
|
|
2332
|
+
const res = await openNumberDlg({
|
|
2333
|
+
title: "",
|
|
2334
|
+
value: number.value,
|
|
2335
|
+
precision: 0,
|
|
2336
|
+
min: 0,
|
|
2337
|
+
max: Infinity,
|
|
2338
|
+
step: 1
|
|
2339
|
+
});
|
|
2340
|
+
if (res === void 0) return;
|
|
2341
|
+
number.value = res;
|
|
2342
|
+
syncRule();
|
|
2343
|
+
}
|
|
2344
|
+
function onNumberUpdate() {
|
|
2345
|
+
syncRule();
|
|
2346
|
+
}
|
|
2347
|
+
return (_ctx, _cache) => {
|
|
2348
|
+
const _component_v_select = resolveComponent("v-select");
|
|
2349
|
+
const _component_v_number_input = resolveComponent("v-number-input");
|
|
2350
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
2351
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
2352
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [createElementVNode("div", _hoisted_2$1, [withDirectives(createVNode(_component_v_select, {
|
|
2353
|
+
modelValue: select.value,
|
|
2354
|
+
"onUpdate:modelValue": [_cache[0] || (_cache[0] = ($event) => select.value = $event), onSelectUpdate],
|
|
2355
|
+
density: "compact",
|
|
2356
|
+
"hide-details": "",
|
|
2357
|
+
items: selectItems.value,
|
|
2358
|
+
readonly: __props.readonly,
|
|
2359
|
+
"single-line": ""
|
|
2360
|
+
}, null, 8, [
|
|
2361
|
+
"modelValue",
|
|
2362
|
+
"items",
|
|
2363
|
+
"readonly"
|
|
2364
|
+
]), [[
|
|
2365
|
+
_directive_ripple,
|
|
2366
|
+
void 0,
|
|
2367
|
+
void 0,
|
|
2368
|
+
{ stop: true }
|
|
2369
|
+
]]), select.value === "minLength" || select.value === "maxLength" || select.value === "length" ? withDirectives((openBlock(), createBlock(_component_v_number_input, {
|
|
2370
|
+
key: 0,
|
|
2371
|
+
modelValue: number.value,
|
|
2372
|
+
"onUpdate:modelValue": [_cache[1] || (_cache[1] = ($event) => number.value = $event), onNumberUpdate],
|
|
2373
|
+
"control-variant": "stacked",
|
|
2374
|
+
density: "compact",
|
|
2375
|
+
"hide-details": "",
|
|
2376
|
+
max: Infinity,
|
|
2377
|
+
min: 0,
|
|
2378
|
+
precision: 0,
|
|
2379
|
+
readonly: __props.readonly,
|
|
2380
|
+
"single-line": "",
|
|
2381
|
+
step: 1,
|
|
2382
|
+
"onUpdate:focused": onNumberFocused
|
|
2383
|
+
}, null, 8, ["modelValue", "readonly"])), [[
|
|
2384
|
+
_directive_ripple,
|
|
2385
|
+
void 0,
|
|
2386
|
+
void 0,
|
|
2387
|
+
{ stop: true }
|
|
2388
|
+
]]) : createCommentVNode("v-if", true)]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
2389
|
+
key: 0,
|
|
2390
|
+
class: "mx-2",
|
|
2391
|
+
density: "compact",
|
|
2392
|
+
icon: "mdi-minus",
|
|
2393
|
+
variant: "text",
|
|
2394
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
2395
|
+
})) : createCommentVNode("v-if", true)]);
|
|
2396
|
+
};
|
|
2397
|
+
}
|
|
2398
|
+
});
|
|
2399
|
+
|
|
2400
|
+
//#endregion
|
|
2401
|
+
//#region src/components/values/rule/index.vue
|
|
2402
|
+
var rule_default = index_vue_vue_type_script_setup_true_lang_default$7;
|
|
2403
|
+
|
|
2404
|
+
//#endregion
|
|
2405
|
+
//#region src/components/values/select/index.vue?vue&type=script&setup=true&lang.ts
|
|
2406
|
+
const _hoisted_1$5 = { class: "d-flex justify-space-between align-center" };
|
|
2407
|
+
var index_vue_vue_type_script_setup_true_lang_default$6 = /*@__PURE__*/ defineComponent({
|
|
2408
|
+
__name: "index",
|
|
2409
|
+
props: /*@__PURE__*/ mergeModels({
|
|
2410
|
+
hasDelete: {
|
|
2411
|
+
type: Boolean,
|
|
2412
|
+
required: false,
|
|
2413
|
+
default: false
|
|
2414
|
+
},
|
|
2415
|
+
readonly: {
|
|
2416
|
+
type: Boolean,
|
|
2417
|
+
required: false,
|
|
2418
|
+
default: false
|
|
2419
|
+
},
|
|
2420
|
+
items: {
|
|
2421
|
+
type: String,
|
|
2422
|
+
required: true
|
|
2423
|
+
}
|
|
2424
|
+
}, {
|
|
2425
|
+
"modelValue": { type: String },
|
|
2426
|
+
"modelModifiers": {}
|
|
2427
|
+
}),
|
|
2428
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
2429
|
+
setup(__props, { emit: __emit }) {
|
|
2430
|
+
const { t } = useI18n();
|
|
2431
|
+
const select = useModel(__props, "modelValue");
|
|
2432
|
+
const emit = __emit;
|
|
2433
|
+
const items = computed(() => {
|
|
2434
|
+
const items = [];
|
|
2435
|
+
getItems(__props.items)?.forEach(({ value, title: src }) => {
|
|
2436
|
+
let title = value;
|
|
2437
|
+
if (src) title = t(src);
|
|
2438
|
+
items.push({
|
|
2439
|
+
value,
|
|
2440
|
+
title
|
|
2441
|
+
});
|
|
2442
|
+
});
|
|
2443
|
+
return items;
|
|
2444
|
+
});
|
|
2445
|
+
return (_ctx, _cache) => {
|
|
2446
|
+
const _component_v_select = resolveComponent("v-select");
|
|
2447
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
2448
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
2449
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [withDirectives(createVNode(_component_v_select, {
|
|
2450
|
+
modelValue: select.value,
|
|
2451
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => select.value = $event),
|
|
2452
|
+
density: "compact",
|
|
2453
|
+
"hide-details": "",
|
|
2454
|
+
items: items.value,
|
|
2455
|
+
readonly: __props.readonly,
|
|
2456
|
+
"single-line": ""
|
|
2457
|
+
}, null, 8, [
|
|
2458
|
+
"modelValue",
|
|
2459
|
+
"items",
|
|
2460
|
+
"readonly"
|
|
2461
|
+
]), [[
|
|
2462
|
+
_directive_ripple,
|
|
2463
|
+
void 0,
|
|
2464
|
+
void 0,
|
|
2465
|
+
{ stop: true }
|
|
2466
|
+
]]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
2467
|
+
key: 0,
|
|
2468
|
+
class: "mx-2",
|
|
2469
|
+
density: "compact",
|
|
2470
|
+
icon: "mdi-minus",
|
|
2471
|
+
variant: "text",
|
|
2472
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
2473
|
+
})) : createCommentVNode("v-if", true)]);
|
|
2474
|
+
};
|
|
2475
|
+
}
|
|
2476
|
+
});
|
|
2477
|
+
|
|
2478
|
+
//#endregion
|
|
2479
|
+
//#region src/components/values/select/index.vue
|
|
2480
|
+
var select_default = index_vue_vue_type_script_setup_true_lang_default$6;
|
|
2481
|
+
|
|
2482
|
+
//#endregion
|
|
2483
|
+
//#region src/components/values/slot/slotList/item.vue?vue&type=script&setup=true&lang.ts
|
|
2484
|
+
const _hoisted_1$4 = { class: "text-body-large ml-6" };
|
|
2485
|
+
var item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
2486
|
+
__name: "item",
|
|
2487
|
+
props: {
|
|
2488
|
+
id: {
|
|
2489
|
+
type: String,
|
|
2490
|
+
required: true
|
|
2491
|
+
},
|
|
2492
|
+
title: {
|
|
2493
|
+
type: String,
|
|
2494
|
+
required: true
|
|
2495
|
+
}
|
|
2496
|
+
},
|
|
2497
|
+
emits: ["x-click"],
|
|
2498
|
+
setup(__props, { emit: __emit }) {
|
|
2499
|
+
const { backgroundColor2, highlightColor } = useColor();
|
|
2500
|
+
const emit = __emit;
|
|
2501
|
+
const mouseOver = ref(false);
|
|
2502
|
+
const style = computed(() => {
|
|
2503
|
+
return {
|
|
2504
|
+
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
2505
|
+
height: "48px",
|
|
2506
|
+
userSelect: "none"
|
|
2507
|
+
};
|
|
2508
|
+
});
|
|
2509
|
+
return (_ctx, _cache) => {
|
|
2510
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
2511
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
2512
|
+
class: "d-flex align-center cursor-pointer",
|
|
2513
|
+
style: normalizeStyle(style.value),
|
|
2514
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("x-click", __props.id)),
|
|
2515
|
+
onMouseout: _cache[1] || (_cache[1] = ($event) => mouseOver.value = false),
|
|
2516
|
+
onMouseover: _cache[2] || (_cache[2] = ($event) => mouseOver.value = true)
|
|
2517
|
+
}, [createElementVNode("span", _hoisted_1$4, toDisplayString(__props.title), 1)], 36)), [[_directive_ripple]]);
|
|
2518
|
+
};
|
|
2519
|
+
}
|
|
2520
|
+
});
|
|
2521
|
+
|
|
2522
|
+
//#endregion
|
|
2523
|
+
//#region src/components/values/slot/slotList/item.vue
|
|
2524
|
+
var item_default = item_vue_vue_type_script_setup_true_lang_default;
|
|
2525
|
+
|
|
2526
|
+
//#endregion
|
|
2527
|
+
//#region src/components/values/slot/slotList/index.vue?vue&type=script&setup=true&lang.ts
|
|
2528
|
+
const _hoisted_1$3 = { key: 0 };
|
|
2529
|
+
const _hoisted_2 = {
|
|
2530
|
+
key: 1,
|
|
2531
|
+
class: "text-body-medium text-grey ml-3"
|
|
2532
|
+
};
|
|
2533
|
+
var index_vue_vue_type_script_setup_true_lang_default$5 = /*@__PURE__*/ defineComponent({
|
|
2534
|
+
__name: "index",
|
|
2535
|
+
props: {
|
|
2536
|
+
"open": {
|
|
2537
|
+
type: Boolean,
|
|
2538
|
+
required: true
|
|
2539
|
+
},
|
|
2540
|
+
"openModifiers": {}
|
|
2541
|
+
},
|
|
2542
|
+
emits: /*@__PURE__*/ mergeModels(["x-select"], ["update:open"]),
|
|
2543
|
+
setup(__props, { emit: __emit }) {
|
|
2544
|
+
const { t } = useI18n();
|
|
2545
|
+
const open = useModel(__props, "open");
|
|
2546
|
+
const emit = __emit;
|
|
2547
|
+
const slotList = injectSlotList();
|
|
2548
|
+
const onItemClick = (id) => {
|
|
2549
|
+
open.value = false;
|
|
2550
|
+
emit("x-select", id);
|
|
2551
|
+
};
|
|
2552
|
+
return (_ctx, _cache) => {
|
|
2553
|
+
return unref(slotList).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(slotList), (item) => {
|
|
2554
|
+
return openBlock(), createBlock(item_default, {
|
|
2555
|
+
key: item.id,
|
|
2556
|
+
id: item.id,
|
|
2557
|
+
title: item.name,
|
|
2558
|
+
onXClick: onItemClick
|
|
2559
|
+
}, null, 8, ["id", "title"]);
|
|
2560
|
+
}), 128))])) : (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(unref(t)("x-prop-tree.noSlot")), 1));
|
|
2561
|
+
};
|
|
2562
|
+
}
|
|
2563
|
+
});
|
|
2564
|
+
|
|
2565
|
+
//#endregion
|
|
2566
|
+
//#region src/components/values/slot/slotList/index.vue
|
|
2567
|
+
var slotList_default = index_vue_vue_type_script_setup_true_lang_default$5;
|
|
2568
|
+
|
|
2569
|
+
//#endregion
|
|
2570
|
+
//#region src/components/values/slot/index.vue?vue&type=script&setup=true&lang.ts
|
|
2571
|
+
const _hoisted_1$2 = { class: "text-body-large" };
|
|
2572
|
+
var index_vue_vue_type_script_setup_true_lang_default$4 = /*@__PURE__*/ defineComponent({
|
|
2573
|
+
__name: "index",
|
|
2574
|
+
props: /*@__PURE__*/ mergeModels({
|
|
2575
|
+
hasDelete: {
|
|
2576
|
+
type: Boolean,
|
|
2577
|
+
required: false,
|
|
2578
|
+
default: false
|
|
2579
|
+
},
|
|
2580
|
+
readonly: {
|
|
2581
|
+
type: Boolean,
|
|
2582
|
+
required: false,
|
|
2583
|
+
default: false
|
|
2584
|
+
}
|
|
2585
|
+
}, {
|
|
2586
|
+
"modelValue": {
|
|
2587
|
+
type: [Object, null],
|
|
2588
|
+
default: null
|
|
2589
|
+
},
|
|
2590
|
+
"modelModifiers": {}
|
|
2591
|
+
}),
|
|
2592
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
2593
|
+
setup(__props, { emit: __emit }) {
|
|
2594
|
+
const { t } = useI18n();
|
|
2595
|
+
const display = useDisplay();
|
|
2596
|
+
const { sysBarAvail } = useSystem();
|
|
2597
|
+
const { backgroundColor1 } = useColor();
|
|
2598
|
+
const slot = useModel(__props, "modelValue");
|
|
2599
|
+
const emit = __emit;
|
|
2600
|
+
const slotList = injectSlotList();
|
|
2601
|
+
const wrapStyle = computed(() => {
|
|
2602
|
+
let width = "100%";
|
|
2603
|
+
if (display.mdAndUp.value) width = "400px";
|
|
2604
|
+
return {
|
|
2605
|
+
background: backgroundColor1.value,
|
|
2606
|
+
width,
|
|
2607
|
+
height: "100%"
|
|
2608
|
+
};
|
|
2609
|
+
});
|
|
2610
|
+
const contStyle = computed(() => {
|
|
2611
|
+
let h = 48;
|
|
2612
|
+
if (sysBarAvail.value) h += 24;
|
|
2613
|
+
return {
|
|
2614
|
+
position: "relative",
|
|
2615
|
+
height: `calc(100% - ${h}px)`
|
|
2616
|
+
};
|
|
2617
|
+
});
|
|
2618
|
+
const tailStyle = computed(() => {
|
|
2619
|
+
return { height: "60px" };
|
|
2620
|
+
});
|
|
2621
|
+
watchEffect(() => {
|
|
2622
|
+
if (!slot.value) return;
|
|
2623
|
+
const item = slotList.value.find((entry) => entry.id === slot.value.id);
|
|
2624
|
+
if (item && item.name !== slot.value.name) slot.value = {
|
|
2625
|
+
...slot.value,
|
|
2626
|
+
name: item.name
|
|
2627
|
+
};
|
|
2628
|
+
});
|
|
2629
|
+
const title = computed(() => {
|
|
2630
|
+
if (slot.value) return slot.value.name;
|
|
2631
|
+
else return t("x-runtime-lib.notSet");
|
|
2632
|
+
});
|
|
2633
|
+
const { open } = useViewStack(`propTreeSlotSelectDlg${useId()}`);
|
|
2634
|
+
onUnmounted(() => {
|
|
2635
|
+
open.value = false;
|
|
2636
|
+
});
|
|
2637
|
+
function onSlotSelect(id) {
|
|
2638
|
+
if (!id) {
|
|
2639
|
+
slot.value = null;
|
|
2640
|
+
return;
|
|
2641
|
+
}
|
|
2642
|
+
const item = slotList.value.find((entry) => entry.id === id);
|
|
2643
|
+
if (!item) {
|
|
2644
|
+
slot.value = null;
|
|
2645
|
+
return;
|
|
2646
|
+
}
|
|
2647
|
+
slot.value = {
|
|
2648
|
+
id: item.id,
|
|
2649
|
+
name: item.name
|
|
2650
|
+
};
|
|
2651
|
+
}
|
|
2652
|
+
return (_ctx, _cache) => {
|
|
2653
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
2654
|
+
const _component_v_sheet = resolveComponent("v-sheet");
|
|
2655
|
+
const _component_v_dialog = resolveComponent("v-dialog");
|
|
2656
|
+
return openBlock(), createBlock(_component_v_dialog, {
|
|
2657
|
+
modelValue: unref(open),
|
|
2658
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(open) ? open.value = $event : null),
|
|
2659
|
+
fullscreen: "",
|
|
2660
|
+
"no-click-animation": "",
|
|
2661
|
+
persistent: "",
|
|
2662
|
+
transition: "scroll-x-reverse-transition",
|
|
2663
|
+
onKeydown: _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => open.value = false, ["stop", "prevent"]), ["esc"]))
|
|
2664
|
+
}, {
|
|
2665
|
+
activator: withCtx(({ props: activatorProps }) => [createVNode(_component_v_btn, mergeProps(activatorProps, {
|
|
2666
|
+
block: "",
|
|
2667
|
+
density: "comfortable",
|
|
2668
|
+
readonly: __props.readonly
|
|
2669
|
+
}), {
|
|
2670
|
+
default: withCtx(() => [createTextVNode(toDisplayString(title.value), 1)]),
|
|
2671
|
+
_: 1
|
|
2672
|
+
}, 16, ["readonly"]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
2673
|
+
key: 0,
|
|
2674
|
+
class: "mx-2",
|
|
2675
|
+
density: "compact",
|
|
2676
|
+
icon: "mdi-minus",
|
|
2677
|
+
variant: "text",
|
|
2678
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
2679
|
+
})) : createCommentVNode("v-if", true)]),
|
|
2680
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
2681
|
+
class: "w-100 h-100 d-flex flex-row-reverse",
|
|
2682
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => open.value = false, ["self"])),
|
|
2683
|
+
onContextmenu: _cache[4] || (_cache[4] = withModifiers(($event) => open.value = false, ["self", "prevent"]))
|
|
2684
|
+
}, [createElementVNode("div", {
|
|
2685
|
+
class: "elevation-2",
|
|
2686
|
+
style: normalizeStyle(wrapStyle.value)
|
|
2687
|
+
}, [
|
|
2688
|
+
unref(sysBarAvail) ? (openBlock(), createBlock(_component_v_sheet, {
|
|
2689
|
+
key: 0,
|
|
2690
|
+
color: "transparent",
|
|
2691
|
+
height: 24
|
|
2692
|
+
})) : createCommentVNode("v-if", true),
|
|
2693
|
+
createVNode(_component_v_sheet, {
|
|
2694
|
+
class: "d-flex align-center px-3",
|
|
2695
|
+
color: "transparent",
|
|
2696
|
+
height: 48
|
|
2697
|
+
}, {
|
|
2698
|
+
default: withCtx(() => [createVNode(_component_v_btn, {
|
|
2699
|
+
density: "comfortable",
|
|
2700
|
+
icon: "mdi-close",
|
|
2701
|
+
variant: "text",
|
|
2702
|
+
onClick: _cache[1] || (_cache[1] = ($event) => open.value = false)
|
|
2703
|
+
}), createElementVNode("span", _hoisted_1$2, toDisplayString(unref(t)("x-prop-tree.selectSlot")), 1)]),
|
|
2704
|
+
_: 1
|
|
2705
|
+
}),
|
|
2706
|
+
createElementVNode("div", {
|
|
2707
|
+
class: "overflow-y-auto",
|
|
2708
|
+
style: normalizeStyle(contStyle.value)
|
|
2709
|
+
}, [createVNode(slotList_default, {
|
|
2710
|
+
open: unref(open),
|
|
2711
|
+
"onUpdate:open": _cache[2] || (_cache[2] = ($event) => isRef(open) ? open.value = $event : null),
|
|
2712
|
+
onXSelect: onSlotSelect
|
|
2713
|
+
}, null, 8, ["open"]), createElementVNode("div", { style: normalizeStyle(tailStyle.value) }, null, 4)], 4)
|
|
2714
|
+
], 4)], 32)]),
|
|
2715
|
+
_: 1
|
|
2716
|
+
}, 8, ["modelValue"]);
|
|
2717
|
+
};
|
|
2718
|
+
}
|
|
2719
|
+
});
|
|
2720
|
+
|
|
2721
|
+
//#endregion
|
|
2722
|
+
//#region src/components/values/slot/index.vue
|
|
2723
|
+
var slot_default = index_vue_vue_type_script_setup_true_lang_default$4;
|
|
2724
|
+
|
|
2725
|
+
//#endregion
|
|
2726
|
+
//#region src/components/values/switch/index.vue?vue&type=script&setup=true&lang.ts
|
|
2727
|
+
const _hoisted_1$1 = { class: "d-flex justify-space-between align-center" };
|
|
2728
|
+
var index_vue_vue_type_script_setup_true_lang_default$3 = /*@__PURE__*/ defineComponent({
|
|
2729
|
+
__name: "index",
|
|
2730
|
+
props: /*@__PURE__*/ mergeModels({
|
|
2731
|
+
hasDelete: {
|
|
2732
|
+
type: Boolean,
|
|
2733
|
+
required: false,
|
|
2734
|
+
default: false
|
|
2735
|
+
},
|
|
2736
|
+
readonly: {
|
|
2737
|
+
type: Boolean,
|
|
2738
|
+
required: false,
|
|
2739
|
+
default: false
|
|
2740
|
+
}
|
|
2741
|
+
}, {
|
|
2742
|
+
"modelValue": { type: Boolean },
|
|
2743
|
+
"modelModifiers": {}
|
|
2744
|
+
}),
|
|
2745
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
2746
|
+
setup(__props, { emit: __emit }) {
|
|
2747
|
+
const modelValue = useModel(__props, "modelValue");
|
|
2748
|
+
const emit = __emit;
|
|
2749
|
+
return (_ctx, _cache) => {
|
|
2750
|
+
const _component_v_switch = resolveComponent("v-switch");
|
|
2751
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
2752
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [createVNode(_component_v_switch, {
|
|
2753
|
+
modelValue: modelValue.value,
|
|
2754
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
2755
|
+
class: "ml-1",
|
|
2756
|
+
color: "primary",
|
|
2757
|
+
density: "compact",
|
|
2758
|
+
"hide-details": "",
|
|
2759
|
+
readonly: __props.readonly
|
|
2760
|
+
}, null, 8, ["modelValue", "readonly"]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
2761
|
+
key: 0,
|
|
2762
|
+
class: "mx-2",
|
|
2763
|
+
density: "compact",
|
|
2764
|
+
icon: "mdi-minus",
|
|
2765
|
+
variant: "text",
|
|
2766
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
2767
|
+
})) : createCommentVNode("v-if", true)]);
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
});
|
|
2771
|
+
|
|
2772
|
+
//#endregion
|
|
2773
|
+
//#region src/components/values/switch/index.vue
|
|
2774
|
+
var switch_default = index_vue_vue_type_script_setup_true_lang_default$3;
|
|
2775
|
+
|
|
2776
|
+
//#endregion
|
|
2777
|
+
//#region src/components/values/text/index.vue?vue&type=script&setup=true&lang.ts
|
|
2778
|
+
const _hoisted_1 = { class: "d-flex justify-space-between align-center" };
|
|
2779
|
+
var index_vue_vue_type_script_setup_true_lang_default$2 = /*@__PURE__*/ defineComponent({
|
|
2780
|
+
__name: "index",
|
|
2781
|
+
props: /*@__PURE__*/ mergeModels({
|
|
2782
|
+
hasDelete: {
|
|
2783
|
+
type: Boolean,
|
|
2784
|
+
required: false,
|
|
2785
|
+
default: false
|
|
2786
|
+
},
|
|
2787
|
+
readonly: {
|
|
2788
|
+
type: Boolean,
|
|
2789
|
+
required: false,
|
|
2790
|
+
default: false
|
|
2791
|
+
}
|
|
2792
|
+
}, {
|
|
2793
|
+
"modelValue": {
|
|
2794
|
+
type: String,
|
|
2795
|
+
required: true
|
|
2796
|
+
},
|
|
2797
|
+
"modelModifiers": {}
|
|
2798
|
+
}),
|
|
2799
|
+
emits: /*@__PURE__*/ mergeModels(["delete"], ["update:modelValue"]),
|
|
2800
|
+
setup(__props, { emit: __emit }) {
|
|
2801
|
+
const { isMobile } = useSystem();
|
|
2802
|
+
const input = useModel(__props, "modelValue");
|
|
2803
|
+
const emit = __emit;
|
|
2804
|
+
const onUpdateFocused = async (focus) => {
|
|
2805
|
+
if (!focus || __props.readonly || !isMobile()) return;
|
|
2806
|
+
const res = await openPromptDlg({
|
|
2807
|
+
title: "",
|
|
2808
|
+
value: input.value
|
|
2809
|
+
});
|
|
2810
|
+
if (res === void 0) return;
|
|
2811
|
+
input.value = res;
|
|
2812
|
+
};
|
|
2813
|
+
return (_ctx, _cache) => {
|
|
2814
|
+
const _component_v_text_field = resolveComponent("v-text-field");
|
|
2815
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
2816
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
2817
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [withDirectives(createVNode(_component_v_text_field, {
|
|
2818
|
+
modelValue: input.value,
|
|
2819
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => input.value = $event),
|
|
2820
|
+
density: "compact",
|
|
2821
|
+
"hide-details": "",
|
|
2822
|
+
readonly: __props.readonly,
|
|
2823
|
+
"single-line": "",
|
|
2824
|
+
"onUpdate:focused": onUpdateFocused
|
|
2825
|
+
}, null, 8, ["modelValue", "readonly"]), [[
|
|
2826
|
+
_directive_ripple,
|
|
2827
|
+
void 0,
|
|
2828
|
+
void 0,
|
|
2829
|
+
{ stop: true }
|
|
2830
|
+
]]), __props.hasDelete ? (openBlock(), createBlock(_component_v_btn, {
|
|
2831
|
+
key: 0,
|
|
2832
|
+
class: "mx-2",
|
|
2833
|
+
density: "compact",
|
|
2834
|
+
icon: "mdi-minus",
|
|
2835
|
+
variant: "text",
|
|
2836
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("delete"), ["stop"]))
|
|
2837
|
+
})) : createCommentVNode("v-if", true)]);
|
|
2838
|
+
};
|
|
2839
|
+
}
|
|
2840
|
+
});
|
|
2841
|
+
|
|
2842
|
+
//#endregion
|
|
2843
|
+
//#region src/components/values/text/index.vue
|
|
2844
|
+
var text_default = index_vue_vue_type_script_setup_true_lang_default$2;
|
|
2845
|
+
|
|
2846
|
+
//#endregion
|
|
2847
|
+
//#region src/composables/uis/uiAdaptSlot.ts
|
|
2848
|
+
function useUiAdaptSlot() {
|
|
2849
|
+
const changeEvent = injectChangeEvent();
|
|
2850
|
+
const renderUiAdaptSlot = (keys, property, object, arrayIndex, isBranch) => {
|
|
2851
|
+
if (property.ui !== "adaptSlot") throw new Error(`useUiAdaptSlot property ui must be adaptSlot`);
|
|
2852
|
+
return h(adaptSlot_default, {
|
|
2853
|
+
"modelValue": (() => {
|
|
2854
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
2855
|
+
})(),
|
|
2856
|
+
"onUpdate:modelValue": (val) => {
|
|
2857
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
2858
|
+
},
|
|
2859
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
2860
|
+
"onDelete": () => {
|
|
2861
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
2862
|
+
object.splice(arrayIndex, 1);
|
|
2863
|
+
changeEvent(keys.slice(0, -1), object);
|
|
2864
|
+
},
|
|
2865
|
+
"readonly": property.readonly
|
|
2866
|
+
});
|
|
2867
|
+
};
|
|
2868
|
+
return { renderUiAdaptSlot };
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
//#endregion
|
|
2872
|
+
//#region src/composables/uis/uiComp.ts
|
|
2873
|
+
function useUiComp() {
|
|
2874
|
+
const changeEvent = injectChangeEvent();
|
|
2875
|
+
const renderUiComp = (keys, property, object, arrayIndex, isBranch) => {
|
|
2876
|
+
if (property.ui !== "comp") throw new Error(`renderUiComp property ui must be comp`);
|
|
2877
|
+
return h(comp_default, {
|
|
2878
|
+
"modelValue": (() => {
|
|
2879
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
2880
|
+
})(),
|
|
2881
|
+
"onUpdate:modelValue": (val) => {
|
|
2882
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
2883
|
+
},
|
|
2884
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
2885
|
+
"onDelete": () => {
|
|
2886
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
2887
|
+
object.splice(arrayIndex, 1);
|
|
2888
|
+
changeEvent(keys.slice(0, -1), object);
|
|
2889
|
+
},
|
|
2890
|
+
"readonly": property.readonly
|
|
2891
|
+
});
|
|
2892
|
+
};
|
|
2893
|
+
return { renderUiComp };
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
//#endregion
|
|
2897
|
+
//#region src/composables/uis/uiDummy.ts
|
|
2898
|
+
function useUiDummy() {
|
|
2899
|
+
const changeEvent = injectChangeEvent();
|
|
2900
|
+
const renderUiDummy = (keys, property, object, arrayIndex, isBranch) => {
|
|
2901
|
+
if (property.ui !== "dummy") throw new Error(`renderUiDummy property ui must be dummy`);
|
|
2902
|
+
getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
2903
|
+
};
|
|
2904
|
+
return { renderUiDummy };
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
//#endregion
|
|
2908
|
+
//#region src/composables/uis/uiIcon.ts
|
|
2909
|
+
function useUiIcon() {
|
|
2910
|
+
const changeEvent = injectChangeEvent();
|
|
2911
|
+
const renderUiIcon = (keys, property, object, arrayIndex, isBranch) => {
|
|
2912
|
+
if (property.ui !== "icon") throw new Error(`renderUiIcon property ui must be icon`);
|
|
2913
|
+
return h(icon_default, {
|
|
2914
|
+
"modelValue": (() => {
|
|
2915
|
+
if (property.static) return property.value;
|
|
2916
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
2917
|
+
})(),
|
|
2918
|
+
"onUpdate:modelValue": (val) => {
|
|
2919
|
+
if (property.static) return;
|
|
2920
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
2921
|
+
},
|
|
2922
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
2923
|
+
"onDelete": () => {
|
|
2924
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
2925
|
+
object.splice(arrayIndex, 1);
|
|
2926
|
+
changeEvent(keys.slice(0, -1), object);
|
|
2927
|
+
},
|
|
2928
|
+
"readonly": property.static || property.readonly
|
|
2929
|
+
});
|
|
2930
|
+
};
|
|
2931
|
+
return { renderUiIcon };
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
//#endregion
|
|
2935
|
+
//#region src/composables/uis/uiJson.ts
|
|
2936
|
+
function useUiJson() {
|
|
2937
|
+
const changeEvent = injectChangeEvent();
|
|
2938
|
+
const renderUiJson = (keys, property, object, arrayIndex, isBranch) => {
|
|
2939
|
+
if (property.ui !== "json") throw new Error(`renderUiJson property ui must be json`);
|
|
2940
|
+
return h(json_default, {
|
|
2941
|
+
"modelValue": (() => {
|
|
2942
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent) ?? "{}";
|
|
2943
|
+
})(),
|
|
2944
|
+
"onUpdate:modelValue": (val) => {
|
|
2945
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
2946
|
+
},
|
|
2947
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
2948
|
+
"onDelete": () => {
|
|
2949
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
2950
|
+
object.splice(arrayIndex, 1);
|
|
2951
|
+
changeEvent(keys.slice(0, -1), object);
|
|
2952
|
+
},
|
|
2953
|
+
"readonly": property.readonly
|
|
2954
|
+
});
|
|
2955
|
+
};
|
|
2956
|
+
return { renderUiJson };
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
//#endregion
|
|
2960
|
+
//#region src/composables/uis/uiMultiTypes.ts
|
|
2961
|
+
function useUiMultiTypes() {
|
|
2962
|
+
const changeEvent = injectChangeEvent();
|
|
2963
|
+
const renderUiMultiTypes = (keys, property, object, arrayIndex, isBranch) => {
|
|
2964
|
+
if (property.ui !== "multiTypes") throw new Error(`renderUiMultiTypes property ui must be multiTypes`);
|
|
2965
|
+
return h(multiTypes_default, {
|
|
2966
|
+
"modelValue": (() => {
|
|
2967
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
2968
|
+
})(),
|
|
2969
|
+
"onUpdate:modelValue": (val) => {
|
|
2970
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
2971
|
+
},
|
|
2972
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
2973
|
+
"onDelete": () => {
|
|
2974
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
2975
|
+
object.splice(arrayIndex, 1);
|
|
2976
|
+
changeEvent(keys.slice(0, -1), object);
|
|
2977
|
+
},
|
|
2978
|
+
"types": property.types
|
|
2979
|
+
});
|
|
2980
|
+
};
|
|
2981
|
+
return { renderUiMultiTypes };
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
//#endregion
|
|
2985
|
+
//#region src/composables/uis/uiNumber.ts
|
|
2986
|
+
function useUiNumber() {
|
|
2987
|
+
const changeEvent = injectChangeEvent();
|
|
2988
|
+
const renderUiNumber = (keys, property, object, arrayIndex, isBranch) => {
|
|
2989
|
+
if (property.ui !== "number") throw new Error(`renderUiNumber property ui must be number`);
|
|
2990
|
+
return h(number_default, {
|
|
2991
|
+
"modelValue": (() => {
|
|
2992
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
2993
|
+
})(),
|
|
2994
|
+
"onUpdate:modelValue": (val) => {
|
|
2995
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
2996
|
+
},
|
|
2997
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
2998
|
+
"onDelete": () => {
|
|
2999
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
3000
|
+
object.splice(arrayIndex, 1);
|
|
3001
|
+
changeEvent(keys.slice(0, -1), object);
|
|
3002
|
+
},
|
|
3003
|
+
"precision": property.precision,
|
|
3004
|
+
"min": property.min,
|
|
3005
|
+
"max": property.max,
|
|
3006
|
+
"step": property.step,
|
|
3007
|
+
"readonly": property.readonly
|
|
3008
|
+
});
|
|
3009
|
+
};
|
|
3010
|
+
return { renderUiNumber };
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
//#endregion
|
|
3014
|
+
//#region src/components/entry/index.vue?vue&type=script&setup=true&lang.ts
|
|
3015
|
+
var index_vue_vue_type_script_setup_true_lang_default$1 = /*@__PURE__*/ defineComponent({
|
|
3016
|
+
__name: "index",
|
|
3017
|
+
props: { minHeight: {
|
|
3018
|
+
type: String,
|
|
3019
|
+
required: true
|
|
3020
|
+
} },
|
|
3021
|
+
emits: ["menu"],
|
|
3022
|
+
setup(__props, { emit: __emit }) {
|
|
3023
|
+
const { backgroundColor2, highlightColor } = useColor();
|
|
3024
|
+
const emit = __emit;
|
|
3025
|
+
const mouseOver = ref(false);
|
|
3026
|
+
const style = computed(() => {
|
|
3027
|
+
return {
|
|
3028
|
+
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
3029
|
+
minHeight: __props.minHeight,
|
|
3030
|
+
paddingRight: "4px",
|
|
3031
|
+
userSelect: "none"
|
|
3032
|
+
};
|
|
3033
|
+
});
|
|
3034
|
+
const onContextMenu = (e) => {
|
|
3035
|
+
emit("menu", e.clientX, e.clientY);
|
|
3036
|
+
};
|
|
3037
|
+
return (_ctx, _cache) => {
|
|
3038
|
+
const _directive_ripple = resolveDirective("ripple");
|
|
3039
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
3040
|
+
class: "d-flex justify-space-between align-center cursor-pointer",
|
|
3041
|
+
style: normalizeStyle(style.value),
|
|
3042
|
+
onContextmenu: withModifiers(onContextMenu, ["self", "prevent"]),
|
|
3043
|
+
onMouseout: _cache[0] || (_cache[0] = ($event) => mouseOver.value = false),
|
|
3044
|
+
onMouseover: _cache[1] || (_cache[1] = ($event) => mouseOver.value = true)
|
|
3045
|
+
}, [renderSlot(_ctx.$slots, "default")], 36)), [[_directive_ripple]]);
|
|
3046
|
+
};
|
|
3047
|
+
}
|
|
3048
|
+
});
|
|
3049
|
+
|
|
3050
|
+
//#endregion
|
|
3051
|
+
//#region src/components/entry/index.vue
|
|
3052
|
+
var entry_default = index_vue_vue_type_script_setup_true_lang_default$1;
|
|
3053
|
+
|
|
3054
|
+
//#endregion
|
|
3055
|
+
//#region src/composables/uis/uiProperty.ts
|
|
3056
|
+
function useUiProperty() {
|
|
3057
|
+
const { t } = useI18n();
|
|
3058
|
+
const propertyState = injectPropertyState();
|
|
3059
|
+
const renderProperty = (keys, property, node) => {
|
|
3060
|
+
const lastKey = keys[keys.length - 1];
|
|
3061
|
+
let propertyName = typeof lastKey === "number" ? `[${lastKey + 1}]` : t(property.name);
|
|
3062
|
+
if (isPropertyWarning(propertyState.value, keys)) propertyName += " !";
|
|
3063
|
+
else if (isPropertyChange(propertyState.value, keys)) propertyName += " *";
|
|
3064
|
+
return h(entry_default, {
|
|
3065
|
+
minHeight: "56px",
|
|
3066
|
+
onMenu: (x, y) => {
|
|
3067
|
+
eventBus.emit("propTreeMenu", {
|
|
3068
|
+
x,
|
|
3069
|
+
y,
|
|
3070
|
+
keys
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
}, () => [h("span", {
|
|
3074
|
+
style: {
|
|
3075
|
+
marginLeft: "4px",
|
|
3076
|
+
pointerEvents: "none"
|
|
3077
|
+
},
|
|
3078
|
+
innerHTML: propertyName
|
|
3079
|
+
}), h("div", { style: { width: "200px" } }, node)]);
|
|
3080
|
+
};
|
|
3081
|
+
return { renderProperty };
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
//#endregion
|
|
3085
|
+
//#region src/composables/uis/uiRule.ts
|
|
3086
|
+
function useUiRule() {
|
|
3087
|
+
const changeEvent = injectChangeEvent();
|
|
3088
|
+
function renderUiRule(keys, property, object, arrayIndex, isBranch) {
|
|
3089
|
+
if (property.ui !== "rule") throw new Error(`renderUiRule property ui must be rule`);
|
|
3090
|
+
return h(rule_default, {
|
|
3091
|
+
"modelValue": (() => {
|
|
3092
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
3093
|
+
})(),
|
|
3094
|
+
"onUpdate:modelValue": (val) => {
|
|
3095
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
3096
|
+
},
|
|
3097
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
3098
|
+
"onDelete": () => {
|
|
3099
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
3100
|
+
object.splice(arrayIndex, 1);
|
|
3101
|
+
changeEvent(keys.slice(0, -1), object);
|
|
3102
|
+
}
|
|
3103
|
+
});
|
|
3104
|
+
}
|
|
3105
|
+
return { renderUiRule };
|
|
3106
|
+
}
|
|
3107
|
+
|
|
3108
|
+
//#endregion
|
|
3109
|
+
//#region src/composables/uis/uiSelect.ts
|
|
3110
|
+
function useUiSelect() {
|
|
3111
|
+
const changeEvent = injectChangeEvent();
|
|
3112
|
+
const renderUiSelect = (keys, property, object, arrayIndex, isBranch) => {
|
|
3113
|
+
if (property.ui !== "select") throw new Error(`renderUiSelect property ui must be select`);
|
|
3114
|
+
return h(select_default, {
|
|
3115
|
+
"modelValue": (() => {
|
|
3116
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
3117
|
+
})(),
|
|
3118
|
+
"onUpdate:modelValue": (val) => {
|
|
3119
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
3120
|
+
},
|
|
3121
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
3122
|
+
"onDelete": () => {
|
|
3123
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
3124
|
+
object.splice(arrayIndex, 1);
|
|
3125
|
+
changeEvent(keys.slice(0, -1), object);
|
|
3126
|
+
},
|
|
3127
|
+
"items": property.items,
|
|
3128
|
+
"readonly": property.readonly
|
|
3129
|
+
});
|
|
3130
|
+
};
|
|
3131
|
+
return { renderUiSelect };
|
|
3132
|
+
}
|
|
3133
|
+
|
|
3134
|
+
//#endregion
|
|
3135
|
+
//#region src/composables/uis/uiSlot.ts
|
|
3136
|
+
function useUiSlot() {
|
|
3137
|
+
const changeEvent = injectChangeEvent();
|
|
3138
|
+
const renderUiSlot = (keys, property, object, arrayIndex, isBranch) => {
|
|
3139
|
+
if (property.ui !== "slot") throw new Error(`renderUiSlot property ui must be slot`);
|
|
3140
|
+
return h(slot_default, {
|
|
3141
|
+
"modelValue": (() => {
|
|
3142
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
3143
|
+
})(),
|
|
3144
|
+
"onUpdate:modelValue": (val) => {
|
|
3145
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
3146
|
+
},
|
|
3147
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
3148
|
+
"onDelete": () => {
|
|
3149
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
3150
|
+
object.splice(arrayIndex, 1);
|
|
3151
|
+
changeEvent(keys.slice(0, -1), object);
|
|
3152
|
+
},
|
|
3153
|
+
"readonly": property.readonly
|
|
3154
|
+
});
|
|
3155
|
+
};
|
|
3156
|
+
return { renderUiSlot };
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
//#endregion
|
|
3160
|
+
//#region src/composables/uis/uiSwitch.ts
|
|
3161
|
+
function useUiSwitch() {
|
|
3162
|
+
const changeEvent = injectChangeEvent();
|
|
3163
|
+
const renderUiSwitch = (keys, property, object, arrayIndex, isBranch) => {
|
|
3164
|
+
if (property.ui !== "switch") throw new Error(`renderUiSwitch property ui must be switch`);
|
|
3165
|
+
return h(switch_default, {
|
|
3166
|
+
"modelValue": (() => {
|
|
3167
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
3168
|
+
})(),
|
|
3169
|
+
"onUpdate:modelValue": (val) => {
|
|
3170
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
3171
|
+
},
|
|
3172
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
3173
|
+
"onDelete": () => {
|
|
3174
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
3175
|
+
object.splice(arrayIndex, 1);
|
|
3176
|
+
changeEvent(keys.slice(0, 1), object);
|
|
3177
|
+
},
|
|
3178
|
+
"readonly": property.readonly
|
|
3179
|
+
});
|
|
3180
|
+
};
|
|
3181
|
+
return { renderUiSwitch };
|
|
3182
|
+
}
|
|
3183
|
+
|
|
3184
|
+
//#endregion
|
|
3185
|
+
//#region src/composables/uis/uiText.ts
|
|
3186
|
+
function useUiText() {
|
|
3187
|
+
const changeEvent = injectChangeEvent();
|
|
3188
|
+
const renderUiText = (keys, property, object, arrayIndex, isBranch) => {
|
|
3189
|
+
if (property.ui !== "text") throw new Error(`renderUiText property ui must be text`);
|
|
3190
|
+
return h(text_default, {
|
|
3191
|
+
"modelValue": (() => {
|
|
3192
|
+
if (property.static) return property.value;
|
|
3193
|
+
return getModelValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
3194
|
+
})(),
|
|
3195
|
+
"onUpdate:modelValue": (val) => {
|
|
3196
|
+
if (property.static) return;
|
|
3197
|
+
setModelValue(keys, property, object, val, arrayIndex, isBranch, changeEvent);
|
|
3198
|
+
},
|
|
3199
|
+
"hasDelete": arrayIndex !== void 0 && !isBranch,
|
|
3200
|
+
"onDelete": () => {
|
|
3201
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
3202
|
+
object.splice(arrayIndex, 1);
|
|
3203
|
+
changeEvent(keys.slice(0, -1), object);
|
|
3204
|
+
},
|
|
3205
|
+
"readonly": property.static || property.readonly
|
|
3206
|
+
});
|
|
3207
|
+
};
|
|
3208
|
+
return { renderUiText };
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
//#endregion
|
|
3212
|
+
//#region src/components/propTree/main.vue?vue&type=script&setup=true&lang.ts
|
|
3213
|
+
const indent = "20px";
|
|
3214
|
+
var main_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
3215
|
+
__name: "main",
|
|
3216
|
+
setup(__props) {
|
|
3217
|
+
const { t } = useI18n();
|
|
3218
|
+
const { backgroundColor1 } = useColor();
|
|
3219
|
+
const config = injectConfig();
|
|
3220
|
+
const object = injectObject();
|
|
3221
|
+
const collapseState = injectCollapseState();
|
|
3222
|
+
const propertyState = injectPropertyState();
|
|
3223
|
+
const changeEvent = injectChangeEvent();
|
|
3224
|
+
useCompList();
|
|
3225
|
+
useSlotList();
|
|
3226
|
+
useAdaptSlotList();
|
|
3227
|
+
const { renderProperty } = useUiProperty();
|
|
3228
|
+
const { renderUiDummy } = useUiDummy();
|
|
3229
|
+
const { renderUiText } = useUiText();
|
|
3230
|
+
const { renderUiNumber } = useUiNumber();
|
|
3231
|
+
const { renderUiSwitch } = useUiSwitch();
|
|
3232
|
+
const { renderUiSelect } = useUiSelect();
|
|
3233
|
+
const { renderUiJson } = useUiJson();
|
|
3234
|
+
const { renderUiIcon } = useUiIcon();
|
|
3235
|
+
const { renderUiComp } = useUiComp();
|
|
3236
|
+
const { renderUiSlot } = useUiSlot();
|
|
3237
|
+
const { renderUiAdaptSlot } = useUiAdaptSlot();
|
|
3238
|
+
const { renderUiRule } = useUiRule();
|
|
3239
|
+
const { renderUiMultiTypes } = useUiMultiTypes();
|
|
3240
|
+
const renderNode = (keys, property, object, arrayIndex, isBranch, leafArrayEntry) => {
|
|
3241
|
+
keys = cloneDeep(keys);
|
|
3242
|
+
if (arrayIndex !== void 0) {
|
|
3243
|
+
keys.push(arrayIndex);
|
|
3244
|
+
if (isBranch) keys.push(property.key);
|
|
3245
|
+
} else keys.push(property.key);
|
|
3246
|
+
if (keys?.[0] === "runtime") return;
|
|
3247
|
+
if (property.ui) if (property.array && !leafArrayEntry) return renderLeafArray(keys, property, object, arrayIndex, isBranch);
|
|
3248
|
+
else return renderLeafScalar(keys, property, object, arrayIndex, isBranch);
|
|
3249
|
+
else if (property.array) return renderBranchArray(keys, property, object, arrayIndex, isBranch);
|
|
3250
|
+
else return renderBranchScalar(keys, property, object, arrayIndex, isBranch);
|
|
3251
|
+
};
|
|
3252
|
+
const renderBranchArray = (keys, property, object, arrayIndex, isBranch) => {
|
|
3253
|
+
if (property.ui) throw new Error(`renderBranchArray property ui must be invalid`);
|
|
3254
|
+
if (!property.array) throw new Error(`renderBranchArray property array must be valid`);
|
|
3255
|
+
const value = ensureArrayValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
3256
|
+
let propertyName = t(property.name);
|
|
3257
|
+
if (isCollapse(collapseState, keys)) {
|
|
3258
|
+
if (isPropertyWarning(propertyState.value, keys)) propertyName += " !";
|
|
3259
|
+
else if (isPropertyChange(propertyState.value, keys)) propertyName += " *";
|
|
3260
|
+
}
|
|
3261
|
+
const title = h(title_default, {
|
|
3262
|
+
title: propertyName,
|
|
3263
|
+
collapse: isCollapse(collapseState, keys),
|
|
3264
|
+
hasCreate: true,
|
|
3265
|
+
onCollapse: (val) => {
|
|
3266
|
+
setCollapse$1(collapseState, keys, val);
|
|
3267
|
+
},
|
|
3268
|
+
onMenu: (x, y) => {
|
|
3269
|
+
eventBus.emit("propTreeMenu", {
|
|
3270
|
+
x,
|
|
3271
|
+
y,
|
|
3272
|
+
keys
|
|
3273
|
+
});
|
|
3274
|
+
},
|
|
3275
|
+
onCreate: () => {
|
|
3276
|
+
value.push({});
|
|
3277
|
+
changeEvent(keys, value);
|
|
3278
|
+
}
|
|
3279
|
+
});
|
|
3280
|
+
const content = h("div", { style: { paddingLeft: indent } }, (() => {
|
|
3281
|
+
const entries = [];
|
|
3282
|
+
for (let i = 0; i < value.length; i++) {
|
|
3283
|
+
const entryKeys = [...keys, i];
|
|
3284
|
+
let entryName = `[${i + 1}]`;
|
|
3285
|
+
if (isCollapse(collapseState, [...keys, i])) {
|
|
3286
|
+
if (isPropertyWarning(propertyState.value, entryKeys)) entryName += " !";
|
|
3287
|
+
else if (isPropertyChange(propertyState.value, entryKeys)) entryName += " *";
|
|
3288
|
+
}
|
|
3289
|
+
const entryTitle = h(title_default, {
|
|
3290
|
+
title: entryName,
|
|
3291
|
+
collapse: isCollapse(collapseState, [...keys, i]),
|
|
3292
|
+
hasDelete: true,
|
|
3293
|
+
index: i,
|
|
3294
|
+
onCollapse: (val) => {
|
|
3295
|
+
setCollapse$1(collapseState, [...keys, i], val);
|
|
3296
|
+
},
|
|
3297
|
+
onMenu: (x, y) => {
|
|
3298
|
+
eventBus.emit("propTreeMenu", {
|
|
3299
|
+
x,
|
|
3300
|
+
y,
|
|
3301
|
+
keys: entryKeys
|
|
3302
|
+
});
|
|
3303
|
+
},
|
|
3304
|
+
onDelete: (idx) => {
|
|
3305
|
+
value.splice(idx, 1);
|
|
3306
|
+
changeEvent(keys, value);
|
|
3307
|
+
}
|
|
3308
|
+
});
|
|
3309
|
+
entries.push(entryTitle);
|
|
3310
|
+
const entryContent = h("div", { style: { paddingLeft: indent } }, (() => {
|
|
3311
|
+
const nodes = [];
|
|
3312
|
+
for (const child of property.children) nodes.push(renderNode(keys, child, value[i], i, true));
|
|
3313
|
+
return nodes;
|
|
3314
|
+
})());
|
|
3315
|
+
if (!isCollapse(collapseState, [...keys, i])) entries.push(entryContent);
|
|
3316
|
+
}
|
|
3317
|
+
return entries;
|
|
3318
|
+
})());
|
|
3319
|
+
return h("div", {}, (() => {
|
|
3320
|
+
const nodes = [];
|
|
3321
|
+
nodes.push(title);
|
|
3322
|
+
if (!isCollapse(collapseState, keys)) nodes.push(content);
|
|
3323
|
+
return nodes;
|
|
3324
|
+
})());
|
|
3325
|
+
};
|
|
3326
|
+
const renderBranchScalar = (keys, property, object, arrayIndex, isBranch) => {
|
|
3327
|
+
if (property.ui) throw new Error(`renderBranchScalar property ui must be invalid`);
|
|
3328
|
+
if (property.array) throw new Error(`renderBranchScalar property array must be invalid`);
|
|
3329
|
+
let propertyName = t(property.name);
|
|
3330
|
+
if (isCollapse(collapseState, keys)) {
|
|
3331
|
+
if (isPropertyWarning(propertyState.value, keys)) propertyName += " !";
|
|
3332
|
+
else if (isPropertyChange(propertyState.value, keys)) propertyName += " *";
|
|
3333
|
+
}
|
|
3334
|
+
const title = h(title_default, {
|
|
3335
|
+
title: propertyName,
|
|
3336
|
+
collapse: isCollapse(collapseState, keys),
|
|
3337
|
+
hasDelete: arrayIndex !== void 0 && !isBranch,
|
|
3338
|
+
onCollapse: (val) => {
|
|
3339
|
+
setCollapse$1(collapseState, keys, val);
|
|
3340
|
+
},
|
|
3341
|
+
onMenu: (x, y) => {
|
|
3342
|
+
eventBus.emit("propTreeMenu", {
|
|
3343
|
+
x,
|
|
3344
|
+
y,
|
|
3345
|
+
keys
|
|
3346
|
+
});
|
|
3347
|
+
},
|
|
3348
|
+
onDelete: () => {
|
|
3349
|
+
if (arrayIndex === void 0 || isBranch) return;
|
|
3350
|
+
object.splice(arrayIndex, 1);
|
|
3351
|
+
changeEvent(keys.slice(0, -1), object);
|
|
3352
|
+
}
|
|
3353
|
+
});
|
|
3354
|
+
const content = h("div", { style: { paddingLeft: indent } }, (() => {
|
|
3355
|
+
const nodes = [];
|
|
3356
|
+
for (const child of property.children) nodes.push(renderNode(keys, child, (() => {
|
|
3357
|
+
if (typeof object[property.key] !== "object") {
|
|
3358
|
+
object[property.key] = {};
|
|
3359
|
+
changeEvent(keys, object[property.key]);
|
|
3360
|
+
}
|
|
3361
|
+
return object[property.key];
|
|
3362
|
+
})(), void 0, false));
|
|
3363
|
+
return nodes;
|
|
3364
|
+
})());
|
|
3365
|
+
return h("div", {}, (() => {
|
|
3366
|
+
const nodes = [];
|
|
3367
|
+
nodes.push(title);
|
|
3368
|
+
if (!isCollapse(collapseState, keys)) nodes.push(content);
|
|
3369
|
+
return nodes;
|
|
3370
|
+
})());
|
|
3371
|
+
};
|
|
3372
|
+
const renderLeafArray = (keys, property, object, arrayIndex, isBranch) => {
|
|
3373
|
+
if (!property.ui) throw new Error(`renderLeafArray property ui must be valid`);
|
|
3374
|
+
if (!property.array) throw new Error(`renderLeafArray property array must be valid`);
|
|
3375
|
+
const value = ensureArrayValue(keys, property, object, arrayIndex, isBranch, changeEvent);
|
|
3376
|
+
let propertyName = t(property.name);
|
|
3377
|
+
if (isCollapse(collapseState, keys)) {
|
|
3378
|
+
if (isPropertyWarning(propertyState.value, keys)) propertyName += " !";
|
|
3379
|
+
else if (isPropertyChange(propertyState.value, keys)) propertyName += " *";
|
|
3380
|
+
}
|
|
3381
|
+
const title = h(title_default, {
|
|
3382
|
+
title: propertyName,
|
|
3383
|
+
collapse: isCollapse(collapseState, keys),
|
|
3384
|
+
hasCreate: true,
|
|
3385
|
+
onCollapse: (val) => {
|
|
3386
|
+
setCollapse$1(collapseState, keys, val);
|
|
3387
|
+
},
|
|
3388
|
+
onMenu: (x, y) => {
|
|
3389
|
+
eventBus.emit("propTreeMenu", {
|
|
3390
|
+
x,
|
|
3391
|
+
y,
|
|
3392
|
+
keys
|
|
3393
|
+
});
|
|
3394
|
+
},
|
|
3395
|
+
onCreate: () => {
|
|
3396
|
+
value.push(getPropertyDefault(property));
|
|
3397
|
+
changeEvent(keys, value);
|
|
3398
|
+
}
|
|
3399
|
+
});
|
|
3400
|
+
const content = h("div", { style: { paddingLeft: indent } }, (() => {
|
|
3401
|
+
const nodes = [];
|
|
3402
|
+
for (let i = 0; i < value.length; i++) nodes.push(renderNode(keys, property, value, i, false, true));
|
|
3403
|
+
return nodes;
|
|
3404
|
+
})());
|
|
3405
|
+
return h("div", {}, (() => {
|
|
3406
|
+
const nodes = [];
|
|
3407
|
+
nodes.push(title);
|
|
3408
|
+
if (!isCollapse(collapseState, keys)) nodes.push(content);
|
|
3409
|
+
return nodes;
|
|
3410
|
+
})());
|
|
3411
|
+
};
|
|
3412
|
+
const renderLeafScalar = (keys, property, object, arrayIndex, isBranch) => {
|
|
3413
|
+
if (!property.ui) throw new Error(`renderLeafScalar property ui must be valid`);
|
|
3414
|
+
let node;
|
|
3415
|
+
if (property.ui === "dummy") node = renderUiDummy(keys, property, object, arrayIndex, isBranch);
|
|
3416
|
+
else if (property.ui === "text") node = renderUiText(keys, property, object, arrayIndex, isBranch);
|
|
3417
|
+
else if (property.ui === "number") node = renderUiNumber(keys, property, object, arrayIndex, isBranch);
|
|
3418
|
+
else if (property.ui === "switch") node = renderUiSwitch(keys, property, object, arrayIndex, isBranch);
|
|
3419
|
+
else if (property.ui === "select") node = renderUiSelect(keys, property, object, arrayIndex, isBranch);
|
|
3420
|
+
else if (property.ui === "json") node = renderUiJson(keys, property, object, arrayIndex, isBranch);
|
|
3421
|
+
else if (property.ui === "icon") node = renderUiIcon(keys, property, object, arrayIndex, isBranch);
|
|
3422
|
+
else if (property.ui === "comp") node = renderUiComp(keys, property, object, arrayIndex, isBranch);
|
|
3423
|
+
else if (property.ui === "slot") node = renderUiSlot(keys, property, object, arrayIndex, isBranch);
|
|
3424
|
+
else if (property.ui === "adaptSlot") node = renderUiAdaptSlot(keys, property, object, arrayIndex, isBranch);
|
|
3425
|
+
else if (property.ui === "rule") node = renderUiRule(keys, property, object, arrayIndex, isBranch);
|
|
3426
|
+
else if (property.ui === "multiTypes") node = renderUiMultiTypes(keys, property, object, arrayIndex, isBranch);
|
|
3427
|
+
else console.assert(false, `renderLeafScalar not implemented`);
|
|
3428
|
+
if (node) return renderProperty(keys, property, node);
|
|
3429
|
+
else return h("div");
|
|
3430
|
+
};
|
|
3431
|
+
const render = () => {
|
|
3432
|
+
return h("div", {
|
|
3433
|
+
class: "text-body-medium",
|
|
3434
|
+
style: { background: backgroundColor1.value }
|
|
3435
|
+
}, (() => {
|
|
3436
|
+
const nodes = [];
|
|
3437
|
+
if (config.value.length > 0 && object.value) for (const property of config.value) nodes.push(renderNode([], property, object.value, void 0, false));
|
|
3438
|
+
return nodes;
|
|
3439
|
+
})());
|
|
3440
|
+
};
|
|
3441
|
+
return (_ctx, _cache) => {
|
|
3442
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(render), createVNode(menu_default)], 64);
|
|
3443
|
+
};
|
|
3444
|
+
}
|
|
3445
|
+
});
|
|
3446
|
+
|
|
3447
|
+
//#endregion
|
|
3448
|
+
//#region src/components/propTree/main.vue
|
|
3449
|
+
var main_default = main_vue_vue_type_script_setup_true_lang_default;
|
|
3450
|
+
|
|
3451
|
+
//#endregion
|
|
3452
|
+
//#region src/components/propTree/index.vue?vue&type=script&setup=true&lang.ts
|
|
3453
|
+
var index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
3454
|
+
__name: "index",
|
|
3455
|
+
props: {
|
|
3456
|
+
config: {
|
|
3457
|
+
type: Array,
|
|
3458
|
+
required: true
|
|
3459
|
+
},
|
|
3460
|
+
object: {
|
|
3461
|
+
type: null,
|
|
3462
|
+
required: true
|
|
3463
|
+
},
|
|
3464
|
+
version: {
|
|
3465
|
+
type: String,
|
|
3466
|
+
required: true
|
|
3467
|
+
},
|
|
3468
|
+
type: {
|
|
3469
|
+
type: String,
|
|
3470
|
+
required: true
|
|
3471
|
+
},
|
|
3472
|
+
subtype: {
|
|
3473
|
+
type: String,
|
|
3474
|
+
required: true
|
|
3475
|
+
}
|
|
3476
|
+
},
|
|
3477
|
+
emits: ["change"],
|
|
3478
|
+
setup(__props, { emit: __emit }) {
|
|
3479
|
+
const emit = __emit;
|
|
3480
|
+
const configRef = ref([]);
|
|
3481
|
+
provideConfig(configRef);
|
|
3482
|
+
watchEffect(() => {
|
|
3483
|
+
configRef.value = __props.config;
|
|
3484
|
+
});
|
|
3485
|
+
const objectRef = ref();
|
|
3486
|
+
provideObject(objectRef);
|
|
3487
|
+
watchEffect(() => {
|
|
3488
|
+
objectRef.value = __props.object;
|
|
3489
|
+
});
|
|
3490
|
+
const versionRef = ref("");
|
|
3491
|
+
provideVersion(versionRef);
|
|
3492
|
+
watchEffect(() => {
|
|
3493
|
+
versionRef.value = __props.version;
|
|
3494
|
+
});
|
|
3495
|
+
const typeRef = ref(__props.type);
|
|
3496
|
+
provideType(typeRef);
|
|
3497
|
+
watchEffect(() => {
|
|
3498
|
+
typeRef.value = __props.type;
|
|
3499
|
+
});
|
|
3500
|
+
const subtypeRef = ref("");
|
|
3501
|
+
provideSubtype(subtypeRef);
|
|
3502
|
+
watchEffect(() => {
|
|
3503
|
+
subtypeRef.value = __props.subtype;
|
|
3504
|
+
});
|
|
3505
|
+
provideCollapseState(ref({
|
|
3506
|
+
collapse: true,
|
|
3507
|
+
children: {}
|
|
3508
|
+
}));
|
|
3509
|
+
const propertyState = ref({
|
|
3510
|
+
change: false,
|
|
3511
|
+
warning: false,
|
|
3512
|
+
children: {}
|
|
3513
|
+
});
|
|
3514
|
+
providePropertyState(propertyState);
|
|
3515
|
+
function changeEvent(keys, val) {
|
|
3516
|
+
rebuildPropertyState(propertyState, __props.config, __props.object);
|
|
3517
|
+
emit("change", keys, val);
|
|
3518
|
+
}
|
|
3519
|
+
provideChangeEvent(changeEvent);
|
|
3520
|
+
function refreshPropertyState() {
|
|
3521
|
+
rebuildPropertyState(propertyState, __props.config, __props.object);
|
|
3522
|
+
}
|
|
3523
|
+
onMounted(() => {
|
|
3524
|
+
eventBus.on("refreshPropertyState", refreshPropertyState);
|
|
3525
|
+
});
|
|
3526
|
+
onBeforeUnmount(() => {
|
|
3527
|
+
eventBus.off("refreshPropertyState", refreshPropertyState);
|
|
3528
|
+
});
|
|
3529
|
+
watch([() => __props.config, () => __props.object], () => {
|
|
3530
|
+
rebuildPropertyState(propertyState, __props.config, __props.object);
|
|
3531
|
+
}, { immediate: true });
|
|
3532
|
+
return (_ctx, _cache) => {
|
|
3533
|
+
return openBlock(), createBlock(main_default);
|
|
3534
|
+
};
|
|
3535
|
+
}
|
|
3536
|
+
});
|
|
3537
|
+
|
|
3538
|
+
//#endregion
|
|
3539
|
+
//#region src/components/propTree/index.vue
|
|
3540
|
+
var propTree_default = index_vue_vue_type_script_setup_true_lang_default;
|
|
3541
|
+
|
|
3542
|
+
//#endregion
|
|
3543
|
+
//#region src/components/index.ts
|
|
3544
|
+
const install = (app) => {
|
|
3545
|
+
app.component("XPropTree", propTree_default);
|
|
3546
|
+
};
|
|
3547
|
+
|
|
3548
|
+
//#endregion
|
|
3549
|
+
//#region src/i18n/index.ts
|
|
3550
|
+
async function loadLocaleMessagePropTree(locale) {
|
|
3551
|
+
if (locale === "en") return (await import("./i18n-en.iiploulp.js").then((n) => n.t)).default;
|
|
3552
|
+
else if (locale === "zhHans") return (await import("./i18n-zhHans.bb5g1fpp.js").then((n) => n.t)).default;
|
|
3553
|
+
else throw new Error(`invalid locale=${locale}`);
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3556
|
+
//#endregion
|
|
3557
|
+
//#region src/index.ts
|
|
3558
|
+
var src_default = { install };
|
|
3559
|
+
|
|
3560
|
+
//#endregion
|
|
3561
|
+
export { src_default as default, loadLocaleMessagePropTree };
|