@stonecrop/desktop 0.6.0 → 0.6.2
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/desktop.css +1 -1
- package/dist/desktop.js +807 -824
- package/dist/desktop.js.map +1 -1
- package/dist/desktop.umd.cjs +25 -33
- package/dist/desktop.umd.cjs.map +1 -1
- package/package.json +5 -5
- package/src/components/ActionSet.vue +1 -1
- package/src/components/SheetNav.vue +135 -114
package/dist/desktop.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { defineComponent as be, ref as
|
|
2
|
-
const xt = { class: "action-menu-icon" },
|
|
1
|
+
import { defineComponent as be, ref as R, onMounted as Te, createElementBlock as B, openBlock as F, normalizeClass as Ne, createElementVNode as j, Fragment as ge, renderList as me, createCommentVNode as fe, toDisplayString as Q, withDirectives as ke, vShow as Be, useTemplateRef as lt, computed as T, watch as H, nextTick as oe, createBlock as Ke, Teleport as Et, createVNode as se, Transition as Ot, withCtx as ye, withModifiers as ct, vModelText as ut, renderSlot as Ae, createTextVNode as De, inject as He, provide as Ue, toRaw as dt, isRef as le, isReactive as xe, toRef as ie, hasInjectionContext as Nt, getCurrentInstance as pt, reactive as kt, markRaw as de, effectScope as Dt, getCurrentScope as Je, onScopeDispose as Ge, toRefs as Xe, shallowRef as qe, toValue as ee, readonly as Ze, customRef as vt, unref as Ee, watchEffect as Rt, resolveDynamicComponent as Ct, mergeProps as It, resolveComponent as Tt, withKeys as ue, normalizeStyle as Pe } from "vue";
|
|
2
|
+
const xt = { class: "action-menu-icon" }, At = ["disabled", "onClick"], Pt = { key: 1 }, Vt = ["onClick"], jt = { class: "dropdown-container" }, Ft = { class: "dropdown" }, Lt = ["onClick"], Mt = ["href"], Bt = { class: "dropdown-item" }, Ht = /* @__PURE__ */ be({
|
|
3
3
|
__name: "ActionSet",
|
|
4
4
|
props: {
|
|
5
5
|
elements: { default: () => [] }
|
|
6
6
|
},
|
|
7
7
|
emits: ["actionClick"],
|
|
8
8
|
setup(o, { emit: e }) {
|
|
9
|
-
const t = e, n =
|
|
10
|
-
|
|
9
|
+
const t = e, n = R({}), r = R(!1), i = R(-1), a = R(!1), l = R(!1);
|
|
10
|
+
Te(() => {
|
|
11
11
|
s();
|
|
12
12
|
});
|
|
13
13
|
const s = () => {
|
|
14
14
|
n.value = {};
|
|
15
15
|
}, c = () => {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
a.value = !0, i.value = setTimeout(() => {
|
|
17
|
+
a.value && (r.value = !0);
|
|
18
18
|
}, 500);
|
|
19
19
|
}, p = () => {
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
const
|
|
23
|
-
s(),
|
|
24
|
-
},
|
|
25
|
-
t("actionClick",
|
|
20
|
+
a.value = !1, l.value = !1, clearTimeout(i.value), r.value = !1;
|
|
21
|
+
}, w = (k) => {
|
|
22
|
+
const O = !n.value[k];
|
|
23
|
+
s(), O && (n.value[k] = !0);
|
|
24
|
+
}, S = (k, O) => {
|
|
25
|
+
t("actionClick", O, k);
|
|
26
26
|
};
|
|
27
|
-
return (
|
|
28
|
-
class:
|
|
27
|
+
return (k, O) => (F(), B("div", {
|
|
28
|
+
class: Ne([{ "open-set": r.value, "hovered-and-closed": l.value }, "action-set collapse"]),
|
|
29
29
|
onMouseover: c,
|
|
30
30
|
onMouseleave: p
|
|
31
31
|
}, [
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
j("div", xt, [
|
|
33
|
+
j("div", {
|
|
34
34
|
id: "chevron",
|
|
35
|
-
onClick:
|
|
36
|
-
}, [...
|
|
37
|
-
|
|
35
|
+
onClick: O[0] || (O[0] = (N) => l.value = !l.value)
|
|
36
|
+
}, [...O[1] || (O[1] = [
|
|
37
|
+
j("svg", {
|
|
38
38
|
id: "Layer_1",
|
|
39
39
|
class: "leftBar",
|
|
40
40
|
version: "1.1",
|
|
@@ -47,9 +47,9 @@ const xt = { class: "action-menu-icon" }, Tt = ["disabled", "onClick"], At = { k
|
|
|
47
47
|
width: "50",
|
|
48
48
|
height: "50"
|
|
49
49
|
}, [
|
|
50
|
-
|
|
50
|
+
j("polygon", { points: "54.2,33.4 29.2,58.8 25,54.6 50,29.2 " })
|
|
51
51
|
], -1),
|
|
52
|
-
|
|
52
|
+
j("svg", {
|
|
53
53
|
id: "Layer_1",
|
|
54
54
|
class: "rightBar",
|
|
55
55
|
version: "1.1",
|
|
@@ -62,62 +62,62 @@ const xt = { class: "action-menu-icon" }, Tt = ["disabled", "onClick"], At = { k
|
|
|
62
62
|
width: "50",
|
|
63
63
|
height: "50"
|
|
64
64
|
}, [
|
|
65
|
-
|
|
65
|
+
j("polygon", { points: "70.8,58.8 45.8,33.4 50,29.2 75,54.6 " })
|
|
66
66
|
], -1)
|
|
67
67
|
])])
|
|
68
68
|
]),
|
|
69
|
-
|
|
70
|
-
(
|
|
71
|
-
key:
|
|
69
|
+
O[2] || (O[2] = j("div", { style: { "margin-right": "30px" } }, null, -1)),
|
|
70
|
+
(F(!0), B(ge, null, me(o.elements, (N, A) => (F(), B("div", {
|
|
71
|
+
key: N.label,
|
|
72
72
|
class: "action-element"
|
|
73
73
|
}, [
|
|
74
|
-
|
|
74
|
+
N.type == "button" ? (F(), B("button", {
|
|
75
75
|
key: 0,
|
|
76
|
-
disabled:
|
|
76
|
+
disabled: N.disabled,
|
|
77
77
|
class: "button-default",
|
|
78
|
-
onClick: (P) =>
|
|
79
|
-
}, Q(
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
onClick: (P) => S(N.action, N.label)
|
|
79
|
+
}, Q(N.label), 9, At)) : fe("", !0),
|
|
80
|
+
N.type == "dropdown" ? (F(), B("div", Pt, [
|
|
81
|
+
j("button", {
|
|
82
82
|
class: "button-default",
|
|
83
|
-
onClick: (P) =>
|
|
84
|
-
}, Q(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(
|
|
83
|
+
onClick: (P) => w(A)
|
|
84
|
+
}, Q(N.label), 9, Vt),
|
|
85
|
+
ke(j("div", jt, [
|
|
86
|
+
j("div", Ft, [
|
|
87
|
+
(F(!0), B(ge, null, me(N.actions, (P, x) => (F(), B("div", {
|
|
88
88
|
key: P.label
|
|
89
89
|
}, [
|
|
90
|
-
P.action != null ? (
|
|
90
|
+
P.action != null ? (F(), B("button", {
|
|
91
91
|
key: 0,
|
|
92
92
|
class: "dropdown-item",
|
|
93
|
-
onClick: (
|
|
94
|
-
}, Q(P.label), 9, Lt)) : P.link != null ? (
|
|
93
|
+
onClick: (W) => S(P.action, P.label)
|
|
94
|
+
}, Q(P.label), 9, Lt)) : P.link != null ? (F(), B("a", {
|
|
95
95
|
key: 1,
|
|
96
96
|
href: P.link
|
|
97
97
|
}, [
|
|
98
|
-
|
|
99
|
-
], 8,
|
|
98
|
+
j("button", Bt, Q(P.label), 1)
|
|
99
|
+
], 8, Mt)) : fe("", !0)
|
|
100
100
|
]))), 128))
|
|
101
101
|
])
|
|
102
102
|
], 512), [
|
|
103
|
-
[
|
|
103
|
+
[Be, n.value[A]]
|
|
104
104
|
])
|
|
105
105
|
])) : fe("", !0)
|
|
106
106
|
]))), 128))
|
|
107
107
|
], 34));
|
|
108
108
|
}
|
|
109
|
-
}),
|
|
109
|
+
}), ft = (o, e) => {
|
|
110
110
|
const t = o.__vccOpts || o;
|
|
111
|
-
for (const [n,
|
|
112
|
-
t[n] =
|
|
111
|
+
for (const [n, r] of e)
|
|
112
|
+
t[n] = r;
|
|
113
113
|
return t;
|
|
114
|
-
},
|
|
114
|
+
}, ht = /* @__PURE__ */ ft(Ht, [["__scopeId", "data-v-eb01c863"]]), Ut = { class: "command-palette-header" }, Wt = ["placeholder"], zt = {
|
|
115
115
|
key: 0,
|
|
116
116
|
class: "command-palette-results"
|
|
117
|
-
},
|
|
117
|
+
}, Kt = ["onClick", "onMouseover"], Jt = { class: "result-title" }, Gt = { class: "result-content" }, qt = {
|
|
118
118
|
key: 1,
|
|
119
119
|
class: "command-palette-no-results"
|
|
120
|
-
},
|
|
120
|
+
}, gt = /* @__PURE__ */ be({
|
|
121
121
|
__name: "CommandPalette",
|
|
122
122
|
props: {
|
|
123
123
|
search: { type: Function },
|
|
@@ -127,14 +127,14 @@ const xt = { class: "action-menu-icon" }, Tt = ["disabled", "onClick"], At = { k
|
|
|
127
127
|
},
|
|
128
128
|
emits: ["select", "close"],
|
|
129
129
|
setup(o, { emit: e }) {
|
|
130
|
-
const t = e, n =
|
|
130
|
+
const t = e, n = R(""), r = R(0), i = lt("input"), a = T(() => n.value ? o.search(n.value).slice(0, o.maxResults) : []);
|
|
131
131
|
H(
|
|
132
132
|
() => o.isOpen,
|
|
133
133
|
async (p) => {
|
|
134
|
-
p && (n.value = "",
|
|
134
|
+
p && (n.value = "", r.value = 0, await oe(), i.value?.focus());
|
|
135
135
|
}
|
|
136
|
-
), H(
|
|
137
|
-
|
|
136
|
+
), H(a, () => {
|
|
137
|
+
r.value = 0;
|
|
138
138
|
});
|
|
139
139
|
const l = () => {
|
|
140
140
|
t("close");
|
|
@@ -144,61 +144,61 @@ const xt = { class: "action-menu-icon" }, Tt = ["disabled", "onClick"], At = { k
|
|
|
144
144
|
l();
|
|
145
145
|
break;
|
|
146
146
|
case "ArrowDown":
|
|
147
|
-
p.preventDefault(),
|
|
147
|
+
p.preventDefault(), a.value.length && (r.value = (r.value + 1) % a.value.length);
|
|
148
148
|
break;
|
|
149
149
|
case "ArrowUp":
|
|
150
|
-
p.preventDefault(),
|
|
150
|
+
p.preventDefault(), a.value.length && (r.value = (r.value - 1 + a.value.length) % a.value.length);
|
|
151
151
|
break;
|
|
152
152
|
case "Enter":
|
|
153
|
-
|
|
153
|
+
a.value.length && r.value >= 0 && c(a.value[r.value]);
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
156
|
}, c = (p) => {
|
|
157
157
|
t("select", p), l();
|
|
158
158
|
};
|
|
159
|
-
return (p,
|
|
160
|
-
se(
|
|
161
|
-
default:
|
|
162
|
-
o.isOpen ? (
|
|
159
|
+
return (p, w) => (F(), Ke(Et, { to: "body" }, [
|
|
160
|
+
se(Ot, { name: "fade" }, {
|
|
161
|
+
default: ye(() => [
|
|
162
|
+
o.isOpen ? (F(), B("div", {
|
|
163
163
|
key: 0,
|
|
164
164
|
class: "command-palette-overlay",
|
|
165
165
|
onClick: l
|
|
166
166
|
}, [
|
|
167
|
-
|
|
167
|
+
j("div", {
|
|
168
168
|
class: "command-palette",
|
|
169
|
-
onClick:
|
|
169
|
+
onClick: w[1] || (w[1] = ct(() => {
|
|
170
170
|
}, ["stop"]))
|
|
171
171
|
}, [
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
j("div", Ut, [
|
|
173
|
+
ke(j("input", {
|
|
174
174
|
ref: "input",
|
|
175
|
-
"onUpdate:modelValue":
|
|
175
|
+
"onUpdate:modelValue": w[0] || (w[0] = (S) => n.value = S),
|
|
176
176
|
type: "text",
|
|
177
177
|
class: "command-palette-input",
|
|
178
178
|
placeholder: o.placeholder,
|
|
179
179
|
autofocus: "",
|
|
180
180
|
onKeydown: s
|
|
181
|
-
}, null, 40,
|
|
182
|
-
[
|
|
181
|
+
}, null, 40, Wt), [
|
|
182
|
+
[ut, n.value]
|
|
183
183
|
])
|
|
184
184
|
]),
|
|
185
|
-
|
|
186
|
-
(
|
|
187
|
-
key:
|
|
188
|
-
class:
|
|
189
|
-
onClick: (
|
|
190
|
-
onMouseover: (
|
|
185
|
+
a.value.length ? (F(), B("div", zt, [
|
|
186
|
+
(F(!0), B(ge, null, me(a.value, (S, k) => (F(), B("div", {
|
|
187
|
+
key: k,
|
|
188
|
+
class: Ne(["command-palette-result", { selected: k === r.value }]),
|
|
189
|
+
onClick: (O) => c(S),
|
|
190
|
+
onMouseover: (O) => r.value = k
|
|
191
191
|
}, [
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
j("div", Jt, [
|
|
193
|
+
Ae(p.$slots, "title", { result: S })
|
|
194
194
|
]),
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
j("div", Gt, [
|
|
196
|
+
Ae(p.$slots, "content", { result: S })
|
|
197
197
|
])
|
|
198
|
-
], 42,
|
|
199
|
-
])) : n.value && !
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
], 42, Kt))), 128))
|
|
199
|
+
])) : n.value && !a.value.length ? (F(), B("div", qt, [
|
|
200
|
+
Ae(p.$slots, "empty", {}, () => [
|
|
201
|
+
De(' No results found for "' + Q(n.value) + '" ', 1)
|
|
202
202
|
])
|
|
203
203
|
])) : fe("", !0)
|
|
204
204
|
])
|
|
@@ -215,7 +215,7 @@ const xt = { class: "action-menu-icon" }, Tt = ["disabled", "onClick"], At = { k
|
|
|
215
215
|
* @license MIT
|
|
216
216
|
*/
|
|
217
217
|
let pe;
|
|
218
|
-
const
|
|
218
|
+
const Re = (o) => pe = o, Zt = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
|
|
219
219
|
/* istanbul ignore next */
|
|
220
220
|
Symbol()
|
|
221
221
|
);
|
|
@@ -227,230 +227,230 @@ var he;
|
|
|
227
227
|
o.direct = "direct", o.patchObject = "patch object", o.patchFunction = "patch function";
|
|
228
228
|
})(he || (he = {}));
|
|
229
229
|
const ve = typeof window < "u";
|
|
230
|
-
function
|
|
230
|
+
function mt(o, e) {
|
|
231
231
|
for (const t in e) {
|
|
232
232
|
const n = e[t];
|
|
233
233
|
if (!(t in o))
|
|
234
234
|
continue;
|
|
235
|
-
const
|
|
236
|
-
ne(
|
|
235
|
+
const r = o[t];
|
|
236
|
+
ne(r) && ne(n) && !le(n) && !xe(n) ? o[t] = mt(r, n) : o[t] = n;
|
|
237
237
|
}
|
|
238
238
|
return o;
|
|
239
239
|
}
|
|
240
|
-
const
|
|
240
|
+
const yt = () => {
|
|
241
241
|
};
|
|
242
|
-
function
|
|
242
|
+
function Qe(o, e, t, n = yt) {
|
|
243
243
|
o.push(e);
|
|
244
|
-
const
|
|
244
|
+
const r = () => {
|
|
245
245
|
const i = o.indexOf(e);
|
|
246
246
|
i > -1 && (o.splice(i, 1), n());
|
|
247
247
|
};
|
|
248
|
-
return !t &&
|
|
248
|
+
return !t && Je() && Ge(r), r;
|
|
249
249
|
}
|
|
250
250
|
function ae(o, ...e) {
|
|
251
251
|
o.slice().forEach((t) => {
|
|
252
252
|
t(...e);
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
const
|
|
256
|
-
function
|
|
255
|
+
const Yt = (o) => o(), et = Symbol(), Ve = Symbol();
|
|
256
|
+
function We(o, e) {
|
|
257
257
|
o instanceof Map && e instanceof Map ? e.forEach((t, n) => o.set(n, t)) : o instanceof Set && e instanceof Set && e.forEach(o.add, o);
|
|
258
258
|
for (const t in e) {
|
|
259
259
|
if (!e.hasOwnProperty(t))
|
|
260
260
|
continue;
|
|
261
|
-
const n = e[t],
|
|
262
|
-
ne(
|
|
261
|
+
const n = e[t], r = o[t];
|
|
262
|
+
ne(r) && ne(n) && o.hasOwnProperty(t) && !le(n) && !xe(n) ? o[t] = We(r, n) : o[t] = n;
|
|
263
263
|
}
|
|
264
264
|
return o;
|
|
265
265
|
}
|
|
266
|
-
const
|
|
266
|
+
const Xt = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
|
|
267
267
|
/* istanbul ignore next */
|
|
268
268
|
Symbol()
|
|
269
269
|
);
|
|
270
|
-
function
|
|
271
|
-
return !ne(o) || !Object.prototype.hasOwnProperty.call(o,
|
|
270
|
+
function Qt(o) {
|
|
271
|
+
return !ne(o) || !Object.prototype.hasOwnProperty.call(o, Xt);
|
|
272
272
|
}
|
|
273
273
|
const { assign: Z } = Object;
|
|
274
|
-
function
|
|
274
|
+
function tt(o) {
|
|
275
275
|
return !!(le(o) && o.effect);
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
const { state:
|
|
277
|
+
function ot(o, e, t, n) {
|
|
278
|
+
const { state: r, actions: i, getters: a } = e, l = t.state.value[o];
|
|
279
279
|
let s;
|
|
280
280
|
function c() {
|
|
281
|
-
!l && (process.env.NODE_ENV === "production" || !n) && (t.state.value[o] =
|
|
281
|
+
!l && (process.env.NODE_ENV === "production" || !n) && (t.state.value[o] = r ? r() : {});
|
|
282
282
|
const p = process.env.NODE_ENV !== "production" && n ? (
|
|
283
283
|
// use ref() to unwrap refs inside state TODO: check if this is still necessary
|
|
284
|
-
|
|
285
|
-
) :
|
|
286
|
-
return Z(p, i, Object.keys(
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
return
|
|
290
|
-
})),
|
|
291
|
-
}
|
|
292
|
-
return s =
|
|
284
|
+
Xe(R(r ? r() : {}).value)
|
|
285
|
+
) : Xe(t.state.value[o]);
|
|
286
|
+
return Z(p, i, Object.keys(a || {}).reduce((w, S) => (process.env.NODE_ENV !== "production" && S in p && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${S}" in store "${o}".`), w[S] = de(T(() => {
|
|
287
|
+
Re(t);
|
|
288
|
+
const k = t._s.get(o);
|
|
289
|
+
return a[S].call(k, k);
|
|
290
|
+
})), w), {}));
|
|
291
|
+
}
|
|
292
|
+
return s = ze(o, c, e, t, n, !0), s;
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
let
|
|
294
|
+
function ze(o, e, t = {}, n, r, i) {
|
|
295
|
+
let a;
|
|
296
296
|
const l = Z({ actions: {} }, t);
|
|
297
297
|
if (process.env.NODE_ENV !== "production" && !n._e.active)
|
|
298
298
|
throw new Error("Pinia destroyed");
|
|
299
299
|
const s = { deep: !0 };
|
|
300
300
|
process.env.NODE_ENV !== "production" && (s.onTrigger = (m) => {
|
|
301
|
-
c ?
|
|
301
|
+
c ? k = m : c == !1 && !_._hotUpdating && (Array.isArray(k) ? k.push(m) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
|
|
302
302
|
});
|
|
303
|
-
let c, p,
|
|
304
|
-
const
|
|
305
|
-
!i && !
|
|
306
|
-
const
|
|
307
|
-
let
|
|
303
|
+
let c, p, w = [], S = [], k;
|
|
304
|
+
const O = n.state.value[o];
|
|
305
|
+
!i && !O && (process.env.NODE_ENV === "production" || !r) && (n.state.value[o] = {});
|
|
306
|
+
const N = R({});
|
|
307
|
+
let A;
|
|
308
308
|
function P(m) {
|
|
309
309
|
let v;
|
|
310
|
-
c = p = !1, process.env.NODE_ENV !== "production" && (
|
|
310
|
+
c = p = !1, process.env.NODE_ENV !== "production" && (k = []), typeof m == "function" ? (m(n.state.value[o]), v = {
|
|
311
311
|
type: he.patchFunction,
|
|
312
312
|
storeId: o,
|
|
313
|
-
events:
|
|
314
|
-
}) : (
|
|
313
|
+
events: k
|
|
314
|
+
}) : (We(n.state.value[o], m), v = {
|
|
315
315
|
type: he.patchObject,
|
|
316
316
|
payload: m,
|
|
317
317
|
storeId: o,
|
|
318
|
-
events:
|
|
318
|
+
events: k
|
|
319
319
|
});
|
|
320
|
-
const
|
|
320
|
+
const C = A = Symbol();
|
|
321
321
|
oe().then(() => {
|
|
322
|
-
|
|
323
|
-
}), p = !0, ae(
|
|
322
|
+
A === C && (c = !0);
|
|
323
|
+
}), p = !0, ae(w, v, n.state.value[o]);
|
|
324
324
|
}
|
|
325
|
-
const
|
|
325
|
+
const x = i ? function() {
|
|
326
326
|
const { state: m } = t, v = m ? m() : {};
|
|
327
|
-
this.$patch((
|
|
328
|
-
Z(
|
|
327
|
+
this.$patch((C) => {
|
|
328
|
+
Z(C, v);
|
|
329
329
|
});
|
|
330
330
|
} : (
|
|
331
331
|
/* istanbul ignore next */
|
|
332
332
|
process.env.NODE_ENV !== "production" ? () => {
|
|
333
333
|
throw new Error(`🍍: Store "${o}" is built using the setup syntax and does not implement $reset().`);
|
|
334
|
-
} :
|
|
334
|
+
} : yt
|
|
335
335
|
);
|
|
336
|
-
function
|
|
337
|
-
|
|
336
|
+
function W() {
|
|
337
|
+
a.stop(), w = [], S = [], n._s.delete(o);
|
|
338
338
|
}
|
|
339
339
|
const J = (m, v = "") => {
|
|
340
|
-
if (
|
|
341
|
-
return m[
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
const
|
|
345
|
-
function $(
|
|
346
|
-
|
|
340
|
+
if (et in m)
|
|
341
|
+
return m[Ve] = v, m;
|
|
342
|
+
const C = function() {
|
|
343
|
+
Re(n);
|
|
344
|
+
const L = Array.from(arguments), E = [], h = [];
|
|
345
|
+
function $(M) {
|
|
346
|
+
E.push(M);
|
|
347
347
|
}
|
|
348
|
-
function D(
|
|
349
|
-
h.push(
|
|
348
|
+
function D(M) {
|
|
349
|
+
h.push(M);
|
|
350
350
|
}
|
|
351
|
-
ae(
|
|
352
|
-
args:
|
|
353
|
-
name:
|
|
354
|
-
store:
|
|
351
|
+
ae(S, {
|
|
352
|
+
args: L,
|
|
353
|
+
name: C[Ve],
|
|
354
|
+
store: _,
|
|
355
355
|
after: $,
|
|
356
356
|
onError: D
|
|
357
357
|
});
|
|
358
|
-
let
|
|
358
|
+
let V;
|
|
359
359
|
try {
|
|
360
|
-
|
|
361
|
-
} catch (
|
|
362
|
-
throw ae(h,
|
|
360
|
+
V = m.apply(this && this.$id === o ? this : _, L);
|
|
361
|
+
} catch (M) {
|
|
362
|
+
throw ae(h, M), M;
|
|
363
363
|
}
|
|
364
|
-
return
|
|
364
|
+
return V instanceof Promise ? V.then((M) => (ae(E, M), M)).catch((M) => (ae(h, M), Promise.reject(M))) : (ae(E, V), V);
|
|
365
365
|
};
|
|
366
|
-
return
|
|
366
|
+
return C[et] = !0, C[Ve] = v, C;
|
|
367
367
|
}, K = /* @__PURE__ */ de({
|
|
368
368
|
actions: {},
|
|
369
369
|
getters: {},
|
|
370
370
|
state: [],
|
|
371
|
-
hotState:
|
|
372
|
-
}),
|
|
371
|
+
hotState: N
|
|
372
|
+
}), z = {
|
|
373
373
|
_p: n,
|
|
374
374
|
// _s: scope,
|
|
375
375
|
$id: o,
|
|
376
|
-
$onAction:
|
|
376
|
+
$onAction: Qe.bind(null, S),
|
|
377
377
|
$patch: P,
|
|
378
|
-
$reset:
|
|
378
|
+
$reset: x,
|
|
379
379
|
$subscribe(m, v = {}) {
|
|
380
|
-
const
|
|
380
|
+
const C = Qe(w, m, v.detached, () => L()), L = a.run(() => H(() => n.state.value[o], (E) => {
|
|
381
381
|
(v.flush === "sync" ? p : c) && m({
|
|
382
382
|
storeId: o,
|
|
383
383
|
type: he.direct,
|
|
384
|
-
events:
|
|
385
|
-
},
|
|
384
|
+
events: k
|
|
385
|
+
}, E);
|
|
386
386
|
}, Z({}, s, v)));
|
|
387
|
-
return
|
|
387
|
+
return C;
|
|
388
388
|
},
|
|
389
|
-
$dispose:
|
|
390
|
-
},
|
|
389
|
+
$dispose: W
|
|
390
|
+
}, _ = kt(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ve ? Z(
|
|
391
391
|
{
|
|
392
392
|
_hmrPayload: K,
|
|
393
393
|
_customProperties: de(/* @__PURE__ */ new Set())
|
|
394
394
|
// devtools custom properties
|
|
395
395
|
},
|
|
396
|
-
|
|
396
|
+
z
|
|
397
397
|
// must be added later
|
|
398
398
|
// setupStore
|
|
399
|
-
) :
|
|
400
|
-
n._s.set(o,
|
|
401
|
-
const U = (n._a && n._a.runWithContext ||
|
|
399
|
+
) : z);
|
|
400
|
+
n._s.set(o, _);
|
|
401
|
+
const U = (n._a && n._a.runWithContext || Yt)(() => n._e.run(() => (a = Dt()).run(() => e({ action: J }))));
|
|
402
402
|
for (const m in U) {
|
|
403
403
|
const v = U[m];
|
|
404
|
-
if (le(v) && !
|
|
405
|
-
process.env.NODE_ENV !== "production" &&
|
|
404
|
+
if (le(v) && !tt(v) || xe(v))
|
|
405
|
+
process.env.NODE_ENV !== "production" && r ? N.value[m] = ie(U, m) : i || (O && Qt(v) && (le(v) ? v.value = O[m] : We(v, O[m])), n.state.value[o][m] = v), process.env.NODE_ENV !== "production" && K.state.push(m);
|
|
406
406
|
else if (typeof v == "function") {
|
|
407
|
-
const
|
|
408
|
-
U[m] =
|
|
409
|
-
} else process.env.NODE_ENV !== "production" &&
|
|
407
|
+
const C = process.env.NODE_ENV !== "production" && r ? v : J(v, m);
|
|
408
|
+
U[m] = C, process.env.NODE_ENV !== "production" && (K.actions[m] = v), l.actions[m] = v;
|
|
409
|
+
} else process.env.NODE_ENV !== "production" && tt(v) && (K.getters[m] = i ? (
|
|
410
410
|
// @ts-expect-error
|
|
411
411
|
t.getters[m]
|
|
412
412
|
) : v, ve && (U._getters || // @ts-expect-error: same
|
|
413
413
|
(U._getters = de([]))).push(m));
|
|
414
414
|
}
|
|
415
|
-
if (Z(
|
|
416
|
-
get: () => process.env.NODE_ENV !== "production" &&
|
|
415
|
+
if (Z(_, U), Z(dt(_), U), Object.defineProperty(_, "$state", {
|
|
416
|
+
get: () => process.env.NODE_ENV !== "production" && r ? N.value : n.state.value[o],
|
|
417
417
|
set: (m) => {
|
|
418
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
418
|
+
if (process.env.NODE_ENV !== "production" && r)
|
|
419
419
|
throw new Error("cannot set hotState");
|
|
420
420
|
P((v) => {
|
|
421
421
|
Z(v, m);
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
|
-
}), process.env.NODE_ENV !== "production" && (
|
|
425
|
-
|
|
426
|
-
if (v in
|
|
427
|
-
const
|
|
428
|
-
typeof
|
|
424
|
+
}), process.env.NODE_ENV !== "production" && (_._hotUpdate = de((m) => {
|
|
425
|
+
_._hotUpdating = !0, m._hmrPayload.state.forEach((v) => {
|
|
426
|
+
if (v in _.$state) {
|
|
427
|
+
const C = m.$state[v], L = _.$state[v];
|
|
428
|
+
typeof C == "object" && ne(C) && ne(L) ? mt(C, L) : m.$state[v] = L;
|
|
429
429
|
}
|
|
430
|
-
|
|
431
|
-
}), Object.keys(
|
|
432
|
-
v in m.$state || delete
|
|
430
|
+
_[v] = ie(m.$state, v);
|
|
431
|
+
}), Object.keys(_.$state).forEach((v) => {
|
|
432
|
+
v in m.$state || delete _[v];
|
|
433
433
|
}), c = !1, p = !1, n.state.value[o] = ie(m._hmrPayload, "hotState"), p = !0, oe().then(() => {
|
|
434
434
|
c = !0;
|
|
435
435
|
});
|
|
436
436
|
for (const v in m._hmrPayload.actions) {
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
-
J(
|
|
437
|
+
const C = m[v];
|
|
438
|
+
_[v] = //
|
|
439
|
+
J(C, v);
|
|
440
440
|
}
|
|
441
441
|
for (const v in m._hmrPayload.getters) {
|
|
442
|
-
const
|
|
442
|
+
const C = m._hmrPayload.getters[v], L = i ? (
|
|
443
443
|
// special handling of options api
|
|
444
|
-
T(() => (
|
|
445
|
-
) :
|
|
446
|
-
|
|
447
|
-
|
|
444
|
+
T(() => (Re(n), C.call(_, _)))
|
|
445
|
+
) : C;
|
|
446
|
+
_[v] = //
|
|
447
|
+
L;
|
|
448
448
|
}
|
|
449
|
-
Object.keys(
|
|
450
|
-
v in m._hmrPayload.getters || delete
|
|
451
|
-
}), Object.keys(
|
|
452
|
-
v in m._hmrPayload.actions || delete
|
|
453
|
-
}),
|
|
449
|
+
Object.keys(_._hmrPayload.getters).forEach((v) => {
|
|
450
|
+
v in m._hmrPayload.getters || delete _[v];
|
|
451
|
+
}), Object.keys(_._hmrPayload.actions).forEach((v) => {
|
|
452
|
+
v in m._hmrPayload.actions || delete _[v];
|
|
453
|
+
}), _._hmrPayload = m._hmrPayload, _._getters = m._getters, _._hotUpdating = !1;
|
|
454
454
|
})), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ve) {
|
|
455
455
|
const m = {
|
|
456
456
|
writable: !0,
|
|
@@ -459,194 +459,194 @@ function He(o, e, t = {}, n, a, i) {
|
|
|
459
459
|
enumerable: !1
|
|
460
460
|
};
|
|
461
461
|
["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((v) => {
|
|
462
|
-
Object.defineProperty(
|
|
462
|
+
Object.defineProperty(_, v, Z({ value: _[v] }, m));
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
465
|
return n._p.forEach((m) => {
|
|
466
466
|
if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ve) {
|
|
467
|
-
const v =
|
|
468
|
-
store:
|
|
467
|
+
const v = a.run(() => m({
|
|
468
|
+
store: _,
|
|
469
469
|
app: n._a,
|
|
470
470
|
pinia: n,
|
|
471
471
|
options: l
|
|
472
472
|
}));
|
|
473
|
-
Object.keys(v || {}).forEach((
|
|
473
|
+
Object.keys(v || {}).forEach((C) => _._customProperties.add(C)), Z(_, v);
|
|
474
474
|
} else
|
|
475
|
-
Z(
|
|
476
|
-
store:
|
|
475
|
+
Z(_, a.run(() => m({
|
|
476
|
+
store: _,
|
|
477
477
|
app: n._a,
|
|
478
478
|
pinia: n,
|
|
479
479
|
options: l
|
|
480
480
|
})));
|
|
481
|
-
}), process.env.NODE_ENV !== "production" &&
|
|
481
|
+
}), process.env.NODE_ENV !== "production" && _.$state && typeof _.$state == "object" && typeof _.$state.constructor == "function" && !_.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
482
482
|
state: () => new MyClass()
|
|
483
|
-
Found in store "${
|
|
483
|
+
Found in store "${_.$id}".`), O && i && t.hydrate && t.hydrate(_.$state, O), c = !0, p = !0, _;
|
|
484
484
|
}
|
|
485
485
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
486
486
|
// @__NO_SIDE_EFFECTS__
|
|
487
|
-
function
|
|
487
|
+
function eo(o, e, t) {
|
|
488
488
|
let n;
|
|
489
|
-
const
|
|
490
|
-
n =
|
|
491
|
-
function i(
|
|
492
|
-
const s =
|
|
493
|
-
if (
|
|
489
|
+
const r = typeof e == "function";
|
|
490
|
+
n = r ? t : e;
|
|
491
|
+
function i(a, l) {
|
|
492
|
+
const s = Nt();
|
|
493
|
+
if (a = // in test mode, ignore the argument provided as we can always retrieve a
|
|
494
494
|
// pinia instance with getActivePinia()
|
|
495
|
-
(process.env.NODE_ENV === "test" && pe && pe._testing ? null :
|
|
495
|
+
(process.env.NODE_ENV === "test" && pe && pe._testing ? null : a) || (s ? He(Zt, null) : null), a && Re(a), process.env.NODE_ENV !== "production" && !pe)
|
|
496
496
|
throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
497
497
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
498
498
|
This will fail in production.`);
|
|
499
|
-
|
|
500
|
-
const c =
|
|
499
|
+
a = pe, a._s.has(o) || (r ? ze(o, e, n, a) : ot(o, n, a), process.env.NODE_ENV !== "production" && (i._pinia = a));
|
|
500
|
+
const c = a._s.get(o);
|
|
501
501
|
if (process.env.NODE_ENV !== "production" && l) {
|
|
502
|
-
const p = "__hot:" + o,
|
|
503
|
-
l._hotUpdate(
|
|
502
|
+
const p = "__hot:" + o, w = r ? ze(p, e, n, a, !0) : ot(p, Z({}, n), a, !0);
|
|
503
|
+
l._hotUpdate(w), delete a.state.value[p], a._s.delete(p);
|
|
504
504
|
}
|
|
505
505
|
if (process.env.NODE_ENV !== "production" && ve) {
|
|
506
|
-
const p =
|
|
506
|
+
const p = pt();
|
|
507
507
|
if (p && p.proxy && // avoid adding stores that are just built for hot module replacement
|
|
508
508
|
!l) {
|
|
509
|
-
const
|
|
510
|
-
|
|
509
|
+
const w = p.proxy, S = "_pStores" in w ? w._pStores : w._pStores = {};
|
|
510
|
+
S[o] = c;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
return c;
|
|
514
514
|
}
|
|
515
515
|
return i.$id = o, i;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
const e =
|
|
517
|
+
function to(o) {
|
|
518
|
+
const e = dt(o), t = {};
|
|
519
519
|
for (const n in e) {
|
|
520
|
-
const
|
|
521
|
-
|
|
520
|
+
const r = e[n];
|
|
521
|
+
r.effect ? t[n] = // ...
|
|
522
522
|
T({
|
|
523
523
|
get: () => o[n],
|
|
524
524
|
set(i) {
|
|
525
525
|
o[n] = i;
|
|
526
526
|
}
|
|
527
|
-
}) : (le(
|
|
527
|
+
}) : (le(r) || xe(r)) && (t[n] = // ---
|
|
528
528
|
ie(o, n));
|
|
529
529
|
}
|
|
530
530
|
return t;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
return
|
|
532
|
+
function oo(o, e) {
|
|
533
|
+
return Je() ? (Ge(o, e), !0) : !1;
|
|
534
534
|
}
|
|
535
|
-
const
|
|
535
|
+
const no = typeof window < "u" && typeof document < "u";
|
|
536
536
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
537
|
-
const
|
|
537
|
+
const ao = Object.prototype.toString, ro = (o) => ao.call(o) === "[object Object]", so = () => {
|
|
538
538
|
};
|
|
539
|
-
function
|
|
539
|
+
function io(...o) {
|
|
540
540
|
if (o.length !== 1) return ie(...o);
|
|
541
541
|
const e = o[0];
|
|
542
|
-
return typeof e == "function" ?
|
|
542
|
+
return typeof e == "function" ? Ze(vt(() => ({
|
|
543
543
|
get: e,
|
|
544
|
-
set:
|
|
545
|
-
}))) :
|
|
544
|
+
set: so
|
|
545
|
+
}))) : R(e);
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function lo(o, e) {
|
|
548
548
|
function t(...n) {
|
|
549
|
-
return new Promise((
|
|
549
|
+
return new Promise((r, i) => {
|
|
550
550
|
Promise.resolve(o(() => e.apply(this, n), {
|
|
551
551
|
fn: e,
|
|
552
552
|
thisArg: this,
|
|
553
553
|
args: n
|
|
554
|
-
})).then(
|
|
554
|
+
})).then(r).catch(i);
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
return t;
|
|
558
558
|
}
|
|
559
|
-
const
|
|
560
|
-
function
|
|
561
|
-
const { initialState: t = "active" } = e, n =
|
|
562
|
-
function
|
|
559
|
+
const bt = (o) => o();
|
|
560
|
+
function co(o = bt, e = {}) {
|
|
561
|
+
const { initialState: t = "active" } = e, n = io(t === "active");
|
|
562
|
+
function r() {
|
|
563
563
|
n.value = !1;
|
|
564
564
|
}
|
|
565
565
|
function i() {
|
|
566
566
|
n.value = !0;
|
|
567
567
|
}
|
|
568
|
-
const
|
|
568
|
+
const a = (...l) => {
|
|
569
569
|
n.value && o(...l);
|
|
570
570
|
};
|
|
571
571
|
return {
|
|
572
|
-
isActive:
|
|
573
|
-
pause:
|
|
572
|
+
isActive: Ze(n),
|
|
573
|
+
pause: r,
|
|
574
574
|
resume: i,
|
|
575
|
-
eventFilter:
|
|
575
|
+
eventFilter: a
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function je(o) {
|
|
579
579
|
return Array.isArray(o) ? o : [o];
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
return
|
|
583
|
-
}
|
|
584
|
-
function uo(o, e, t = {}) {
|
|
585
|
-
const { eventFilter: n = mt, ...a } = t;
|
|
586
|
-
return H(o, io(n, e), a);
|
|
581
|
+
function uo(o) {
|
|
582
|
+
return pt();
|
|
587
583
|
}
|
|
588
584
|
function po(o, e, t = {}) {
|
|
589
|
-
const { eventFilter: n
|
|
585
|
+
const { eventFilter: n = bt, ...r } = t;
|
|
586
|
+
return H(o, lo(n, e), r);
|
|
587
|
+
}
|
|
588
|
+
function vo(o, e, t = {}) {
|
|
589
|
+
const { eventFilter: n, initialState: r = "active", ...i } = t, { eventFilter: a, pause: l, resume: s, isActive: c } = co(n, { initialState: r });
|
|
590
590
|
return {
|
|
591
|
-
stop:
|
|
591
|
+
stop: po(o, e, {
|
|
592
592
|
...i,
|
|
593
|
-
eventFilter:
|
|
593
|
+
eventFilter: a
|
|
594
594
|
}),
|
|
595
595
|
pause: l,
|
|
596
596
|
resume: s,
|
|
597
597
|
isActive: c
|
|
598
598
|
};
|
|
599
599
|
}
|
|
600
|
-
const
|
|
601
|
-
function
|
|
602
|
-
|
|
600
|
+
const fo = vo;
|
|
601
|
+
function ho(o, e = !0, t) {
|
|
602
|
+
uo() ? Te(o, t) : e ? o() : oe(o);
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function go(o, e, t) {
|
|
605
605
|
return H(o, e, {
|
|
606
606
|
...t,
|
|
607
607
|
immediate: !0
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
|
-
const Ce =
|
|
611
|
-
function
|
|
610
|
+
const Ce = no ? window : void 0;
|
|
611
|
+
function mo(o) {
|
|
612
612
|
var e;
|
|
613
613
|
const t = ee(o);
|
|
614
614
|
return (e = t?.$el) !== null && e !== void 0 ? e : t;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function nt(...o) {
|
|
617
617
|
const e = [], t = () => {
|
|
618
618
|
e.forEach((l) => l()), e.length = 0;
|
|
619
|
-
}, n = (l, s, c, p) => (l.addEventListener(s, c, p), () => l.removeEventListener(s, c, p)),
|
|
620
|
-
const l =
|
|
619
|
+
}, n = (l, s, c, p) => (l.addEventListener(s, c, p), () => l.removeEventListener(s, c, p)), r = T(() => {
|
|
620
|
+
const l = je(ee(o[0])).filter((s) => s != null);
|
|
621
621
|
return l.every((s) => typeof s != "string") ? l : void 0;
|
|
622
|
-
}), i =
|
|
622
|
+
}), i = go(() => {
|
|
623
623
|
var l, s;
|
|
624
624
|
return [
|
|
625
|
-
(l = (s =
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
ee(
|
|
625
|
+
(l = (s = r.value) === null || s === void 0 ? void 0 : s.map((c) => mo(c))) !== null && l !== void 0 ? l : [Ce].filter((c) => c != null),
|
|
626
|
+
je(ee(r.value ? o[1] : o[0])),
|
|
627
|
+
je(Ee(r.value ? o[2] : o[1])),
|
|
628
|
+
ee(r.value ? o[3] : o[2])
|
|
629
629
|
];
|
|
630
630
|
}, ([l, s, c, p]) => {
|
|
631
631
|
if (t(), !l?.length || !s?.length || !c?.length) return;
|
|
632
|
-
const
|
|
633
|
-
e.push(...l.flatMap((
|
|
634
|
-
}, { flush: "post" }),
|
|
632
|
+
const w = ro(p) ? { ...p } : p;
|
|
633
|
+
e.push(...l.flatMap((S) => s.flatMap((k) => c.map((O) => n(S, k, O, w)))));
|
|
634
|
+
}, { flush: "post" }), a = () => {
|
|
635
635
|
i(), t();
|
|
636
636
|
};
|
|
637
|
-
return
|
|
637
|
+
return oo(t), a;
|
|
638
638
|
}
|
|
639
|
-
const
|
|
640
|
-
function
|
|
641
|
-
return
|
|
639
|
+
const we = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Se = "__vueuse_ssr_handlers__", yo = /* @__PURE__ */ bo();
|
|
640
|
+
function bo() {
|
|
641
|
+
return Se in we || (we[Se] = we[Se] || {}), we[Se];
|
|
642
642
|
}
|
|
643
643
|
function wo(o, e) {
|
|
644
|
-
return
|
|
644
|
+
return yo[o] || e;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function So(o) {
|
|
647
647
|
return o == null ? "any" : o instanceof Set ? "set" : o instanceof Map ? "map" : o instanceof Date ? "date" : typeof o == "boolean" ? "boolean" : typeof o == "string" ? "string" : typeof o == "object" ? "object" : Number.isNaN(o) ? "any" : "number";
|
|
648
648
|
}
|
|
649
|
-
const
|
|
649
|
+
const $o = {
|
|
650
650
|
boolean: {
|
|
651
651
|
read: (o) => o === "true",
|
|
652
652
|
write: (o) => String(o)
|
|
@@ -679,101 +679,101 @@ const So = {
|
|
|
679
679
|
read: (o) => new Date(o),
|
|
680
680
|
write: (o) => o.toISOString()
|
|
681
681
|
}
|
|
682
|
-
},
|
|
683
|
-
function
|
|
684
|
-
var
|
|
685
|
-
const { flush: i = "pre", deep:
|
|
682
|
+
}, at = "vueuse-storage";
|
|
683
|
+
function _o(o, e, t, n = {}) {
|
|
684
|
+
var r;
|
|
685
|
+
const { flush: i = "pre", deep: a = !0, listenToStorageChanges: l = !0, writeDefaults: s = !0, mergeDefaults: c = !1, shallow: p, window: w = Ce, eventFilter: S, onError: k = (h) => {
|
|
686
686
|
console.error(h);
|
|
687
|
-
}, initOnMounted:
|
|
687
|
+
}, initOnMounted: O } = n, N = (p ? qe : R)(e), A = T(() => ee(o));
|
|
688
688
|
if (!t) try {
|
|
689
689
|
t = wo("getDefaultStorage", () => Ce?.localStorage)();
|
|
690
690
|
} catch (h) {
|
|
691
|
-
|
|
691
|
+
k(h);
|
|
692
692
|
}
|
|
693
|
-
if (!t) return
|
|
694
|
-
const P = ee(e),
|
|
693
|
+
if (!t) return N;
|
|
694
|
+
const P = ee(e), x = So(P), W = (r = n.serializer) !== null && r !== void 0 ? r : $o[x], { pause: J, resume: K } = fo(N, (h) => v(h), {
|
|
695
695
|
flush: i,
|
|
696
|
-
deep:
|
|
697
|
-
eventFilter:
|
|
696
|
+
deep: a,
|
|
697
|
+
eventFilter: S
|
|
698
698
|
});
|
|
699
|
-
H(
|
|
700
|
-
let
|
|
701
|
-
const
|
|
702
|
-
|
|
699
|
+
H(A, () => L(), { flush: i });
|
|
700
|
+
let z = !1;
|
|
701
|
+
const _ = (h) => {
|
|
702
|
+
O && !z || L(h);
|
|
703
703
|
}, U = (h) => {
|
|
704
|
-
|
|
704
|
+
O && !z || E(h);
|
|
705
705
|
};
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
}) :
|
|
706
|
+
w && l && (t instanceof Storage ? nt(w, "storage", _, { passive: !0 }) : nt(w, at, U)), O ? ho(() => {
|
|
707
|
+
z = !0, L();
|
|
708
|
+
}) : L();
|
|
709
709
|
function m(h, $) {
|
|
710
|
-
if (
|
|
710
|
+
if (w) {
|
|
711
711
|
const D = {
|
|
712
|
-
key:
|
|
712
|
+
key: A.value,
|
|
713
713
|
oldValue: h,
|
|
714
714
|
newValue: $,
|
|
715
715
|
storageArea: t
|
|
716
716
|
};
|
|
717
|
-
|
|
717
|
+
w.dispatchEvent(t instanceof Storage ? new StorageEvent("storage", D) : new CustomEvent(at, { detail: D }));
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
function v(h) {
|
|
721
721
|
try {
|
|
722
|
-
const $ = t.getItem(
|
|
722
|
+
const $ = t.getItem(A.value);
|
|
723
723
|
if (h == null)
|
|
724
|
-
m($, null), t.removeItem(
|
|
724
|
+
m($, null), t.removeItem(A.value);
|
|
725
725
|
else {
|
|
726
|
-
const D =
|
|
727
|
-
$ !== D && (t.setItem(
|
|
726
|
+
const D = W.write(h);
|
|
727
|
+
$ !== D && (t.setItem(A.value, D), m($, D));
|
|
728
728
|
}
|
|
729
729
|
} catch ($) {
|
|
730
|
-
|
|
730
|
+
k($);
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
const $ = h ? h.newValue : t.getItem(
|
|
733
|
+
function C(h) {
|
|
734
|
+
const $ = h ? h.newValue : t.getItem(A.value);
|
|
735
735
|
if ($ == null)
|
|
736
|
-
return s && P != null && t.setItem(
|
|
736
|
+
return s && P != null && t.setItem(A.value, W.write(P)), P;
|
|
737
737
|
if (!h && c) {
|
|
738
|
-
const D =
|
|
739
|
-
return typeof c == "function" ? c(D, P) :
|
|
738
|
+
const D = W.read($);
|
|
739
|
+
return typeof c == "function" ? c(D, P) : x === "object" && !Array.isArray(D) ? {
|
|
740
740
|
...P,
|
|
741
741
|
...D
|
|
742
742
|
} : D;
|
|
743
|
-
} else return typeof $ != "string" ? $ :
|
|
743
|
+
} else return typeof $ != "string" ? $ : W.read($);
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function L(h) {
|
|
746
746
|
if (!(h && h.storageArea !== t)) {
|
|
747
747
|
if (h && h.key == null) {
|
|
748
|
-
|
|
748
|
+
N.value = P;
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
if (!(h && h.key !==
|
|
751
|
+
if (!(h && h.key !== A.value)) {
|
|
752
752
|
J();
|
|
753
753
|
try {
|
|
754
|
-
const $ =
|
|
755
|
-
(h === void 0 || h?.newValue !== $) && (
|
|
754
|
+
const $ = W.write(N.value);
|
|
755
|
+
(h === void 0 || h?.newValue !== $) && (N.value = C(h));
|
|
756
756
|
} catch ($) {
|
|
757
|
-
|
|
757
|
+
k($);
|
|
758
758
|
} finally {
|
|
759
759
|
h ? oe(K) : K();
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
function
|
|
765
|
-
|
|
764
|
+
function E(h) {
|
|
765
|
+
L(h.detail);
|
|
766
766
|
}
|
|
767
|
-
return
|
|
767
|
+
return N;
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function Eo(o, e, t = {}) {
|
|
770
770
|
const { window: n = Ce } = t;
|
|
771
|
-
return
|
|
771
|
+
return _o(o, e, n?.localStorage, t);
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function Fe() {
|
|
774
774
|
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function $e(o) {
|
|
777
777
|
const e = {
|
|
778
778
|
type: o.type,
|
|
779
779
|
clientId: o.clientId,
|
|
@@ -787,7 +787,7 @@ function Ee(o) {
|
|
|
787
787
|
timestamp: t.timestamp.toISOString()
|
|
788
788
|
}))), e;
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function Oo(o) {
|
|
791
791
|
const e = {
|
|
792
792
|
type: o.type,
|
|
793
793
|
clientId: o.clientId,
|
|
@@ -801,53 +801,53 @@ function Eo(o) {
|
|
|
801
801
|
timestamp: new Date(t.timestamp)
|
|
802
802
|
}))), e;
|
|
803
803
|
}
|
|
804
|
-
const
|
|
805
|
-
const o =
|
|
804
|
+
const wt = /* @__PURE__ */ eo("hst-operation-log", () => {
|
|
805
|
+
const o = R({
|
|
806
806
|
maxOperations: 100,
|
|
807
807
|
enableCrossTabSync: !0,
|
|
808
808
|
autoSyncInterval: 3e4,
|
|
809
809
|
enablePersistence: !1,
|
|
810
810
|
persistenceKeyPrefix: "stonecrop-ops"
|
|
811
|
-
}), e =
|
|
811
|
+
}), e = R([]), t = R(-1), n = R(Fe()), r = R(!1), i = R([]), a = R(null), l = T(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), s = T(() => t.value < e.value.length - 1), c = T(() => {
|
|
812
812
|
let g = 0;
|
|
813
813
|
for (let f = t.value; f >= 0 && e.value[f]?.reversible; f--)
|
|
814
814
|
g++;
|
|
815
815
|
return g;
|
|
816
|
-
}), p = T(() => e.value.length - 1 - t.value),
|
|
816
|
+
}), p = T(() => e.value.length - 1 - t.value), w = T(() => ({
|
|
817
817
|
canUndo: l.value,
|
|
818
818
|
canRedo: s.value,
|
|
819
819
|
undoCount: c.value,
|
|
820
820
|
redoCount: p.value,
|
|
821
821
|
currentIndex: t.value
|
|
822
822
|
}));
|
|
823
|
-
function
|
|
824
|
-
o.value = { ...o.value, ...g }, o.value.enablePersistence && (
|
|
823
|
+
function S(g) {
|
|
824
|
+
o.value = { ...o.value, ...g }, o.value.enablePersistence && (V(), G()), o.value.enableCrossTabSync && C();
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function k(g, f = "user") {
|
|
827
827
|
const y = {
|
|
828
828
|
...g,
|
|
829
|
-
id:
|
|
829
|
+
id: Fe(),
|
|
830
830
|
timestamp: /* @__PURE__ */ new Date(),
|
|
831
831
|
source: f,
|
|
832
832
|
userId: o.value.userId
|
|
833
833
|
};
|
|
834
834
|
if (o.value.operationFilter && !o.value.operationFilter(y))
|
|
835
835
|
return y.id;
|
|
836
|
-
if (
|
|
836
|
+
if (r.value)
|
|
837
837
|
return i.value.push(y), y.id;
|
|
838
838
|
if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(y), t.value++, o.value.maxOperations && e.value.length > o.value.maxOperations) {
|
|
839
839
|
const u = e.value.length - o.value.maxOperations;
|
|
840
840
|
e.value = e.value.slice(u), t.value -= u;
|
|
841
841
|
}
|
|
842
|
-
return o.value.enableCrossTabSync &&
|
|
842
|
+
return o.value.enableCrossTabSync && L(y), y.id;
|
|
843
843
|
}
|
|
844
|
-
function
|
|
845
|
-
|
|
844
|
+
function O() {
|
|
845
|
+
r.value = !0, i.value = [], a.value = Fe();
|
|
846
846
|
}
|
|
847
|
-
function
|
|
848
|
-
if (!
|
|
849
|
-
return
|
|
850
|
-
const f =
|
|
847
|
+
function N(g) {
|
|
848
|
+
if (!r.value || i.value.length === 0)
|
|
849
|
+
return r.value = !1, i.value = [], a.value = null, null;
|
|
850
|
+
const f = a.value, y = i.value.every((b) => b.reversible), u = {
|
|
851
851
|
id: f,
|
|
852
852
|
type: "batch",
|
|
853
853
|
path: "",
|
|
@@ -865,12 +865,12 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
865
865
|
};
|
|
866
866
|
i.value.forEach((b) => {
|
|
867
867
|
b.parentOperationId = f;
|
|
868
|
-
}), e.value.push(...i.value, u), t.value = e.value.length - 1, o.value.enableCrossTabSync &&
|
|
868
|
+
}), e.value.push(...i.value, u), t.value = e.value.length - 1, o.value.enableCrossTabSync && E(i.value, u);
|
|
869
869
|
const d = f;
|
|
870
|
-
return
|
|
870
|
+
return r.value = !1, i.value = [], a.value = null, d;
|
|
871
871
|
}
|
|
872
|
-
function
|
|
873
|
-
|
|
872
|
+
function A() {
|
|
873
|
+
r.value = !1, i.value = [], a.value = null;
|
|
874
874
|
}
|
|
875
875
|
function P(g) {
|
|
876
876
|
if (!l.value) return !1;
|
|
@@ -881,16 +881,16 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
881
881
|
if (f.type === "batch" && f.childOperationIds)
|
|
882
882
|
for (let y = f.childOperationIds.length - 1; y >= 0; y--) {
|
|
883
883
|
const u = f.childOperationIds[y], d = e.value.find((b) => b.id === u);
|
|
884
|
-
d &&
|
|
884
|
+
d && W(d, g);
|
|
885
885
|
}
|
|
886
886
|
else
|
|
887
|
-
|
|
887
|
+
W(f, g);
|
|
888
888
|
return t.value--, o.value.enableCrossTabSync && h(f), !0;
|
|
889
889
|
} catch (y) {
|
|
890
890
|
return typeof console < "u" && console.error("Undo failed:", y), !1;
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function x(g) {
|
|
894
894
|
if (!s.value) return !1;
|
|
895
895
|
const f = e.value[t.value + 1];
|
|
896
896
|
try {
|
|
@@ -906,7 +906,7 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
906
906
|
return typeof console < "u" && console.error("Redo failed:", y), !1;
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function W(g, f) {
|
|
910
910
|
(g.type === "set" || g.type === "delete") && f && typeof f.set == "function" && f.set(g.path, g.beforeValue, "undo");
|
|
911
911
|
}
|
|
912
912
|
function J(g, f) {
|
|
@@ -924,10 +924,10 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
924
924
|
newestOperation: f.length > 0 ? new Date(Math.max(...f.map((y) => y.getTime()))) : void 0
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function z() {
|
|
928
928
|
e.value = [], t.value = -1;
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function _(g, f) {
|
|
931
931
|
return e.value.filter((y) => y.doctype === g && (f === void 0 || y.recordId === f));
|
|
932
932
|
}
|
|
933
933
|
function U(g, f) {
|
|
@@ -950,18 +950,18 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
950
950
|
actionResult: u,
|
|
951
951
|
actionError: d
|
|
952
952
|
};
|
|
953
|
-
return
|
|
953
|
+
return k(b);
|
|
954
954
|
}
|
|
955
955
|
let v = null;
|
|
956
|
-
function
|
|
956
|
+
function C() {
|
|
957
957
|
typeof window > "u" || !window.BroadcastChannel || (v = new BroadcastChannel("stonecrop-operation-log"), v.addEventListener("message", (g) => {
|
|
958
958
|
const f = g.data;
|
|
959
959
|
if (!f || typeof f != "object") return;
|
|
960
|
-
const y =
|
|
960
|
+
const y = Oo(f);
|
|
961
961
|
y.clientId !== n.value && (y.type === "operation" && y.operation ? (e.value.push({ ...y.operation, source: "sync" }), t.value = e.value.length - 1) : y.type === "operation" && y.operations && (e.value.push(...y.operations.map((u) => ({ ...u, source: "sync" }))), t.value = e.value.length - 1));
|
|
962
962
|
}));
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function L(g) {
|
|
965
965
|
if (!v) return;
|
|
966
966
|
const f = {
|
|
967
967
|
type: "operation",
|
|
@@ -969,9 +969,9 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
969
969
|
clientId: n.value,
|
|
970
970
|
timestamp: /* @__PURE__ */ new Date()
|
|
971
971
|
};
|
|
972
|
-
v.postMessage(
|
|
972
|
+
v.postMessage($e(f));
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function E(g, f) {
|
|
975
975
|
if (!v) return;
|
|
976
976
|
const y = {
|
|
977
977
|
type: "operation",
|
|
@@ -979,7 +979,7 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
979
979
|
clientId: n.value,
|
|
980
980
|
timestamp: /* @__PURE__ */ new Date()
|
|
981
981
|
};
|
|
982
|
-
v.postMessage(
|
|
982
|
+
v.postMessage($e(y));
|
|
983
983
|
}
|
|
984
984
|
function h(g) {
|
|
985
985
|
if (!v) return;
|
|
@@ -989,7 +989,7 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
989
989
|
clientId: n.value,
|
|
990
990
|
timestamp: /* @__PURE__ */ new Date()
|
|
991
991
|
};
|
|
992
|
-
v.postMessage(
|
|
992
|
+
v.postMessage($e(f));
|
|
993
993
|
}
|
|
994
994
|
function $(g) {
|
|
995
995
|
if (!v) return;
|
|
@@ -999,9 +999,9 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
999
999
|
clientId: n.value,
|
|
1000
1000
|
timestamp: /* @__PURE__ */ new Date()
|
|
1001
1001
|
};
|
|
1002
|
-
v.postMessage(
|
|
1002
|
+
v.postMessage($e(f));
|
|
1003
1003
|
}
|
|
1004
|
-
const D =
|
|
1004
|
+
const D = Eo("stonecrop-ops-operations", null, {
|
|
1005
1005
|
serializer: {
|
|
1006
1006
|
read: (g) => {
|
|
1007
1007
|
try {
|
|
@@ -1013,7 +1013,7 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
1013
1013
|
write: (g) => g ? JSON.stringify(g) : ""
|
|
1014
1014
|
}
|
|
1015
1015
|
});
|
|
1016
|
-
function
|
|
1016
|
+
function V() {
|
|
1017
1017
|
if (!(typeof window > "u"))
|
|
1018
1018
|
try {
|
|
1019
1019
|
const g = D.value;
|
|
@@ -1025,7 +1025,7 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
1025
1025
|
typeof console < "u" && console.error("Failed to load operations from persistence:", g);
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1028
|
+
function M() {
|
|
1029
1029
|
if (!(typeof window > "u"))
|
|
1030
1030
|
try {
|
|
1031
1031
|
D.value = {
|
|
@@ -1043,7 +1043,7 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
1043
1043
|
H(
|
|
1044
1044
|
[e, t],
|
|
1045
1045
|
() => {
|
|
1046
|
-
o.value.enablePersistence &&
|
|
1046
|
+
o.value.enablePersistence && M();
|
|
1047
1047
|
},
|
|
1048
1048
|
{ deep: !0 }
|
|
1049
1049
|
);
|
|
@@ -1054,28 +1054,28 @@ const yt = /* @__PURE__ */ Qt("hst-operation-log", () => {
|
|
|
1054
1054
|
currentIndex: t,
|
|
1055
1055
|
config: o,
|
|
1056
1056
|
clientId: n,
|
|
1057
|
-
undoRedoState:
|
|
1057
|
+
undoRedoState: w,
|
|
1058
1058
|
// Computed
|
|
1059
1059
|
canUndo: l,
|
|
1060
1060
|
canRedo: s,
|
|
1061
1061
|
undoCount: c,
|
|
1062
1062
|
redoCount: p,
|
|
1063
1063
|
// Methods
|
|
1064
|
-
configure:
|
|
1065
|
-
addOperation:
|
|
1066
|
-
startBatch:
|
|
1067
|
-
commitBatch:
|
|
1068
|
-
cancelBatch:
|
|
1064
|
+
configure: S,
|
|
1065
|
+
addOperation: k,
|
|
1066
|
+
startBatch: O,
|
|
1067
|
+
commitBatch: N,
|
|
1068
|
+
cancelBatch: A,
|
|
1069
1069
|
undo: P,
|
|
1070
|
-
redo:
|
|
1071
|
-
clear:
|
|
1072
|
-
getOperationsFor:
|
|
1070
|
+
redo: x,
|
|
1071
|
+
clear: z,
|
|
1072
|
+
getOperationsFor: _,
|
|
1073
1073
|
getSnapshot: K,
|
|
1074
1074
|
markIrreversible: U,
|
|
1075
1075
|
logAction: m
|
|
1076
1076
|
};
|
|
1077
1077
|
});
|
|
1078
|
-
class
|
|
1078
|
+
let No = class Oe {
|
|
1079
1079
|
/**
|
|
1080
1080
|
* The root FieldTriggerEngine instance
|
|
1081
1081
|
*/
|
|
@@ -1096,9 +1096,9 @@ class ge {
|
|
|
1096
1096
|
* @param options - Configuration options for the field trigger engine
|
|
1097
1097
|
*/
|
|
1098
1098
|
constructor(e = {}) {
|
|
1099
|
-
if (
|
|
1100
|
-
return
|
|
1101
|
-
|
|
1099
|
+
if (Oe._root)
|
|
1100
|
+
return Oe._root;
|
|
1101
|
+
Oe._root = this, this.options = {
|
|
1102
1102
|
defaultTimeout: e.defaultTimeout ?? 5e3,
|
|
1103
1103
|
debug: e.debug ?? !1,
|
|
1104
1104
|
enableRollback: e.enableRollback ?? !0,
|
|
@@ -1144,25 +1144,25 @@ class ge {
|
|
|
1144
1144
|
*/
|
|
1145
1145
|
registerDoctypeActions(e, t) {
|
|
1146
1146
|
if (!t) return;
|
|
1147
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1147
|
+
const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
1148
1148
|
if (typeof t.entrySeq == "function")
|
|
1149
|
-
t.entrySeq().forEach(([i,
|
|
1150
|
-
this.categorizeAction(i,
|
|
1149
|
+
t.entrySeq().forEach(([i, a]) => {
|
|
1150
|
+
this.categorizeAction(i, a, n, r);
|
|
1151
1151
|
});
|
|
1152
1152
|
else if (t instanceof Map)
|
|
1153
|
-
for (const [i,
|
|
1154
|
-
this.categorizeAction(i,
|
|
1155
|
-
else t && typeof t == "object" && Object.entries(t).forEach(([i,
|
|
1156
|
-
this.categorizeAction(i,
|
|
1153
|
+
for (const [i, a] of t)
|
|
1154
|
+
this.categorizeAction(i, a, n, r);
|
|
1155
|
+
else t && typeof t == "object" && Object.entries(t).forEach(([i, a]) => {
|
|
1156
|
+
this.categorizeAction(i, a, n, r);
|
|
1157
1157
|
});
|
|
1158
|
-
this.doctypeActions.set(e, n), this.doctypeTransitions.set(e,
|
|
1158
|
+
this.doctypeActions.set(e, n), this.doctypeTransitions.set(e, r);
|
|
1159
1159
|
}
|
|
1160
1160
|
/**
|
|
1161
1161
|
* Categorize an action as either a field trigger or XState transition
|
|
1162
1162
|
* Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger
|
|
1163
1163
|
*/
|
|
1164
|
-
categorizeAction(e, t, n,
|
|
1165
|
-
this.isTransitionKey(e) ?
|
|
1164
|
+
categorizeAction(e, t, n, r) {
|
|
1165
|
+
this.isTransitionKey(e) ? r.set(e, t) : n.set(e, t);
|
|
1166
1166
|
}
|
|
1167
1167
|
/**
|
|
1168
1168
|
* Determine if a key represents an XState transition
|
|
@@ -1177,7 +1177,7 @@ class ge {
|
|
|
1177
1177
|
* @param options - Execution options (timeout and enableRollback)
|
|
1178
1178
|
*/
|
|
1179
1179
|
async executeFieldTriggers(e, t = {}) {
|
|
1180
|
-
const { doctype: n, fieldname:
|
|
1180
|
+
const { doctype: n, fieldname: r } = e, i = this.findFieldTriggers(n, r);
|
|
1181
1181
|
if (i.length === 0)
|
|
1182
1182
|
return {
|
|
1183
1183
|
path: e.path,
|
|
@@ -1187,49 +1187,49 @@ class ge {
|
|
|
1187
1187
|
stoppedOnError: !1,
|
|
1188
1188
|
rolledBack: !1
|
|
1189
1189
|
};
|
|
1190
|
-
const
|
|
1190
|
+
const a = performance.now(), l = [];
|
|
1191
1191
|
let s = !1, c = !1, p;
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1194
|
-
for (const
|
|
1192
|
+
const w = this.getFieldRollback(n, r), S = t.enableRollback ?? w ?? this.options.enableRollback;
|
|
1193
|
+
S && e.store && (p = this.captureSnapshot(e));
|
|
1194
|
+
for (const N of i)
|
|
1195
1195
|
try {
|
|
1196
|
-
const
|
|
1197
|
-
if (l.push(
|
|
1196
|
+
const A = await this.executeAction(N, e, t.timeout);
|
|
1197
|
+
if (l.push(A), !A.success) {
|
|
1198
1198
|
s = !0;
|
|
1199
1199
|
break;
|
|
1200
1200
|
}
|
|
1201
|
-
} catch (
|
|
1201
|
+
} catch (A) {
|
|
1202
1202
|
const P = {
|
|
1203
1203
|
success: !1,
|
|
1204
|
-
error:
|
|
1204
|
+
error: A instanceof Error ? A : new Error(String(A)),
|
|
1205
1205
|
executionTime: 0,
|
|
1206
|
-
action:
|
|
1206
|
+
action: N
|
|
1207
1207
|
};
|
|
1208
1208
|
l.push(P), s = !0;
|
|
1209
1209
|
break;
|
|
1210
1210
|
}
|
|
1211
|
-
if (
|
|
1211
|
+
if (S && s && p && e.store)
|
|
1212
1212
|
try {
|
|
1213
1213
|
this.restoreSnapshot(e, p), c = !0;
|
|
1214
|
-
} catch (
|
|
1215
|
-
console.error("[FieldTriggers] Rollback failed:",
|
|
1214
|
+
} catch (N) {
|
|
1215
|
+
console.error("[FieldTriggers] Rollback failed:", N);
|
|
1216
1216
|
}
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1219
|
-
for (const
|
|
1217
|
+
const k = performance.now() - a, O = l.filter((N) => !N.success);
|
|
1218
|
+
if (O.length > 0 && this.options.errorHandler)
|
|
1219
|
+
for (const N of O)
|
|
1220
1220
|
try {
|
|
1221
|
-
this.options.errorHandler(
|
|
1222
|
-
} catch (
|
|
1223
|
-
console.error("[FieldTriggers] Error in global error handler:",
|
|
1221
|
+
this.options.errorHandler(N.error, e, N.action);
|
|
1222
|
+
} catch (A) {
|
|
1223
|
+
console.error("[FieldTriggers] Error in global error handler:", A);
|
|
1224
1224
|
}
|
|
1225
1225
|
return {
|
|
1226
1226
|
path: e.path,
|
|
1227
1227
|
actionResults: l,
|
|
1228
|
-
totalExecutionTime:
|
|
1229
|
-
allSucceeded: l.every((
|
|
1228
|
+
totalExecutionTime: k,
|
|
1229
|
+
allSucceeded: l.every((N) => N.success),
|
|
1230
1230
|
stoppedOnError: s,
|
|
1231
1231
|
rolledBack: c,
|
|
1232
|
-
snapshot: this.options.debug &&
|
|
1232
|
+
snapshot: this.options.debug && S ? p : void 0
|
|
1233
1233
|
// Only include snapshot in debug mode if rollback is enabled
|
|
1234
1234
|
};
|
|
1235
1235
|
}
|
|
@@ -1240,14 +1240,14 @@ class ge {
|
|
|
1240
1240
|
* @param options - Execution options (timeout)
|
|
1241
1241
|
*/
|
|
1242
1242
|
async executeTransitionActions(e, t = {}) {
|
|
1243
|
-
const { doctype: n, transition:
|
|
1243
|
+
const { doctype: n, transition: r } = e, i = this.findTransitionActions(n, r);
|
|
1244
1244
|
if (i.length === 0)
|
|
1245
1245
|
return [];
|
|
1246
|
-
const
|
|
1246
|
+
const a = [];
|
|
1247
1247
|
for (const s of i)
|
|
1248
1248
|
try {
|
|
1249
1249
|
const c = await this.executeTransitionAction(s, e, t.timeout);
|
|
1250
|
-
if (
|
|
1250
|
+
if (a.push(c), !c.success)
|
|
1251
1251
|
break;
|
|
1252
1252
|
} catch (c) {
|
|
1253
1253
|
const p = {
|
|
@@ -1255,12 +1255,12 @@ class ge {
|
|
|
1255
1255
|
error: c instanceof Error ? c : new Error(String(c)),
|
|
1256
1256
|
executionTime: 0,
|
|
1257
1257
|
action: s,
|
|
1258
|
-
transition:
|
|
1258
|
+
transition: r
|
|
1259
1259
|
};
|
|
1260
|
-
|
|
1260
|
+
a.push(p);
|
|
1261
1261
|
break;
|
|
1262
1262
|
}
|
|
1263
|
-
const l =
|
|
1263
|
+
const l = a.filter((s) => !s.success);
|
|
1264
1264
|
if (l.length > 0 && this.options.errorHandler)
|
|
1265
1265
|
for (const s of l)
|
|
1266
1266
|
try {
|
|
@@ -1268,7 +1268,7 @@ class ge {
|
|
|
1268
1268
|
} catch (c) {
|
|
1269
1269
|
console.error("[FieldTriggers] Error in global error handler:", c);
|
|
1270
1270
|
}
|
|
1271
|
-
return
|
|
1271
|
+
return a;
|
|
1272
1272
|
}
|
|
1273
1273
|
/**
|
|
1274
1274
|
* Find transition actions for a specific doctype and transition
|
|
@@ -1281,26 +1281,26 @@ class ge {
|
|
|
1281
1281
|
* Execute a single transition action by name
|
|
1282
1282
|
*/
|
|
1283
1283
|
async executeTransitionAction(e, t, n) {
|
|
1284
|
-
const
|
|
1284
|
+
const r = performance.now(), i = n ?? this.options.defaultTimeout;
|
|
1285
1285
|
try {
|
|
1286
|
-
let
|
|
1287
|
-
if (!
|
|
1286
|
+
let a = this.globalTransitionActions.get(e);
|
|
1287
|
+
if (!a) {
|
|
1288
1288
|
const l = this.globalActions.get(e);
|
|
1289
|
-
l && (
|
|
1289
|
+
l && (a = l);
|
|
1290
1290
|
}
|
|
1291
|
-
if (!
|
|
1291
|
+
if (!a)
|
|
1292
1292
|
throw new Error(`Transition action "${e}" not found in registry`);
|
|
1293
|
-
return await this.executeWithTimeout(
|
|
1293
|
+
return await this.executeWithTimeout(a, t, i), {
|
|
1294
1294
|
success: !0,
|
|
1295
|
-
executionTime: performance.now() -
|
|
1295
|
+
executionTime: performance.now() - r,
|
|
1296
1296
|
action: e,
|
|
1297
1297
|
transition: t.transition
|
|
1298
1298
|
};
|
|
1299
|
-
} catch (
|
|
1300
|
-
const l = performance.now() -
|
|
1299
|
+
} catch (a) {
|
|
1300
|
+
const l = performance.now() - r;
|
|
1301
1301
|
return {
|
|
1302
1302
|
success: !1,
|
|
1303
|
-
error:
|
|
1303
|
+
error: a instanceof Error ? a : new Error(String(a)),
|
|
1304
1304
|
executionTime: l,
|
|
1305
1305
|
action: e,
|
|
1306
1306
|
transition: t.transition
|
|
@@ -1314,10 +1314,10 @@ class ge {
|
|
|
1314
1314
|
findFieldTriggers(e, t) {
|
|
1315
1315
|
const n = this.doctypeActions.get(e);
|
|
1316
1316
|
if (!n) return [];
|
|
1317
|
-
const
|
|
1318
|
-
for (const [i,
|
|
1319
|
-
this.isFieldTriggerKey(i, t) &&
|
|
1320
|
-
return
|
|
1317
|
+
const r = [];
|
|
1318
|
+
for (const [i, a] of n)
|
|
1319
|
+
this.isFieldTriggerKey(i, t) && r.push(...a);
|
|
1320
|
+
return r;
|
|
1321
1321
|
}
|
|
1322
1322
|
/**
|
|
1323
1323
|
* Determine if an action key represents a field trigger
|
|
@@ -1334,12 +1334,12 @@ class ge {
|
|
|
1334
1334
|
* Supports wildcards (*) for dynamic segments
|
|
1335
1335
|
*/
|
|
1336
1336
|
matchFieldPattern(e, t) {
|
|
1337
|
-
const n = e.split("."),
|
|
1338
|
-
if (n.length !==
|
|
1337
|
+
const n = e.split("."), r = t.split(".");
|
|
1338
|
+
if (n.length !== r.length)
|
|
1339
1339
|
return !1;
|
|
1340
1340
|
for (let i = 0; i < n.length; i++) {
|
|
1341
|
-
const
|
|
1342
|
-
if (
|
|
1341
|
+
const a = n[i], l = r[i];
|
|
1342
|
+
if (a !== "*" && a !== l)
|
|
1343
1343
|
return !1;
|
|
1344
1344
|
}
|
|
1345
1345
|
return !0;
|
|
@@ -1348,21 +1348,21 @@ class ge {
|
|
|
1348
1348
|
* Execute a single action by name
|
|
1349
1349
|
*/
|
|
1350
1350
|
async executeAction(e, t, n) {
|
|
1351
|
-
const
|
|
1351
|
+
const r = performance.now(), i = n ?? this.options.defaultTimeout;
|
|
1352
1352
|
try {
|
|
1353
|
-
const
|
|
1354
|
-
if (!
|
|
1353
|
+
const a = this.globalActions.get(e);
|
|
1354
|
+
if (!a)
|
|
1355
1355
|
throw new Error(`Action "${e}" not found in registry`);
|
|
1356
|
-
return await this.executeWithTimeout(
|
|
1356
|
+
return await this.executeWithTimeout(a, t, i), {
|
|
1357
1357
|
success: !0,
|
|
1358
|
-
executionTime: performance.now() -
|
|
1358
|
+
executionTime: performance.now() - r,
|
|
1359
1359
|
action: e
|
|
1360
1360
|
};
|
|
1361
|
-
} catch (
|
|
1362
|
-
const l = performance.now() -
|
|
1361
|
+
} catch (a) {
|
|
1362
|
+
const l = performance.now() - r;
|
|
1363
1363
|
return {
|
|
1364
1364
|
success: !1,
|
|
1365
|
-
error:
|
|
1365
|
+
error: a instanceof Error ? a : new Error(String(a)),
|
|
1366
1366
|
executionTime: l,
|
|
1367
1367
|
action: e
|
|
1368
1368
|
};
|
|
@@ -1372,14 +1372,14 @@ class ge {
|
|
|
1372
1372
|
* Execute a function with timeout
|
|
1373
1373
|
*/
|
|
1374
1374
|
async executeWithTimeout(e, t, n) {
|
|
1375
|
-
return new Promise((
|
|
1376
|
-
const
|
|
1375
|
+
return new Promise((r, i) => {
|
|
1376
|
+
const a = setTimeout(() => {
|
|
1377
1377
|
i(new Error(`Action timeout after ${n}ms`));
|
|
1378
1378
|
}, n);
|
|
1379
1379
|
Promise.resolve(e(t)).then((l) => {
|
|
1380
|
-
clearTimeout(
|
|
1380
|
+
clearTimeout(a), r(l);
|
|
1381
1381
|
}).catch((l) => {
|
|
1382
|
-
clearTimeout(
|
|
1382
|
+
clearTimeout(a), i(l);
|
|
1383
1383
|
});
|
|
1384
1384
|
});
|
|
1385
1385
|
}
|
|
@@ -1410,13 +1410,13 @@ class ge {
|
|
|
1410
1410
|
throw console.error("[FieldTriggers] Failed to restore snapshot:", n), n;
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
|
+
};
|
|
1414
|
+
function rt(o) {
|
|
1415
|
+
return new No(o);
|
|
1413
1416
|
}
|
|
1414
|
-
function
|
|
1415
|
-
return new ge(o);
|
|
1416
|
-
}
|
|
1417
|
-
function rt() {
|
|
1417
|
+
function st() {
|
|
1418
1418
|
try {
|
|
1419
|
-
return
|
|
1419
|
+
return wt();
|
|
1420
1420
|
} catch {
|
|
1421
1421
|
return null;
|
|
1422
1422
|
}
|
|
@@ -1462,23 +1462,23 @@ class re {
|
|
|
1462
1462
|
return t.registry[e];
|
|
1463
1463
|
}
|
|
1464
1464
|
}
|
|
1465
|
-
class
|
|
1465
|
+
class Ie {
|
|
1466
1466
|
target;
|
|
1467
1467
|
parentPath;
|
|
1468
1468
|
rootNode;
|
|
1469
1469
|
doctype;
|
|
1470
1470
|
parentDoctype;
|
|
1471
1471
|
hst;
|
|
1472
|
-
constructor(e, t, n = "",
|
|
1473
|
-
return this.target = e, this.parentPath = n, this.rootNode =
|
|
1474
|
-
get(
|
|
1475
|
-
if (l in
|
|
1472
|
+
constructor(e, t, n = "", r = null, i) {
|
|
1473
|
+
return this.target = e, this.parentPath = n, this.rootNode = r || this, this.doctype = t, this.parentDoctype = i, this.hst = re.getInstance(), new Proxy(this, {
|
|
1474
|
+
get(a, l) {
|
|
1475
|
+
if (l in a) return a[l];
|
|
1476
1476
|
const s = String(l);
|
|
1477
|
-
return
|
|
1477
|
+
return a.getNode(s);
|
|
1478
1478
|
},
|
|
1479
|
-
set(
|
|
1479
|
+
set(a, l, s) {
|
|
1480
1480
|
const c = String(l);
|
|
1481
|
-
return
|
|
1481
|
+
return a.set(c, s), !0;
|
|
1482
1482
|
}
|
|
1483
1483
|
});
|
|
1484
1484
|
}
|
|
@@ -1487,20 +1487,20 @@ class Re {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
// Method to get a tree-wrapped node for navigation
|
|
1489
1489
|
getNode(e) {
|
|
1490
|
-
const t = this.resolvePath(e), n = this.resolveValue(e),
|
|
1490
|
+
const t = this.resolvePath(e), n = this.resolveValue(e), r = t.split(".");
|
|
1491
1491
|
let i = this.doctype;
|
|
1492
|
-
return this.doctype === "StonecropStore" &&
|
|
1492
|
+
return this.doctype === "StonecropStore" && r.length >= 1 && (i = r[0]), typeof n == "object" && n !== null && !this.isPrimitive(n) ? new Ie(n, i, t, this.rootNode, this.parentDoctype) : new Ie(n, i, t, this.rootNode, this.parentDoctype);
|
|
1493
1493
|
}
|
|
1494
1494
|
set(e, t, n = "user") {
|
|
1495
|
-
const
|
|
1495
|
+
const r = this.resolvePath(e), i = this.has(e) ? this.get(e) : void 0;
|
|
1496
1496
|
if (n !== "undo" && n !== "redo") {
|
|
1497
|
-
const
|
|
1498
|
-
if (
|
|
1499
|
-
const l =
|
|
1500
|
-
|
|
1497
|
+
const a = st();
|
|
1498
|
+
if (a && typeof a.addOperation == "function") {
|
|
1499
|
+
const l = r.split("."), s = this.doctype === "StonecropStore" && l.length >= 1 ? l[0] : this.doctype, c = l.length >= 2 ? l[1] : void 0, p = l.slice(2).join(".") || l[l.length - 1], w = t === void 0 && i !== void 0 ? "delete" : "set";
|
|
1500
|
+
a.addOperation(
|
|
1501
1501
|
{
|
|
1502
|
-
type:
|
|
1503
|
-
path:
|
|
1502
|
+
type: w,
|
|
1503
|
+
path: r,
|
|
1504
1504
|
fieldname: p,
|
|
1505
1505
|
beforeValue: i,
|
|
1506
1506
|
afterValue: t,
|
|
@@ -1513,7 +1513,7 @@ class Re {
|
|
|
1513
1513
|
);
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
|
-
this.updateValue(e, t), this.triggerFieldActions(
|
|
1516
|
+
this.updateValue(e, t), this.triggerFieldActions(r, i, t);
|
|
1517
1517
|
}
|
|
1518
1518
|
has(e) {
|
|
1519
1519
|
try {
|
|
@@ -1521,11 +1521,11 @@ class Re {
|
|
|
1521
1521
|
return !0;
|
|
1522
1522
|
const t = this.parsePath(e);
|
|
1523
1523
|
let n = this.target;
|
|
1524
|
-
for (let
|
|
1525
|
-
const i = t[
|
|
1524
|
+
for (let r = 0; r < t.length; r++) {
|
|
1525
|
+
const i = t[r];
|
|
1526
1526
|
if (n == null)
|
|
1527
1527
|
return !1;
|
|
1528
|
-
if (
|
|
1528
|
+
if (r === t.length - 1)
|
|
1529
1529
|
return this.isImmutable(n) ? n.has(i) : this.isPiniaStore(n) && n.$state && i in n.$state || i in n;
|
|
1530
1530
|
n = this.getProperty(n, i);
|
|
1531
1531
|
}
|
|
@@ -1556,9 +1556,9 @@ class Re {
|
|
|
1556
1556
|
* Trigger an XState transition with optional context data
|
|
1557
1557
|
*/
|
|
1558
1558
|
async triggerTransition(e, t) {
|
|
1559
|
-
const n =
|
|
1560
|
-
let i = this.doctype,
|
|
1561
|
-
this.doctype === "StonecropStore" &&
|
|
1559
|
+
const n = rt(), r = this.parentPath.split(".");
|
|
1560
|
+
let i = this.doctype, a;
|
|
1561
|
+
this.doctype === "StonecropStore" && r.length >= 1 && (i = r[0]), r.length >= 2 && (a = r[1]);
|
|
1562
1562
|
const l = {
|
|
1563
1563
|
path: this.parentPath,
|
|
1564
1564
|
fieldname: "",
|
|
@@ -1567,14 +1567,14 @@ class Re {
|
|
|
1567
1567
|
afterValue: void 0,
|
|
1568
1568
|
operation: "set",
|
|
1569
1569
|
doctype: i,
|
|
1570
|
-
recordId:
|
|
1570
|
+
recordId: a,
|
|
1571
1571
|
timestamp: /* @__PURE__ */ new Date(),
|
|
1572
1572
|
store: this.rootNode || void 0,
|
|
1573
1573
|
transition: e,
|
|
1574
1574
|
currentState: t?.currentState,
|
|
1575
1575
|
targetState: t?.targetState,
|
|
1576
1576
|
fsmContext: t?.fsmContext
|
|
1577
|
-
}, s =
|
|
1577
|
+
}, s = st();
|
|
1578
1578
|
return s && typeof s.addOperation == "function" && s.addOperation(
|
|
1579
1579
|
{
|
|
1580
1580
|
type: "transition",
|
|
@@ -1583,7 +1583,7 @@ class Re {
|
|
|
1583
1583
|
beforeValue: t?.currentState,
|
|
1584
1584
|
afterValue: t?.targetState,
|
|
1585
1585
|
doctype: i,
|
|
1586
|
-
recordId:
|
|
1586
|
+
recordId: a,
|
|
1587
1587
|
reversible: !1,
|
|
1588
1588
|
// FSM transitions are generally not reversible
|
|
1589
1589
|
metadata: {
|
|
@@ -1605,22 +1605,22 @@ class Re {
|
|
|
1605
1605
|
return this.target;
|
|
1606
1606
|
const t = this.parsePath(e);
|
|
1607
1607
|
let n = this.target;
|
|
1608
|
-
for (const
|
|
1608
|
+
for (const r of t) {
|
|
1609
1609
|
if (n == null)
|
|
1610
1610
|
return;
|
|
1611
|
-
n = this.getProperty(n,
|
|
1611
|
+
n = this.getProperty(n, r);
|
|
1612
1612
|
}
|
|
1613
1613
|
return n;
|
|
1614
1614
|
}
|
|
1615
1615
|
updateValue(e, t) {
|
|
1616
1616
|
if (e === "")
|
|
1617
1617
|
throw new Error("Cannot set value on empty path");
|
|
1618
|
-
const n = this.parsePath(e),
|
|
1618
|
+
const n = this.parsePath(e), r = n.pop();
|
|
1619
1619
|
let i = this.target;
|
|
1620
|
-
for (const
|
|
1621
|
-
if (i = this.getProperty(i,
|
|
1620
|
+
for (const a of n)
|
|
1621
|
+
if (i = this.getProperty(i, a), i == null)
|
|
1622
1622
|
throw new Error(`Cannot set property on null/undefined path: ${e}`);
|
|
1623
|
-
this.setProperty(i,
|
|
1623
|
+
this.setProperty(i, r, t);
|
|
1624
1624
|
}
|
|
1625
1625
|
getProperty(e, t) {
|
|
1626
1626
|
return this.isImmutable(e) ? e.get(t) : this.isVueReactive(e) ? e[t] : this.isPiniaStore(e) ? e.$state?.[t] ?? e[t] : e[t];
|
|
@@ -1638,17 +1638,17 @@ class Re {
|
|
|
1638
1638
|
try {
|
|
1639
1639
|
if (!e || typeof e != "string")
|
|
1640
1640
|
return;
|
|
1641
|
-
const
|
|
1642
|
-
if (
|
|
1641
|
+
const r = e.split(".");
|
|
1642
|
+
if (r.length < 3)
|
|
1643
1643
|
return;
|
|
1644
|
-
const i =
|
|
1644
|
+
const i = rt(), a = r.slice(2).join(".") || r[r.length - 1];
|
|
1645
1645
|
let l = this.doctype;
|
|
1646
|
-
this.doctype === "StonecropStore" &&
|
|
1646
|
+
this.doctype === "StonecropStore" && r.length >= 1 && (l = r[0]);
|
|
1647
1647
|
let s;
|
|
1648
|
-
|
|
1648
|
+
r.length >= 2 && (s = r[1]);
|
|
1649
1649
|
const c = {
|
|
1650
1650
|
path: e,
|
|
1651
|
-
fieldname:
|
|
1651
|
+
fieldname: a,
|
|
1652
1652
|
beforeValue: t,
|
|
1653
1653
|
afterValue: n,
|
|
1654
1654
|
operation: "set",
|
|
@@ -1659,8 +1659,8 @@ class Re {
|
|
|
1659
1659
|
// Pass the root store for snapshot/rollback capabilities
|
|
1660
1660
|
};
|
|
1661
1661
|
await i.executeFieldTriggers(c);
|
|
1662
|
-
} catch (
|
|
1663
|
-
|
|
1662
|
+
} catch (r) {
|
|
1663
|
+
r instanceof Error && console.warn("Field trigger error:", r.message);
|
|
1664
1664
|
}
|
|
1665
1665
|
}
|
|
1666
1666
|
isVueReactive(e) {
|
|
@@ -1672,19 +1672,19 @@ class Re {
|
|
|
1672
1672
|
isImmutable(e) {
|
|
1673
1673
|
if (!e || typeof e != "object")
|
|
1674
1674
|
return !1;
|
|
1675
|
-
const t = "get" in e && typeof e.get == "function", n = "set" in e && typeof e.set == "function",
|
|
1676
|
-
let
|
|
1675
|
+
const t = "get" in e && typeof e.get == "function", n = "set" in e && typeof e.set == "function", r = "has" in e && typeof e.has == "function", i = "__ownerID" in e || "_map" in e || "_list" in e || "_origin" in e || "_capacity" in e || "_defaultValues" in e || "_tail" in e || "_root" in e || "size" in e && t && n;
|
|
1676
|
+
let a;
|
|
1677
1677
|
try {
|
|
1678
1678
|
const s = e;
|
|
1679
1679
|
if ("constructor" in s && s.constructor && typeof s.constructor == "object" && "name" in s.constructor) {
|
|
1680
1680
|
const c = s.constructor.name;
|
|
1681
|
-
|
|
1681
|
+
a = typeof c == "string" ? c : void 0;
|
|
1682
1682
|
}
|
|
1683
1683
|
} catch {
|
|
1684
|
-
|
|
1684
|
+
a = void 0;
|
|
1685
1685
|
}
|
|
1686
|
-
const l =
|
|
1687
|
-
return !!(t && n &&
|
|
1686
|
+
const l = a && (a.includes("Map") || a.includes("List") || a.includes("Set") || a.includes("Stack") || a.includes("Seq")) && (t || n);
|
|
1687
|
+
return !!(t && n && r && i || t && n && l);
|
|
1688
1688
|
}
|
|
1689
1689
|
isPrimitive(e) {
|
|
1690
1690
|
return e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "function" || typeof e == "symbol" || typeof e == "bigint";
|
|
@@ -1694,9 +1694,9 @@ class Re {
|
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
1696
|
function ko(o, e, t) {
|
|
1697
|
-
return new
|
|
1697
|
+
return new Ie(o, e, "", null, t);
|
|
1698
1698
|
}
|
|
1699
|
-
class
|
|
1699
|
+
class Do {
|
|
1700
1700
|
hstStore;
|
|
1701
1701
|
_operationLogStore;
|
|
1702
1702
|
_operationLogConfig;
|
|
@@ -1715,7 +1715,7 @@ class Oo {
|
|
|
1715
1715
|
* @internal
|
|
1716
1716
|
*/
|
|
1717
1717
|
getOperationLogStore() {
|
|
1718
|
-
return this._operationLogStore || (this._operationLogStore =
|
|
1718
|
+
return this._operationLogStore || (this._operationLogStore = wt(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;
|
|
1719
1719
|
}
|
|
1720
1720
|
/**
|
|
1721
1721
|
* Initialize the HST store structure
|
|
@@ -1751,8 +1751,8 @@ class Oo {
|
|
|
1751
1751
|
* @param recordData - The record data
|
|
1752
1752
|
*/
|
|
1753
1753
|
addRecord(e, t, n) {
|
|
1754
|
-
const
|
|
1755
|
-
this.ensureDoctypeExists(
|
|
1754
|
+
const r = typeof e == "string" ? e : e.slug;
|
|
1755
|
+
this.ensureDoctypeExists(r), this.hstStore.set(`${r}.${t}`, n);
|
|
1756
1756
|
}
|
|
1757
1757
|
/**
|
|
1758
1758
|
* Get a specific record
|
|
@@ -1783,7 +1783,7 @@ class Oo {
|
|
|
1783
1783
|
const t = typeof e == "string" ? e : e.slug;
|
|
1784
1784
|
this.ensureDoctypeExists(t);
|
|
1785
1785
|
const n = this.hstStore.get(t);
|
|
1786
|
-
return !n || typeof n != "object" ? [] : Object.keys(n).filter((
|
|
1786
|
+
return !n || typeof n != "object" ? [] : Object.keys(n).filter((r) => n[r] !== void 0);
|
|
1787
1787
|
}
|
|
1788
1788
|
/**
|
|
1789
1789
|
* Clear all records for a doctype
|
|
@@ -1810,10 +1810,10 @@ class Oo {
|
|
|
1810
1810
|
* @param args - Action arguments (typically record IDs)
|
|
1811
1811
|
*/
|
|
1812
1812
|
runAction(e, t, n) {
|
|
1813
|
-
const
|
|
1813
|
+
const r = this.registry.registry[e.slug]?.actions?.get(t), i = Array.isArray(n) ? n.filter((c) => typeof c == "string") : void 0, a = this.getOperationLogStore();
|
|
1814
1814
|
let l = "success", s;
|
|
1815
1815
|
try {
|
|
1816
|
-
|
|
1816
|
+
r && r.length > 0 && r.forEach((c) => {
|
|
1817
1817
|
try {
|
|
1818
1818
|
new Function("args", c)(n);
|
|
1819
1819
|
} catch (p) {
|
|
@@ -1822,7 +1822,7 @@ class Oo {
|
|
|
1822
1822
|
});
|
|
1823
1823
|
} catch {
|
|
1824
1824
|
} finally {
|
|
1825
|
-
|
|
1825
|
+
a.logAction(e.doctype, t, i, l, s);
|
|
1826
1826
|
}
|
|
1827
1827
|
}
|
|
1828
1828
|
/**
|
|
@@ -1868,9 +1868,9 @@ class Oo {
|
|
|
1868
1868
|
return this.hstStore;
|
|
1869
1869
|
}
|
|
1870
1870
|
}
|
|
1871
|
-
function
|
|
1871
|
+
function Ro(o) {
|
|
1872
1872
|
o || (o = {});
|
|
1873
|
-
const e = o.registry ||
|
|
1873
|
+
const e = o.registry || He("$registry"), t = He("$stonecrop"), n = R(), r = R(), i = R({}), a = R(), l = R(), s = R([]), c = R(-1), p = T(() => n.value?.getOperationLogStore().canUndo ?? !1), w = T(() => n.value?.getOperationLogStore().canRedo ?? !1), S = T(() => n.value?.getOperationLogStore().undoCount ?? 0), k = T(() => n.value?.getOperationLogStore().redoCount ?? 0), O = T(
|
|
1874
1874
|
() => n.value?.getOperationLogStore().undoRedoState ?? {
|
|
1875
1875
|
canUndo: !1,
|
|
1876
1876
|
canRedo: !1,
|
|
@@ -1878,28 +1878,28 @@ function No(o) {
|
|
|
1878
1878
|
redoCount: 0,
|
|
1879
1879
|
currentIndex: -1
|
|
1880
1880
|
}
|
|
1881
|
-
),
|
|
1881
|
+
), N = (E) => n.value?.getOperationLogStore().undo(E) ?? !1, A = (E) => n.value?.getOperationLogStore().redo(E) ?? !1, P = () => {
|
|
1882
1882
|
n.value?.getOperationLogStore().startBatch();
|
|
1883
|
-
},
|
|
1883
|
+
}, x = (E) => n.value?.getOperationLogStore().commitBatch(E) ?? null, W = () => {
|
|
1884
1884
|
n.value?.getOperationLogStore().cancelBatch();
|
|
1885
1885
|
}, J = () => {
|
|
1886
1886
|
n.value?.getOperationLogStore().clear();
|
|
1887
|
-
}, K = (
|
|
1887
|
+
}, K = (E, h) => n.value?.getOperationLogStore().getOperationsFor(E, h) ?? [], z = () => n.value?.getOperationLogStore().getSnapshot() ?? {
|
|
1888
1888
|
operations: [],
|
|
1889
1889
|
currentIndex: -1,
|
|
1890
1890
|
totalOperations: 0,
|
|
1891
1891
|
reversibleOperations: 0,
|
|
1892
1892
|
irreversibleOperations: 0
|
|
1893
|
-
},
|
|
1894
|
-
n.value?.getOperationLogStore().markIrreversible(
|
|
1895
|
-
}, U = (
|
|
1896
|
-
n.value?.getOperationLogStore().configure(
|
|
1893
|
+
}, _ = (E, h) => {
|
|
1894
|
+
n.value?.getOperationLogStore().markIrreversible(E, h);
|
|
1895
|
+
}, U = (E, h, $, D = "success", V) => n.value?.getOperationLogStore().logAction(E, h, $, D, V) ?? "", m = (E) => {
|
|
1896
|
+
n.value?.getOperationLogStore().configure(E);
|
|
1897
1897
|
};
|
|
1898
|
-
|
|
1898
|
+
Te(async () => {
|
|
1899
1899
|
if (e) {
|
|
1900
|
-
n.value = t || new
|
|
1900
|
+
n.value = t || new Do(e);
|
|
1901
1901
|
try {
|
|
1902
|
-
const
|
|
1902
|
+
const E = n.value.getOperationLogStore(), h = to(E);
|
|
1903
1903
|
s.value = h.operations.value, c.value = h.currentIndex.value, H(
|
|
1904
1904
|
() => h.operations.value,
|
|
1905
1905
|
($) => {
|
|
@@ -1914,123 +1914,123 @@ function No(o) {
|
|
|
1914
1914
|
} catch {
|
|
1915
1915
|
}
|
|
1916
1916
|
if (!o.doctype && e.router) {
|
|
1917
|
-
const
|
|
1918
|
-
if (!
|
|
1919
|
-
const h =
|
|
1917
|
+
const E = e.router.currentRoute.value;
|
|
1918
|
+
if (!E.path) return;
|
|
1919
|
+
const h = E.path.split("/").filter((D) => D.length > 0), $ = h[1]?.toLowerCase();
|
|
1920
1920
|
if (h.length > 0) {
|
|
1921
1921
|
const D = {
|
|
1922
|
-
path:
|
|
1922
|
+
path: E.path,
|
|
1923
1923
|
segments: h
|
|
1924
|
-
},
|
|
1925
|
-
if (
|
|
1926
|
-
if (e.addDoctype(
|
|
1927
|
-
const
|
|
1928
|
-
if (
|
|
1929
|
-
i.value =
|
|
1924
|
+
}, V = await e.getMeta?.(D);
|
|
1925
|
+
if (V) {
|
|
1926
|
+
if (e.addDoctype(V), n.value.setup(V), a.value = V, l.value = $, r.value = n.value.getStore(), $ && $ !== "new") {
|
|
1927
|
+
const M = n.value.getRecordById(V, $);
|
|
1928
|
+
if (M)
|
|
1929
|
+
i.value = M.get("") || {};
|
|
1930
1930
|
else
|
|
1931
1931
|
try {
|
|
1932
|
-
await n.value.getRecord(
|
|
1933
|
-
const G = n.value.getRecordById(
|
|
1932
|
+
await n.value.getRecord(V, $);
|
|
1933
|
+
const G = n.value.getRecordById(V, $);
|
|
1934
1934
|
G && (i.value = G.get("") || {});
|
|
1935
1935
|
} catch {
|
|
1936
|
-
i.value =
|
|
1936
|
+
i.value = _e(V);
|
|
1937
1937
|
}
|
|
1938
1938
|
} else
|
|
1939
|
-
i.value =
|
|
1940
|
-
|
|
1939
|
+
i.value = _e(V);
|
|
1940
|
+
r.value && it(V, $ || "new", i, r.value), n.value.runAction(V, "load", $ ? [$] : void 0);
|
|
1941
1941
|
}
|
|
1942
1942
|
}
|
|
1943
1943
|
}
|
|
1944
1944
|
if (o.doctype) {
|
|
1945
|
-
|
|
1946
|
-
const
|
|
1945
|
+
r.value = n.value.getStore();
|
|
1946
|
+
const E = o.doctype, h = o.recordId;
|
|
1947
1947
|
if (h && h !== "new") {
|
|
1948
|
-
const $ = n.value.getRecordById(
|
|
1948
|
+
const $ = n.value.getRecordById(E, h);
|
|
1949
1949
|
if ($)
|
|
1950
1950
|
i.value = $.get("") || {};
|
|
1951
1951
|
else
|
|
1952
1952
|
try {
|
|
1953
|
-
await n.value.getRecord(
|
|
1954
|
-
const D = n.value.getRecordById(
|
|
1953
|
+
await n.value.getRecord(E, h);
|
|
1954
|
+
const D = n.value.getRecordById(E, h);
|
|
1955
1955
|
D && (i.value = D.get("") || {});
|
|
1956
1956
|
} catch {
|
|
1957
|
-
i.value =
|
|
1957
|
+
i.value = _e(E);
|
|
1958
1958
|
}
|
|
1959
1959
|
} else
|
|
1960
|
-
i.value =
|
|
1961
|
-
|
|
1960
|
+
i.value = _e(E);
|
|
1961
|
+
r.value && it(E, h || "new", i, r.value);
|
|
1962
1962
|
}
|
|
1963
1963
|
}
|
|
1964
1964
|
});
|
|
1965
|
-
const v = (
|
|
1966
|
-
const $ = o.doctype ||
|
|
1965
|
+
const v = (E, h) => {
|
|
1966
|
+
const $ = o.doctype || a.value;
|
|
1967
1967
|
if (!$) return "";
|
|
1968
1968
|
const D = h || o.recordId || l.value || "new";
|
|
1969
|
-
return `${$.slug}.${D}.${
|
|
1970
|
-
},
|
|
1971
|
-
const h = o.doctype ||
|
|
1972
|
-
if (!(!
|
|
1969
|
+
return `${$.slug}.${D}.${E}`;
|
|
1970
|
+
}, C = (E) => {
|
|
1971
|
+
const h = o.doctype || a.value;
|
|
1972
|
+
if (!(!r.value || !n.value || !h))
|
|
1973
1973
|
try {
|
|
1974
|
-
const $ =
|
|
1974
|
+
const $ = E.path.split(".");
|
|
1975
1975
|
if ($.length >= 2) {
|
|
1976
|
-
const
|
|
1977
|
-
if (
|
|
1978
|
-
const g = `${
|
|
1976
|
+
const M = $[0], G = $[1];
|
|
1977
|
+
if (r.value.has(`${M}.${G}`) || n.value.addRecord(h, G, { ...i.value }), $.length > 3) {
|
|
1978
|
+
const g = `${M}.${G}`, f = $.slice(2);
|
|
1979
1979
|
let y = g;
|
|
1980
1980
|
for (let u = 0; u < f.length - 1; u++)
|
|
1981
|
-
if (y += `.${f[u]}`, !
|
|
1981
|
+
if (y += `.${f[u]}`, !r.value.has(y)) {
|
|
1982
1982
|
const d = f[u + 1], b = !isNaN(Number(d));
|
|
1983
|
-
|
|
1983
|
+
r.value.set(y, b ? [] : {});
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
1987
|
-
|
|
1988
|
-
const D =
|
|
1989
|
-
D.length === 1 ?
|
|
1987
|
+
r.value.set(E.path, E.value);
|
|
1988
|
+
const D = E.fieldname.split("."), V = { ...i.value };
|
|
1989
|
+
D.length === 1 ? V[D[0]] = E.value : Co(V, D, E.value), i.value = V;
|
|
1990
1990
|
} catch {
|
|
1991
1991
|
}
|
|
1992
1992
|
};
|
|
1993
|
-
(o.doctype || e?.router) && (
|
|
1994
|
-
const
|
|
1993
|
+
(o.doctype || e?.router) && (Ue("hstPathProvider", v), Ue("hstChangeHandler", C));
|
|
1994
|
+
const L = {
|
|
1995
1995
|
operations: s,
|
|
1996
1996
|
currentIndex: c,
|
|
1997
|
-
undoRedoState:
|
|
1997
|
+
undoRedoState: O,
|
|
1998
1998
|
canUndo: p,
|
|
1999
|
-
canRedo:
|
|
2000
|
-
undoCount:
|
|
2001
|
-
redoCount:
|
|
2002
|
-
undo:
|
|
2003
|
-
redo:
|
|
1999
|
+
canRedo: w,
|
|
2000
|
+
undoCount: S,
|
|
2001
|
+
redoCount: k,
|
|
2002
|
+
undo: N,
|
|
2003
|
+
redo: A,
|
|
2004
2004
|
startBatch: P,
|
|
2005
|
-
commitBatch:
|
|
2006
|
-
cancelBatch:
|
|
2005
|
+
commitBatch: x,
|
|
2006
|
+
cancelBatch: W,
|
|
2007
2007
|
clear: J,
|
|
2008
2008
|
getOperationsFor: K,
|
|
2009
|
-
getSnapshot:
|
|
2010
|
-
markIrreversible:
|
|
2009
|
+
getSnapshot: z,
|
|
2010
|
+
markIrreversible: _,
|
|
2011
2011
|
logAction: U,
|
|
2012
2012
|
configure: m
|
|
2013
2013
|
};
|
|
2014
2014
|
return o.doctype ? {
|
|
2015
2015
|
stonecrop: n,
|
|
2016
|
-
operationLog:
|
|
2016
|
+
operationLog: L,
|
|
2017
2017
|
provideHSTPath: v,
|
|
2018
|
-
handleHSTChange:
|
|
2019
|
-
hstStore:
|
|
2018
|
+
handleHSTChange: C,
|
|
2019
|
+
hstStore: r,
|
|
2020
2020
|
formData: i
|
|
2021
2021
|
} : !o.doctype && e?.router ? {
|
|
2022
2022
|
stonecrop: n,
|
|
2023
|
-
operationLog:
|
|
2023
|
+
operationLog: L,
|
|
2024
2024
|
provideHSTPath: v,
|
|
2025
|
-
handleHSTChange:
|
|
2026
|
-
hstStore:
|
|
2025
|
+
handleHSTChange: C,
|
|
2026
|
+
hstStore: r,
|
|
2027
2027
|
formData: i
|
|
2028
2028
|
} : {
|
|
2029
2029
|
stonecrop: n,
|
|
2030
|
-
operationLog:
|
|
2030
|
+
operationLog: L
|
|
2031
2031
|
};
|
|
2032
2032
|
}
|
|
2033
|
-
function
|
|
2033
|
+
function _e(o) {
|
|
2034
2034
|
const e = {};
|
|
2035
2035
|
return o.schema && o.schema.forEach((t) => {
|
|
2036
2036
|
switch ("fieldtype" in t ? t.fieldtype : "Data") {
|
|
@@ -2056,15 +2056,15 @@ function ke(o) {
|
|
|
2056
2056
|
}
|
|
2057
2057
|
}), e;
|
|
2058
2058
|
}
|
|
2059
|
-
function
|
|
2059
|
+
function it(o, e, t, n) {
|
|
2060
2060
|
H(
|
|
2061
2061
|
t,
|
|
2062
|
-
(
|
|
2062
|
+
(r) => {
|
|
2063
2063
|
const i = `${o.slug}.${e}`;
|
|
2064
|
-
Object.keys(
|
|
2065
|
-
const l = `${i}.${
|
|
2064
|
+
Object.keys(r).forEach((a) => {
|
|
2065
|
+
const l = `${i}.${a}`;
|
|
2066
2066
|
try {
|
|
2067
|
-
n.set(l, a
|
|
2067
|
+
n.set(l, r[a]);
|
|
2068
2068
|
} catch {
|
|
2069
2069
|
}
|
|
2070
2070
|
});
|
|
@@ -2072,79 +2072,79 @@ function st(o, e, t, n) {
|
|
|
2072
2072
|
{ deep: !0 }
|
|
2073
2073
|
);
|
|
2074
2074
|
}
|
|
2075
|
-
function
|
|
2075
|
+
function Co(o, e, t) {
|
|
2076
2076
|
let n = o;
|
|
2077
2077
|
for (let i = 0; i < e.length - 1; i++) {
|
|
2078
|
-
const
|
|
2079
|
-
(!(
|
|
2078
|
+
const a = e[i];
|
|
2079
|
+
(!(a in n) || typeof n[a] != "object") && (n[a] = isNaN(Number(e[i + 1])) ? {} : []), n = n[a];
|
|
2080
2080
|
}
|
|
2081
|
-
const
|
|
2082
|
-
n[
|
|
2081
|
+
const r = e[e.length - 1];
|
|
2082
|
+
n[r] = t;
|
|
2083
2083
|
}
|
|
2084
|
-
const
|
|
2084
|
+
const Io = (o, e) => {
|
|
2085
2085
|
const t = o.__vccOpts || o;
|
|
2086
|
-
for (const [n,
|
|
2087
|
-
t[n] =
|
|
2086
|
+
for (const [n, r] of e)
|
|
2087
|
+
t[n] = r;
|
|
2088
2088
|
return t;
|
|
2089
2089
|
};
|
|
2090
|
-
function
|
|
2091
|
-
return
|
|
2090
|
+
function To(o, e) {
|
|
2091
|
+
return Je() ? (Ge(o, e), !0) : !1;
|
|
2092
2092
|
}
|
|
2093
2093
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
2094
|
-
const
|
|
2094
|
+
const xo = () => {
|
|
2095
2095
|
};
|
|
2096
|
-
function
|
|
2096
|
+
function Ao(...o) {
|
|
2097
2097
|
if (o.length !== 1) return ie(...o);
|
|
2098
2098
|
const e = o[0];
|
|
2099
|
-
return typeof e == "function" ?
|
|
2099
|
+
return typeof e == "function" ? Ze(vt(() => ({
|
|
2100
2100
|
get: e,
|
|
2101
|
-
set:
|
|
2102
|
-
}))) :
|
|
2101
|
+
set: xo
|
|
2102
|
+
}))) : R(e);
|
|
2103
2103
|
}
|
|
2104
|
-
function
|
|
2104
|
+
function Le(o) {
|
|
2105
2105
|
return typeof Window < "u" && o instanceof Window ? o.document.documentElement : typeof Document < "u" && o instanceof Document ? o.documentElement : o;
|
|
2106
2106
|
}
|
|
2107
|
-
const
|
|
2108
|
-
function
|
|
2109
|
-
const t =
|
|
2107
|
+
const Me = /* @__PURE__ */ new WeakMap();
|
|
2108
|
+
function Po(o, e = !1) {
|
|
2109
|
+
const t = qe(e);
|
|
2110
2110
|
let n = "";
|
|
2111
|
-
H(
|
|
2112
|
-
const l =
|
|
2111
|
+
H(Ao(o), (a) => {
|
|
2112
|
+
const l = Le(ee(a));
|
|
2113
2113
|
if (l) {
|
|
2114
2114
|
const s = l;
|
|
2115
|
-
if (
|
|
2115
|
+
if (Me.get(s) || Me.set(s, s.style.overflow), s.style.overflow !== "hidden" && (n = s.style.overflow), s.style.overflow === "hidden") return t.value = !0;
|
|
2116
2116
|
if (t.value) return s.style.overflow = "hidden";
|
|
2117
2117
|
}
|
|
2118
2118
|
}, { immediate: !0 });
|
|
2119
|
-
const
|
|
2120
|
-
const
|
|
2121
|
-
!
|
|
2119
|
+
const r = () => {
|
|
2120
|
+
const a = Le(ee(o));
|
|
2121
|
+
!a || t.value || (a.style.overflow = "hidden", t.value = !0);
|
|
2122
2122
|
}, i = () => {
|
|
2123
|
-
const
|
|
2124
|
-
!
|
|
2123
|
+
const a = Le(ee(o));
|
|
2124
|
+
!a || !t.value || (a.style.overflow = n, Me.delete(a), t.value = !1);
|
|
2125
2125
|
};
|
|
2126
|
-
return
|
|
2126
|
+
return To(i), T({
|
|
2127
2127
|
get() {
|
|
2128
2128
|
return t.value;
|
|
2129
2129
|
},
|
|
2130
|
-
set(
|
|
2131
|
-
|
|
2130
|
+
set(a) {
|
|
2131
|
+
a ? r() : i();
|
|
2132
2132
|
}
|
|
2133
2133
|
});
|
|
2134
2134
|
}
|
|
2135
|
-
function
|
|
2135
|
+
function Vo() {
|
|
2136
2136
|
let o = !1;
|
|
2137
|
-
const e =
|
|
2137
|
+
const e = qe(!1);
|
|
2138
2138
|
return (t, n) => {
|
|
2139
2139
|
if (e.value = n.value, o) return;
|
|
2140
2140
|
o = !0;
|
|
2141
|
-
const
|
|
2142
|
-
H(e, (i) =>
|
|
2141
|
+
const r = Po(t, n.value);
|
|
2142
|
+
H(e, (i) => r.value = i);
|
|
2143
2143
|
};
|
|
2144
2144
|
}
|
|
2145
|
-
|
|
2145
|
+
Vo();
|
|
2146
2146
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
2147
|
-
const
|
|
2147
|
+
const jo = { class: "aform" }, Fo = /* @__PURE__ */ be({
|
|
2148
2148
|
__name: "AForm",
|
|
2149
2149
|
props: {
|
|
2150
2150
|
modelValue: {},
|
|
@@ -2153,15 +2153,21 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2153
2153
|
},
|
|
2154
2154
|
emits: ["update:modelValue"],
|
|
2155
2155
|
setup(o, { emit: e }) {
|
|
2156
|
-
const t = e, n =
|
|
2156
|
+
const t = e, n = R(o.data || {});
|
|
2157
|
+
Rt(() => {
|
|
2158
|
+
o.data && (n.value = o.data, o.modelValue.forEach((a) => {
|
|
2159
|
+
a.fieldname && o.data[a.fieldname] !== void 0 && (a.value = o.data[a.fieldname]);
|
|
2160
|
+
}));
|
|
2161
|
+
});
|
|
2162
|
+
const r = (a) => {
|
|
2157
2163
|
let l = {};
|
|
2158
|
-
for (const [s, c] of Object.entries(
|
|
2159
|
-
["component", "fieldtype"].includes(s) || (l[s] = c), s === "rows" && c && c.length === 0 && (l.rows = n.value[
|
|
2164
|
+
for (const [s, c] of Object.entries(a))
|
|
2165
|
+
["component", "fieldtype"].includes(s) || (l[s] = c), s === "rows" && c && c.length === 0 && (l.rows = n.value[a.fieldname]);
|
|
2160
2166
|
return l;
|
|
2161
2167
|
}, i = T({
|
|
2162
|
-
get: () => o.modelValue.map((
|
|
2168
|
+
get: () => o.modelValue.map((a, l) => T({
|
|
2163
2169
|
get() {
|
|
2164
|
-
return
|
|
2170
|
+
return a.value;
|
|
2165
2171
|
},
|
|
2166
2172
|
set: (s) => {
|
|
2167
2173
|
o.modelValue[l].value = s, t("update:modelValue", o.modelValue);
|
|
@@ -2170,135 +2176,112 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2170
2176
|
set: () => {
|
|
2171
2177
|
}
|
|
2172
2178
|
});
|
|
2173
|
-
return (
|
|
2174
|
-
(
|
|
2179
|
+
return (a, l) => (F(), B("form", jo, [
|
|
2180
|
+
(F(!0), B(ge, null, me(o.modelValue, (s, c) => (F(), Ke(Ct(s.component), It({
|
|
2175
2181
|
key: c,
|
|
2176
2182
|
modelValue: i.value[c].value,
|
|
2177
2183
|
"onUpdate:modelValue": (p) => i.value[c].value = p,
|
|
2178
2184
|
schema: s,
|
|
2179
2185
|
data: n.value[s.fieldname],
|
|
2180
2186
|
readonly: o.readonly
|
|
2181
|
-
}, { ref_for: !0 },
|
|
2187
|
+
}, { ref_for: !0 }, r(s)), null, 16, ["modelValue", "onUpdate:modelValue", "schema", "data", "readonly"]))), 128))
|
|
2182
2188
|
]));
|
|
2183
2189
|
}
|
|
2184
|
-
}),
|
|
2185
|
-
id: "Capa_1",
|
|
2186
|
-
version: "1.1",
|
|
2187
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2188
|
-
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
2189
|
-
x: "0px",
|
|
2190
|
-
y: "0px",
|
|
2191
|
-
viewBox: "0 0 424.098 424.098",
|
|
2192
|
-
style: { "enable-background": "new 0 0 424.098 424.098" },
|
|
2193
|
-
"xml:space": "preserve"
|
|
2194
|
-
}, Bo = { tabindex: "0" }, Ho = { style: { width: "11pt" } }, Uo = /* @__PURE__ */ be({
|
|
2190
|
+
}), Lo = /* @__PURE__ */ Io(Fo, [["__scopeId", "data-v-82d33d5b"]]), Mo = { class: "tabs" }, Bo = { tabindex: "0" }, Ho = { tabindex: "0" }, Uo = /* @__PURE__ */ be({
|
|
2195
2191
|
__name: "SheetNav",
|
|
2196
2192
|
props: {
|
|
2197
2193
|
breadcrumbs: { default: () => [] }
|
|
2198
2194
|
},
|
|
2199
2195
|
setup(o) {
|
|
2200
|
-
const e =
|
|
2196
|
+
const e = R(!0), t = R(!1), n = R(""), r = lt("searchinput"), i = T(() => e.value ? "unrotated" : "rotated"), a = () => {
|
|
2201
2197
|
e.value = !e.value;
|
|
2202
2198
|
}, l = async () => {
|
|
2203
2199
|
t.value = !t.value, await oe(() => {
|
|
2204
|
-
|
|
2200
|
+
r.value?.focus();
|
|
2205
2201
|
});
|
|
2206
|
-
}, s = (
|
|
2207
|
-
|
|
2208
|
-
}, c = async (
|
|
2209
|
-
|
|
2202
|
+
}, s = (w) => {
|
|
2203
|
+
w.preventDefault(), w.stopPropagation();
|
|
2204
|
+
}, c = async (w) => {
|
|
2205
|
+
w.preventDefault(), w.stopPropagation(), await l();
|
|
2210
2206
|
}, p = () => {
|
|
2211
2207
|
};
|
|
2212
|
-
return (
|
|
2213
|
-
const
|
|
2214
|
-
return
|
|
2215
|
-
|
|
2216
|
-
|
|
2208
|
+
return (w, S) => {
|
|
2209
|
+
const k = Tt("router-link");
|
|
2210
|
+
return F(), B("footer", null, [
|
|
2211
|
+
j("ul", Mo, [
|
|
2212
|
+
j("li", {
|
|
2217
2213
|
class: "hidebreadcrumbs",
|
|
2218
|
-
onClick:
|
|
2219
|
-
onKeydown:
|
|
2214
|
+
onClick: a,
|
|
2215
|
+
onKeydown: ue(a, ["enter"])
|
|
2220
2216
|
}, [
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
class:
|
|
2217
|
+
j("a", Bo, [
|
|
2218
|
+
j("div", {
|
|
2219
|
+
class: Ne(i.value)
|
|
2224
2220
|
}, "×", 2)
|
|
2225
2221
|
])
|
|
2226
2222
|
], 32),
|
|
2227
|
-
|
|
2223
|
+
j("li", {
|
|
2228
2224
|
class: "hometab",
|
|
2229
|
-
style:
|
|
2225
|
+
style: Pe({ display: e.value ? "block" : "none" }),
|
|
2230
2226
|
onClick: p,
|
|
2231
|
-
onKeydown:
|
|
2227
|
+
onKeydown: ue(p, ["enter"])
|
|
2232
2228
|
}, [
|
|
2233
|
-
se(
|
|
2229
|
+
se(k, {
|
|
2234
2230
|
to: "/",
|
|
2235
2231
|
tabindex: "0"
|
|
2236
2232
|
}, {
|
|
2237
|
-
default:
|
|
2238
|
-
(
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
c-3.284-0.008-6.243-1.992-7.495-5.023c-1.252-3.04-0.553-6.527,1.764-8.852L206.104,24.546c1.853-1.845,4.503-2.666,7.047-2.276
|
|
2244
|
-
c2.414,0.39,4.511,1.845,5.731,3.942l47.43,47.43V58.499c0-4.487,3.633-8.129,8.129-8.129h47.755c4.495,0,8.129,3.642,8.129,8.129
|
|
2245
|
-
v79.156l91.39,91.398c2.325,2.325,3.024,5.828,1.764,8.868c-1.26,3.032-4.227,5.007-7.511,5.007c-0.008,0-0.008,0-0.016,0
|
|
2246
|
-
l-56.64-0.114v150.98C359.32,398.29,355.686,401.923,351.191,401.923z M81.03,385.666h262.033V234.67
|
|
2247
|
-
c0-2.162,0.854-4.235,2.39-5.755c1.528-1.52,3.585-2.374,5.739-2.374c0.008,0,0.008,0,0.016,0l45.105,0.089l-79.855-79.863
|
|
2248
|
-
c-1.528-1.528-2.382-3.593-2.382-5.747V66.628h-31.498v26.645c0,3.284-1.975,6.251-5.015,7.511
|
|
2249
|
-
c-3.032,1.268-6.527,0.569-8.86-1.764l-57.038-57.038l-183.95,183.95l45.203,0.089c4.487,0.008,8.112,3.642,8.112,8.129
|
|
2250
|
-
C81.03,234.149,81.03,385.666,81.03,385.666z`
|
|
2251
|
-
})
|
|
2252
|
-
], -1)
|
|
2253
|
-
])]))
|
|
2254
|
-
]),
|
|
2233
|
+
default: ye(() => [...S[5] || (S[5] = [
|
|
2234
|
+
j("span", {
|
|
2235
|
+
class: "icon-placeholder",
|
|
2236
|
+
"aria-label": "Home"
|
|
2237
|
+
}, "🏠", -1)
|
|
2238
|
+
])]),
|
|
2255
2239
|
_: 1
|
|
2256
2240
|
})
|
|
2257
2241
|
], 36),
|
|
2258
|
-
|
|
2259
|
-
class: "searchtab",
|
|
2260
|
-
style:
|
|
2261
|
-
onClick: l,
|
|
2262
|
-
onKeydown: Se(l, ["enter"])
|
|
2242
|
+
j("li", {
|
|
2243
|
+
class: Ne(["searchtab", { "search-active": t.value }]),
|
|
2244
|
+
style: Pe({ display: e.value ? "block" : "none" })
|
|
2263
2245
|
}, [
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
], -1)
|
|
2276
|
-
])]))
|
|
2277
|
-
], 4),
|
|
2278
|
-
ze(x("input", {
|
|
2246
|
+
j("a", Ho, [
|
|
2247
|
+
ke(j("span", {
|
|
2248
|
+
class: "search-icon",
|
|
2249
|
+
role: "button",
|
|
2250
|
+
"aria-label": "Search",
|
|
2251
|
+
onClick: l,
|
|
2252
|
+
onKeydown: ue(l, ["enter"])
|
|
2253
|
+
}, "🔍", 544), [
|
|
2254
|
+
[Be, !t.value]
|
|
2255
|
+
]),
|
|
2256
|
+
ke(j("input", {
|
|
2279
2257
|
ref: "searchinput",
|
|
2280
|
-
"onUpdate:modelValue":
|
|
2281
|
-
style: ue({ display: t.value ? "block" : "none" }),
|
|
2258
|
+
"onUpdate:modelValue": S[0] || (S[0] = (O) => n.value = O),
|
|
2282
2259
|
type: "text",
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
[
|
|
2260
|
+
placeholder: "Search...",
|
|
2261
|
+
onClick: S[1] || (S[1] = ct(() => {
|
|
2262
|
+
}, ["stop"])),
|
|
2263
|
+
onInput: S[2] || (S[2] = (O) => s(O)),
|
|
2264
|
+
onBlur: S[3] || (S[3] = (O) => c(O)),
|
|
2265
|
+
onKeydown: [
|
|
2266
|
+
S[4] || (S[4] = ue((O) => c(O), ["enter"])),
|
|
2267
|
+
ue(l, ["escape"])
|
|
2268
|
+
]
|
|
2269
|
+
}, null, 544), [
|
|
2270
|
+
[Be, t.value],
|
|
2271
|
+
[ut, n.value]
|
|
2289
2272
|
])
|
|
2290
2273
|
])
|
|
2291
|
-
],
|
|
2292
|
-
(
|
|
2293
|
-
key:
|
|
2294
|
-
style:
|
|
2274
|
+
], 6),
|
|
2275
|
+
(F(!0), B(ge, null, me(o.breadcrumbs, (O) => (F(), B("li", {
|
|
2276
|
+
key: O.title,
|
|
2277
|
+
style: Pe({ display: e.value ? "block" : "none" })
|
|
2295
2278
|
}, [
|
|
2296
|
-
se(
|
|
2279
|
+
se(k, {
|
|
2297
2280
|
tabindex: "0",
|
|
2298
|
-
to:
|
|
2281
|
+
to: O.to
|
|
2299
2282
|
}, {
|
|
2300
|
-
default:
|
|
2301
|
-
|
|
2283
|
+
default: ye(() => [
|
|
2284
|
+
De(Q(O.title), 1)
|
|
2302
2285
|
]),
|
|
2303
2286
|
_: 2
|
|
2304
2287
|
}, 1032, ["to"])
|
|
@@ -2307,10 +2290,10 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2307
2290
|
]);
|
|
2308
2291
|
};
|
|
2309
2292
|
}
|
|
2310
|
-
}),
|
|
2293
|
+
}), St = /* @__PURE__ */ ft(Uo, [["__scopeId", "data-v-0afb6e2a"]]), Wo = {
|
|
2311
2294
|
key: 1,
|
|
2312
2295
|
class: "loading"
|
|
2313
|
-
},
|
|
2296
|
+
}, zo = {
|
|
2314
2297
|
key: 2,
|
|
2315
2298
|
class: "loading"
|
|
2316
2299
|
}, Ko = /* @__PURE__ */ be({
|
|
@@ -2319,7 +2302,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2319
2302
|
availableDoctypes: { default: () => [] }
|
|
2320
2303
|
},
|
|
2321
2304
|
setup(o) {
|
|
2322
|
-
const { stonecrop: e } =
|
|
2305
|
+
const { stonecrop: e } = Ro(), t = R(!1), n = R(!1), r = R(!1), i = T({
|
|
2323
2306
|
get() {
|
|
2324
2307
|
if (!e.value || !s.value || !p.value)
|
|
2325
2308
|
return {};
|
|
@@ -2341,71 +2324,71 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2341
2324
|
console.warn("HST update failed:", d);
|
|
2342
2325
|
}
|
|
2343
2326
|
}
|
|
2344
|
-
}),
|
|
2345
|
-
if (!
|
|
2346
|
-
if (
|
|
2347
|
-
return
|
|
2348
|
-
if (
|
|
2349
|
-
return
|
|
2350
|
-
const u =
|
|
2327
|
+
}), a = T(() => Ee(e.value?.registry.router?.currentRoute)), l = T(() => e.value?.registry.router), s = T(() => {
|
|
2328
|
+
if (!a.value) return "";
|
|
2329
|
+
if (a.value.meta?.actualDoctype)
|
|
2330
|
+
return a.value.meta.actualDoctype;
|
|
2331
|
+
if (a.value.params.doctype)
|
|
2332
|
+
return a.value.params.doctype;
|
|
2333
|
+
const u = a.value.params.pathMatch;
|
|
2351
2334
|
return u && u.length > 0 ? u[0] : "";
|
|
2352
2335
|
}), c = T(() => {
|
|
2353
|
-
if (!
|
|
2354
|
-
if (
|
|
2355
|
-
return
|
|
2356
|
-
if (
|
|
2357
|
-
return
|
|
2358
|
-
const u =
|
|
2336
|
+
if (!a.value) return "";
|
|
2337
|
+
if (a.value.meta?.doctype)
|
|
2338
|
+
return a.value.meta.doctype;
|
|
2339
|
+
if (a.value.params.doctype)
|
|
2340
|
+
return a.value.params.doctype;
|
|
2341
|
+
const u = a.value.params.pathMatch;
|
|
2359
2342
|
return u && u.length > 0 ? u[0] : "";
|
|
2360
2343
|
}), p = T(() => {
|
|
2361
|
-
if (!
|
|
2362
|
-
if (
|
|
2363
|
-
return
|
|
2364
|
-
const u =
|
|
2344
|
+
if (!a.value) return "";
|
|
2345
|
+
if (a.value.params.recordId)
|
|
2346
|
+
return a.value.params.recordId;
|
|
2347
|
+
const u = a.value.params.pathMatch;
|
|
2365
2348
|
return u && u.length > 1 ? u[1] : "";
|
|
2366
|
-
}),
|
|
2367
|
-
if (!
|
|
2349
|
+
}), w = T(() => p.value?.startsWith("new-")), S = T(() => {
|
|
2350
|
+
if (!a.value || a.value.name === "home" || a.value.path === "/")
|
|
2368
2351
|
return "doctypes";
|
|
2369
|
-
if (
|
|
2370
|
-
const d =
|
|
2371
|
-
if (d.includes("form") ||
|
|
2352
|
+
if (a.value.name && a.value.name !== "catch-all") {
|
|
2353
|
+
const d = a.value.name;
|
|
2354
|
+
if (d.includes("form") || a.value.params.recordId)
|
|
2372
2355
|
return "record";
|
|
2373
|
-
if (d.includes("list") ||
|
|
2356
|
+
if (d.includes("list") || a.value.params.doctype)
|
|
2374
2357
|
return "records";
|
|
2375
2358
|
}
|
|
2376
|
-
const u =
|
|
2359
|
+
const u = a.value.params.pathMatch;
|
|
2377
2360
|
return u && u.length > 0 ? u.length === 1 ? "records" : "record" : "doctypes";
|
|
2378
|
-
}),
|
|
2361
|
+
}), k = () => {
|
|
2379
2362
|
if (!e.value || !s.value || !p.value)
|
|
2380
2363
|
return [];
|
|
2381
2364
|
try {
|
|
2382
2365
|
const d = e.value.registry.registry[s.value];
|
|
2383
2366
|
if (!d?.workflow?.states)
|
|
2384
2367
|
return [];
|
|
2385
|
-
const b =
|
|
2368
|
+
const b = w.value ? "creating" : "editing", I = d.workflow.states[b];
|
|
2386
2369
|
return I?.on ? Object.keys(I.on).map((q) => {
|
|
2387
|
-
const ce = I.on?.[q], Y = typeof ce == "string" ? ce : "unknown",
|
|
2388
|
-
const
|
|
2389
|
-
if (
|
|
2390
|
-
const
|
|
2391
|
-
await
|
|
2370
|
+
const ce = I.on?.[q], Y = typeof ce == "string" ? ce : "unknown", $t = async () => {
|
|
2371
|
+
const Ye = e.value?.getRecordById(s.value, p.value);
|
|
2372
|
+
if (Ye) {
|
|
2373
|
+
const _t = i.value || {};
|
|
2374
|
+
await Ye.triggerTransition(q, {
|
|
2392
2375
|
currentState: b,
|
|
2393
2376
|
targetState: Y,
|
|
2394
|
-
fsmContext:
|
|
2377
|
+
fsmContext: _t
|
|
2395
2378
|
});
|
|
2396
2379
|
}
|
|
2397
2380
|
};
|
|
2398
2381
|
return {
|
|
2399
2382
|
label: `${q} (→ ${Y})`,
|
|
2400
|
-
action:
|
|
2383
|
+
action: $t
|
|
2401
2384
|
};
|
|
2402
2385
|
}) : [];
|
|
2403
2386
|
} catch (u) {
|
|
2404
2387
|
return console.warn("Error getting available transitions:", u), [];
|
|
2405
2388
|
}
|
|
2406
|
-
},
|
|
2389
|
+
}, O = T(() => {
|
|
2407
2390
|
const u = [];
|
|
2408
|
-
switch (
|
|
2391
|
+
switch (S.value) {
|
|
2409
2392
|
case "doctypes":
|
|
2410
2393
|
u.push({
|
|
2411
2394
|
type: "button",
|
|
@@ -2420,7 +2403,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2420
2403
|
{
|
|
2421
2404
|
type: "button",
|
|
2422
2405
|
label: "New Record",
|
|
2423
|
-
action: () => void
|
|
2406
|
+
action: () => void z()
|
|
2424
2407
|
},
|
|
2425
2408
|
{
|
|
2426
2409
|
type: "button",
|
|
@@ -2432,7 +2415,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2432
2415
|
);
|
|
2433
2416
|
break;
|
|
2434
2417
|
case "record": {
|
|
2435
|
-
const d =
|
|
2418
|
+
const d = k();
|
|
2436
2419
|
d.length > 0 && u.push({
|
|
2437
2420
|
type: "dropdown",
|
|
2438
2421
|
label: "Actions",
|
|
@@ -2442,17 +2425,17 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2442
2425
|
}
|
|
2443
2426
|
}
|
|
2444
2427
|
return u;
|
|
2445
|
-
}),
|
|
2428
|
+
}), N = T(() => {
|
|
2446
2429
|
const u = [];
|
|
2447
|
-
return
|
|
2430
|
+
return S.value === "records" && c.value ? u.push(
|
|
2448
2431
|
{ title: "Home", to: "/" },
|
|
2449
|
-
{ title:
|
|
2450
|
-
) :
|
|
2432
|
+
{ title: x(c.value), to: `/${c.value}` }
|
|
2433
|
+
) : S.value === "record" && c.value && u.push(
|
|
2451
2434
|
{ title: "Home", to: "/" },
|
|
2452
|
-
{ title:
|
|
2453
|
-
{ title:
|
|
2435
|
+
{ title: x(c.value), to: `/${c.value}` },
|
|
2436
|
+
{ title: w.value ? "New Record" : "Edit Record", to: a.value?.fullPath || "" }
|
|
2454
2437
|
), u;
|
|
2455
|
-
}),
|
|
2438
|
+
}), A = (u) => {
|
|
2456
2439
|
const d = [
|
|
2457
2440
|
{
|
|
2458
2441
|
title: "Go Home",
|
|
@@ -2462,20 +2445,20 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2462
2445
|
{
|
|
2463
2446
|
title: "Toggle Command Palette",
|
|
2464
2447
|
description: "Open/close the command palette",
|
|
2465
|
-
action: () =>
|
|
2448
|
+
action: () => r.value = !r.value
|
|
2466
2449
|
}
|
|
2467
2450
|
];
|
|
2468
2451
|
return c.value && (d.push({
|
|
2469
|
-
title: `View ${
|
|
2452
|
+
title: `View ${x(c.value)} Records`,
|
|
2470
2453
|
description: `Navigate to ${c.value} list`,
|
|
2471
2454
|
action: () => void l.value?.push(`/${c.value}`)
|
|
2472
2455
|
}), d.push({
|
|
2473
|
-
title: `Create New ${
|
|
2456
|
+
title: `Create New ${x(c.value)}`,
|
|
2474
2457
|
description: `Create a new ${c.value} record`,
|
|
2475
|
-
action: () => void
|
|
2458
|
+
action: () => void z()
|
|
2476
2459
|
})), o.availableDoctypes.forEach((b) => {
|
|
2477
2460
|
d.push({
|
|
2478
|
-
title: `View ${
|
|
2461
|
+
title: `View ${x(b)}`,
|
|
2479
2462
|
description: `Navigate to ${b} list`,
|
|
2480
2463
|
action: () => void l.value?.push(`/${b}`)
|
|
2481
2464
|
});
|
|
@@ -2483,15 +2466,15 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2483
2466
|
(b) => b.title.toLowerCase().includes(u.toLowerCase()) || b.description.toLowerCase().includes(u.toLowerCase())
|
|
2484
2467
|
) : d;
|
|
2485
2468
|
}, P = (u) => {
|
|
2486
|
-
u.action(),
|
|
2487
|
-
},
|
|
2469
|
+
u.action(), r.value = !1;
|
|
2470
|
+
}, x = (u) => u.split("-").map((d) => d.charAt(0).toUpperCase() + d.slice(1)).join(" "), W = (u) => e.value ? e.value.getRecordIds(u).length : 0, J = async (u) => {
|
|
2488
2471
|
await l.value?.push(`/${u}`);
|
|
2489
2472
|
}, K = async (u) => {
|
|
2490
2473
|
await l.value?.push(`/${c.value}/${u}`);
|
|
2491
|
-
},
|
|
2474
|
+
}, z = async () => {
|
|
2492
2475
|
const u = `new-${Date.now()}`;
|
|
2493
2476
|
await l.value?.push(`/${c.value}/${u}`);
|
|
2494
|
-
},
|
|
2477
|
+
}, _ = (u) => {
|
|
2495
2478
|
if (e.value)
|
|
2496
2479
|
try {
|
|
2497
2480
|
e.value.records(u);
|
|
@@ -2502,8 +2485,8 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2502
2485
|
const u = o.availableDoctypes.map((d) => ({
|
|
2503
2486
|
id: d,
|
|
2504
2487
|
doctype: d,
|
|
2505
|
-
display_name:
|
|
2506
|
-
record_count:
|
|
2488
|
+
display_name: x(d),
|
|
2489
|
+
record_count: W(d),
|
|
2507
2490
|
actions: "View Records"
|
|
2508
2491
|
}));
|
|
2509
2492
|
return [
|
|
@@ -2563,7 +2546,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2563
2546
|
}, m = () => {
|
|
2564
2547
|
if (!s.value) return [];
|
|
2565
2548
|
if (!e.value) return [];
|
|
2566
|
-
const u =
|
|
2549
|
+
const u = C(), d = L();
|
|
2567
2550
|
if (d.length === 0)
|
|
2568
2551
|
return [
|
|
2569
2552
|
{
|
|
@@ -2574,9 +2557,9 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2574
2557
|
<nav class="breadcrumbs">
|
|
2575
2558
|
<a href="/">Home</a>
|
|
2576
2559
|
<span class="separator">/</span>
|
|
2577
|
-
<span class="current">${
|
|
2560
|
+
<span class="current">${x(c.value || s.value)}</span>
|
|
2578
2561
|
</nav>
|
|
2579
|
-
<h1>${
|
|
2562
|
+
<h1>${x(c.value || s.value)} Records</h1>
|
|
2580
2563
|
</div>
|
|
2581
2564
|
`
|
|
2582
2565
|
},
|
|
@@ -2585,7 +2568,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2585
2568
|
component: "div",
|
|
2586
2569
|
value: `
|
|
2587
2570
|
<div class="loading-state">
|
|
2588
|
-
<p>Loading ${
|
|
2571
|
+
<p>Loading ${x(c.value || s.value)} schema...</p>
|
|
2589
2572
|
</div>
|
|
2590
2573
|
`
|
|
2591
2574
|
}
|
|
@@ -2605,9 +2588,9 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2605
2588
|
<nav class="breadcrumbs">
|
|
2606
2589
|
<a href="/">Home</a>
|
|
2607
2590
|
<span class="separator">/</span>
|
|
2608
|
-
<span class="current">${
|
|
2591
|
+
<span class="current">${x(c.value || s.value)}</span>
|
|
2609
2592
|
</nav>
|
|
2610
|
-
<h1>${
|
|
2593
|
+
<h1>${x(c.value || s.value)} Records</h1>
|
|
2611
2594
|
</div>
|
|
2612
2595
|
`
|
|
2613
2596
|
},
|
|
@@ -2617,7 +2600,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2617
2600
|
value: `
|
|
2618
2601
|
<div class="view-actions">
|
|
2619
2602
|
<button class="btn-primary" data-action="create">
|
|
2620
|
-
New ${
|
|
2603
|
+
New ${x(c.value || s.value)}
|
|
2621
2604
|
</button>
|
|
2622
2605
|
</div>
|
|
2623
2606
|
`
|
|
@@ -2680,13 +2663,13 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2680
2663
|
<nav class="breadcrumbs">
|
|
2681
2664
|
<a href="/">Home</a>
|
|
2682
2665
|
<span class="separator">/</span>
|
|
2683
|
-
<a href="/${c.value || s.value}">${
|
|
2666
|
+
<a href="/${c.value || s.value}">${x(
|
|
2684
2667
|
c.value || s.value
|
|
2685
2668
|
)}</a>
|
|
2686
2669
|
<span class="separator">/</span>
|
|
2687
|
-
<span class="current">${
|
|
2670
|
+
<span class="current">${w.value ? "New Record" : p.value}</span>
|
|
2688
2671
|
</nav>
|
|
2689
|
-
<h1>${
|
|
2672
|
+
<h1>${w.value ? `New ${x(c.value || s.value)}` : `Edit ${x(c.value || s.value)}`}</h1>
|
|
2690
2673
|
</div>
|
|
2691
2674
|
`
|
|
2692
2675
|
},
|
|
@@ -2695,12 +2678,12 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2695
2678
|
component: "div",
|
|
2696
2679
|
value: `
|
|
2697
2680
|
<div class="loading-state">
|
|
2698
|
-
<p>Loading ${
|
|
2681
|
+
<p>Loading ${x(c.value || s.value)} form...</p>
|
|
2699
2682
|
</div>
|
|
2700
2683
|
`
|
|
2701
2684
|
}
|
|
2702
2685
|
];
|
|
2703
|
-
const b = "toArray" in d.schema ? d.schema.toArray() : d.schema, I =
|
|
2686
|
+
const b = "toArray" in d.schema ? d.schema.toArray() : d.schema, I = E();
|
|
2704
2687
|
return [
|
|
2705
2688
|
{
|
|
2706
2689
|
fieldname: "header",
|
|
@@ -2710,14 +2693,14 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2710
2693
|
<nav class="breadcrumbs">
|
|
2711
2694
|
<a href="/">Home</a>
|
|
2712
2695
|
<span class="separator">/</span>
|
|
2713
|
-
<a href="/${c.value || s.value}">${
|
|
2696
|
+
<a href="/${c.value || s.value}">${x(
|
|
2714
2697
|
c.value || s.value
|
|
2715
2698
|
)}</a>
|
|
2716
2699
|
<span class="separator">/</span>
|
|
2717
|
-
<span class="current">${
|
|
2700
|
+
<span class="current">${w.value ? "New Record" : p.value}</span>
|
|
2718
2701
|
</nav>
|
|
2719
2702
|
<h1>
|
|
2720
|
-
${
|
|
2703
|
+
${w.value ? `New ${x(c.value || s.value)}` : `Edit ${x(c.value || s.value)}`}
|
|
2721
2704
|
</h1>
|
|
2722
2705
|
</div>
|
|
2723
2706
|
`
|
|
@@ -2731,7 +2714,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2731
2714
|
${n.value ? "Saving..." : "Save"}
|
|
2732
2715
|
</button>
|
|
2733
2716
|
<button class="btn-secondary" data-action="cancel">Cancel</button>
|
|
2734
|
-
${
|
|
2717
|
+
${w.value ? "" : '<button class="btn-danger" data-action="delete">Delete</button>'}
|
|
2735
2718
|
</div>
|
|
2736
2719
|
`
|
|
2737
2720
|
},
|
|
@@ -2748,18 +2731,18 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2748
2731
|
component: "div",
|
|
2749
2732
|
value: `
|
|
2750
2733
|
<div class="error-state">
|
|
2751
|
-
<p>Unable to load form schema for ${
|
|
2734
|
+
<p>Unable to load form schema for ${x(c.value || s.value)}</p>
|
|
2752
2735
|
</div>
|
|
2753
2736
|
`
|
|
2754
2737
|
}
|
|
2755
2738
|
];
|
|
2756
2739
|
}
|
|
2757
|
-
},
|
|
2740
|
+
}, C = () => {
|
|
2758
2741
|
if (!e.value || !s.value)
|
|
2759
2742
|
return [];
|
|
2760
2743
|
const d = e.value.records(s.value)?.get("");
|
|
2761
2744
|
return d && typeof d == "object" && !Array.isArray(d) ? Object.values(d) : [];
|
|
2762
|
-
},
|
|
2745
|
+
}, L = () => {
|
|
2763
2746
|
if (!e.value || !s.value) return [];
|
|
2764
2747
|
try {
|
|
2765
2748
|
const d = e.value.registry.registry[s.value];
|
|
@@ -2772,8 +2755,8 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2772
2755
|
} catch {
|
|
2773
2756
|
}
|
|
2774
2757
|
return [];
|
|
2775
|
-
},
|
|
2776
|
-
switch (
|
|
2758
|
+
}, E = () => !e.value || !s.value || w.value ? {} : e.value.getRecordById(s.value, p.value)?.get("") || {}, h = T(() => {
|
|
2759
|
+
switch (S.value) {
|
|
2777
2760
|
case "doctypes":
|
|
2778
2761
|
return U();
|
|
2779
2762
|
case "records":
|
|
@@ -2783,7 +2766,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2783
2766
|
default:
|
|
2784
2767
|
return [];
|
|
2785
2768
|
}
|
|
2786
|
-
}), $ =
|
|
2769
|
+
}), $ = R([]);
|
|
2787
2770
|
H(
|
|
2788
2771
|
h,
|
|
2789
2772
|
(u) => {
|
|
@@ -2793,7 +2776,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2793
2776
|
), H(
|
|
2794
2777
|
$,
|
|
2795
2778
|
(u) => {
|
|
2796
|
-
if (!(!e.value || !s.value || !p.value ||
|
|
2779
|
+
if (!(!e.value || !s.value || !p.value || w.value))
|
|
2797
2780
|
try {
|
|
2798
2781
|
const d = e.value.getStore();
|
|
2799
2782
|
u.forEach((b) => {
|
|
@@ -2813,7 +2796,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2813
2796
|
n.value = !0;
|
|
2814
2797
|
try {
|
|
2815
2798
|
const u = i.value || {};
|
|
2816
|
-
if (
|
|
2799
|
+
if (w.value) {
|
|
2817
2800
|
const d = `record-${Date.now()}`, b = { id: d, ...u };
|
|
2818
2801
|
e.value.addRecord(s.value, d, b);
|
|
2819
2802
|
const I = e.value.getRecordById(s.value, d);
|
|
@@ -2837,8 +2820,8 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2837
2820
|
n.value = !1;
|
|
2838
2821
|
}
|
|
2839
2822
|
}
|
|
2840
|
-
},
|
|
2841
|
-
if (
|
|
2823
|
+
}, V = async () => {
|
|
2824
|
+
if (w.value)
|
|
2842
2825
|
await l.value?.push(`/${c.value}`);
|
|
2843
2826
|
else {
|
|
2844
2827
|
if (e.value) {
|
|
@@ -2850,7 +2833,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2850
2833
|
}
|
|
2851
2834
|
f();
|
|
2852
2835
|
}
|
|
2853
|
-
},
|
|
2836
|
+
}, M = (u, d) => {
|
|
2854
2837
|
d && d();
|
|
2855
2838
|
}, G = async (u) => {
|
|
2856
2839
|
if (!e.value) return;
|
|
@@ -2860,20 +2843,20 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2860
2843
|
b && await b.triggerTransition("DELETE", {
|
|
2861
2844
|
currentState: "editing",
|
|
2862
2845
|
targetState: "deleted"
|
|
2863
|
-
}), e.value.removeRecord(s.value, d),
|
|
2846
|
+
}), e.value.removeRecord(s.value, d), S.value === "record" && await l.value?.push(`/${c.value}`);
|
|
2864
2847
|
}
|
|
2865
2848
|
}, g = async (u) => {
|
|
2866
2849
|
const d = u.target, b = d.getAttribute("data-action");
|
|
2867
2850
|
if (b)
|
|
2868
2851
|
switch (b) {
|
|
2869
2852
|
case "create":
|
|
2870
|
-
await
|
|
2853
|
+
await z();
|
|
2871
2854
|
break;
|
|
2872
2855
|
case "save":
|
|
2873
2856
|
await D();
|
|
2874
2857
|
break;
|
|
2875
2858
|
case "cancel":
|
|
2876
|
-
await
|
|
2859
|
+
await V();
|
|
2877
2860
|
break;
|
|
2878
2861
|
case "delete":
|
|
2879
2862
|
await G();
|
|
@@ -2904,9 +2887,9 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2904
2887
|
}
|
|
2905
2888
|
};
|
|
2906
2889
|
H(
|
|
2907
|
-
[
|
|
2890
|
+
[S, s, p],
|
|
2908
2891
|
() => {
|
|
2909
|
-
|
|
2892
|
+
S.value === "record" && f();
|
|
2910
2893
|
},
|
|
2911
2894
|
{ immediate: !0 }
|
|
2912
2895
|
), H(
|
|
@@ -2915,9 +2898,9 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2915
2898
|
},
|
|
2916
2899
|
{ immediate: !0 }
|
|
2917
2900
|
), H(
|
|
2918
|
-
[
|
|
2901
|
+
[S, s, e],
|
|
2919
2902
|
([u, d, b]) => {
|
|
2920
|
-
u === "records" && d && b &&
|
|
2903
|
+
u === "records" && d && b && _(d);
|
|
2921
2904
|
},
|
|
2922
2905
|
{ immediate: !0 }
|
|
2923
2906
|
);
|
|
@@ -2925,7 +2908,7 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2925
2908
|
if (!(!e.value || !s.value)) {
|
|
2926
2909
|
t.value = !0;
|
|
2927
2910
|
try {
|
|
2928
|
-
|
|
2911
|
+
w.value || e.value.getRecordById(s.value, p.value);
|
|
2929
2912
|
} catch (u) {
|
|
2930
2913
|
console.warn("Error loading record data:", u);
|
|
2931
2914
|
} finally {
|
|
@@ -2933,54 +2916,54 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2933
2916
|
}
|
|
2934
2917
|
}
|
|
2935
2918
|
};
|
|
2936
|
-
return
|
|
2919
|
+
return Ue("desktopMethods", {
|
|
2937
2920
|
navigateToDoctype: J,
|
|
2938
2921
|
openRecord: K,
|
|
2939
|
-
createNewRecord:
|
|
2922
|
+
createNewRecord: z,
|
|
2940
2923
|
handleSave: D,
|
|
2941
|
-
handleCancel:
|
|
2924
|
+
handleCancel: V,
|
|
2942
2925
|
handleDelete: G
|
|
2943
|
-
}),
|
|
2926
|
+
}), Te(() => {
|
|
2944
2927
|
oe(() => {
|
|
2945
|
-
|
|
2928
|
+
S.value === "records" && s.value && e.value && _(s.value);
|
|
2946
2929
|
});
|
|
2947
2930
|
const u = (d) => {
|
|
2948
|
-
(d.ctrlKey || d.metaKey) && d.key === "k" && (d.preventDefault(),
|
|
2931
|
+
(d.ctrlKey || d.metaKey) && d.key === "k" && (d.preventDefault(), r.value = !0), d.key === "Escape" && r.value && (r.value = !1);
|
|
2949
2932
|
};
|
|
2950
2933
|
return document.addEventListener("keydown", u), () => {
|
|
2951
2934
|
document.removeEventListener("keydown", u);
|
|
2952
2935
|
};
|
|
2953
|
-
}), (u, d) => (
|
|
2936
|
+
}), (u, d) => (F(), B("div", {
|
|
2954
2937
|
class: "desktop",
|
|
2955
2938
|
onClick: g
|
|
2956
2939
|
}, [
|
|
2957
|
-
se(
|
|
2958
|
-
elements:
|
|
2959
|
-
onActionClick:
|
|
2940
|
+
se(ht, {
|
|
2941
|
+
elements: O.value,
|
|
2942
|
+
onActionClick: M
|
|
2960
2943
|
}, null, 8, ["elements"]),
|
|
2961
|
-
$.value.length > 0 ? (
|
|
2944
|
+
$.value.length > 0 ? (F(), Ke(Ee(Lo), {
|
|
2962
2945
|
key: 0,
|
|
2963
2946
|
modelValue: $.value,
|
|
2964
2947
|
"onUpdate:modelValue": d[0] || (d[0] = (b) => $.value = b),
|
|
2965
2948
|
data: i.value
|
|
2966
|
-
}, null, 8, ["modelValue", "data"])) :
|
|
2967
|
-
|
|
2968
|
-
])) : (
|
|
2969
|
-
|
|
2949
|
+
}, null, 8, ["modelValue", "data"])) : Ee(e) ? (F(), B("div", zo, [
|
|
2950
|
+
j("p", null, "Loading " + Q(S.value) + " data...", 1)
|
|
2951
|
+
])) : (F(), B("div", Wo, [...d[2] || (d[2] = [
|
|
2952
|
+
j("p", null, "Initializing Stonecrop...", -1)
|
|
2970
2953
|
])])),
|
|
2971
|
-
se(
|
|
2972
|
-
se(
|
|
2973
|
-
"is-open":
|
|
2974
|
-
search:
|
|
2954
|
+
se(St, { breadcrumbs: N.value }, null, 8, ["breadcrumbs"]),
|
|
2955
|
+
se(gt, {
|
|
2956
|
+
"is-open": r.value,
|
|
2957
|
+
search: A,
|
|
2975
2958
|
placeholder: "Type a command or search...",
|
|
2976
2959
|
onSelect: P,
|
|
2977
|
-
onClose: d[1] || (d[1] = (b) =>
|
|
2960
|
+
onClose: d[1] || (d[1] = (b) => r.value = !1)
|
|
2978
2961
|
}, {
|
|
2979
|
-
title:
|
|
2980
|
-
|
|
2962
|
+
title: ye(({ result: b }) => [
|
|
2963
|
+
De(Q(b.title), 1)
|
|
2981
2964
|
]),
|
|
2982
|
-
content:
|
|
2983
|
-
|
|
2965
|
+
content: ye(({ result: b }) => [
|
|
2966
|
+
De(Q(b.description), 1)
|
|
2984
2967
|
]),
|
|
2985
2968
|
_: 1
|
|
2986
2969
|
}, 8, ["is-open"])
|
|
@@ -2988,14 +2971,14 @@ const Vo = { class: "aform" }, Po = /* @__PURE__ */ be({
|
|
|
2988
2971
|
}
|
|
2989
2972
|
}), qo = {
|
|
2990
2973
|
install: (o) => {
|
|
2991
|
-
o.component("ActionSet",
|
|
2974
|
+
o.component("ActionSet", ht), o.component("CommandPalette", gt), o.component("Desktop", Ko), o.component("SheetNav", St);
|
|
2992
2975
|
}
|
|
2993
2976
|
};
|
|
2994
2977
|
export {
|
|
2995
|
-
|
|
2996
|
-
|
|
2978
|
+
ht as ActionSet,
|
|
2979
|
+
gt as CommandPalette,
|
|
2997
2980
|
Ko as Desktop,
|
|
2998
|
-
|
|
2981
|
+
St as SheetNav,
|
|
2999
2982
|
qo as StonecropDesktop
|
|
3000
2983
|
};
|
|
3001
2984
|
//# sourceMappingURL=desktop.js.map
|