@kong-ui-public/entities-plugins 9.251.2 → 9.251.3
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/entities-plugins.es.js +5600 -5588
- package/dist/entities-plugins.umd.js +71 -71
- package/dist/filler/cypress/index.js +1 -1
- package/dist/filler/{field-walker-D0yOkGm2.js → field-walker-DNtTknBn.js} +1578 -1566
- package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/form-context.d.ts.map +1 -1
- package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/render-rules.d.ts.map +1 -1
- package/dist/filler/playwright/index.js +1 -1
- package/dist/freeform/index.js +749 -737
- package/dist/types/components/free-form/shared/composables/form-context.d.ts.map +1 -1
- package/dist/types/components/free-form/shared/composables/render-rules.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/freeform/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { toValue as E, computed as
|
|
2
|
-
import { marked as
|
|
3
|
-
import
|
|
4
|
-
import { get as tt, isEqual as fe, omit as
|
|
1
|
+
import { toValue as E, computed as k, ref as se, watch as te, onBeforeUnmount as bt, reactive as Xe, toRef as j, useSlots as we, provide as Pe, inject as Ae, toRaw as Qe, onUnmounted as _t, defineComponent as N, useAttrs as ye, openBlock as b, createBlock as q, unref as i, mergeProps as W, createSlots as J, renderList as re, withCtx as x, renderSlot as O, normalizeProps as De, guardReactiveProps as Ze, createPropsRestProxy as le, resolveComponent as D, withDirectives as Y, createElementBlock as K, createVNode as V, createElementVNode as U, resolveDynamicComponent as oe, createCommentVNode as H, Fragment as ee, vShow as X, useCssVars as wt, useTemplateRef as et, normalizeClass as Te, createTextVNode as pe, toDisplayString as de, withModifiers as Ce, nextTick as $e, Transition as At, useId as kt, useModel as Re, onBeforeMount as St, mergeModels as Ve, withKeys as Ne } from "vue";
|
|
2
|
+
import { marked as Tt } from "marked";
|
|
3
|
+
import Ct from "dompurify";
|
|
4
|
+
import { get as tt, uniqueId as at, isEqual as fe, omit as Pt, cloneDeep as ze, isFunction as He, set as It, upperFirst as Lt } from "lodash-es";
|
|
5
5
|
import { createInjectionState as qt } from "@vueuse/core";
|
|
6
|
-
import { AUTOFILL_SLOT as
|
|
7
|
-
import { createI18n as
|
|
6
|
+
import { AUTOFILL_SLOT as nt } from "@kong-ui-public/forms";
|
|
7
|
+
import { createI18n as ot, i18nTComponent as it } from "@kong-ui-public/i18n";
|
|
8
8
|
import { KTextArea as Mt, KInput as xt, KCheckbox as $t, KCard as Ke, KLabel as Rt, KMultiselect as Vt, KSelect as Kt, KInputSwitch as jt } from "@kong/kongponents";
|
|
9
|
-
import { AddIcon as je, CloseIcon as
|
|
9
|
+
import { AddIcon as je, CloseIcon as rt, TrashIcon as Et, ChevronRightIcon as Ot } from "@kong/icons";
|
|
10
10
|
import { KUI_ICON_SIZE_30 as Ft } from "@kong/design-tokens";
|
|
11
11
|
function Dt(e) {
|
|
12
12
|
return e.map((r) => ({ value: r, label: `${r}` }));
|
|
13
13
|
}
|
|
14
|
-
const Be = "*", Ue = "#",
|
|
14
|
+
const Be = "*", Ue = "#", ce = "$", Ie = ".";
|
|
15
15
|
function R(...e) {
|
|
16
16
|
return e.join(Ie);
|
|
17
17
|
}
|
|
18
18
|
function Ee(...e) {
|
|
19
|
-
return R(
|
|
19
|
+
return R(ce, ...e);
|
|
20
20
|
}
|
|
21
21
|
function We(e) {
|
|
22
|
-
return e.startsWith(R(
|
|
22
|
+
return e.startsWith(R(ce, ""));
|
|
23
23
|
}
|
|
24
24
|
function Z(e) {
|
|
25
25
|
return e.split(Ie).filter((r) => r !== "");
|
|
@@ -28,72 +28,72 @@ function me(e) {
|
|
|
28
28
|
const r = Z(e);
|
|
29
29
|
return r[r.length - 1];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function st(e, r, t, a = "") {
|
|
32
32
|
if (e == null || typeof e != "object") return;
|
|
33
33
|
const s = Array.isArray(e) ? e.map((n, c) => String(c)) : Object.keys(e);
|
|
34
34
|
for (const n of s) {
|
|
35
35
|
const c = a ? R(a, n) : n;
|
|
36
|
-
r(c) ? e[n] = t(c) :
|
|
36
|
+
r(c) ? e[n] = t(c) : st(e[n], r, t, c);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
function Bt(e) {
|
|
40
40
|
const r = E(e);
|
|
41
41
|
return r ? r.type === "set" && r.elements.type === "string" && !r.elements.one_of : !1;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function lt(e, r) {
|
|
44
44
|
return [...e].sort((t, a) => {
|
|
45
45
|
const s = Object.keys(t)[0], n = Object.keys(a)[0], c = r.indexOf(s), d = r.indexOf(n);
|
|
46
46
|
return c === -1 && d === -1 ? 0 : c === -1 ? 1 : d === -1 ? -1 : c - d;
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function ut(e, r) {
|
|
50
50
|
const t = /* @__PURE__ */ new Map();
|
|
51
51
|
e.forEach((o) => {
|
|
52
|
-
const
|
|
53
|
-
t.set(
|
|
52
|
+
const p = Object.keys(o)[0];
|
|
53
|
+
t.set(p, o);
|
|
54
54
|
});
|
|
55
55
|
const a = /* @__PURE__ */ new Map();
|
|
56
|
-
r.forEach((o,
|
|
56
|
+
r.forEach((o, p) => {
|
|
57
57
|
o.forEach((h, l) => {
|
|
58
|
-
a.has(h) || a.set(h, []), a.get(h).push({ bundleIndex:
|
|
58
|
+
a.has(h) || a.set(h, []), a.get(h).push({ bundleIndex: p, position: l });
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
const s = /* @__PURE__ */ new Set(), n = [], c = /* @__PURE__ */ new Set(), d = (o) => {
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
64
|
-
for (const { bundleIndex: h, position: l } of
|
|
62
|
+
const p = a.get(o);
|
|
63
|
+
if (!p) return !0;
|
|
64
|
+
for (const { bundleIndex: h, position: l } of p) {
|
|
65
65
|
const u = r[h];
|
|
66
66
|
for (let f = 0; f < l; f++) {
|
|
67
|
-
const
|
|
68
|
-
if (t.has(
|
|
67
|
+
const y = u[f];
|
|
68
|
+
if (t.has(y) && !s.has(y))
|
|
69
69
|
return !1;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return !0;
|
|
73
|
-
},
|
|
73
|
+
}, m = (o) => {
|
|
74
74
|
if (s.has(o)) return;
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
n.push(
|
|
75
|
+
const p = t.get(o);
|
|
76
|
+
if (!p) return;
|
|
77
|
+
n.push(p), s.add(o), c.delete(o);
|
|
78
78
|
const h = a.get(o);
|
|
79
79
|
if (h)
|
|
80
80
|
for (const { bundleIndex: u, position: f } of h) {
|
|
81
|
-
const
|
|
82
|
-
for (let
|
|
83
|
-
const
|
|
84
|
-
if (!s.has(
|
|
85
|
-
const
|
|
86
|
-
|
|
81
|
+
const y = r[u];
|
|
82
|
+
for (let T = f + 1; T < y.length; T++) {
|
|
83
|
+
const M = y[T];
|
|
84
|
+
if (!s.has(M)) {
|
|
85
|
+
const P = t.get(M);
|
|
86
|
+
P && (n.push(P), s.add(M), c.delete(M));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
const l = Array.from(c);
|
|
91
91
|
for (const u of l)
|
|
92
|
-
d(u) &&
|
|
92
|
+
d(u) && m(u);
|
|
93
93
|
};
|
|
94
94
|
for (const o of e) {
|
|
95
|
-
const
|
|
96
|
-
s.has(
|
|
95
|
+
const p = Object.keys(o)[0];
|
|
96
|
+
s.has(p) || (d(p) ? m(p) : c.add(p));
|
|
97
97
|
}
|
|
98
98
|
return n;
|
|
99
99
|
}
|
|
@@ -106,8 +106,8 @@ function Ut(e) {
|
|
|
106
106
|
}
|
|
107
107
|
return t;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return
|
|
109
|
+
function ct(e) {
|
|
110
|
+
return k(() => Ut(E(e)));
|
|
111
111
|
}
|
|
112
112
|
const Ge = /* @__PURE__ */ Symbol("free-form-field-path"), Oe = /* @__PURE__ */ Symbol("free-form-field-renderer-slots"), Je = /* @__PURE__ */ Symbol("free-form-field-reset-label-path-setting"), ke = "free-form-field-renderers-slot", Nt = {
|
|
113
113
|
tooltipAttributes: {
|
|
@@ -178,11 +178,11 @@ function he(e, r) {
|
|
|
178
178
|
return R(...a);
|
|
179
179
|
}
|
|
180
180
|
function Ht(e) {
|
|
181
|
-
const r = E(e), t =
|
|
181
|
+
const r = E(e), t = k(() => r ? zt(r) : {});
|
|
182
182
|
function a(l) {
|
|
183
183
|
if (l) {
|
|
184
184
|
let u = he(l, t.value || {});
|
|
185
|
-
return u.startsWith(`${
|
|
185
|
+
return u.startsWith(`${ce}${Ie}`) && (u = u.slice(2)), t.value?.[u];
|
|
186
186
|
}
|
|
187
187
|
return r;
|
|
188
188
|
}
|
|
@@ -198,9 +198,9 @@ function Ht(e) {
|
|
|
198
198
|
function n(l, u) {
|
|
199
199
|
const f = {};
|
|
200
200
|
if (Array.isArray(l.fields))
|
|
201
|
-
for (const
|
|
202
|
-
const
|
|
203
|
-
|
|
201
|
+
for (const y of l.fields) {
|
|
202
|
+
const T = Object.keys(y)[0], M = u ? `${u}.${T}` : T, P = s(M, !1);
|
|
203
|
+
P !== void 0 && (f[T] = P);
|
|
204
204
|
}
|
|
205
205
|
return f;
|
|
206
206
|
}
|
|
@@ -208,45 +208,45 @@ function Ht(e) {
|
|
|
208
208
|
return l ? s(l, !0) : n(a(), "");
|
|
209
209
|
}
|
|
210
210
|
function d(l) {
|
|
211
|
-
const u = a(l), f = u?.description ?
|
|
211
|
+
const u = a(l), f = u?.description ? Ct.sanitize(Tt.parse(u.description, { async: !1 })) : void 0;
|
|
212
212
|
return {
|
|
213
213
|
...Nt,
|
|
214
214
|
"data-testid": `ff-label-${l}`,
|
|
215
215
|
info: f
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function m(l) {
|
|
219
219
|
const u = a(l);
|
|
220
220
|
return Dt(u?.one_of || u.elements?.one_of || []);
|
|
221
221
|
}
|
|
222
222
|
function o(l) {
|
|
223
223
|
const u = a(l), f = u?.default;
|
|
224
|
-
let
|
|
224
|
+
let y = null;
|
|
225
225
|
if (u?.type === "foreign" && f?.id)
|
|
226
|
-
|
|
226
|
+
y = f.id;
|
|
227
227
|
else {
|
|
228
228
|
if (f == null || typeof f == "object" || f === "")
|
|
229
229
|
return null;
|
|
230
230
|
if (Array.isArray(f)) {
|
|
231
231
|
if (f.length === 0)
|
|
232
232
|
return null;
|
|
233
|
-
|
|
233
|
+
y = f.join(", ");
|
|
234
234
|
} else
|
|
235
|
-
|
|
235
|
+
y = f.toString();
|
|
236
236
|
}
|
|
237
|
-
return `Default: ${
|
|
237
|
+
return `Default: ${y}`;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function p() {
|
|
240
240
|
return t.value;
|
|
241
241
|
}
|
|
242
242
|
function h(l) {
|
|
243
243
|
return a(l)?.required ? c(l) : null;
|
|
244
244
|
}
|
|
245
245
|
return {
|
|
246
|
-
getSchemaMap:
|
|
246
|
+
getSchemaMap: p,
|
|
247
247
|
getSchema: a,
|
|
248
248
|
getDefault: c,
|
|
249
|
-
getSelectItems:
|
|
249
|
+
getSelectItems: m,
|
|
250
250
|
getLabelAttributes: d,
|
|
251
251
|
getPlaceholder: o,
|
|
252
252
|
getEmptyOrDefault: h
|
|
@@ -260,191 +260,203 @@ function Wt(e, r) {
|
|
|
260
260
|
return typeof r == "object" && r !== null && Fe in r ? fe(e, r[Fe]) : Array.isArray(r) ? r.some((a) => fe(e, a)) : fe(e, r);
|
|
261
261
|
}
|
|
262
262
|
function Gt(e, r) {
|
|
263
|
-
const t =
|
|
264
|
-
function s(g,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
263
|
+
const t = se({}), a = se({});
|
|
264
|
+
function s(g, S, v) {
|
|
265
|
+
a.value[g] = { ...a.value[g], [S]: v ? [...v] : [] };
|
|
266
|
+
}
|
|
267
|
+
function n(g, S) {
|
|
268
|
+
const v = a.value[g];
|
|
269
|
+
if (!v || !(S in v)) return;
|
|
270
|
+
const A = { ...v };
|
|
271
|
+
delete A[S], Object.keys(A).length ? a.value[g] = A : delete a.value[g];
|
|
272
|
+
}
|
|
273
|
+
function c(g, S) {
|
|
274
|
+
const v = g.map((C) => Z(C).length), A = v[0];
|
|
275
|
+
if (!v.every((C) => C === A)) {
|
|
276
|
+
const C = g.map(($, I) => ` - '${$}' is at level ${v[I]}`).join(`
|
|
268
277
|
`);
|
|
269
278
|
throw new Error(
|
|
270
|
-
`${
|
|
271
|
-
${
|
|
279
|
+
`${S}: Fields must be at the same level. Found mixed levels:
|
|
280
|
+
${C}`
|
|
272
281
|
);
|
|
273
282
|
}
|
|
274
283
|
}
|
|
275
|
-
function
|
|
276
|
-
for (const [
|
|
277
|
-
if (!
|
|
278
|
-
for (const
|
|
279
|
-
if (new Set(
|
|
280
|
-
const
|
|
284
|
+
function d(g) {
|
|
285
|
+
for (const [S, v] of Object.entries(g)) {
|
|
286
|
+
if (!v.bundles) continue;
|
|
287
|
+
for (const C of v.bundles)
|
|
288
|
+
if (new Set(C).size !== C.length) {
|
|
289
|
+
const I = C.filter((_, L) => C.indexOf(_) !== L);
|
|
281
290
|
throw new Error(
|
|
282
|
-
`Self-cycle detected in bundle: field '${
|
|
291
|
+
`Self-cycle detected in bundle: field '${I[0]}' appears multiple times in [${C.join(", ")}]`
|
|
283
292
|
);
|
|
284
293
|
}
|
|
285
|
-
const
|
|
286
|
-
for (const
|
|
287
|
-
for (let
|
|
288
|
-
const
|
|
289
|
-
|
|
294
|
+
const A = /* @__PURE__ */ new Map();
|
|
295
|
+
for (const C of v.bundles)
|
|
296
|
+
for (let $ = 1; $ < C.length; $++) {
|
|
297
|
+
const I = C[$], _ = C[$ - 1];
|
|
298
|
+
A.has(I) || A.set(I, /* @__PURE__ */ new Set()), A.get(I).add(_);
|
|
290
299
|
}
|
|
291
|
-
for (const
|
|
292
|
-
let
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
300
|
+
for (const C of A.keys()) {
|
|
301
|
+
let $ = function(L) {
|
|
302
|
+
if (_.includes(L)) {
|
|
303
|
+
const B = [..._, L].join(" -> ");
|
|
295
304
|
throw new Error(
|
|
296
|
-
`Circular bundle detected in path '${
|
|
297
|
-
${
|
|
305
|
+
`Circular bundle detected in path '${S}':
|
|
306
|
+
${B}`
|
|
298
307
|
);
|
|
299
308
|
}
|
|
300
|
-
if (
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
if (
|
|
304
|
-
for (const
|
|
305
|
-
|
|
306
|
-
|
|
309
|
+
if (I.has(L)) return;
|
|
310
|
+
I.add(L), _.push(L);
|
|
311
|
+
const w = A.get(L);
|
|
312
|
+
if (w)
|
|
313
|
+
for (const B of w)
|
|
314
|
+
$(B);
|
|
315
|
+
_.pop();
|
|
307
316
|
};
|
|
308
|
-
const
|
|
309
|
-
|
|
317
|
+
const I = /* @__PURE__ */ new Set(), _ = [];
|
|
318
|
+
$(C);
|
|
310
319
|
}
|
|
311
320
|
}
|
|
312
321
|
}
|
|
313
|
-
function
|
|
314
|
-
for (const [
|
|
315
|
-
if (
|
|
316
|
-
for (const
|
|
317
|
-
let
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
322
|
+
function m(g) {
|
|
323
|
+
for (const [S, v] of Object.entries(g))
|
|
324
|
+
if (v.dependencies)
|
|
325
|
+
for (const A of Object.keys(v.dependencies)) {
|
|
326
|
+
let C = function(_) {
|
|
327
|
+
if (I.includes(_)) {
|
|
328
|
+
const w = [...I, _].join(" -> ");
|
|
320
329
|
throw new Error(
|
|
321
|
-
`Circular dependency detected in path '${
|
|
322
|
-
${
|
|
330
|
+
`Circular dependency detected in path '${S}':
|
|
331
|
+
${w}`
|
|
323
332
|
);
|
|
324
333
|
}
|
|
325
|
-
if (
|
|
326
|
-
|
|
327
|
-
const L =
|
|
334
|
+
if ($.has(_)) return;
|
|
335
|
+
$.add(_), I.push(_);
|
|
336
|
+
const L = v.dependencies[_];
|
|
328
337
|
if (L) {
|
|
329
|
-
const [
|
|
330
|
-
|
|
338
|
+
const [w] = L;
|
|
339
|
+
v.dependencies[w] && C(w);
|
|
331
340
|
}
|
|
332
|
-
|
|
341
|
+
I.pop();
|
|
333
342
|
};
|
|
334
|
-
const
|
|
335
|
-
|
|
343
|
+
const $ = /* @__PURE__ */ new Set(), I = [];
|
|
344
|
+
C(A);
|
|
336
345
|
}
|
|
337
346
|
}
|
|
338
|
-
function
|
|
339
|
-
const
|
|
340
|
-
return
|
|
347
|
+
function o(g, S) {
|
|
348
|
+
const v = g.map((C) => S ? R(S, C) : C), A = Z(v[0]);
|
|
349
|
+
return A.pop(), R(...A);
|
|
341
350
|
}
|
|
342
|
-
function p(g,
|
|
343
|
-
if (!
|
|
344
|
-
const
|
|
345
|
-
return g.startsWith(
|
|
351
|
+
function p(g, S) {
|
|
352
|
+
if (!S) return g;
|
|
353
|
+
const v = `${S}${Ie}`;
|
|
354
|
+
return g.startsWith(v) ? g.slice(v.length) : g;
|
|
346
355
|
}
|
|
347
|
-
function
|
|
348
|
-
const
|
|
349
|
-
return
|
|
356
|
+
function h(g) {
|
|
357
|
+
const S = Z(g);
|
|
358
|
+
return S.pop(), R(...S);
|
|
350
359
|
}
|
|
351
|
-
function
|
|
360
|
+
function l() {
|
|
352
361
|
const g = {};
|
|
353
|
-
for (const [
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
356
|
-
for (const
|
|
357
|
-
if (
|
|
362
|
+
for (const [S, v] of Object.entries(t.value)) {
|
|
363
|
+
const A = S === ce ? "" : S;
|
|
364
|
+
if (v.bundles)
|
|
365
|
+
for (const C of v.bundles) {
|
|
366
|
+
if (C.length < 2)
|
|
358
367
|
throw new Error(
|
|
359
|
-
`Bundle must contain at least 2 fields. Found ${
|
|
368
|
+
`Bundle must contain at least 2 fields. Found ${C.length} field(s) in bundle: [${C.join(", ")}]`
|
|
360
369
|
);
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
g[
|
|
365
|
-
const
|
|
366
|
-
g[
|
|
370
|
+
const $ = C.map((L) => A ? R(A, L) : L);
|
|
371
|
+
c($, `Bundle [${C.join(", ")}]`);
|
|
372
|
+
const I = o(C, A) || ce;
|
|
373
|
+
g[I] || (g[I] = {}), g[I].bundles || (g[I].bundles = []);
|
|
374
|
+
const _ = $.map((L) => p(L, I));
|
|
375
|
+
g[I].bundles.push(_);
|
|
367
376
|
}
|
|
368
|
-
if (
|
|
369
|
-
for (const [
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
[
|
|
373
|
-
`Dependency '${
|
|
377
|
+
if (v.dependencies)
|
|
378
|
+
for (const [C, [$, I]] of Object.entries(v.dependencies)) {
|
|
379
|
+
const _ = A ? R(A, C) : C, L = A ? R(A, $) : $;
|
|
380
|
+
c(
|
|
381
|
+
[_, L],
|
|
382
|
+
`Dependency '${C}' -> '${$}'`
|
|
374
383
|
);
|
|
375
|
-
const
|
|
376
|
-
g[
|
|
377
|
-
const
|
|
378
|
-
g[
|
|
384
|
+
const w = h(_) || ce;
|
|
385
|
+
g[w] || (g[w] = {}), g[w].dependencies || (g[w].dependencies = {});
|
|
386
|
+
const B = p(_, w), z = p(L, w);
|
|
387
|
+
g[w].dependencies[B] = [z, I];
|
|
379
388
|
}
|
|
380
389
|
}
|
|
381
|
-
return
|
|
390
|
+
return d(g), m(g), g;
|
|
382
391
|
}
|
|
383
|
-
const
|
|
392
|
+
const u = k(() => {
|
|
384
393
|
try {
|
|
385
|
-
return
|
|
394
|
+
return l();
|
|
386
395
|
} catch (g) {
|
|
387
396
|
return console.error("Invalid render rules:", g instanceof Error ? g.message : String(g)), {};
|
|
388
397
|
}
|
|
389
398
|
});
|
|
390
|
-
function
|
|
399
|
+
function f(g) {
|
|
391
400
|
if (!g)
|
|
392
|
-
return
|
|
393
|
-
const
|
|
394
|
-
return
|
|
401
|
+
return u.value;
|
|
402
|
+
const S = he(g, e());
|
|
403
|
+
return u.value[S];
|
|
395
404
|
}
|
|
396
|
-
function
|
|
397
|
-
let
|
|
398
|
-
return
|
|
399
|
-
if (
|
|
400
|
-
const
|
|
405
|
+
function y(g) {
|
|
406
|
+
let S = !1;
|
|
407
|
+
return k(() => {
|
|
408
|
+
if (S) return;
|
|
409
|
+
const v = E(g);
|
|
401
410
|
try {
|
|
402
|
-
return
|
|
403
|
-
} catch (
|
|
404
|
-
|
|
411
|
+
return f(v);
|
|
412
|
+
} catch (A) {
|
|
413
|
+
S = !0, console.error(`Failed to get render rules for path: \`${v}\`,`, A instanceof Error ? A.message : "");
|
|
405
414
|
return;
|
|
406
415
|
}
|
|
407
416
|
});
|
|
408
417
|
}
|
|
409
|
-
const
|
|
410
|
-
() => Object.values(
|
|
418
|
+
const T = k(
|
|
419
|
+
() => Object.values(u.value).some(
|
|
411
420
|
(g) => g.dependencies && Object.keys(g.dependencies).length > 0
|
|
412
421
|
)
|
|
413
422
|
);
|
|
414
|
-
function
|
|
423
|
+
function M(g) {
|
|
415
424
|
const {
|
|
416
|
-
fieldPath:
|
|
417
|
-
rules:
|
|
418
|
-
omittedFields:
|
|
419
|
-
} = g;
|
|
425
|
+
fieldPath: S,
|
|
426
|
+
rules: v,
|
|
427
|
+
omittedFields: A
|
|
428
|
+
} = g, C = at("omit-");
|
|
420
429
|
te([
|
|
421
|
-
() => E(
|
|
422
|
-
() => E(
|
|
423
|
-
() => E(
|
|
424
|
-
], ([
|
|
425
|
-
|
|
430
|
+
() => E(v),
|
|
431
|
+
() => E(S),
|
|
432
|
+
() => E(A)
|
|
433
|
+
], ([I, _, L], [, w]) => {
|
|
434
|
+
I ? t.value[_] = I : delete t.value[_], s(_, C, L), w && w !== _ && (delete t.value[w], n(w, C));
|
|
426
435
|
}, { immediate: !0, deep: !0 });
|
|
427
|
-
const
|
|
428
|
-
return
|
|
429
|
-
const
|
|
430
|
-
delete t.value[
|
|
431
|
-
}),
|
|
436
|
+
const $ = y(S);
|
|
437
|
+
return bt(() => {
|
|
438
|
+
const I = E(S);
|
|
439
|
+
delete t.value[I], n(I, C);
|
|
440
|
+
}), $;
|
|
432
441
|
}
|
|
433
|
-
function
|
|
434
|
-
const
|
|
435
|
-
if (!
|
|
436
|
-
const
|
|
437
|
-
if (
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
+
function P(g) {
|
|
443
|
+
const S = Z(g);
|
|
444
|
+
if (!S.length) return !1;
|
|
445
|
+
const v = S[S.length - 1], A = R(...S.slice(0, -1)), C = a.value[A];
|
|
446
|
+
if (C) {
|
|
447
|
+
const z = Object.values(C);
|
|
448
|
+
if (z.length && z.every((ie) => ie.includes(v))) return !1;
|
|
449
|
+
}
|
|
450
|
+
const $ = A === "" ? ce : he(A, e()), I = u.value[$]?.dependencies?.[v];
|
|
451
|
+
if (!I) return !1;
|
|
452
|
+
const [_, L] = I, w = A ? R(A, _) : _, B = tt(r(), Z(w));
|
|
453
|
+
return !Wt(B, L);
|
|
442
454
|
}
|
|
443
455
|
return {
|
|
444
|
-
useCurrentRules:
|
|
445
|
-
createComputedRules:
|
|
446
|
-
hasDependencies:
|
|
447
|
-
isFieldHidden:
|
|
456
|
+
useCurrentRules: M,
|
|
457
|
+
createComputedRules: y,
|
|
458
|
+
hasDependencies: T,
|
|
459
|
+
isFieldHidden: P
|
|
448
460
|
};
|
|
449
461
|
}
|
|
450
462
|
let Jt = 0;
|
|
@@ -454,14 +466,14 @@ function Yt() {
|
|
|
454
466
|
function Xt(e) {
|
|
455
467
|
const r = Xe(/* @__PURE__ */ new Map());
|
|
456
468
|
function t(o = "") {
|
|
457
|
-
const
|
|
458
|
-
return r.set(
|
|
469
|
+
const p = Yt();
|
|
470
|
+
return r.set(p, o), p;
|
|
459
471
|
}
|
|
460
472
|
function a(o) {
|
|
461
473
|
return r.get(o);
|
|
462
474
|
}
|
|
463
|
-
function s(o,
|
|
464
|
-
r.has(o) && r.set(o,
|
|
475
|
+
function s(o, p) {
|
|
476
|
+
r.has(o) && r.set(o, p);
|
|
465
477
|
}
|
|
466
478
|
function n(o) {
|
|
467
479
|
r.delete(o);
|
|
@@ -472,7 +484,7 @@ function Xt(e) {
|
|
|
472
484
|
function d(o) {
|
|
473
485
|
return Zt(o, e, a);
|
|
474
486
|
}
|
|
475
|
-
function
|
|
487
|
+
function m() {
|
|
476
488
|
r.clear();
|
|
477
489
|
}
|
|
478
490
|
return {
|
|
@@ -482,7 +494,7 @@ function Xt(e) {
|
|
|
482
494
|
deleteKey: n,
|
|
483
495
|
serialize: c,
|
|
484
496
|
deserialize: d,
|
|
485
|
-
clear:
|
|
497
|
+
clear: m
|
|
486
498
|
};
|
|
487
499
|
}
|
|
488
500
|
function Qt(e, r, t) {
|
|
@@ -490,21 +502,21 @@ function Qt(e, r, t) {
|
|
|
490
502
|
if (s == null || typeof s != "object")
|
|
491
503
|
return s;
|
|
492
504
|
if (Array.isArray(s))
|
|
493
|
-
return s.map((
|
|
494
|
-
const
|
|
495
|
-
return a(
|
|
505
|
+
return s.map((m, o) => {
|
|
506
|
+
const p = n ? R(n, `${o}`) : `${o}`;
|
|
507
|
+
return a(m, p);
|
|
496
508
|
});
|
|
497
509
|
if ((n ? r(n) : r())?.type === "map") {
|
|
498
|
-
const
|
|
499
|
-
return Object.keys(
|
|
500
|
-
const h = t(
|
|
510
|
+
const m = s, o = {};
|
|
511
|
+
return Object.keys(m).forEach((p) => {
|
|
512
|
+
const h = t(p), l = m[p], u = n ? R(n, p) : p;
|
|
501
513
|
o[h] = a(l, u);
|
|
502
514
|
}), o;
|
|
503
515
|
}
|
|
504
516
|
const d = {};
|
|
505
|
-
return Object.keys(s).forEach((
|
|
506
|
-
const o = n ? R(n,
|
|
507
|
-
d[
|
|
517
|
+
return Object.keys(s).forEach((m) => {
|
|
518
|
+
const o = n ? R(n, m) : m;
|
|
519
|
+
d[m] = a(s[m], o);
|
|
508
520
|
}), d;
|
|
509
521
|
};
|
|
510
522
|
return a(e);
|
|
@@ -514,26 +526,26 @@ function Zt(e, r, t) {
|
|
|
514
526
|
if (s == null || typeof s != "object")
|
|
515
527
|
return s;
|
|
516
528
|
if (Array.isArray(s))
|
|
517
|
-
return s.map((
|
|
518
|
-
const
|
|
519
|
-
return a(
|
|
529
|
+
return s.map((m, o) => {
|
|
530
|
+
const p = n ? R(n, `${o}`) : `${o}`;
|
|
531
|
+
return a(m, p);
|
|
520
532
|
});
|
|
521
533
|
if ((n ? r(n) : r())?.type === "map") {
|
|
522
|
-
const
|
|
523
|
-
return Object.keys(
|
|
524
|
-
const h =
|
|
534
|
+
const m = s, o = {};
|
|
535
|
+
return Object.keys(m).forEach((p) => {
|
|
536
|
+
const h = p, l = m[h], u = t(h);
|
|
525
537
|
if (u == null) {
|
|
526
538
|
console.error(`[FreeForm] Missing name for key ID: ${String(h)}`);
|
|
527
539
|
return;
|
|
528
540
|
}
|
|
529
|
-
const f = u || Ue,
|
|
530
|
-
o[u] = a(l,
|
|
541
|
+
const f = u || Ue, y = n ? R(n, f) : f;
|
|
542
|
+
o[u] = a(l, y);
|
|
531
543
|
}), o;
|
|
532
544
|
}
|
|
533
545
|
const d = {};
|
|
534
|
-
return Object.keys(s).forEach((
|
|
535
|
-
const o = n ? R(n,
|
|
536
|
-
d[
|
|
546
|
+
return Object.keys(s).forEach((m) => {
|
|
547
|
+
const o = n ? R(n, m) : m;
|
|
548
|
+
d[m] = a(s[m], o);
|
|
537
549
|
}), d;
|
|
538
550
|
};
|
|
539
551
|
return a(e);
|
|
@@ -551,54 +563,54 @@ const [ta, aa] = qt(
|
|
|
551
563
|
propsConfig: c
|
|
552
564
|
} = r, {
|
|
553
565
|
getDefault: d,
|
|
554
|
-
getEmptyOrDefault:
|
|
566
|
+
getEmptyOrDefault: m,
|
|
555
567
|
...o
|
|
556
|
-
} = Ht(t),
|
|
557
|
-
Pe(Oe,
|
|
568
|
+
} = Ht(t), p = Xt(o.getSchema), h = /* @__PURE__ */ new Map(), l = Xe({}), u = j(() => c ?? {}), f = we();
|
|
569
|
+
Pe(Oe, Pt(f, "default", ke));
|
|
558
570
|
const {
|
|
559
|
-
useCurrentRules:
|
|
560
|
-
createComputedRules:
|
|
561
|
-
hasDependencies:
|
|
562
|
-
isFieldHidden:
|
|
563
|
-
} = Gt(o.getSchemaMap, () => l),
|
|
564
|
-
fieldPath:
|
|
571
|
+
useCurrentRules: y,
|
|
572
|
+
createComputedRules: T,
|
|
573
|
+
hasDependencies: M,
|
|
574
|
+
isFieldHidden: P
|
|
575
|
+
} = Gt(o.getSchemaMap, () => l), g = y({
|
|
576
|
+
fieldPath: ce,
|
|
565
577
|
rules: n
|
|
566
578
|
});
|
|
567
|
-
function
|
|
568
|
-
Object.keys(l).forEach((
|
|
569
|
-
delete l[
|
|
570
|
-
}),
|
|
579
|
+
function S(w) {
|
|
580
|
+
Object.keys(l).forEach((B) => {
|
|
581
|
+
delete l[B];
|
|
582
|
+
}), p.clear(), Object.assign(l, p.serialize(w));
|
|
571
583
|
}
|
|
572
|
-
function v(
|
|
573
|
-
let
|
|
574
|
-
!
|
|
584
|
+
function v(w) {
|
|
585
|
+
let B;
|
|
586
|
+
!w || !A(E(w)) ? B = d() : B = ze(E(w)), He(u.value.prepareFormData) ? S(u.value.prepareFormData(B)) : S(B);
|
|
575
587
|
}
|
|
576
|
-
function
|
|
577
|
-
return He(u.value.hasValue) ? u.value.hasValue(
|
|
588
|
+
function A(w) {
|
|
589
|
+
return He(u.value.hasValue) ? u.value.hasValue(w) : !!w;
|
|
578
590
|
}
|
|
579
|
-
function
|
|
580
|
-
const
|
|
581
|
-
return
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
),
|
|
591
|
+
function C() {
|
|
592
|
+
const w = ze(E(l));
|
|
593
|
+
return M.value && st(
|
|
594
|
+
w,
|
|
595
|
+
P,
|
|
596
|
+
m
|
|
597
|
+
), p.deserialize(w);
|
|
586
598
|
}
|
|
587
599
|
te(l, () => {
|
|
588
|
-
s?.(
|
|
600
|
+
s?.(C());
|
|
589
601
|
}, { deep: !0 });
|
|
590
|
-
let
|
|
591
|
-
te(() => a?.value, (
|
|
592
|
-
|
|
602
|
+
let $ = !1;
|
|
603
|
+
te(() => a?.value, (w) => {
|
|
604
|
+
$ && fe(C(), E(w)) || (v(w), $ = !0);
|
|
593
605
|
}, { deep: !0, immediate: !0 });
|
|
594
|
-
function
|
|
595
|
-
return
|
|
606
|
+
function I(w) {
|
|
607
|
+
return w != null && typeof w == "object" && !Array.isArray(w) ? p.serialize(w) : w;
|
|
596
608
|
}
|
|
597
|
-
function
|
|
598
|
-
return
|
|
609
|
+
function _(w) {
|
|
610
|
+
return I(d(w));
|
|
599
611
|
}
|
|
600
|
-
function
|
|
601
|
-
return
|
|
612
|
+
function L(w) {
|
|
613
|
+
return I(m(w));
|
|
602
614
|
}
|
|
603
615
|
return {
|
|
604
616
|
/**
|
|
@@ -608,16 +620,16 @@ const [ta, aa] = qt(
|
|
|
608
620
|
schema: t,
|
|
609
621
|
config: u,
|
|
610
622
|
fieldRendererRegistry: h,
|
|
611
|
-
setValue:
|
|
612
|
-
useCurrentRenderRules:
|
|
613
|
-
rootRenderRules:
|
|
614
|
-
createComputedRenderRules:
|
|
623
|
+
setValue: S,
|
|
624
|
+
useCurrentRenderRules: y,
|
|
625
|
+
rootRenderRules: g,
|
|
626
|
+
createComputedRenderRules: T,
|
|
615
627
|
...o,
|
|
616
|
-
getValue:
|
|
617
|
-
isFieldHidden:
|
|
618
|
-
keyIdMap:
|
|
619
|
-
getDefault:
|
|
620
|
-
getEmptyOrDefault:
|
|
628
|
+
getValue: C,
|
|
629
|
+
isFieldHidden: P,
|
|
630
|
+
keyIdMap: p,
|
|
631
|
+
getDefault: _,
|
|
632
|
+
getEmptyOrDefault: L
|
|
621
633
|
};
|
|
622
634
|
}
|
|
623
635
|
);
|
|
@@ -627,54 +639,54 @@ function ae() {
|
|
|
627
639
|
throw new Error("useFormShared() called without provider.");
|
|
628
640
|
return e;
|
|
629
641
|
}
|
|
630
|
-
const
|
|
631
|
-
const r = Ae(Ge,
|
|
642
|
+
const dt = (e) => {
|
|
643
|
+
const r = Ae(Ge, k(() => "")), t = k(() => {
|
|
632
644
|
const a = E(e);
|
|
633
645
|
let s = a;
|
|
634
646
|
return !We(a) && r.value && (s = R(r.value, a)), We(a) && (s = s.slice(Ee("").length)), s;
|
|
635
647
|
});
|
|
636
648
|
return Pe(Ge, t), t;
|
|
637
649
|
}, na = (e) => {
|
|
638
|
-
const { getSchema: r, getSchemaMap: t, fieldRendererRegistry: a } = ae(), { default: s, ...n } = we(), c = Ae(Oe), d =
|
|
639
|
-
const
|
|
650
|
+
const { getSchema: r, getSchemaMap: t, fieldRendererRegistry: a } = ae(), { default: s, ...n } = we(), c = Ae(Oe), d = k(() => {
|
|
651
|
+
const m = E(c), o = t(), p = Object.keys(n).filter((h) => h !== ke && h !== "item").reduce((h, l) => {
|
|
640
652
|
const u = he(R(E(e), l), o);
|
|
641
653
|
return { ...h, [u]: n[l] };
|
|
642
654
|
}, {});
|
|
643
|
-
return
|
|
655
|
+
return m ? { ...m, ...p } : p;
|
|
644
656
|
});
|
|
645
|
-
return Pe(Oe, d),
|
|
657
|
+
return Pe(Oe, d), k(() => {
|
|
646
658
|
if (s) return;
|
|
647
|
-
const
|
|
659
|
+
const m = E(e), o = d.value[he(m, t())];
|
|
648
660
|
if (o) return o;
|
|
649
|
-
const
|
|
661
|
+
const p = t();
|
|
650
662
|
for (const [h, l] of a) {
|
|
651
|
-
const u = he(
|
|
652
|
-
if (h({ path:
|
|
663
|
+
const u = he(m, p);
|
|
664
|
+
if (h({ path: m, genericPath: u, schema: r(m) }))
|
|
653
665
|
return l;
|
|
654
666
|
}
|
|
655
667
|
});
|
|
656
668
|
}, _e = "__FREEFORM_SCHEMA_MAP__";
|
|
657
669
|
function oa(e) {
|
|
658
|
-
const { formData: r } = ae(), t =
|
|
670
|
+
const { formData: r } = ae(), t = dt(e);
|
|
659
671
|
return {
|
|
660
|
-
value:
|
|
672
|
+
value: k({
|
|
661
673
|
get: () => tt(r, Z(t.value)),
|
|
662
|
-
set: (s) =>
|
|
674
|
+
set: (s) => It(r, Z(t.value), s)
|
|
663
675
|
})
|
|
664
676
|
};
|
|
665
677
|
}
|
|
666
|
-
function
|
|
667
|
-
const { getSchema: r, isFieldHidden: t, getEmptyOrDefault: a } = ae(), s =
|
|
678
|
+
function Q(e) {
|
|
679
|
+
const { getSchema: r, isFieldHidden: t, getEmptyOrDefault: a } = ae(), s = dt(e), n = na(s), { value: c } = oa(e), d = k(() => r(s.value)), m = k(() => t(s.value)), o = k(() => a(s.value));
|
|
668
680
|
return d.value ? {
|
|
669
681
|
schema: d,
|
|
670
682
|
path: s,
|
|
671
683
|
renderer: n,
|
|
672
684
|
value: c,
|
|
673
|
-
ancestors:
|
|
685
|
+
ancestors: ct(s),
|
|
674
686
|
/**
|
|
675
687
|
* Hide the field but keep its state.
|
|
676
688
|
*/
|
|
677
|
-
hide:
|
|
689
|
+
hide: m,
|
|
678
690
|
emptyOrDefaultValue: o,
|
|
679
691
|
error: null
|
|
680
692
|
} : {
|
|
@@ -684,29 +696,29 @@ function Y(e) {
|
|
|
684
696
|
function ia(e, r) {
|
|
685
697
|
const t = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new Map();
|
|
686
698
|
function s() {
|
|
687
|
-
return
|
|
699
|
+
return at(`${e}-`);
|
|
688
700
|
}
|
|
689
701
|
function n(c, d) {
|
|
690
702
|
if (c == null || typeof c != "object")
|
|
691
703
|
return `${e}-${d}`;
|
|
692
704
|
if (t.has(c))
|
|
693
705
|
return t.get(c);
|
|
694
|
-
const
|
|
695
|
-
return a.set(d,
|
|
706
|
+
const m = a.has(d) ? a.get(d) : s();
|
|
707
|
+
return a.set(d, m), t.set(c, m), m;
|
|
696
708
|
}
|
|
697
709
|
return te(r, (c) => {
|
|
698
|
-
const d = E(c),
|
|
699
|
-
d.forEach((o,
|
|
700
|
-
|
|
710
|
+
const d = E(c), m = /* @__PURE__ */ new Set();
|
|
711
|
+
d.forEach((o, p) => {
|
|
712
|
+
m.add(p);
|
|
701
713
|
}), Array.from(a.keys()).forEach((o) => {
|
|
702
|
-
|
|
714
|
+
m.has(o) || a.delete(o);
|
|
703
715
|
});
|
|
704
716
|
}, { immediate: !0, deep: !0 }), { getKey: n };
|
|
705
717
|
}
|
|
706
718
|
function Kn(e, r) {
|
|
707
719
|
te(e, (t) => {
|
|
708
720
|
window[_e] || (window[_e] = {}), window[_e][r] = Qe(t);
|
|
709
|
-
}, { immediate: !0, deep: !0 }),
|
|
721
|
+
}, { immediate: !0, deep: !0 }), _t(() => {
|
|
710
722
|
window[_e] && delete window[_e][r];
|
|
711
723
|
});
|
|
712
724
|
}
|
|
@@ -743,22 +755,22 @@ const ra = {
|
|
|
743
755
|
traceid: "TraceID",
|
|
744
756
|
dmq: "DMQ"
|
|
745
757
|
};
|
|
746
|
-
function
|
|
758
|
+
function pt(e) {
|
|
747
759
|
return ra[e.toLocaleLowerCase()] ?? e;
|
|
748
760
|
}
|
|
749
|
-
function
|
|
750
|
-
return e.split("_").map(
|
|
761
|
+
function mt(e) {
|
|
762
|
+
return e.split("_").map(pt).join(" ");
|
|
751
763
|
}
|
|
752
764
|
function sa(e, r) {
|
|
753
765
|
const t = Ae(Je, {
|
|
754
766
|
parentPath: null,
|
|
755
767
|
isolate: !1
|
|
756
|
-
}), { parentPath: a, isolate: s } = E(t), n =
|
|
768
|
+
}), { parentPath: a, isolate: s } = E(t), n = se(a ? R(a, e) : e), c = se({
|
|
757
769
|
parentPath: n.value,
|
|
758
770
|
isolate: s
|
|
759
771
|
});
|
|
760
|
-
return te([j(r), j(t)], ([d,
|
|
761
|
-
const { parentPath: o, isolate:
|
|
772
|
+
return te([j(r), j(t)], ([d, m]) => {
|
|
773
|
+
const { parentPath: o, isolate: p } = m, h = o ? R(o, e) : e;
|
|
762
774
|
d ? {
|
|
763
775
|
isolate: () => {
|
|
764
776
|
n.value = e, c.value.isolate = !0, c.value.parentPath = null;
|
|
@@ -775,25 +787,25 @@ function sa(e, r) {
|
|
|
775
787
|
inherit: () => {
|
|
776
788
|
n.value = h, c.value.isolate = !1, c.value.parentPath = h;
|
|
777
789
|
}
|
|
778
|
-
}[d]?.() :
|
|
790
|
+
}[d]?.() : p && (n.value = e, c.value.isolate = !0, c.value.parentPath = null);
|
|
779
791
|
}, { deep: !0, immediate: !0 }), Pe(Je, c), n;
|
|
780
792
|
}
|
|
781
|
-
function
|
|
782
|
-
return Z(e).map((t) => t.split("_").map(
|
|
793
|
+
function ft(e) {
|
|
794
|
+
return Z(e).map((t) => t.split("_").map(pt).join(" ")).map(Lt).join(" › ");
|
|
783
795
|
}
|
|
784
796
|
function la(e, r) {
|
|
785
|
-
const t = E(e), a = me(t), { config: s, getSchema: n } = ae(), c = sa(a, r), d =
|
|
786
|
-
return
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
797
|
+
const t = E(e), a = me(t), { config: s, getSchema: n } = ae(), c = sa(a, r), d = ct(e);
|
|
798
|
+
return k(() => {
|
|
799
|
+
const m = c.value ?? a, o = d.value.parent?.path ? n(d.value.parent.path) : null, p = o?.type === "array", h = o?.type === "map";
|
|
800
|
+
if (p || h)
|
|
789
801
|
return "";
|
|
790
|
-
const l =
|
|
802
|
+
const l = ft(m);
|
|
791
803
|
return s.value.transformLabel ? s.value.transformLabel(l, t) : l;
|
|
792
804
|
});
|
|
793
805
|
}
|
|
794
806
|
function ne(e, r) {
|
|
795
807
|
const { getLabelAttributes: t, getPlaceholder: a, getSchema: s } = ae(), n = E(e), c = E(r), d = la(e, j(() => E(r).resetLabelPath));
|
|
796
|
-
return
|
|
808
|
+
return k(() => ({
|
|
797
809
|
...c,
|
|
798
810
|
placeholder: c.placeholder ?? a(n) ?? void 0,
|
|
799
811
|
labelAttributes: c.labelAttributes ?? t(n),
|
|
@@ -802,14 +814,14 @@ function ne(e, r) {
|
|
|
802
814
|
}));
|
|
803
815
|
}
|
|
804
816
|
function ua(e, r) {
|
|
805
|
-
const { value: t, ...a } =
|
|
817
|
+
const { value: t, ...a } = Q(e), { getEmptyOrDefault: s, keyIdMap: n } = ae(), c = k(() => {
|
|
806
818
|
if (a.path)
|
|
807
819
|
return a.schema.value.values;
|
|
808
|
-
}), d =
|
|
809
|
-
const
|
|
810
|
-
return [
|
|
820
|
+
}), d = k(() => t ? Object.keys(t.value || {}).map((f) => {
|
|
821
|
+
const y = f, T = n.getKey(y) ?? "";
|
|
822
|
+
return [y, T];
|
|
811
823
|
}) : []);
|
|
812
|
-
function
|
|
824
|
+
function m(u, f) {
|
|
813
825
|
t && (n.updateKey(u, f), t.value = { ...t.value });
|
|
814
826
|
}
|
|
815
827
|
function o() {
|
|
@@ -820,40 +832,40 @@ function ua(e, r) {
|
|
|
820
832
|
[u]: f
|
|
821
833
|
}, u;
|
|
822
834
|
}
|
|
823
|
-
function
|
|
835
|
+
function p(u) {
|
|
824
836
|
if (n.deleteKey(u), !t) return;
|
|
825
|
-
const { [u]: f, ...
|
|
826
|
-
Object.keys(
|
|
837
|
+
const { [u]: f, ...y } = t.value || {};
|
|
838
|
+
Object.keys(y).length === 0 ? a.schema?.value?.required ? t.value = {} : t.value = null : t.value = y;
|
|
827
839
|
}
|
|
828
840
|
function h(u) {
|
|
829
841
|
return n.getKey(u);
|
|
830
842
|
}
|
|
831
|
-
const l =
|
|
843
|
+
const l = k(() => {
|
|
832
844
|
if (!a.path) return "";
|
|
833
845
|
const u = me(a.path.value);
|
|
834
846
|
let f = u;
|
|
835
|
-
return ea(u) && (f = n.getKey(u) ?? ""),
|
|
847
|
+
return ea(u) && (f = n.getKey(u) ?? ""), mt(f);
|
|
836
848
|
});
|
|
837
849
|
if (r && c.value?.type === "string") {
|
|
838
850
|
let u = function() {
|
|
839
851
|
if (!t || !t.value) return null;
|
|
840
|
-
const
|
|
841
|
-
for (const [
|
|
842
|
-
const
|
|
843
|
-
|
|
852
|
+
const y = {};
|
|
853
|
+
for (const [T, M] of Object.entries(t.value)) {
|
|
854
|
+
const P = n.getKey(T);
|
|
855
|
+
P && (y[P] = M);
|
|
844
856
|
}
|
|
845
|
-
return
|
|
857
|
+
return y;
|
|
846
858
|
}, f = null;
|
|
847
|
-
te(() => t?.value, (
|
|
848
|
-
const
|
|
849
|
-
fe(f,
|
|
859
|
+
te(() => t?.value, (y) => {
|
|
860
|
+
const T = u();
|
|
861
|
+
fe(f, T) || (f = T, r?.(T));
|
|
850
862
|
}, { deep: !0 });
|
|
851
863
|
}
|
|
852
864
|
return {
|
|
853
865
|
keys: d,
|
|
854
|
-
updateKey:
|
|
866
|
+
updateKey: m,
|
|
855
867
|
addKey: o,
|
|
856
|
-
removeKey:
|
|
868
|
+
removeKey: p,
|
|
857
869
|
field: a,
|
|
858
870
|
fieldDisplayName: l,
|
|
859
871
|
getKeyName: h
|
|
@@ -864,13 +876,13 @@ const ca = { add_entity: "Add {entity}", remove_entity: "Remove {entity}" }, da
|
|
|
864
876
|
plugins: da
|
|
865
877
|
};
|
|
866
878
|
function ve() {
|
|
867
|
-
const e =
|
|
879
|
+
const e = ot("en-us", pa);
|
|
868
880
|
return {
|
|
869
881
|
i18n: e,
|
|
870
|
-
i18nT:
|
|
882
|
+
i18nT: it(e)
|
|
871
883
|
};
|
|
872
884
|
}
|
|
873
|
-
const be = /* @__PURE__ */
|
|
885
|
+
const be = /* @__PURE__ */ N({
|
|
874
886
|
__name: "EnhancedInput",
|
|
875
887
|
props: {
|
|
876
888
|
modelValue: {},
|
|
@@ -878,31 +890,31 @@ const be = /* @__PURE__ */ U({
|
|
|
878
890
|
},
|
|
879
891
|
emits: ["update:modelValue"],
|
|
880
892
|
setup(e, { emit: r }) {
|
|
881
|
-
const t = e, a = ye(), s = r, n =
|
|
893
|
+
const t = e, a = ye(), s = r, n = k(() => t.multiline ? Mt : xt), c = k(() => a.characterLimit ?? (t.multiline ? !1 : void 0)), d = se(t.modelValue);
|
|
882
894
|
te(() => t.modelValue, (h) => {
|
|
883
895
|
d.value = h;
|
|
884
896
|
});
|
|
885
|
-
const { config:
|
|
886
|
-
h !== d.value && (d.value = h,
|
|
887
|
-
},
|
|
888
|
-
|
|
897
|
+
const { config: m } = ae(), o = (h) => {
|
|
898
|
+
h !== d.value && (d.value = h, m.value.updateOnChange || s("update:modelValue", h));
|
|
899
|
+
}, p = () => {
|
|
900
|
+
m.value.updateOnChange && s("update:modelValue", d.value);
|
|
889
901
|
};
|
|
890
|
-
return (h, l) => (
|
|
902
|
+
return (h, l) => (b(), q(i(n), W(h.$attrs, {
|
|
891
903
|
"character-limit": c.value,
|
|
892
904
|
"model-value": e.modelValue,
|
|
893
905
|
resizable: e.multiline ? !0 : void 0,
|
|
894
|
-
onChange:
|
|
906
|
+
onChange: p,
|
|
895
907
|
"onUpdate:modelValue": o
|
|
896
|
-
}),
|
|
897
|
-
|
|
908
|
+
}), J({ _: 2 }, [
|
|
909
|
+
re(we(), (u, f) => ({
|
|
898
910
|
name: f,
|
|
899
|
-
fn: x((
|
|
900
|
-
O(h.$slots, f, De(Ze(
|
|
911
|
+
fn: x((y) => [
|
|
912
|
+
O(h.$slots, f, De(Ze(y)))
|
|
901
913
|
])
|
|
902
914
|
}))
|
|
903
915
|
]), 1040, ["character-limit", "model-value", "resizable"]));
|
|
904
916
|
}
|
|
905
|
-
}), ma = ["innerHTML"], fa = /* @__PURE__ */
|
|
917
|
+
}), ma = ["innerHTML"], fa = /* @__PURE__ */ N({
|
|
906
918
|
inheritAttrs: !1,
|
|
907
919
|
__name: "StringField",
|
|
908
920
|
props: {
|
|
@@ -928,98 +940,98 @@ const be = /* @__PURE__ */ U({
|
|
|
928
940
|
},
|
|
929
941
|
emits: ["update:modelValue"],
|
|
930
942
|
setup(e, { emit: r }) {
|
|
931
|
-
const t = ye(), { i18n: a } = ve(), s =
|
|
932
|
-
function
|
|
933
|
-
c.value =
|
|
943
|
+
const t = ye(), { i18n: a } = ve(), s = le(e, ["autofocus", "showVaultSecretPicker", "showPasswordMaskToggle", "name"]), n = r, { value: c, hide: d, ...m } = Q(j(() => e.name)), o = ne(m.path, j({ ...s, ...t }));
|
|
944
|
+
function p(T) {
|
|
945
|
+
c.value = T === "" ? null : T, n("update:modelValue", c.value);
|
|
934
946
|
}
|
|
935
|
-
const h =
|
|
936
|
-
return (
|
|
937
|
-
const
|
|
938
|
-
return
|
|
947
|
+
const h = k(() => e.showPasswordMaskToggle !== void 0 ? e.showPasswordMaskToggle : s.type === "password" ? !0 : !!(m.schema?.value).encrypted), l = Ae(nt, void 0), u = k(() => e.showVaultSecretPicker !== void 0 ? e.showVaultSecretPicker : !!m.schema.value?.referenceable), f = k(() => ({ referenceable: u.value })), y = k(() => t["data-1p-ignore"] !== void 0 ? t["data-1p-ignore"] : me(e.name) === "name");
|
|
948
|
+
return (T, M) => {
|
|
949
|
+
const P = D("KAlert");
|
|
950
|
+
return m.error ? (b(), q(P, {
|
|
939
951
|
key: 0,
|
|
940
952
|
appearance: "danger",
|
|
941
|
-
message:
|
|
942
|
-
}, null, 8, ["message"])) :
|
|
943
|
-
V(be,
|
|
953
|
+
message: m.error.message
|
|
954
|
+
}, null, 8, ["message"])) : Y((b(), K("div", De(W({ key: 1 }, T.$attrs)), [
|
|
955
|
+
V(be, W({
|
|
944
956
|
...i(o),
|
|
945
957
|
showPasswordMaskToggle: h.value,
|
|
946
958
|
type: h.value ? "password" : "text"
|
|
947
959
|
}, {
|
|
948
960
|
id: e.inputId,
|
|
949
961
|
class: "ff-string-field",
|
|
950
|
-
"data-1p-ignore":
|
|
962
|
+
"data-1p-ignore": y.value,
|
|
951
963
|
"data-autofocus": e.autofocus ? "true" : void 0,
|
|
952
|
-
"data-testid": `ff-${
|
|
964
|
+
"data-testid": `ff-${m.path.value}`,
|
|
953
965
|
error: e.error,
|
|
954
966
|
"error-message": e.errorMessage,
|
|
955
967
|
help: e.multiline && e.error ? e.errorMessage : e.help,
|
|
956
968
|
"model-value": i(c) ?? "",
|
|
957
969
|
multiline: e.multiline,
|
|
958
970
|
placeholder: e.placeholder ?? i(o).placeholder,
|
|
959
|
-
"onUpdate:modelValue":
|
|
960
|
-
}),
|
|
971
|
+
"onUpdate:modelValue": p
|
|
972
|
+
}), J({ _: 2 }, [
|
|
961
973
|
i(o).labelAttributes?.info ? {
|
|
962
974
|
name: "label-tooltip",
|
|
963
975
|
fn: x(() => [
|
|
964
|
-
O(
|
|
965
|
-
|
|
976
|
+
O(T.$slots, "tooltip", {}, () => [
|
|
977
|
+
U("div", {
|
|
966
978
|
innerHTML: i(o).labelAttributes.info
|
|
967
979
|
}, null, 8, ma)
|
|
968
980
|
], !0)
|
|
969
981
|
]),
|
|
970
982
|
key: "0"
|
|
971
983
|
} : void 0,
|
|
972
|
-
!(e.multiline && e.error) &&
|
|
984
|
+
!(e.multiline && e.error) && T.$slots.help ? {
|
|
973
985
|
name: "help",
|
|
974
986
|
fn: x(() => [
|
|
975
|
-
O(
|
|
987
|
+
O(T.$slots, "help", {}, void 0, !0)
|
|
976
988
|
]),
|
|
977
989
|
key: "1"
|
|
978
990
|
} : void 0,
|
|
979
991
|
!e.multiline && e.inlineVaultPicker ? {
|
|
980
992
|
name: "after",
|
|
981
993
|
fn: x(() => [
|
|
982
|
-
i(l) && u.value ? (
|
|
994
|
+
i(l) && u.value ? (b(), q(oe(i(l)), {
|
|
983
995
|
key: 0,
|
|
984
996
|
schema: f.value,
|
|
985
|
-
update:
|
|
997
|
+
update: p,
|
|
986
998
|
value: i(c) ?? ""
|
|
987
|
-
}, null, 8, ["schema", "value"])) :
|
|
988
|
-
u.value && !i(l) ? (
|
|
999
|
+
}, null, 8, ["schema", "value"])) : H("", !0),
|
|
1000
|
+
u.value && !i(l) ? (b(), q(P, {
|
|
989
1001
|
key: 1,
|
|
990
1002
|
appearance: "warning",
|
|
991
|
-
"data-testid": `ff-vault-secret-picker-warning-${
|
|
1003
|
+
"data-testid": `ff-vault-secret-picker-warning-${m.path.value}`,
|
|
992
1004
|
message: i(a).t("plugins.free-form.vault_picker.component_error")
|
|
993
|
-
}, null, 8, ["data-testid", "message"])) :
|
|
1005
|
+
}, null, 8, ["data-testid", "message"])) : H("", !0)
|
|
994
1006
|
]),
|
|
995
1007
|
key: "2"
|
|
996
1008
|
} : void 0
|
|
997
1009
|
]), 1040, ["id", "data-1p-ignore", "data-autofocus", "data-testid", "error", "error-message", "help", "model-value", "multiline", "placeholder"]),
|
|
998
|
-
e.inlineVaultPicker ?
|
|
999
|
-
i(l) && u.value ? (
|
|
1010
|
+
e.inlineVaultPicker ? H("", !0) : (b(), K(ee, { key: 0 }, [
|
|
1011
|
+
i(l) && u.value ? (b(), q(oe(i(l)), {
|
|
1000
1012
|
key: 0,
|
|
1001
1013
|
schema: f.value,
|
|
1002
|
-
update:
|
|
1014
|
+
update: p,
|
|
1003
1015
|
value: i(c) ?? ""
|
|
1004
|
-
}, null, 8, ["schema", "value"])) :
|
|
1005
|
-
u.value && !i(l) ? (
|
|
1016
|
+
}, null, 8, ["schema", "value"])) : H("", !0),
|
|
1017
|
+
u.value && !i(l) ? (b(), q(P, {
|
|
1006
1018
|
key: 1,
|
|
1007
1019
|
appearance: "warning",
|
|
1008
|
-
"data-testid": `ff-vault-secret-picker-warning-${
|
|
1020
|
+
"data-testid": `ff-vault-secret-picker-warning-${m.path.value}`,
|
|
1009
1021
|
message: i(a).t("plugins.free-form.vault_picker.component_error")
|
|
1010
|
-
}, null, 8, ["data-testid", "message"])) :
|
|
1022
|
+
}, null, 8, ["data-testid", "message"])) : H("", !0)
|
|
1011
1023
|
], 64))
|
|
1012
1024
|
], 16)), [
|
|
1013
|
-
[
|
|
1025
|
+
[X, !i(d)]
|
|
1014
1026
|
]);
|
|
1015
1027
|
};
|
|
1016
1028
|
}
|
|
1017
|
-
}),
|
|
1029
|
+
}), G = (e, r) => {
|
|
1018
1030
|
const t = e.__vccOpts || e;
|
|
1019
1031
|
for (const [a, s] of r)
|
|
1020
1032
|
t[a] = s;
|
|
1021
1033
|
return t;
|
|
1022
|
-
},
|
|
1034
|
+
}, ht = /* @__PURE__ */ G(fa, [["__scopeId", "data-v-ab4f4a8a"]]), ha = ["innerHTML"], ga = /* @__PURE__ */ N({
|
|
1023
1035
|
inheritAttrs: !1,
|
|
1024
1036
|
__name: "BooleanField",
|
|
1025
1037
|
props: {
|
|
@@ -1030,27 +1042,27 @@ const be = /* @__PURE__ */ U({
|
|
|
1030
1042
|
},
|
|
1031
1043
|
emits: ["update:modelValue"],
|
|
1032
1044
|
setup(e, { emit: r }) {
|
|
1033
|
-
const t =
|
|
1034
|
-
a.value =
|
|
1045
|
+
const t = le(e, ["autofocus", "name"]), { value: a, hide: s, emptyOrDefaultValue: n, ...c } = Q(j(() => e.name)), d = r, m = (p) => {
|
|
1046
|
+
a.value = p, d("update:modelValue", p);
|
|
1035
1047
|
}, o = ne(c.path, t);
|
|
1036
|
-
return (
|
|
1048
|
+
return (p, h) => {
|
|
1037
1049
|
const l = D("KAlert");
|
|
1038
|
-
return c.error ? (
|
|
1050
|
+
return c.error ? (b(), q(l, {
|
|
1039
1051
|
key: 0,
|
|
1040
1052
|
appearance: "danger",
|
|
1041
1053
|
message: c.error.message
|
|
1042
|
-
}, null, 8, ["message"])) :
|
|
1054
|
+
}, null, 8, ["message"])) : Y((b(), q(i($t), W({ key: 1 }, { ...i(o), ...p.$attrs }, {
|
|
1043
1055
|
class: "ff-boolean-field",
|
|
1044
1056
|
"data-autofocus": e.autofocus ? "true" : void 0,
|
|
1045
1057
|
"data-testid": `ff-${c.path.value}`,
|
|
1046
1058
|
"model-value": !!(i(a) == null ? i(n) : i(a)),
|
|
1047
|
-
"onUpdate:modelValue":
|
|
1048
|
-
}),
|
|
1059
|
+
"onUpdate:modelValue": m
|
|
1060
|
+
}), J({ _: 2 }, [
|
|
1049
1061
|
i(o).labelAttributes?.info ? {
|
|
1050
1062
|
name: "tooltip",
|
|
1051
1063
|
fn: x(() => [
|
|
1052
|
-
O(
|
|
1053
|
-
|
|
1064
|
+
O(p.$slots, "tooltip", {}, () => [
|
|
1065
|
+
U("div", {
|
|
1054
1066
|
innerHTML: i(o).labelAttributes.info
|
|
1055
1067
|
}, null, 8, ha)
|
|
1056
1068
|
], !0)
|
|
@@ -1058,11 +1070,11 @@ const be = /* @__PURE__ */ U({
|
|
|
1058
1070
|
key: "0"
|
|
1059
1071
|
} : void 0
|
|
1060
1072
|
]), 1040, ["data-autofocus", "data-testid", "model-value"])), [
|
|
1061
|
-
[
|
|
1073
|
+
[X, !i(s)]
|
|
1062
1074
|
]);
|
|
1063
1075
|
};
|
|
1064
1076
|
}
|
|
1065
|
-
}), ya = /* @__PURE__ */
|
|
1077
|
+
}), ya = /* @__PURE__ */ G(ga, [["__scopeId", "data-v-a1c08c7f"]]), va = ["data-testid"], ba = ["innerHTML"], _a = /* @__PURE__ */ N({
|
|
1066
1078
|
inheritAttrs: !1,
|
|
1067
1079
|
__name: "StringArrayField",
|
|
1068
1080
|
props: {
|
|
@@ -1073,46 +1085,46 @@ const be = /* @__PURE__ */ U({
|
|
|
1073
1085
|
},
|
|
1074
1086
|
emits: ["update:modelValue"],
|
|
1075
1087
|
setup(e, { emit: r }) {
|
|
1076
|
-
const t = ye(), a =
|
|
1077
|
-
function h(
|
|
1078
|
-
return
|
|
1088
|
+
const t = ye(), a = le(e, ["autofocus", "name"]), s = r, { value: n, hide: c, ...d } = Q(j(() => e.name)), m = ne(d.path, j({ ...a, ...t })), o = k(() => d.schema?.value?.len_min && d.schema.value.len_min > 0), p = se("");
|
|
1089
|
+
function h(y) {
|
|
1090
|
+
return y.map((T) => T.trim()).filter(Boolean).join(", ");
|
|
1079
1091
|
}
|
|
1080
|
-
function l(
|
|
1081
|
-
return
|
|
1092
|
+
function l(y) {
|
|
1093
|
+
return y.trim().split(",").map((T) => T.trim()).filter(Boolean);
|
|
1082
1094
|
}
|
|
1083
|
-
function u(
|
|
1084
|
-
|
|
1085
|
-
const
|
|
1086
|
-
n.value =
|
|
1095
|
+
function u(y) {
|
|
1096
|
+
p.value = y;
|
|
1097
|
+
const T = l(y), M = !T.length && o.value ? null : T;
|
|
1098
|
+
n.value = M, s("update:modelValue", M);
|
|
1087
1099
|
}
|
|
1088
|
-
const f =
|
|
1089
|
-
return te(n, (
|
|
1090
|
-
const
|
|
1091
|
-
h(l(
|
|
1092
|
-
}, { immediate: !0 }), (
|
|
1093
|
-
const
|
|
1094
|
-
return d.error ? (
|
|
1100
|
+
const f = k(() => t["data-1p-ignore"] !== void 0 ? t["data-1p-ignore"] : me(e.name) === "name");
|
|
1101
|
+
return te(n, (y) => {
|
|
1102
|
+
const T = y ? h(y) : "";
|
|
1103
|
+
h(l(p.value)) !== T && (p.value = T);
|
|
1104
|
+
}, { immediate: !0 }), (y, T) => {
|
|
1105
|
+
const M = D("KAlert");
|
|
1106
|
+
return d.error ? (b(), q(M, {
|
|
1095
1107
|
key: 0,
|
|
1096
1108
|
appearance: "danger",
|
|
1097
1109
|
message: d.error.message
|
|
1098
|
-
}, null, 8, ["message"])) :
|
|
1110
|
+
}, null, 8, ["message"])) : Y((b(), K("div", {
|
|
1099
1111
|
key: 1,
|
|
1100
1112
|
"data-testid": `ff-tag-${d.path.value}`
|
|
1101
1113
|
}, [
|
|
1102
|
-
V(be,
|
|
1114
|
+
V(be, W(i(m), {
|
|
1103
1115
|
class: "ff-tag-field",
|
|
1104
1116
|
"data-1p-ignore": f.value,
|
|
1105
1117
|
"data-autofocus": e.autofocus ? "true" : void 0,
|
|
1106
1118
|
"data-testid": `ff-${d.path.value}`,
|
|
1107
|
-
"model-value":
|
|
1119
|
+
"model-value": p.value ?? "",
|
|
1108
1120
|
"onUpdate:modelValue": u
|
|
1109
|
-
}),
|
|
1110
|
-
i(
|
|
1121
|
+
}), J({ _: 2 }, [
|
|
1122
|
+
i(m).labelAttributes?.info ? {
|
|
1111
1123
|
name: "label-tooltip",
|
|
1112
1124
|
fn: x(() => [
|
|
1113
|
-
O(
|
|
1114
|
-
|
|
1115
|
-
innerHTML: i(
|
|
1125
|
+
O(y.$slots, "tooltip", {}, () => [
|
|
1126
|
+
U("div", {
|
|
1127
|
+
innerHTML: i(m).labelAttributes.info
|
|
1116
1128
|
}, null, 8, ba)
|
|
1117
1129
|
], !0)
|
|
1118
1130
|
]),
|
|
@@ -1120,11 +1132,11 @@ const be = /* @__PURE__ */ U({
|
|
|
1120
1132
|
} : void 0
|
|
1121
1133
|
]), 1040, ["data-1p-ignore", "data-autofocus", "data-testid", "model-value"])
|
|
1122
1134
|
], 8, va)), [
|
|
1123
|
-
[
|
|
1135
|
+
[X, !i(c)]
|
|
1124
1136
|
]);
|
|
1125
1137
|
};
|
|
1126
1138
|
}
|
|
1127
|
-
}),
|
|
1139
|
+
}), gt = /* @__PURE__ */ G(_a, [["__scopeId", "data-v-3aa09162"]]), wa = ["data-appearance", "data-testid"], Aa = ["data-testid"], ka = ["innerHTML"], Sa = ["data-testid"], Ta = { class: "ff-array-field-item-content" }, Ca = ["data-index", "data-testid"], xe = 'input:not(:disabled), textarea:not(:disabled), select:not(:disabled), button:not(:disabled), [contenteditable="true"], [tabindex]:not([tabindex="-1"]):not(:disabled)', Pa = /* @__PURE__ */ N({
|
|
1128
1140
|
__name: "ArrayField",
|
|
1129
1141
|
props: {
|
|
1130
1142
|
name: {},
|
|
@@ -1139,148 +1151,148 @@ const be = /* @__PURE__ */ U({
|
|
|
1139
1151
|
},
|
|
1140
1152
|
emits: ["add", "remove"],
|
|
1141
1153
|
setup(e, { emit: r }) {
|
|
1142
|
-
|
|
1143
|
-
v2cc732dc:
|
|
1154
|
+
wt((_) => ({
|
|
1155
|
+
v2cc732dc: I.value
|
|
1144
1156
|
}));
|
|
1145
|
-
const t = e, a = r, { i18n: { t: s } } = ve(), { getDefault: n, getSchema: c } = ae(), { value: d, hide:
|
|
1157
|
+
const t = e, a = r, { i18n: { t: s } } = ve(), { getDefault: n, getSchema: c } = ae(), { value: d, hide: m, ...o } = Q(j(t, "name")), p = ne(o.path, j({ ...t, ...ye() })), h = k(() => {
|
|
1146
1158
|
if (!o.path) throw new Error("Field path is required for sub-schema retrieval");
|
|
1147
|
-
const
|
|
1148
|
-
if (!
|
|
1149
|
-
return
|
|
1150
|
-
}), l =
|
|
1159
|
+
const _ = c(o.path.value);
|
|
1160
|
+
if (!_) throw new Error(`Schema not found for path: ${o.path.value}`);
|
|
1161
|
+
return _.elements;
|
|
1162
|
+
}), l = k(() => {
|
|
1151
1163
|
if (!o.path) return "";
|
|
1152
|
-
const
|
|
1153
|
-
return
|
|
1154
|
-
}), u =
|
|
1155
|
-
function
|
|
1156
|
-
return typeof t.itemLabel == "function" ? t.itemLabel(
|
|
1164
|
+
const _ = me(o.path.value);
|
|
1165
|
+
return mt(_);
|
|
1166
|
+
}), u = k(() => t.items ?? E(d) ?? []), { getKey: f } = ia("ff-array-field", u), y = k(() => t.appearance ? t.appearance : h.value.type === "record" || h.value.type === "map" ? "card" : "default"), T = k(() => y.value === "card" ? Ke : "div");
|
|
1167
|
+
function M(_, L) {
|
|
1168
|
+
return typeof t.itemLabel == "function" ? t.itemLabel(_, L) : t.itemLabel || p.value.label || `Item #${L}`;
|
|
1157
1169
|
}
|
|
1158
|
-
const
|
|
1159
|
-
hash: `#${f(
|
|
1170
|
+
const P = k(() => u.value.map((_, L) => ({
|
|
1171
|
+
hash: `#${f(_, L)}`,
|
|
1160
1172
|
title: ""
|
|
1161
|
-
}))),
|
|
1162
|
-
const
|
|
1163
|
-
Array.isArray(d.value) || (d.value = []), d.value.push(
|
|
1164
|
-
}, v = async (
|
|
1165
|
-
Array.isArray(d.value) && (d.value.splice(
|
|
1166
|
-
},
|
|
1167
|
-
function
|
|
1168
|
-
if (!
|
|
1173
|
+
}))), g = se(P.value[0]?.hash), S = async () => {
|
|
1174
|
+
const _ = n(R(o.path.value, Be));
|
|
1175
|
+
Array.isArray(d.value) || (d.value = []), d.value.push(_), a("add"), t.appearance === "tabs" && (await $e(), g.value = P.value[P.value.length - 1]?.hash), await $e(), C(u.value.length + 1);
|
|
1176
|
+
}, v = async (_) => {
|
|
1177
|
+
Array.isArray(d.value) && (d.value.splice(_, 1), d.value.length === 0 && !p.value.required && (d.value = null)), a("remove", _), t.appearance === "tabs" && (g.value = P.value[Math.max(0, _ - 1)]?.hash);
|
|
1178
|
+
}, A = et("root");
|
|
1179
|
+
function C(_) {
|
|
1180
|
+
if (!A.value)
|
|
1169
1181
|
return;
|
|
1170
|
-
const
|
|
1171
|
-
if (!
|
|
1182
|
+
const L = Math.max(0, Math.min(_, u.value.length - 1)), w = A.value.querySelector(`[data-index="${L}"]`);
|
|
1183
|
+
if (!w)
|
|
1172
1184
|
return;
|
|
1173
|
-
|
|
1185
|
+
$(w)?.focus();
|
|
1174
1186
|
}
|
|
1175
|
-
function
|
|
1176
|
-
const
|
|
1177
|
-
return
|
|
1187
|
+
function $(_) {
|
|
1188
|
+
const L = _.querySelector('[data-autofocus="true"]');
|
|
1189
|
+
return L ? L.matches(xe) ? L : L.querySelector(xe) : _.querySelector(xe);
|
|
1178
1190
|
}
|
|
1179
|
-
const
|
|
1180
|
-
const { appearance:
|
|
1181
|
-
return
|
|
1191
|
+
const I = k(() => {
|
|
1192
|
+
const { appearance: _, stickyTabs: L } = t;
|
|
1193
|
+
return _ !== "tabs" || L == null || L === !1 ? null : typeof L == "number" ? `${t.stickyTabs}px` : typeof L == "string" ? L : "0";
|
|
1182
1194
|
});
|
|
1183
|
-
return (
|
|
1184
|
-
const
|
|
1185
|
-
return o.error ? (
|
|
1195
|
+
return (_, L) => {
|
|
1196
|
+
const w = D("KAlert"), B = D("KLabel"), z = D("KButton"), ie = D("KTooltip"), yt = D("KTabs");
|
|
1197
|
+
return o.error ? (b(), q(w, {
|
|
1186
1198
|
key: 0,
|
|
1187
1199
|
appearance: "danger",
|
|
1188
1200
|
message: o.error.message
|
|
1189
|
-
}, null, 8, ["message"])) :
|
|
1201
|
+
}, null, 8, ["message"])) : Y((b(), K("div", {
|
|
1190
1202
|
key: 1,
|
|
1191
1203
|
ref_key: "root",
|
|
1192
|
-
ref:
|
|
1204
|
+
ref: A,
|
|
1193
1205
|
class: Te(["ff-array-field", {
|
|
1194
|
-
[`ff-array-field-${
|
|
1206
|
+
[`ff-array-field-${y.value ?? "default"}`]: !0,
|
|
1195
1207
|
"ff-array-field-sticky-tabs": e.stickyTabs
|
|
1196
1208
|
}]),
|
|
1197
|
-
"data-appearance":
|
|
1209
|
+
"data-appearance": y.value,
|
|
1198
1210
|
"data-testid": `ff-array-${o.path.value}`
|
|
1199
1211
|
}, [
|
|
1200
|
-
i(
|
|
1212
|
+
i(p).label && !e.hideLabel ? (b(), K("header", {
|
|
1201
1213
|
key: 0,
|
|
1202
1214
|
class: "ff-array-field-header",
|
|
1203
1215
|
"data-testid": `ff-array-header-${o.path.value}`
|
|
1204
1216
|
}, [
|
|
1205
|
-
V(
|
|
1217
|
+
V(B, W({ class: "ff-array-field-label" }, i(p), {
|
|
1206
1218
|
"data-testid": `ff-label-${o.path.value}`,
|
|
1207
|
-
"tooltip-attributes": i(
|
|
1208
|
-
}),
|
|
1219
|
+
"tooltip-attributes": i(p).labelAttributes.tooltipAttributes
|
|
1220
|
+
}), J({
|
|
1209
1221
|
default: x(() => [
|
|
1210
|
-
pe(
|
|
1222
|
+
pe(de(i(p).label) + " ", 1)
|
|
1211
1223
|
]),
|
|
1212
1224
|
_: 2
|
|
1213
1225
|
}, [
|
|
1214
|
-
i(
|
|
1226
|
+
i(p).labelAttributes?.info ? {
|
|
1215
1227
|
name: "tooltip",
|
|
1216
1228
|
fn: x(() => [
|
|
1217
|
-
O(
|
|
1218
|
-
|
|
1219
|
-
innerHTML: i(
|
|
1229
|
+
O(_.$slots, "tooltip", {}, () => [
|
|
1230
|
+
U("div", {
|
|
1231
|
+
innerHTML: i(p).labelAttributes.info
|
|
1220
1232
|
}, null, 8, ka)
|
|
1221
1233
|
], !0)
|
|
1222
1234
|
]),
|
|
1223
1235
|
key: "0"
|
|
1224
1236
|
} : void 0
|
|
1225
1237
|
]), 1040, ["data-testid", "tooltip-attributes"]),
|
|
1226
|
-
e.appearance === "tabs" ? (
|
|
1238
|
+
e.appearance === "tabs" ? (b(), q(z, {
|
|
1227
1239
|
key: 0,
|
|
1228
1240
|
appearance: "tertiary",
|
|
1229
1241
|
"aria-label": i(s)("actions.add_entity", { entity: l.value }),
|
|
1230
1242
|
"data-testid": `ff-add-item-btn-${o.path.value}`,
|
|
1231
1243
|
icon: "",
|
|
1232
|
-
onClick:
|
|
1244
|
+
onClick: S
|
|
1233
1245
|
}, {
|
|
1234
1246
|
default: x(() => [
|
|
1235
1247
|
V(i(je))
|
|
1236
1248
|
]),
|
|
1237
1249
|
_: 1
|
|
1238
|
-
}, 8, ["aria-label", "data-testid"])) :
|
|
1239
|
-
], 8, Aa)) :
|
|
1240
|
-
|
|
1241
|
-
|
|
1250
|
+
}, 8, ["aria-label", "data-testid"])) : H("", !0)
|
|
1251
|
+
], 8, Aa)) : H("", !0),
|
|
1252
|
+
y.value !== "tabs" ? (b(), K(ee, { key: 1 }, [
|
|
1253
|
+
U("div", {
|
|
1242
1254
|
class: "ff-array-field-container",
|
|
1243
1255
|
"data-testid": `ff-array-basic-container-${o.path.value}`
|
|
1244
1256
|
}, [
|
|
1245
|
-
(
|
|
1246
|
-
key: i(f)(
|
|
1247
|
-
class: Te(["ff-array-field-item", { "ff-array-field-item-card":
|
|
1257
|
+
(b(!0), K(ee, null, re(u.value, (ue, F) => (b(), q(i(T), {
|
|
1258
|
+
key: i(f)(ue, F),
|
|
1259
|
+
class: Te(["ff-array-field-item", { "ff-array-field-item-card": y.value === "card" }]),
|
|
1248
1260
|
"data-index": F,
|
|
1249
1261
|
"data-testid": `ff-array-item-${o.path.value}.${F}`
|
|
1250
1262
|
}, {
|
|
1251
1263
|
default: x(() => [
|
|
1252
|
-
|
|
1253
|
-
|
|
1264
|
+
U("div", Ta, [
|
|
1265
|
+
_.$slots.item ? O(_.$slots, "item", {
|
|
1254
1266
|
key: 0,
|
|
1255
1267
|
autofocus: !0,
|
|
1256
1268
|
fieldName: String(F),
|
|
1257
1269
|
index: F
|
|
1258
|
-
}, void 0, !0) : h.value.type === "array" && h.value.elements.type === "string" ? (
|
|
1270
|
+
}, void 0, !0) : h.value.type === "array" && h.value.elements.type === "string" ? (b(), q(gt, {
|
|
1259
1271
|
key: 1,
|
|
1260
1272
|
autofocus: "",
|
|
1261
1273
|
help: i(s)("plugins.free-form.tag_helper"),
|
|
1262
1274
|
name: String(F)
|
|
1263
|
-
}, null, 8, ["help", "name"])) : (
|
|
1275
|
+
}, null, 8, ["help", "name"])) : (b(), q(ge, {
|
|
1264
1276
|
key: 2,
|
|
1265
1277
|
autofocus: "",
|
|
1266
1278
|
name: String(F)
|
|
1267
1279
|
}, null, 8, ["name"]))
|
|
1268
1280
|
]),
|
|
1269
|
-
V(
|
|
1281
|
+
V(ie, {
|
|
1270
1282
|
class: "ff-array-field-item-remove-tooltip",
|
|
1271
1283
|
text: i(s)("actions.remove_entity", { entity: l.value })
|
|
1272
1284
|
}, {
|
|
1273
1285
|
default: x(() => [
|
|
1274
|
-
V(
|
|
1286
|
+
V(z, {
|
|
1275
1287
|
appearance: "tertiary",
|
|
1276
1288
|
"aria-label": i(s)("actions.remove_entity", { entity: l.value }),
|
|
1277
1289
|
class: "ff-array-field-item-remove",
|
|
1278
1290
|
"data-testid": `ff-array-remove-item-btn-${o.path.value}.${F}`,
|
|
1279
1291
|
icon: "",
|
|
1280
|
-
onClick: Ce((
|
|
1292
|
+
onClick: Ce((vt) => v(F), ["stop"])
|
|
1281
1293
|
}, {
|
|
1282
1294
|
default: x(() => [
|
|
1283
|
-
V(i(
|
|
1295
|
+
V(i(rt))
|
|
1284
1296
|
]),
|
|
1285
1297
|
_: 1
|
|
1286
1298
|
}, 8, ["aria-label", "data-testid", "onClick"])
|
|
@@ -1291,44 +1303,44 @@ const be = /* @__PURE__ */ U({
|
|
|
1291
1303
|
_: 2
|
|
1292
1304
|
}, 1032, ["class", "data-index", "data-testid"]))), 128))
|
|
1293
1305
|
], 8, Sa),
|
|
1294
|
-
V(
|
|
1306
|
+
V(z, {
|
|
1295
1307
|
appearance: "tertiary",
|
|
1296
1308
|
"aria-label": i(s)("actions.add_entity", { entity: l.value }),
|
|
1297
1309
|
class: "ff-array-field-add-item-btn",
|
|
1298
1310
|
"data-testid": `ff-add-item-btn-${o.path.value}`,
|
|
1299
|
-
onClick:
|
|
1311
|
+
onClick: S
|
|
1300
1312
|
}, {
|
|
1301
1313
|
default: x(() => [
|
|
1302
1314
|
V(i(je)),
|
|
1303
|
-
pe(" " +
|
|
1315
|
+
pe(" " + de(i(s)("actions.add_entity", { entity: l.value })), 1)
|
|
1304
1316
|
]),
|
|
1305
1317
|
_: 1
|
|
1306
1318
|
}, 8, ["aria-label", "data-testid"])
|
|
1307
|
-
], 64)) : u.value.length ? (
|
|
1319
|
+
], 64)) : u.value.length ? (b(), q(i(Ke), {
|
|
1308
1320
|
key: 2,
|
|
1309
1321
|
"data-testid": `ff-array-tab-container-${o.path.value}`
|
|
1310
1322
|
}, {
|
|
1311
1323
|
default: x(() => [
|
|
1312
|
-
V(
|
|
1313
|
-
modelValue:
|
|
1314
|
-
"onUpdate:modelValue":
|
|
1324
|
+
V(yt, {
|
|
1325
|
+
modelValue: g.value,
|
|
1326
|
+
"onUpdate:modelValue": L[0] || (L[0] = (ue) => g.value = ue),
|
|
1315
1327
|
"data-testid": `ff-array-tabs-${o.path.value}`,
|
|
1316
|
-
tabs:
|
|
1317
|
-
},
|
|
1318
|
-
|
|
1319
|
-
name: i(f)(
|
|
1328
|
+
tabs: P.value
|
|
1329
|
+
}, J({ _: 2 }, [
|
|
1330
|
+
re(u.value, (ue, F) => ({
|
|
1331
|
+
name: i(f)(ue, F),
|
|
1320
1332
|
fn: x(() => [
|
|
1321
|
-
|
|
1333
|
+
U("div", {
|
|
1322
1334
|
class: "ff-array-field-item",
|
|
1323
1335
|
"data-index": F,
|
|
1324
1336
|
"data-testid": `ff-array-item-${o.path.value}.${F}`
|
|
1325
1337
|
}, [
|
|
1326
|
-
|
|
1338
|
+
_.$slots.item ? O(_.$slots, "item", {
|
|
1327
1339
|
key: 0,
|
|
1328
1340
|
autofocus: !0,
|
|
1329
1341
|
fieldName: String(F),
|
|
1330
1342
|
index: F
|
|
1331
|
-
}, void 0, !0) : (
|
|
1343
|
+
}, void 0, !0) : (b(), q(ge, {
|
|
1332
1344
|
key: 1,
|
|
1333
1345
|
autofocus: "",
|
|
1334
1346
|
name: String(F)
|
|
@@ -1336,17 +1348,17 @@ const be = /* @__PURE__ */ U({
|
|
|
1336
1348
|
], 8, Ca)
|
|
1337
1349
|
])
|
|
1338
1350
|
})),
|
|
1339
|
-
|
|
1340
|
-
name: `${i(f)(
|
|
1351
|
+
re(u.value, (ue, F) => ({
|
|
1352
|
+
name: `${i(f)(ue, F)}-anchor`,
|
|
1341
1353
|
fn: x(() => [
|
|
1342
|
-
pe(
|
|
1343
|
-
V(
|
|
1354
|
+
pe(de(M(ue, F)) + " ", 1),
|
|
1355
|
+
V(z, {
|
|
1344
1356
|
appearance: "tertiary",
|
|
1345
1357
|
"aria-label": i(s)("actions.remove_entity", { entity: l.value }),
|
|
1346
1358
|
class: "ff-array-field-item-remove",
|
|
1347
1359
|
"data-testid": `ff-array-remove-item-btn-${o.path.value}.${F}`,
|
|
1348
1360
|
icon: "",
|
|
1349
|
-
onClick: Ce((
|
|
1361
|
+
onClick: Ce((vt) => v(F), ["stop"])
|
|
1350
1362
|
}, {
|
|
1351
1363
|
default: x(() => [
|
|
1352
1364
|
V(i(Et))
|
|
@@ -1358,13 +1370,13 @@ const be = /* @__PURE__ */ U({
|
|
|
1358
1370
|
]), 1032, ["modelValue", "data-testid", "tabs"])
|
|
1359
1371
|
]),
|
|
1360
1372
|
_: 3
|
|
1361
|
-
}, 8, ["data-testid"])) :
|
|
1373
|
+
}, 8, ["data-testid"])) : H("", !0)
|
|
1362
1374
|
], 10, wa)), [
|
|
1363
|
-
[
|
|
1375
|
+
[X, !i(m)]
|
|
1364
1376
|
]);
|
|
1365
1377
|
};
|
|
1366
1378
|
}
|
|
1367
|
-
}), Ia = /* @__PURE__ */
|
|
1379
|
+
}), Ia = /* @__PURE__ */ G(Pa, [["__scopeId", "data-v-04b60981"]]), La = /* @__PURE__ */ N({
|
|
1368
1380
|
__name: "SlideTransition",
|
|
1369
1381
|
setup(e) {
|
|
1370
1382
|
const r = [
|
|
@@ -1404,7 +1416,7 @@ const be = /* @__PURE__ */ U({
|
|
|
1404
1416
|
});
|
|
1405
1417
|
});
|
|
1406
1418
|
}
|
|
1407
|
-
function
|
|
1419
|
+
function m(l) {
|
|
1408
1420
|
n(l);
|
|
1409
1421
|
}
|
|
1410
1422
|
function o(l) {
|
|
@@ -1414,21 +1426,21 @@ const be = /* @__PURE__ */ U({
|
|
|
1414
1426
|
overflow: "hidden"
|
|
1415
1427
|
});
|
|
1416
1428
|
}
|
|
1417
|
-
function
|
|
1429
|
+
function p(l) {
|
|
1418
1430
|
Object.assign(l.style, a);
|
|
1419
1431
|
}
|
|
1420
1432
|
function h(l) {
|
|
1421
1433
|
n(l);
|
|
1422
1434
|
}
|
|
1423
|
-
return (l, u) => (
|
|
1435
|
+
return (l, u) => (b(), q(At, {
|
|
1424
1436
|
"enter-active-class": "ff-slide-active",
|
|
1425
1437
|
"leave-active-class": "ff-slide-active",
|
|
1426
|
-
onAfterEnter:
|
|
1438
|
+
onAfterEnter: m,
|
|
1427
1439
|
onAfterLeave: h,
|
|
1428
1440
|
onBeforeEnter: c,
|
|
1429
1441
|
onBeforeLeave: o,
|
|
1430
1442
|
onEnter: d,
|
|
1431
|
-
onLeave:
|
|
1443
|
+
onLeave: p
|
|
1432
1444
|
}, {
|
|
1433
1445
|
default: x(() => [
|
|
1434
1446
|
O(l.$slots, "default", {}, void 0, !0)
|
|
@@ -1436,14 +1448,14 @@ const be = /* @__PURE__ */ U({
|
|
|
1436
1448
|
_: 3
|
|
1437
1449
|
}));
|
|
1438
1450
|
}
|
|
1439
|
-
}), qa = /* @__PURE__ */
|
|
1451
|
+
}), qa = /* @__PURE__ */ G(La, [["__scopeId", "data-v-4969409d"]]), Ma = { class: "ff-entity-checks-list" }, xa = /* @__PURE__ */ N({
|
|
1440
1452
|
__name: "EntityChecksAlert",
|
|
1441
1453
|
props: {
|
|
1442
1454
|
entityChecks: {},
|
|
1443
1455
|
visibleFields: {}
|
|
1444
1456
|
},
|
|
1445
1457
|
setup(e) {
|
|
1446
|
-
const { i18n: { t: r } } = ve(), t =
|
|
1458
|
+
const { i18n: { t: r } } = ve(), t = k(() => {
|
|
1447
1459
|
if (!Array.isArray(e.entityChecks) || e.entityChecks.length === 0)
|
|
1448
1460
|
return null;
|
|
1449
1461
|
const n = [], c = [
|
|
@@ -1452,11 +1464,11 @@ const be = /* @__PURE__ */ U({
|
|
|
1452
1464
|
{ key: "mutually_exclusive", i18nKey: "plugins.form.field_rules.mutually_exclusive" }
|
|
1453
1465
|
];
|
|
1454
1466
|
for (const d of e.entityChecks)
|
|
1455
|
-
for (const { key:
|
|
1456
|
-
if (
|
|
1457
|
-
const
|
|
1458
|
-
if (Array.isArray(
|
|
1459
|
-
const h = s(
|
|
1467
|
+
for (const { key: m, i18nKey: o } of c)
|
|
1468
|
+
if (m in d) {
|
|
1469
|
+
const p = d[m];
|
|
1470
|
+
if (Array.isArray(p) && p.length > 0) {
|
|
1471
|
+
const h = s(p);
|
|
1460
1472
|
h.length > 0 && n.push(r(o, {
|
|
1461
1473
|
parameters: a(h)
|
|
1462
1474
|
}));
|
|
@@ -1466,33 +1478,33 @@ const be = /* @__PURE__ */ U({
|
|
|
1466
1478
|
return n.length ? n : null;
|
|
1467
1479
|
});
|
|
1468
1480
|
function a(n) {
|
|
1469
|
-
return n.map(
|
|
1481
|
+
return n.map(ft).join(", ");
|
|
1470
1482
|
}
|
|
1471
1483
|
function s(n) {
|
|
1472
1484
|
return Array.isArray(e.visibleFields) ? n.filter((c) => e.visibleFields.includes(c.split(".")[0])) : n;
|
|
1473
1485
|
}
|
|
1474
1486
|
return (n, c) => {
|
|
1475
1487
|
const d = D("KAlert");
|
|
1476
|
-
return t.value ? (
|
|
1488
|
+
return t.value ? (b(), q(d, {
|
|
1477
1489
|
key: 0,
|
|
1478
1490
|
"data-testid": "ff-entity-checks-alert"
|
|
1479
1491
|
}, {
|
|
1480
1492
|
default: x(() => [
|
|
1481
|
-
|
|
1482
|
-
(
|
|
1483
|
-
key:
|
|
1493
|
+
U("ul", Ma, [
|
|
1494
|
+
(b(!0), K(ee, null, re(t.value, (m) => (b(), K("li", {
|
|
1495
|
+
key: m,
|
|
1484
1496
|
"data-testid": "ff-entity-check-item"
|
|
1485
|
-
},
|
|
1497
|
+
}, de(m), 1))), 128))
|
|
1486
1498
|
])
|
|
1487
1499
|
]),
|
|
1488
1500
|
_: 1
|
|
1489
|
-
})) :
|
|
1501
|
+
})) : H("", !0);
|
|
1490
1502
|
};
|
|
1491
1503
|
}
|
|
1492
|
-
}), Ye = /* @__PURE__ */
|
|
1504
|
+
}), Ye = /* @__PURE__ */ G(xa, [["__scopeId", "data-v-374c59bc"]]), $a = ["data-testid"], Ra = ["data-testid"], Va = ["data-testid"], Ka = { class: "ff-object-field-header-toggle" }, ja = ["aria-controls", "aria-expanded", "aria-label", "data-testid", "disabled"], Ea = ["innerHTML"], Oa = ["data-testid"], Fa = {
|
|
1493
1505
|
key: 0,
|
|
1494
1506
|
class: "indent-guide"
|
|
1495
|
-
}, Da = /* @__PURE__ */
|
|
1507
|
+
}, Da = /* @__PURE__ */ N({
|
|
1496
1508
|
inheritAttrs: !1,
|
|
1497
1509
|
__name: "ObjectField",
|
|
1498
1510
|
props: /* @__PURE__ */ Ve({
|
|
@@ -1518,53 +1530,53 @@ const be = /* @__PURE__ */ U({
|
|
|
1518
1530
|
}),
|
|
1519
1531
|
emits: ["update:added", "update:expanded"],
|
|
1520
1532
|
setup(e) {
|
|
1521
|
-
const r =
|
|
1533
|
+
const r = kt(), t = le(e, ["defaultAdded", "collapsible", "omit", "required", "asChild", "resetLabelPath", "fieldsOrder"]), { value: a, hide: s, ...n } = Q(j(t, "name")), {
|
|
1522
1534
|
getSchema: c,
|
|
1523
1535
|
getDefault: d,
|
|
1524
|
-
useCurrentRenderRules:
|
|
1525
|
-
} = ae(), o =
|
|
1536
|
+
useCurrentRenderRules: m
|
|
1537
|
+
} = ae(), o = m({
|
|
1526
1538
|
fieldPath: n.path,
|
|
1527
1539
|
rules: j(t, "renderRules"),
|
|
1528
1540
|
omittedFields: j(() => e.omit)
|
|
1529
|
-
}),
|
|
1541
|
+
}), p = Re(e, "added"), h = Re(e, "expanded"), l = k(() => {
|
|
1530
1542
|
if (n.ancestors?.value) {
|
|
1531
1543
|
const v = n.ancestors.value.parent;
|
|
1532
1544
|
if (v?.path)
|
|
1533
1545
|
return c(v.path)?.type === "array";
|
|
1534
1546
|
}
|
|
1535
1547
|
return !1;
|
|
1536
|
-
}), u =
|
|
1548
|
+
}), u = k(() => {
|
|
1537
1549
|
if (n.ancestors?.value) {
|
|
1538
1550
|
const v = n.ancestors.value.parent;
|
|
1539
1551
|
if (v?.path)
|
|
1540
1552
|
return c(v.path)?.type === "map";
|
|
1541
1553
|
}
|
|
1542
1554
|
return !1;
|
|
1543
|
-
}), f = ne(n.path, { required: e.required, ...t, resetLabelPath: e.resetLabelPath }),
|
|
1555
|
+
}), f = ne(n.path, { required: e.required, ...t, resetLabelPath: e.resetLabelPath }), y = k(() => f.value.required ? !0 : p.value ?? e.defaultAdded), T = k(() => e.asChild !== void 0 ? e.asChild : l.value), M = k(() => {
|
|
1544
1556
|
let v = n.schema.value.fields;
|
|
1545
|
-
return e.omit && (v = v.filter((
|
|
1546
|
-
}),
|
|
1547
|
-
function
|
|
1557
|
+
return e.omit && (v = v.filter((A) => !e.omit.includes(Object.keys(A)[0]))), e.fieldsOrder ? lt(v, e.fieldsOrder) : (o.value?.bundles && (v = ut([...v], o.value.bundles)), v);
|
|
1558
|
+
}), P = k(() => M.value.map((v) => Object.keys(v)[0]));
|
|
1559
|
+
function g() {
|
|
1548
1560
|
h.value = !h.value;
|
|
1549
1561
|
}
|
|
1550
|
-
function
|
|
1551
|
-
|
|
1562
|
+
function S() {
|
|
1563
|
+
p.value ? a.value = d(n.path.value) : a.value = null;
|
|
1552
1564
|
}
|
|
1553
|
-
return te(
|
|
1565
|
+
return te(y, (v) => {
|
|
1554
1566
|
e.collapsible && (h.value = v);
|
|
1555
|
-
}),
|
|
1567
|
+
}), St(() => {
|
|
1556
1568
|
if (n.error || !a) return;
|
|
1557
1569
|
const v = a.value != null;
|
|
1558
|
-
|
|
1559
|
-
}), (v,
|
|
1560
|
-
const
|
|
1561
|
-
return
|
|
1562
|
-
(
|
|
1563
|
-
n.error ? (
|
|
1570
|
+
p.value = v, (f.value.required || v) && (h.value = !0);
|
|
1571
|
+
}), (v, A) => {
|
|
1572
|
+
const C = D("KAlert"), $ = D("KInputSwitch");
|
|
1573
|
+
return b(), K(ee, null, [
|
|
1574
|
+
(b(), q(oe(v.$slots[i(ke)]))),
|
|
1575
|
+
n.error ? (b(), q(C, {
|
|
1564
1576
|
key: 0,
|
|
1565
1577
|
appearance: "danger",
|
|
1566
1578
|
message: n.error.message
|
|
1567
|
-
}, null, 8, ["message"])) :
|
|
1579
|
+
}, null, 8, ["message"])) : T.value ? Y((b(), K("div", W({
|
|
1568
1580
|
key: 1,
|
|
1569
1581
|
class: "ff-object-field ff-object-field-as-child"
|
|
1570
1582
|
}, v.$attrs, {
|
|
@@ -1573,34 +1585,34 @@ const be = /* @__PURE__ */ U({
|
|
|
1573
1585
|
O(v.$slots, "default", {}, () => [
|
|
1574
1586
|
V(Ye, {
|
|
1575
1587
|
"entity-checks": n.schema.value?.entity_checks,
|
|
1576
|
-
"visible-fields":
|
|
1588
|
+
"visible-fields": P.value
|
|
1577
1589
|
}, null, 8, ["entity-checks", "visible-fields"]),
|
|
1578
|
-
(
|
|
1579
|
-
key: Object.keys(
|
|
1580
|
-
name: Object.keys(
|
|
1590
|
+
(b(!0), K(ee, null, re(M.value, (I) => (b(), q(ge, {
|
|
1591
|
+
key: Object.keys(I)[0],
|
|
1592
|
+
name: Object.keys(I)[0]
|
|
1581
1593
|
}, null, 8, ["name"]))), 128))
|
|
1582
1594
|
], !0)
|
|
1583
1595
|
], 16, $a)), [
|
|
1584
|
-
[
|
|
1585
|
-
]) :
|
|
1596
|
+
[X, !i(s)]
|
|
1597
|
+
]) : Y((b(), K("div", W({
|
|
1586
1598
|
key: 2,
|
|
1587
1599
|
class: ["ff-object-field", { "ff-object-field-collapsed": !h.value }],
|
|
1588
1600
|
"data-testid": `ff-object-${n.path.value}`
|
|
1589
1601
|
}, v.$attrs), [
|
|
1590
|
-
|
|
1602
|
+
U("header", {
|
|
1591
1603
|
class: "ff-object-field-header",
|
|
1592
1604
|
"data-testid": `ff-object-header-${n.path.value}`
|
|
1593
1605
|
}, [
|
|
1594
|
-
|
|
1595
|
-
|
|
1606
|
+
U("div", Ka, [
|
|
1607
|
+
U("button", {
|
|
1596
1608
|
"aria-controls": i(r),
|
|
1597
1609
|
"aria-expanded": h.value,
|
|
1598
1610
|
"aria-label": i(f).label,
|
|
1599
1611
|
class: "ff-object-field-toggle-btn",
|
|
1600
1612
|
"data-testid": `ff-object-toggle-btn-${n.path.value}`,
|
|
1601
|
-
disabled: !
|
|
1613
|
+
disabled: !p.value,
|
|
1602
1614
|
type: "button",
|
|
1603
|
-
onClick: Ce(
|
|
1615
|
+
onClick: Ce(g, ["prevent", "stop"])
|
|
1604
1616
|
}, [
|
|
1605
1617
|
V(i(Ot), {
|
|
1606
1618
|
class: Te(["ff-object-field-toggle-btn-trigger-icon", { "collapse-expanded": h.value }]),
|
|
@@ -1609,7 +1621,7 @@ const be = /* @__PURE__ */ U({
|
|
|
1609
1621
|
size: `var(--kui-icon-size-30, ${i(Ft)})`
|
|
1610
1622
|
}, null, 8, ["class", "data-testid", "size"])
|
|
1611
1623
|
], 8, ja),
|
|
1612
|
-
u.value ?
|
|
1624
|
+
u.value ? H("", !0) : (b(), q(i(Rt), W({
|
|
1613
1625
|
key: 0,
|
|
1614
1626
|
class: "ff-object-field-label",
|
|
1615
1627
|
"data-testid": `ff-label-${n.path.value}`
|
|
@@ -1618,9 +1630,9 @@ const be = /* @__PURE__ */ U({
|
|
|
1618
1630
|
required: !1
|
|
1619
1631
|
}, {
|
|
1620
1632
|
"tooltip-attributes": i(f).labelAttributes.tooltipAttributes
|
|
1621
|
-
}),
|
|
1633
|
+
}), J({
|
|
1622
1634
|
default: x(() => [
|
|
1623
|
-
pe(
|
|
1635
|
+
pe(de(i(f).label) + " ", 1)
|
|
1624
1636
|
]),
|
|
1625
1637
|
_: 2
|
|
1626
1638
|
}, [
|
|
@@ -1628,7 +1640,7 @@ const be = /* @__PURE__ */ U({
|
|
|
1628
1640
|
name: "tooltip",
|
|
1629
1641
|
fn: x(() => [
|
|
1630
1642
|
O(v.$slots, "tooltip", {}, () => [
|
|
1631
|
-
|
|
1643
|
+
U("div", {
|
|
1632
1644
|
innerHTML: i(f).labelAttributes.info
|
|
1633
1645
|
}, null, 8, Ea)
|
|
1634
1646
|
], !0)
|
|
@@ -1637,19 +1649,19 @@ const be = /* @__PURE__ */ U({
|
|
|
1637
1649
|
} : void 0
|
|
1638
1650
|
]), 1040, ["data-testid", "tooltip-attributes"]))
|
|
1639
1651
|
]),
|
|
1640
|
-
i(f).required ?
|
|
1652
|
+
i(f).required ? H("", !0) : (b(), q($, {
|
|
1641
1653
|
key: 0,
|
|
1642
|
-
modelValue:
|
|
1654
|
+
modelValue: p.value,
|
|
1643
1655
|
"onUpdate:modelValue": [
|
|
1644
|
-
|
|
1645
|
-
|
|
1656
|
+
A[0] || (A[0] = (I) => p.value = I),
|
|
1657
|
+
S
|
|
1646
1658
|
],
|
|
1647
1659
|
"data-testid": `ff-object-switch-${n.path.value}`
|
|
1648
1660
|
}, null, 8, ["modelValue", "data-testid"]))
|
|
1649
1661
|
], 8, Va),
|
|
1650
1662
|
V(qa, null, {
|
|
1651
1663
|
default: x(() => [
|
|
1652
|
-
h.value ? (
|
|
1664
|
+
h.value ? (b(), K("div", {
|
|
1653
1665
|
key: 0,
|
|
1654
1666
|
class: "ff-object-field-content",
|
|
1655
1667
|
"data-testid": `ff-object-content-${n.path.value}`
|
|
@@ -1657,28 +1669,28 @@ const be = /* @__PURE__ */ U({
|
|
|
1657
1669
|
O(v.$slots, "default", {}, () => [
|
|
1658
1670
|
V(Ye, {
|
|
1659
1671
|
"entity-checks": n.schema.value?.entity_checks,
|
|
1660
|
-
"visible-fields":
|
|
1672
|
+
"visible-fields": P.value
|
|
1661
1673
|
}, null, 8, ["entity-checks", "visible-fields"]),
|
|
1662
|
-
(
|
|
1663
|
-
key: Object.keys(
|
|
1664
|
-
name: Object.keys(
|
|
1674
|
+
(b(!0), K(ee, null, re(M.value, (I) => (b(), q(ge, {
|
|
1675
|
+
key: Object.keys(I)[0],
|
|
1676
|
+
name: Object.keys(I)[0]
|
|
1665
1677
|
}, null, 8, ["name"]))), 128))
|
|
1666
1678
|
], !0)
|
|
1667
|
-
], 8, Oa)) :
|
|
1679
|
+
], 8, Oa)) : H("", !0)
|
|
1668
1680
|
]),
|
|
1669
1681
|
_: 3
|
|
1670
1682
|
}),
|
|
1671
|
-
h.value ? (
|
|
1683
|
+
h.value ? (b(), K("div", Fa)) : H("", !0)
|
|
1672
1684
|
], 16, Ra)), [
|
|
1673
|
-
[
|
|
1685
|
+
[X, !i(s)]
|
|
1674
1686
|
])
|
|
1675
1687
|
], 64);
|
|
1676
1688
|
};
|
|
1677
1689
|
}
|
|
1678
|
-
}), Ba = /* @__PURE__ */
|
|
1690
|
+
}), Ba = /* @__PURE__ */ G(Da, [["__scopeId", "data-v-66b4c328"]]), Ua = {
|
|
1679
1691
|
key: 1,
|
|
1680
1692
|
class: "ff-number-field-wrapper"
|
|
1681
|
-
}, Na = ["innerHTML"], za = /* @__PURE__ */
|
|
1693
|
+
}, Na = ["innerHTML"], za = /* @__PURE__ */ N({
|
|
1682
1694
|
__name: "NumberField",
|
|
1683
1695
|
props: {
|
|
1684
1696
|
showVaultSecretPicker: { type: Boolean, default: () => {
|
|
@@ -1700,57 +1712,57 @@ const be = /* @__PURE__ */ U({
|
|
|
1700
1712
|
},
|
|
1701
1713
|
emits: ["update:modelValue"],
|
|
1702
1714
|
setup(e, { emit: r }) {
|
|
1703
|
-
const t =
|
|
1704
|
-
const
|
|
1705
|
-
if (typeof
|
|
1706
|
-
return { min:
|
|
1707
|
-
const [
|
|
1715
|
+
const t = le(e, ["autofocus", "showVaultSecretPicker", "name"]), { value: a, hide: s, ...n } = Q(j(() => e.name)), c = ne(n.path, t), { i18n: d } = ve(), m = k(() => {
|
|
1716
|
+
const P = n.schema?.value;
|
|
1717
|
+
if (typeof P.gt == "number")
|
|
1718
|
+
return { min: P.type === "integer" ? P.gt + 1 : P.gt };
|
|
1719
|
+
const [g, S] = P.between ?? [];
|
|
1708
1720
|
return {
|
|
1709
|
-
min: t.min ??
|
|
1710
|
-
max: t.max ??
|
|
1721
|
+
min: t.min ?? g,
|
|
1722
|
+
max: t.max ?? S
|
|
1711
1723
|
};
|
|
1712
|
-
}), o = r,
|
|
1713
|
-
const
|
|
1714
|
-
if (
|
|
1715
|
-
if (
|
|
1716
|
-
const
|
|
1717
|
-
return Number.isFinite(
|
|
1724
|
+
}), o = r, p = a.value, h = k(() => {
|
|
1725
|
+
const P = a?.value;
|
|
1726
|
+
if (P == null || P === "") return "";
|
|
1727
|
+
if (T.value) return `${P}`;
|
|
1728
|
+
const g = typeof P == "number" ? P : Number(P);
|
|
1729
|
+
return Number.isFinite(g) ? `${g}` : "";
|
|
1718
1730
|
});
|
|
1719
|
-
function l(
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1731
|
+
function l(P) {
|
|
1732
|
+
const g = u(P);
|
|
1733
|
+
p !== void 0 && P === "" && g !== p ? (a.value = null, o("update:modelValue", null)) : (a.value = g, o("update:modelValue", g));
|
|
1722
1734
|
}
|
|
1723
|
-
function u(
|
|
1724
|
-
if (
|
|
1725
|
-
const
|
|
1726
|
-
if (
|
|
1727
|
-
const
|
|
1728
|
-
return Number.isFinite(
|
|
1735
|
+
function u(P) {
|
|
1736
|
+
if (P === "") return null;
|
|
1737
|
+
const g = P.trim();
|
|
1738
|
+
if (g === "") return null;
|
|
1739
|
+
const S = Number(g);
|
|
1740
|
+
return Number.isFinite(S) ? S : T.value ? P : null;
|
|
1729
1741
|
}
|
|
1730
|
-
const f = Ae(
|
|
1731
|
-
return (
|
|
1732
|
-
const
|
|
1733
|
-
return n.error ? (
|
|
1742
|
+
const f = Ae(nt, void 0), y = k(() => ({ referenceable: T.value })), T = k(() => e.showVaultSecretPicker !== void 0 ? e.showVaultSecretPicker : !!n.schema.value?.referenceable), M = k(() => T.value ? "text" : "number");
|
|
1743
|
+
return (P, g) => {
|
|
1744
|
+
const S = D("KAlert");
|
|
1745
|
+
return n.error ? (b(), q(S, {
|
|
1734
1746
|
key: 0,
|
|
1735
1747
|
appearance: "danger",
|
|
1736
1748
|
message: n.error.message
|
|
1737
|
-
}, null, 8, ["message"])) :
|
|
1738
|
-
V(be,
|
|
1749
|
+
}, null, 8, ["message"])) : Y((b(), K("div", Ua, [
|
|
1750
|
+
V(be, W({ class: "ff-number-field" }, {
|
|
1739
1751
|
...i(c),
|
|
1740
|
-
min:
|
|
1741
|
-
max:
|
|
1752
|
+
min: m.value.min,
|
|
1753
|
+
max: m.value.max
|
|
1742
1754
|
}, {
|
|
1743
1755
|
"data-autofocus": e.autofocus ? "true" : void 0,
|
|
1744
1756
|
"data-testid": `ff-${n.path.value}`,
|
|
1745
1757
|
"model-value": h.value,
|
|
1746
|
-
type:
|
|
1758
|
+
type: M.value,
|
|
1747
1759
|
"onUpdate:modelValue": l
|
|
1748
|
-
}),
|
|
1760
|
+
}), J({ _: 2 }, [
|
|
1749
1761
|
i(c).labelAttributes?.info ? {
|
|
1750
1762
|
name: "label-tooltip",
|
|
1751
1763
|
fn: x(() => [
|
|
1752
|
-
O(
|
|
1753
|
-
|
|
1764
|
+
O(P.$slots, "tooltip", {}, () => [
|
|
1765
|
+
U("div", {
|
|
1754
1766
|
innerHTML: i(c).labelAttributes.info
|
|
1755
1767
|
}, null, 8, Na)
|
|
1756
1768
|
], !0)
|
|
@@ -1758,24 +1770,24 @@ const be = /* @__PURE__ */ U({
|
|
|
1758
1770
|
key: "0"
|
|
1759
1771
|
} : void 0
|
|
1760
1772
|
]), 1040, ["data-autofocus", "data-testid", "model-value", "type"]),
|
|
1761
|
-
i(f) &&
|
|
1773
|
+
i(f) && T.value ? (b(), q(oe(i(f)), {
|
|
1762
1774
|
key: 0,
|
|
1763
|
-
schema:
|
|
1775
|
+
schema: y.value,
|
|
1764
1776
|
update: l,
|
|
1765
1777
|
value: i(a) ?? ""
|
|
1766
|
-
}, null, 8, ["schema", "value"])) :
|
|
1767
|
-
|
|
1778
|
+
}, null, 8, ["schema", "value"])) : H("", !0),
|
|
1779
|
+
T.value && !i(f) ? (b(), q(S, {
|
|
1768
1780
|
key: 1,
|
|
1769
1781
|
appearance: "warning",
|
|
1770
1782
|
"data-testid": `ff-vault-secret-picker-warning-${n.path.value}`,
|
|
1771
1783
|
message: i(d).t("plugins.free-form.vault_picker.component_error")
|
|
1772
|
-
}, null, 8, ["data-testid", "message"])) :
|
|
1784
|
+
}, null, 8, ["data-testid", "message"])) : H("", !0)
|
|
1773
1785
|
], 512)), [
|
|
1774
|
-
[
|
|
1786
|
+
[X, !i(s)]
|
|
1775
1787
|
]);
|
|
1776
1788
|
};
|
|
1777
1789
|
}
|
|
1778
|
-
}), Ha = /* @__PURE__ */
|
|
1790
|
+
}), Ha = /* @__PURE__ */ G(za, [["__scopeId", "data-v-f303431f"]]), Wa = ["innerHTML"], Ga = /* @__PURE__ */ N({
|
|
1779
1791
|
__name: "EnumField",
|
|
1780
1792
|
props: /* @__PURE__ */ Ve({
|
|
1781
1793
|
labelAttributes: {},
|
|
@@ -1814,44 +1826,44 @@ const be = /* @__PURE__ */ U({
|
|
|
1814
1826
|
}),
|
|
1815
1827
|
emits: /* @__PURE__ */ Ve(["update"], ["update:modelValue"]),
|
|
1816
1828
|
setup(e, { emit: r }) {
|
|
1817
|
-
const t = r, a =
|
|
1829
|
+
const t = r, a = le(e, ["name", "items", "multiple", "autofocus"]), { getSelectItems: s } = ae(), { value: n, hide: c, ...d } = Q(
|
|
1818
1830
|
j(() => e.name)
|
|
1819
|
-
),
|
|
1831
|
+
), m = ne(d.path, a);
|
|
1820
1832
|
function o(f) {
|
|
1821
|
-
return l.value && Array.isArray(f) && f.length === 0 && !
|
|
1833
|
+
return l.value && Array.isArray(f) && f.length === 0 && !m.value.required ? null : f;
|
|
1822
1834
|
}
|
|
1823
|
-
const
|
|
1835
|
+
const p = Re(e, "modelValue", {
|
|
1824
1836
|
// If multiple and value is null/undefined, return empty array for v-model
|
|
1825
1837
|
get: () => l.value && n?.value == null ? [] : n.value,
|
|
1826
1838
|
set: (f) => {
|
|
1827
1839
|
n.value = o(f);
|
|
1828
1840
|
}
|
|
1829
|
-
}), h =
|
|
1830
|
-
return (f,
|
|
1831
|
-
const
|
|
1832
|
-
return d.error ? (
|
|
1841
|
+
}), h = k(() => e.items ? e.items : d.path ? s(d.path.value) : []), l = k(() => e.multiple !== void 0 ? e.multiple : d.schema.value?.type === "set"), u = k(() => l.value ? Vt : Kt);
|
|
1842
|
+
return (f, y) => {
|
|
1843
|
+
const T = D("KAlert");
|
|
1844
|
+
return d.error ? (b(), q(T, {
|
|
1833
1845
|
key: 0,
|
|
1834
1846
|
appearance: "danger",
|
|
1835
1847
|
message: d.error.message
|
|
1836
|
-
}, null, 8, ["message"])) :
|
|
1837
|
-
modelValue:
|
|
1848
|
+
}, null, 8, ["message"])) : Y((b(), q(i(u), W({ key: 1 }, { ...a, ...i(m) }, {
|
|
1849
|
+
modelValue: p.value,
|
|
1838
1850
|
"onUpdate:modelValue": [
|
|
1839
|
-
|
|
1840
|
-
|
|
1851
|
+
y[0] || (y[0] = (M) => p.value = M),
|
|
1852
|
+
y[1] || (y[1] = (M) => t("update", o(M)))
|
|
1841
1853
|
],
|
|
1842
1854
|
class: "ff-enum-field",
|
|
1843
|
-
clearable: !i(
|
|
1855
|
+
clearable: !i(m).required,
|
|
1844
1856
|
"data-autofocus": e.autofocus ? "true" : void 0,
|
|
1845
1857
|
"data-testid": `ff-${d.path.value}`,
|
|
1846
1858
|
items: h.value,
|
|
1847
1859
|
"kpop-attributes": { "data-testid": `ff-enum-${d.path.value}-items` }
|
|
1848
|
-
}),
|
|
1849
|
-
"tooltip" in f.$slots || i(
|
|
1860
|
+
}), J({ _: 2 }, [
|
|
1861
|
+
"tooltip" in f.$slots || i(m).labelAttributes?.info ? {
|
|
1850
1862
|
name: "label-tooltip",
|
|
1851
1863
|
fn: x(() => [
|
|
1852
1864
|
O(f.$slots, "tooltip", {}, () => [
|
|
1853
|
-
|
|
1854
|
-
innerHTML: i(
|
|
1865
|
+
U("div", {
|
|
1866
|
+
innerHTML: i(m).labelAttributes.info
|
|
1855
1867
|
}, null, 8, Wa)
|
|
1856
1868
|
], !0)
|
|
1857
1869
|
]),
|
|
@@ -1859,8 +1871,8 @@ const be = /* @__PURE__ */ U({
|
|
|
1859
1871
|
} : void 0,
|
|
1860
1872
|
f.$slots["item-label"] ? {
|
|
1861
1873
|
name: "item-template",
|
|
1862
|
-
fn: x(({ item:
|
|
1863
|
-
O(f.$slots, "item-label", De(Ze(
|
|
1874
|
+
fn: x(({ item: M }) => [
|
|
1875
|
+
O(f.$slots, "item-label", De(Ze(M)), void 0, !0)
|
|
1864
1876
|
]),
|
|
1865
1877
|
key: "1"
|
|
1866
1878
|
} : void 0,
|
|
@@ -1872,11 +1884,11 @@ const be = /* @__PURE__ */ U({
|
|
|
1872
1884
|
key: "2"
|
|
1873
1885
|
} : void 0
|
|
1874
1886
|
]), 1040, ["modelValue", "clearable", "data-autofocus", "data-testid", "items", "kpop-attributes"])), [
|
|
1875
|
-
[
|
|
1887
|
+
[X, !i(c)]
|
|
1876
1888
|
]);
|
|
1877
1889
|
};
|
|
1878
1890
|
}
|
|
1879
|
-
}), Se = /* @__PURE__ */
|
|
1891
|
+
}), Se = /* @__PURE__ */ G(Ga, [["__scopeId", "data-v-a8b95670"]]), Ja = ["data-testid"], Ya = ["innerHTML"], Xa = /* @__PURE__ */ N({
|
|
1880
1892
|
inheritAttrs: !1,
|
|
1881
1893
|
__name: "JsonField",
|
|
1882
1894
|
props: {
|
|
@@ -1886,8 +1898,8 @@ const be = /* @__PURE__ */ U({
|
|
|
1886
1898
|
},
|
|
1887
1899
|
emits: ["update:modelValue"],
|
|
1888
1900
|
setup(e, { emit: r }) {
|
|
1889
|
-
const t = ye(), a =
|
|
1890
|
-
function
|
|
1901
|
+
const t = ye(), a = le(e, ["autofocus", "name"]), s = r, { value: n, hide: c, ...d } = Q(j(() => e.name)), m = ne(d.path, j({ ...a, ...t })), o = se("");
|
|
1902
|
+
function p(l) {
|
|
1891
1903
|
o.value = l;
|
|
1892
1904
|
let u = l || null;
|
|
1893
1905
|
try {
|
|
@@ -1897,7 +1909,7 @@ const be = /* @__PURE__ */ U({
|
|
|
1897
1909
|
}
|
|
1898
1910
|
n.value = u, s("update:modelValue", u);
|
|
1899
1911
|
}
|
|
1900
|
-
const h =
|
|
1912
|
+
const h = k(() => t["data-1p-ignore"] !== void 0 ? t["data-1p-ignore"] : me(e.name) === "name");
|
|
1901
1913
|
return te(n, (l) => {
|
|
1902
1914
|
if (l && typeof l == "object") {
|
|
1903
1915
|
try {
|
|
@@ -1911,29 +1923,29 @@ const be = /* @__PURE__ */ U({
|
|
|
1911
1923
|
o.value = l || "";
|
|
1912
1924
|
}, { immediate: !0 }), (l, u) => {
|
|
1913
1925
|
const f = D("KAlert");
|
|
1914
|
-
return d.error ? (
|
|
1926
|
+
return d.error ? (b(), q(f, {
|
|
1915
1927
|
key: 0,
|
|
1916
1928
|
appearance: "danger",
|
|
1917
1929
|
message: d.error.message
|
|
1918
|
-
}, null, 8, ["message"])) :
|
|
1930
|
+
}, null, 8, ["message"])) : Y((b(), K("div", {
|
|
1919
1931
|
key: 1,
|
|
1920
1932
|
"data-testid": `ff-json-${d.path.value}`
|
|
1921
1933
|
}, [
|
|
1922
|
-
V(be,
|
|
1934
|
+
V(be, W(i(m), {
|
|
1923
1935
|
class: "ff-json-field",
|
|
1924
1936
|
"data-1p-ignore": h.value,
|
|
1925
1937
|
"data-autofocus": e.autofocus ? "true" : void 0,
|
|
1926
1938
|
"data-testid": `ff-${d.path.value}`,
|
|
1927
1939
|
"model-value": o.value ?? "",
|
|
1928
1940
|
multiline: "",
|
|
1929
|
-
"onUpdate:modelValue":
|
|
1930
|
-
}),
|
|
1931
|
-
i(
|
|
1941
|
+
"onUpdate:modelValue": p
|
|
1942
|
+
}), J({ _: 2 }, [
|
|
1943
|
+
i(m).labelAttributes?.info ? {
|
|
1932
1944
|
name: "label-tooltip",
|
|
1933
1945
|
fn: x(() => [
|
|
1934
1946
|
O(l.$slots, "tooltip", {}, () => [
|
|
1935
|
-
|
|
1936
|
-
innerHTML: i(
|
|
1947
|
+
U("div", {
|
|
1948
|
+
innerHTML: i(m).labelAttributes.info
|
|
1937
1949
|
}, null, 8, Ya)
|
|
1938
1950
|
], !0)
|
|
1939
1951
|
]),
|
|
@@ -1941,11 +1953,11 @@ const be = /* @__PURE__ */ U({
|
|
|
1941
1953
|
} : void 0
|
|
1942
1954
|
]), 1040, ["data-1p-ignore", "data-autofocus", "data-testid", "model-value"])
|
|
1943
1955
|
], 8, Ja)), [
|
|
1944
|
-
[
|
|
1956
|
+
[X, !i(c)]
|
|
1945
1957
|
]);
|
|
1946
1958
|
};
|
|
1947
1959
|
}
|
|
1948
|
-
}), Qa = /* @__PURE__ */
|
|
1960
|
+
}), Qa = /* @__PURE__ */ G(Xa, [["__scopeId", "data-v-6f302da9"]]), Za = ["innerHTML"], en = /* @__PURE__ */ N({
|
|
1949
1961
|
inheritAttrs: !1,
|
|
1950
1962
|
__name: "ForeignField",
|
|
1951
1963
|
props: {
|
|
@@ -1964,31 +1976,31 @@ const be = /* @__PURE__ */ U({
|
|
|
1964
1976
|
},
|
|
1965
1977
|
emits: ["update:modelValue"],
|
|
1966
1978
|
setup(e, { emit: r }) {
|
|
1967
|
-
const t = ye(), { i18n: { t: a } } = ve(), s =
|
|
1968
|
-
if (
|
|
1969
|
-
throw new Error(
|
|
1970
|
-
const o = ne(
|
|
1971
|
-
function u(
|
|
1972
|
-
|
|
1979
|
+
const t = ye(), { i18n: { t: a } } = ve(), s = le(e, ["autofocus", "name"]), n = r, { value: c, hide: d, ...m } = Q(j(() => e.name));
|
|
1980
|
+
if (m.error)
|
|
1981
|
+
throw new Error(m.error.message);
|
|
1982
|
+
const o = ne(m.path, j({ ...s, ...t })), p = c.value ? c.value.id : null, h = k(() => o.value.placeholder ? o.value.placeholder : a("plugins.free-form.foreign_placeholder", { entity: m.schema.value?.reference ?? "entity" })), l = se(p ?? "");
|
|
1983
|
+
function u(y) {
|
|
1984
|
+
p !== void 0 && y === "" && y !== p ? (c.value = null, n("update:modelValue", null)) : (c.value = { id: y.trim() }, n("update:modelValue", c.value));
|
|
1973
1985
|
}
|
|
1974
|
-
const f =
|
|
1975
|
-
return (
|
|
1986
|
+
const f = k(() => t["data-1p-ignore"] !== void 0 ? t["data-1p-ignore"] : me(e.name) === "name");
|
|
1987
|
+
return (y, T) => Y((b(), q(be, W(i(o), {
|
|
1976
1988
|
class: "ff-foreign-field",
|
|
1977
1989
|
"data-1p-ignore": f.value,
|
|
1978
1990
|
"data-autofocus": e.autofocus ? "true" : void 0,
|
|
1979
|
-
"data-testid": `ff-${
|
|
1991
|
+
"data-testid": `ff-${m.path.value}`,
|
|
1980
1992
|
error: e.error,
|
|
1981
1993
|
"error-message": e.errorMessage,
|
|
1982
1994
|
help: e.help,
|
|
1983
1995
|
"model-value": l.value,
|
|
1984
1996
|
placeholder: h.value,
|
|
1985
1997
|
"onUpdate:modelValue": u
|
|
1986
|
-
}),
|
|
1998
|
+
}), J({ _: 2 }, [
|
|
1987
1999
|
i(o).labelAttributes?.info ? {
|
|
1988
2000
|
name: "label-tooltip",
|
|
1989
2001
|
fn: x(() => [
|
|
1990
|
-
O(
|
|
1991
|
-
|
|
2002
|
+
O(y.$slots, "tooltip", {}, () => [
|
|
2003
|
+
U("div", {
|
|
1992
2004
|
innerHTML: i(o).labelAttributes.info
|
|
1993
2005
|
}, null, 8, Za)
|
|
1994
2006
|
], !0)
|
|
@@ -1996,10 +2008,10 @@ const be = /* @__PURE__ */ U({
|
|
|
1996
2008
|
key: "0"
|
|
1997
2009
|
} : void 0
|
|
1998
2010
|
]), 1040, ["data-1p-ignore", "data-autofocus", "data-testid", "error", "error-message", "help", "model-value", "placeholder"])), [
|
|
1999
|
-
[
|
|
2011
|
+
[X, !i(d)]
|
|
2000
2012
|
]);
|
|
2001
2013
|
}
|
|
2002
|
-
}), tn = /* @__PURE__ */
|
|
2014
|
+
}), tn = /* @__PURE__ */ G(en, [["__scopeId", "data-v-8c298e9f"]]), an = ["data-testid"], nn = ["data-testid"], on = ["innerHTML"], rn = { class: "ff-map-field-fields" }, sn = /* @__PURE__ */ N({
|
|
2003
2015
|
__name: "MapField",
|
|
2004
2016
|
props: {
|
|
2005
2017
|
keyPlaceholder: {},
|
|
@@ -2015,57 +2027,57 @@ const be = /* @__PURE__ */ U({
|
|
|
2015
2027
|
keys: n,
|
|
2016
2028
|
updateKey: c,
|
|
2017
2029
|
addKey: d,
|
|
2018
|
-
removeKey:
|
|
2030
|
+
removeKey: m,
|
|
2019
2031
|
field: o,
|
|
2020
|
-
fieldDisplayName:
|
|
2021
|
-
} = ua(j(a, "name"), v), h = ne(o.path, a), l = ["string", "number", "boolean", "integer", "foreign"], u =
|
|
2022
|
-
function
|
|
2023
|
-
a.appearance?.string?.multiline || (
|
|
2032
|
+
fieldDisplayName: p
|
|
2033
|
+
} = ua(j(a, "name"), v), h = ne(o.path, a), l = ["string", "number", "boolean", "integer", "foreign"], u = k(() => a.oneLine ? !0 : o.schema?.value?.type === "map" && l.includes(o.schema.value.values.type) && !a.appearance?.string?.multiline), f = k(() => o.schema?.value?.type === "map" ? o.schema.value.values : void 0), y = k(() => f.value?.type === "string" && !f.value?.one_of), T = k(() => u.value ? "div" : Ke), M = et("root");
|
|
2034
|
+
function P(A, C) {
|
|
2035
|
+
a.appearance?.string?.multiline || (A.preventDefault(), C === n.value.length - 1 && d(), g(C + 1));
|
|
2024
2036
|
}
|
|
2025
|
-
async function A
|
|
2026
|
-
|
|
2037
|
+
async function g(A) {
|
|
2038
|
+
M.value && (await $e(), M.value.querySelector(`[data-key-input="${A}"]`)?.focus());
|
|
2027
2039
|
}
|
|
2028
|
-
function
|
|
2040
|
+
function S() {
|
|
2029
2041
|
d();
|
|
2030
|
-
const
|
|
2031
|
-
A
|
|
2042
|
+
const A = n.value.findIndex(([C, $]) => !$);
|
|
2043
|
+
g(A === -1 ? n.value.length - 1 : A);
|
|
2032
2044
|
}
|
|
2033
|
-
function v(
|
|
2034
|
-
s("legacyValueChange",
|
|
2045
|
+
function v(A) {
|
|
2046
|
+
s("legacyValueChange", A);
|
|
2035
2047
|
}
|
|
2036
|
-
return (
|
|
2037
|
-
const
|
|
2038
|
-
return i(o).error ? (
|
|
2048
|
+
return (A, C) => {
|
|
2049
|
+
const $ = D("KAlert"), I = D("KLabel"), _ = D("KButton"), L = D("KTooltip");
|
|
2050
|
+
return i(o).error ? (b(), q($, {
|
|
2039
2051
|
key: 0,
|
|
2040
2052
|
appearance: "danger",
|
|
2041
2053
|
message: i(o).error.message
|
|
2042
|
-
}, null, 8, ["message"])) :
|
|
2054
|
+
}, null, 8, ["message"])) : Y((b(), K("div", {
|
|
2043
2055
|
key: 1,
|
|
2044
2056
|
ref_key: "root",
|
|
2045
|
-
ref:
|
|
2057
|
+
ref: M,
|
|
2046
2058
|
class: "ff-map-field",
|
|
2047
2059
|
"data-testid": `ff-map-${i(o).path.value}`
|
|
2048
2060
|
}, [
|
|
2049
|
-
i(h).label ? (
|
|
2061
|
+
i(h).label ? (b(), K("header", {
|
|
2050
2062
|
key: 0,
|
|
2051
2063
|
class: "ff-map-field-header",
|
|
2052
2064
|
"data-testid": `ff-map-header-${i(o).path.value}`
|
|
2053
2065
|
}, [
|
|
2054
|
-
V(
|
|
2066
|
+
V(I, W({ class: "ff-map-field-label" }, i(h).labelAttributes, {
|
|
2055
2067
|
"data-testid": `ff-label-${i(o).path.value}`,
|
|
2056
2068
|
required: i(h).required,
|
|
2057
2069
|
"tooltip-attributes": i(h).labelAttributes.tooltipAttributes
|
|
2058
|
-
}),
|
|
2070
|
+
}), J({
|
|
2059
2071
|
default: x(() => [
|
|
2060
|
-
pe(
|
|
2072
|
+
pe(de(i(h).label) + " ", 1)
|
|
2061
2073
|
]),
|
|
2062
2074
|
_: 2
|
|
2063
2075
|
}, [
|
|
2064
2076
|
i(h).labelAttributes?.info ? {
|
|
2065
2077
|
name: "tooltip",
|
|
2066
2078
|
fn: x(() => [
|
|
2067
|
-
O(
|
|
2068
|
-
|
|
2079
|
+
O(A.$slots, "tooltip", {}, () => [
|
|
2080
|
+
U("div", {
|
|
2069
2081
|
innerHTML: i(h).labelAttributes.info
|
|
2070
2082
|
}, null, 8, on)
|
|
2071
2083
|
], !0)
|
|
@@ -2073,52 +2085,52 @@ const be = /* @__PURE__ */ U({
|
|
|
2073
2085
|
key: "0"
|
|
2074
2086
|
} : void 0
|
|
2075
2087
|
]), 1040, ["data-testid", "required", "tooltip-attributes"])
|
|
2076
|
-
], 8, nn)) :
|
|
2077
|
-
(
|
|
2078
|
-
key:
|
|
2088
|
+
], 8, nn)) : H("", !0),
|
|
2089
|
+
(b(!0), K(ee, null, re(i(n), ([w, B], z) => (b(), q(oe(T.value), {
|
|
2090
|
+
key: w,
|
|
2079
2091
|
class: Te(["ff-map-field-item", {
|
|
2080
2092
|
"ff-map-field-item-simple": u.value,
|
|
2081
2093
|
"ff-map-field-item-complex": !u.value
|
|
2082
2094
|
}]),
|
|
2083
|
-
"data-testid": `ff-map-container-${i(o).path.value}.${
|
|
2095
|
+
"data-testid": `ff-map-container-${i(o).path.value}.${z}`
|
|
2084
2096
|
}, {
|
|
2085
2097
|
default: x(() => [
|
|
2086
|
-
|
|
2098
|
+
U("div", rn, [
|
|
2087
2099
|
V(be, {
|
|
2088
2100
|
class: "ff-map-field-fields-key",
|
|
2089
|
-
"data-key-input":
|
|
2090
|
-
"data-testid": `ff-map-key-${i(o).path.value}.${
|
|
2091
|
-
"model-value":
|
|
2101
|
+
"data-key-input": z,
|
|
2102
|
+
"data-testid": `ff-map-key-${i(o).path.value}.${z}`,
|
|
2103
|
+
"model-value": B,
|
|
2092
2104
|
placeholder: e.keyPlaceholder || "Key",
|
|
2093
|
-
onKeydown: Ne(Ce((
|
|
2094
|
-
"onUpdate:modelValue": (
|
|
2105
|
+
onKeydown: Ne(Ce((ie) => g(z), ["prevent"]), ["enter"]),
|
|
2106
|
+
"onUpdate:modelValue": (ie) => i(c)(w, ie)
|
|
2095
2107
|
}, null, 8, ["data-key-input", "data-testid", "model-value", "placeholder", "onKeydown", "onUpdate:modelValue"]),
|
|
2096
|
-
O(
|
|
2097
|
-
|
|
2108
|
+
O(A.$slots, "default", { keyId: w }, () => [
|
|
2109
|
+
y.value ? (b(), q(ht, {
|
|
2098
2110
|
key: 0,
|
|
2099
2111
|
"inline-vault-picker": "",
|
|
2100
2112
|
multiline: e.appearance?.string?.multiline,
|
|
2101
|
-
name:
|
|
2102
|
-
onKeydown: Ne((
|
|
2103
|
-
}, null, 8, ["multiline", "name", "onKeydown"])) : (
|
|
2113
|
+
name: w,
|
|
2114
|
+
onKeydown: Ne((ie) => P(ie, z), ["enter"])
|
|
2115
|
+
}, null, 8, ["multiline", "name", "onKeydown"])) : (b(), q(ge, {
|
|
2104
2116
|
key: 1,
|
|
2105
|
-
name:
|
|
2117
|
+
name: w
|
|
2106
2118
|
}, null, 8, ["name"]))
|
|
2107
2119
|
], !0)
|
|
2108
2120
|
]),
|
|
2109
|
-
V(
|
|
2110
|
-
text: i(t).t("actions.remove_entity", { entity: i(
|
|
2121
|
+
V(L, {
|
|
2122
|
+
text: i(t).t("actions.remove_entity", { entity: i(p) })
|
|
2111
2123
|
}, {
|
|
2112
2124
|
default: x(() => [
|
|
2113
|
-
V(
|
|
2125
|
+
V(_, {
|
|
2114
2126
|
appearance: "tertiary",
|
|
2115
|
-
"aria-label": i(t).t("actions.remove_entity", { entity: i(
|
|
2116
|
-
"data-testid": `ff-map-remove-btn-${i(o).path.value}.${
|
|
2127
|
+
"aria-label": i(t).t("actions.remove_entity", { entity: i(p) }),
|
|
2128
|
+
"data-testid": `ff-map-remove-btn-${i(o).path.value}.${z}`,
|
|
2117
2129
|
icon: "",
|
|
2118
|
-
onClick: (
|
|
2130
|
+
onClick: (ie) => i(m)(w)
|
|
2119
2131
|
}, {
|
|
2120
2132
|
default: x(() => [
|
|
2121
|
-
V(i(
|
|
2133
|
+
V(i(rt))
|
|
2122
2134
|
]),
|
|
2123
2135
|
_: 1
|
|
2124
2136
|
}, 8, ["aria-label", "data-testid", "onClick"])
|
|
@@ -2128,25 +2140,25 @@ const be = /* @__PURE__ */ U({
|
|
|
2128
2140
|
]),
|
|
2129
2141
|
_: 2
|
|
2130
2142
|
}, 1032, ["class", "data-testid"]))), 128)),
|
|
2131
|
-
V(
|
|
2143
|
+
V(_, {
|
|
2132
2144
|
appearance: "tertiary",
|
|
2133
|
-
"aria-label": i(t).t("actions.add_entity", { entity: i(
|
|
2145
|
+
"aria-label": i(t).t("actions.add_entity", { entity: i(p) }),
|
|
2134
2146
|
class: "ff-map-field-add-entry-btn",
|
|
2135
2147
|
"data-testid": `ff-map-add-btn-${i(o).path.value}`,
|
|
2136
|
-
onClick:
|
|
2148
|
+
onClick: S
|
|
2137
2149
|
}, {
|
|
2138
2150
|
default: x(() => [
|
|
2139
2151
|
V(i(je)),
|
|
2140
|
-
pe(" " +
|
|
2152
|
+
pe(" " + de(i(t).t("actions.add_entity", { entity: i(p) })), 1)
|
|
2141
2153
|
]),
|
|
2142
2154
|
_: 1
|
|
2143
2155
|
}, 8, ["aria-label", "data-testid"])
|
|
2144
2156
|
], 8, an)), [
|
|
2145
|
-
[
|
|
2157
|
+
[X, !i(o).hide.value]
|
|
2146
2158
|
]);
|
|
2147
2159
|
};
|
|
2148
2160
|
}
|
|
2149
|
-
}), ln = /* @__PURE__ */
|
|
2161
|
+
}), ln = /* @__PURE__ */ G(sn, [["__scopeId", "data-v-dca94ae5"]]), ge = /* @__PURE__ */ N({
|
|
2150
2162
|
name: "AutoField",
|
|
2151
2163
|
__name: "Field",
|
|
2152
2164
|
props: {
|
|
@@ -2156,10 +2168,10 @@ const be = /* @__PURE__ */ U({
|
|
|
2156
2168
|
},
|
|
2157
2169
|
emits: ["globalAction"],
|
|
2158
2170
|
setup(e) {
|
|
2159
|
-
const r = e, t =
|
|
2171
|
+
const r = e, t = Q(j(r, "name")), a = k(() => {
|
|
2160
2172
|
switch (t.schema?.value?.type) {
|
|
2161
2173
|
case "string":
|
|
2162
|
-
return "one_of" in t.schema.value ? Se :
|
|
2174
|
+
return "one_of" in t.schema.value ? Se : ht;
|
|
2163
2175
|
case "boolean":
|
|
2164
2176
|
return "one_of" in t.schema.value ? Se : ya;
|
|
2165
2177
|
case "number":
|
|
@@ -2168,7 +2180,7 @@ const be = /* @__PURE__ */ U({
|
|
|
2168
2180
|
case "array":
|
|
2169
2181
|
return Ia;
|
|
2170
2182
|
case "set":
|
|
2171
|
-
return Bt(t.schema) ?
|
|
2183
|
+
return Bt(t.schema) ? gt : Se;
|
|
2172
2184
|
case "record":
|
|
2173
2185
|
return Ba;
|
|
2174
2186
|
case "map":
|
|
@@ -2183,23 +2195,23 @@ const be = /* @__PURE__ */ U({
|
|
|
2183
2195
|
});
|
|
2184
2196
|
return (s, n) => {
|
|
2185
2197
|
const c = D("KAlert");
|
|
2186
|
-
return
|
|
2187
|
-
(
|
|
2188
|
-
i(t).error ? (
|
|
2198
|
+
return b(), K(ee, null, [
|
|
2199
|
+
(b(), q(oe(s.$slots[i(ke)]))),
|
|
2200
|
+
i(t).error ? (b(), q(c, {
|
|
2189
2201
|
key: 0,
|
|
2190
2202
|
appearance: "danger",
|
|
2191
2203
|
message: i(t).error.message
|
|
2192
|
-
}, null, 8, ["message"])) : i(t).renderer.value ? (
|
|
2204
|
+
}, null, 8, ["message"])) : i(t).renderer.value ? (b(), q(oe(i(t).renderer.value), {
|
|
2193
2205
|
key: 1,
|
|
2194
2206
|
autofocus: r.autofocus,
|
|
2195
2207
|
name: Ee(i(t).path.value),
|
|
2196
|
-
onGlobalAction: n[0] || (n[0] = (d,
|
|
2197
|
-
}, null, 40, ["autofocus", "name"])) : (
|
|
2198
|
-
a.value ? (
|
|
2208
|
+
onGlobalAction: n[0] || (n[0] = (d, m) => s.$emit("globalAction", d, m))
|
|
2209
|
+
}, null, 40, ["autofocus", "name"])) : (b(), K(ee, { key: 2 }, [
|
|
2210
|
+
a.value ? (b(), q(oe(a.value), {
|
|
2199
2211
|
key: 0,
|
|
2200
2212
|
autofocus: r.autofocus,
|
|
2201
2213
|
name: Ee(i(t).path.value)
|
|
2202
|
-
}, null, 8, ["autofocus", "name"])) : (
|
|
2214
|
+
}, null, 8, ["autofocus", "name"])) : (b(), q(c, {
|
|
2203
2215
|
key: 1,
|
|
2204
2216
|
appearance: "warning",
|
|
2205
2217
|
message: `${i(t).path.value} ${i(t).schema.value.type} (no renderer yet)`
|
|
@@ -2209,7 +2221,7 @@ const be = /* @__PURE__ */ U({
|
|
|
2209
2221
|
], 64);
|
|
2210
2222
|
};
|
|
2211
2223
|
}
|
|
2212
|
-
}), jn = /* @__PURE__ */
|
|
2224
|
+
}), jn = /* @__PURE__ */ N({
|
|
2213
2225
|
name: "SchemaForm",
|
|
2214
2226
|
__name: "Form",
|
|
2215
2227
|
props: {
|
|
@@ -2222,36 +2234,36 @@ const be = /* @__PURE__ */ U({
|
|
|
2222
2234
|
},
|
|
2223
2235
|
emits: ["change", "globalAction"],
|
|
2224
2236
|
setup(e, { expose: r, emit: t }) {
|
|
2225
|
-
const a = t, s = we(), { getSchema: n, formData: c, setValue: d, getValue:
|
|
2237
|
+
const a = t, s = we(), { getSchema: n, formData: c, setValue: d, getValue: m, rootRenderRules: o } = ta({
|
|
2226
2238
|
schema: e.schema,
|
|
2227
|
-
propsData:
|
|
2239
|
+
propsData: k(() => e.data),
|
|
2228
2240
|
propsConfig: e.config,
|
|
2229
2241
|
propsRenderRules: j(() => e.renderRules),
|
|
2230
2242
|
onChange: (h) => a("change", h)
|
|
2231
|
-
}),
|
|
2243
|
+
}), p = k(() => {
|
|
2232
2244
|
const { fields: h } = n();
|
|
2233
2245
|
let l = [...h];
|
|
2234
|
-
return e.fieldsOrder ?
|
|
2246
|
+
return e.fieldsOrder ? lt(l, e.fieldsOrder) : (o.value?.bundles && (l = ut([...l], o.value.bundles)), l);
|
|
2235
2247
|
});
|
|
2236
2248
|
return r({
|
|
2237
|
-
getValue:
|
|
2249
|
+
getValue: m,
|
|
2238
2250
|
getRawValue: () => Qe(c),
|
|
2239
2251
|
setValue: d
|
|
2240
|
-
}), (h, l) => (
|
|
2252
|
+
}), (h, l) => (b(), q(oe(e.tag), null, {
|
|
2241
2253
|
default: x(() => [
|
|
2242
|
-
(
|
|
2254
|
+
(b(), q(oe(i(s)[i(ke)]))),
|
|
2243
2255
|
O(h.$slots, "default", {}, () => [
|
|
2244
|
-
(
|
|
2256
|
+
(b(!0), K(ee, null, re(p.value, (u) => (b(), q(ge, {
|
|
2245
2257
|
key: Object.keys(u)[0],
|
|
2246
2258
|
name: Object.keys(u)[0],
|
|
2247
|
-
onGlobalAction: l[0] || (l[0] = (f,
|
|
2259
|
+
onGlobalAction: l[0] || (l[0] = (f, y) => a("globalAction", f, y))
|
|
2248
2260
|
}, null, 8, ["name"]))), 128))
|
|
2249
2261
|
])
|
|
2250
2262
|
]),
|
|
2251
2263
|
_: 3
|
|
2252
2264
|
}));
|
|
2253
2265
|
}
|
|
2254
|
-
}), En = /* @__PURE__ */
|
|
2266
|
+
}), En = /* @__PURE__ */ N({
|
|
2255
2267
|
__name: "FieldRenderer",
|
|
2256
2268
|
props: {
|
|
2257
2269
|
match: { type: Function },
|
|
@@ -2279,14 +2291,14 @@ will extend the wait time by about 12 minutes, continuously adjusting as new req
|
|
|
2279
2291
|
custom_plugin_form: _n
|
|
2280
2292
|
};
|
|
2281
2293
|
function An() {
|
|
2282
|
-
const e =
|
|
2294
|
+
const e = ot("en-us", wn);
|
|
2283
2295
|
return {
|
|
2284
2296
|
i18n: e,
|
|
2285
|
-
i18nT:
|
|
2297
|
+
i18nT: it(e)
|
|
2286
2298
|
// Translation component <i18n-t>
|
|
2287
2299
|
};
|
|
2288
2300
|
}
|
|
2289
|
-
const kn = ["data-testid"], Sn = /* @__PURE__ */
|
|
2301
|
+
const kn = ["data-testid"], Sn = /* @__PURE__ */ N({
|
|
2290
2302
|
__name: "SwitchField",
|
|
2291
2303
|
props: {
|
|
2292
2304
|
labelAttributes: {},
|
|
@@ -2297,35 +2309,35 @@ const kn = ["data-testid"], Sn = /* @__PURE__ */ U({
|
|
|
2297
2309
|
},
|
|
2298
2310
|
emits: ["update:modelValue"],
|
|
2299
2311
|
setup(e, { emit: r }) {
|
|
2300
|
-
const { i18n: { t } } = An(), a =
|
|
2301
|
-
s.value = h,
|
|
2302
|
-
},
|
|
2312
|
+
const { i18n: { t } } = An(), a = le(e, ["name", "enabledText", "disabledText"]), { value: s, hide: n, emptyOrDefaultValue: c, ...d } = Q(j(() => e.name)), m = r, o = (h) => {
|
|
2313
|
+
s.value = h, m("update:modelValue", h);
|
|
2314
|
+
}, p = ne(d.path, a);
|
|
2303
2315
|
return (h, l) => {
|
|
2304
2316
|
const u = D("KAlert");
|
|
2305
|
-
return d.error ? (
|
|
2317
|
+
return d.error ? (b(), q(u, {
|
|
2306
2318
|
key: 0,
|
|
2307
2319
|
appearance: "danger",
|
|
2308
2320
|
message: d.error.message
|
|
2309
|
-
}, null, 8, ["message"])) :
|
|
2321
|
+
}, null, 8, ["message"])) : Y((b(), K("div", {
|
|
2310
2322
|
key: 1,
|
|
2311
2323
|
class: "ff-switch-field",
|
|
2312
2324
|
"data-testid": `ff-${d.path.value}`
|
|
2313
2325
|
}, [
|
|
2314
|
-
V(i(jt),
|
|
2326
|
+
V(i(jt), W(i(p), {
|
|
2315
2327
|
"model-value": !!(i(s) == null ? i(c) : i(s)),
|
|
2316
2328
|
"onUpdate:modelValue": o
|
|
2317
2329
|
}), {
|
|
2318
2330
|
label: x(() => [
|
|
2319
|
-
pe(
|
|
2331
|
+
pe(de(i(s) ? e.enabledText || i(t)("actions.enabled") : e.disabledText || i(t)("actions.disabled")), 1)
|
|
2320
2332
|
]),
|
|
2321
2333
|
_: 1
|
|
2322
2334
|
}, 16, ["model-value"])
|
|
2323
2335
|
], 8, kn)), [
|
|
2324
|
-
[
|
|
2336
|
+
[X, !i(n)]
|
|
2325
2337
|
]);
|
|
2326
2338
|
};
|
|
2327
2339
|
}
|
|
2328
|
-
}), On = /* @__PURE__ */
|
|
2340
|
+
}), On = /* @__PURE__ */ G(Sn, [["__scopeId", "data-v-0b4c3942"]]);
|
|
2329
2341
|
export {
|
|
2330
2342
|
Ia as ArrayField,
|
|
2331
2343
|
ya as BooleanField,
|
|
@@ -2342,25 +2354,25 @@ export {
|
|
|
2342
2354
|
ln as MapField,
|
|
2343
2355
|
Ha as NumberField,
|
|
2344
2356
|
Ba as ObjectField,
|
|
2345
|
-
|
|
2346
|
-
|
|
2357
|
+
gt as StringArrayField,
|
|
2358
|
+
ht as StringField,
|
|
2347
2359
|
On as SwitchField,
|
|
2348
2360
|
Ut as buildAncestor,
|
|
2349
2361
|
qe as buildArraySchemaMap,
|
|
2350
2362
|
Me as buildMapSchemaMap,
|
|
2351
2363
|
Le as buildRecordSchemaMap,
|
|
2352
2364
|
zt as buildSchemaMap,
|
|
2353
|
-
|
|
2365
|
+
ft as defaultLabelFormatter,
|
|
2354
2366
|
he as generalizePath,
|
|
2355
2367
|
ta as provideFormShared,
|
|
2356
2368
|
Vn as renderRuleExactMatch,
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2369
|
+
pt as replaceByDictionary,
|
|
2370
|
+
mt as replaceByDictionaryInFieldName,
|
|
2371
|
+
Q as useField,
|
|
2372
|
+
ct as useFieldAncestors,
|
|
2361
2373
|
ne as useFieldAttrs,
|
|
2362
2374
|
la as useFieldLabel,
|
|
2363
|
-
|
|
2375
|
+
dt as useFieldPath,
|
|
2364
2376
|
na as useFieldRenderer,
|
|
2365
2377
|
oa as useFormData,
|
|
2366
2378
|
ae as useFormShared,
|