@declarion/react 0.198.0 → 0.200.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-lib/components/actions/ResponsiveActionBar.js +119 -114
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +1 -0
- package/dist-lib/components/params/ParamsBlock.js +1 -0
- package/dist-lib/components/params/param-editors.js +11 -8
- package/dist-lib/components/primitives/RecordIdBadge.js +7 -6
- package/dist-lib/hooks/useViews.js +20 -19
- package/dist-lib/lib/uuid.js +6 -0
- package/package.json +1 -1
|
@@ -350,42 +350,46 @@ function L({ layout: e, entityActions: t, globalActions: n, onRun: r, loading: a
|
|
|
350
350
|
]
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
|
-
var
|
|
353
|
+
var ee = "__overflow_trigger__", R = 90, z = 4, B = 8;
|
|
354
354
|
function te(e) {
|
|
355
|
-
return `icon:${
|
|
355
|
+
return `icon:${q(e)}`;
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function V() {
|
|
358
358
|
return B;
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function H(e, t, n) {
|
|
361
361
|
return [
|
|
362
362
|
...e,
|
|
363
363
|
...t,
|
|
364
364
|
...n
|
|
365
365
|
];
|
|
366
366
|
}
|
|
367
|
-
var
|
|
368
|
-
function
|
|
367
|
+
var U = () => {}, ne = () => Promise.resolve();
|
|
368
|
+
function re(e) {
|
|
369
369
|
return (t) => {
|
|
370
370
|
t && (t.setAttribute("data-node-key", e), t.setAttribute("tabindex", "-1"));
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function ie(e, t) {
|
|
374
374
|
if (e.size !== t.size) return !1;
|
|
375
375
|
for (let [n, r] of t) if (e.get(n) !== r) return !1;
|
|
376
376
|
return !0;
|
|
377
377
|
}
|
|
378
|
-
function
|
|
379
|
-
return t.get(
|
|
378
|
+
function W(e, t) {
|
|
379
|
+
return t.get(q(e)) ?? 0;
|
|
380
|
+
}
|
|
381
|
+
function ae(e, t, n) {
|
|
382
|
+
let r = e.map((e) => W(e, t)).filter((e) => e > 0);
|
|
383
|
+
if (r.length !== 0) return r.reduce((e, t) => e + t, 0) + z * (r.length - 1) + n;
|
|
380
384
|
}
|
|
381
|
-
function
|
|
385
|
+
function G(e, t) {
|
|
382
386
|
return t.get(te(e));
|
|
383
387
|
}
|
|
384
|
-
function
|
|
385
|
-
let { primary: l, regular: u, destructive: d } = E(e, i, a), f =
|
|
386
|
-
if (o) for (let e of h) o(e) && g.add(
|
|
388
|
+
function K(e, t, n, r, i, a, o, s, c) {
|
|
389
|
+
let { primary: l, regular: u, destructive: d } = E(e, i, a), f = z, p = r.get(ee) ?? R, m = t - n, h = H(l, u, d), g = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Set();
|
|
390
|
+
if (o) for (let e of h) o(e) && g.add(q(e));
|
|
387
391
|
else {
|
|
388
|
-
let e = (e, t) => t ?
|
|
392
|
+
let e = (e, t) => t ? G(e, r) ?? W(e, r) : W(e, r), t = (e) => s ? e.filter((e) => !s.has(q(e))).length * V() : 0, n = (e, t) => c ? e.slice(0, t).filter((e) => c.has(q(e))).length * V() : 0, i = (r, i) => {
|
|
389
393
|
let a = r.length < h.length ? p + f : 0, o = r.length > 1 ? (r.length - 1) * f : 0;
|
|
390
394
|
return r.reduce((t, n, r) => t + e(n, r >= i), 0) + o + a + t(r) + n(r, i) <= m;
|
|
391
395
|
}, a = 0, o = !1;
|
|
@@ -393,11 +397,11 @@ function q(e, t, n, r, i, a, o, s, c) {
|
|
|
393
397
|
let l = o ? 0 : Math.min(1, a), u = h.slice(0, a);
|
|
394
398
|
for (; l < a && i(u, l + 1);) l++;
|
|
395
399
|
u.forEach((e, t) => {
|
|
396
|
-
let n =
|
|
400
|
+
let n = q(e);
|
|
397
401
|
g.add(n), t >= l && _.add(n);
|
|
398
402
|
});
|
|
399
403
|
}
|
|
400
|
-
let v = (e) => g.has(
|
|
404
|
+
let v = (e) => g.has(q(e)), y = [
|
|
401
405
|
...l,
|
|
402
406
|
...u,
|
|
403
407
|
...d
|
|
@@ -410,112 +414,112 @@ function q(e, t, n, r, i, a, o, s, c) {
|
|
|
410
414
|
iconOnly: _
|
|
411
415
|
};
|
|
412
416
|
}
|
|
413
|
-
function
|
|
417
|
+
function q(e) {
|
|
414
418
|
return e.kind === "action" ? `action:${e.code}` : `group:${JSON.stringify(e.name ?? {})}`;
|
|
415
419
|
}
|
|
416
|
-
function
|
|
420
|
+
function oe(e) {
|
|
417
421
|
let t = e.parentElement;
|
|
418
422
|
for (; t && getComputedStyle(t).display === "contents";) t = t.parentElement;
|
|
419
423
|
if (!t) return !1;
|
|
420
424
|
let n = getComputedStyle(t);
|
|
421
425
|
return !(parseFloat(n.flexGrow) > 0 || n.display === "block" || n.display === "flow-root" || n.width !== "auto" || n.maxWidth !== "none");
|
|
422
426
|
}
|
|
423
|
-
function
|
|
424
|
-
let A = u(), F = g(null), I = g(null), [L,
|
|
427
|
+
function J({ layout: r, entityActions: a, globalActions: o, onRun: s, reservedRightWidth: c = 0, measurementOverride: l, ariaLabel: x, align: S = "trailing", constrain: C = !0, row: E, widgetContext: D, onActionClick: O }) {
|
|
428
|
+
let A = u(), F = g(null), I = g(null), [L, R] = _(0), [B, V] = _(/* @__PURE__ */ new Map()), [H, W] = _(!1), [G, J] = _(null), [Y, se] = _(() => typeof document < "u" && document.documentElement.dir === "rtl");
|
|
425
429
|
p(() => {
|
|
426
430
|
if (typeof MutationObserver > "u") return;
|
|
427
431
|
let e = new MutationObserver((e) => {
|
|
428
|
-
for (let t of e) t.attributeName === "dir" &&
|
|
432
|
+
for (let t of e) t.attributeName === "dir" && se(document.documentElement.dir === "rtl"), t.attributeName === "lang" && W(!1);
|
|
429
433
|
});
|
|
430
434
|
return e.observe(document.documentElement, {
|
|
431
435
|
attributes: !0,
|
|
432
436
|
attributeFilter: ["dir", "lang"]
|
|
433
437
|
}), () => e.disconnect();
|
|
434
438
|
}, []);
|
|
435
|
-
let
|
|
436
|
-
if (
|
|
439
|
+
let ce = g(null), [le, ue] = _(!1), de = f((e, t) => (ue(!1), s(e, t)), [s]), fe = w(r), X = !!l, Z = f(() => {
|
|
440
|
+
if (X || !I.current) return;
|
|
437
441
|
let e = Array.from(I.current.children), t = /* @__PURE__ */ new Map();
|
|
438
442
|
e.forEach((e) => {
|
|
439
443
|
let n = e.dataset.nodeKey;
|
|
440
444
|
n && t.set(n, e.getBoundingClientRect().width || e.offsetWidth);
|
|
441
|
-
}),
|
|
442
|
-
}, [
|
|
445
|
+
}), V((e) => ie(e, t) ? e : t), W(!0);
|
|
446
|
+
}, [X]), pe = h(() => JSON.stringify(r.map((e) => q(e))), [r]);
|
|
443
447
|
p(() => {
|
|
444
|
-
if (
|
|
448
|
+
if (X) return;
|
|
445
449
|
let e = I.current;
|
|
446
450
|
if (!e || typeof ResizeObserver > "u") return;
|
|
447
|
-
let t = new ResizeObserver(() =>
|
|
451
|
+
let t = new ResizeObserver(() => Z());
|
|
448
452
|
t.observe(e);
|
|
449
453
|
for (let n of Array.from(e.children)) t.observe(n);
|
|
450
454
|
return () => t.disconnect();
|
|
451
455
|
}, [
|
|
452
|
-
Q,
|
|
453
456
|
Z,
|
|
454
|
-
|
|
457
|
+
X,
|
|
458
|
+
pe
|
|
455
459
|
]), m(() => {
|
|
456
|
-
if (
|
|
457
|
-
|
|
460
|
+
if (X) {
|
|
461
|
+
W(!0);
|
|
458
462
|
return;
|
|
459
463
|
}
|
|
460
|
-
|
|
464
|
+
W(!1);
|
|
461
465
|
let e = requestAnimationFrame(() => {
|
|
462
|
-
|
|
466
|
+
Z();
|
|
463
467
|
});
|
|
464
468
|
return () => cancelAnimationFrame(e);
|
|
465
469
|
}, [
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
470
|
+
pe,
|
|
471
|
+
Z,
|
|
472
|
+
X
|
|
469
473
|
]), p(() => {
|
|
470
|
-
if (
|
|
474
|
+
if (X || H) return;
|
|
471
475
|
let e = setTimeout(() => {
|
|
472
|
-
|
|
476
|
+
Z(), W(!0);
|
|
473
477
|
}, 16);
|
|
474
478
|
return () => clearTimeout(e);
|
|
475
479
|
}, [
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
480
|
+
H,
|
|
481
|
+
Z,
|
|
482
|
+
X
|
|
479
483
|
]), p(() => {
|
|
480
|
-
if (
|
|
484
|
+
if (X || !C || !H || L === 0) return;
|
|
481
485
|
let e = F.current;
|
|
482
|
-
if (!e || !
|
|
486
|
+
if (!e || !oe(e)) return;
|
|
483
487
|
let t = [...e.children].filter((e) => e.getAttribute("aria-hidden") !== "true"), n = t.length > 1 ? (t.length - 1) * 4 : 0, r = t.reduce((e, t) => e + t.getBoundingClientRect().width, 0) + n;
|
|
484
488
|
r > 0 && Math.abs(L - r) < 1 && console.error(`[declarion] ResponsiveActionBar is measuring itself: its container is ${Math.round(L)}px, exactly the width of what it just rendered. The slot holding this bar is sized by its own content, so it cannot tell the bar how much room there is. Give that slot \`flex: 1 1 auto; min-width: 0\` (and justify its content to the edge the buttons sit on), or pass \`constrain={false}\` if it genuinely has no row to take space from.`);
|
|
485
489
|
}, [
|
|
486
|
-
|
|
490
|
+
X,
|
|
487
491
|
C,
|
|
488
|
-
|
|
492
|
+
H,
|
|
489
493
|
L,
|
|
490
494
|
B
|
|
491
495
|
]), p(() => {
|
|
492
|
-
if (
|
|
496
|
+
if (X) return;
|
|
493
497
|
let e = F.current;
|
|
494
498
|
if (!e) return;
|
|
495
499
|
if (typeof ResizeObserver > "u") {
|
|
496
|
-
|
|
500
|
+
R(e.getBoundingClientRect().width);
|
|
497
501
|
return;
|
|
498
502
|
}
|
|
499
503
|
let t = new ResizeObserver((e) => {
|
|
500
504
|
let t = e[0];
|
|
501
|
-
t &&
|
|
505
|
+
t && R(t.contentRect.width);
|
|
502
506
|
});
|
|
503
|
-
return t.observe(e),
|
|
504
|
-
}, [
|
|
505
|
-
let
|
|
507
|
+
return t.observe(e), R(e.getBoundingClientRect().width), () => t.disconnect();
|
|
508
|
+
}, [X]);
|
|
509
|
+
let me = g(void 0), Q = g(void 0);
|
|
506
510
|
p(() => {
|
|
507
|
-
|
|
508
|
-
}, [
|
|
509
|
-
let $ = h(() =>
|
|
511
|
+
me.current = void 0, Q.current = void 0;
|
|
512
|
+
}, [pe]);
|
|
513
|
+
let $ = h(() => X || !C ? K(r, 2 ** 53 - 1, c, B, a, o, l) : H ? L === 0 ? K(r, 2 ** 53 - 1, c, B, a, o, l) : K(r, L, c, B, a, o, l, me.current, Q.current) : {
|
|
510
514
|
primaryInline: [],
|
|
511
515
|
inline: [],
|
|
512
516
|
overflow: [],
|
|
513
517
|
destructiveInline: [],
|
|
514
518
|
iconOnly: /* @__PURE__ */ new Set()
|
|
515
519
|
}, [
|
|
516
|
-
|
|
520
|
+
X,
|
|
517
521
|
C,
|
|
518
|
-
|
|
522
|
+
H,
|
|
519
523
|
L,
|
|
520
524
|
r,
|
|
521
525
|
c,
|
|
@@ -525,30 +529,31 @@ function Y({ layout: r, entityActions: a, globalActions: o, onRun: s, reservedRi
|
|
|
525
529
|
l
|
|
526
530
|
]);
|
|
527
531
|
if (p(() => {
|
|
528
|
-
(
|
|
532
|
+
(H || X) && (me.current = new Set([
|
|
529
533
|
...$.primaryInline,
|
|
530
534
|
...$.inline,
|
|
531
535
|
...$.destructiveInline
|
|
532
|
-
].map(
|
|
536
|
+
].map(q)), Q.current = new Set($.iconOnly));
|
|
533
537
|
}, [
|
|
534
538
|
$,
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
]),
|
|
538
|
-
let
|
|
539
|
+
H,
|
|
540
|
+
X
|
|
541
|
+
]), fe === 0) return null;
|
|
542
|
+
let he = $.overflow.length > 0, { normal: ge, destructive: _e } = T($.overflow, a, o);
|
|
539
543
|
return /* @__PURE__ */ b("div", {
|
|
540
544
|
ref: F,
|
|
541
545
|
role: "toolbar",
|
|
542
546
|
"aria-label": x ?? A("action.menu.title", "Actions"),
|
|
543
547
|
style: {
|
|
544
548
|
display: "flex",
|
|
545
|
-
flexDirection:
|
|
549
|
+
flexDirection: Y ? "row-reverse" : "row",
|
|
546
550
|
alignItems: "center",
|
|
547
|
-
gap:
|
|
551
|
+
gap: z,
|
|
548
552
|
flexWrap: "wrap",
|
|
549
|
-
visibility:
|
|
553
|
+
visibility: H || X ? "visible" : "hidden",
|
|
550
554
|
position: "relative",
|
|
551
555
|
flex: C ? "1 1 auto" : "0 1 auto",
|
|
556
|
+
width: C && H && !X ? ae(r, B, c) : void 0,
|
|
552
557
|
justifyContent: S === "trailing" ? "flex-end" : "flex-start",
|
|
553
558
|
minWidth: 0,
|
|
554
559
|
boxSizing: "border-box"
|
|
@@ -570,44 +575,44 @@ function Y({ layout: r, entityActions: a, globalActions: o, onRun: s, reservedRi
|
|
|
570
575
|
flexWrap: "nowrap"
|
|
571
576
|
},
|
|
572
577
|
children: [/* @__PURE__ */ y(e, {
|
|
573
|
-
"data-node-key":
|
|
578
|
+
"data-node-key": ee,
|
|
574
579
|
iconRight: /* @__PURE__ */ y(n.down, { size: 10 }),
|
|
575
580
|
tabIndex: -1,
|
|
576
581
|
children: A("action.menu.title", "Actions")
|
|
577
|
-
},
|
|
578
|
-
let t =
|
|
582
|
+
}, ee), r.map((e) => {
|
|
583
|
+
let t = q(e);
|
|
579
584
|
return e.kind === "action" ? /* @__PURE__ */ b(d, { children: [/* @__PURE__ */ y(j, {
|
|
580
585
|
leaf: e,
|
|
581
586
|
entityActions: a,
|
|
582
587
|
globalActions: o,
|
|
583
|
-
onRun:
|
|
588
|
+
onRun: ne,
|
|
584
589
|
loading: !1,
|
|
585
|
-
onLoadingChange:
|
|
590
|
+
onLoadingChange: U,
|
|
586
591
|
row: E,
|
|
587
592
|
widgetContext: D,
|
|
588
|
-
measureRef:
|
|
593
|
+
measureRef: re(t)
|
|
589
594
|
}), k(e.code, a, o) && /* @__PURE__ */ y(j, {
|
|
590
595
|
leaf: e,
|
|
591
596
|
entityActions: a,
|
|
592
597
|
globalActions: o,
|
|
593
|
-
onRun:
|
|
598
|
+
onRun: ne,
|
|
594
599
|
loading: !1,
|
|
595
|
-
onLoadingChange:
|
|
600
|
+
onLoadingChange: U,
|
|
596
601
|
row: E,
|
|
597
602
|
widgetContext: D,
|
|
598
603
|
iconOnly: !0,
|
|
599
|
-
measureRef:
|
|
604
|
+
measureRef: re(te(e))
|
|
600
605
|
})] }, t) : /* @__PURE__ */ y(M, {
|
|
601
606
|
group: e,
|
|
602
607
|
entityActions: a,
|
|
603
608
|
globalActions: o,
|
|
604
|
-
onRun:
|
|
609
|
+
onRun: ne,
|
|
605
610
|
loading: null,
|
|
606
|
-
onLoadingChange:
|
|
611
|
+
onLoadingChange: U,
|
|
607
612
|
row: E,
|
|
608
613
|
widgetContext: D,
|
|
609
614
|
onActionClick: O,
|
|
610
|
-
measureRef:
|
|
615
|
+
measureRef: re(t)
|
|
611
616
|
}, t);
|
|
612
617
|
})]
|
|
613
618
|
}),
|
|
@@ -616,22 +621,22 @@ function Y({ layout: r, entityActions: a, globalActions: o, onRun: s, reservedRi
|
|
|
616
621
|
entityActions: a,
|
|
617
622
|
globalActions: o,
|
|
618
623
|
onRun: s,
|
|
619
|
-
loading:
|
|
620
|
-
onLoadingChange: (t) =>
|
|
624
|
+
loading: G === e.code,
|
|
625
|
+
onLoadingChange: (t) => J(t ? e.code : null),
|
|
621
626
|
row: E,
|
|
622
627
|
widgetContext: D,
|
|
623
628
|
onActionClick: O,
|
|
624
|
-
iconOnly: $.iconOnly.has(
|
|
625
|
-
},
|
|
629
|
+
iconOnly: $.iconOnly.has(q(e))
|
|
630
|
+
}, q(e))),
|
|
626
631
|
$.inline.map((e) => {
|
|
627
|
-
let t =
|
|
632
|
+
let t = q(e);
|
|
628
633
|
return e.kind === "action" ? /* @__PURE__ */ y(j, {
|
|
629
634
|
leaf: e,
|
|
630
635
|
entityActions: a,
|
|
631
636
|
globalActions: o,
|
|
632
637
|
onRun: s,
|
|
633
|
-
loading:
|
|
634
|
-
onLoadingChange: (t) =>
|
|
638
|
+
loading: G === e.code,
|
|
639
|
+
onLoadingChange: (t) => J(t ? e.code : null),
|
|
635
640
|
row: E,
|
|
636
641
|
widgetContext: D,
|
|
637
642
|
onActionClick: O,
|
|
@@ -641,41 +646,41 @@ function Y({ layout: r, entityActions: a, globalActions: o, onRun: s, reservedRi
|
|
|
641
646
|
entityActions: a,
|
|
642
647
|
globalActions: o,
|
|
643
648
|
onRun: s,
|
|
644
|
-
loading:
|
|
645
|
-
onLoadingChange:
|
|
649
|
+
loading: G,
|
|
650
|
+
onLoadingChange: J,
|
|
646
651
|
row: E,
|
|
647
652
|
widgetContext: D,
|
|
648
653
|
onActionClick: O
|
|
649
654
|
}, t);
|
|
650
655
|
}),
|
|
651
|
-
|
|
652
|
-
ref:
|
|
656
|
+
he && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(e, {
|
|
657
|
+
ref: ce,
|
|
653
658
|
kind: "default",
|
|
654
659
|
iconRight: /* @__PURE__ */ y(n.down, { size: 10 }),
|
|
655
660
|
"aria-haspopup": "menu",
|
|
656
|
-
"aria-expanded":
|
|
657
|
-
onClick: () =>
|
|
661
|
+
"aria-expanded": le ? "true" : "false",
|
|
662
|
+
onClick: () => ue((e) => !e),
|
|
658
663
|
children: A("action.menu.title", "Actions")
|
|
659
664
|
}), /* @__PURE__ */ y(t, {
|
|
660
|
-
open:
|
|
661
|
-
anchor:
|
|
662
|
-
onClose: () =>
|
|
663
|
-
align:
|
|
665
|
+
open: le,
|
|
666
|
+
anchor: ce.current,
|
|
667
|
+
onClose: () => ue(!1),
|
|
668
|
+
align: Y ? "start" : "end",
|
|
664
669
|
width: 220,
|
|
665
670
|
children: /* @__PURE__ */ y("div", {
|
|
666
671
|
role: "menu",
|
|
667
672
|
"aria-label": A("action.menu.more", "More actions"),
|
|
668
673
|
children: [
|
|
669
|
-
...
|
|
670
|
-
...
|
|
671
|
-
...
|
|
674
|
+
...ge,
|
|
675
|
+
..._e.length > 0 ? [null] : [],
|
|
676
|
+
..._e
|
|
672
677
|
].map((e, t) => e === null ? /* @__PURE__ */ y(i, { divider: !0 }, "destructive-divider") : e.kind === "action" ? /* @__PURE__ */ y(N, {
|
|
673
678
|
leaf: e,
|
|
674
679
|
entityActions: a,
|
|
675
680
|
globalActions: o,
|
|
676
|
-
onRun:
|
|
677
|
-
loading:
|
|
678
|
-
onLoadingChange: (t) =>
|
|
681
|
+
onRun: de,
|
|
682
|
+
loading: G === e.code,
|
|
683
|
+
onLoadingChange: (t) => J(t ? e.code : null),
|
|
679
684
|
row: E,
|
|
680
685
|
widgetContext: D,
|
|
681
686
|
onActionClick: O
|
|
@@ -683,13 +688,13 @@ function Y({ layout: r, entityActions: a, globalActions: o, onRun: s, reservedRi
|
|
|
683
688
|
group: e,
|
|
684
689
|
entityActions: a,
|
|
685
690
|
globalActions: o,
|
|
686
|
-
onRun:
|
|
687
|
-
loading:
|
|
688
|
-
onLoadingChange:
|
|
691
|
+
onRun: de,
|
|
692
|
+
loading: G,
|
|
693
|
+
onLoadingChange: J,
|
|
689
694
|
row: E,
|
|
690
695
|
widgetContext: D,
|
|
691
696
|
onActionClick: O
|
|
692
|
-
}, `${
|
|
697
|
+
}, `${q(e)}-${t}`))
|
|
693
698
|
})
|
|
694
699
|
})] }),
|
|
695
700
|
$.destructiveInline.map((e) => /* @__PURE__ */ y(j, {
|
|
@@ -697,17 +702,17 @@ function Y({ layout: r, entityActions: a, globalActions: o, onRun: s, reservedRi
|
|
|
697
702
|
entityActions: a,
|
|
698
703
|
globalActions: o,
|
|
699
704
|
onRun: s,
|
|
700
|
-
loading:
|
|
701
|
-
onLoadingChange: (t) =>
|
|
705
|
+
loading: G === e.code,
|
|
706
|
+
onLoadingChange: (t) => J(t ? e.code : null),
|
|
702
707
|
row: E,
|
|
703
708
|
widgetContext: D,
|
|
704
709
|
onActionClick: O,
|
|
705
|
-
iconOnly: $.iconOnly.has(
|
|
706
|
-
},
|
|
710
|
+
iconOnly: $.iconOnly.has(q(e))
|
|
711
|
+
}, q(e)))
|
|
707
712
|
]
|
|
708
713
|
});
|
|
709
714
|
}
|
|
710
|
-
function
|
|
715
|
+
function Y({ layout: e, rowSelection: t = [], ...n }) {
|
|
711
716
|
let r = t.length > 0;
|
|
712
717
|
return /* @__PURE__ */ b("div", {
|
|
713
718
|
style: {
|
|
@@ -723,7 +728,7 @@ function X({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
723
728
|
flex: "1 1 auto",
|
|
724
729
|
minWidth: 0
|
|
725
730
|
},
|
|
726
|
-
children: /* @__PURE__ */ y(
|
|
731
|
+
children: /* @__PURE__ */ y(J, {
|
|
727
732
|
layout: e,
|
|
728
733
|
rowSelection: [],
|
|
729
734
|
...n
|
|
@@ -735,7 +740,7 @@ function X({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
735
740
|
flex: "1 1 auto",
|
|
736
741
|
minWidth: 0
|
|
737
742
|
},
|
|
738
|
-
children: /* @__PURE__ */ y(
|
|
743
|
+
children: /* @__PURE__ */ y(J, {
|
|
739
744
|
layout: e,
|
|
740
745
|
rowSelection: t,
|
|
741
746
|
...n
|
|
@@ -743,7 +748,7 @@ function X({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
743
748
|
})]
|
|
744
749
|
});
|
|
745
750
|
}
|
|
746
|
-
function
|
|
751
|
+
function se({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth: i = 0, kind: a = "toolbar", align: o = "trailing", constrain: s = !0, measurementOverride: c, entityActions: l, globalActions: u, ariaLabel: d, widgetContext: f, onActionClick: p }) {
|
|
747
752
|
let m = w(e);
|
|
748
753
|
return a === "row" ? /* @__PURE__ */ y(F, {
|
|
749
754
|
layout: e,
|
|
@@ -753,7 +758,7 @@ function ae({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
753
758
|
row: t,
|
|
754
759
|
widgetContext: f,
|
|
755
760
|
onActionClick: p
|
|
756
|
-
}) : m === 0 ? null : y(a === "toolbar" ?
|
|
761
|
+
}) : m === 0 ? null : y(a === "toolbar" ? Y : J, {
|
|
757
762
|
layout: e,
|
|
758
763
|
row: t,
|
|
759
764
|
rowSelection: n,
|
|
@@ -769,4 +774,4 @@ function ae({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
769
774
|
onActionClick: p
|
|
770
775
|
});
|
|
771
776
|
}
|
|
772
|
-
export {
|
|
777
|
+
export { se as ResponsiveActionBar, L as RowMenuContent, K as computeLayout, x as interpolate, oe as slotIsContentSized };
|
|
@@ -69,25 +69,28 @@ function S(e) {
|
|
|
69
69
|
}] : []), { refs: i } = s(r, void 0, n?.entities);
|
|
70
70
|
return (e) => e.ref?.entity ? o(t, i, e.ref, e.value, n?.entities) : void 0;
|
|
71
71
|
}
|
|
72
|
-
function C({ type: e, value: t, values: n,
|
|
73
|
-
let
|
|
72
|
+
function C({ type: e, value: t, values: n, structure: r, label: i, maxWidth: a = 180 }) {
|
|
73
|
+
let o = d(), { data: s } = c(), l = (e) => {
|
|
74
74
|
let t = n?.find((t) => t.code === e);
|
|
75
|
-
return t &&
|
|
76
|
-
},
|
|
77
|
-
|
|
75
|
+
return t && o(t.name) || u(e);
|
|
76
|
+
}, f = (e) => {
|
|
77
|
+
let t = r ? s?.structures?.[r]?.fields : void 0;
|
|
78
|
+
return t ? [...t].filter(([t]) => t in e).map(([e, t]) => t.display ? o(t.display.name) : e).join(", ") || "—" : `{${Object.keys(e).join(", ")}}`;
|
|
79
|
+
}, p;
|
|
80
|
+
return p = i === void 0 ? t == null || t === "" ? "—" : n && n.length > 0 ? (Array.isArray(t) ? t.map(l).join(", ") : l(t)) || "—" : e === "bool" ? t ? o("params.value.on", "On") : o("params.value.off", "Off") : e === "multilang" || e === "multilang_text" ? o(t) || "—" : e === "multilang_array" && Array.isArray(t) ? t.map((e) => o(e)).join(", ") || "—" : e === "json" || e === "structure" ? Array.isArray(t) ? `[${t.map((e) => e && typeof e == "object" ? "{…}" : u(e)).join(", ")}]` : t && typeof t == "object" ? f(t) : u(t) : u(t) : i, /* @__PURE__ */ h("span", {
|
|
78
81
|
className: "mono",
|
|
79
|
-
title:
|
|
82
|
+
title: p,
|
|
80
83
|
style: {
|
|
81
84
|
display: "inline-block",
|
|
82
85
|
verticalAlign: "middle",
|
|
83
86
|
fontSize: 11.5,
|
|
84
87
|
color: "var(--text-2)",
|
|
85
|
-
maxWidth:
|
|
88
|
+
maxWidth: a,
|
|
86
89
|
overflow: "hidden",
|
|
87
90
|
textOverflow: "ellipsis",
|
|
88
91
|
whiteSpace: "nowrap"
|
|
89
92
|
},
|
|
90
|
-
children:
|
|
93
|
+
children: p
|
|
91
94
|
});
|
|
92
95
|
}
|
|
93
96
|
function w({ param: i, current: o, error: s, onCancel: c, onSave: l }) {
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { Icon as e } from "./Icons.js";
|
|
2
2
|
import { useText as t } from "../../hooks/useText.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { isUuid as n } from "../../lib/uuid.js";
|
|
4
|
+
import { useCallback as r, useState as i } from "react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
6
|
// src/components/primitives/RecordIdBadge.tsx
|
|
6
|
-
var
|
|
7
|
+
var s = 1200;
|
|
7
8
|
function c({ value: c }) {
|
|
8
|
-
let l = t(), [u, d] =
|
|
9
|
+
let l = t(), [u, d] = i(!1), f = n(c) ? `${c.slice(0, 8)}…` : c, p = r(async () => {
|
|
9
10
|
try {
|
|
10
11
|
await navigator.clipboard.writeText(c), d(!0), window.setTimeout(() => d(!1), s);
|
|
11
12
|
} catch {}
|
|
12
13
|
}, [c]);
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ o("button", {
|
|
14
15
|
type: "button",
|
|
15
16
|
onClick: p,
|
|
16
17
|
title: u ? l("control.copied", "Copied") : l("control.copy_value", "Copy {value}", { value: c }),
|
|
17
18
|
className: "mono inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-text-4 hover:bg-surface-2 hover:text-text-3 transition-colors shrink-0 border border-transparent hover:border-border",
|
|
18
|
-
children: [/* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ a("span", { children: f }), u ? /* @__PURE__ */ a(e.check, { size: 10 }) : /* @__PURE__ */ a(e.copy, {
|
|
19
20
|
size: 10,
|
|
20
21
|
style: { opacity: .6 }
|
|
21
22
|
})]
|
|
@@ -2,9 +2,10 @@ import { useEntity as e } from "./useEntity.js";
|
|
|
2
2
|
import { useEntityData as t } from "./useEntityData.js";
|
|
3
3
|
import { useScreen as n } from "./useScreen.js";
|
|
4
4
|
import { coerceDisplayString as r } from "../lib/display-value.js";
|
|
5
|
-
import {
|
|
5
|
+
import { isUuid as i } from "../lib/uuid.js";
|
|
6
|
+
import { useCallback as a, useMemo as o } from "react";
|
|
6
7
|
// src/hooks/useViews.ts
|
|
7
|
-
function
|
|
8
|
+
function s(e, t) {
|
|
8
9
|
let n = t && String(e.user_id) === t;
|
|
9
10
|
return {
|
|
10
11
|
id: String(e.id),
|
|
@@ -17,27 +18,27 @@ function o(e, t) {
|
|
|
17
18
|
sort: e.sort
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
let r = t("view", {
|
|
21
|
+
function c(e, n) {
|
|
22
|
+
let r = e && i(e) ? e : null, a = t("view", {
|
|
22
23
|
filters: [{
|
|
23
24
|
field: "id",
|
|
24
25
|
op: "eq",
|
|
25
|
-
value:
|
|
26
|
+
value: r ?? ""
|
|
26
27
|
}],
|
|
27
28
|
per_page: 1
|
|
28
|
-
}, !!
|
|
29
|
-
return
|
|
30
|
-
view:
|
|
31
|
-
isSettled: !
|
|
29
|
+
}, !!r), c = a.data?.data?.[0], l = o(() => c ? s(c, n) : void 0, [c, n]);
|
|
30
|
+
return r ? {
|
|
31
|
+
view: l,
|
|
32
|
+
isSettled: !a.isPending || a.fetchStatus === "paused"
|
|
32
33
|
} : {
|
|
33
34
|
view: void 0,
|
|
34
35
|
isSettled: !0
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
|
-
function c(e, t) {
|
|
38
|
-
return u(e, t).views;
|
|
39
|
-
}
|
|
40
38
|
function l(e, t) {
|
|
39
|
+
return d(e, t).views;
|
|
40
|
+
}
|
|
41
|
+
function u(e, t) {
|
|
41
42
|
return {
|
|
42
43
|
filters: [{
|
|
43
44
|
field: "screen_code",
|
|
@@ -56,8 +57,8 @@ function l(e, t) {
|
|
|
56
57
|
per_page: 100
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
let c = n(r),
|
|
60
|
+
function d(r, i) {
|
|
61
|
+
let c = n(r), l = e("view") !== void 0, d = t("view", u(r, i), l), f = d.data, p = o(() => {
|
|
61
62
|
let e = [];
|
|
62
63
|
if (c?.views) for (let t of c.views) e.push({
|
|
63
64
|
id: t.code,
|
|
@@ -68,20 +69,20 @@ function u(r, s) {
|
|
|
68
69
|
columns: t.columns,
|
|
69
70
|
sort: t.sort
|
|
70
71
|
});
|
|
71
|
-
if (f?.data) for (let t of f.data) e.push(
|
|
72
|
+
if (f?.data) for (let t of f.data) e.push(s(t, i));
|
|
72
73
|
return e;
|
|
73
74
|
}, [
|
|
74
75
|
c?.views,
|
|
75
76
|
f?.data,
|
|
76
|
-
|
|
77
|
+
i
|
|
77
78
|
]), { refetch: m } = d;
|
|
78
79
|
return {
|
|
79
80
|
views: p,
|
|
80
|
-
isSettled: !
|
|
81
|
+
isSettled: !l || !d.isPending || d.fetchStatus === "paused",
|
|
81
82
|
isFetching: d.isFetching,
|
|
82
|
-
refetch:
|
|
83
|
+
refetch: a(() => {
|
|
83
84
|
m();
|
|
84
85
|
}, [m])
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
|
-
export {
|
|
88
|
+
export { u as savedViewsParams, c as useViewById, l as useViews, d as useViewsQuery, s as viewItemFromRow };
|