@declarion/react 0.59.2 → 0.60.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/{AgentChatPanel.impl-DBH1Ff4G.js → AgentChatPanel.impl-BY-Ir7Sh.js} +39 -39
- package/dist-lib/{DetailAuditStrip-9eJM2Fml.js → DetailAuditStrip-B9p1XhjC.js} +11 -11
- package/dist-lib/{DraggableChildrenTable-4RZC351U.js → DraggableChildrenTable-CtL7rdT6.js} +34 -34
- package/dist-lib/{Grid-CQabaBLx.js → Grid-CYERLdXO.js} +1 -1
- package/dist-lib/{LayoutRenderer-DGKWZKpW.js → LayoutRenderer-B08IJKsZ.js} +465 -465
- package/dist-lib/{ListCardsBody-DfGmyNIu.js → ListCardsBody-Dje_rays.js} +26 -26
- package/dist-lib/{MarkdownRenderer-BDbzDv_y.js → MarkdownRenderer-N0IWjTH5.js} +1 -1
- package/dist-lib/{RefreshControl-Bhoib0ZA.js → RefreshControl-BEWSHtAC.js} +26 -26
- package/dist-lib/{SmartDetailPage.impl-DFjz29Ff.js → SmartDetailPage.impl-CYiM-ITJ.js} +470 -470
- package/dist-lib/SmartListPage.impl-Db_Pv9Xc.js +3051 -0
- package/dist-lib/SmartRecordListPage.impl-hbbLglC1.js +780 -0
- package/dist-lib/{SortHeaderMenu-Cijxk4cX.js → SortHeaderMenu-DKKeCGTH.js} +1 -1
- package/dist-lib/{action-dispatch-DY0c8U81.js → action-dispatch-DbiOpvd6.js} +187 -187
- package/dist-lib/api/data.d.ts +5 -1
- package/dist-lib/{cardProjection-Bkl2SSYz.js → cardProjection-nveYLvHR.js} +1 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
- package/dist-lib/components/pages/list/useActiveView.d.ts +9 -2
- package/dist-lib/components/pages/list/useListViews.d.ts +3 -2
- package/dist-lib/{failure-v-uGSpbX.js → failure-BT54OLHy.js} +5 -5
- package/dist-lib/{format-count-DA4wmmWR.js → format-count-DLFCdtME.js} +246 -246
- package/dist-lib/hooks/useObject.d.ts +3 -2
- package/dist-lib/index.js +613 -613
- package/dist-lib/lib/field-classification.d.ts +10 -1
- package/dist-lib/{peekDraftStore-D-cTbiIr.js → peekDraftStore-DSExeoAh.js} +6 -6
- package/dist-lib/{registry-Cb3W-czW.js → registry-CRPxNbkk.js} +444 -438
- package/dist-lib/testing.js +2 -2
- package/dist-lib/{useAgentConversation-D97IqE-J.js → useAgentConversation-BavrHfrU.js} +14 -14
- package/dist-lib/{useCurrentScreen-BL5NZFCw.js → useCurrentScreen-BPq7HMF1.js} +1083 -1017
- package/dist-lib/{useListQuery-BG1GyKtJ.js → useListQuery-CG1WM4cv.js} +5 -5
- package/dist-lib/{field-classification-C28XE-_P.js → useOwnRefresh-C18iWRgr.js} +132 -158
- package/dist-lib/{useProperties-4Lg3odrt.js → useProperties-C35JrjwQ.js} +2 -2
- package/dist-lib/{useTabSearchMirror-ZVLlINBX.js → useTabSearchMirror-DKktWWLB.js} +1 -1
- package/package.json +1 -1
- package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +0 -3046
- package/dist-lib/SmartRecordListPage.impl-C1FJLr80.js +0 -780
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import { $ as n,
|
|
2
|
+
import { $ as n, Dn as r, Jn as i, L as a, On as o, R as s, U as c, Wn as l, dt as u, fn as d, ft as f, gt as p, ht as m, lt as h, mt as g, pn as _, pt as v, qn as y, rt as b, st as x, tt as S, ut as C, yt as w } from "./useCurrentScreen-BPq7HMF1.js";
|
|
3
3
|
import { i as T, r as E, t as D, u as O } from "./useText-BFDCTUSo.js";
|
|
4
4
|
import { a as k, c as A, d as j, f as M, i as ee, l as te, m as N, n as P, o as F, p as I, r as L, s as R, t as z, u as ne } from "./value-By1-WJ8J.js";
|
|
5
5
|
import { Fragment as re, Suspense as B, lazy as V, useCallback as H, useEffect as U, useLayoutEffect as W, useMemo as ie, useRef as G, useState as K } from "react";
|
|
@@ -37,20 +37,20 @@ function de(e) {
|
|
|
37
37
|
return t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
|
|
38
38
|
}
|
|
39
39
|
function fe(e) {
|
|
40
|
-
let { field: t, fieldName: n, value: r, onChange: i, mode: a, alt: o, recordTitle: s, disabled: c, visual: l, uploadFieldCode: u, uploadSlotCode:
|
|
40
|
+
let { field: t, fieldName: n, value: r, onChange: i, mode: a, alt: o, recordTitle: s, disabled: c, visual: l, uploadFieldCode: u, uploadSlotCode: d } = e, p = P(r), [_, y] = K("idle"), [b, S] = K(null), [w, O] = K(null), [k, A] = K(null), [F, L] = K(!1), z = G(null), ne = G(!1), re = G(null), { register: B, unregister: V, isDraft: W } = x(), q = D(), X = D("errors");
|
|
41
41
|
U(() => () => {
|
|
42
42
|
z.current && z.current.abort();
|
|
43
43
|
}, []);
|
|
44
|
-
let Z = T(), ae = E(), oe = ie(() => M(
|
|
44
|
+
let Z = T(), ae = E(), oe = ie(() => M(p, o, n, Z, ae), [
|
|
45
45
|
o,
|
|
46
46
|
n,
|
|
47
|
-
|
|
47
|
+
p,
|
|
48
48
|
Z,
|
|
49
49
|
ae
|
|
50
50
|
]), se = t.display?.initials ? s?.trim() : void 0, ce = (t.accepts ?? ["image/*"]).join(","), le = H(async (r) => {
|
|
51
|
-
let a =
|
|
51
|
+
let a = m(r, t.accepts, t.max_size_bytes);
|
|
52
52
|
if (a) {
|
|
53
|
-
O(
|
|
53
|
+
O(f(q, X, a)), y("error");
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
let o = r;
|
|
@@ -67,7 +67,7 @@ function fe(e) {
|
|
|
67
67
|
}), y("error");
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
O(null), ne.current = !1, y("uploading"),
|
|
70
|
+
O(null), ne.current = !1, y("uploading"), S({
|
|
71
71
|
loaded: 0,
|
|
72
72
|
total: o.size,
|
|
73
73
|
pct: 0
|
|
@@ -75,19 +75,19 @@ function fe(e) {
|
|
|
75
75
|
let s = new AbortController();
|
|
76
76
|
z.current = s;
|
|
77
77
|
try {
|
|
78
|
-
let r = await
|
|
78
|
+
let r = await g({
|
|
79
79
|
file: o,
|
|
80
80
|
entityCode: e.entityCode,
|
|
81
81
|
fieldCode: u ?? n,
|
|
82
|
-
slotCode:
|
|
82
|
+
slotCode: d,
|
|
83
83
|
signal: s.signal,
|
|
84
|
-
onProgress:
|
|
84
|
+
onProgress: S
|
|
85
85
|
});
|
|
86
86
|
if (ne.current) {
|
|
87
|
-
|
|
87
|
+
C(r.id).catch(() => {}), V(r.id);
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
p && W(p.id) && (C(p.id).catch(() => {}), V(p.id)), B(r.id, () => C(r.id)), A(r.id), y("idle"), S(null);
|
|
91
91
|
let a = {
|
|
92
92
|
id: r.id,
|
|
93
93
|
filename: r.filename,
|
|
@@ -101,8 +101,8 @@ function fe(e) {
|
|
|
101
101
|
};
|
|
102
102
|
i?.(t.mode === "array" ? [a] : a);
|
|
103
103
|
} catch (e) {
|
|
104
|
-
if (e instanceof
|
|
105
|
-
O(
|
|
104
|
+
if (e instanceof h && e.code === "ABORTED") return;
|
|
105
|
+
O(v(q, X, e)), y("error"), S(null);
|
|
106
106
|
}
|
|
107
107
|
}, [
|
|
108
108
|
X,
|
|
@@ -117,20 +117,20 @@ function fe(e) {
|
|
|
117
117
|
e.entityCode,
|
|
118
118
|
B,
|
|
119
119
|
W,
|
|
120
|
-
|
|
120
|
+
p,
|
|
121
121
|
V,
|
|
122
122
|
u,
|
|
123
|
-
|
|
123
|
+
d
|
|
124
124
|
]), de = H(() => {
|
|
125
|
-
|
|
125
|
+
_ === "uploading" && z.current && (ne.current = !0, z.current.abort(), z.current = null, y("idle"), S(null)), k && (C(k).catch(() => {}), V(k), A(null));
|
|
126
126
|
}, [
|
|
127
|
-
|
|
127
|
+
_,
|
|
128
128
|
k,
|
|
129
129
|
V
|
|
130
130
|
]), fe = H(() => {
|
|
131
|
-
|
|
131
|
+
p && W(p.id) && (C(p.id).catch(() => {}), V(p.id), A(null)), i?.(t.mode === "array" ? [] : null);
|
|
132
132
|
}, [
|
|
133
|
-
|
|
133
|
+
p,
|
|
134
134
|
t.mode,
|
|
135
135
|
W,
|
|
136
136
|
i,
|
|
@@ -151,21 +151,21 @@ function fe(e) {
|
|
|
151
151
|
}, [c, le]), we = H((e) => {
|
|
152
152
|
let t = e.target.files?.[0];
|
|
153
153
|
e.target.value = "", t && le(t);
|
|
154
|
-
}, [le]), Te = l.aspectRatio ?? he(l.shape, t.display?.aspect_ratio), Ee = j(
|
|
154
|
+
}, [le]), Te = l.aspectRatio ?? he(l.shape, t.display?.aspect_ratio), Ee = j(p), De = {
|
|
155
155
|
aspectRatio: Te,
|
|
156
156
|
width: l.width ?? (l.shape === "wide" ? "100%" : "120px")
|
|
157
|
-
}, Oe = !!
|
|
157
|
+
}, Oe = !!p, ke = ue(p, t.display?.listable_thumbnail), Ae = te(p, t.display?.listable_thumbnail), je = ee(p?.id, Ae, ke), Me = a === "display", Ne = H((e) => {
|
|
158
158
|
e.stopPropagation(), L((e) => !e);
|
|
159
159
|
}, []), Pe = H((e) => {
|
|
160
|
-
if (!
|
|
161
|
-
let n = e.currentTarget.getBoundingClientRect(), r = n.width > 0 ? (e.clientX - n.left) / n.width : .5, a = n.height > 0 ? (e.clientY - n.top) / n.height : .5, o = I(
|
|
160
|
+
if (!p || !F) return;
|
|
161
|
+
let n = e.currentTarget.getBoundingClientRect(), r = n.width > 0 ? (e.clientX - n.left) / n.width : .5, a = n.height > 0 ? (e.clientY - n.top) / n.height : .5, o = I(p, {
|
|
162
162
|
x: Math.max(0, Math.min(1, r)),
|
|
163
163
|
y: Math.max(0, Math.min(1, a))
|
|
164
164
|
});
|
|
165
165
|
i?.(t.mode === "array" ? [o] : o), L(!1);
|
|
166
166
|
}, [
|
|
167
167
|
t.mode,
|
|
168
|
-
|
|
168
|
+
p,
|
|
169
169
|
F,
|
|
170
170
|
i
|
|
171
171
|
]);
|
|
@@ -190,9 +190,9 @@ function fe(e) {
|
|
|
190
190
|
role: "button",
|
|
191
191
|
"aria-label": oe,
|
|
192
192
|
"aria-disabled": c || void 0,
|
|
193
|
-
"aria-busy":
|
|
194
|
-
"aria-invalid":
|
|
195
|
-
onClick:
|
|
193
|
+
"aria-busy": _ === "uploading" || void 0,
|
|
194
|
+
"aria-invalid": _ === "error" || void 0,
|
|
195
|
+
onClick: _ === "idle" && !Oe ? be : void 0,
|
|
196
196
|
onMouseDown: F ? Pe : void 0,
|
|
197
197
|
onKeyDown: xe,
|
|
198
198
|
onDragOver: Se,
|
|
@@ -213,20 +213,20 @@ function fe(e) {
|
|
|
213
213
|
className: me(l.shape),
|
|
214
214
|
style: { objectPosition: R(Ee) },
|
|
215
215
|
loading: "lazy"
|
|
216
|
-
}) :
|
|
216
|
+
}) : _ === "uploading" ? null : /* @__PURE__ */ J(_e, {
|
|
217
217
|
shape: l.shape,
|
|
218
218
|
initialsTitle: se
|
|
219
219
|
}),
|
|
220
|
-
|
|
221
|
-
pct:
|
|
222
|
-
label: q("file.upload.progress", "Uploading {pct}%", { pct: Math.round(
|
|
220
|
+
_ === "uploading" && /* @__PURE__ */ J(ve, {
|
|
221
|
+
pct: b?.pct ?? 0,
|
|
222
|
+
label: q("file.upload.progress", "Uploading {pct}%", { pct: Math.round(b?.pct ?? 0) })
|
|
223
223
|
}),
|
|
224
224
|
k && /* @__PURE__ */ J("span", {
|
|
225
225
|
className: "absolute right-1 top-1 h-2 w-2 rounded-full bg-warning",
|
|
226
226
|
"aria-hidden": "true",
|
|
227
227
|
"data-testid": "draft-indicator"
|
|
228
228
|
}),
|
|
229
|
-
Oe &&
|
|
229
|
+
Oe && _ === "idle" && !c && /* @__PURE__ */ Y("div", {
|
|
230
230
|
className: "absolute inset-0 flex items-center justify-center gap-2 bg-black/40 opacity-0 transition-opacity hover:opacity-100 focus-within:opacity-100",
|
|
231
231
|
children: [
|
|
232
232
|
t.display?.focal_point && /* @__PURE__ */ J("button", {
|
|
@@ -262,7 +262,7 @@ function fe(e) {
|
|
|
262
262
|
},
|
|
263
263
|
"data-testid": "focal-point-marker"
|
|
264
264
|
}),
|
|
265
|
-
|
|
265
|
+
_ === "uploading" && /* @__PURE__ */ J("button", {
|
|
266
266
|
type: "button",
|
|
267
267
|
className: "absolute bottom-1 right-1 rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
268
268
|
onClick: (e) => {
|
|
@@ -271,7 +271,7 @@ function fe(e) {
|
|
|
271
271
|
"data-testid": "cancel-upload",
|
|
272
272
|
children: q("file.upload.cancel", "Cancel")
|
|
273
273
|
}),
|
|
274
|
-
|
|
274
|
+
_ === "error" && w && /* @__PURE__ */ Y("div", {
|
|
275
275
|
className: "absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-destructive-soft px-2 py-1 text-xs text-destructive",
|
|
276
276
|
role: "alert",
|
|
277
277
|
children: [/* @__PURE__ */ J("span", {
|
|
@@ -395,7 +395,7 @@ function xe(e) {
|
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/components/file-widgets/GridLazy.tsx
|
|
398
|
-
var Se = V(() => import("./Grid-
|
|
398
|
+
var Se = V(() => import("./Grid-CYERLdXO.js").then((e) => ({ default: e.Grid })));
|
|
399
399
|
function Ce() {
|
|
400
400
|
return /* @__PURE__ */ J("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
|
|
401
401
|
}
|
|
@@ -415,19 +415,19 @@ function Te({ contentType: e }) {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
function Ee(e) {
|
|
418
|
-
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o, uploadFieldCode: s, uploadSlotCode: c } = e, l = P(r), [
|
|
418
|
+
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o, uploadFieldCode: s, uploadSlotCode: c } = e, l = P(r), [d, p] = K("idle"), [_, y] = K(null), [b, S] = K(null), [w, T] = K(!1), [E, A] = K(l?.filename ?? ""), j = G(null), M = G(!1), ee = G(null), { register: te, unregister: I, isDraft: R } = x(), z = D(), re = D("errors"), { open: B } = L();
|
|
419
419
|
U(() => () => {
|
|
420
420
|
j.current && j.current.abort();
|
|
421
421
|
}, []), U(() => {
|
|
422
422
|
A(l?.filename ?? "");
|
|
423
423
|
}, [l?.filename]);
|
|
424
424
|
let V = (t.accepts ?? []).join(","), W = H(async (r) => {
|
|
425
|
-
let a =
|
|
425
|
+
let a = m(r, t.accepts, t.max_size_bytes);
|
|
426
426
|
if (a) {
|
|
427
|
-
|
|
427
|
+
S(f(z, re, a)), p("error");
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
430
|
-
|
|
430
|
+
S(null), M.current = !1, p("uploading"), y({
|
|
431
431
|
loaded: 0,
|
|
432
432
|
total: r.size,
|
|
433
433
|
pct: 0
|
|
@@ -435,7 +435,7 @@ function Ee(e) {
|
|
|
435
435
|
let o = new AbortController();
|
|
436
436
|
j.current = o;
|
|
437
437
|
try {
|
|
438
|
-
let a = await
|
|
438
|
+
let a = await g({
|
|
439
439
|
file: r,
|
|
440
440
|
entityCode: e.entityCode,
|
|
441
441
|
fieldCode: s ?? n,
|
|
@@ -444,10 +444,10 @@ function Ee(e) {
|
|
|
444
444
|
onProgress: y
|
|
445
445
|
});
|
|
446
446
|
if (M.current) {
|
|
447
|
-
|
|
447
|
+
C(a.id).catch(() => {}), I(a.id);
|
|
448
448
|
return;
|
|
449
449
|
}
|
|
450
|
-
l && R(l.id) && (
|
|
450
|
+
l && R(l.id) && (C(l.id).catch(() => {}), I(l.id)), te(a.id, () => C(a.id)), p("idle"), y(null);
|
|
451
451
|
let u = {
|
|
452
452
|
id: a.id,
|
|
453
453
|
filename: a.filename,
|
|
@@ -461,8 +461,8 @@ function Ee(e) {
|
|
|
461
461
|
};
|
|
462
462
|
i?.(t.mode === "array" ? [u] : u);
|
|
463
463
|
} catch (e) {
|
|
464
|
-
if (e instanceof
|
|
465
|
-
|
|
464
|
+
if (e instanceof h && e.code === "ABORTED") return;
|
|
465
|
+
S(v(z, re, e)), p("error"), y(null);
|
|
466
466
|
}
|
|
467
467
|
}, [
|
|
468
468
|
re,
|
|
@@ -485,7 +485,7 @@ function Ee(e) {
|
|
|
485
485
|
let t = e.target.files?.[0];
|
|
486
486
|
e.target.value = "", t && W(t);
|
|
487
487
|
}, [W]), Z = H(() => {
|
|
488
|
-
l && R(l.id) && (
|
|
488
|
+
l && R(l.id) && (C(l.id).catch(() => {}), I(l.id)), i?.(t.mode === "array" ? [] : null);
|
|
489
489
|
}, [
|
|
490
490
|
l,
|
|
491
491
|
t.mode,
|
|
@@ -493,8 +493,8 @@ function Ee(e) {
|
|
|
493
493
|
i,
|
|
494
494
|
I
|
|
495
495
|
]), ae = H(() => {
|
|
496
|
-
|
|
497
|
-
}, [
|
|
496
|
+
d === "uploading" && j.current && (M.current = !0, j.current.abort(), j.current = null, p("idle"), y(null));
|
|
497
|
+
}, [d]), oe = H(() => {
|
|
498
498
|
l && B(l.id, "download", F(l));
|
|
499
499
|
}, [l, B]), se = l ? k(l) : !1, ce = H(() => {
|
|
500
500
|
l && k(l) && B(l.id, "preview", ne(l));
|
|
@@ -519,7 +519,7 @@ function Ee(e) {
|
|
|
519
519
|
i,
|
|
520
520
|
t.mode
|
|
521
521
|
]), Q = a === "display";
|
|
522
|
-
return !l &&
|
|
522
|
+
return !l && d !== "uploading" ? /* @__PURE__ */ Y("div", {
|
|
523
523
|
"data-testid": `file-widget-${n}`,
|
|
524
524
|
className: "flex items-center gap-3 rounded-md border border-dashed border-border bg-surface p-3",
|
|
525
525
|
children: [
|
|
@@ -546,17 +546,17 @@ function Ee(e) {
|
|
|
546
546
|
style: { display: "none" },
|
|
547
547
|
"data-testid": `file-input-${n}`
|
|
548
548
|
}),
|
|
549
|
-
|
|
549
|
+
d === "error" && b && /* @__PURE__ */ J("div", {
|
|
550
550
|
className: "ml-auto text-xs text-destructive",
|
|
551
551
|
role: "alert",
|
|
552
|
-
children: /* @__PURE__ */ J(N, { failure:
|
|
552
|
+
children: /* @__PURE__ */ J(N, { failure: b })
|
|
553
553
|
})
|
|
554
554
|
]
|
|
555
555
|
}) : /* @__PURE__ */ Y("div", {
|
|
556
556
|
"data-testid": `file-widget-${n}`,
|
|
557
557
|
className: "flex items-center gap-3 rounded-md border border-border bg-surface p-3",
|
|
558
|
-
"aria-busy":
|
|
559
|
-
"aria-invalid":
|
|
558
|
+
"aria-busy": d === "uploading" || void 0,
|
|
559
|
+
"aria-invalid": d === "error" || void 0,
|
|
560
560
|
children: [
|
|
561
561
|
/* @__PURE__ */ J(Te, { contentType: l?.content_type }),
|
|
562
562
|
/* @__PURE__ */ Y("div", {
|
|
@@ -598,25 +598,25 @@ function Ee(e) {
|
|
|
598
598
|
})
|
|
599
599
|
]
|
|
600
600
|
}),
|
|
601
|
-
|
|
601
|
+
d === "uploading" && /* @__PURE__ */ J("div", {
|
|
602
602
|
className: "text-xs text-muted-foreground",
|
|
603
603
|
role: "progressbar",
|
|
604
|
-
"aria-valuenow":
|
|
604
|
+
"aria-valuenow": _?.pct ?? 0,
|
|
605
605
|
"aria-valuemin": 0,
|
|
606
606
|
"aria-valuemax": 100,
|
|
607
607
|
"data-testid": "upload-progress",
|
|
608
|
-
children: z("file.upload.progress", "Uploading {pct}%", { pct:
|
|
608
|
+
children: z("file.upload.progress", "Uploading {pct}%", { pct: _?.pct ?? 0 })
|
|
609
609
|
}),
|
|
610
|
-
|
|
610
|
+
d === "error" && b && /* @__PURE__ */ J("div", {
|
|
611
611
|
className: "text-xs text-destructive",
|
|
612
612
|
role: "alert",
|
|
613
|
-
children: /* @__PURE__ */ J(N, { failure:
|
|
613
|
+
children: /* @__PURE__ */ J(N, { failure: b })
|
|
614
614
|
})
|
|
615
615
|
]
|
|
616
616
|
}),
|
|
617
617
|
/* @__PURE__ */ Y("div", {
|
|
618
618
|
className: "flex flex-none items-center gap-1",
|
|
619
|
-
children: [l &&
|
|
619
|
+
children: [l && d !== "uploading" && /* @__PURE__ */ Y(q, { children: [
|
|
620
620
|
/* @__PURE__ */ J("button", {
|
|
621
621
|
type: "button",
|
|
622
622
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
@@ -648,7 +648,7 @@ function Ee(e) {
|
|
|
648
648
|
"data-testid": "remove",
|
|
649
649
|
children: z("file.remove", "Remove")
|
|
650
650
|
})] })
|
|
651
|
-
] }),
|
|
651
|
+
] }), d === "uploading" && /* @__PURE__ */ J("button", {
|
|
652
652
|
type: "button",
|
|
653
653
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs",
|
|
654
654
|
onClick: ae,
|
|
@@ -677,8 +677,8 @@ function Oe(e) {
|
|
|
677
677
|
return e ? (e.split("/")[1] ?? e).toUpperCase().slice(0, 6) : "";
|
|
678
678
|
}
|
|
679
679
|
function ke(e) {
|
|
680
|
-
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o } = e, s = z(r), [c, l] = K([]), { register:
|
|
681
|
-
|
|
680
|
+
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o } = e, s = z(r), [c, l] = K([]), { register: d, unregister: p, isDraft: _ } = x(), y = D(), b = D("errors"), S = G(s);
|
|
681
|
+
S.current = s;
|
|
682
682
|
let w = G(null), T = G(/* @__PURE__ */ new Set()), E = G([]);
|
|
683
683
|
E.current = c;
|
|
684
684
|
let { open: O } = L();
|
|
@@ -686,13 +686,13 @@ function ke(e) {
|
|
|
686
686
|
E.current.forEach((e) => e.abort());
|
|
687
687
|
}, []);
|
|
688
688
|
let k = (t.accepts ?? []).join(","), A = a === "display", j = H(async (r) => {
|
|
689
|
-
let a =
|
|
689
|
+
let a = m(r, t.accepts, t.max_size_bytes), o = `row-${Math.random().toString(36).slice(2)}-${Date.now()}`, s = new AbortController();
|
|
690
690
|
if (a) {
|
|
691
691
|
l((e) => [...e, {
|
|
692
692
|
localId: o,
|
|
693
693
|
filename: r.name,
|
|
694
694
|
progress: null,
|
|
695
|
-
error:
|
|
695
|
+
error: f(y, b, a),
|
|
696
696
|
abort: () => {}
|
|
697
697
|
}]);
|
|
698
698
|
return;
|
|
@@ -709,7 +709,7 @@ function ke(e) {
|
|
|
709
709
|
abort: () => s.abort()
|
|
710
710
|
}]);
|
|
711
711
|
try {
|
|
712
|
-
let t = await
|
|
712
|
+
let t = await g({
|
|
713
713
|
file: r,
|
|
714
714
|
entityCode: e.entityCode,
|
|
715
715
|
fieldCode: n,
|
|
@@ -720,10 +720,10 @@ function ke(e) {
|
|
|
720
720
|
} : t))
|
|
721
721
|
});
|
|
722
722
|
if (T.current.delete(o)) {
|
|
723
|
-
|
|
723
|
+
C(t.id).catch(() => {}), p(t.id);
|
|
724
724
|
return;
|
|
725
725
|
}
|
|
726
|
-
|
|
726
|
+
d(t.id, () => C(t.id));
|
|
727
727
|
let a = {
|
|
728
728
|
id: t.id,
|
|
729
729
|
filename: t.filename,
|
|
@@ -734,14 +734,14 @@ function ke(e) {
|
|
|
734
734
|
height: t.height,
|
|
735
735
|
url: t.url,
|
|
736
736
|
metadata: t.metadata
|
|
737
|
-
}, c = [...
|
|
738
|
-
|
|
737
|
+
}, c = [...S.current, a];
|
|
738
|
+
S.current = c, i?.(c), l((e) => e.filter((e) => e.localId !== o));
|
|
739
739
|
} catch (e) {
|
|
740
|
-
if (e instanceof
|
|
740
|
+
if (e instanceof h && e.code === "ABORTED") {
|
|
741
741
|
l((e) => e.filter((e) => e.localId !== o));
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
let t =
|
|
744
|
+
let t = v(y, b, e);
|
|
745
745
|
l((e) => e.map((e) => e.localId === o ? {
|
|
746
746
|
...e,
|
|
747
747
|
error: t,
|
|
@@ -750,15 +750,15 @@ function ke(e) {
|
|
|
750
750
|
} : e));
|
|
751
751
|
}
|
|
752
752
|
}, [
|
|
753
|
-
|
|
753
|
+
b,
|
|
754
754
|
y,
|
|
755
755
|
t.accepts,
|
|
756
756
|
t.max_size_bytes,
|
|
757
757
|
n,
|
|
758
758
|
i,
|
|
759
759
|
e.entityCode,
|
|
760
|
-
|
|
761
|
-
|
|
760
|
+
d,
|
|
761
|
+
p
|
|
762
762
|
]), M = H((e) => {
|
|
763
763
|
Array.from(e).forEach((e) => void j(e));
|
|
764
764
|
}, [j]), ee = H(() => {
|
|
@@ -767,12 +767,12 @@ function ke(e) {
|
|
|
767
767
|
let t = e.target.files;
|
|
768
768
|
e.target.value = "", t && t.length > 0 && M(t);
|
|
769
769
|
}, [M]), P = H((e) => {
|
|
770
|
-
|
|
770
|
+
_(e) && (C(e).catch(() => {}), p(e)), i?.(s.filter((t) => t.id !== e));
|
|
771
771
|
}, [
|
|
772
|
-
|
|
772
|
+
_,
|
|
773
773
|
s,
|
|
774
774
|
i,
|
|
775
|
-
|
|
775
|
+
p
|
|
776
776
|
]), I = H((e) => {
|
|
777
777
|
O(e.id, "download", F(e));
|
|
778
778
|
}, [O]);
|
|
@@ -976,55 +976,55 @@ function Re(e, t) {
|
|
|
976
976
|
function ze(e, t, n) {
|
|
977
977
|
if (Le(e, n)) return Re(t, n);
|
|
978
978
|
let r = e.fields.get(n);
|
|
979
|
-
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ?
|
|
979
|
+
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? p(t[n], Re(t, n)) : t[n];
|
|
980
980
|
}
|
|
981
981
|
function Be(e, t, n) {
|
|
982
982
|
let r = e.fields.get(t);
|
|
983
983
|
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? w(n) : n;
|
|
984
984
|
}
|
|
985
|
-
function Ve(e, t, n,
|
|
986
|
-
let
|
|
987
|
-
if (
|
|
988
|
-
let
|
|
989
|
-
return
|
|
985
|
+
function Ve(e, t, n, i) {
|
|
986
|
+
let a = Le(t, n);
|
|
987
|
+
if (a) return a.name || n;
|
|
988
|
+
let o = t.fields.get(n);
|
|
989
|
+
return o ? r(e, o, n, i) : n;
|
|
990
990
|
}
|
|
991
991
|
function He(e) {
|
|
992
|
-
let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange:
|
|
993
|
-
if (
|
|
994
|
-
let e =
|
|
995
|
-
return
|
|
996
|
-
field:
|
|
992
|
+
let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: s, refs: c, disabled: l, surface: u, entities: d, screens: f, t: p, fieldId: m, labelId: h, structure: g, detailScreen: _ } = e, v = Le(t, r);
|
|
993
|
+
if (v) {
|
|
994
|
+
let e = v.display?.widget ?? "", c = ae(e);
|
|
995
|
+
return c ? /* @__PURE__ */ J(c, {
|
|
996
|
+
field: v,
|
|
997
997
|
fieldName: r,
|
|
998
998
|
entityCode: n,
|
|
999
999
|
value: Re(i, r),
|
|
1000
|
-
recordTitle:
|
|
1000
|
+
recordTitle: o(p, i, t),
|
|
1001
1001
|
mode: a,
|
|
1002
|
-
onChange:
|
|
1003
|
-
disabled:
|
|
1004
|
-
fieldId:
|
|
1002
|
+
onChange: s,
|
|
1003
|
+
disabled: l,
|
|
1004
|
+
fieldId: m
|
|
1005
1005
|
}) : /* @__PURE__ */ J(Ae, { widgetCode: e });
|
|
1006
1006
|
}
|
|
1007
|
-
let
|
|
1008
|
-
...
|
|
1009
|
-
structure:
|
|
1010
|
-
} :
|
|
1011
|
-
return
|
|
1012
|
-
field:
|
|
1007
|
+
let y = t.fields.get(r), x = g && a === "display" && y ? {
|
|
1008
|
+
...y,
|
|
1009
|
+
structure: g
|
|
1010
|
+
} : y;
|
|
1011
|
+
return x ? b({
|
|
1012
|
+
field: x,
|
|
1013
1013
|
entityCode: n,
|
|
1014
1014
|
fieldName: r,
|
|
1015
1015
|
value: ze(t, i, r),
|
|
1016
1016
|
mode: a,
|
|
1017
|
-
onChange:
|
|
1017
|
+
onChange: s,
|
|
1018
1018
|
record: i,
|
|
1019
|
-
refs:
|
|
1020
|
-
surface:
|
|
1021
|
-
entity: n &&
|
|
1022
|
-
entities:
|
|
1023
|
-
screens:
|
|
1024
|
-
t:
|
|
1025
|
-
fieldId:
|
|
1026
|
-
labelId:
|
|
1027
|
-
detailScreen:
|
|
1019
|
+
refs: c,
|
|
1020
|
+
surface: u,
|
|
1021
|
+
entity: n && d ? d[n] : void 0,
|
|
1022
|
+
entities: d,
|
|
1023
|
+
screens: f,
|
|
1024
|
+
t: p,
|
|
1025
|
+
fieldId: m,
|
|
1026
|
+
labelId: h,
|
|
1027
|
+
detailScreen: _
|
|
1028
1028
|
}) : null;
|
|
1029
1029
|
}
|
|
1030
1030
|
//#endregion
|
|
@@ -1036,7 +1036,7 @@ function We(e) {
|
|
|
1036
1036
|
return e.widget ? "widget" : e.href ? "href" : e.handler ? "handler" : e.association ? "association" : e.ui_steps && e.ui_steps.length > 0 ? "ui_steps" : "unknown";
|
|
1037
1037
|
}
|
|
1038
1038
|
function Ge(e, t, n, r, i) {
|
|
1039
|
-
let a = We(t), o =
|
|
1039
|
+
let a = We(t), o = S(n, r?.entity), s = r?.entityCode ?? "";
|
|
1040
1040
|
if (e === "__peek") return i?.({
|
|
1041
1041
|
code: e,
|
|
1042
1042
|
entity: s,
|
|
@@ -1112,27 +1112,27 @@ function Ze(e, t, n) {
|
|
|
1112
1112
|
function Qe(e) {
|
|
1113
1113
|
return `action-tooltip-${e}`;
|
|
1114
1114
|
}
|
|
1115
|
-
function $e({ leaf: e, entityActions: n, globalActions: r, onRun:
|
|
1116
|
-
let
|
|
1117
|
-
if (!(!_ || S ||
|
|
1118
|
-
|
|
1115
|
+
function $e({ leaf: e, entityActions: n, globalActions: r, onRun: a, loading: o, onLoadingChange: s, measureRef: l, style: u, row: f, widgetContext: p, onActionClick: m, iconOnly: h = !1 }) {
|
|
1116
|
+
let g = D(), _ = Ye(e.code, n, r), v = Xe(g, e.code, n, r), y = Ze(e.code, n, r), b = _?.destructive ?? !1, x = !b && _?.display?.primary === !0, S = !e.enabled, C = S ? Qe(e.code) : void 0, w = H(async () => {
|
|
1117
|
+
if (!(!_ || S || o)) {
|
|
1118
|
+
s(!0);
|
|
1119
1119
|
try {
|
|
1120
|
-
Ge(e.code, _,
|
|
1120
|
+
Ge(e.code, _, f, p, m) || await Promise.resolve(a(e.code, _));
|
|
1121
1121
|
} finally {
|
|
1122
|
-
|
|
1122
|
+
s(!1);
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
}, [
|
|
1126
1126
|
_,
|
|
1127
1127
|
S,
|
|
1128
|
+
o,
|
|
1128
1129
|
a,
|
|
1129
|
-
i,
|
|
1130
1130
|
e.code,
|
|
1131
|
-
|
|
1132
|
-
d,
|
|
1131
|
+
s,
|
|
1133
1132
|
f,
|
|
1134
|
-
p
|
|
1135
|
-
|
|
1133
|
+
p,
|
|
1134
|
+
m
|
|
1135
|
+
]), T = o ? /* @__PURE__ */ J(d, { size: 12 }) : y ? /* @__PURE__ */ J(t, {
|
|
1136
1136
|
name: y,
|
|
1137
1137
|
size: 12
|
|
1138
1138
|
}) : null;
|
|
@@ -1147,40 +1147,40 @@ function $e({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
1147
1147
|
clip: "rect(0,0,0,0)"
|
|
1148
1148
|
},
|
|
1149
1149
|
children: e.reason
|
|
1150
|
-
}), /* @__PURE__ */ J(
|
|
1150
|
+
}), /* @__PURE__ */ J(i, {
|
|
1151
1151
|
ref: l,
|
|
1152
1152
|
kind: x ? "primary" : "default",
|
|
1153
1153
|
danger: b,
|
|
1154
1154
|
icon: T,
|
|
1155
|
-
disabled: S ||
|
|
1155
|
+
disabled: S || o,
|
|
1156
1156
|
"aria-disabled": S ? "true" : void 0,
|
|
1157
1157
|
"aria-describedby": C,
|
|
1158
|
-
"aria-label":
|
|
1159
|
-
title: c(
|
|
1158
|
+
"aria-label": h ? v : void 0,
|
|
1159
|
+
title: c(g, _, v, S, e.reason, h),
|
|
1160
1160
|
onClick: w,
|
|
1161
1161
|
style: u,
|
|
1162
|
-
children:
|
|
1162
|
+
children: h ? null : v
|
|
1163
1163
|
})] });
|
|
1164
1164
|
}
|
|
1165
|
-
function et({ group: n, entityActions: r, globalActions:
|
|
1166
|
-
let
|
|
1165
|
+
function et({ group: n, entityActions: r, globalActions: a, onRun: o, loading: s, onLoadingChange: c, measureRef: u, style: f, row: p, widgetContext: m, onActionClick: h }) {
|
|
1166
|
+
let g = D(), _ = G(null), [v, y] = K(!1), b = n.name ? g(n.name) : g("action.menu.title", "Actions"), x = H((e) => {
|
|
1167
1167
|
_.current = e, u?.(e);
|
|
1168
1168
|
}, [u]), S = H((e, t) => (y(!1), o(e, t)), [o]);
|
|
1169
|
-
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(
|
|
1169
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(i, {
|
|
1170
1170
|
ref: x,
|
|
1171
1171
|
kind: "default",
|
|
1172
|
-
icon:
|
|
1172
|
+
icon: s == null ? n.icon ? /* @__PURE__ */ J(t, {
|
|
1173
1173
|
name: n.icon,
|
|
1174
1174
|
size: 12
|
|
1175
|
-
}) : void 0 : /* @__PURE__ */ J(
|
|
1175
|
+
}) : void 0 : /* @__PURE__ */ J(d, { size: 12 }),
|
|
1176
1176
|
iconRight: /* @__PURE__ */ J(e.down, { size: 10 }),
|
|
1177
1177
|
"aria-haspopup": "menu",
|
|
1178
1178
|
"aria-expanded": v ? "true" : "false",
|
|
1179
1179
|
title: b,
|
|
1180
1180
|
onClick: () => y((e) => !e),
|
|
1181
|
-
style:
|
|
1181
|
+
style: f,
|
|
1182
1182
|
children: b
|
|
1183
|
-
}), /* @__PURE__ */ J(
|
|
1183
|
+
}), /* @__PURE__ */ J(l, {
|
|
1184
1184
|
open: v,
|
|
1185
1185
|
anchor: _.current,
|
|
1186
1186
|
onClose: () => y(!1),
|
|
@@ -1192,30 +1192,30 @@ function et({ group: n, entityActions: r, globalActions: i, onRun: o, loading: c
|
|
|
1192
1192
|
children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ J(tt, {
|
|
1193
1193
|
leaf: e,
|
|
1194
1194
|
entityActions: r,
|
|
1195
|
-
globalActions:
|
|
1195
|
+
globalActions: a,
|
|
1196
1196
|
onRun: S,
|
|
1197
|
-
loading:
|
|
1198
|
-
onLoadingChange: (t) =>
|
|
1199
|
-
row:
|
|
1200
|
-
widgetContext:
|
|
1201
|
-
onActionClick:
|
|
1197
|
+
loading: s === e.code,
|
|
1198
|
+
onLoadingChange: (t) => c(t ? e.code : null),
|
|
1199
|
+
row: p,
|
|
1200
|
+
widgetContext: m,
|
|
1201
|
+
onActionClick: h
|
|
1202
1202
|
}, e.code) : /* @__PURE__ */ J(nt, {
|
|
1203
1203
|
group: e,
|
|
1204
1204
|
entityActions: r,
|
|
1205
|
-
globalActions:
|
|
1205
|
+
globalActions: a,
|
|
1206
1206
|
onRun: S,
|
|
1207
|
-
loading:
|
|
1208
|
-
onLoadingChange:
|
|
1209
|
-
row:
|
|
1210
|
-
widgetContext:
|
|
1211
|
-
onActionClick:
|
|
1207
|
+
loading: s,
|
|
1208
|
+
onLoadingChange: c,
|
|
1209
|
+
row: p,
|
|
1210
|
+
widgetContext: m,
|
|
1211
|
+
onActionClick: h
|
|
1212
1212
|
}, e.items[0]?.kind === "action" ? e.items[0].code : e.icon ?? "group"))
|
|
1213
1213
|
})
|
|
1214
1214
|
})] });
|
|
1215
1215
|
}
|
|
1216
1216
|
function tt({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a, onLoadingChange: o, row: s, widgetContext: l, onActionClick: u }) {
|
|
1217
|
-
let
|
|
1218
|
-
name:
|
|
1217
|
+
let f = D(), p = Ye(e.code, n, r), m = Xe(f, e.code, n, r), h = Ze(e.code, n, r), g = p?.destructive ?? !1, _ = !e.enabled, v = _ ? Qe(e.code) : void 0, y = a ? /* @__PURE__ */ J(d, { size: 12 }) : h ? /* @__PURE__ */ J(t, {
|
|
1218
|
+
name: h,
|
|
1219
1219
|
size: 12
|
|
1220
1220
|
}) : null;
|
|
1221
1221
|
return /* @__PURE__ */ Y(q, { children: [v && e.reason && /* @__PURE__ */ J("span", {
|
|
@@ -1233,12 +1233,12 @@ function tt({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
1233
1233
|
role: "menuitem",
|
|
1234
1234
|
"aria-disabled": _ ? "true" : void 0,
|
|
1235
1235
|
"aria-describedby": v,
|
|
1236
|
-
title: c(
|
|
1236
|
+
title: c(f, p, m, _, e.reason),
|
|
1237
1237
|
onClick: async () => {
|
|
1238
|
-
if (!(!
|
|
1238
|
+
if (!(!p || _ || a)) {
|
|
1239
1239
|
o(!0);
|
|
1240
1240
|
try {
|
|
1241
|
-
Ge(e.code,
|
|
1241
|
+
Ge(e.code, p, s, l, u) || await Promise.resolve(i(e.code, p));
|
|
1242
1242
|
} finally {
|
|
1243
1243
|
o(!1);
|
|
1244
1244
|
}
|
|
@@ -1251,7 +1251,7 @@ function tt({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
1251
1251
|
padding: "6px 10px",
|
|
1252
1252
|
borderRadius: 5,
|
|
1253
1253
|
fontSize: 12.5,
|
|
1254
|
-
color:
|
|
1254
|
+
color: g ? "var(--danger)" : _ ? "var(--text-3)" : "var(--text-2)",
|
|
1255
1255
|
cursor: _ ? "not-allowed" : "pointer",
|
|
1256
1256
|
opacity: _ ? .6 : 1
|
|
1257
1257
|
},
|
|
@@ -1263,13 +1263,13 @@ function tt({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
1263
1263
|
},
|
|
1264
1264
|
children: [y && /* @__PURE__ */ J("span", {
|
|
1265
1265
|
style: {
|
|
1266
|
-
color:
|
|
1266
|
+
color: g ? "var(--danger)" : "var(--text-3)",
|
|
1267
1267
|
display: "flex"
|
|
1268
1268
|
},
|
|
1269
1269
|
children: y
|
|
1270
1270
|
}), /* @__PURE__ */ J("span", {
|
|
1271
1271
|
style: { flex: 1 },
|
|
1272
|
-
children:
|
|
1272
|
+
children: m
|
|
1273
1273
|
})]
|
|
1274
1274
|
})] });
|
|
1275
1275
|
}
|
|
@@ -1307,23 +1307,23 @@ function nt({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
1307
1307
|
onActionClick: c
|
|
1308
1308
|
}, e.icon ?? "nested"))] });
|
|
1309
1309
|
}
|
|
1310
|
-
function rt({ layout: t, entityActions: n, globalActions: r, onRun:
|
|
1311
|
-
let
|
|
1310
|
+
function rt({ layout: t, entityActions: n, globalActions: r, onRun: i, row: a, widgetContext: o, onActionClick: s }) {
|
|
1311
|
+
let c = D(), u = G(null), [f, p] = K(!1), [m, h] = K(null), g = H((e, t) => (p(!1), i(e, t)), [i]);
|
|
1312
1312
|
return Ke(t) === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
1313
1313
|
"data-open": f ? "true" : void 0,
|
|
1314
1314
|
style: {
|
|
1315
1315
|
display: "inline-flex",
|
|
1316
1316
|
alignItems: "center"
|
|
1317
1317
|
},
|
|
1318
|
-
children: [/* @__PURE__ */ J(
|
|
1319
|
-
ref:
|
|
1320
|
-
icon: J(m == null ? e.more :
|
|
1321
|
-
title:
|
|
1318
|
+
children: [/* @__PURE__ */ J(y, {
|
|
1319
|
+
ref: u,
|
|
1320
|
+
icon: J(m == null ? e.more : d, { size: 14 }),
|
|
1321
|
+
title: c("action.menu.title", "Actions"),
|
|
1322
1322
|
size: 28,
|
|
1323
1323
|
onClick: () => p((e) => !e)
|
|
1324
|
-
}), /* @__PURE__ */ J(
|
|
1324
|
+
}), /* @__PURE__ */ J(l, {
|
|
1325
1325
|
open: f,
|
|
1326
|
-
anchor:
|
|
1326
|
+
anchor: u.current,
|
|
1327
1327
|
onClose: () => p(!1),
|
|
1328
1328
|
align: "end",
|
|
1329
1329
|
width: 220,
|
|
@@ -1331,12 +1331,12 @@ function rt({ layout: t, entityActions: n, globalActions: r, onRun: o, row: s, w
|
|
|
1331
1331
|
layout: t,
|
|
1332
1332
|
entityActions: n,
|
|
1333
1333
|
globalActions: r,
|
|
1334
|
-
onRun:
|
|
1334
|
+
onRun: g,
|
|
1335
1335
|
loading: m,
|
|
1336
1336
|
onLoadingChange: h,
|
|
1337
|
-
row:
|
|
1338
|
-
widgetContext:
|
|
1339
|
-
onActionClick:
|
|
1337
|
+
row: a,
|
|
1338
|
+
widgetContext: o,
|
|
1339
|
+
onActionClick: s
|
|
1340
1340
|
})
|
|
1341
1341
|
})]
|
|
1342
1342
|
});
|
|
@@ -1348,7 +1348,7 @@ function it(e) {
|
|
|
1348
1348
|
return t;
|
|
1349
1349
|
}
|
|
1350
1350
|
function at({ layout: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c, ariaLabel: l }) {
|
|
1351
|
-
let u = D(), { normal: d, destructive: f } = qe(e, t, n), p = it(d), m = d.slice(0, p), h = d.slice(p), g = f.length > 0,
|
|
1351
|
+
let u = D(), { normal: d, destructive: f } = qe(e, t, n), p = it(d), m = d.slice(0, p), h = d.slice(p), g = f.length > 0, v = h.length > 0, y = (e) => /* @__PURE__ */ J(tt, {
|
|
1352
1352
|
leaf: e,
|
|
1353
1353
|
entityActions: t,
|
|
1354
1354
|
globalActions: n,
|
|
@@ -1364,7 +1364,7 @@ function at({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
1364
1364
|
"aria-label": l ?? u("action.menu.row_actions", "Row actions"),
|
|
1365
1365
|
children: [
|
|
1366
1366
|
m.map((e) => e.kind === "action" ? y(e) : null),
|
|
1367
|
-
m.length > 0 &&
|
|
1367
|
+
m.length > 0 && v && /* @__PURE__ */ J(_, { divider: !0 }),
|
|
1368
1368
|
h.map((e) => e.kind === "action" ? y(e) : /* @__PURE__ */ J(nt, {
|
|
1369
1369
|
group: e,
|
|
1370
1370
|
entityActions: t,
|
|
@@ -1376,7 +1376,7 @@ function at({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
1376
1376
|
widgetContext: s,
|
|
1377
1377
|
onActionClick: c
|
|
1378
1378
|
}, e.icon ?? "group")),
|
|
1379
|
-
g && /* @__PURE__ */ J(
|
|
1379
|
+
g && /* @__PURE__ */ J(_, { divider: !0 }),
|
|
1380
1380
|
f.map((e) => y(e))
|
|
1381
1381
|
]
|
|
1382
1382
|
});
|
|
@@ -1451,8 +1451,8 @@ function bt(e) {
|
|
|
1451
1451
|
let n = getComputedStyle(t);
|
|
1452
1452
|
return !(parseFloat(n.flexGrow) > 0 || n.display === "block" || n.display === "flow-root" || n.width !== "auto" || n.maxWidth !== "none");
|
|
1453
1453
|
}
|
|
1454
|
-
function xt({ layout: t, entityActions: n, globalActions: r, onRun:
|
|
1455
|
-
let h = D(), g = G(null),
|
|
1454
|
+
function xt({ layout: t, entityActions: n, globalActions: r, onRun: a, reservedRightWidth: o = 0, measurementOverride: s, ariaLabel: c, align: u = "trailing", constrain: d = !0, row: f, widgetContext: p, onActionClick: m }) {
|
|
1455
|
+
let h = D(), g = G(null), v = G(null), [y, b] = K(0), [x, S] = K(/* @__PURE__ */ new Map()), [C, w] = K(!1), [T, E] = K(null), [O, k] = K(() => typeof document < "u" && document.documentElement.dir === "rtl");
|
|
1456
1456
|
U(() => {
|
|
1457
1457
|
if (typeof MutationObserver > "u") return;
|
|
1458
1458
|
let e = new MutationObserver((e) => {
|
|
@@ -1463,9 +1463,9 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1463
1463
|
attributeFilter: ["dir", "lang"]
|
|
1464
1464
|
}), () => e.disconnect();
|
|
1465
1465
|
}, []);
|
|
1466
|
-
let A = G(null), [j, M] = K(!1), ee = H((e, t) => (M(!1),
|
|
1467
|
-
if (N || !
|
|
1468
|
-
let e = Array.from(
|
|
1466
|
+
let A = G(null), [j, M] = K(!1), ee = H((e, t) => (M(!1), a(e, t)), [a]), te = Ke(t), N = !!s, P = H(() => {
|
|
1467
|
+
if (N || !v.current) return;
|
|
1468
|
+
let e = Array.from(v.current.children), t = /* @__PURE__ */ new Map();
|
|
1469
1469
|
e.forEach((e) => {
|
|
1470
1470
|
let n = e.dataset.nodeKey;
|
|
1471
1471
|
n && t.set(n, e.getBoundingClientRect().width || e.offsetWidth);
|
|
@@ -1473,7 +1473,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1473
1473
|
}, [N]), F = ie(() => JSON.stringify(t.map((e) => $(e))), [t]);
|
|
1474
1474
|
U(() => {
|
|
1475
1475
|
if (N) return;
|
|
1476
|
-
let e =
|
|
1476
|
+
let e = v.current;
|
|
1477
1477
|
if (!e || typeof ResizeObserver > "u") return;
|
|
1478
1478
|
let t = new ResizeObserver(() => P());
|
|
1479
1479
|
t.observe(e);
|
|
@@ -1537,7 +1537,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1537
1537
|
U(() => {
|
|
1538
1538
|
I.current = void 0, L.current = void 0;
|
|
1539
1539
|
}, [F]);
|
|
1540
|
-
let R = ie(() => N || !d ? yt(t, 2 ** 53 - 1, o, x, n, r,
|
|
1540
|
+
let R = ie(() => N || !d ? yt(t, 2 ** 53 - 1, o, x, n, r, s) : C ? y === 0 ? yt(t, 2 ** 53 - 1, o, x, n, r, s) : yt(t, y, o, x, n, r, s, I.current, L.current) : {
|
|
1541
1541
|
primaryInline: [],
|
|
1542
1542
|
inline: [],
|
|
1543
1543
|
overflow: [],
|
|
@@ -1553,7 +1553,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1553
1553
|
x,
|
|
1554
1554
|
n,
|
|
1555
1555
|
r,
|
|
1556
|
-
|
|
1556
|
+
s
|
|
1557
1557
|
]);
|
|
1558
1558
|
if (U(() => {
|
|
1559
1559
|
(C || N) && (I.current = new Set([
|
|
@@ -1570,7 +1570,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1570
1570
|
return /* @__PURE__ */ Y("div", {
|
|
1571
1571
|
ref: g,
|
|
1572
1572
|
role: "toolbar",
|
|
1573
|
-
"aria-label":
|
|
1573
|
+
"aria-label": c ?? h("action.menu.title", "Actions"),
|
|
1574
1574
|
style: {
|
|
1575
1575
|
display: "flex",
|
|
1576
1576
|
flexDirection: O ? "row-reverse" : "row",
|
|
@@ -1586,7 +1586,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1586
1586
|
},
|
|
1587
1587
|
children: [
|
|
1588
1588
|
/* @__PURE__ */ Y("div", {
|
|
1589
|
-
ref:
|
|
1589
|
+
ref: v,
|
|
1590
1590
|
"aria-hidden": "true",
|
|
1591
1591
|
inert: !0,
|
|
1592
1592
|
style: {
|
|
@@ -1600,7 +1600,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1600
1600
|
width: "max-content",
|
|
1601
1601
|
flexWrap: "nowrap"
|
|
1602
1602
|
},
|
|
1603
|
-
children: [/* @__PURE__ */ J(
|
|
1603
|
+
children: [/* @__PURE__ */ J(i, {
|
|
1604
1604
|
"data-node-key": ot,
|
|
1605
1605
|
iconRight: /* @__PURE__ */ J(e.down, { size: 10 }),
|
|
1606
1606
|
tabIndex: -1,
|
|
@@ -1646,7 +1646,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1646
1646
|
leaf: e,
|
|
1647
1647
|
entityActions: n,
|
|
1648
1648
|
globalActions: r,
|
|
1649
|
-
onRun:
|
|
1649
|
+
onRun: a,
|
|
1650
1650
|
loading: T === e.code,
|
|
1651
1651
|
onLoadingChange: (t) => E(t ? e.code : null),
|
|
1652
1652
|
row: f,
|
|
@@ -1660,7 +1660,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1660
1660
|
leaf: e,
|
|
1661
1661
|
entityActions: n,
|
|
1662
1662
|
globalActions: r,
|
|
1663
|
-
onRun:
|
|
1663
|
+
onRun: a,
|
|
1664
1664
|
loading: T === e.code,
|
|
1665
1665
|
onLoadingChange: (t) => E(t ? e.code : null),
|
|
1666
1666
|
row: f,
|
|
@@ -1671,7 +1671,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1671
1671
|
group: e,
|
|
1672
1672
|
entityActions: n,
|
|
1673
1673
|
globalActions: r,
|
|
1674
|
-
onRun:
|
|
1674
|
+
onRun: a,
|
|
1675
1675
|
loading: T,
|
|
1676
1676
|
onLoadingChange: E,
|
|
1677
1677
|
row: f,
|
|
@@ -1679,7 +1679,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1679
1679
|
onActionClick: m
|
|
1680
1680
|
}, t);
|
|
1681
1681
|
}),
|
|
1682
|
-
z && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(
|
|
1682
|
+
z && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(i, {
|
|
1683
1683
|
ref: A,
|
|
1684
1684
|
kind: "default",
|
|
1685
1685
|
iconRight: /* @__PURE__ */ J(e.down, { size: 10 }),
|
|
@@ -1687,7 +1687,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1687
1687
|
"aria-expanded": j ? "true" : "false",
|
|
1688
1688
|
onClick: () => M((e) => !e),
|
|
1689
1689
|
children: h("action.menu.title", "Actions")
|
|
1690
|
-
}), /* @__PURE__ */ J(
|
|
1690
|
+
}), /* @__PURE__ */ J(l, {
|
|
1691
1691
|
open: j,
|
|
1692
1692
|
anchor: A.current,
|
|
1693
1693
|
onClose: () => M(!1),
|
|
@@ -1700,7 +1700,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1700
1700
|
...ne,
|
|
1701
1701
|
...B.length > 0 ? [null] : [],
|
|
1702
1702
|
...B
|
|
1703
|
-
].map((e, t) => e === null ? /* @__PURE__ */ J(
|
|
1703
|
+
].map((e, t) => e === null ? /* @__PURE__ */ J(_, { divider: !0 }, "destructive-divider") : e.kind === "action" ? /* @__PURE__ */ J(tt, {
|
|
1704
1704
|
leaf: e,
|
|
1705
1705
|
entityActions: n,
|
|
1706
1706
|
globalActions: r,
|
|
@@ -1727,7 +1727,7 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: i, reservedR
|
|
|
1727
1727
|
leaf: e,
|
|
1728
1728
|
entityActions: n,
|
|
1729
1729
|
globalActions: r,
|
|
1730
|
-
onRun:
|
|
1730
|
+
onRun: a,
|
|
1731
1731
|
loading: T === e.code,
|
|
1732
1732
|
onLoadingChange: (t) => E(t ? e.code : null),
|
|
1733
1733
|
row: f,
|
|
@@ -1960,8 +1960,8 @@ function Gt(e, t, n) {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
//#endregion
|
|
1962
1962
|
//#region src/lib/action-dispatch.ts
|
|
1963
|
-
function Kt(e, t, n,
|
|
1964
|
-
return
|
|
1963
|
+
function Kt(e, t, n, r, i) {
|
|
1964
|
+
return s(n) ? (a(e, n.ui_steps, r), null) : n.entity ? `${n.entity}.${t}` : i ? `${i}.${t}` : t;
|
|
1965
1965
|
}
|
|
1966
1966
|
//#endregion
|
|
1967
1967
|
export { Z as C, oe as S, be as _, Ut as a, le as b, Ct as c, Re as d, ze as f, xe as g, Be as h, Bt as i, at as l, Ve as m, Ht as n, Vt as o, He as p, Gt as r, jt as s, Kt as t, Le as u, ye as v, ae as x, Q as y };
|