x-prop-tree 0.7.6 → 0.7.7
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/index.js +110 -104
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { provide as ce, inject as de, defineComponent as R, ref as O, computed as K, resolveComponent as
|
|
1
|
+
import { provide as ce, inject as de, defineComponent as R, ref as O, computed as K, resolveComponent as x, createBlock as B, openBlock as C, unref as L, isRef as ve, withCtx as J, createVNode as D, createElementBlock as E, Fragment as Ve, renderList as Be, createTextVNode as Ce, toDisplayString as W, resolveDirective as le, withDirectives as ee, withModifiers as X, normalizeStyle as I, createElementVNode as F, createCommentVNode as G, renderSlot as ft, h, mergeModels as Y, useModel as z, useId as we, onUnmounted as De, withKeys as Ke, mergeProps as be, watchEffect as Ne, watch as re, useTemplateRef as Je, reactive as mt, onMounted as vt, onBeforeUnmount as pt } from "vue";
|
|
2
2
|
import { useI18n as te } from "vue-i18n";
|
|
3
3
|
import { useViewStack as Se, useColor as ie, eventBus as ue, useSystem as pe, openPromptDlg as yt, openNumberDlg as Re, injectDark as gt, injectLocale as ht } from "x-essential-lib";
|
|
4
4
|
import { c as Ee, i as Ue, r as He, v as _t, d as kt } from "./vendor.n68iqk3a.js";
|
|
5
5
|
import { getPropDefault as q, pkgs as Fe, parsePixelStr as Vt, parsePercentStr as Ct } from "x-runtime-lib";
|
|
6
6
|
import { globalState as St } from "x-state-lib";
|
|
7
7
|
import { useDisplay as Ut } from "vuetify";
|
|
8
|
-
import { XBlockly as
|
|
8
|
+
import { XBlockly as xt } from "x-block-lib";
|
|
9
9
|
const _e = (l, s) => {
|
|
10
10
|
let t = { key: "", name: "", children: l };
|
|
11
11
|
return s.forEach((e) => {
|
|
@@ -30,7 +30,7 @@ const _e = (l, s) => {
|
|
|
30
30
|
}
|
|
31
31
|
t = t[e];
|
|
32
32
|
}), t;
|
|
33
|
-
}, Oe = (l) => !(l instanceof Array), Me = (l) => l instanceof Array,
|
|
33
|
+
}, Oe = (l) => !(l instanceof Array), Me = (l) => l instanceof Array, $t = (l, s) => {
|
|
34
34
|
const t = (e, n) => {
|
|
35
35
|
if (e.ui !== n.ui || e.array !== n.array)
|
|
36
36
|
return !1;
|
|
@@ -44,10 +44,10 @@ const _e = (l, s) => {
|
|
|
44
44
|
return !0;
|
|
45
45
|
};
|
|
46
46
|
return t(l, s);
|
|
47
|
-
}, Ae = (l) => !(l instanceof Array),
|
|
47
|
+
}, Ae = (l) => !(l instanceof Array), xe = (l) => l instanceof Array, Pt = [
|
|
48
48
|
["basic", "id"],
|
|
49
49
|
["basic", "name"]
|
|
50
|
-
], Mt = (l) => Pt.find((s) => Ue(l, s)),
|
|
50
|
+
], Mt = (l) => Pt.find((s) => Ue(l, s)), $e = (l, s, t, e, n, o, i) => (l = Ee(l), o !== void 0 ? (l.push(o), i && l.push(s.key)) : l.push(s.key), Mt(l) ? (e.change = !1, e.change) : s.ui ? s.array && e.children && xe(e.children) ? bt(
|
|
51
51
|
l,
|
|
52
52
|
s,
|
|
53
53
|
t,
|
|
@@ -76,7 +76,7 @@ const _e = (l, s) => {
|
|
|
76
76
|
return console.assert(!1, "execPropBranchArray prop ui must be invalid"), !1;
|
|
77
77
|
if (!s.array)
|
|
78
78
|
return console.assert(!1, "execPropBranchArray prop array must be valid"), !1;
|
|
79
|
-
if (!e.children ||
|
|
79
|
+
if (!e.children || !xe(e.children))
|
|
80
80
|
return console.assert(!1, "execPropBranchArray state children must be array"), !1;
|
|
81
81
|
let r;
|
|
82
82
|
o !== void 0 && !i ? (t[o] instanceof Array || (t[o] = q(s), n?.(l, t[o])), r = t[o]) : (t[s.key] instanceof Array || (t[s.key] = q(s), n?.(l, t[s.key])), r = t[s.key]), e.change = !1;
|
|
@@ -94,7 +94,7 @@ const _e = (l, s) => {
|
|
|
94
94
|
a.children[f.key] = {
|
|
95
95
|
change: !1,
|
|
96
96
|
children: f.array ? [] : {}
|
|
97
|
-
},
|
|
97
|
+
}, $e(
|
|
98
98
|
l,
|
|
99
99
|
f,
|
|
100
100
|
r[u],
|
|
@@ -120,7 +120,7 @@ const _e = (l, s) => {
|
|
|
120
120
|
e.children[a.key] = {
|
|
121
121
|
change: !1,
|
|
122
122
|
children: a.array ? [] : {}
|
|
123
|
-
},
|
|
123
|
+
}, $e(l, a, r, e.children[a.key], n) && (e.change = !0);
|
|
124
124
|
}
|
|
125
125
|
return e.change;
|
|
126
126
|
}, bt = (l, s, t, e, n, o, i) => {
|
|
@@ -128,7 +128,7 @@ const _e = (l, s) => {
|
|
|
128
128
|
return console.assert(!1, "execPropLeafArray prop ui must be valid"), !1;
|
|
129
129
|
if (!s.array)
|
|
130
130
|
return console.assert(!1, "execPropLeafArray prop aray must be valid"), !1;
|
|
131
|
-
if (!e.children ||
|
|
131
|
+
if (!e.children || !xe(e.children))
|
|
132
132
|
return console.assert(!1, "execPropLeafArray state children must be array"), !1;
|
|
133
133
|
let r;
|
|
134
134
|
o !== void 0 && !i ? (t[o] instanceof Array || (t[o] = q(s), n?.(l, t[o])), r = t[o]) : (t[s.key] instanceof Array || (t[s.key] = q(s), n?.(l, t[s.key])), r = t[s.key]), e.change = !1;
|
|
@@ -136,7 +136,7 @@ const _e = (l, s) => {
|
|
|
136
136
|
e.children[u] = {
|
|
137
137
|
change: !1,
|
|
138
138
|
children: {}
|
|
139
|
-
},
|
|
139
|
+
}, $e(l, s, r, e.children[u], n, u, !1) && (e.change = !0);
|
|
140
140
|
return e.change || (e.change = !Ue(r, q(s))), e.change;
|
|
141
141
|
}, At = (l, s, t, e, n) => {
|
|
142
142
|
if (!l.ui)
|
|
@@ -153,7 +153,7 @@ const _e = (l, s) => {
|
|
|
153
153
|
n[o.key] = {
|
|
154
154
|
change: !1,
|
|
155
155
|
children: o.array ? [] : {}
|
|
156
|
-
},
|
|
156
|
+
}, $e([], o, t, n[o.key], e);
|
|
157
157
|
}), l.value = n;
|
|
158
158
|
}, ae = (l, s) => {
|
|
159
159
|
let t = { change: !1, children: l };
|
|
@@ -162,7 +162,7 @@ const _e = (l, s) => {
|
|
|
162
162
|
return console.assert(!1, `isPropChanged state must be valid keys=${s}`), !1;
|
|
163
163
|
if (!t.children)
|
|
164
164
|
return console.assert(!1, `isPropChanged state must be valid keys=${s}`), !1;
|
|
165
|
-
typeof e == "string" ? Ae(t.children) && (t = t.children[e]) :
|
|
165
|
+
typeof e == "string" ? Ae(t.children) && (t = t.children[e]) : xe(t.children) && (t = t.children[e]);
|
|
166
166
|
}), t?.change ?? !1;
|
|
167
167
|
}, Xe = Symbol(), ze = Symbol(), Ge = Symbol(), Ye = Symbol(), We = Symbol(), Qe = Symbol();
|
|
168
168
|
function Tt(l) {
|
|
@@ -261,7 +261,7 @@ const Ht = /* @__PURE__ */ R({
|
|
|
261
261
|
return !1;
|
|
262
262
|
try {
|
|
263
263
|
const { prop: M } = JSON.parse(_), N = _e(t.value, u.value);
|
|
264
|
-
return
|
|
264
|
+
return $t(M, N);
|
|
265
265
|
} catch (M) {
|
|
266
266
|
console.error(M);
|
|
267
267
|
}
|
|
@@ -289,13 +289,13 @@ const Ht = /* @__PURE__ */ R({
|
|
|
289
289
|
i.value = P.x, r.value = P.y, u.value = P.keys;
|
|
290
290
|
}, { open: S } = Se("propTreeMenu", k);
|
|
291
291
|
return (P, T) => {
|
|
292
|
-
const w =
|
|
292
|
+
const w = x("v-list-item-title"), _ = x("v-list-item"), M = x("v-list"), N = x("v-menu");
|
|
293
293
|
return C(), B(N, {
|
|
294
294
|
modelValue: L(S),
|
|
295
295
|
"onUpdate:modelValue": T[0] || (T[0] = (Q) => ve(S) ? S.value = Q : null),
|
|
296
296
|
"location-strategy": "connected",
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
scrim: "transparent",
|
|
298
|
+
target: a.value
|
|
299
299
|
}, {
|
|
300
300
|
default: J(() => [
|
|
301
301
|
D(M, null, {
|
|
@@ -345,14 +345,14 @@ const Ht = /* @__PURE__ */ R({
|
|
|
345
345
|
n("menu", a.clientX, a.clientY);
|
|
346
346
|
};
|
|
347
347
|
return (a, f) => {
|
|
348
|
-
const d =
|
|
348
|
+
const d = x("v-icon"), y = x("v-spacer"), g = x("v-btn"), k = le("ripple");
|
|
349
349
|
return ee((C(), E("div", {
|
|
350
350
|
class: "d-flex align-center cursor-pointer",
|
|
351
351
|
style: I(i.value),
|
|
352
352
|
onClick: r,
|
|
353
353
|
onContextmenu: X(u, ["self", "prevent"]),
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
onMouseout: f[2] || (f[2] = (S) => o.value = !1),
|
|
355
|
+
onMouseover: f[3] || (f[3] = (S) => o.value = !0)
|
|
356
356
|
}, [
|
|
357
357
|
D(d, {
|
|
358
358
|
class: "mr-1",
|
|
@@ -363,17 +363,17 @@ const Ht = /* @__PURE__ */ R({
|
|
|
363
363
|
a.hasCreate ? (C(), B(g, {
|
|
364
364
|
key: 0,
|
|
365
365
|
class: "mx-3",
|
|
366
|
-
variant: "text",
|
|
367
366
|
density: "compact",
|
|
368
367
|
icon: "mdi-plus",
|
|
368
|
+
variant: "text",
|
|
369
369
|
onClick: f[0] || (f[0] = X((S) => n("create"), ["stop"]))
|
|
370
370
|
})) : G("", !0),
|
|
371
371
|
a.hasDelete ? (C(), B(g, {
|
|
372
372
|
key: 1,
|
|
373
373
|
class: "mx-3",
|
|
374
|
-
variant: "text",
|
|
375
374
|
density: "compact",
|
|
376
375
|
icon: "mdi-minus",
|
|
376
|
+
variant: "text",
|
|
377
377
|
onClick: f[1] || (f[1] = X((S) => n("delete", a.index), ["stop"]))
|
|
378
378
|
})) : G("", !0)
|
|
379
379
|
], 36)), [
|
|
@@ -403,8 +403,8 @@ const Ht = /* @__PURE__ */ R({
|
|
|
403
403
|
class: "d-flex justify-space-between align-center cursor-pointer",
|
|
404
404
|
style: I(i.value),
|
|
405
405
|
onContextmenu: X(r, ["self", "prevent"]),
|
|
406
|
-
|
|
407
|
-
|
|
406
|
+
onMouseout: a[0] || (a[0] = (d) => o.value = !1),
|
|
407
|
+
onMouseover: a[1] || (a[1] = (d) => o.value = !0)
|
|
408
408
|
}, [
|
|
409
409
|
ft(u.$slots, "default")
|
|
410
410
|
], 36)), [
|
|
@@ -496,15 +496,15 @@ const Yt = { class: "d-flex justify-space-between align-center" }, Wt = /* @__PU
|
|
|
496
496
|
r !== void 0 && (e.value = r);
|
|
497
497
|
};
|
|
498
498
|
return (i, r) => {
|
|
499
|
-
const u =
|
|
499
|
+
const u = x("v-text-field"), a = x("v-btn"), f = le("ripple");
|
|
500
500
|
return C(), E("div", Yt, [
|
|
501
501
|
ee(D(u, {
|
|
502
502
|
modelValue: e.value,
|
|
503
503
|
"onUpdate:modelValue": r[0] || (r[0] = (d) => e.value = d),
|
|
504
504
|
density: "compact",
|
|
505
505
|
"hide-details": "",
|
|
506
|
-
"single-line": "",
|
|
507
506
|
readonly: i.readonly,
|
|
507
|
+
"single-line": "",
|
|
508
508
|
"onUpdate:focused": o
|
|
509
509
|
}, null, 8, ["modelValue", "readonly"]), [
|
|
510
510
|
[
|
|
@@ -517,9 +517,9 @@ const Yt = { class: "d-flex justify-space-between align-center" }, Wt = /* @__PU
|
|
|
517
517
|
i.hasDelete ? (C(), B(a, {
|
|
518
518
|
key: 0,
|
|
519
519
|
class: "mx-2",
|
|
520
|
-
variant: "text",
|
|
521
520
|
density: "compact",
|
|
522
521
|
icon: "mdi-minus",
|
|
522
|
+
variant: "text",
|
|
523
523
|
onClick: r[1] || (r[1] = X((d) => n("delete"), ["stop"]))
|
|
524
524
|
})) : G("", !0)
|
|
525
525
|
]);
|
|
@@ -574,6 +574,7 @@ const Zt = { class: "d-flex justify-space-between align-center" }, jt = /* @__PU
|
|
|
574
574
|
if (!i || l.readonly || !t())
|
|
575
575
|
return;
|
|
576
576
|
const r = await Re({
|
|
577
|
+
title: "",
|
|
577
578
|
value: e.value,
|
|
578
579
|
precision: l.precision,
|
|
579
580
|
min: l.min,
|
|
@@ -583,22 +584,22 @@ const Zt = { class: "d-flex justify-space-between align-center" }, jt = /* @__PU
|
|
|
583
584
|
r !== void 0 && (e.value = r);
|
|
584
585
|
};
|
|
585
586
|
return (i, r) => {
|
|
586
|
-
const u =
|
|
587
|
+
const u = x("v-number-input"), a = x("v-btn"), f = le("ripple");
|
|
587
588
|
return C(), E("div", Zt, [
|
|
588
589
|
ee(D(u, {
|
|
589
590
|
modelValue: e.value,
|
|
590
591
|
"onUpdate:modelValue": r[0] || (r[0] = (d) => e.value = d),
|
|
591
|
-
density: "compact",
|
|
592
592
|
"control-variant": "stacked",
|
|
593
|
-
|
|
594
|
-
min: i.min,
|
|
595
|
-
max: i.max,
|
|
596
|
-
step: i.step,
|
|
593
|
+
density: "compact",
|
|
597
594
|
"hide-details": "",
|
|
598
|
-
|
|
595
|
+
max: i.max,
|
|
596
|
+
min: i.min,
|
|
597
|
+
precision: i.precision,
|
|
599
598
|
readonly: i.readonly,
|
|
599
|
+
"single-line": "",
|
|
600
|
+
step: i.step,
|
|
600
601
|
"onUpdate:focused": o
|
|
601
|
-
}, null, 8, ["modelValue", "
|
|
602
|
+
}, null, 8, ["modelValue", "max", "min", "precision", "readonly", "step"]), [
|
|
602
603
|
[
|
|
603
604
|
f,
|
|
604
605
|
void 0,
|
|
@@ -609,9 +610,9 @@ const Zt = { class: "d-flex justify-space-between align-center" }, jt = /* @__PU
|
|
|
609
610
|
i.hasDelete ? (C(), B(a, {
|
|
610
611
|
key: 0,
|
|
611
612
|
class: "mx-2",
|
|
612
|
-
variant: "text",
|
|
613
613
|
density: "compact",
|
|
614
614
|
icon: "mdi-minus",
|
|
615
|
+
variant: "text",
|
|
615
616
|
onClick: r[1] || (r[1] = X((d) => n("delete"), ["stop"]))
|
|
616
617
|
})) : G("", !0)
|
|
617
618
|
]);
|
|
@@ -663,23 +664,23 @@ const en = { class: "d-flex justify-space-between align-center" }, tn = /* @__PU
|
|
|
663
664
|
setup(l, { emit: s }) {
|
|
664
665
|
const t = z(l, "modelValue"), e = s;
|
|
665
666
|
return (n, o) => {
|
|
666
|
-
const i =
|
|
667
|
+
const i = x("v-switch"), r = x("v-btn");
|
|
667
668
|
return C(), E("div", en, [
|
|
668
669
|
D(i, {
|
|
669
670
|
modelValue: t.value,
|
|
670
671
|
"onUpdate:modelValue": o[0] || (o[0] = (u) => t.value = u),
|
|
671
672
|
class: "ml-1",
|
|
672
|
-
density: "compact",
|
|
673
673
|
color: "primary",
|
|
674
|
+
density: "compact",
|
|
674
675
|
"hide-details": "",
|
|
675
676
|
readonly: n.readonly
|
|
676
677
|
}, null, 8, ["modelValue", "readonly"]),
|
|
677
678
|
n.hasDelete ? (C(), B(r, {
|
|
678
679
|
key: 0,
|
|
679
680
|
class: "mx-2",
|
|
680
|
-
variant: "text",
|
|
681
681
|
density: "compact",
|
|
682
682
|
icon: "mdi-minus",
|
|
683
|
+
variant: "text",
|
|
683
684
|
onClick: o[1] || (o[1] = X((u) => e("delete"), ["stop"]))
|
|
684
685
|
})) : G("", !0)
|
|
685
686
|
]);
|
|
@@ -733,16 +734,16 @@ const ln = { class: "d-flex justify-space-between align-center" }, on = /* @__PU
|
|
|
733
734
|
}), r;
|
|
734
735
|
});
|
|
735
736
|
return (r, u) => {
|
|
736
|
-
const a =
|
|
737
|
+
const a = x("v-select"), f = x("v-btn"), d = le("ripple");
|
|
737
738
|
return C(), E("div", ln, [
|
|
738
739
|
ee(D(a, {
|
|
739
740
|
modelValue: e.value,
|
|
740
741
|
"onUpdate:modelValue": u[0] || (u[0] = (y) => e.value = y),
|
|
741
742
|
density: "compact",
|
|
742
|
-
items: i.value,
|
|
743
743
|
"hide-details": "",
|
|
744
|
-
|
|
745
|
-
readonly: r.readonly
|
|
744
|
+
items: i.value,
|
|
745
|
+
readonly: r.readonly,
|
|
746
|
+
"single-line": ""
|
|
746
747
|
}, null, 8, ["modelValue", "items", "readonly"]), [
|
|
747
748
|
[
|
|
748
749
|
d,
|
|
@@ -754,9 +755,9 @@ const ln = { class: "d-flex justify-space-between align-center" }, on = /* @__PU
|
|
|
754
755
|
r.hasDelete ? (C(), B(f, {
|
|
755
756
|
key: 0,
|
|
756
757
|
class: "mx-2",
|
|
757
|
-
variant: "text",
|
|
758
758
|
density: "compact",
|
|
759
759
|
icon: "mdi-minus",
|
|
760
|
+
variant: "text",
|
|
760
761
|
onClick: u[1] || (u[1] = X((y) => n("delete"), ["stop"]))
|
|
761
762
|
})) : G("", !0)
|
|
762
763
|
]);
|
|
@@ -809,13 +810,13 @@ const rn = { class: "text-subtitle-2 ml-1" }, un = { class: "text-caption text-g
|
|
|
809
810
|
userSelect: "none"
|
|
810
811
|
}));
|
|
811
812
|
return (u, a) => {
|
|
812
|
-
const f =
|
|
813
|
+
const f = x("v-icon"), d = le("ripple");
|
|
813
814
|
return ee((C(), E("div", {
|
|
814
815
|
class: "d-flex align-center cursor-pointer",
|
|
815
816
|
style: I(r.value),
|
|
816
817
|
onClick: a[0] || (a[0] = (y) => o("x-click", n.id)),
|
|
817
|
-
|
|
818
|
-
|
|
818
|
+
onMouseout: a[1] || (a[1] = (y) => i.value = !1),
|
|
819
|
+
onMouseover: a[2] || (a[2] = (y) => i.value = !0)
|
|
819
820
|
}, [
|
|
820
821
|
D(f, {
|
|
821
822
|
icon: n.collapse ? "mdi-chevron-right" : "mdi-chevron-down",
|
|
@@ -848,8 +849,8 @@ const rn = { class: "text-subtitle-2 ml-1" }, un = { class: "text-caption text-g
|
|
|
848
849
|
class: "d-flex align-center cursor-pointer",
|
|
849
850
|
style: I(r.value),
|
|
850
851
|
onClick: a[0] || (a[0] = (d) => o("x-click", n.id)),
|
|
851
|
-
|
|
852
|
-
|
|
852
|
+
onMouseout: a[1] || (a[1] = (d) => i.value = !1),
|
|
853
|
+
onMouseover: a[2] || (a[2] = (d) => i.value = !0)
|
|
853
854
|
}, [
|
|
854
855
|
F("span", cn, W(n.title), 1)
|
|
855
856
|
], 36)), [
|
|
@@ -883,11 +884,11 @@ const rn = { class: "text-subtitle-2 ml-1" }, un = { class: "text-caption text-g
|
|
|
883
884
|
a.type === 0 ? (C(), B(an, {
|
|
884
885
|
key: 0,
|
|
885
886
|
id: a.id,
|
|
886
|
-
title: a.name,
|
|
887
887
|
collapse: a.collapse,
|
|
888
888
|
count: a.count ?? 0,
|
|
889
|
+
title: a.name,
|
|
889
890
|
onXClick: o
|
|
890
|
-
}, null, 8, ["id", "
|
|
891
|
+
}, null, 8, ["id", "collapse", "count", "title"])) : G("", !0),
|
|
891
892
|
a.type === 1 && a.show ? (C(), B(dn, {
|
|
892
893
|
key: 1,
|
|
893
894
|
id: a.id,
|
|
@@ -929,20 +930,20 @@ const rn = { class: "text-subtitle-2 ml-1" }, un = { class: "text-caption text-g
|
|
|
929
930
|
return De(() => {
|
|
930
931
|
d.value = !1;
|
|
931
932
|
}), (y, g) => {
|
|
932
|
-
const k =
|
|
933
|
+
const k = x("v-btn"), S = x("v-sheet"), P = x("v-icon"), T = x("v-dialog");
|
|
933
934
|
return C(), B(T, {
|
|
934
935
|
modelValue: L(d),
|
|
935
936
|
"onUpdate:modelValue": g[5] || (g[5] = (w) => ve(d) ? d.value = w : null),
|
|
936
|
-
transition: "scroll-x-reverse-transition",
|
|
937
|
-
persistent: "",
|
|
938
|
-
"no-click-animation": "",
|
|
939
937
|
fullscreen: "",
|
|
938
|
+
"no-click-animation": "",
|
|
939
|
+
persistent: "",
|
|
940
|
+
transition: "scroll-x-reverse-transition",
|
|
940
941
|
onKeydown: g[6] || (g[6] = Ke(X((w) => d.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
941
942
|
}, {
|
|
942
943
|
activator: J(({ props: w }) => [
|
|
943
944
|
D(k, be(w, {
|
|
944
|
-
|
|
945
|
-
|
|
945
|
+
block: "",
|
|
946
|
+
density: "comfortable"
|
|
946
947
|
}), {
|
|
947
948
|
default: J(() => [
|
|
948
949
|
Ce(W(f.value), 1)
|
|
@@ -1044,7 +1045,7 @@ const hn = { class: "d-flex justify-space-between align-center" }, _n = /* @__PU
|
|
|
1044
1045
|
return De(() => {
|
|
1045
1046
|
r.value = !1;
|
|
1046
1047
|
}), (u, a) => {
|
|
1047
|
-
const f =
|
|
1048
|
+
const f = x("v-btn"), d = x("v-color-picker"), y = x("v-menu");
|
|
1048
1049
|
return C(), B(y, {
|
|
1049
1050
|
modelValue: L(r),
|
|
1050
1051
|
"onUpdate:modelValue": a[2] || (a[2] = (g) => ve(r) ? r.value = g : null),
|
|
@@ -1058,9 +1059,9 @@ const hn = { class: "d-flex justify-space-between align-center" }, _n = /* @__PU
|
|
|
1058
1059
|
style: I(o.value)
|
|
1059
1060
|
}, [
|
|
1060
1061
|
D(f, be(g, {
|
|
1061
|
-
density: "comfortable",
|
|
1062
|
-
color: e.value,
|
|
1063
1062
|
block: "",
|
|
1063
|
+
color: e.value,
|
|
1064
|
+
density: "comfortable",
|
|
1064
1065
|
disabled: i.value
|
|
1065
1066
|
}), {
|
|
1066
1067
|
default: J(() => [
|
|
@@ -1072,9 +1073,9 @@ const hn = { class: "d-flex justify-space-between align-center" }, _n = /* @__PU
|
|
|
1072
1073
|
u.hasDelete ? (C(), B(f, {
|
|
1073
1074
|
key: 0,
|
|
1074
1075
|
class: "mx-2",
|
|
1075
|
-
variant: "text",
|
|
1076
1076
|
density: "compact",
|
|
1077
1077
|
icon: "mdi-minus",
|
|
1078
|
+
variant: "text",
|
|
1078
1079
|
onClick: a[0] || (a[0] = X((k) => n("delete"), ["stop"]))
|
|
1079
1080
|
})) : G("", !0)
|
|
1080
1081
|
])
|
|
@@ -1147,10 +1148,15 @@ const Vn = { class: "d-flex justify-space-between align-center my-2" }, Cn = { c
|
|
|
1147
1148
|
const f = K(() => r.value?.[u.value]), d = () => {
|
|
1148
1149
|
n.value = f.value?.default;
|
|
1149
1150
|
}, y = O(0), g = async (k) => {
|
|
1150
|
-
if (!k || !e())
|
|
1151
|
+
if (!k || !e() || f.value.ui !== "pixelInput" && f.value.ui !== "percentInput")
|
|
1151
1152
|
return;
|
|
1152
1153
|
const S = await Re({
|
|
1153
|
-
|
|
1154
|
+
title: "",
|
|
1155
|
+
value: y.value,
|
|
1156
|
+
precision: f.value.precision,
|
|
1157
|
+
min: f.value.min,
|
|
1158
|
+
max: f.value.max,
|
|
1159
|
+
step: f.value.step
|
|
1154
1160
|
});
|
|
1155
1161
|
S !== void 0 && (y.value = S);
|
|
1156
1162
|
};
|
|
@@ -1159,7 +1165,7 @@ const Vn = { class: "d-flex justify-space-between align-center my-2" }, Cn = { c
|
|
|
1159
1165
|
}), re(y, (k) => {
|
|
1160
1166
|
f.value?.ui === "pixelInput" ? n.value = k + "px" : f.value?.ui === "percentInput" && (n.value = k + "%");
|
|
1161
1167
|
}), (k, S) => {
|
|
1162
|
-
const P =
|
|
1168
|
+
const P = x("v-select"), T = x("v-number-input"), w = x("v-btn"), _ = le("ripple");
|
|
1163
1169
|
return C(), E("div", Vn, [
|
|
1164
1170
|
F("div", Cn, [
|
|
1165
1171
|
ee(D(P, {
|
|
@@ -1169,8 +1175,8 @@ const Vn = { class: "d-flex justify-space-between align-center my-2" }, Cn = { c
|
|
|
1169
1175
|
d
|
|
1170
1176
|
],
|
|
1171
1177
|
density: "compact",
|
|
1172
|
-
items: a.value,
|
|
1173
1178
|
"hide-details": "",
|
|
1179
|
+
items: a.value,
|
|
1174
1180
|
"single-line": ""
|
|
1175
1181
|
}, null, 8, ["modelValue", "items"]), [
|
|
1176
1182
|
[
|
|
@@ -1184,16 +1190,16 @@ const Vn = { class: "d-flex justify-space-between align-center my-2" }, Cn = { c
|
|
|
1184
1190
|
key: 0,
|
|
1185
1191
|
modelValue: y.value,
|
|
1186
1192
|
"onUpdate:modelValue": S[1] || (S[1] = (M) => y.value = M),
|
|
1187
|
-
density: "compact",
|
|
1188
1193
|
"control-variant": "stacked",
|
|
1189
|
-
|
|
1190
|
-
min: f.value.min,
|
|
1191
|
-
max: f.value.max,
|
|
1192
|
-
step: f.value.step,
|
|
1194
|
+
density: "compact",
|
|
1193
1195
|
"hide-details": "",
|
|
1196
|
+
max: f.value.max,
|
|
1197
|
+
min: f.value.min,
|
|
1198
|
+
precision: f.value.precision,
|
|
1194
1199
|
"single-line": "",
|
|
1200
|
+
step: f.value.step,
|
|
1195
1201
|
"onUpdate:focused": g
|
|
1196
|
-
}, null, 8, ["modelValue", "
|
|
1202
|
+
}, null, 8, ["modelValue", "max", "min", "precision", "step"])), [
|
|
1197
1203
|
[
|
|
1198
1204
|
_,
|
|
1199
1205
|
void 0,
|
|
@@ -1205,9 +1211,9 @@ const Vn = { class: "d-flex justify-space-between align-center my-2" }, Cn = { c
|
|
|
1205
1211
|
k.hasDelete ? (C(), B(w, {
|
|
1206
1212
|
key: 0,
|
|
1207
1213
|
class: "mx-2",
|
|
1208
|
-
variant: "text",
|
|
1209
1214
|
density: "compact",
|
|
1210
1215
|
icon: "mdi-minus",
|
|
1216
|
+
variant: "text",
|
|
1211
1217
|
onClick: S[2] || (S[2] = X((M) => o("delete"), ["stop"]))
|
|
1212
1218
|
})) : G("", !0)
|
|
1213
1219
|
]);
|
|
@@ -1242,7 +1248,7 @@ function Un(l) {
|
|
|
1242
1248
|
types: e.types
|
|
1243
1249
|
}) };
|
|
1244
1250
|
}
|
|
1245
|
-
const
|
|
1251
|
+
const xn = /* @__PURE__ */ R({
|
|
1246
1252
|
__name: "editor",
|
|
1247
1253
|
props: {
|
|
1248
1254
|
modelValue: { required: !0 },
|
|
@@ -1261,21 +1267,21 @@ const $n = /* @__PURE__ */ R({
|
|
|
1261
1267
|
return s({ save: () => {
|
|
1262
1268
|
const d = u.value.save();
|
|
1263
1269
|
t.value = JSON.stringify(d, null, 2);
|
|
1264
|
-
} }), (d, y) => (C(), B(L(
|
|
1270
|
+
} }), (d, y) => (C(), B(L(xt), {
|
|
1265
1271
|
ref_key: "target",
|
|
1266
1272
|
ref: u,
|
|
1267
1273
|
lock: e.value,
|
|
1268
1274
|
"onUpdate:lock": y[0] || (y[0] = (g) => e.value = g),
|
|
1269
1275
|
scale: n.value,
|
|
1270
1276
|
"onUpdate:scale": y[1] || (y[1] = (g) => n.value = g),
|
|
1277
|
+
dark: L(o),
|
|
1278
|
+
locale: L(i),
|
|
1271
1279
|
type: "json",
|
|
1272
1280
|
version: L(r),
|
|
1273
|
-
locale: L(i),
|
|
1274
|
-
dark: L(o),
|
|
1275
1281
|
onReady: a
|
|
1276
|
-
}, null, 8, ["lock", "scale", "
|
|
1282
|
+
}, null, 8, ["lock", "scale", "dark", "locale", "version"]));
|
|
1277
1283
|
}
|
|
1278
|
-
}),
|
|
1284
|
+
}), $n = { class: "text-subtitle-1" }, Pn = /* @__PURE__ */ R({
|
|
1279
1285
|
__name: "index",
|
|
1280
1286
|
props: {
|
|
1281
1287
|
modelValue: { required: !0 },
|
|
@@ -1298,21 +1304,21 @@ const $n = /* @__PURE__ */ R({
|
|
|
1298
1304
|
return re(d, (g) => {
|
|
1299
1305
|
g || y.value?.save();
|
|
1300
1306
|
}), (g, k) => {
|
|
1301
|
-
const S =
|
|
1307
|
+
const S = x("v-btn"), P = x("v-sheet"), T = x("v-spacer"), w = x("v-dialog");
|
|
1302
1308
|
return C(), B(w, {
|
|
1303
1309
|
modelValue: L(d),
|
|
1304
1310
|
"onUpdate:modelValue": k[4] || (k[4] = (_) => ve(d) ? d.value = _ : null),
|
|
1305
|
-
transition: "dialog-bottom-transition",
|
|
1306
|
-
persistent: "",
|
|
1307
|
-
"no-click-animation": "",
|
|
1308
|
-
fullscreen: "",
|
|
1309
1311
|
attach: "",
|
|
1312
|
+
fullscreen: "",
|
|
1313
|
+
"no-click-animation": "",
|
|
1314
|
+
persistent: "",
|
|
1315
|
+
transition: "dialog-bottom-transition",
|
|
1310
1316
|
onKeydown: k[5] || (k[5] = Ke(X((_) => d.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
1311
1317
|
}, {
|
|
1312
1318
|
activator: J(({ props: _ }) => [
|
|
1313
1319
|
D(S, be(_, {
|
|
1314
|
-
|
|
1315
|
-
|
|
1320
|
+
block: "",
|
|
1321
|
+
density: "comfortable"
|
|
1316
1322
|
}), {
|
|
1317
1323
|
default: J(() => [
|
|
1318
1324
|
Ce(W(f.value), 1)
|
|
@@ -1323,8 +1329,8 @@ const $n = /* @__PURE__ */ R({
|
|
|
1323
1329
|
default: J(() => [
|
|
1324
1330
|
D(P, {
|
|
1325
1331
|
color: L(e),
|
|
1326
|
-
|
|
1327
|
-
|
|
1332
|
+
height: "100%",
|
|
1333
|
+
width: "100%"
|
|
1328
1334
|
}, {
|
|
1329
1335
|
default: J(() => [
|
|
1330
1336
|
L(t) ? (C(), B(P, {
|
|
@@ -1339,12 +1345,12 @@ const $n = /* @__PURE__ */ R({
|
|
|
1339
1345
|
}, {
|
|
1340
1346
|
default: J(() => [
|
|
1341
1347
|
D(S, {
|
|
1342
|
-
variant: "text",
|
|
1343
1348
|
density: "comfortable",
|
|
1344
1349
|
icon: "mdi-close",
|
|
1350
|
+
variant: "text",
|
|
1345
1351
|
onClick: k[0] || (k[0] = (_) => d.value = !1)
|
|
1346
1352
|
}),
|
|
1347
|
-
F("span",
|
|
1353
|
+
F("span", $n, W(L(s)("x-prop-tree.dlg.jsonObject.title")), 1),
|
|
1348
1354
|
D(T)
|
|
1349
1355
|
]),
|
|
1350
1356
|
_: 1
|
|
@@ -1352,7 +1358,7 @@ const $n = /* @__PURE__ */ R({
|
|
|
1352
1358
|
F("div", {
|
|
1353
1359
|
style: I(a.value)
|
|
1354
1360
|
}, [
|
|
1355
|
-
D(
|
|
1361
|
+
D(xn, {
|
|
1356
1362
|
ref_key: "editor",
|
|
1357
1363
|
ref: y,
|
|
1358
1364
|
modelValue: i.value,
|
|
@@ -1442,17 +1448,17 @@ const wn = /* @__PURE__ */ R({
|
|
|
1442
1448
|
Et(S);
|
|
1443
1449
|
const P = () => {
|
|
1444
1450
|
const { compGroups: v, comps: c } = St.app.activeApp, p = [];
|
|
1445
|
-
v.forEach(({ id: m, name: V, position:
|
|
1451
|
+
v.forEach(({ id: m, name: V, position: $ }) => {
|
|
1446
1452
|
const A = S.value.find((Z) => Z.id === m);
|
|
1447
1453
|
p.push({
|
|
1448
1454
|
id: m,
|
|
1449
1455
|
type: 0,
|
|
1450
1456
|
name: V,
|
|
1451
|
-
position:
|
|
1457
|
+
position: $,
|
|
1452
1458
|
collapse: A?.collapse ?? !0
|
|
1453
1459
|
});
|
|
1454
|
-
}), c.forEach(({ id: m, groupid: V, name:
|
|
1455
|
-
p.push({ id: m, type: 1, name:
|
|
1460
|
+
}), c.forEach(({ id: m, groupid: V, name: $, position: A }) => {
|
|
1461
|
+
p.push({ id: m, type: 1, name: $, position: A, group: V });
|
|
1456
1462
|
}), kt(p, !0), S.value = p;
|
|
1457
1463
|
};
|
|
1458
1464
|
let T;
|
|
@@ -1468,14 +1474,14 @@ const wn = /* @__PURE__ */ R({
|
|
|
1468
1474
|
}), pt(() => {
|
|
1469
1475
|
_();
|
|
1470
1476
|
});
|
|
1471
|
-
const { renderProp: M } = zt(f, r, u), { renderUiDummy: N } = Gt(d), { renderUiStrInput: Q } = Qt(d), { renderUiNumInput: Pe } = It(d), { renderUiSwitch: je } = nn(d), { renderUiSelect: Ie } = sn(d), { renderUiColorPicker: et } = kn(d), { renderUiJsonEditor: tt } = Mn(d), { renderUiMultiTypes: nt } = Un(d), { renderUiCompSelect: lt } = gn(d), ye = (v, c, p, m, V,
|
|
1477
|
+
const { renderProp: M } = zt(f, r, u), { renderUiDummy: N } = Gt(d), { renderUiStrInput: Q } = Qt(d), { renderUiNumInput: Pe } = It(d), { renderUiSwitch: je } = nn(d), { renderUiSelect: Ie } = sn(d), { renderUiColorPicker: et } = kn(d), { renderUiJsonEditor: tt } = Mn(d), { renderUiMultiTypes: nt } = Un(d), { renderUiCompSelect: lt } = gn(d), ye = (v, c, p, m, V, $) => (v = Ee(v), V !== void 0 ? (v.push(V), $ && v.push(c.key)) : v.push(c.key), c.ui ? c.array && m ? it(v, c, p, m, V, $) : rt(v, c, p, V, $) : c.array ? ot(v, c, p, m, V, $) : st(
|
|
1472
1478
|
v,
|
|
1473
1479
|
c,
|
|
1474
1480
|
p,
|
|
1475
1481
|
m,
|
|
1476
1482
|
V,
|
|
1477
|
-
|
|
1478
|
-
)), ot = (v, c, p, m, V,
|
|
1483
|
+
$
|
|
1484
|
+
)), ot = (v, c, p, m, V, $) => {
|
|
1479
1485
|
if (c.ui)
|
|
1480
1486
|
return console.assert(!1), h("div", "renderBranchArray prop ui must be invalid");
|
|
1481
1487
|
if (!c.array)
|
|
@@ -1483,7 +1489,7 @@ const wn = /* @__PURE__ */ R({
|
|
|
1483
1489
|
if (!m)
|
|
1484
1490
|
return console.assert(!1), h("div", "renderBranchArray branch must be valid");
|
|
1485
1491
|
let A;
|
|
1486
|
-
V !== void 0 &&
|
|
1492
|
+
V !== void 0 && !$ ? (p[V] instanceof Array || (p[V] = q(c), d(v, p[c.key])), A = p[V]) : (p[c.key] instanceof Array || (p[c.key] = q(c), d(v, p[c.key])), A = p[c.key]);
|
|
1487
1493
|
let Z = t(c.name);
|
|
1488
1494
|
m.collapse && ae(f.value, v) && (Z += " *");
|
|
1489
1495
|
const fe = h(ke, {
|
|
@@ -1591,7 +1597,7 @@ const wn = /* @__PURE__ */ R({
|
|
|
1591
1597
|
return U.push(fe), m.collapse || U.push(H), U;
|
|
1592
1598
|
})()
|
|
1593
1599
|
);
|
|
1594
|
-
}, st = (v, c, p, m, V,
|
|
1600
|
+
}, st = (v, c, p, m, V, $) => {
|
|
1595
1601
|
if (c.ui)
|
|
1596
1602
|
return console.assert(!1), h("div", "renderBranchScalar prop ui must be invalid");
|
|
1597
1603
|
if (c.array)
|
|
@@ -1603,7 +1609,7 @@ const wn = /* @__PURE__ */ R({
|
|
|
1603
1609
|
const Z = h(ke, {
|
|
1604
1610
|
title: A,
|
|
1605
1611
|
collapse: m.collapse,
|
|
1606
|
-
hasDelete: V !== void 0 &&
|
|
1612
|
+
hasDelete: V !== void 0 && !$,
|
|
1607
1613
|
onCollapse: (H) => {
|
|
1608
1614
|
m.collapse = H;
|
|
1609
1615
|
},
|
|
@@ -1611,7 +1617,7 @@ const wn = /* @__PURE__ */ R({
|
|
|
1611
1617
|
ue.emit("propTreeMenu", { x: H, y: U, keys: v });
|
|
1612
1618
|
},
|
|
1613
1619
|
onDelete: () => {
|
|
1614
|
-
V === void 0 ||
|
|
1620
|
+
V === void 0 || $ || (p.splice(V, 1), d(v.slice(0, -1), p));
|
|
1615
1621
|
}
|
|
1616
1622
|
}), fe = h(
|
|
1617
1623
|
"div",
|
|
@@ -1653,7 +1659,7 @@ const wn = /* @__PURE__ */ R({
|
|
|
1653
1659
|
return H.push(Z), m.collapse || H.push(fe), H;
|
|
1654
1660
|
})()
|
|
1655
1661
|
);
|
|
1656
|
-
}, it = (v, c, p, m, V,
|
|
1662
|
+
}, it = (v, c, p, m, V, $) => {
|
|
1657
1663
|
if (!c.ui)
|
|
1658
1664
|
return console.assert(!1), h("div", "renderLeafArray prop ui must be valid");
|
|
1659
1665
|
if (!c.array)
|
|
@@ -1661,7 +1667,7 @@ const wn = /* @__PURE__ */ R({
|
|
|
1661
1667
|
if (!m)
|
|
1662
1668
|
return console.assert(!1), h("div", "renderLeafArray branch must be valid");
|
|
1663
1669
|
let A;
|
|
1664
|
-
V !== void 0 &&
|
|
1670
|
+
V !== void 0 && !$ ? (p[V] instanceof Array || (p[V] = q(c), d(v, p[V])), A = p[V]) : (p[c.key] instanceof Array || (p[c.key] = q(c), d(v, p[c.key])), A = p[c.key]);
|
|
1665
1671
|
let Z = t(c.name);
|
|
1666
1672
|
m.collapse && ae(f.value, v) && (Z += " *");
|
|
1667
1673
|
const fe = h(ke, {
|
|
@@ -1708,8 +1714,8 @@ const wn = /* @__PURE__ */ R({
|
|
|
1708
1714
|
}, rt = (v, c, p, m, V) => {
|
|
1709
1715
|
if (!c.ui)
|
|
1710
1716
|
return console.assert(!1), h("div", "renderLeafScalar prop ui must be valid");
|
|
1711
|
-
let
|
|
1712
|
-
return c.ui === "dummy" ?
|
|
1717
|
+
let $;
|
|
1718
|
+
return c.ui === "dummy" ? $ = N(v, c, p, m, V) : c.ui === "strInput" ? $ = Q(v, c, p, m, V) : c.ui === "numInput" ? $ = Pe(v, c, p, m, V) : c.ui === "switch" ? $ = je(v, c, p, m, V) : c.ui === "select" ? $ = Ie(v, c, p, m, V) : c.ui === "colorPicker" ? $ = et(v, c, p, m, V) : c.ui === "jsonEditor" ? $ = tt(v, c, p, m, V) : c.ui === "multiTypes" ? $ = nt(v, c, p, m, V) : c.ui === "compSelect" ? $ = lt(v, c, p, m, V) : console.assert(!1, "renderLeafScalar not implemented"), $ ? M(v, c, $) : h("div");
|
|
1713
1719
|
}, ut = () => h(
|
|
1714
1720
|
"div",
|
|
1715
1721
|
{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-prop-tree",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -24,20 +24,20 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"lodash-es": "^4.17.21",
|
|
26
26
|
"vue": "^3.5.17",
|
|
27
|
-
"vue-i18n": "^11.1.
|
|
27
|
+
"vue-i18n": "^11.1.10",
|
|
28
28
|
"vuetify": "^3.9.0",
|
|
29
|
-
"x-block-lib": "^0.7.
|
|
30
|
-
"x-essential-lib": "^0.8.
|
|
29
|
+
"x-block-lib": "^0.7.8",
|
|
30
|
+
"x-essential-lib": "^0.8.22",
|
|
31
31
|
"x-group-list": "^0.4.3",
|
|
32
32
|
"x-runtime-lib": "^0.7.15",
|
|
33
33
|
"x-state-lib": "^0.3.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@eslint/js": "^9.
|
|
36
|
+
"@eslint/js": "^9.31.0",
|
|
37
37
|
"@types/lodash-es": "^4.17.12",
|
|
38
|
-
"@types/node": "^24.0.
|
|
38
|
+
"@types/node": "^24.0.14",
|
|
39
39
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
40
|
-
"eslint": "^9.
|
|
40
|
+
"eslint": "^9.31.0",
|
|
41
41
|
"eslint-config-prettier": "^10.1.5",
|
|
42
42
|
"eslint-plugin-prettier": "^5.5.1",
|
|
43
43
|
"eslint-plugin-vue": "^10.3.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"prettier": "3.6.2",
|
|
48
48
|
"sass": "^1.89.2",
|
|
49
49
|
"typescript": "^5.8.3",
|
|
50
|
-
"typescript-eslint": "^8.
|
|
51
|
-
"vite": "^7.0.
|
|
50
|
+
"typescript-eslint": "^8.37.0",
|
|
51
|
+
"vite": "^7.0.4",
|
|
52
52
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
53
53
|
"vite-plugin-vuetify": "^2.1.1",
|
|
54
54
|
"vue-eslint-parser": "^10.2.0",
|