@gravitee/graphene-core 3.3.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeEditorField-cwZAv7Ib.js → CodeEditorField-xgGU8af-.js} +1 -1
- package/dist/{SchemaBanner-lrLehIB4.js → SchemaBanner-C_D3DjhL.js} +122 -114
- package/dist/base/Alert/Alert.d.ts +5 -2
- package/dist/base/Alert/Alert.d.ts.map +1 -1
- package/dist/base/Badge/Badge.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/styles/globals.css +1 -1
- package/package.json +1 -1
|
@@ -184,11 +184,18 @@ var oe = ie, se = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, ce
|
|
|
184
184
|
}, le = D("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-20 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
|
|
185
185
|
variants: { variant: {
|
|
186
186
|
default: "bg-card text-card-foreground",
|
|
187
|
-
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"
|
|
187
|
+
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
|
|
188
|
+
warning: "border-warning/40 bg-warning/10 text-card-foreground dark:bg-warning/20 *:[svg]:text-warning"
|
|
188
189
|
} },
|
|
189
190
|
defaultVariants: { variant: "default" }
|
|
191
|
+
}), ue = D("absolute right-2", {
|
|
192
|
+
variants: { align: {
|
|
193
|
+
top: "top-2",
|
|
194
|
+
center: "top-1/2 -translate-y-1/2"
|
|
195
|
+
} },
|
|
196
|
+
defaultVariants: { align: "top" }
|
|
190
197
|
});
|
|
191
|
-
function
|
|
198
|
+
function de({ className: e, variant: n = "default", ...r }) {
|
|
192
199
|
return /* @__PURE__ */ l("div", {
|
|
193
200
|
"data-slot": "alert",
|
|
194
201
|
"data-variant": n,
|
|
@@ -197,30 +204,31 @@ function ue({ className: e, variant: n = "default", ...r }) {
|
|
|
197
204
|
...r
|
|
198
205
|
});
|
|
199
206
|
}
|
|
200
|
-
function
|
|
207
|
+
function fe({ className: e, ...n }) {
|
|
201
208
|
return /* @__PURE__ */ l("div", {
|
|
202
209
|
"data-slot": "alert-title",
|
|
203
210
|
className: t("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground", e),
|
|
204
211
|
...n
|
|
205
212
|
});
|
|
206
213
|
}
|
|
207
|
-
function
|
|
214
|
+
function pe({ className: e, ...n }) {
|
|
208
215
|
return /* @__PURE__ */ l("div", {
|
|
209
216
|
"data-slot": "alert-description",
|
|
210
217
|
className: t("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4", e),
|
|
211
218
|
...n
|
|
212
219
|
});
|
|
213
220
|
}
|
|
214
|
-
function
|
|
221
|
+
function me({ className: e, align: n = "top", ...r }) {
|
|
215
222
|
return /* @__PURE__ */ l("div", {
|
|
216
223
|
"data-slot": "alert-action",
|
|
217
|
-
|
|
218
|
-
|
|
224
|
+
"data-align": n,
|
|
225
|
+
className: t(ue({ align: n }), e),
|
|
226
|
+
...r
|
|
219
227
|
});
|
|
220
228
|
}
|
|
221
229
|
//#endregion
|
|
222
230
|
//#region src/base/Separator/Separator.tsx
|
|
223
|
-
function
|
|
231
|
+
function he({ className: e, orientation: n = "horizontal", decorative: r = !0, ...i }) {
|
|
224
232
|
return /* @__PURE__ */ l(oe, {
|
|
225
233
|
"data-slot": "separator",
|
|
226
234
|
decorative: r,
|
|
@@ -231,7 +239,7 @@ function me({ className: e, orientation: n = "horizontal", decorative: r = !0, .
|
|
|
231
239
|
}
|
|
232
240
|
//#endregion
|
|
233
241
|
//#region src/base/Label/Label.tsx
|
|
234
|
-
function
|
|
242
|
+
function ge({ className: e, ...n }) {
|
|
235
243
|
return /* @__PURE__ */ l(E, {
|
|
236
244
|
"data-slot": "label",
|
|
237
245
|
className: t("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
|
|
@@ -240,14 +248,14 @@ function he({ className: e, ...n }) {
|
|
|
240
248
|
}
|
|
241
249
|
//#endregion
|
|
242
250
|
//#region src/base/Field/Field.tsx
|
|
243
|
-
function
|
|
251
|
+
function _e({ className: e, ...n }) {
|
|
244
252
|
return /* @__PURE__ */ l("fieldset", {
|
|
245
253
|
"data-slot": "field-set",
|
|
246
254
|
className: t("flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", e),
|
|
247
255
|
...n
|
|
248
256
|
});
|
|
249
257
|
}
|
|
250
|
-
function
|
|
258
|
+
function ve({ className: e, variant: n = "legend", required: r, children: i, ...a }) {
|
|
251
259
|
return /* @__PURE__ */ l("legend", {
|
|
252
260
|
"data-slot": "field-legend",
|
|
253
261
|
"data-variant": n,
|
|
@@ -263,14 +271,14 @@ function _e({ className: e, variant: n = "legend", required: r, children: i, ...
|
|
|
263
271
|
}) : i
|
|
264
272
|
});
|
|
265
273
|
}
|
|
266
|
-
function
|
|
274
|
+
function ye({ className: e, ...n }) {
|
|
267
275
|
return /* @__PURE__ */ l("div", {
|
|
268
276
|
"data-slot": "field-group",
|
|
269
277
|
className: t("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", e),
|
|
270
278
|
...n
|
|
271
279
|
});
|
|
272
280
|
}
|
|
273
|
-
var
|
|
281
|
+
var be = D("group/field flex w-full gap-2 data-[invalid=true]:text-destructive", {
|
|
274
282
|
variants: { orientation: {
|
|
275
283
|
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
276
284
|
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
@@ -278,24 +286,24 @@ var ye = D("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",
|
|
|
278
286
|
} },
|
|
279
287
|
defaultVariants: { orientation: "vertical" }
|
|
280
288
|
});
|
|
281
|
-
function
|
|
289
|
+
function xe({ className: e, orientation: n = "vertical", ...r }) {
|
|
282
290
|
return /* @__PURE__ */ l("div", {
|
|
283
291
|
role: "group",
|
|
284
292
|
"data-slot": "field",
|
|
285
293
|
"data-orientation": n,
|
|
286
|
-
className: t(
|
|
294
|
+
className: t(be({ orientation: n }), e),
|
|
287
295
|
...r
|
|
288
296
|
});
|
|
289
297
|
}
|
|
290
|
-
function
|
|
298
|
+
function Se({ className: e, ...n }) {
|
|
291
299
|
return /* @__PURE__ */ l("div", {
|
|
292
300
|
"data-slot": "field-content",
|
|
293
301
|
className: t("group/field-content flex flex-1 flex-col gap-0.5 leading-snug", e),
|
|
294
302
|
...n
|
|
295
303
|
});
|
|
296
304
|
}
|
|
297
|
-
function
|
|
298
|
-
return /* @__PURE__ */ l(
|
|
305
|
+
function Ce({ className: e, required: n, children: r, ...i }) {
|
|
306
|
+
return /* @__PURE__ */ l(ge, {
|
|
299
307
|
"data-slot": "field-label",
|
|
300
308
|
className: t("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", e),
|
|
301
309
|
...i,
|
|
@@ -309,34 +317,34 @@ function Se({ className: e, required: n, children: r, ...i }) {
|
|
|
309
317
|
}) : r
|
|
310
318
|
});
|
|
311
319
|
}
|
|
312
|
-
function
|
|
320
|
+
function we({ className: e, ...n }) {
|
|
313
321
|
return /* @__PURE__ */ l("div", {
|
|
314
322
|
"data-slot": "field-title",
|
|
315
323
|
className: t("flex w-fit items-center gap-2 text-sm/snug font-medium group-data-[disabled=true]/field:opacity-50", e),
|
|
316
324
|
...n
|
|
317
325
|
});
|
|
318
326
|
}
|
|
319
|
-
function
|
|
327
|
+
function Te({ className: e, ...n }) {
|
|
320
328
|
return /* @__PURE__ */ l("p", {
|
|
321
329
|
"data-slot": "field-description",
|
|
322
330
|
className: t("text-left text-sm/normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", e),
|
|
323
331
|
...n
|
|
324
332
|
});
|
|
325
333
|
}
|
|
326
|
-
function
|
|
334
|
+
function Ee({ children: e, className: n, ...r }) {
|
|
327
335
|
return /* @__PURE__ */ u("div", {
|
|
328
336
|
"data-slot": "field-separator",
|
|
329
337
|
"data-content": !!e,
|
|
330
338
|
className: t("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", n),
|
|
331
339
|
...r,
|
|
332
|
-
children: [/* @__PURE__ */ l(
|
|
340
|
+
children: [/* @__PURE__ */ l(he, { className: "absolute inset-0 top-1/2" }), e && /* @__PURE__ */ l("span", {
|
|
333
341
|
className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
|
|
334
342
|
"data-slot": "field-separator-content",
|
|
335
343
|
children: e
|
|
336
344
|
})]
|
|
337
345
|
});
|
|
338
346
|
}
|
|
339
|
-
function
|
|
347
|
+
function De({ className: e, children: n, errors: r, ...i }) {
|
|
340
348
|
let a = s(() => {
|
|
341
349
|
if (n) return n;
|
|
342
350
|
if (!r?.length) return null;
|
|
@@ -356,7 +364,7 @@ function Ee({ className: e, children: n, errors: r, ...i }) {
|
|
|
356
364
|
}
|
|
357
365
|
//#endregion
|
|
358
366
|
//#region ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
359
|
-
var
|
|
367
|
+
var Oe = (e) => e.type === "checkbox", O = (e) => e instanceof Date, k = (e) => e == null, ke = (e) => typeof e == "object", A = (e) => !k(e) && !Array.isArray(e) && ke(e) && !O(e), Ae = (e) => A(e) && e.target ? Oe(e.target) ? e.target.checked : e.target.value : e, je = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), Me = (e) => {
|
|
360
368
|
let t = e.constructor && e.constructor.prototype;
|
|
361
369
|
return A(t) && t.hasOwnProperty("isPrototypeOf");
|
|
362
370
|
}, j = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
|
|
@@ -365,12 +373,12 @@ function M(e) {
|
|
|
365
373
|
let t = typeof FileList < "u" && e instanceof FileList;
|
|
366
374
|
if (j && (e instanceof Blob || t)) return e;
|
|
367
375
|
let n = Array.isArray(e);
|
|
368
|
-
if (!n && !(A(e) &&
|
|
376
|
+
if (!n && !(A(e) && Me(e))) return e;
|
|
369
377
|
let r = n ? [] : Object.create(Object.getPrototypeOf(e));
|
|
370
378
|
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] = M(e[t]));
|
|
371
379
|
return r;
|
|
372
380
|
}
|
|
373
|
-
var
|
|
381
|
+
var Ne = {
|
|
374
382
|
BLUR: "blur",
|
|
375
383
|
FOCUS_OUT: "focusout",
|
|
376
384
|
CHANGE: "change",
|
|
@@ -391,14 +399,14 @@ var Me = {
|
|
|
391
399
|
pattern: "pattern",
|
|
392
400
|
required: "required",
|
|
393
401
|
validate: "validate"
|
|
394
|
-
},
|
|
402
|
+
}, Pe = "root", Fe = [
|
|
395
403
|
"__proto__",
|
|
396
404
|
"constructor",
|
|
397
405
|
"prototype"
|
|
398
406
|
], F = (e) => /^\w*$/.test(e), I = (e) => e === void 0, L = (e) => e.split(/[.[\]'"]/g).filter(Boolean), R = (e, t, n) => {
|
|
399
407
|
if (!t || !A(e)) return n;
|
|
400
408
|
let r = F(t) ? [t] : L(t);
|
|
401
|
-
if (r.some((e) =>
|
|
409
|
+
if (r.some((e) => Fe.includes(e))) return n;
|
|
402
410
|
let i = r.reduce((e, t) => k(e) ? void 0 : e[t], e);
|
|
403
411
|
return I(i) || i === e ? I(e[t]) ? n : e[t] : i;
|
|
404
412
|
}, z = (e) => typeof e == "boolean", B = (e) => typeof e == "function", V = (e, t, n) => {
|
|
@@ -409,12 +417,12 @@ var Me = {
|
|
|
409
417
|
let n = e[t];
|
|
410
418
|
a = A(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
411
419
|
}
|
|
412
|
-
if (
|
|
420
|
+
if (Fe.includes(t)) return;
|
|
413
421
|
e[t] = a, e = e[t];
|
|
414
422
|
}
|
|
415
|
-
},
|
|
416
|
-
|
|
417
|
-
var H = () => i.useContext(
|
|
423
|
+
}, Ie = i.createContext(null);
|
|
424
|
+
Ie.displayName = "HookFormControlContext";
|
|
425
|
+
var H = () => i.useContext(Ie), Le = (e, t, n, r = !0) => {
|
|
418
426
|
let i = {};
|
|
419
427
|
for (let a in e) Object.defineProperty(i, a, { get: () => {
|
|
420
428
|
let i = a;
|
|
@@ -422,7 +430,7 @@ var H = () => i.useContext(Fe), Ie = (e, t, n, r = !0) => {
|
|
|
422
430
|
} });
|
|
423
431
|
return i;
|
|
424
432
|
}, U = j ? i.useLayoutEffect : i.useEffect;
|
|
425
|
-
function
|
|
433
|
+
function Re(e) {
|
|
426
434
|
let t = H(), { control: n = t, disabled: r, name: a, exact: o } = e || {}, [s, c] = i.useState(() => ({
|
|
427
435
|
...n._formState,
|
|
428
436
|
defaultValues: n._defaultValues
|
|
@@ -453,16 +461,16 @@ function Le(e) {
|
|
|
453
461
|
o
|
|
454
462
|
]), i.useEffect(() => {
|
|
455
463
|
l.current.isValid && n._setValid(!0);
|
|
456
|
-
}, [n]), i.useMemo(() =>
|
|
464
|
+
}, [n]), i.useMemo(() => Le(s, n, l.current, !1), [s, n]);
|
|
457
465
|
}
|
|
458
|
-
var W = (e) => typeof e == "string",
|
|
466
|
+
var W = (e) => typeof e == "string", ze = (e, t, n, r, i) => W(e) ? (r && t.watch.add(e), R(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), R(n, e))) : (r && (t.watchAll = !0), n), Be = (e) => k(e) || !ke(e), Ve = (e, t) => t.length === 0 && !Array.isArray(e) && !Me(e);
|
|
459
467
|
function G(e, t, n = /* @__PURE__ */ new WeakSet()) {
|
|
460
468
|
if (e === t) return !0;
|
|
461
|
-
if (
|
|
469
|
+
if (Be(e) || Be(t)) return Object.is(e, t);
|
|
462
470
|
if (O(e) && O(t)) return Object.is(e.getTime(), t.getTime());
|
|
463
471
|
let r = Object.keys(e), i = Object.keys(t);
|
|
464
472
|
if (r.length !== i.length) return !1;
|
|
465
|
-
if (
|
|
473
|
+
if (Ve(e, r) || Ve(t, i)) return Object.is(e, t);
|
|
466
474
|
if (n.has(e) || n.has(t)) return !0;
|
|
467
475
|
n.add(e), n.add(t);
|
|
468
476
|
for (let i of r) {
|
|
@@ -475,14 +483,14 @@ function G(e, t, n = /* @__PURE__ */ new WeakSet()) {
|
|
|
475
483
|
}
|
|
476
484
|
return !0;
|
|
477
485
|
}
|
|
478
|
-
function
|
|
486
|
+
function He(e) {
|
|
479
487
|
let t = H(), { control: n = t, name: r, defaultValue: a, disabled: o, exact: s, compute: c } = e || {}, l = i.useRef(a), u = i.useRef(c), d = i.useRef(void 0), f = i.useRef(n), p = i.useRef(r);
|
|
480
488
|
u.current = c;
|
|
481
489
|
let [m, h] = i.useState(() => {
|
|
482
490
|
let e = n._getWatch(r, l.current);
|
|
483
491
|
return u.current ? u.current(e) : e;
|
|
484
492
|
}), g = i.useCallback((e) => {
|
|
485
|
-
let t =
|
|
493
|
+
let t = ze(r, n._names, e || n._formValues, !1, l.current);
|
|
486
494
|
return u.current ? u.current(t) : t;
|
|
487
495
|
}, [
|
|
488
496
|
n._formValues,
|
|
@@ -490,7 +498,7 @@ function Ve(e) {
|
|
|
490
498
|
r
|
|
491
499
|
]), _ = i.useCallback((e) => {
|
|
492
500
|
if (!o) {
|
|
493
|
-
let t =
|
|
501
|
+
let t = ze(r, n._names, e || n._formValues, !1, l.current);
|
|
494
502
|
if (u.current) {
|
|
495
503
|
let e = u.current(t);
|
|
496
504
|
G(e, d.current) || (h(e), d.current = e);
|
|
@@ -528,8 +536,8 @@ function Ve(e) {
|
|
|
528
536
|
]);
|
|
529
537
|
return b === null ? m : b;
|
|
530
538
|
}
|
|
531
|
-
function
|
|
532
|
-
let t = H(), { name: n, disabled: r, control: a = t, shouldUnregister: o, defaultValue: s, exact: c = !0 } = e, l =
|
|
539
|
+
function Ue(e) {
|
|
540
|
+
let t = H(), { name: n, disabled: r, control: a = t, shouldUnregister: o, defaultValue: s, exact: c = !0 } = e, l = je(a._names.array, n), u = He({
|
|
533
541
|
control: a,
|
|
534
542
|
name: n,
|
|
535
543
|
defaultValue: i.useMemo(() => R(a._formValues, n, R(a._defaultValues, n, s)), [
|
|
@@ -538,7 +546,7 @@ function He(e) {
|
|
|
538
546
|
s
|
|
539
547
|
]),
|
|
540
548
|
exact: c
|
|
541
|
-
}), d =
|
|
549
|
+
}), d = Re({
|
|
542
550
|
control: a,
|
|
543
551
|
name: n,
|
|
544
552
|
exact: c
|
|
@@ -570,23 +578,23 @@ function He(e) {
|
|
|
570
578
|
get: () => R(d.errors, n)
|
|
571
579
|
}
|
|
572
580
|
}), [d, n]), h = i.useCallback((e) => {
|
|
573
|
-
let t =
|
|
581
|
+
let t = Ae(e);
|
|
574
582
|
R(a._fields, n) || (p.current = a.register(n, {
|
|
575
583
|
...f.current.rules,
|
|
576
584
|
value: t
|
|
577
585
|
})), p.current.onChange({
|
|
578
586
|
target: {
|
|
579
|
-
value:
|
|
587
|
+
value: Ae(e),
|
|
580
588
|
name: n
|
|
581
589
|
},
|
|
582
|
-
type:
|
|
590
|
+
type: Ne.CHANGE
|
|
583
591
|
});
|
|
584
592
|
}, [n, a]), g = i.useCallback(() => p.current.onBlur({
|
|
585
593
|
target: {
|
|
586
594
|
value: R(a._formValues, n),
|
|
587
595
|
name: n
|
|
588
596
|
},
|
|
589
|
-
type:
|
|
597
|
+
type: Ne.BLUR
|
|
590
598
|
}), [n, a._formValues]), _ = i.useCallback((e) => {
|
|
591
599
|
let t = R(a._fields, n);
|
|
592
600
|
t && t._f && e && (t._f.ref = {
|
|
@@ -652,20 +660,20 @@ function He(e) {
|
|
|
652
660
|
m
|
|
653
661
|
]);
|
|
654
662
|
}
|
|
655
|
-
var
|
|
656
|
-
|
|
657
|
-
var
|
|
663
|
+
var We = i.createContext(null);
|
|
664
|
+
We.displayName = "HookFormContext";
|
|
665
|
+
var Ge = (e, t, n, r, i) => t ? {
|
|
658
666
|
...n[e],
|
|
659
667
|
types: {
|
|
660
668
|
...n[e] && n[e].types ? n[e].types : {},
|
|
661
669
|
[r]: i || !0
|
|
662
670
|
}
|
|
663
|
-
} : {},
|
|
671
|
+
} : {}, Ke = (e) => Array.isArray(e) ? e.filter(Boolean) : [], K = (e) => Array.isArray(e) ? e : [e], q = (e) => A(e) && !Object.keys(e).length, qe = (e) => e.type === "file", Je = (e) => {
|
|
664
672
|
if (!j) return !1;
|
|
665
673
|
let t = e ? e.ownerDocument : 0;
|
|
666
674
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
667
|
-
},
|
|
668
|
-
function
|
|
675
|
+
}, Ye = (e) => e.type === "radio";
|
|
676
|
+
function Xe(e, t) {
|
|
669
677
|
let n = t.slice(0, -1).length, r = 0;
|
|
670
678
|
for (; r < n;) {
|
|
671
679
|
if (k(e)) {
|
|
@@ -676,22 +684,22 @@ function Ye(e, t) {
|
|
|
676
684
|
}
|
|
677
685
|
return e;
|
|
678
686
|
}
|
|
679
|
-
function
|
|
687
|
+
function Ze(e) {
|
|
680
688
|
for (let t in e) if (e.hasOwnProperty(t) && !I(e[t])) return !1;
|
|
681
689
|
return !0;
|
|
682
690
|
}
|
|
683
|
-
function
|
|
691
|
+
function Qe(e, t) {
|
|
684
692
|
if (W(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
|
|
685
|
-
let n = Array.isArray(t) ? t : F(t) ? [t] : L(t), r = n.length === 1 ? e :
|
|
686
|
-
return r && delete r[a], i !== 0 && (A(r) && q(r) || Array.isArray(r) &&
|
|
693
|
+
let n = Array.isArray(t) ? t : F(t) ? [t] : L(t), r = n.length === 1 ? e : Xe(e, n), i = n.length - 1, a = n[i];
|
|
694
|
+
return r && delete r[a], i !== 0 && (A(r) && q(r) || Array.isArray(r) && Ze(r)) && Qe(e, n.slice(0, -1)), e;
|
|
687
695
|
}
|
|
688
|
-
var
|
|
696
|
+
var $e = {
|
|
689
697
|
value: !1,
|
|
690
698
|
isValid: !1
|
|
691
|
-
},
|
|
699
|
+
}, et = {
|
|
692
700
|
value: !0,
|
|
693
701
|
isValid: !0
|
|
694
|
-
},
|
|
702
|
+
}, tt = (e) => {
|
|
695
703
|
if (Array.isArray(e)) {
|
|
696
704
|
if (e.length > 1) {
|
|
697
705
|
let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
|
|
@@ -700,25 +708,25 @@ var Qe = {
|
|
|
700
708
|
isValid: !!t.length
|
|
701
709
|
};
|
|
702
710
|
}
|
|
703
|
-
return e[0].checked && !e[0].disabled ? e[0].attributes && !I(e[0].attributes.value) ? I(e[0].value) || e[0].value === "" ?
|
|
711
|
+
return e[0].checked && !e[0].disabled ? e[0].attributes && !I(e[0].attributes.value) ? I(e[0].value) || e[0].value === "" ? et : {
|
|
704
712
|
value: e[0].value,
|
|
705
713
|
isValid: !0
|
|
706
|
-
} :
|
|
714
|
+
} : et : $e;
|
|
707
715
|
}
|
|
708
|
-
return
|
|
709
|
-
},
|
|
716
|
+
return $e;
|
|
717
|
+
}, nt = {
|
|
710
718
|
isValid: !1,
|
|
711
719
|
value: null
|
|
712
|
-
},
|
|
720
|
+
}, rt = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
|
|
713
721
|
isValid: !0,
|
|
714
722
|
value: t.value
|
|
715
|
-
} : e,
|
|
723
|
+
} : e, nt) : nt, it = (e) => e instanceof RegExp, J = (e) => ({
|
|
716
724
|
isOnSubmit: !e || e === N.onSubmit,
|
|
717
725
|
isOnBlur: e === N.onBlur,
|
|
718
726
|
isOnChange: e === N.onChange,
|
|
719
727
|
isOnAll: e === N.all,
|
|
720
728
|
isOnTouch: e === N.onTouched
|
|
721
|
-
}),
|
|
729
|
+
}), at = (e, t, n) => !n && (t.watchAll || t.watch.has(e) || [...t.watch].some((t) => e.startsWith(`${t}.`))), Y = (e, t, n, r) => {
|
|
722
730
|
for (let i of n || Object.keys(e)) {
|
|
723
731
|
let n = R(e, i);
|
|
724
732
|
if (n) {
|
|
@@ -729,26 +737,26 @@ var Qe = {
|
|
|
729
737
|
} else if (A(a) && Y(a, t)) break;
|
|
730
738
|
}
|
|
731
739
|
}
|
|
732
|
-
},
|
|
740
|
+
}, ot = (e, t, n) => {
|
|
733
741
|
let r = R(e, n), i = Array.isArray(r) ? r : [];
|
|
734
|
-
return V(i,
|
|
742
|
+
return V(i, Pe, t[n]), V(e, n, i), e;
|
|
735
743
|
};
|
|
736
|
-
function
|
|
744
|
+
function st(e, t, n = "validate") {
|
|
737
745
|
if (W(e) || Array.isArray(e) && e.every(W) || z(e) && !e) return {
|
|
738
746
|
type: n,
|
|
739
747
|
message: W(e) ? e : "",
|
|
740
748
|
ref: t
|
|
741
749
|
};
|
|
742
750
|
}
|
|
743
|
-
var X = (e) => A(e) && !
|
|
751
|
+
var X = (e) => A(e) && !it(e) ? e : {
|
|
744
752
|
value: e,
|
|
745
753
|
message: ""
|
|
746
|
-
},
|
|
754
|
+
}, ct = async (e, t, n, r, i, a) => {
|
|
747
755
|
let { ref: o, refs: s, required: c, maxLength: l, minLength: u, min: d, max: f, pattern: p, validate: m, name: h, valueAsNumber: g, mount: _ } = e._f, v = R(n, h);
|
|
748
756
|
if (!_ || t.has(h)) return {};
|
|
749
757
|
let y = s ? s[0] : o, b = (e) => {
|
|
750
758
|
i && y.reportValidity && (y.setCustomValidity(z(e) ? "" : e || ""), y.reportValidity());
|
|
751
|
-
}, x = {}, S =
|
|
759
|
+
}, x = {}, S = Ye(o), C = Oe(o), ee = S || C, w = (g || qe(o)) && I(o.value) && I(v) || Je(o) && o.value === "" || v === "" || Array.isArray(v) && !v.length, T = Ge.bind(null, h, r, x), E = (e, t, n, r = P.maxLength, i = P.minLength) => {
|
|
752
760
|
let a = e ? t : n;
|
|
753
761
|
x[h] = {
|
|
754
762
|
type: e ? r : i,
|
|
@@ -757,7 +765,7 @@ var X = (e) => A(e) && !rt(e) ? e : {
|
|
|
757
765
|
...T(e ? r : i, a)
|
|
758
766
|
};
|
|
759
767
|
};
|
|
760
|
-
if (a ? !Array.isArray(v) || !v.length : c && (!ee && (w || k(v)) || z(v) && !v || C && !
|
|
768
|
+
if (a ? !Array.isArray(v) || !v.length : c && (!ee && (w || k(v)) || z(v) && !v || C && !tt(s).isValid || S && !rt(s).isValid)) {
|
|
761
769
|
let { value: e, message: t } = W(c) ? {
|
|
762
770
|
value: !!c,
|
|
763
771
|
message: c
|
|
@@ -786,7 +794,7 @@ var X = (e) => A(e) && !rt(e) ? e : {
|
|
|
786
794
|
}
|
|
787
795
|
if (p && !w && W(v)) {
|
|
788
796
|
let { value: e, message: t } = X(p);
|
|
789
|
-
if (
|
|
797
|
+
if (it(e) && !v.match(e) && (x[h] = {
|
|
790
798
|
type: P.pattern,
|
|
791
799
|
message: t,
|
|
792
800
|
ref: o,
|
|
@@ -795,7 +803,7 @@ var X = (e) => A(e) && !rt(e) ? e : {
|
|
|
795
803
|
}
|
|
796
804
|
if (m) {
|
|
797
805
|
if (B(m)) {
|
|
798
|
-
let e =
|
|
806
|
+
let e = st(await m(v, n), y);
|
|
799
807
|
if (e && (x[h] = {
|
|
800
808
|
...e,
|
|
801
809
|
...T(P.validate, e.message)
|
|
@@ -804,7 +812,7 @@ var X = (e) => A(e) && !rt(e) ? e : {
|
|
|
804
812
|
let e = {};
|
|
805
813
|
for (let t in m) {
|
|
806
814
|
if (!q(e) && !r) break;
|
|
807
|
-
let i =
|
|
815
|
+
let i = st(await m[t](v, n), y, t);
|
|
808
816
|
i && (e = {
|
|
809
817
|
...i,
|
|
810
818
|
...T(t, i.message)
|
|
@@ -826,24 +834,24 @@ var Z = () => {
|
|
|
826
834
|
let n = (Math.random() * 16 + e) % 16 | 0;
|
|
827
835
|
return (t == "x" ? n : n & 3 | 8).toString(16);
|
|
828
836
|
});
|
|
829
|
-
},
|
|
830
|
-
function
|
|
837
|
+
}, lt = (e, t, n = {}) => n.shouldFocus || I(n.shouldFocus) ? n.focusName || `${e}.${I(n.focusIndex) ? t : n.focusIndex}.` : "", ut = (e, t) => [...e, ...K(t)], dt = (e) => Array.isArray(e) ? e.map(() => void 0) : void 0;
|
|
838
|
+
function ft(e, t, n) {
|
|
831
839
|
return [
|
|
832
840
|
...e.slice(0, t),
|
|
833
841
|
...K(n),
|
|
834
842
|
...e.slice(t)
|
|
835
843
|
];
|
|
836
844
|
}
|
|
837
|
-
var
|
|
838
|
-
function
|
|
845
|
+
var pt = (e, t, n) => Array.isArray(e) ? (I(e[n]) && (e[n] = void 0), e.splice(n, 0, e.splice(t, 1)[0]), e) : [], Q = (e, t) => [...K(t), ...K(e)];
|
|
846
|
+
function mt(e, t) {
|
|
839
847
|
let n = 0, r = [...e];
|
|
840
848
|
for (let e of t) r.splice(e - n, 1), n++;
|
|
841
|
-
return
|
|
849
|
+
return Ke(r).length ? r : [];
|
|
842
850
|
}
|
|
843
|
-
var
|
|
851
|
+
var ht = (e, t) => I(t) ? [] : mt(e, K(t).sort((e, t) => e - t)), $ = (e, t, n) => {
|
|
844
852
|
[e[t], e[n]] = [e[n], e[t]];
|
|
845
|
-
},
|
|
846
|
-
function
|
|
853
|
+
}, gt = (e, t, n) => (e[t] = n, e);
|
|
854
|
+
function _t(e) {
|
|
847
855
|
let t = H(), { control: n = t, name: r, keyName: a = "id", shouldUnregister: o, rules: s } = e, [c, l] = i.useState(n._getFieldArray(r)), u = i.useRef(n._getFieldArray(r).map(Z)), d = i.useRef(!1);
|
|
848
856
|
n._names.array.add(r), i.useMemo(() => s && c.length >= 0 && n.register(r, s), [
|
|
849
857
|
n,
|
|
@@ -860,16 +868,16 @@ function gt(e) {
|
|
|
860
868
|
d.current = !0, n._setFieldArray(r, e);
|
|
861
869
|
}, [n, r]);
|
|
862
870
|
return i.useEffect(() => {
|
|
863
|
-
n._state.action = !1,
|
|
871
|
+
n._state.action = !1, at(r, n._names) && n._subjects.state.next({ ...n._formState });
|
|
864
872
|
let e = J(n._options.mode);
|
|
865
873
|
if (d.current && (!e.isOnSubmit || n._formState.isSubmitted) && !J(n._options.reValidateMode).isOnSubmit && !e.isOnBlur) if (n._options.resolver) n._runSchema([r]).then((e) => {
|
|
866
874
|
n._updateIsValidating([r]);
|
|
867
875
|
let t = R(e.errors, r), i = R(n._formState.errors, r);
|
|
868
|
-
(i ? !t && i.type || t && (i.type !== t.type || i.message !== t.message) : t && t.type) && (t ? V(n._formState.errors, r, t) :
|
|
876
|
+
(i ? !t && i.type || t && (i.type !== t.type || i.message !== t.message) : t && t.type) && (t ? V(n._formState.errors, r, t) : Qe(n._formState.errors, r), n._subjects.state.next({ errors: n._formState.errors }));
|
|
869
877
|
});
|
|
870
878
|
else {
|
|
871
879
|
let e = R(n._fields, r);
|
|
872
|
-
e && e._f && !(J(n._options.reValidateMode).isOnSubmit && J(n._options.mode).isOnSubmit) &&
|
|
880
|
+
e && e._f && !(J(n._options.reValidateMode).isOnSubmit && J(n._options.mode).isOnSubmit) && ct(e, n._names.disabled, n._formValues, n._options.criteriaMode === N.all, n._options.shouldUseNativeValidation, !0).then((e) => !q(e) && n._subjects.state.next({ errors: ot(n._formState.errors, e, r) }));
|
|
873
881
|
}
|
|
874
882
|
n._subjects.state.next({
|
|
875
883
|
name: r,
|
|
@@ -909,7 +917,7 @@ function gt(e) {
|
|
|
909
917
|
]),
|
|
910
918
|
move: i.useCallback((e, t) => {
|
|
911
919
|
let i = n._getFieldArray(r);
|
|
912
|
-
|
|
920
|
+
pt(i, e, t), pt(u.current, e, t), f(i), l(i), n._setFieldArray(r, i, pt, {
|
|
913
921
|
argA: e,
|
|
914
922
|
argB: t
|
|
915
923
|
}, !1);
|
|
@@ -919,34 +927,34 @@ function gt(e) {
|
|
|
919
927
|
n
|
|
920
928
|
]),
|
|
921
929
|
prepend: i.useCallback((e, t) => {
|
|
922
|
-
let i = K(M(e)), a =
|
|
923
|
-
n._names.focus =
|
|
930
|
+
let i = K(M(e)), a = Q(n._getFieldArray(r), i);
|
|
931
|
+
n._names.focus = lt(r, 0, t), u.current = Q(u.current, i.map(Z)), f(a), l(a), n._setFieldArray(r, a, Q, { argA: dt(e) });
|
|
924
932
|
}, [
|
|
925
933
|
f,
|
|
926
934
|
r,
|
|
927
935
|
n
|
|
928
936
|
]),
|
|
929
937
|
append: i.useCallback((e, t) => {
|
|
930
|
-
let i = K(M(e)), a =
|
|
931
|
-
n._names.focus =
|
|
938
|
+
let i = K(M(e)), a = ut(n._getFieldArray(r), i);
|
|
939
|
+
n._names.focus = lt(r, a.length - 1, t), u.current = ut(u.current, i.map(Z)), f(a), l(a), n._setFieldArray(r, a, ut, { argA: dt(e) });
|
|
932
940
|
}, [
|
|
933
941
|
f,
|
|
934
942
|
r,
|
|
935
943
|
n
|
|
936
944
|
]),
|
|
937
945
|
remove: i.useCallback((e) => {
|
|
938
|
-
let t =
|
|
939
|
-
u.current =
|
|
946
|
+
let t = ht(n._getFieldArray(r), e);
|
|
947
|
+
u.current = ht(u.current, e), f(t), l(t), !Array.isArray(R(n._fields, r)) && V(n._fields, r, void 0), n._setFieldArray(r, t, ht, { argA: e });
|
|
940
948
|
}, [
|
|
941
949
|
f,
|
|
942
950
|
r,
|
|
943
951
|
n
|
|
944
952
|
]),
|
|
945
953
|
insert: i.useCallback((e, t, i) => {
|
|
946
|
-
let a = K(M(t)), o =
|
|
947
|
-
n._names.focus =
|
|
954
|
+
let a = K(M(t)), o = ft(n._getFieldArray(r), e, a);
|
|
955
|
+
n._names.focus = lt(r, e, i), u.current = ft(u.current, e, a.map(Z)), f(o), l(o), n._setFieldArray(r, o, ft, {
|
|
948
956
|
argA: e,
|
|
949
|
-
argB:
|
|
957
|
+
argB: dt(t)
|
|
950
958
|
});
|
|
951
959
|
}, [
|
|
952
960
|
f,
|
|
@@ -954,8 +962,8 @@ function gt(e) {
|
|
|
954
962
|
n
|
|
955
963
|
]),
|
|
956
964
|
update: i.useCallback((e, t) => {
|
|
957
|
-
let i = M(t), a =
|
|
958
|
-
u.current = [...a].map((t, n) => !t || n === e ? Z() : u.current[n]), f(a), l([...a]), n._setFieldArray(r, a,
|
|
965
|
+
let i = M(t), a = gt(n._getFieldArray(r), e, i);
|
|
966
|
+
u.current = [...a].map((t, n) => !t || n === e ? Z() : u.current[n]), f(a), l([...a]), n._setFieldArray(r, a, gt, {
|
|
959
967
|
argA: e,
|
|
960
968
|
argB: i
|
|
961
969
|
}, !0, !1);
|
|
@@ -980,42 +988,42 @@ function gt(e) {
|
|
|
980
988
|
}
|
|
981
989
|
//#endregion
|
|
982
990
|
//#region src/composed/JsonSchemaForm/models/JsonSchemaFormContext.ts
|
|
983
|
-
var
|
|
984
|
-
function
|
|
985
|
-
let e = o(
|
|
991
|
+
var vt = a(null);
|
|
992
|
+
function yt() {
|
|
993
|
+
let e = o(vt);
|
|
986
994
|
if (e === null) throw Error("useJsonSchemaFormContext must be used within a <JsonSchemaForm>");
|
|
987
995
|
return e;
|
|
988
996
|
}
|
|
989
997
|
//#endregion
|
|
990
998
|
//#region src/composed/JsonSchemaForm/utils/fieldErrors.ts
|
|
991
|
-
function
|
|
999
|
+
function bt(e) {
|
|
992
1000
|
return e ? e.types ? Object.values(e.types).flat().filter((e) => typeof e == "string").map((e) => ({ message: e })) : [{ message: e.message }] : [];
|
|
993
1001
|
}
|
|
994
1002
|
//#endregion
|
|
995
1003
|
//#region src/composed/JsonSchemaForm/utils/labelOf.ts
|
|
996
|
-
function
|
|
1004
|
+
function xt(e) {
|
|
997
1005
|
return e ? e.charAt(0).toUpperCase() + e.slice(1) : "Field";
|
|
998
1006
|
}
|
|
999
|
-
function
|
|
1000
|
-
return
|
|
1007
|
+
function St(e) {
|
|
1008
|
+
return xt(e.split(".").pop());
|
|
1001
1009
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return typeof e.title == "string" && e.title.length > 0 ? e.title :
|
|
1010
|
+
function Ct(e, t) {
|
|
1011
|
+
return typeof e.title == "string" && e.title.length > 0 ? e.title : xt(t);
|
|
1004
1012
|
}
|
|
1005
1013
|
//#endregion
|
|
1006
1014
|
//#region src/composed/JsonSchemaForm/fields/banner/SchemaBanner.tsx
|
|
1007
|
-
function
|
|
1015
|
+
function wt({ banner: e }) {
|
|
1008
1016
|
let t = "title" in e ? e.title : void 0;
|
|
1009
|
-
return /* @__PURE__ */ u(
|
|
1017
|
+
return /* @__PURE__ */ u(de, {
|
|
1010
1018
|
role: "note",
|
|
1011
1019
|
className: "border-warning/8 bg-warning/4 dark:border-warning/25 dark:bg-warning/8 [&>svg]:text-badge-warning-foreground/85",
|
|
1012
1020
|
children: [
|
|
1013
1021
|
/* @__PURE__ */ l(n, { "aria-hidden": "true" }),
|
|
1014
|
-
t && /* @__PURE__ */ l(
|
|
1022
|
+
t && /* @__PURE__ */ l(fe, {
|
|
1015
1023
|
className: "font-semibold text-foreground",
|
|
1016
1024
|
children: t
|
|
1017
1025
|
}),
|
|
1018
|
-
/* @__PURE__ */ l(
|
|
1026
|
+
/* @__PURE__ */ l(pe, {
|
|
1019
1027
|
className: "text-muted-foreground [&_code]:rounded-sm [&_code]:bg-warning/8 [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-xs [&_code]:text-foreground [&_li]:mt-0.5 [&_strong]:font-medium [&_strong]:text-foreground [&_ul]:ml-4 [&_ul]:list-disc",
|
|
1020
1028
|
dangerouslySetInnerHTML: { __html: e.text }
|
|
1021
1029
|
})
|
|
@@ -1023,4 +1031,4 @@ function Ct({ banner: e }) {
|
|
|
1023
1031
|
});
|
|
1024
1032
|
}
|
|
1025
1033
|
//#endregion
|
|
1026
|
-
export { g as A,
|
|
1034
|
+
export { g as A, me as C, D, le as E, y as M, p as N, C as O, m as P, de as S, fe as T, Ee as _, vt as a, ge as b, _t as c, Se as d, Te as f, ve as g, Ce as h, bt as i, h as j, ee as k, He as l, ye as m, St as n, yt as o, De as p, Ct as r, Ue as s, wt as t, xe as u, _e as v, pe as w, he as x, we as y };
|