@declarion/react 0.47.0 → 0.48.1
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/{DraggableChildrenTable-B6KjWkwD.js → DraggableChildrenTable-p2ZSdwzj.js} +1 -1
- package/dist-lib/{Grid-OdquWJNX.js → Grid-CjLFAKMZ.js} +2 -2
- package/dist-lib/{LayoutRenderer-CzAdhjNT.js → LayoutRenderer-DCscqXsv.js} +124 -118
- package/dist-lib/{MarkdownRenderer-C6bhrAIe.js → MarkdownRenderer-Sb7zcvj0.js} +1 -1
- package/dist-lib/{RefreshControl-F9Ib9asP.js → RefreshControl-Cnl9nE0x.js} +255 -225
- package/dist-lib/{SmartDetailPage.impl-DdSu3kmW.js → SmartDetailPage.impl-BAW-Tx_H.js} +465 -463
- package/dist-lib/{SmartRecordListPage.impl-SkIp0_Rd.js → SmartRecordListPage.impl-DtSSlGrI.js} +141 -139
- package/dist-lib/api/agents.d.ts +8 -11
- package/dist-lib/components/agents/AgentChatPanel.d.ts +1 -0
- package/dist-lib/components/agents/AgentPicker.d.ts +9 -0
- package/dist-lib/components/primitives/Tooltip.d.ts +4 -0
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +24 -5
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +5 -7
- package/dist-lib/hooks/useBrandingChrome.d.ts +11 -0
- package/dist-lib/hooks/useLongPress.d.ts +29 -0
- package/dist-lib/hooks/useResponsiveMode.d.ts +2 -21
- package/dist-lib/index.d.ts +2 -2
- package/dist-lib/index.js +2351 -2144
- package/dist-lib/lib/actions.d.ts +12 -4
- package/dist-lib/lib/longPressGesture.d.ts +55 -0
- package/dist-lib/lib/page-inset.d.ts +3 -0
- package/dist-lib/lib/viewport-category.d.ts +44 -0
- package/dist-lib/{registry-C2VD-5MD.js → registry-CCxnZW2b.js} +1021 -955
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/api.d.ts +15 -2
- package/dist-lib/{useCurrentScreen-ow4r-nWa.js → useCurrentScreen-BshVTPVq.js} +979 -971
- package/dist-lib/{useProperties-lEKfzm2X.js → useProperties-DrHFr0A1.js} +2 -2
- package/dist-lib/{value-CXohNH6a.js → value-B1O6QikE.js} +1 -1
- package/package.json +1 -1
- package/dist-lib/components/agents/AgentVisualHints.d.ts +0 -6
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
|
-
import { A as n, At as r, B as i, C as a, Dn as o, E as s, Gt as c, I as l, K as u, Kn as d, L as f, Ln as p, Nn as m, O as h, P as g, Qn as _, R as v, Rn as y, Sn as b, St as x, T as S, Tn as C, Tt as w, U as T, V as E, W as D, X as O, Yn as k, Zn as A, _ as j, _t as M, b as N, bn as P, bt as F, cr as I, d as L, g as
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as
|
|
5
|
-
import { Component as Ne, Suspense as Pe, lazy as Fe, useCallback as
|
|
2
|
+
import { A as n, At as r, B as i, C as a, Dn as o, E as s, Gt as c, I as l, K as u, Kn as d, L as f, Ln as p, Nn as m, O as h, P as g, Qn as _, R as v, Rn as y, Sn as b, St as x, T as S, Tn as C, Tt as w, U as T, V as E, W as D, X as O, Yn as k, Zn as A, _ as j, _t as M, b as N, bn as P, bt as F, cr as I, d as L, g as R, gt as z, i as ee, j as B, jn as te, kt as ne, lr as V, mn as re, or as H, ot as ie, pt as ae, rt as U, st as oe, tr as se, u as ce, ur as W, v as le, vt as ue, wn as de, wt as fe, xn as pe, yt as me, z as he } from "./useCurrentScreen-BshVTPVq.js";
|
|
3
|
+
import { a as ge, c as _e, d as ve, f as ye, i as be, l as xe, n as Se, o as Ce, p as we, r as Te, s as Ee, t as De, u as Oe } from "./value-B1O6QikE.js";
|
|
4
|
+
import { n as ke, r as Ae, t as je } from "./dataTableStyles-vwD1mVOP.js";
|
|
5
|
+
import { Component as Me, Fragment as Ne, Suspense as Pe, lazy as Fe, useCallback as G, useEffect as K, useId as Ie, useLayoutEffect as Le, useMemo as q, useRef as J, useState as Y } from "react";
|
|
6
6
|
import { parsePath as Re, useNavigate as ze } from "react-router";
|
|
7
7
|
import { useInfiniteQuery as Be, useMutation as Ve, useQuery as He, useQueryClient as Ue } from "@tanstack/react-query";
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { create as
|
|
10
|
-
import { clsx as
|
|
11
|
-
import { twMerge as
|
|
8
|
+
import { Fragment as We, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
9
|
+
import { create as Ge } from "zustand";
|
|
10
|
+
import { clsx as Ke } from "clsx";
|
|
11
|
+
import { twMerge as qe } from "tailwind-merge";
|
|
12
12
|
//#region src/components/primitives/SectionCard.tsx
|
|
13
|
-
var
|
|
13
|
+
var Je = {
|
|
14
14
|
primary: {
|
|
15
15
|
surface: "var(--surface)",
|
|
16
16
|
shadow: "var(--shadow-xs)"
|
|
@@ -20,8 +20,8 @@ var qe = {
|
|
|
20
20
|
shadow: "none"
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
function
|
|
24
|
-
let [m, h] =
|
|
23
|
+
function Ye({ title: t, subtitle: n, right: r, badge: i, count: a, children: o, footer: s, collapsible: c = !0, defaultOpen: l = !0, icon: u, emphasis: d = "primary", headingLevel: f = 2, padding: p = "16px" }) {
|
|
24
|
+
let [m, h] = Y(l), g = Je[d] ?? Je.primary;
|
|
25
25
|
return /* @__PURE__ */ Z("div", {
|
|
26
26
|
"data-emphasis": d,
|
|
27
27
|
style: {
|
|
@@ -126,7 +126,7 @@ function Je({ title: t, subtitle: n, right: r, badge: i, count: a, children: o,
|
|
|
126
126
|
children: i.text
|
|
127
127
|
}),
|
|
128
128
|
r,
|
|
129
|
-
c && /* @__PURE__ */ X(
|
|
129
|
+
c && /* @__PURE__ */ X(V, {
|
|
130
130
|
size: 24,
|
|
131
131
|
icon: X(m ? e.up : e.down, { size: 14 }),
|
|
132
132
|
onClick: () => h((e) => !e),
|
|
@@ -153,7 +153,7 @@ function Je({ title: t, subtitle: n, right: r, badge: i, count: a, children: o,
|
|
|
153
153
|
}
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region src/components/primitives/ClassifiedFieldLocked.tsx
|
|
156
|
-
function
|
|
156
|
+
function Xe({ tier: t, tierDef: n, requiredPermission: r, locale: i = "en", variant: a = "value" }) {
|
|
157
157
|
let o = n?.name?.[i] ?? n?.name?.en ?? t, s = r ? `Locked: requires permission "${r}". Ask your administrator to grant it to your role.` : `Locked: ${o} classification — requires explicit grant.`;
|
|
158
158
|
return /* @__PURE__ */ Z("span", {
|
|
159
159
|
title: s,
|
|
@@ -164,7 +164,7 @@ function Ye({ tier: t, tierDef: n, requiredPermission: r, locale: i = "en", vari
|
|
|
164
164
|
}
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region src/stores/preferences.ts
|
|
167
|
-
var
|
|
167
|
+
var Ze = {
|
|
168
168
|
colorScheme: "light",
|
|
169
169
|
accent: "violet",
|
|
170
170
|
density: "compact",
|
|
@@ -176,22 +176,22 @@ var Xe = {
|
|
|
176
176
|
zebra: !0,
|
|
177
177
|
aiSurface: "both",
|
|
178
178
|
toastPosition: "bottom-right"
|
|
179
|
-
},
|
|
179
|
+
}, Qe = ["light", "dark"], $e = [
|
|
180
180
|
"violet",
|
|
181
181
|
"blue",
|
|
182
182
|
"teal",
|
|
183
183
|
"amber",
|
|
184
184
|
"rose"
|
|
185
|
-
],
|
|
185
|
+
], et = [
|
|
186
186
|
"compact",
|
|
187
187
|
"comfortable",
|
|
188
188
|
"cozy"
|
|
189
|
-
],
|
|
189
|
+
], tt = ["wide", "collapsed"], nt = ["top", "bottom"], rt = [
|
|
190
190
|
"command",
|
|
191
191
|
"panel",
|
|
192
192
|
"both",
|
|
193
193
|
"off"
|
|
194
|
-
],
|
|
194
|
+
], it = [
|
|
195
195
|
"top-left",
|
|
196
196
|
"top-center",
|
|
197
197
|
"top-right",
|
|
@@ -199,37 +199,37 @@ var Xe = {
|
|
|
199
199
|
"bottom-center",
|
|
200
200
|
"bottom-right"
|
|
201
201
|
];
|
|
202
|
-
function
|
|
202
|
+
function at(e, t) {
|
|
203
203
|
return typeof t == "string" && e.includes(t) ? t : void 0;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
let t = {}, n =
|
|
205
|
+
function ot(e) {
|
|
206
|
+
let t = {}, n = at(Qe, e.colorScheme);
|
|
207
207
|
n && (t.colorScheme = n);
|
|
208
|
-
let r =
|
|
208
|
+
let r = at($e, e.accent);
|
|
209
209
|
r && (t.accent = r);
|
|
210
|
-
let i =
|
|
210
|
+
let i = at(et, e.density);
|
|
211
211
|
i && (t.density = i);
|
|
212
|
-
let a =
|
|
212
|
+
let a = at(tt, e.sidebar);
|
|
213
213
|
a && (t.sidebar = a);
|
|
214
|
-
let o =
|
|
214
|
+
let o = at(nt, e.tabsPosition);
|
|
215
215
|
o && (t.tabsPosition = o);
|
|
216
|
-
let s =
|
|
216
|
+
let s = at(rt, e.aiSurface);
|
|
217
217
|
s && (t.aiSurface = s);
|
|
218
|
-
let c = it
|
|
218
|
+
let c = at(it, e.toastPosition);
|
|
219
219
|
return c && (t.toastPosition = c), typeof e.tabsMaxOpen == "number" && e.tabsMaxOpen > 0 && (t.tabsMaxOpen = e.tabsMaxOpen), typeof e.radius == "number" && e.radius >= 0 && e.radius <= 32 && (t.radius = e.radius), typeof e.zebra == "boolean" && (t.zebra = e.zebra), typeof e.tabsPersist == "boolean" && (t.tabsPersist = e.tabsPersist), t;
|
|
220
220
|
}
|
|
221
|
-
var
|
|
222
|
-
function
|
|
221
|
+
var st = ["declarion-preferences", "declarion-appearance"];
|
|
222
|
+
function ct() {
|
|
223
223
|
if (!(typeof window > "u")) try {
|
|
224
|
-
for (let e of
|
|
224
|
+
for (let e of st) localStorage.removeItem(e);
|
|
225
225
|
} catch {}
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function lt(e) {
|
|
228
228
|
if (typeof document > "u") return;
|
|
229
229
|
let t = document.documentElement;
|
|
230
230
|
t.dataset.colorScheme = e.colorScheme, t.dataset.accent = e.accent, t.dataset.density = e.density, t.dataset.sidebar = e.sidebar, t.dataset.tabbar = e.tabsPosition, t.dataset.zebra = e.zebra ? "on" : "off", t.dataset.ai = e.aiSurface, t.style.setProperty("--radius-md", `${e.radius}px`), t.style.setProperty("--radius-lg", `${e.radius + 3}px`);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function ut(e) {
|
|
233
233
|
return {
|
|
234
234
|
colorScheme: e.color_scheme,
|
|
235
235
|
accent: e.accent,
|
|
@@ -244,70 +244,70 @@ function lt(e) {
|
|
|
244
244
|
toastPosition: e.toast_position
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
|
|
248
|
-
var
|
|
249
|
-
typeof window < "u" &&
|
|
250
|
-
var
|
|
251
|
-
...
|
|
247
|
+
ct();
|
|
248
|
+
var dt = /* @__PURE__ */ new Set(), ft = { ...Ze };
|
|
249
|
+
typeof window < "u" && lt(ft);
|
|
250
|
+
var pt = Ge((e, t) => ({
|
|
251
|
+
...ft,
|
|
252
252
|
set: (n, r) => {
|
|
253
|
-
let i =
|
|
254
|
-
i[n] !== void 0 && (
|
|
253
|
+
let i = ot({ [n]: r });
|
|
254
|
+
i[n] !== void 0 && (lt({
|
|
255
255
|
...t(),
|
|
256
256
|
...i
|
|
257
|
-
}),
|
|
257
|
+
}), dt.add(n), e(i));
|
|
258
258
|
},
|
|
259
259
|
setMany: (n) => {
|
|
260
|
-
let r =
|
|
260
|
+
let r = ot(n);
|
|
261
261
|
if (Object.keys(r).length) {
|
|
262
|
-
|
|
262
|
+
lt({
|
|
263
263
|
...t(),
|
|
264
264
|
...r
|
|
265
265
|
});
|
|
266
|
-
for (let e of Object.keys(r))
|
|
266
|
+
for (let e of Object.keys(r)) dt.add(e);
|
|
267
267
|
e(r);
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
270
|
hydrateFromBranding: (t) => {
|
|
271
271
|
if (!t) return;
|
|
272
|
-
let n =
|
|
273
|
-
for (let [e, t] of Object.entries(n))
|
|
274
|
-
let i =
|
|
275
|
-
Object.keys(i).length && (
|
|
276
|
-
...
|
|
272
|
+
let n = ut(t), r = {};
|
|
273
|
+
for (let [e, t] of Object.entries(n)) dt.has(e) || t !== void 0 && (r[e] = t);
|
|
274
|
+
let i = ot(r);
|
|
275
|
+
Object.keys(i).length && (lt({
|
|
276
|
+
...pt.getState(),
|
|
277
277
|
...i
|
|
278
278
|
}), e(i));
|
|
279
279
|
},
|
|
280
280
|
resetToDefaults: (t) => {
|
|
281
|
-
|
|
282
|
-
let n = t ?
|
|
283
|
-
...
|
|
281
|
+
dt.clear(), ct();
|
|
282
|
+
let n = t ? ot(ut(t)) : {}, r = {
|
|
283
|
+
...Ze,
|
|
284
284
|
...n
|
|
285
285
|
};
|
|
286
|
-
|
|
286
|
+
lt(r), e(r);
|
|
287
287
|
}
|
|
288
|
-
})),
|
|
289
|
-
function mt(e) {
|
|
290
|
-
return pt.includes(e);
|
|
291
|
-
}
|
|
288
|
+
})), mt = ["/login", "/signup"];
|
|
292
289
|
function ht(e) {
|
|
293
|
-
return
|
|
290
|
+
return mt.includes(e);
|
|
294
291
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
return typeof e == "string" && e.length <= gt;
|
|
292
|
+
function gt(e) {
|
|
293
|
+
return typeof e == "string" && e.startsWith("/") && !e.startsWith("//");
|
|
298
294
|
}
|
|
295
|
+
var _t = 4096;
|
|
299
296
|
function vt(e) {
|
|
297
|
+
return typeof e == "string" && e.length <= _t;
|
|
298
|
+
}
|
|
299
|
+
function yt(e) {
|
|
300
300
|
if (e === null) return null;
|
|
301
301
|
if (e === void 0 || typeof e != "object" || Array.isArray(e)) return;
|
|
302
302
|
let t = e;
|
|
303
|
-
if (!
|
|
303
|
+
if (!gt(t.pathname) || t.pathname.length > _t || t.pathname.includes("?") || t.pathname.includes("#")) return;
|
|
304
304
|
let n = { pathname: t.pathname };
|
|
305
305
|
if (t.search !== void 0) {
|
|
306
|
-
if (!
|
|
306
|
+
if (!vt(t.search) || t.search.startsWith("?")) return;
|
|
307
307
|
t.search && (n.search = t.search);
|
|
308
308
|
}
|
|
309
309
|
if (t.hash !== void 0) {
|
|
310
|
-
if (!
|
|
310
|
+
if (!vt(t.hash) || t.hash && !t.hash.startsWith("#")) return;
|
|
311
311
|
t.hash && (n.hash = t.hash);
|
|
312
312
|
}
|
|
313
313
|
for (let e of [
|
|
@@ -316,29 +316,29 @@ function vt(e) {
|
|
|
316
316
|
"icon",
|
|
317
317
|
"screen"
|
|
318
318
|
]) if (t[e] !== void 0) {
|
|
319
|
-
if (!
|
|
319
|
+
if (!vt(t[e])) return;
|
|
320
320
|
t[e] && (n[e] = t[e]);
|
|
321
321
|
}
|
|
322
322
|
return n;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function bt(e) {
|
|
325
325
|
return e.closable !== !1;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
if (n === "all") return e.filter(
|
|
327
|
+
function xt(e, t, n, r) {
|
|
328
|
+
if (n === "all") return e.filter(bt).map((e) => e.id);
|
|
329
329
|
let i = r ?? t;
|
|
330
330
|
if (!i) return [];
|
|
331
331
|
let a = e.findIndex((e) => e.id === i);
|
|
332
|
-
return a === -1 ? [] : n === "current" ?
|
|
332
|
+
return a === -1 ? [] : n === "current" ? bt(e[a]) ? [e[a].id] : [] : n === "others" ? e.filter((e, t) => t !== a && bt(e)).map((e) => e.id) : e.slice(a + 1).filter(bt).map((e) => e.id);
|
|
333
333
|
}
|
|
334
|
-
var
|
|
335
|
-
function
|
|
334
|
+
var St = null, Ct = null;
|
|
335
|
+
function wt(e, t) {
|
|
336
336
|
return `declarion::${e}::${t}::tabs`;
|
|
337
337
|
}
|
|
338
|
-
function
|
|
339
|
-
return !
|
|
338
|
+
function Tt() {
|
|
339
|
+
return !St || !Ct ? null : wt(St, Ct);
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function Et(e) {
|
|
342
342
|
let t;
|
|
343
343
|
try {
|
|
344
344
|
t = JSON.parse(e);
|
|
@@ -349,7 +349,7 @@ function Tt(e) {
|
|
|
349
349
|
let n = t;
|
|
350
350
|
return Array.isArray(n.tabs) ? {
|
|
351
351
|
tabs: n.tabs.filter((e) => typeof e == "object" && !!e && typeof e.id == "string" && typeof e.pathname == "string").map((e) => {
|
|
352
|
-
let t =
|
|
352
|
+
let t = yt(e.returnTo);
|
|
353
353
|
if (t === void 0) {
|
|
354
354
|
let { returnTo: t, ...n } = e;
|
|
355
355
|
return n;
|
|
@@ -362,22 +362,22 @@ function Tt(e) {
|
|
|
362
362
|
activeTabId: typeof n.activeTabId == "string" ? n.activeTabId : null
|
|
363
363
|
} : null;
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function Dt(e, t) {
|
|
366
366
|
if (typeof window > "u") return null;
|
|
367
|
-
let n = localStorage.getItem(
|
|
367
|
+
let n = localStorage.getItem(wt(e, t));
|
|
368
368
|
if (!n) return null;
|
|
369
|
-
let r =
|
|
369
|
+
let r = Et(n);
|
|
370
370
|
if (!r) return null;
|
|
371
371
|
let i = r.tabs.find((e) => e.id === r.activeTabId), a = i?.pathname;
|
|
372
|
-
if (
|
|
372
|
+
if (gt(a)) {
|
|
373
373
|
let e = typeof i?.search == "string" ? i.search : "", t = e.startsWith("?") ? e.slice(1) : e;
|
|
374
374
|
return t ? `${a}?${t}` : a;
|
|
375
375
|
}
|
|
376
376
|
return null;
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Ot(e, t) {
|
|
379
379
|
if (typeof window > "u") return;
|
|
380
|
-
let n =
|
|
380
|
+
let n = pt.getState().tabsPersist, r = Tt();
|
|
381
381
|
if (r) {
|
|
382
382
|
if (!n) {
|
|
383
383
|
try {
|
|
@@ -393,24 +393,24 @@ function Dt(e, t) {
|
|
|
393
393
|
} catch {}
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
if (typeof window > "u" || !
|
|
398
|
-
let e =
|
|
396
|
+
function kt() {
|
|
397
|
+
if (typeof window > "u" || !pt.getState().tabsPersist) return null;
|
|
398
|
+
let e = Tt();
|
|
399
399
|
if (!e) return null;
|
|
400
400
|
let t = localStorage.getItem(e);
|
|
401
|
-
return t ?
|
|
401
|
+
return t ? Et(t) : null;
|
|
402
402
|
}
|
|
403
|
-
var
|
|
403
|
+
var At = Ge((e, t) => ({
|
|
404
404
|
tabs: [],
|
|
405
405
|
activeTabId: null,
|
|
406
406
|
openTab: (n) => {
|
|
407
|
-
if (
|
|
407
|
+
if (ht(n.pathname)) return "";
|
|
408
408
|
let r = t(), i = r.tabs.find((e) => e.pathname === n.pathname);
|
|
409
|
-
if (i) return e({ activeTabId: i.id }),
|
|
409
|
+
if (i) return e({ activeTabId: i.id }), Ot(r.tabs, i.id), i.id;
|
|
410
410
|
let a = crypto.randomUUID(), o = {
|
|
411
411
|
...n,
|
|
412
412
|
id: a
|
|
413
|
-
}, s = [...r.tabs, o], c =
|
|
413
|
+
}, s = [...r.tabs, o], c = pt.getState().tabsMaxOpen;
|
|
414
414
|
if (c > 0 && s.length > c) {
|
|
415
415
|
let e = s.findIndex((e) => e.id !== a && e.closable !== !1 && !e.dirty);
|
|
416
416
|
e !== -1 && (s = s.filter((t, n) => n !== e));
|
|
@@ -418,7 +418,7 @@ var kt = We((e, t) => ({
|
|
|
418
418
|
return e({
|
|
419
419
|
tabs: s,
|
|
420
420
|
activeTabId: a
|
|
421
|
-
}),
|
|
421
|
+
}), Ot(s, a), a;
|
|
422
422
|
},
|
|
423
423
|
closeTab: (e) => {
|
|
424
424
|
let n = t(), r = n.tabs.findIndex((t) => t.id === e);
|
|
@@ -427,14 +427,14 @@ var kt = We((e, t) => ({
|
|
|
427
427
|
closeTabs: (n) => {
|
|
428
428
|
let r = t(), i = new Set(n);
|
|
429
429
|
if (i.size === 0) return r.tabs.find((e) => e.id === r.activeTabId) ?? null;
|
|
430
|
-
let a = r.tabs.findIndex((e) => e.id === r.activeTabId), o = r.tabs.filter((e) => !(i.has(e.id) &&
|
|
430
|
+
let a = r.tabs.findIndex((e) => e.id === r.activeTabId), o = r.tabs.filter((e) => !(i.has(e.id) && bt(e))), s = r.activeTabId;
|
|
431
431
|
return s && !o.some((e) => e.id === s) ? s = o.length === 0 ? null : o[Math.min(Math.max(a, 0), o.length - 1)].id : o.length === 0 && (s = null), e({
|
|
432
432
|
tabs: o,
|
|
433
433
|
activeTabId: s
|
|
434
|
-
}),
|
|
434
|
+
}), Ot(o, s), o.find((e) => e.id === s) ?? null;
|
|
435
435
|
},
|
|
436
436
|
switchTab: (n) => {
|
|
437
|
-
e({ activeTabId: n }),
|
|
437
|
+
e({ activeTabId: n }), Ot(t().tabs, n);
|
|
438
438
|
},
|
|
439
439
|
reorderTabs: (t, n) => {
|
|
440
440
|
e((e) => {
|
|
@@ -461,7 +461,7 @@ var kt = We((e, t) => ({
|
|
|
461
461
|
e((e) => ({ tabs: e.tabs.map((e) => e.id === n ? {
|
|
462
462
|
...e,
|
|
463
463
|
returnTo: r
|
|
464
|
-
} : e) })),
|
|
464
|
+
} : e) })), Ot(t().tabs, t().activeTabId);
|
|
465
465
|
},
|
|
466
466
|
commitTabNavigation: (n, r) => {
|
|
467
467
|
let i = "returnTo" in r;
|
|
@@ -472,37 +472,37 @@ var kt = We((e, t) => ({
|
|
|
472
472
|
...i ? { returnTo: r.returnTo } : {}
|
|
473
473
|
} : e),
|
|
474
474
|
activeTabId: n
|
|
475
|
-
})),
|
|
475
|
+
})), Ot(t().tabs, t().activeTabId);
|
|
476
476
|
},
|
|
477
477
|
setDirty: (n, r) => {
|
|
478
478
|
e((e) => ({ tabs: e.tabs.map((e) => e.id === n ? {
|
|
479
479
|
...e,
|
|
480
480
|
dirty: r
|
|
481
|
-
} : e) })),
|
|
481
|
+
} : e) })), Ot(t().tabs, t().activeTabId);
|
|
482
482
|
},
|
|
483
483
|
setMode: (n, r) => {
|
|
484
484
|
e((e) => ({ tabs: e.tabs.map((e) => e.id === n ? {
|
|
485
485
|
...e,
|
|
486
486
|
mode: r
|
|
487
|
-
} : e) })),
|
|
487
|
+
} : e) })), Ot(t().tabs, t().activeTabId);
|
|
488
488
|
},
|
|
489
489
|
updateTab: (n, r) => {
|
|
490
490
|
e((e) => ({ tabs: e.tabs.map((e) => e.id === n ? {
|
|
491
491
|
...e,
|
|
492
492
|
...r
|
|
493
|
-
} : e) })),
|
|
493
|
+
} : e) })), Ot(t().tabs, t().activeTabId);
|
|
494
494
|
},
|
|
495
495
|
setScope: (e, t) => {
|
|
496
|
-
|
|
496
|
+
St = e, Ct = t;
|
|
497
497
|
},
|
|
498
498
|
hydrate: () => {
|
|
499
|
-
let t =
|
|
499
|
+
let t = kt();
|
|
500
500
|
t && e({
|
|
501
501
|
tabs: t.tabs,
|
|
502
502
|
activeTabId: t.activeTabId
|
|
503
503
|
});
|
|
504
504
|
}
|
|
505
|
-
})),
|
|
505
|
+
})), jt = Ge((e) => ({
|
|
506
506
|
depth: 0,
|
|
507
507
|
nextIsRoot: !1,
|
|
508
508
|
applyNavigation: (t) => e((e) => e.nextIsRoot ? {
|
|
@@ -517,33 +517,33 @@ var kt = We((e, t) => ({
|
|
|
517
517
|
}));
|
|
518
518
|
//#endregion
|
|
519
519
|
//#region src/lib/utils.ts
|
|
520
|
-
function
|
|
521
|
-
return Ke(
|
|
520
|
+
function Mt(...e) {
|
|
521
|
+
return qe(Ke(e));
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function Nt(e) {
|
|
524
524
|
return e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0;
|
|
525
525
|
}
|
|
526
526
|
//#endregion
|
|
527
527
|
//#region src/lib/screen-back.ts
|
|
528
|
-
function
|
|
528
|
+
function Pt(e) {
|
|
529
529
|
return e ? e.startsWith("?") ? e.slice(1) : e : "";
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function Ft(e) {
|
|
532
532
|
if (e) return e.startsWith("?") ? e : `?${e}`;
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
if (!
|
|
536
|
-
let r =
|
|
534
|
+
function It(e, t, n) {
|
|
535
|
+
if (!gt(e.pathname) || ht(e.pathname) || e.pathname === t) return;
|
|
536
|
+
let r = Pt(e.search), i = { pathname: e.pathname };
|
|
537
537
|
return r && (i.search = r), e.hash && (i.hash = e.hash), n?.id && (i.tabId = n.id), n?.title && (i.title = n.title), n?.icon && (i.icon = n.icon), n?.screen && (i.screen = n.screen), i;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Lt(e, t) {
|
|
540
540
|
return t ? {
|
|
541
541
|
hasOriginBack: !1,
|
|
542
542
|
allowFallbackBack: !0
|
|
543
543
|
} : e === null ? {
|
|
544
544
|
hasOriginBack: !1,
|
|
545
545
|
allowFallbackBack: !1
|
|
546
|
-
} : e &&
|
|
546
|
+
} : e && gt(e.pathname) ? {
|
|
547
547
|
hasOriginBack: !0,
|
|
548
548
|
allowFallbackBack: !0
|
|
549
549
|
} : {
|
|
@@ -551,8 +551,8 @@ function It(e, t) {
|
|
|
551
551
|
allowFallbackBack: !0
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
|
-
function
|
|
555
|
-
if (n || !e || !
|
|
554
|
+
function Rt(e, t, n) {
|
|
555
|
+
if (n || !e || !gt(e.pathname)) return null;
|
|
556
556
|
let r = (e.tabId ? t.find((t) => t.id === e.tabId) : void 0) ?? t.find((t) => t.pathname === e.pathname);
|
|
557
557
|
return {
|
|
558
558
|
kind: r ? "live" : "reopen",
|
|
@@ -567,26 +567,26 @@ function Lt(e, t, n) {
|
|
|
567
567
|
}
|
|
568
568
|
//#endregion
|
|
569
569
|
//#region src/hooks/useTabNavigate.ts
|
|
570
|
-
function
|
|
570
|
+
function zt(e, t) {
|
|
571
571
|
let n = Re(e);
|
|
572
572
|
return {
|
|
573
573
|
pathname: n.pathname ?? e,
|
|
574
|
-
search:
|
|
574
|
+
search: Bt(n.search) ?? Bt(t),
|
|
575
575
|
hash: n.hash
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Bt(e) {
|
|
579
579
|
if (!(!e || e === "?")) return e.startsWith("?") ? e : `?${e}`;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
let e = ze(), { data: t } = r(), n =
|
|
583
|
-
return
|
|
584
|
-
let { pathname: o, search: s, hash: c } =
|
|
581
|
+
function Vt() {
|
|
582
|
+
let e = ze(), { data: t } = r(), n = ae(), i = oe();
|
|
583
|
+
return G((r, a) => {
|
|
584
|
+
let { pathname: o, search: s, hash: c } = zt(r, a?.search);
|
|
585
585
|
if (n.enabled) {
|
|
586
586
|
i(`${o}${s ?? ""}${c ?? ""}`, { replace: a?.replace });
|
|
587
587
|
return;
|
|
588
588
|
}
|
|
589
|
-
let l =
|
|
589
|
+
let l = At.getState(), u = a?.topLevel ?? !1, d = Pt(s), f = u || typeof window > "u" ? void 0 : It({
|
|
590
590
|
pathname: window.location.pathname,
|
|
591
591
|
search: window.location.search,
|
|
592
592
|
hash: window.location.hash
|
|
@@ -636,49 +636,57 @@ function Bt() {
|
|
|
636
636
|
]);
|
|
637
637
|
}
|
|
638
638
|
//#endregion
|
|
639
|
+
//#region src/lib/page-inset.ts
|
|
640
|
+
function Ht(e) {
|
|
641
|
+
return {
|
|
642
|
+
paddingLeft: `calc(${e}px + var(--safe-area-left))`,
|
|
643
|
+
paddingRight: `calc(${e}px + var(--safe-area-right))`
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
//#endregion
|
|
639
647
|
//#region src/components/file-widgets/registry.ts
|
|
640
|
-
var
|
|
641
|
-
function
|
|
642
|
-
|
|
648
|
+
var Ut = /* @__PURE__ */ new Map();
|
|
649
|
+
function Wt(e, t) {
|
|
650
|
+
Ut.set(e, t);
|
|
643
651
|
}
|
|
644
|
-
function
|
|
645
|
-
return
|
|
652
|
+
function Gt(e) {
|
|
653
|
+
return Ut.get(e);
|
|
646
654
|
}
|
|
647
|
-
function
|
|
648
|
-
return
|
|
655
|
+
function Kt(e) {
|
|
656
|
+
return Ut.has(e);
|
|
649
657
|
}
|
|
650
658
|
//#endregion
|
|
651
659
|
//#region src/components/file-widgets/cropper.ts
|
|
652
|
-
var
|
|
660
|
+
var qt = ({ file: e }) => Promise.resolve({
|
|
653
661
|
blob: e,
|
|
654
662
|
filename: e.name
|
|
655
|
-
}),
|
|
656
|
-
function
|
|
657
|
-
|
|
663
|
+
}), Jt = qt;
|
|
664
|
+
function Yt(e) {
|
|
665
|
+
Jt = e ?? qt;
|
|
658
666
|
}
|
|
659
|
-
function
|
|
660
|
-
return
|
|
667
|
+
function Xt() {
|
|
668
|
+
return Jt;
|
|
661
669
|
}
|
|
662
670
|
//#endregion
|
|
663
671
|
//#region src/components/file-widgets/ImageWidget.tsx
|
|
664
|
-
function
|
|
665
|
-
return
|
|
672
|
+
function Zt(e, t) {
|
|
673
|
+
return _e(e, t);
|
|
666
674
|
}
|
|
667
|
-
function
|
|
675
|
+
function Qt(e) {
|
|
668
676
|
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
669
677
|
return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
|
|
670
678
|
}
|
|
671
|
-
function
|
|
672
|
-
let { field: t, fieldName: n, value: r, onChange: a, mode: o, alt: s, disabled: c, visual: u, uploadFieldCode: d, uploadSlotCode: p } = e, m =
|
|
673
|
-
|
|
679
|
+
function $t(e) {
|
|
680
|
+
let { field: t, fieldName: n, value: r, onChange: a, mode: o, alt: s, disabled: c, visual: u, uploadFieldCode: d, uploadSlotCode: p } = e, m = Se(r), [h, _] = Y("idle"), [v, y] = Y(null), [b, x] = Y(null), [S, C] = Y(null), [w, T] = Y(!1), E = J(null), D = J(!1), O = J(null), { register: k, unregister: A, isDraft: j } = g();
|
|
681
|
+
K(() => () => {
|
|
674
682
|
E.current && E.current.abort();
|
|
675
683
|
}, []);
|
|
676
|
-
let M =
|
|
684
|
+
let M = q(() => ye(m, s, t.display?.placeholder || n), [
|
|
677
685
|
s,
|
|
678
686
|
t.display?.placeholder,
|
|
679
687
|
n,
|
|
680
688
|
m
|
|
681
|
-
]), N = (t.accepts ?? ["image/*"]).join(","), P =
|
|
689
|
+
]), N = (t.accepts ?? ["image/*"]).join(","), P = G(async (r) => {
|
|
682
690
|
let o = i(r, t.accepts, t.max_size_bytes);
|
|
683
691
|
if (o) {
|
|
684
692
|
x(o), _("error");
|
|
@@ -686,9 +694,9 @@ function Zt(e) {
|
|
|
686
694
|
}
|
|
687
695
|
let s = r;
|
|
688
696
|
if (t.display?.crop_on_upload) try {
|
|
689
|
-
let { blob: e, filename: n } = await
|
|
697
|
+
let { blob: e, filename: n } = await Xt()({
|
|
690
698
|
file: r,
|
|
691
|
-
aspectRatio:
|
|
699
|
+
aspectRatio: rn(t.display.aspect_ratio)
|
|
692
700
|
});
|
|
693
701
|
s = new File([e], n, { type: e.type || r.type });
|
|
694
702
|
} catch (e) {
|
|
@@ -706,7 +714,7 @@ function Zt(e) {
|
|
|
706
714
|
let c = new AbortController();
|
|
707
715
|
E.current = c;
|
|
708
716
|
try {
|
|
709
|
-
let r = await
|
|
717
|
+
let r = await he({
|
|
710
718
|
file: s,
|
|
711
719
|
entityCode: e.entityCode,
|
|
712
720
|
fieldCode: d ?? n,
|
|
@@ -757,13 +765,13 @@ function Zt(e) {
|
|
|
757
765
|
A,
|
|
758
766
|
d,
|
|
759
767
|
p
|
|
760
|
-
]), F =
|
|
768
|
+
]), F = G(() => {
|
|
761
769
|
h === "uploading" && E.current && (D.current = !0, E.current.abort(), E.current = null, _("idle"), y(null)), S && (f(S).catch(() => {}), A(S), C(null));
|
|
762
770
|
}, [
|
|
763
771
|
h,
|
|
764
772
|
S,
|
|
765
773
|
A
|
|
766
|
-
]), I =
|
|
774
|
+
]), I = G(() => {
|
|
767
775
|
m && j(m.id) && (f(m.id).catch(() => {}), A(m.id), C(null)), a?.(t.mode === "array" ? [] : null);
|
|
768
776
|
}, [
|
|
769
777
|
m,
|
|
@@ -771,30 +779,30 @@ function Zt(e) {
|
|
|
771
779
|
j,
|
|
772
780
|
a,
|
|
773
781
|
A
|
|
774
|
-
]), L =
|
|
782
|
+
]), L = G(() => {
|
|
775
783
|
x(null), _("idle"), O.current?.click();
|
|
776
|
-
}, []),
|
|
784
|
+
}, []), R = G(() => {
|
|
777
785
|
c || O.current?.click();
|
|
778
|
-
}, [c]),
|
|
779
|
-
c || (e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
780
|
-
}, [c,
|
|
786
|
+
}, [c]), z = G((e) => {
|
|
787
|
+
c || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), R());
|
|
788
|
+
}, [c, R]), ee = G((e) => {
|
|
781
789
|
c || (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
782
|
-
}, [c]),
|
|
790
|
+
}, [c]), B = G((e) => {
|
|
783
791
|
if (c) return;
|
|
784
792
|
e.preventDefault();
|
|
785
793
|
let t = e.dataTransfer.files?.[0];
|
|
786
794
|
t && P(t);
|
|
787
|
-
}, [c, P]),
|
|
795
|
+
}, [c, P]), te = G((e) => {
|
|
788
796
|
let t = e.target.files?.[0];
|
|
789
797
|
e.target.value = "", t && P(t);
|
|
790
|
-
}, [P]),
|
|
791
|
-
aspectRatio:
|
|
798
|
+
}, [P]), ne = u.aspectRatio ?? nn(u.shape, t.display?.aspect_ratio), V = ve(m), re = {
|
|
799
|
+
aspectRatio: ne,
|
|
792
800
|
width: u.width ?? (u.shape === "wide" ? "100%" : "120px")
|
|
793
|
-
},
|
|
801
|
+
}, H = !!m, ie = Zt(m, t.display?.listable_thumbnail), ae = xe(m, t.display?.listable_thumbnail), U = be(m?.id, ae, ie), oe = o === "display", se = G((e) => {
|
|
794
802
|
e.stopPropagation(), T((e) => !e);
|
|
795
|
-
}, []),
|
|
803
|
+
}, []), ce = G((e) => {
|
|
796
804
|
if (!m || !w) return;
|
|
797
|
-
let n = e.currentTarget.getBoundingClientRect(), r = n.width > 0 ? (e.clientX - n.left) / n.width : .5, i = n.height > 0 ? (e.clientY - n.top) / n.height : .5, o =
|
|
805
|
+
let n = e.currentTarget.getBoundingClientRect(), r = n.width > 0 ? (e.clientX - n.left) / n.width : .5, i = n.height > 0 ? (e.clientY - n.top) / n.height : .5, o = we(m, {
|
|
798
806
|
x: Math.max(0, Math.min(1, r)),
|
|
799
807
|
y: Math.max(0, Math.min(1, i))
|
|
800
808
|
});
|
|
@@ -805,69 +813,69 @@ function Zt(e) {
|
|
|
805
813
|
w,
|
|
806
814
|
a
|
|
807
815
|
]);
|
|
808
|
-
return
|
|
809
|
-
className:
|
|
810
|
-
style:
|
|
816
|
+
return oe ? /* @__PURE__ */ X("div", {
|
|
817
|
+
className: en(u.shape, !1),
|
|
818
|
+
style: re,
|
|
811
819
|
"aria-label": M,
|
|
812
|
-
children:
|
|
813
|
-
src:
|
|
820
|
+
children: H && U ? /* @__PURE__ */ X("img", {
|
|
821
|
+
src: U,
|
|
814
822
|
alt: M,
|
|
815
|
-
className:
|
|
816
|
-
style: { objectPosition:
|
|
823
|
+
className: tn(u.shape),
|
|
824
|
+
style: { objectPosition: Ee(V) },
|
|
817
825
|
loading: "lazy"
|
|
818
|
-
}) : /* @__PURE__ */ X(
|
|
826
|
+
}) : /* @__PURE__ */ X(an, {
|
|
819
827
|
shape: u.shape,
|
|
820
828
|
label: M,
|
|
821
829
|
placeholder: t.display?.placeholder
|
|
822
830
|
})
|
|
823
831
|
}) : /* @__PURE__ */ Z("div", {
|
|
824
|
-
className:
|
|
825
|
-
style:
|
|
832
|
+
className: en(u.shape, !c),
|
|
833
|
+
style: re,
|
|
826
834
|
tabIndex: c ? -1 : 0,
|
|
827
835
|
role: "button",
|
|
828
836
|
"aria-label": M,
|
|
829
837
|
"aria-disabled": c || void 0,
|
|
830
838
|
"aria-busy": h === "uploading" || void 0,
|
|
831
839
|
"aria-invalid": h === "error" || void 0,
|
|
832
|
-
onClick: h === "idle" && !
|
|
833
|
-
onMouseDown: w ?
|
|
834
|
-
onKeyDown:
|
|
835
|
-
onDragOver:
|
|
836
|
-
onDrop:
|
|
840
|
+
onClick: h === "idle" && !H ? R : void 0,
|
|
841
|
+
onMouseDown: w ? ce : void 0,
|
|
842
|
+
onKeyDown: z,
|
|
843
|
+
onDragOver: ee,
|
|
844
|
+
onDrop: B,
|
|
837
845
|
"data-testid": w ? "focal-point-target" : `file-widget-${n}`,
|
|
838
846
|
children: [
|
|
839
847
|
/* @__PURE__ */ X("input", {
|
|
840
848
|
ref: O,
|
|
841
849
|
type: "file",
|
|
842
850
|
accept: N,
|
|
843
|
-
onChange:
|
|
851
|
+
onChange: te,
|
|
844
852
|
style: { display: "none" },
|
|
845
853
|
"data-testid": `file-input-${n}`
|
|
846
854
|
}),
|
|
847
|
-
|
|
848
|
-
src:
|
|
855
|
+
H && U ? /* @__PURE__ */ X("img", {
|
|
856
|
+
src: U,
|
|
849
857
|
alt: M,
|
|
850
|
-
className:
|
|
851
|
-
style: { objectPosition:
|
|
858
|
+
className: tn(u.shape),
|
|
859
|
+
style: { objectPosition: Ee(V) },
|
|
852
860
|
loading: "lazy"
|
|
853
|
-
}) : h === "uploading" ? null : /* @__PURE__ */ X(
|
|
861
|
+
}) : h === "uploading" ? null : /* @__PURE__ */ X(an, {
|
|
854
862
|
shape: u.shape,
|
|
855
863
|
label: M,
|
|
856
864
|
placeholder: t.display?.placeholder
|
|
857
865
|
}),
|
|
858
|
-
h === "uploading" && /* @__PURE__ */ X(
|
|
866
|
+
h === "uploading" && /* @__PURE__ */ X(on, { pct: v?.pct ?? 0 }),
|
|
859
867
|
S && /* @__PURE__ */ X("span", {
|
|
860
868
|
className: "absolute right-1 top-1 h-2 w-2 rounded-full bg-warning",
|
|
861
869
|
"aria-hidden": "true",
|
|
862
870
|
"data-testid": "draft-indicator"
|
|
863
871
|
}),
|
|
864
|
-
|
|
872
|
+
H && h === "idle" && !c && /* @__PURE__ */ Z("div", {
|
|
865
873
|
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",
|
|
866
874
|
children: [
|
|
867
875
|
t.display?.focal_point && /* @__PURE__ */ X("button", {
|
|
868
876
|
type: "button",
|
|
869
877
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
870
|
-
onClick:
|
|
878
|
+
onClick: se,
|
|
871
879
|
"data-testid": "focal-point-toggle",
|
|
872
880
|
children: w ? "Cancel focus" : "Set focus"
|
|
873
881
|
}),
|
|
@@ -875,7 +883,7 @@ function Zt(e) {
|
|
|
875
883
|
type: "button",
|
|
876
884
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
877
885
|
onClick: (e) => {
|
|
878
|
-
e.stopPropagation(),
|
|
886
|
+
e.stopPropagation(), R();
|
|
879
887
|
},
|
|
880
888
|
children: "Change"
|
|
881
889
|
}),
|
|
@@ -889,11 +897,11 @@ function Zt(e) {
|
|
|
889
897
|
})
|
|
890
898
|
]
|
|
891
899
|
}),
|
|
892
|
-
|
|
900
|
+
V && H && /* @__PURE__ */ X("span", {
|
|
893
901
|
className: "absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border border-white bg-black/70",
|
|
894
902
|
style: {
|
|
895
|
-
left: `${
|
|
896
|
-
top: `${
|
|
903
|
+
left: `${V.x * 100}%`,
|
|
904
|
+
top: `${V.y * 100}%`
|
|
897
905
|
},
|
|
898
906
|
"data-testid": "focal-point-marker"
|
|
899
907
|
}),
|
|
@@ -926,32 +934,32 @@ function Zt(e) {
|
|
|
926
934
|
]
|
|
927
935
|
});
|
|
928
936
|
}
|
|
929
|
-
function
|
|
937
|
+
function en(e, t) {
|
|
930
938
|
return [
|
|
931
939
|
"relative overflow-hidden border border-border bg-surface-2",
|
|
932
940
|
e === "circle" ? "rounded-full" : "rounded-md",
|
|
933
941
|
t ? "cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent" : ""
|
|
934
942
|
].filter(Boolean).join(" ");
|
|
935
943
|
}
|
|
936
|
-
function
|
|
944
|
+
function tn(e) {
|
|
937
945
|
return "h-full w-full object-cover";
|
|
938
946
|
}
|
|
939
|
-
function
|
|
947
|
+
function nn(e, t) {
|
|
940
948
|
return t ? t.replace(":", " / ") : e === "wide" ? "16 / 9" : "1 / 1";
|
|
941
949
|
}
|
|
942
|
-
function
|
|
950
|
+
function rn(e) {
|
|
943
951
|
if (!e) return;
|
|
944
952
|
let t = e.replace(/\s/g, "").match(/^(\d+(?:\.\d+)?)[:/](\d+(?:\.\d+)?)$/);
|
|
945
953
|
if (!t) return;
|
|
946
954
|
let n = Number(t[1]), r = Number(t[2]);
|
|
947
955
|
if (!(!n || !r)) return n / r;
|
|
948
956
|
}
|
|
949
|
-
function
|
|
957
|
+
function an({ shape: e, label: t, placeholder: n }) {
|
|
950
958
|
return n === "initials" ? /* @__PURE__ */ X("div", {
|
|
951
959
|
className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-3",
|
|
952
960
|
children: /* @__PURE__ */ X("span", {
|
|
953
961
|
className: e === "circle" ? "text-lg font-medium" : "text-base font-medium",
|
|
954
|
-
children:
|
|
962
|
+
children: Qt(t)
|
|
955
963
|
})
|
|
956
964
|
}) : /* @__PURE__ */ X("div", {
|
|
957
965
|
className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-4",
|
|
@@ -961,7 +969,7 @@ function nn({ shape: e, label: t, placeholder: n }) {
|
|
|
961
969
|
})
|
|
962
970
|
});
|
|
963
971
|
}
|
|
964
|
-
function
|
|
972
|
+
function on({ pct: e }) {
|
|
965
973
|
let t = 2 * Math.PI * 18, n = t - Math.max(0, Math.min(100, e)) / 100 * t;
|
|
966
974
|
return /* @__PURE__ */ Z("div", {
|
|
967
975
|
className: "absolute inset-0 flex items-center justify-center bg-black/30",
|
|
@@ -1005,57 +1013,57 @@ function rn({ pct: e }) {
|
|
|
1005
1013
|
}
|
|
1006
1014
|
//#endregion
|
|
1007
1015
|
//#region src/components/file-widgets/SquareImage.tsx
|
|
1008
|
-
function
|
|
1009
|
-
return /* @__PURE__ */ X(
|
|
1016
|
+
function sn(e) {
|
|
1017
|
+
return /* @__PURE__ */ X($t, {
|
|
1010
1018
|
...e,
|
|
1011
1019
|
visual: { shape: "square" }
|
|
1012
1020
|
});
|
|
1013
1021
|
}
|
|
1014
1022
|
//#endregion
|
|
1015
1023
|
//#region src/components/file-widgets/CircleImage.tsx
|
|
1016
|
-
function
|
|
1017
|
-
return /* @__PURE__ */ X(
|
|
1024
|
+
function cn(e) {
|
|
1025
|
+
return /* @__PURE__ */ X($t, {
|
|
1018
1026
|
...e,
|
|
1019
1027
|
visual: { shape: "circle" }
|
|
1020
1028
|
});
|
|
1021
1029
|
}
|
|
1022
1030
|
//#endregion
|
|
1023
1031
|
//#region src/components/file-widgets/WideBanner.tsx
|
|
1024
|
-
function
|
|
1025
|
-
return /* @__PURE__ */ X(
|
|
1032
|
+
function ln(e) {
|
|
1033
|
+
return /* @__PURE__ */ X($t, {
|
|
1026
1034
|
...e,
|
|
1027
1035
|
visual: { shape: "wide" }
|
|
1028
1036
|
});
|
|
1029
1037
|
}
|
|
1030
1038
|
//#endregion
|
|
1031
1039
|
//#region src/components/file-widgets/GridLazy.tsx
|
|
1032
|
-
var
|
|
1033
|
-
function
|
|
1040
|
+
var un = Fe(() => import("./Grid-CjLFAKMZ.js").then((e) => ({ default: e.Grid })));
|
|
1041
|
+
function dn() {
|
|
1034
1042
|
return /* @__PURE__ */ X("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
|
|
1035
1043
|
}
|
|
1036
|
-
function
|
|
1044
|
+
function fn(e) {
|
|
1037
1045
|
return /* @__PURE__ */ X(Pe, {
|
|
1038
|
-
fallback: /* @__PURE__ */ X(
|
|
1039
|
-
children: /* @__PURE__ */ X(
|
|
1046
|
+
fallback: /* @__PURE__ */ X(dn, {}),
|
|
1047
|
+
children: /* @__PURE__ */ X(un, { ...e })
|
|
1040
1048
|
});
|
|
1041
1049
|
}
|
|
1042
1050
|
//#endregion
|
|
1043
1051
|
//#region src/components/file-widgets/DocumentCard.tsx
|
|
1044
|
-
function
|
|
1052
|
+
function pn({ contentType: e }) {
|
|
1045
1053
|
let t = e ? e.includes("pdf") ? "PDF" : e.includes("word") ? "DOC" : e.includes("sheet") || e.includes("excel") ? "XLS" : e.startsWith("image/") ? "IMG" : e.split("/")[1]?.slice(0, 4).toUpperCase() ?? "FILE" : "FILE";
|
|
1046
1054
|
return /* @__PURE__ */ X("div", {
|
|
1047
1055
|
className: "flex h-16 w-16 flex-none items-center justify-center rounded-md border border-border bg-surface-3 text-xs font-medium text-muted-foreground",
|
|
1048
1056
|
children: t
|
|
1049
1057
|
});
|
|
1050
1058
|
}
|
|
1051
|
-
function
|
|
1052
|
-
let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s, uploadFieldCode: c, uploadSlotCode: u } = e, d =
|
|
1053
|
-
|
|
1059
|
+
function mn(e) {
|
|
1060
|
+
let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s, uploadFieldCode: c, uploadSlotCode: u } = e, d = Se(r), [p, m] = Y("idle"), [h, _] = Y(null), [y, b] = Y(null), [x, S] = Y(!1), [C, w] = Y(d?.filename ?? ""), T = J(null), E = J(!1), D = J(null), { register: O, unregister: k, isDraft: A } = g(), { open: j } = Te();
|
|
1061
|
+
K(() => () => {
|
|
1054
1062
|
T.current && T.current.abort();
|
|
1055
|
-
}, []),
|
|
1063
|
+
}, []), K(() => {
|
|
1056
1064
|
w(d?.filename ?? "");
|
|
1057
1065
|
}, [d?.filename]);
|
|
1058
|
-
let M = (t.accepts ?? []).join(","), N =
|
|
1066
|
+
let M = (t.accepts ?? []).join(","), N = G(async (r) => {
|
|
1059
1067
|
let o = i(r, t.accepts, t.max_size_bytes);
|
|
1060
1068
|
if (o) {
|
|
1061
1069
|
b(o), m("error");
|
|
@@ -1069,7 +1077,7 @@ function fn(e) {
|
|
|
1069
1077
|
let s = new AbortController();
|
|
1070
1078
|
T.current = s;
|
|
1071
1079
|
try {
|
|
1072
|
-
let i = await
|
|
1080
|
+
let i = await he({
|
|
1073
1081
|
file: r,
|
|
1074
1082
|
entityCode: e.entityCode,
|
|
1075
1083
|
fieldCode: c ?? n,
|
|
@@ -1118,12 +1126,12 @@ function fn(e) {
|
|
|
1118
1126
|
k,
|
|
1119
1127
|
c,
|
|
1120
1128
|
u
|
|
1121
|
-
]), P =
|
|
1129
|
+
]), P = G(() => {
|
|
1122
1130
|
s || D.current?.click();
|
|
1123
|
-
}, [s]), F =
|
|
1131
|
+
}, [s]), F = G((e) => {
|
|
1124
1132
|
let t = e.target.files?.[0];
|
|
1125
1133
|
e.target.value = "", t && N(t);
|
|
1126
|
-
}, [N]), I =
|
|
1134
|
+
}, [N]), I = G(() => {
|
|
1127
1135
|
d && A(d.id) && (f(d.id).catch(() => {}), k(d.id)), a?.(t.mode === "array" ? [] : null);
|
|
1128
1136
|
}, [
|
|
1129
1137
|
d,
|
|
@@ -1131,13 +1139,13 @@ function fn(e) {
|
|
|
1131
1139
|
A,
|
|
1132
1140
|
a,
|
|
1133
1141
|
k
|
|
1134
|
-
]), L =
|
|
1142
|
+
]), L = G(() => {
|
|
1135
1143
|
p === "uploading" && T.current && (E.current = !0, T.current.abort(), T.current = null, m("idle"), _(null));
|
|
1136
|
-
}, [p]),
|
|
1137
|
-
d && j(d.id, "download",
|
|
1138
|
-
}, [d, j]),
|
|
1139
|
-
!d || !
|
|
1140
|
-
}, [d, j]),
|
|
1144
|
+
}, [p]), R = G(() => {
|
|
1145
|
+
d && j(d.id, "download", Ce(d));
|
|
1146
|
+
}, [d, j]), z = d ? ge(d) : !1, ee = G(() => {
|
|
1147
|
+
!d || !ge(d) || j(d.id, "preview", Oe(d));
|
|
1148
|
+
}, [d, j]), B = G(() => {
|
|
1141
1149
|
if (!d) {
|
|
1142
1150
|
S(!1);
|
|
1143
1151
|
return;
|
|
@@ -1157,18 +1165,18 @@ function fn(e) {
|
|
|
1157
1165
|
d,
|
|
1158
1166
|
a,
|
|
1159
1167
|
t.mode
|
|
1160
|
-
]),
|
|
1168
|
+
]), te = o === "display";
|
|
1161
1169
|
return !d && p !== "uploading" ? /* @__PURE__ */ Z("div", {
|
|
1162
1170
|
"data-testid": `file-widget-${n}`,
|
|
1163
1171
|
className: "flex items-center gap-3 rounded-md border border-dashed border-border bg-surface p-3",
|
|
1164
1172
|
children: [
|
|
1165
|
-
/* @__PURE__ */ X(
|
|
1173
|
+
/* @__PURE__ */ X(pn, {}),
|
|
1166
1174
|
/* @__PURE__ */ Z("div", {
|
|
1167
1175
|
className: "flex flex-col gap-1",
|
|
1168
1176
|
children: [/* @__PURE__ */ X("span", {
|
|
1169
1177
|
className: "text-sm text-foreground",
|
|
1170
1178
|
children: t.display?.placeholder || "No document attached"
|
|
1171
|
-
}), !
|
|
1179
|
+
}), !te && /* @__PURE__ */ X("button", {
|
|
1172
1180
|
type: "button",
|
|
1173
1181
|
className: "self-start rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
1174
1182
|
onClick: P,
|
|
@@ -1177,7 +1185,7 @@ function fn(e) {
|
|
|
1177
1185
|
children: "Upload"
|
|
1178
1186
|
})]
|
|
1179
1187
|
}),
|
|
1180
|
-
!
|
|
1188
|
+
!te && /* @__PURE__ */ X("input", {
|
|
1181
1189
|
ref: D,
|
|
1182
1190
|
type: "file",
|
|
1183
1191
|
accept: M || void 0,
|
|
@@ -1197,7 +1205,7 @@ function fn(e) {
|
|
|
1197
1205
|
"aria-busy": p === "uploading" || void 0,
|
|
1198
1206
|
"aria-invalid": p === "error" || void 0,
|
|
1199
1207
|
children: [
|
|
1200
|
-
/* @__PURE__ */ X(
|
|
1208
|
+
/* @__PURE__ */ X(pn, { contentType: d?.content_type }),
|
|
1201
1209
|
/* @__PURE__ */ Z("div", {
|
|
1202
1210
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
1203
1211
|
children: [
|
|
@@ -1207,16 +1215,16 @@ function fn(e) {
|
|
|
1207
1215
|
value: C,
|
|
1208
1216
|
autoFocus: !0,
|
|
1209
1217
|
onChange: (e) => w(e.target.value),
|
|
1210
|
-
onBlur:
|
|
1218
|
+
onBlur: B,
|
|
1211
1219
|
onKeyDown: (e) => {
|
|
1212
|
-
e.key === "Enter" ?
|
|
1220
|
+
e.key === "Enter" ? B() : e.key === "Escape" && (S(!1), w(d.filename));
|
|
1213
1221
|
},
|
|
1214
1222
|
"data-testid": "filename-input"
|
|
1215
1223
|
}) : /* @__PURE__ */ X("button", {
|
|
1216
1224
|
type: "button",
|
|
1217
1225
|
className: "truncate text-left text-sm font-medium text-foreground hover:underline",
|
|
1218
|
-
onClick: () => !
|
|
1219
|
-
disabled:
|
|
1226
|
+
onClick: () => !te && d && S(!0),
|
|
1227
|
+
disabled: te || s || !d,
|
|
1220
1228
|
title: d?.filename,
|
|
1221
1229
|
"data-testid": "filename",
|
|
1222
1230
|
children: d?.filename ?? "Uploading…"
|
|
@@ -1226,7 +1234,7 @@ function fn(e) {
|
|
|
1226
1234
|
children: [
|
|
1227
1235
|
d && /* @__PURE__ */ X("span", { children: v(d.size_bytes) }),
|
|
1228
1236
|
d?.page_count != null && /* @__PURE__ */ Z("span", { children: [d.page_count, " pages"] }),
|
|
1229
|
-
d?.uploaded_at && /* @__PURE__ */ X("span", { children:
|
|
1237
|
+
d?.uploaded_at && /* @__PURE__ */ X("span", { children: hn(d.uploaded_at) }),
|
|
1230
1238
|
d?.uploaded_by && /* @__PURE__ */ Z("span", { children: ["by ", d.uploaded_by] }),
|
|
1231
1239
|
d?.version?.number != null && /* @__PURE__ */ Z("span", {
|
|
1232
1240
|
"data-testid": "version-badge",
|
|
@@ -1256,24 +1264,24 @@ function fn(e) {
|
|
|
1256
1264
|
}),
|
|
1257
1265
|
/* @__PURE__ */ Z("div", {
|
|
1258
1266
|
className: "flex flex-none items-center gap-1",
|
|
1259
|
-
children: [d && p !== "uploading" && /* @__PURE__ */ Z(
|
|
1267
|
+
children: [d && p !== "uploading" && /* @__PURE__ */ Z(We, { children: [
|
|
1260
1268
|
/* @__PURE__ */ X("button", {
|
|
1261
1269
|
type: "button",
|
|
1262
1270
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
1263
|
-
onClick:
|
|
1271
|
+
onClick: R,
|
|
1264
1272
|
"data-testid": "download",
|
|
1265
1273
|
children: "Download"
|
|
1266
1274
|
}),
|
|
1267
1275
|
/* @__PURE__ */ X("button", {
|
|
1268
1276
|
type: "button",
|
|
1269
1277
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1270
|
-
onClick:
|
|
1271
|
-
disabled: !
|
|
1272
|
-
title:
|
|
1278
|
+
onClick: ee,
|
|
1279
|
+
disabled: !z,
|
|
1280
|
+
title: z ? void 0 : "Preview is available only for images and PDFs",
|
|
1273
1281
|
"data-testid": "preview",
|
|
1274
1282
|
children: "Preview"
|
|
1275
1283
|
}),
|
|
1276
|
-
!
|
|
1284
|
+
!te && /* @__PURE__ */ Z(We, { children: [/* @__PURE__ */ X("button", {
|
|
1277
1285
|
type: "button",
|
|
1278
1286
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
1279
1287
|
onClick: P,
|
|
@@ -1296,7 +1304,7 @@ function fn(e) {
|
|
|
1296
1304
|
children: "Cancel"
|
|
1297
1305
|
})]
|
|
1298
1306
|
}),
|
|
1299
|
-
!
|
|
1307
|
+
!te && /* @__PURE__ */ X("input", {
|
|
1300
1308
|
ref: D,
|
|
1301
1309
|
type: "file",
|
|
1302
1310
|
accept: M || void 0,
|
|
@@ -1307,25 +1315,25 @@ function fn(e) {
|
|
|
1307
1315
|
]
|
|
1308
1316
|
});
|
|
1309
1317
|
}
|
|
1310
|
-
function
|
|
1318
|
+
function hn(e) {
|
|
1311
1319
|
let t = new Date(e);
|
|
1312
1320
|
return isNaN(t.getTime()) ? e : t.toISOString().slice(0, 10);
|
|
1313
1321
|
}
|
|
1314
1322
|
//#endregion
|
|
1315
1323
|
//#region src/components/file-widgets/FileList.tsx
|
|
1316
|
-
function
|
|
1324
|
+
function gn(e) {
|
|
1317
1325
|
return e ? (e.split("/")[1] ?? e).toUpperCase().slice(0, 6) : "";
|
|
1318
1326
|
}
|
|
1319
|
-
function
|
|
1320
|
-
let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s } = e, c =
|
|
1327
|
+
function _n(e) {
|
|
1328
|
+
let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s } = e, c = De(r), [u, d] = Y([]), { register: p, unregister: m, isDraft: h } = g(), _ = J(c);
|
|
1321
1329
|
_.current = c;
|
|
1322
|
-
let y =
|
|
1330
|
+
let y = J(null), b = J(/* @__PURE__ */ new Set()), x = J([]);
|
|
1323
1331
|
x.current = u;
|
|
1324
|
-
let { open: S } =
|
|
1325
|
-
|
|
1332
|
+
let { open: S } = Te();
|
|
1333
|
+
K(() => () => {
|
|
1326
1334
|
x.current.forEach((e) => e.abort());
|
|
1327
1335
|
}, []);
|
|
1328
|
-
let C = (t.accepts ?? []).join(","), w = o === "display", T =
|
|
1336
|
+
let C = (t.accepts ?? []).join(","), w = o === "display", T = G(async (r) => {
|
|
1329
1337
|
let o = i(r, t.accepts, t.max_size_bytes), s = `row-${Math.random().toString(36).slice(2)}-${Date.now()}`, c = new AbortController();
|
|
1330
1338
|
if (o) {
|
|
1331
1339
|
d((e) => [...e, {
|
|
@@ -1349,7 +1357,7 @@ function hn(e) {
|
|
|
1349
1357
|
abort: () => c.abort()
|
|
1350
1358
|
}]);
|
|
1351
1359
|
try {
|
|
1352
|
-
let t = await
|
|
1360
|
+
let t = await he({
|
|
1353
1361
|
file: r,
|
|
1354
1362
|
entityCode: e.entityCode,
|
|
1355
1363
|
fieldCode: n,
|
|
@@ -1403,22 +1411,22 @@ function hn(e) {
|
|
|
1403
1411
|
e.entityCode,
|
|
1404
1412
|
p,
|
|
1405
1413
|
m
|
|
1406
|
-
]), E =
|
|
1414
|
+
]), E = G((e) => {
|
|
1407
1415
|
Array.from(e).forEach((e) => void T(e));
|
|
1408
|
-
}, [T]), D =
|
|
1416
|
+
}, [T]), D = G(() => {
|
|
1409
1417
|
s || y.current?.click();
|
|
1410
|
-
}, [s]), O =
|
|
1418
|
+
}, [s]), O = G((e) => {
|
|
1411
1419
|
let t = e.target.files;
|
|
1412
1420
|
e.target.value = "", t && t.length > 0 && E(t);
|
|
1413
|
-
}, [E]), k =
|
|
1421
|
+
}, [E]), k = G((e) => {
|
|
1414
1422
|
h(e) && (f(e).catch(() => {}), m(e)), a?.(c.filter((t) => t.id !== e));
|
|
1415
1423
|
}, [
|
|
1416
1424
|
h,
|
|
1417
1425
|
c,
|
|
1418
1426
|
a,
|
|
1419
1427
|
m
|
|
1420
|
-
]), A =
|
|
1421
|
-
S(e.id, "download",
|
|
1428
|
+
]), A = G((e) => {
|
|
1429
|
+
S(e.id, "download", Ce(e));
|
|
1422
1430
|
}, [S]);
|
|
1423
1431
|
return /* @__PURE__ */ Z("div", {
|
|
1424
1432
|
"data-testid": `file-widget-${n}`,
|
|
@@ -1436,7 +1444,7 @@ function hn(e) {
|
|
|
1436
1444
|
children: [
|
|
1437
1445
|
/* @__PURE__ */ X("span", {
|
|
1438
1446
|
className: "flex-none rounded-sm border border-border bg-surface-3 px-1.5 py-0.5 text-[10px] text-muted-foreground",
|
|
1439
|
-
children:
|
|
1447
|
+
children: gn(e.content_type)
|
|
1440
1448
|
}),
|
|
1441
1449
|
/* @__PURE__ */ X("button", {
|
|
1442
1450
|
type: "button",
|
|
@@ -1501,7 +1509,7 @@ function hn(e) {
|
|
|
1501
1509
|
]
|
|
1502
1510
|
}, e.localId))
|
|
1503
1511
|
]
|
|
1504
|
-
}), !w && /* @__PURE__ */ Z(
|
|
1512
|
+
}), !w && /* @__PURE__ */ Z(We, { children: [/* @__PURE__ */ X("button", {
|
|
1505
1513
|
type: "button",
|
|
1506
1514
|
className: "self-start rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
1507
1515
|
onClick: D,
|
|
@@ -1521,16 +1529,16 @@ function hn(e) {
|
|
|
1521
1529
|
}
|
|
1522
1530
|
//#endregion
|
|
1523
1531
|
//#region src/components/file-widgets/LabeledSlots.tsx
|
|
1524
|
-
function
|
|
1532
|
+
function vn(e) {
|
|
1525
1533
|
return !e || Array.isArray(e) || typeof e != "object" ? {} : e;
|
|
1526
1534
|
}
|
|
1527
|
-
function
|
|
1535
|
+
function yn(e) {
|
|
1528
1536
|
return e.split("_").filter(Boolean).map((e) => e.slice(0, 1).toUpperCase() + e.slice(1)).join(" ");
|
|
1529
1537
|
}
|
|
1530
|
-
function
|
|
1538
|
+
function bn(e, t) {
|
|
1531
1539
|
return t?.content_type?.startsWith("image/") ? !0 : (e?.accepts ?? []).some((e) => e === "image/*" || e.startsWith("image/"));
|
|
1532
1540
|
}
|
|
1533
|
-
function
|
|
1541
|
+
function xn(e, t, n, r) {
|
|
1534
1542
|
return {
|
|
1535
1543
|
...e,
|
|
1536
1544
|
name: `${e.name}.${t}`,
|
|
@@ -1540,14 +1548,14 @@ function yn(e, t, n, r) {
|
|
|
1540
1548
|
slots: void 0,
|
|
1541
1549
|
display: {
|
|
1542
1550
|
...e.display ?? { widget: "document_card" },
|
|
1543
|
-
widget:
|
|
1551
|
+
widget: bn(n, r) ? "square_image" : "document_card",
|
|
1544
1552
|
aspect_ratio: n?.aspect_ratio ?? e.display?.aspect_ratio,
|
|
1545
|
-
placeholder: e.display?.placeholder ??
|
|
1553
|
+
placeholder: e.display?.placeholder ?? yn(t)
|
|
1546
1554
|
}
|
|
1547
1555
|
};
|
|
1548
1556
|
}
|
|
1549
|
-
function
|
|
1550
|
-
let { field: t, fieldName: n, entityCode: r, value: i, onChange: a, mode: o, disabled: s } = e, c = Object.entries(t.slots ?? {}), l =
|
|
1557
|
+
function Sn(e) {
|
|
1558
|
+
let { field: t, fieldName: n, entityCode: r, value: i, onChange: a, mode: o, disabled: s } = e, c = Object.entries(t.slots ?? {}), l = vn(i);
|
|
1551
1559
|
return c.length === 0 ? /* @__PURE__ */ X("span", {
|
|
1552
1560
|
className: "text-sm text-muted-foreground",
|
|
1553
1561
|
children: "No slots configured"
|
|
@@ -1557,7 +1565,7 @@ function bn(e) {
|
|
|
1557
1565
|
gap: 12
|
|
1558
1566
|
},
|
|
1559
1567
|
children: c.map(([e, i]) => {
|
|
1560
|
-
let c = l[e] ?? null, u =
|
|
1568
|
+
let c = l[e] ?? null, u = xn(t, e, i, c), d = u.display?.widget ?? "document_card", f = Gt(d);
|
|
1561
1569
|
return f ? /* @__PURE__ */ Z("div", {
|
|
1562
1570
|
style: {
|
|
1563
1571
|
display: "grid",
|
|
@@ -1569,7 +1577,7 @@ function bn(e) {
|
|
|
1569
1577
|
fontWeight: 600,
|
|
1570
1578
|
color: "var(--text-2)"
|
|
1571
1579
|
},
|
|
1572
|
-
children:
|
|
1580
|
+
children: yn(e)
|
|
1573
1581
|
}), /* @__PURE__ */ X(f, {
|
|
1574
1582
|
field: u,
|
|
1575
1583
|
fieldName: e,
|
|
@@ -1597,7 +1605,7 @@ function bn(e) {
|
|
|
1597
1605
|
fontWeight: 600,
|
|
1598
1606
|
color: "var(--text-2)"
|
|
1599
1607
|
},
|
|
1600
|
-
children:
|
|
1608
|
+
children: yn(e)
|
|
1601
1609
|
}), /* @__PURE__ */ X("span", {
|
|
1602
1610
|
className: "text-sm text-muted-foreground",
|
|
1603
1611
|
children: `Unknown file widget: ${d}`
|
|
@@ -1608,43 +1616,43 @@ function bn(e) {
|
|
|
1608
1616
|
}
|
|
1609
1617
|
//#endregion
|
|
1610
1618
|
//#region src/components/file-widgets/builtins.ts
|
|
1611
|
-
var
|
|
1612
|
-
function
|
|
1613
|
-
|
|
1619
|
+
var Cn = !1;
|
|
1620
|
+
function wn() {
|
|
1621
|
+
Cn ||= (Wt("square_image", sn), Wt("circle_image", cn), Wt("wide_banner", ln), Wt("grid", fn), Wt("document_card", mn), Wt("file_list", _n), Wt("labeled_slots", Sn), !0);
|
|
1614
1622
|
}
|
|
1615
1623
|
//#endregion
|
|
1616
1624
|
//#region src/components/file-widgets/host.tsx
|
|
1617
|
-
|
|
1618
|
-
function
|
|
1625
|
+
wn();
|
|
1626
|
+
function Tn(e, t) {
|
|
1619
1627
|
return e.files?.get(t);
|
|
1620
1628
|
}
|
|
1621
|
-
function
|
|
1629
|
+
function En(e, t) {
|
|
1622
1630
|
return Object.prototype.hasOwnProperty.call(e, t) ? e[t] ?? null : e.$files?.[t] ?? null;
|
|
1623
1631
|
}
|
|
1624
|
-
function
|
|
1625
|
-
if (
|
|
1632
|
+
function Dn(e, t, n) {
|
|
1633
|
+
if (Tn(e, n)) return En(t, n);
|
|
1626
1634
|
let r = e.fields.get(n);
|
|
1627
|
-
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? E(t[n],
|
|
1635
|
+
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? E(t[n], En(t, n)) : t[n];
|
|
1628
1636
|
}
|
|
1629
|
-
function
|
|
1637
|
+
function On(e, t, n) {
|
|
1630
1638
|
let r = e.fields.get(t);
|
|
1631
1639
|
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? D(n) : n;
|
|
1632
1640
|
}
|
|
1633
|
-
function
|
|
1634
|
-
let r =
|
|
1641
|
+
function kn(e, t, n) {
|
|
1642
|
+
let r = Tn(e, t);
|
|
1635
1643
|
if (r) return r.name || t;
|
|
1636
1644
|
let i = e.fields.get(t);
|
|
1637
1645
|
return i ? b(i, t, n) : t;
|
|
1638
1646
|
}
|
|
1639
|
-
function
|
|
1640
|
-
let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, locale: f, fieldId: p, labelId: m, structure: h } = e, g =
|
|
1647
|
+
function An(e) {
|
|
1648
|
+
let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, locale: f, fieldId: p, labelId: m, structure: h } = e, g = Tn(t, r);
|
|
1641
1649
|
if (g) {
|
|
1642
|
-
let e = g.display?.widget ?? "", t =
|
|
1650
|
+
let e = g.display?.widget ?? "", t = Gt(e);
|
|
1643
1651
|
return t ? /* @__PURE__ */ X(t, {
|
|
1644
1652
|
field: g,
|
|
1645
1653
|
fieldName: r,
|
|
1646
1654
|
entityCode: n,
|
|
1647
|
-
value:
|
|
1655
|
+
value: En(i, r),
|
|
1648
1656
|
mode: a,
|
|
1649
1657
|
onChange: o,
|
|
1650
1658
|
disabled: c,
|
|
@@ -1658,11 +1666,11 @@ function On(e) {
|
|
|
1658
1666
|
..._,
|
|
1659
1667
|
structure: h
|
|
1660
1668
|
} : _;
|
|
1661
|
-
return v ?
|
|
1669
|
+
return v ? B({
|
|
1662
1670
|
field: v,
|
|
1663
1671
|
entityCode: n,
|
|
1664
1672
|
fieldName: r,
|
|
1665
|
-
value:
|
|
1673
|
+
value: Dn(t, i, r),
|
|
1666
1674
|
mode: a,
|
|
1667
1675
|
onChange: o,
|
|
1668
1676
|
record: i,
|
|
@@ -1678,80 +1686,80 @@ function On(e) {
|
|
|
1678
1686
|
}
|
|
1679
1687
|
//#endregion
|
|
1680
1688
|
//#region src/components/file-widgets/payload.ts
|
|
1681
|
-
function
|
|
1689
|
+
function jn(e) {
|
|
1682
1690
|
return !e || Array.isArray(e) ? null : e;
|
|
1683
1691
|
}
|
|
1684
|
-
function
|
|
1692
|
+
function Mn(e) {
|
|
1685
1693
|
return Array.isArray(e) ? e : [];
|
|
1686
1694
|
}
|
|
1687
|
-
function
|
|
1695
|
+
function Nn(e) {
|
|
1688
1696
|
return !e || Array.isArray(e) || typeof e != "object" ? {} : e;
|
|
1689
1697
|
}
|
|
1690
|
-
function
|
|
1691
|
-
return e.mode === "array" ?
|
|
1698
|
+
function Pn(e, t) {
|
|
1699
|
+
return e.mode === "array" ? Mn(t) : e.mode === "named_map" ? Nn(t) : jn(t);
|
|
1692
1700
|
}
|
|
1693
|
-
function
|
|
1701
|
+
function Fn(e, t, n, r) {
|
|
1694
1702
|
let i = {
|
|
1695
1703
|
file_id: e.id,
|
|
1696
1704
|
filename: e.filename
|
|
1697
1705
|
};
|
|
1698
1706
|
return r && (i.slot = r), n && (i.position = t), e.metadata !== void 0 && (i.metadata = e.metadata), i;
|
|
1699
1707
|
}
|
|
1700
|
-
function
|
|
1708
|
+
function In(e, t) {
|
|
1701
1709
|
if (e.mode === "array") {
|
|
1702
|
-
let e =
|
|
1703
|
-
return e.length === 0 ? { clear: !0 } : { set: e.map((e, t) =>
|
|
1710
|
+
let e = Mn(t);
|
|
1711
|
+
return e.length === 0 ? { clear: !0 } : { set: e.map((e, t) => Fn(e, t, !0)) };
|
|
1704
1712
|
}
|
|
1705
1713
|
if (e.mode === "named_map") {
|
|
1706
|
-
let e =
|
|
1714
|
+
let e = Nn(t), n = Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => Fn(t, 0, !1, e));
|
|
1707
1715
|
return n.length === 0 ? { clear: !0 } : { set: n };
|
|
1708
1716
|
}
|
|
1709
|
-
let n =
|
|
1710
|
-
return n ? { set: [
|
|
1717
|
+
let n = jn(t);
|
|
1718
|
+
return n ? { set: [Fn(n, 0, !0)] } : { clear: !0 };
|
|
1711
1719
|
}
|
|
1712
|
-
function
|
|
1720
|
+
function Ln(e) {
|
|
1713
1721
|
return JSON.stringify(e);
|
|
1714
1722
|
}
|
|
1715
|
-
function
|
|
1723
|
+
function Rn(e) {
|
|
1716
1724
|
let { entity: t, formData: n, record: r, isNew: i } = e, a = {};
|
|
1717
1725
|
for (let e of t.files?.names() ?? []) {
|
|
1718
1726
|
if (!Object.prototype.hasOwnProperty.call(n, e)) continue;
|
|
1719
|
-
let o =
|
|
1727
|
+
let o = Tn(t, e);
|
|
1720
1728
|
if (!o) continue;
|
|
1721
|
-
let s =
|
|
1729
|
+
let s = Pn(o, n[e]);
|
|
1722
1730
|
if (i) {
|
|
1723
|
-
if (o.mode === "array" ?
|
|
1724
|
-
a[e] =
|
|
1731
|
+
if (o.mode === "array" ? Mn(s).length === 0 : o.mode === "named_map" ? Object.values(Nn(s)).every((e) => e == null) : jn(s) == null) continue;
|
|
1732
|
+
a[e] = In(o, s);
|
|
1725
1733
|
continue;
|
|
1726
1734
|
}
|
|
1727
|
-
let c =
|
|
1728
|
-
|
|
1735
|
+
let c = Pn(o, r ? En(r, e) : null), l = In(o, s), u = In(o, c);
|
|
1736
|
+
Ln(l) !== Ln(u) && (a[e] = l);
|
|
1729
1737
|
}
|
|
1730
1738
|
let o = t.fields;
|
|
1731
1739
|
if (!o) return a;
|
|
1732
1740
|
for (let e of o.names()) {
|
|
1733
1741
|
let s = o.get(e)?.files;
|
|
1734
1742
|
if (!s || s.mode !== "rich_text_inline" || !Object.prototype.hasOwnProperty.call(n, e)) continue;
|
|
1735
|
-
let c =
|
|
1743
|
+
let c = Bn(s, n[e]);
|
|
1736
1744
|
if (i) {
|
|
1737
1745
|
if (c.clear) continue;
|
|
1738
1746
|
a[e] = c;
|
|
1739
1747
|
continue;
|
|
1740
1748
|
}
|
|
1741
|
-
let l =
|
|
1749
|
+
let l = Bn(s, r ? Dn({
|
|
1742
1750
|
...t,
|
|
1743
1751
|
fields: o
|
|
1744
1752
|
}, r, e) : null);
|
|
1745
|
-
|
|
1753
|
+
Ln(c) !== Ln(l) && (a[e] = c);
|
|
1746
1754
|
}
|
|
1747
1755
|
return a;
|
|
1748
1756
|
}
|
|
1749
|
-
function
|
|
1757
|
+
function zn(e) {
|
|
1750
1758
|
let t = [];
|
|
1751
1759
|
for (let n of Object.values(e)) for (let e of n.set ?? []) t.push(e.file_id);
|
|
1752
1760
|
return t;
|
|
1753
1761
|
}
|
|
1754
|
-
function
|
|
1762
|
+
function Bn(e, t) {
|
|
1755
1763
|
if (e.mode !== "rich_text_inline") return { clear: !0 };
|
|
1756
1764
|
let n = T(D(t));
|
|
1757
1765
|
return n.length === 0 ? { clear: !0 } : { set: n.map((e, t) => ({
|
|
@@ -1759,24 +1767,24 @@ function Rn(e, t) {
|
|
|
1759
1767
|
position: t
|
|
1760
1768
|
})) };
|
|
1761
1769
|
}
|
|
1762
|
-
var
|
|
1763
|
-
function
|
|
1764
|
-
return !
|
|
1770
|
+
var Vn = 1200, Hn = null, Un = null;
|
|
1771
|
+
function Wn() {
|
|
1772
|
+
return !Hn || !Un ? null : `declarion::${Hn}::${Un}::listlayout`;
|
|
1765
1773
|
}
|
|
1766
|
-
function
|
|
1774
|
+
function Gn() {
|
|
1767
1775
|
return {
|
|
1768
1776
|
v: 2,
|
|
1769
1777
|
widths: {},
|
|
1770
1778
|
resizeEduShown: !1
|
|
1771
1779
|
};
|
|
1772
1780
|
}
|
|
1773
|
-
function
|
|
1781
|
+
function Kn(e) {
|
|
1774
1782
|
if (typeof e != "object" || !e) return {};
|
|
1775
1783
|
let t = {};
|
|
1776
1784
|
for (let [n, r] of Object.entries(e)) typeof r == "number" && Number.isFinite(r) && r >= 60 && (t[n] = r);
|
|
1777
1785
|
return t;
|
|
1778
1786
|
}
|
|
1779
|
-
function
|
|
1787
|
+
function qn(e) {
|
|
1780
1788
|
let t;
|
|
1781
1789
|
try {
|
|
1782
1790
|
t = JSON.parse(e);
|
|
@@ -1787,21 +1795,21 @@ function Gn(e) {
|
|
|
1787
1795
|
let n = t;
|
|
1788
1796
|
if (n.v !== 2) return null;
|
|
1789
1797
|
let r = {};
|
|
1790
|
-
if (n.widths && typeof n.widths == "object") for (let [e, t] of Object.entries(n.widths)) r[e] =
|
|
1798
|
+
if (n.widths && typeof n.widths == "object") for (let [e, t] of Object.entries(n.widths)) r[e] = Kn(t);
|
|
1791
1799
|
return {
|
|
1792
1800
|
v: 2,
|
|
1793
1801
|
widths: r,
|
|
1794
1802
|
resizeEduShown: n.resizeEduShown === !0
|
|
1795
1803
|
};
|
|
1796
1804
|
}
|
|
1797
|
-
function
|
|
1805
|
+
function Jn(e) {
|
|
1798
1806
|
if (typeof window > "u") return;
|
|
1799
|
-
let t =
|
|
1807
|
+
let t = Wn();
|
|
1800
1808
|
if (t) try {
|
|
1801
1809
|
localStorage.setItem(t, JSON.stringify(e));
|
|
1802
1810
|
} catch {}
|
|
1803
1811
|
}
|
|
1804
|
-
function
|
|
1812
|
+
function Yn(e, t) {
|
|
1805
1813
|
return {
|
|
1806
1814
|
v: 2,
|
|
1807
1815
|
widths: {
|
|
@@ -1811,29 +1819,29 @@ function qn(e, t) {
|
|
|
1811
1819
|
resizeEduShown: e.resizeEduShown || t.resizeEduShown
|
|
1812
1820
|
};
|
|
1813
1821
|
}
|
|
1814
|
-
function
|
|
1815
|
-
return Math.min(
|
|
1822
|
+
function Xn(e) {
|
|
1823
|
+
return Math.min(Vn, Math.max(60, Math.round(e)));
|
|
1816
1824
|
}
|
|
1817
|
-
var
|
|
1818
|
-
...
|
|
1825
|
+
var Zn = Ge((e) => ({
|
|
1826
|
+
...Gn(),
|
|
1819
1827
|
setScope: (e, t) => {
|
|
1820
|
-
|
|
1828
|
+
Hn = e, Un = t;
|
|
1821
1829
|
},
|
|
1822
1830
|
hydrate: () => {
|
|
1823
1831
|
if (typeof window > "u") return;
|
|
1824
|
-
let t =
|
|
1832
|
+
let t = Wn();
|
|
1825
1833
|
if (!t) {
|
|
1826
|
-
e(
|
|
1834
|
+
e(Gn());
|
|
1827
1835
|
return;
|
|
1828
1836
|
}
|
|
1829
1837
|
let n = localStorage.getItem(t);
|
|
1830
|
-
e((n ?
|
|
1838
|
+
e((n ? qn(n) : null) ?? Gn());
|
|
1831
1839
|
},
|
|
1832
1840
|
setWidth: (t, n, r) => {
|
|
1833
1841
|
e((e) => {
|
|
1834
1842
|
let i = {
|
|
1835
1843
|
...e.widths[t] ?? {},
|
|
1836
|
-
[n]:
|
|
1844
|
+
[n]: Xn(r)
|
|
1837
1845
|
}, a = {
|
|
1838
1846
|
...e,
|
|
1839
1847
|
widths: {
|
|
@@ -1841,13 +1849,13 @@ var Yn = We((e) => ({
|
|
|
1841
1849
|
[t]: i
|
|
1842
1850
|
}
|
|
1843
1851
|
};
|
|
1844
|
-
return
|
|
1852
|
+
return Jn(a), a;
|
|
1845
1853
|
});
|
|
1846
1854
|
},
|
|
1847
1855
|
setWidths: (t, n) => {
|
|
1848
1856
|
e((e) => {
|
|
1849
1857
|
let r = {};
|
|
1850
|
-
for (let [e, t] of Object.entries(n)) r[e] =
|
|
1858
|
+
for (let [e, t] of Object.entries(n)) r[e] = Xn(t);
|
|
1851
1859
|
let i = {
|
|
1852
1860
|
...e.widths[t] ?? {},
|
|
1853
1861
|
...r
|
|
@@ -1858,7 +1866,7 @@ var Yn = We((e) => ({
|
|
|
1858
1866
|
[t]: i
|
|
1859
1867
|
}
|
|
1860
1868
|
};
|
|
1861
|
-
return
|
|
1869
|
+
return Jn(a), a;
|
|
1862
1870
|
});
|
|
1863
1871
|
},
|
|
1864
1872
|
resetWidths: (t) => {
|
|
@@ -1870,7 +1878,7 @@ var Yn = We((e) => ({
|
|
|
1870
1878
|
[t]: {}
|
|
1871
1879
|
}
|
|
1872
1880
|
};
|
|
1873
|
-
return
|
|
1881
|
+
return Jn(n), n;
|
|
1874
1882
|
});
|
|
1875
1883
|
},
|
|
1876
1884
|
prune: (t, n) => {
|
|
@@ -1888,7 +1896,7 @@ var Yn = We((e) => ({
|
|
|
1888
1896
|
[t]: i
|
|
1889
1897
|
}
|
|
1890
1898
|
};
|
|
1891
|
-
return
|
|
1899
|
+
return Jn(o), o;
|
|
1892
1900
|
});
|
|
1893
1901
|
},
|
|
1894
1902
|
markResizeEduShown: () => {
|
|
@@ -1898,49 +1906,49 @@ var Yn = We((e) => ({
|
|
|
1898
1906
|
...e,
|
|
1899
1907
|
resizeEduShown: !0
|
|
1900
1908
|
};
|
|
1901
|
-
return
|
|
1909
|
+
return Jn(t), t;
|
|
1902
1910
|
});
|
|
1903
1911
|
}
|
|
1904
|
-
})),
|
|
1905
|
-
function
|
|
1906
|
-
typeof window > "u" ||
|
|
1907
|
-
let t =
|
|
1912
|
+
})), Qn = !1;
|
|
1913
|
+
function $n() {
|
|
1914
|
+
typeof window > "u" || Qn || (Qn = !0, window.addEventListener("storage", (e) => {
|
|
1915
|
+
let t = Wn();
|
|
1908
1916
|
if (!t || e.key !== t || e.newValue == null) return;
|
|
1909
|
-
let n =
|
|
1910
|
-
n &&
|
|
1917
|
+
let n = qn(e.newValue);
|
|
1918
|
+
n && Zn.setState((e) => Yn(e, n));
|
|
1911
1919
|
}));
|
|
1912
1920
|
}
|
|
1913
|
-
var
|
|
1914
|
-
function
|
|
1915
|
-
let t = !!e &&
|
|
1916
|
-
t && e &&
|
|
1917
|
-
}, [t, e]), a =
|
|
1918
|
-
t && e &&
|
|
1919
|
-
}, [t, e]), o =
|
|
1920
|
-
t && e &&
|
|
1921
|
-
}, [t, e]), s =
|
|
1922
|
-
t && e &&
|
|
1923
|
-
}, [t, e]), c =
|
|
1924
|
-
t &&
|
|
1921
|
+
var er = {}, tr = () => {};
|
|
1922
|
+
function nr(e) {
|
|
1923
|
+
let t = !!e && Wn() !== null, n = Zn((t) => e ? t.widths[e] : void 0), r = Zn((e) => e.resizeEduShown === !0), i = G((n, r) => {
|
|
1924
|
+
t && e && Zn.getState().setWidth(e, n, r);
|
|
1925
|
+
}, [t, e]), a = G((n) => {
|
|
1926
|
+
t && e && Zn.getState().setWidths(e, n);
|
|
1927
|
+
}, [t, e]), o = G(() => {
|
|
1928
|
+
t && e && Zn.getState().resetWidths(e);
|
|
1929
|
+
}, [t, e]), s = G((n) => {
|
|
1930
|
+
t && e && Zn.getState().prune(e, n);
|
|
1931
|
+
}, [t, e]), c = G(() => {
|
|
1932
|
+
t && Zn.getState().markResizeEduShown();
|
|
1925
1933
|
}, [t]);
|
|
1926
1934
|
return {
|
|
1927
|
-
widths: t ? n ??
|
|
1935
|
+
widths: t ? n ?? er : er,
|
|
1928
1936
|
resizeEduShown: r,
|
|
1929
|
-
setWidth: t ? i :
|
|
1930
|
-
setWidths: t ? a :
|
|
1931
|
-
resetWidths: t ? o :
|
|
1932
|
-
prune: t ? s :
|
|
1933
|
-
markResizeEduShown: t ? c :
|
|
1937
|
+
setWidth: t ? i : tr,
|
|
1938
|
+
setWidths: t ? a : tr,
|
|
1939
|
+
resetWidths: t ? o : tr,
|
|
1940
|
+
prune: t ? s : tr,
|
|
1941
|
+
markResizeEduShown: t ? c : tr
|
|
1934
1942
|
};
|
|
1935
1943
|
}
|
|
1936
1944
|
//#endregion
|
|
1937
1945
|
//#region src/hooks/useChildrenData.ts
|
|
1938
|
-
var
|
|
1939
|
-
function
|
|
1946
|
+
var rr = "entity-children";
|
|
1947
|
+
function ir(e, t, n, r, i, a) {
|
|
1940
1948
|
let s = Array.isArray(r) ? r : [r], l = Array.isArray(r) ? o(t, s.length) : [t];
|
|
1941
1949
|
return He({
|
|
1942
1950
|
queryKey: [
|
|
1943
|
-
|
|
1951
|
+
rr,
|
|
1944
1952
|
e,
|
|
1945
1953
|
t,
|
|
1946
1954
|
n,
|
|
@@ -1962,7 +1970,7 @@ function nr(e, t, n, r, i, a) {
|
|
|
1962
1970
|
}
|
|
1963
1971
|
//#endregion
|
|
1964
1972
|
//#region src/stores/realtime.ts
|
|
1965
|
-
var
|
|
1973
|
+
var ar = Ge((e, t) => ({
|
|
1966
1974
|
degradedEntities: /* @__PURE__ */ new Set(),
|
|
1967
1975
|
markDegraded: (n) => {
|
|
1968
1976
|
if (!n || t().degradedEntities.has(n)) return;
|
|
@@ -1970,16 +1978,16 @@ var rr = We((e, t) => ({
|
|
|
1970
1978
|
r.add(n), e({ degradedEntities: r });
|
|
1971
1979
|
}
|
|
1972
1980
|
}));
|
|
1973
|
-
function
|
|
1981
|
+
function or(e, t, n) {
|
|
1974
1982
|
return e === !0 && !t.has(n);
|
|
1975
1983
|
}
|
|
1976
1984
|
//#endregion
|
|
1977
1985
|
//#region src/hooks/useAssociatedData.ts
|
|
1978
|
-
function
|
|
1986
|
+
function sr(e, t, n, r, i, a, o, s) {
|
|
1979
1987
|
let l = s ? JSON.stringify(Object.entries(s).sort()) : void 0;
|
|
1980
1988
|
return Be({
|
|
1981
1989
|
queryKey: [
|
|
1982
|
-
|
|
1990
|
+
rr,
|
|
1983
1991
|
e,
|
|
1984
1992
|
t,
|
|
1985
1993
|
n,
|
|
@@ -2008,19 +2016,19 @@ function ar(e, t, n, r, i, a, o, s) {
|
|
|
2008
2016
|
}
|
|
2009
2017
|
//#endregion
|
|
2010
2018
|
//#region src/components/shared/ActionButton.tsx
|
|
2011
|
-
function
|
|
2012
|
-
let [f, p] =
|
|
2019
|
+
function cr({ actionCode: n, action: i, entityCode: o, objectIds: s = [], row: c, variant: l = "outline", size: u = "default", onSuccess: d }) {
|
|
2020
|
+
let [f, p] = Y(!1), [m, g] = Y(!1), { data: _ } = r(), v = Vt(), { run: y } = ee(), b = S(i), x = !c || N(i.conditions, c), w = G(async () => {
|
|
2013
2021
|
if (!(!i.association || s.length === 0)) {
|
|
2014
2022
|
p(!0);
|
|
2015
2023
|
try {
|
|
2016
|
-
let e = o ? `${o}.${i.association}` : i.association, t = await
|
|
2024
|
+
let e = o ? `${o}.${i.association}` : i.association, t = await fe(e, s), n = a(_, t.target_entity);
|
|
2017
2025
|
if (!n) {
|
|
2018
|
-
|
|
2026
|
+
U.error(`No list screen found for ${t.target_entity}`);
|
|
2019
2027
|
return;
|
|
2020
2028
|
}
|
|
2021
2029
|
let r = _?.entities[t.target_entity], c = C(i.display?.name) || t.target_entity;
|
|
2022
2030
|
if (t.ids.length === 0) {
|
|
2023
|
-
|
|
2031
|
+
U.info(`No related ${c} found`);
|
|
2024
2032
|
return;
|
|
2025
2033
|
}
|
|
2026
2034
|
let l = r?.fields.names().find((e) => r.fields.get(e)?.primary) ?? "id", u = new URLSearchParams();
|
|
@@ -2030,7 +2038,7 @@ function or({ actionCode: n, action: i, entityCode: o, objectIds: s = [], row: c
|
|
|
2030
2038
|
search: u.toString()
|
|
2031
2039
|
}), d?.();
|
|
2032
2040
|
} catch (e) {
|
|
2033
|
-
|
|
2041
|
+
U.error(e instanceof Error ? e.message : "Failed to resolve association");
|
|
2034
2042
|
} finally {
|
|
2035
2043
|
p(!1);
|
|
2036
2044
|
}
|
|
@@ -2042,13 +2050,13 @@ function or({ actionCode: n, action: i, entityCode: o, objectIds: s = [], row: c
|
|
|
2042
2050
|
_,
|
|
2043
2051
|
v,
|
|
2044
2052
|
d
|
|
2045
|
-
]), T = i.entity ? `${i.entity}.${n}` : n, E = s.length > 0 ? s : void 0, D =
|
|
2053
|
+
]), T = i.entity ? `${i.entity}.${n}` : n, E = s.length > 0 ? s : void 0, D = G(() => {
|
|
2046
2054
|
g(!0), y({
|
|
2047
2055
|
action: i,
|
|
2048
2056
|
title: C(i.display?.name) || n,
|
|
2049
2057
|
row: c,
|
|
2050
2058
|
entity: o,
|
|
2051
|
-
execute: (e) => F(T,
|
|
2059
|
+
execute: (e) => F(T, z(e, E)),
|
|
2052
2060
|
onSuccess: () => d?.()
|
|
2053
2061
|
}).finally(() => g(!1));
|
|
2054
2062
|
}, [
|
|
@@ -2060,9 +2068,9 @@ function or({ actionCode: n, action: i, entityCode: o, objectIds: s = [], row: c
|
|
|
2060
2068
|
T,
|
|
2061
2069
|
E,
|
|
2062
2070
|
d
|
|
2063
|
-
]), O =
|
|
2071
|
+
]), O = G(() => {
|
|
2064
2072
|
if (L(i)) {
|
|
2065
|
-
|
|
2073
|
+
ce(i.ui_steps, { row: c }).then(() => d?.());
|
|
2066
2074
|
return;
|
|
2067
2075
|
}
|
|
2068
2076
|
if (b) {
|
|
@@ -2093,11 +2101,11 @@ function or({ actionCode: n, action: i, entityCode: o, objectIds: s = [], row: c
|
|
|
2093
2101
|
name: A,
|
|
2094
2102
|
size: 13
|
|
2095
2103
|
}) : null, P = !x || m || f;
|
|
2096
|
-
return u === "icon" ? /* @__PURE__ */ X(
|
|
2104
|
+
return u === "icon" ? /* @__PURE__ */ X(V, {
|
|
2097
2105
|
icon: M ?? /* @__PURE__ */ X(e.bolt, { size: 13 }),
|
|
2098
2106
|
onClick: O,
|
|
2099
2107
|
title: k
|
|
2100
|
-
}) : /* @__PURE__ */ X(
|
|
2108
|
+
}) : /* @__PURE__ */ X(W, {
|
|
2101
2109
|
kind: l === "default" ? "primary" : l === "ghost" ? "ghost" : "default",
|
|
2102
2110
|
size: "sm",
|
|
2103
2111
|
icon: M,
|
|
@@ -2111,14 +2119,14 @@ function or({ actionCode: n, action: i, entityCode: o, objectIds: s = [], row: c
|
|
|
2111
2119
|
}
|
|
2112
2120
|
//#endregion
|
|
2113
2121
|
//#region src/components/shared/ResponsiveActionBar.tsx
|
|
2114
|
-
function
|
|
2122
|
+
function lr(e, t) {
|
|
2115
2123
|
return e.replace(/\$\{([^}]+)\}/g, (e, n) => Object.prototype.hasOwnProperty.call(t, n) ? t[n] : e);
|
|
2116
2124
|
}
|
|
2117
|
-
function
|
|
2125
|
+
function ur(e) {
|
|
2118
2126
|
return e.widget ? "widget" : e.href ? "href" : e.handler ? "handler" : e.association ? "association" : e.ui_steps && e.ui_steps.length > 0 ? "ui_steps" : "unknown";
|
|
2119
2127
|
}
|
|
2120
|
-
function
|
|
2121
|
-
let a =
|
|
2128
|
+
function dr(e, t, n, r, i) {
|
|
2129
|
+
let a = ur(t), o = h(n, r?.entity), s = r?.entityCode ?? "";
|
|
2122
2130
|
if (e === "__peek") return i?.({
|
|
2123
2131
|
code: e,
|
|
2124
2132
|
entity: s,
|
|
@@ -2132,7 +2140,7 @@ function lr(e, t, n, r, i) {
|
|
|
2132
2140
|
rowId: o
|
|
2133
2141
|
}), a === "widget") return console.warn(`[ResponsiveActionBar] widget "${t.widget}" requested for action "${e}" but the widget registry ships in Phase 2; falling back to onRun.`), !1;
|
|
2134
2142
|
if (a === "href" && r) {
|
|
2135
|
-
let e =
|
|
2143
|
+
let e = lr(t.href ?? "", {
|
|
2136
2144
|
entity: s,
|
|
2137
2145
|
id: encodeURIComponent(o)
|
|
2138
2146
|
}), n = e.indexOf("?");
|
|
@@ -2140,27 +2148,27 @@ function lr(e, t, n, r, i) {
|
|
|
2140
2148
|
}
|
|
2141
2149
|
return a === "handler" || a === "association" || a === "ui_steps" || a === "unknown" && console.warn(`[ResponsiveActionBar] no dispatch mode set on action "${e}" (none of handler/association/widget/href/ui_steps).`), !1;
|
|
2142
2150
|
}
|
|
2143
|
-
function
|
|
2151
|
+
function fr(e) {
|
|
2144
2152
|
let t = 0;
|
|
2145
|
-
for (let n of e) n.kind === "action" ? t++ : t +=
|
|
2153
|
+
for (let n of e) n.kind === "action" ? t++ : t += fr(n.items);
|
|
2146
2154
|
return t;
|
|
2147
2155
|
}
|
|
2148
|
-
function
|
|
2156
|
+
function pr(e, t, n) {
|
|
2149
2157
|
let r = [], i = [];
|
|
2150
|
-
for (let a of e) a.kind === "action" &&
|
|
2158
|
+
for (let a of e) a.kind === "action" && hr(a.code, t, n)?.destructive ? i.push(a) : r.push(a);
|
|
2151
2159
|
return {
|
|
2152
2160
|
normal: r,
|
|
2153
2161
|
destructive: i
|
|
2154
2162
|
};
|
|
2155
2163
|
}
|
|
2156
|
-
function
|
|
2164
|
+
function mr(e, t, n) {
|
|
2157
2165
|
let r = [], i = [], a = [];
|
|
2158
2166
|
for (let o of e) {
|
|
2159
2167
|
if (o.kind !== "action") {
|
|
2160
2168
|
i.push(o);
|
|
2161
2169
|
continue;
|
|
2162
2170
|
}
|
|
2163
|
-
let e =
|
|
2171
|
+
let e = hr(o.code, t, n), s = e?.destructive === !0, c = e?.display?.primary === !0;
|
|
2164
2172
|
if (s && c) {
|
|
2165
2173
|
console.warn(`[ResponsiveActionBar] action "${o.code}" declares both primary and destructive; treating as destructive.`), a.push(o);
|
|
2166
2174
|
continue;
|
|
@@ -2181,33 +2189,33 @@ function fr(e, t, n) {
|
|
|
2181
2189
|
destructive: a
|
|
2182
2190
|
};
|
|
2183
2191
|
}
|
|
2184
|
-
function
|
|
2192
|
+
function hr(e, t, n) {
|
|
2185
2193
|
if (t && e in t) return t[e];
|
|
2186
2194
|
if (n && e in n) return n[e];
|
|
2187
2195
|
}
|
|
2188
|
-
function
|
|
2189
|
-
let r =
|
|
2196
|
+
function gr(e, t, n) {
|
|
2197
|
+
let r = hr(e, t, n);
|
|
2190
2198
|
return C(r?.display?.name) || e;
|
|
2191
2199
|
}
|
|
2192
|
-
function
|
|
2193
|
-
return
|
|
2200
|
+
function _r(e, t, n) {
|
|
2201
|
+
return hr(e, t, n)?.display?.icon || void 0;
|
|
2194
2202
|
}
|
|
2195
|
-
function
|
|
2203
|
+
function vr(e) {
|
|
2196
2204
|
return `action-tooltip-${e}`;
|
|
2197
2205
|
}
|
|
2198
|
-
function
|
|
2199
|
-
let
|
|
2200
|
-
if (!(!
|
|
2206
|
+
function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a, onLoadingChange: o, measureRef: s, style: c, row: l, widgetContext: u, onActionClick: d, iconOnly: f = !1 }) {
|
|
2207
|
+
let p = hr(e.code, n, r), m = gr(e.code, n, r), h = _r(e.code, n, r), g = p?.destructive ?? !1, _ = !g && p?.display?.primary === !0, v = !e.enabled, y = v ? vr(e.code) : void 0, b = G(async () => {
|
|
2208
|
+
if (!(!p || v || a)) {
|
|
2201
2209
|
o(!0);
|
|
2202
2210
|
try {
|
|
2203
|
-
|
|
2211
|
+
dr(e.code, p, l, u, d) || await Promise.resolve(i(e.code, p));
|
|
2204
2212
|
} finally {
|
|
2205
2213
|
o(!1);
|
|
2206
2214
|
}
|
|
2207
2215
|
}
|
|
2208
2216
|
}, [
|
|
2209
|
-
|
|
2210
|
-
|
|
2217
|
+
p,
|
|
2218
|
+
v,
|
|
2211
2219
|
a,
|
|
2212
2220
|
i,
|
|
2213
2221
|
e.code,
|
|
@@ -2215,12 +2223,12 @@ function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2215
2223
|
l,
|
|
2216
2224
|
u,
|
|
2217
2225
|
d
|
|
2218
|
-
]),
|
|
2219
|
-
name:
|
|
2226
|
+
]), x = a ? /* @__PURE__ */ X(A, { size: 12 }) : h ? /* @__PURE__ */ X(t, {
|
|
2227
|
+
name: h,
|
|
2220
2228
|
size: 12
|
|
2221
2229
|
}) : null;
|
|
2222
|
-
return /* @__PURE__ */ Z(
|
|
2223
|
-
id:
|
|
2230
|
+
return /* @__PURE__ */ Z(We, { children: [y && e.reason && /* @__PURE__ */ X("span", {
|
|
2231
|
+
id: y,
|
|
2224
2232
|
role: "tooltip",
|
|
2225
2233
|
style: {
|
|
2226
2234
|
position: "absolute",
|
|
@@ -2230,25 +2238,26 @@ function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2230
2238
|
clip: "rect(0,0,0,0)"
|
|
2231
2239
|
},
|
|
2232
2240
|
children: e.reason
|
|
2233
|
-
}), /* @__PURE__ */ X(
|
|
2241
|
+
}), /* @__PURE__ */ X(W, {
|
|
2234
2242
|
ref: s,
|
|
2235
|
-
kind:
|
|
2236
|
-
danger:
|
|
2237
|
-
icon:
|
|
2238
|
-
disabled:
|
|
2239
|
-
"aria-disabled":
|
|
2240
|
-
"aria-describedby":
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
+
kind: _ ? "primary" : "default",
|
|
2244
|
+
danger: g,
|
|
2245
|
+
icon: x,
|
|
2246
|
+
disabled: v || a,
|
|
2247
|
+
"aria-disabled": v ? "true" : void 0,
|
|
2248
|
+
"aria-describedby": y,
|
|
2249
|
+
"aria-label": f ? m : void 0,
|
|
2250
|
+
title: R(p, m, v, e.reason, f),
|
|
2251
|
+
onClick: b,
|
|
2243
2252
|
style: c,
|
|
2244
|
-
children:
|
|
2253
|
+
children: f ? null : m
|
|
2245
2254
|
})] });
|
|
2246
2255
|
}
|
|
2247
|
-
function
|
|
2248
|
-
let p =
|
|
2256
|
+
function br({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o, onLoadingChange: s, measureRef: c, style: l, row: u, widgetContext: d, onActionClick: f }) {
|
|
2257
|
+
let p = J(null), [m, h] = Y(!1), g = n.name ? C(n.name) : "Actions", _ = G((e) => {
|
|
2249
2258
|
p.current = e, c?.(e);
|
|
2250
|
-
}, [c]), v =
|
|
2251
|
-
return /* @__PURE__ */ Z(
|
|
2259
|
+
}, [c]), v = G((e, t) => (h(!1), a(e, t)), [a]);
|
|
2260
|
+
return /* @__PURE__ */ Z(We, { children: [/* @__PURE__ */ X(W, {
|
|
2252
2261
|
ref: _,
|
|
2253
2262
|
kind: "default",
|
|
2254
2263
|
icon: o == null ? n.icon ? /* @__PURE__ */ X(t, {
|
|
@@ -2262,7 +2271,7 @@ function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2262
2271
|
onClick: () => h((e) => !e),
|
|
2263
2272
|
style: l,
|
|
2264
2273
|
children: g
|
|
2265
|
-
}), /* @__PURE__ */ X(
|
|
2274
|
+
}), /* @__PURE__ */ X(H, {
|
|
2266
2275
|
open: m,
|
|
2267
2276
|
anchor: p.current,
|
|
2268
2277
|
onClose: () => h(!1),
|
|
@@ -2271,7 +2280,7 @@ function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2271
2280
|
children: /* @__PURE__ */ X("div", {
|
|
2272
2281
|
role: "menu",
|
|
2273
2282
|
"aria-label": g,
|
|
2274
|
-
children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ X(
|
|
2283
|
+
children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ X(xr, {
|
|
2275
2284
|
leaf: e,
|
|
2276
2285
|
entityActions: r,
|
|
2277
2286
|
globalActions: i,
|
|
@@ -2281,7 +2290,7 @@ function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2281
2290
|
row: u,
|
|
2282
2291
|
widgetContext: d,
|
|
2283
2292
|
onActionClick: f
|
|
2284
|
-
}, e.code) : /* @__PURE__ */ X(
|
|
2293
|
+
}, e.code) : /* @__PURE__ */ X(Sr, {
|
|
2285
2294
|
group: e,
|
|
2286
2295
|
entityActions: r,
|
|
2287
2296
|
globalActions: i,
|
|
@@ -2295,12 +2304,12 @@ function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2295
2304
|
})
|
|
2296
2305
|
})] });
|
|
2297
2306
|
}
|
|
2298
|
-
function
|
|
2299
|
-
let u =
|
|
2307
|
+
function xr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a, onLoadingChange: o, row: s, widgetContext: c, onActionClick: l }) {
|
|
2308
|
+
let u = hr(e.code, n, r), d = gr(e.code, n, r), f = _r(e.code, n, r), p = u?.destructive ?? !1, m = !e.enabled, h = m ? vr(e.code) : void 0, g = a ? /* @__PURE__ */ X(A, { size: 12 }) : f ? /* @__PURE__ */ X(t, {
|
|
2300
2309
|
name: f,
|
|
2301
2310
|
size: 12
|
|
2302
2311
|
}) : null;
|
|
2303
|
-
return /* @__PURE__ */ Z(
|
|
2312
|
+
return /* @__PURE__ */ Z(We, { children: [h && e.reason && /* @__PURE__ */ X("span", {
|
|
2304
2313
|
id: h,
|
|
2305
2314
|
role: "tooltip",
|
|
2306
2315
|
style: {
|
|
@@ -2315,12 +2324,12 @@ function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2315
2324
|
role: "menuitem",
|
|
2316
2325
|
"aria-disabled": m ? "true" : void 0,
|
|
2317
2326
|
"aria-describedby": h,
|
|
2318
|
-
title:
|
|
2327
|
+
title: R(u, d, m, e.reason),
|
|
2319
2328
|
onClick: async () => {
|
|
2320
2329
|
if (!(!u || m || a)) {
|
|
2321
2330
|
o(!0);
|
|
2322
2331
|
try {
|
|
2323
|
-
|
|
2332
|
+
dr(e.code, u, s, c, l) || await Promise.resolve(i(e.code, u));
|
|
2324
2333
|
} finally {
|
|
2325
2334
|
o(!1);
|
|
2326
2335
|
}
|
|
@@ -2355,9 +2364,9 @@ function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2355
2364
|
})]
|
|
2356
2365
|
})] });
|
|
2357
2366
|
}
|
|
2358
|
-
function
|
|
2367
|
+
function Sr({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
|
|
2359
2368
|
let l = e.name ? C(e.name) : void 0;
|
|
2360
|
-
return /* @__PURE__ */ Z(
|
|
2369
|
+
return /* @__PURE__ */ Z(We, { children: [l && /* @__PURE__ */ X("div", {
|
|
2361
2370
|
style: {
|
|
2362
2371
|
padding: "4px 10px 2px",
|
|
2363
2372
|
fontSize: 10.5,
|
|
@@ -2367,7 +2376,7 @@ function br({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2367
2376
|
letterSpacing: "0.05em"
|
|
2368
2377
|
},
|
|
2369
2378
|
children: l
|
|
2370
|
-
}), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ X(
|
|
2379
|
+
}), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ X(xr, {
|
|
2371
2380
|
leaf: e,
|
|
2372
2381
|
entityActions: t,
|
|
2373
2382
|
globalActions: n,
|
|
@@ -2377,7 +2386,7 @@ function br({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2377
2386
|
row: o,
|
|
2378
2387
|
widgetContext: s,
|
|
2379
2388
|
onActionClick: c
|
|
2380
|
-
}, e.code) : /* @__PURE__ */ X(
|
|
2389
|
+
}, e.code) : /* @__PURE__ */ X(Sr, {
|
|
2381
2390
|
group: e,
|
|
2382
2391
|
entityActions: t,
|
|
2383
2392
|
globalActions: n,
|
|
@@ -2389,26 +2398,27 @@ function br({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2389
2398
|
onActionClick: c
|
|
2390
2399
|
}, e.icon ?? "nested"))] });
|
|
2391
2400
|
}
|
|
2392
|
-
function
|
|
2393
|
-
let c =
|
|
2394
|
-
return
|
|
2401
|
+
function Cr({ layout: t, entityActions: n, globalActions: r, onRun: i, row: a, widgetContext: o, onActionClick: s }) {
|
|
2402
|
+
let c = J(null), [l, u] = Y(!1), [d, f] = Y(null), p = G((e, t) => (u(!1), i(e, t)), [i]);
|
|
2403
|
+
return fr(t) === 0 ? null : /* @__PURE__ */ Z("div", {
|
|
2404
|
+
"data-open": l ? "true" : void 0,
|
|
2395
2405
|
style: {
|
|
2396
2406
|
display: "inline-flex",
|
|
2397
2407
|
alignItems: "center"
|
|
2398
2408
|
},
|
|
2399
|
-
children: [/* @__PURE__ */ X(
|
|
2409
|
+
children: [/* @__PURE__ */ X(V, {
|
|
2400
2410
|
ref: c,
|
|
2401
2411
|
icon: X(d == null ? e.more : A, { size: 14 }),
|
|
2402
2412
|
title: "Actions",
|
|
2403
2413
|
size: 28,
|
|
2404
2414
|
onClick: () => u((e) => !e)
|
|
2405
|
-
}), /* @__PURE__ */ X(
|
|
2415
|
+
}), /* @__PURE__ */ X(H, {
|
|
2406
2416
|
open: l,
|
|
2407
2417
|
anchor: c.current,
|
|
2408
2418
|
onClose: () => u(!1),
|
|
2409
2419
|
align: "end",
|
|
2410
2420
|
width: 220,
|
|
2411
|
-
children: /* @__PURE__ */ X(
|
|
2421
|
+
children: /* @__PURE__ */ X(Tr, {
|
|
2412
2422
|
layout: t,
|
|
2413
2423
|
entityActions: n,
|
|
2414
2424
|
globalActions: r,
|
|
@@ -2422,14 +2432,14 @@ function xr({ layout: t, entityActions: n, globalActions: r, onRun: i, row: a, w
|
|
|
2422
2432
|
})]
|
|
2423
2433
|
});
|
|
2424
2434
|
}
|
|
2425
|
-
function
|
|
2435
|
+
function wr(e) {
|
|
2426
2436
|
let t = 0;
|
|
2427
2437
|
for (let n of e) if (n.kind === "action" && s(n.code)) t++;
|
|
2428
2438
|
else break;
|
|
2429
2439
|
return t;
|
|
2430
2440
|
}
|
|
2431
|
-
function
|
|
2432
|
-
let { normal: u, destructive: d } =
|
|
2441
|
+
function Tr({ layout: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c, ariaLabel: l = "Row actions" }) {
|
|
2442
|
+
let { normal: u, destructive: d } = pr(e, t, n), f = wr(u), p = u.slice(0, f), m = u.slice(f), h = d.length > 0, g = m.length > 0, v = (e) => /* @__PURE__ */ X(xr, {
|
|
2433
2443
|
leaf: e,
|
|
2434
2444
|
entityActions: t,
|
|
2435
2445
|
globalActions: n,
|
|
@@ -2446,7 +2456,7 @@ function Cr({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
2446
2456
|
children: [
|
|
2447
2457
|
p.map((e) => e.kind === "action" ? v(e) : null),
|
|
2448
2458
|
p.length > 0 && g && /* @__PURE__ */ X(_, { divider: !0 }),
|
|
2449
|
-
m.map((e) => e.kind === "action" ? v(e) : /* @__PURE__ */ X(
|
|
2459
|
+
m.map((e) => e.kind === "action" ? v(e) : /* @__PURE__ */ X(Sr, {
|
|
2450
2460
|
group: e,
|
|
2451
2461
|
entityActions: t,
|
|
2452
2462
|
globalActions: n,
|
|
@@ -2462,136 +2472,180 @@ function Cr({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
2462
2472
|
]
|
|
2463
2473
|
});
|
|
2464
2474
|
}
|
|
2465
|
-
var
|
|
2466
|
-
function
|
|
2467
|
-
return e
|
|
2475
|
+
var Er = "__overflow_trigger__", Dr = 90, Or = 4, kr = 8;
|
|
2476
|
+
function Ar(e) {
|
|
2477
|
+
return `icon:${Q(e)}`;
|
|
2468
2478
|
}
|
|
2469
|
-
function
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
+
function jr() {
|
|
2480
|
+
return kr;
|
|
2481
|
+
}
|
|
2482
|
+
function Mr(e, t, n) {
|
|
2483
|
+
return [
|
|
2484
|
+
...e,
|
|
2485
|
+
...t,
|
|
2486
|
+
...n
|
|
2487
|
+
];
|
|
2488
|
+
}
|
|
2489
|
+
function Nr(e, t) {
|
|
2490
|
+
return t.get(Q(e)) ?? 0;
|
|
2491
|
+
}
|
|
2492
|
+
function Pr(e, t) {
|
|
2493
|
+
return t.get(Ar(e));
|
|
2494
|
+
}
|
|
2495
|
+
function Fr(e, t, n, r, i, a, o, s, c) {
|
|
2496
|
+
let { primary: l, regular: u, destructive: d } = mr(e, i, a), f = Or, p = r.get(Er) ?? Dr, m = t - n, h = Mr(l, u, d), g = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Set();
|
|
2497
|
+
if (o) for (let e of h) o(e) && g.add(Q(e));
|
|
2498
|
+
else {
|
|
2499
|
+
let e = c ?? h.length, t = (e, t) => t ? Pr(e, r) ?? Nr(e, r) : Nr(e, r), n = (e) => s ? e.filter((e) => !s.has(Q(e))).length * jr() : 0, i = (e, r) => {
|
|
2500
|
+
let i = e.length < h.length ? p + f : 0, a = e.length > 1 ? (e.length - 1) * f : 0;
|
|
2501
|
+
return e.reduce((e, n, i) => e + t(n, i >= r), 0) + a + i + n(e) <= m;
|
|
2502
|
+
}, a = 0, o = !1;
|
|
2503
|
+
for (let t = Math.min(e, h.length); t >= 1 && a === 0; t--) i(h.slice(0, t), 1) ? a = t : i(h.slice(0, t), 0) && (a = t, o = !0);
|
|
2504
|
+
let l = o ? 0 : Math.min(1, a), u = h.slice(0, a);
|
|
2505
|
+
for (; l < a && i(u, l + 1);) l++;
|
|
2506
|
+
u.forEach((e, t) => {
|
|
2507
|
+
let n = Q(e);
|
|
2508
|
+
g.add(n), t >= l && _.add(n);
|
|
2509
|
+
});
|
|
2479
2510
|
}
|
|
2511
|
+
let v = (e) => g.has(Q(e)), y = [
|
|
2512
|
+
...l,
|
|
2513
|
+
...u,
|
|
2514
|
+
...d
|
|
2515
|
+
].filter((e) => !v(e));
|
|
2480
2516
|
return {
|
|
2481
|
-
primaryInline:
|
|
2482
|
-
inline:
|
|
2483
|
-
overflow:
|
|
2484
|
-
destructiveInline:
|
|
2517
|
+
primaryInline: l.filter(v),
|
|
2518
|
+
inline: u.filter(v),
|
|
2519
|
+
overflow: y,
|
|
2520
|
+
destructiveInline: d.filter(v),
|
|
2521
|
+
iconOnly: _
|
|
2485
2522
|
};
|
|
2486
2523
|
}
|
|
2487
2524
|
function Q(e) {
|
|
2488
2525
|
return e.kind === "action" ? `action:${e.code}` : `group:${e.name ? C(e.name) : ""}`;
|
|
2489
2526
|
}
|
|
2490
|
-
function
|
|
2491
|
-
let
|
|
2492
|
-
|
|
2527
|
+
function Ir(e) {
|
|
2528
|
+
let t = e.parentElement;
|
|
2529
|
+
for (; t && getComputedStyle(t).display === "contents";) t = t.parentElement;
|
|
2530
|
+
if (!t) return !1;
|
|
2531
|
+
let n = getComputedStyle(t);
|
|
2532
|
+
return !(parseFloat(n.flexGrow) > 0 || n.display === "block" || n.display === "flow-root" || n.width !== "auto" || n.maxWidth !== "none");
|
|
2533
|
+
}
|
|
2534
|
+
function Lr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedRightWidth: o = 0, measurementOverride: s, ariaLabel: c = "Actions", align: l = "trailing", constrain: u = !0, row: d, widgetContext: f, onActionClick: p }) {
|
|
2535
|
+
let m = J(null), h = J(null), [g, v] = Y(0), [y, b] = Y(/* @__PURE__ */ new Map()), [x, S] = Y(!1), [w, T] = Y(null), [E, D] = Y(() => typeof document < "u" && document.documentElement.dir === "rtl");
|
|
2536
|
+
K(() => {
|
|
2493
2537
|
if (typeof MutationObserver > "u") return;
|
|
2494
2538
|
let e = new MutationObserver((e) => {
|
|
2495
|
-
for (let t of e) t.attributeName === "dir" &&
|
|
2539
|
+
for (let t of e) t.attributeName === "dir" && D(document.documentElement.dir === "rtl"), t.attributeName === "lang" && S(!1);
|
|
2496
2540
|
});
|
|
2497
2541
|
return e.observe(document.documentElement, {
|
|
2498
2542
|
attributes: !0,
|
|
2499
2543
|
attributeFilter: ["dir", "lang"]
|
|
2500
2544
|
}), () => e.disconnect();
|
|
2501
2545
|
}, []);
|
|
2502
|
-
let
|
|
2503
|
-
if (
|
|
2546
|
+
let O = J(null), [k, A] = Y(!1), j = G((e, t) => (A(!1), a(e, t)), [a]), M = fr(n), N = !!s, P = G(() => {
|
|
2547
|
+
if (N || !h.current) return;
|
|
2504
2548
|
let e = Array.from(h.current.children), t = /* @__PURE__ */ new Map();
|
|
2505
2549
|
e.forEach((e) => {
|
|
2506
2550
|
let n = e.dataset.nodeKey;
|
|
2507
2551
|
n && t.set(n, e.getBoundingClientRect().width || e.offsetWidth);
|
|
2508
|
-
}),
|
|
2509
|
-
}, [
|
|
2552
|
+
}), b(t), S(!0);
|
|
2553
|
+
}, [N]), F = q(() => JSON.stringify(n.map((e) => Q(e))), [n]);
|
|
2510
2554
|
Le(() => {
|
|
2511
|
-
if (
|
|
2512
|
-
|
|
2555
|
+
if (N) {
|
|
2556
|
+
S(!0);
|
|
2513
2557
|
return;
|
|
2514
2558
|
}
|
|
2515
|
-
|
|
2559
|
+
S(!1);
|
|
2516
2560
|
let e = requestAnimationFrame(() => {
|
|
2517
|
-
|
|
2561
|
+
P();
|
|
2518
2562
|
});
|
|
2519
2563
|
return () => cancelAnimationFrame(e);
|
|
2520
2564
|
}, [
|
|
2565
|
+
F,
|
|
2521
2566
|
P,
|
|
2522
|
-
N
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
if (M || b) return;
|
|
2567
|
+
N
|
|
2568
|
+
]), K(() => {
|
|
2569
|
+
if (N || x) return;
|
|
2526
2570
|
let e = setTimeout(() => {
|
|
2527
|
-
|
|
2571
|
+
P(), S(!0);
|
|
2528
2572
|
}, 16);
|
|
2529
2573
|
return () => clearTimeout(e);
|
|
2530
2574
|
}, [
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
]),
|
|
2535
|
-
if (
|
|
2575
|
+
x,
|
|
2576
|
+
P,
|
|
2577
|
+
N
|
|
2578
|
+
]), K(() => {
|
|
2579
|
+
if (N || !u || !x || g === 0) return;
|
|
2536
2580
|
let e = m.current;
|
|
2537
|
-
if (!e) return;
|
|
2581
|
+
if (!e || !Ir(e)) return;
|
|
2538
2582
|
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;
|
|
2539
2583
|
r > 0 && Math.abs(g - r) < 1 && console.error(`[declarion] ResponsiveActionBar is measuring itself: its container is ${Math.round(g)}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.`);
|
|
2540
2584
|
}, [
|
|
2541
|
-
|
|
2585
|
+
N,
|
|
2542
2586
|
u,
|
|
2543
|
-
|
|
2587
|
+
x,
|
|
2544
2588
|
g,
|
|
2545
|
-
|
|
2546
|
-
]),
|
|
2547
|
-
if (
|
|
2589
|
+
y
|
|
2590
|
+
]), K(() => {
|
|
2591
|
+
if (N) return;
|
|
2548
2592
|
let e = m.current;
|
|
2549
2593
|
if (!e) return;
|
|
2550
2594
|
if (typeof ResizeObserver > "u") {
|
|
2551
|
-
|
|
2595
|
+
v(e.getBoundingClientRect().width);
|
|
2552
2596
|
return;
|
|
2553
2597
|
}
|
|
2554
2598
|
let t = new ResizeObserver((e) => {
|
|
2555
2599
|
let t = e[0];
|
|
2556
|
-
t &&
|
|
2600
|
+
t && v(t.contentRect.width);
|
|
2557
2601
|
});
|
|
2558
|
-
return t.observe(e),
|
|
2559
|
-
}, [
|
|
2560
|
-
let
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
}, [
|
|
2564
|
-
let
|
|
2602
|
+
return t.observe(e), v(e.getBoundingClientRect().width), () => t.disconnect();
|
|
2603
|
+
}, [N]);
|
|
2604
|
+
let I = J(void 0);
|
|
2605
|
+
K(() => {
|
|
2606
|
+
I.current = void 0;
|
|
2607
|
+
}, [F]);
|
|
2608
|
+
let L = q(() => N || !u ? Fr(n, 2 ** 53 - 1, o, y, r, i, s) : x ? g === 0 ? Fr(n, 2 ** 53 - 1, o, y, r, i, s) : Fr(n, g, o, y, r, i, s, I.current) : {
|
|
2565
2609
|
primaryInline: [],
|
|
2566
2610
|
inline: [],
|
|
2567
2611
|
overflow: [],
|
|
2568
|
-
destructiveInline: []
|
|
2612
|
+
destructiveInline: [],
|
|
2613
|
+
iconOnly: /* @__PURE__ */ new Set()
|
|
2569
2614
|
}, [
|
|
2570
|
-
|
|
2615
|
+
N,
|
|
2571
2616
|
u,
|
|
2572
|
-
|
|
2617
|
+
x,
|
|
2573
2618
|
g,
|
|
2574
2619
|
n,
|
|
2575
2620
|
o,
|
|
2576
|
-
|
|
2621
|
+
y,
|
|
2577
2622
|
r,
|
|
2578
2623
|
i,
|
|
2579
2624
|
s
|
|
2580
2625
|
]);
|
|
2581
|
-
if (
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2626
|
+
if (K(() => {
|
|
2627
|
+
!x && !N || (I.current = new Set([
|
|
2628
|
+
...L.primaryInline,
|
|
2629
|
+
...L.inline,
|
|
2630
|
+
...L.destructiveInline
|
|
2631
|
+
].map(Q)));
|
|
2632
|
+
}, [
|
|
2633
|
+
L,
|
|
2634
|
+
x,
|
|
2635
|
+
N
|
|
2636
|
+
]), M === 0) return null;
|
|
2637
|
+
let R = L.overflow.length > 0, { normal: z, destructive: ee } = pr(L.overflow, r, i);
|
|
2585
2638
|
return /* @__PURE__ */ Z("div", {
|
|
2586
2639
|
ref: m,
|
|
2587
2640
|
role: "toolbar",
|
|
2588
2641
|
"aria-label": c,
|
|
2589
2642
|
style: {
|
|
2590
2643
|
display: "flex",
|
|
2591
|
-
flexDirection:
|
|
2644
|
+
flexDirection: E ? "row-reverse" : "row",
|
|
2592
2645
|
alignItems: "center",
|
|
2593
|
-
gap:
|
|
2594
|
-
|
|
2646
|
+
gap: Or,
|
|
2647
|
+
flexWrap: "wrap",
|
|
2648
|
+
visibility: x || N ? "visible" : "hidden",
|
|
2595
2649
|
position: "relative",
|
|
2596
2650
|
flex: u ? "1 1 auto" : "0 1 auto",
|
|
2597
2651
|
justifyContent: l === "trailing" ? "flex-end" : "flex-start",
|
|
@@ -2611,29 +2665,34 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2611
2665
|
top: 0,
|
|
2612
2666
|
left: 0
|
|
2613
2667
|
},
|
|
2614
|
-
children: [/* @__PURE__ */ X(
|
|
2615
|
-
"data-node-key":
|
|
2668
|
+
children: [/* @__PURE__ */ X(W, {
|
|
2669
|
+
"data-node-key": Er,
|
|
2616
2670
|
iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
|
|
2617
2671
|
tabIndex: -1,
|
|
2618
2672
|
children: "Actions"
|
|
2619
|
-
},
|
|
2673
|
+
}, Er), n.map((n) => {
|
|
2620
2674
|
let a = Q(n);
|
|
2621
2675
|
if (n.kind === "action") {
|
|
2622
|
-
let e =
|
|
2623
|
-
|
|
2676
|
+
let e = hr(n.code, r, i), o = gr(n.code, r, i), s = _r(n.code, r, i), c = s ? /* @__PURE__ */ X(t, {
|
|
2677
|
+
name: s,
|
|
2678
|
+
size: 12
|
|
2679
|
+
}) : null;
|
|
2680
|
+
return /* @__PURE__ */ Z(Ne, { children: [/* @__PURE__ */ X(W, {
|
|
2624
2681
|
"data-node-key": a,
|
|
2625
|
-
icon:
|
|
2626
|
-
name: s,
|
|
2627
|
-
size: 12
|
|
2628
|
-
}) : null,
|
|
2682
|
+
icon: c,
|
|
2629
2683
|
danger: e?.destructive,
|
|
2630
2684
|
tabIndex: -1,
|
|
2631
2685
|
children: o
|
|
2632
|
-
},
|
|
2686
|
+
}), c && /* @__PURE__ */ X(W, {
|
|
2687
|
+
"data-node-key": Ar(n),
|
|
2688
|
+
icon: c,
|
|
2689
|
+
danger: e?.destructive,
|
|
2690
|
+
tabIndex: -1
|
|
2691
|
+
})] }, a);
|
|
2633
2692
|
}
|
|
2634
2693
|
{
|
|
2635
2694
|
let t = n.name ? C(n.name) : "Actions";
|
|
2636
|
-
return /* @__PURE__ */ X(
|
|
2695
|
+
return /* @__PURE__ */ X(W, {
|
|
2637
2696
|
"data-node-key": a,
|
|
2638
2697
|
iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
|
|
2639
2698
|
tabIndex: -1,
|
|
@@ -2642,96 +2701,103 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2642
2701
|
}
|
|
2643
2702
|
})]
|
|
2644
2703
|
}),
|
|
2645
|
-
|
|
2704
|
+
L.primaryInline.map((e) => /* @__PURE__ */ X(yr, {
|
|
2646
2705
|
leaf: e,
|
|
2647
2706
|
entityActions: r,
|
|
2648
2707
|
globalActions: i,
|
|
2649
2708
|
onRun: a,
|
|
2650
|
-
loading:
|
|
2651
|
-
onLoadingChange: (t) =>
|
|
2709
|
+
loading: w === e.code,
|
|
2710
|
+
onLoadingChange: (t) => T(t ? e.code : null),
|
|
2652
2711
|
row: d,
|
|
2653
2712
|
widgetContext: f,
|
|
2654
|
-
onActionClick: p
|
|
2713
|
+
onActionClick: p,
|
|
2714
|
+
iconOnly: L.iconOnly.has(Q(e))
|
|
2655
2715
|
}, Q(e))),
|
|
2656
|
-
|
|
2716
|
+
L.inline.map((e) => {
|
|
2657
2717
|
let t = Q(e);
|
|
2658
|
-
return e.kind === "action" ? /* @__PURE__ */ X(
|
|
2718
|
+
return e.kind === "action" ? /* @__PURE__ */ X(yr, {
|
|
2659
2719
|
leaf: e,
|
|
2660
2720
|
entityActions: r,
|
|
2661
2721
|
globalActions: i,
|
|
2662
2722
|
onRun: a,
|
|
2663
|
-
loading:
|
|
2664
|
-
onLoadingChange: (t) =>
|
|
2723
|
+
loading: w === e.code,
|
|
2724
|
+
onLoadingChange: (t) => T(t ? e.code : null),
|
|
2665
2725
|
row: d,
|
|
2666
2726
|
widgetContext: f,
|
|
2667
|
-
onActionClick: p
|
|
2668
|
-
|
|
2727
|
+
onActionClick: p,
|
|
2728
|
+
iconOnly: L.iconOnly.has(t)
|
|
2729
|
+
}, t) : /* @__PURE__ */ X(br, {
|
|
2669
2730
|
group: e,
|
|
2670
2731
|
entityActions: r,
|
|
2671
2732
|
globalActions: i,
|
|
2672
2733
|
onRun: a,
|
|
2673
|
-
loading:
|
|
2674
|
-
onLoadingChange:
|
|
2734
|
+
loading: w,
|
|
2735
|
+
onLoadingChange: T,
|
|
2675
2736
|
row: d,
|
|
2676
2737
|
widgetContext: f,
|
|
2677
2738
|
onActionClick: p
|
|
2678
2739
|
}, t);
|
|
2679
2740
|
}),
|
|
2680
|
-
|
|
2681
|
-
ref:
|
|
2741
|
+
R && /* @__PURE__ */ Z(We, { children: [/* @__PURE__ */ X(W, {
|
|
2742
|
+
ref: O,
|
|
2682
2743
|
kind: "default",
|
|
2683
2744
|
iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
|
|
2684
2745
|
"aria-haspopup": "menu",
|
|
2685
|
-
"aria-expanded":
|
|
2686
|
-
onClick: () =>
|
|
2746
|
+
"aria-expanded": k ? "true" : "false",
|
|
2747
|
+
onClick: () => A((e) => !e),
|
|
2687
2748
|
children: "Actions"
|
|
2688
|
-
}), /* @__PURE__ */ X(
|
|
2689
|
-
open:
|
|
2690
|
-
anchor:
|
|
2691
|
-
onClose: () =>
|
|
2692
|
-
align:
|
|
2749
|
+
}), /* @__PURE__ */ X(H, {
|
|
2750
|
+
open: k,
|
|
2751
|
+
anchor: O.current,
|
|
2752
|
+
onClose: () => A(!1),
|
|
2753
|
+
align: E ? "start" : "end",
|
|
2693
2754
|
width: 220,
|
|
2694
2755
|
children: /* @__PURE__ */ X("div", {
|
|
2695
2756
|
role: "menu",
|
|
2696
2757
|
"aria-label": "More actions",
|
|
2697
|
-
children:
|
|
2758
|
+
children: [
|
|
2759
|
+
...z,
|
|
2760
|
+
...ee.length > 0 ? [null] : [],
|
|
2761
|
+
...ee
|
|
2762
|
+
].map((e, t) => e === null ? /* @__PURE__ */ X(_, { divider: !0 }, "destructive-divider") : e.kind === "action" ? /* @__PURE__ */ X(xr, {
|
|
2698
2763
|
leaf: e,
|
|
2699
2764
|
entityActions: r,
|
|
2700
2765
|
globalActions: i,
|
|
2701
|
-
onRun:
|
|
2702
|
-
loading:
|
|
2703
|
-
onLoadingChange: (t) =>
|
|
2766
|
+
onRun: j,
|
|
2767
|
+
loading: w === e.code,
|
|
2768
|
+
onLoadingChange: (t) => T(t ? e.code : null),
|
|
2704
2769
|
row: d,
|
|
2705
2770
|
widgetContext: f,
|
|
2706
2771
|
onActionClick: p
|
|
2707
|
-
}, e.code) : /* @__PURE__ */ X(
|
|
2772
|
+
}, e.code) : /* @__PURE__ */ X(Sr, {
|
|
2708
2773
|
group: e,
|
|
2709
2774
|
entityActions: r,
|
|
2710
2775
|
globalActions: i,
|
|
2711
|
-
onRun:
|
|
2712
|
-
loading:
|
|
2713
|
-
onLoadingChange:
|
|
2776
|
+
onRun: j,
|
|
2777
|
+
loading: w,
|
|
2778
|
+
onLoadingChange: T,
|
|
2714
2779
|
row: d,
|
|
2715
2780
|
widgetContext: f,
|
|
2716
2781
|
onActionClick: p
|
|
2717
|
-
}, Q(e)))
|
|
2782
|
+
}, `${Q(e)}-${t}`))
|
|
2718
2783
|
})
|
|
2719
2784
|
})] }),
|
|
2720
|
-
|
|
2785
|
+
L.destructiveInline.map((e) => /* @__PURE__ */ X(yr, {
|
|
2721
2786
|
leaf: e,
|
|
2722
2787
|
entityActions: r,
|
|
2723
2788
|
globalActions: i,
|
|
2724
2789
|
onRun: a,
|
|
2725
|
-
loading:
|
|
2726
|
-
onLoadingChange: (t) =>
|
|
2790
|
+
loading: w === e.code,
|
|
2791
|
+
onLoadingChange: (t) => T(t ? e.code : null),
|
|
2727
2792
|
row: d,
|
|
2728
2793
|
widgetContext: f,
|
|
2729
|
-
onActionClick: p
|
|
2794
|
+
onActionClick: p,
|
|
2795
|
+
iconOnly: L.iconOnly.has(Q(e))
|
|
2730
2796
|
}, Q(e)))
|
|
2731
2797
|
]
|
|
2732
2798
|
});
|
|
2733
2799
|
}
|
|
2734
|
-
function
|
|
2800
|
+
function Rr({ layout: e, rowSelection: t = [], ...n }) {
|
|
2735
2801
|
let r = t.length > 0;
|
|
2736
2802
|
return /* @__PURE__ */ Z("div", {
|
|
2737
2803
|
style: {
|
|
@@ -2747,7 +2813,7 @@ function Ar({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
2747
2813
|
flex: "1 1 auto",
|
|
2748
2814
|
minWidth: 0
|
|
2749
2815
|
},
|
|
2750
|
-
children: /* @__PURE__ */ X(
|
|
2816
|
+
children: /* @__PURE__ */ X(Lr, {
|
|
2751
2817
|
layout: e,
|
|
2752
2818
|
rowSelection: [],
|
|
2753
2819
|
...n
|
|
@@ -2759,7 +2825,7 @@ function Ar({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
2759
2825
|
flex: "1 1 auto",
|
|
2760
2826
|
minWidth: 0
|
|
2761
2827
|
},
|
|
2762
|
-
children: /* @__PURE__ */ X(
|
|
2828
|
+
children: /* @__PURE__ */ X(Lr, {
|
|
2763
2829
|
layout: e,
|
|
2764
2830
|
rowSelection: t,
|
|
2765
2831
|
...n
|
|
@@ -2767,9 +2833,9 @@ function Ar({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
2767
2833
|
})]
|
|
2768
2834
|
});
|
|
2769
2835
|
}
|
|
2770
|
-
function
|
|
2771
|
-
let m =
|
|
2772
|
-
return a === "row" ? /* @__PURE__ */ X(
|
|
2836
|
+
function zr({ 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 = "Actions", widgetContext: f, onActionClick: p }) {
|
|
2837
|
+
let m = fr(e);
|
|
2838
|
+
return a === "row" ? /* @__PURE__ */ X(Cr, {
|
|
2773
2839
|
layout: e,
|
|
2774
2840
|
entityActions: l,
|
|
2775
2841
|
globalActions: u,
|
|
@@ -2777,7 +2843,7 @@ function jr({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
2777
2843
|
row: t,
|
|
2778
2844
|
widgetContext: f,
|
|
2779
2845
|
onActionClick: p
|
|
2780
|
-
}) : m === 0 ? null : X(a === "toolbar" ?
|
|
2846
|
+
}) : m === 0 ? null : X(a === "toolbar" ? Rr : Lr, {
|
|
2781
2847
|
layout: e,
|
|
2782
2848
|
row: t,
|
|
2783
2849
|
rowSelection: n,
|
|
@@ -2795,94 +2861,94 @@ function jr({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
2795
2861
|
}
|
|
2796
2862
|
//#endregion
|
|
2797
2863
|
//#region src/lib/filter-evaluator.ts
|
|
2798
|
-
var
|
|
2864
|
+
var Br = /* @__PURE__ */ new Set([
|
|
2799
2865
|
"string",
|
|
2800
2866
|
"text",
|
|
2801
2867
|
"rich_text",
|
|
2802
2868
|
"email",
|
|
2803
2869
|
"url",
|
|
2804
2870
|
"phone"
|
|
2805
|
-
]),
|
|
2871
|
+
]), Vr = /* @__PURE__ */ new Set([
|
|
2806
2872
|
"int",
|
|
2807
2873
|
"float",
|
|
2808
2874
|
"decimal"
|
|
2809
|
-
]),
|
|
2875
|
+
]), Hr = /* @__PURE__ */ new Set([
|
|
2810
2876
|
"date",
|
|
2811
2877
|
"timestamp",
|
|
2812
2878
|
"time"
|
|
2813
|
-
]),
|
|
2814
|
-
string:
|
|
2815
|
-
text:
|
|
2816
|
-
rich_text:
|
|
2817
|
-
email:
|
|
2818
|
-
url:
|
|
2819
|
-
phone:
|
|
2820
|
-
enum:
|
|
2821
|
-
int:
|
|
2822
|
-
float:
|
|
2823
|
-
decimal:
|
|
2824
|
-
date:
|
|
2825
|
-
timestamp:
|
|
2826
|
-
time:
|
|
2879
|
+
]), Ur = /^(?:eq|not_eq|contains|starts_with|is_empty|is_not_empty)$/, Wr = /^(?:eq|not_eq|in|not_in|is_empty|is_not_empty)$/, Gr = /^(?:eq|not_eq|gt|gte|lt|lte|between|is_empty|is_not_empty)$/, Kr = {
|
|
2880
|
+
string: Ur,
|
|
2881
|
+
text: Ur,
|
|
2882
|
+
rich_text: Ur,
|
|
2883
|
+
email: Ur,
|
|
2884
|
+
url: Ur,
|
|
2885
|
+
phone: Ur,
|
|
2886
|
+
enum: Wr,
|
|
2887
|
+
int: Gr,
|
|
2888
|
+
float: Gr,
|
|
2889
|
+
decimal: Gr,
|
|
2890
|
+
date: Gr,
|
|
2891
|
+
timestamp: Gr,
|
|
2892
|
+
time: Gr,
|
|
2827
2893
|
bool: /^(?:eq|is_empty)$/,
|
|
2828
2894
|
ref: /^(?:eq|not_eq|is_empty|is_not_empty)$/,
|
|
2829
2895
|
uuid: /^(?:eq|not_eq|is_empty|is_not_empty)$/
|
|
2830
2896
|
};
|
|
2831
|
-
function
|
|
2832
|
-
return e.every((e) =>
|
|
2897
|
+
function qr(e, t, n) {
|
|
2898
|
+
return e.every((e) => Jr(e, t, n));
|
|
2833
2899
|
}
|
|
2834
|
-
function
|
|
2835
|
-
if (e.and) return e.and.every((e) =>
|
|
2836
|
-
if (e.or) return e.or.some((e) =>
|
|
2900
|
+
function Jr(e, t, n) {
|
|
2901
|
+
if (e.and) return e.and.every((e) => Jr(e, t, n));
|
|
2902
|
+
if (e.or) return e.or.some((e) => Jr(e, t, n));
|
|
2837
2903
|
if (!e.field || !e.op) return !1;
|
|
2838
2904
|
let r = t[e.field];
|
|
2839
|
-
return !r || !
|
|
2905
|
+
return !r || !Kr[r.type]?.test(e.op) ? !1 : Yr(e, r.type, n[e.field]);
|
|
2840
2906
|
}
|
|
2841
|
-
function
|
|
2842
|
-
let r =
|
|
2907
|
+
function Yr(e, t, n) {
|
|
2908
|
+
let r = Xr(n);
|
|
2843
2909
|
if (e.op === "is_empty") return r;
|
|
2844
2910
|
if (e.op === "is_not_empty") return !r;
|
|
2845
2911
|
if (r) return !1;
|
|
2846
2912
|
let i = e.value;
|
|
2847
2913
|
switch (e.op) {
|
|
2848
|
-
case "eq": return
|
|
2849
|
-
case "not_eq": return !
|
|
2850
|
-
case "in": return Array.isArray(i) && i.some((e) =>
|
|
2851
|
-
case "not_in": return Array.isArray(i) && i.every((e) =>
|
|
2914
|
+
case "eq": return Zr(t, n, i);
|
|
2915
|
+
case "not_eq": return !Zr(t, n, i) && Qr(t, n, i);
|
|
2916
|
+
case "in": return Array.isArray(i) && i.some((e) => Zr(t, n, e));
|
|
2917
|
+
case "not_in": return Array.isArray(i) && i.every((e) => Qr(t, n, e) && !Zr(t, n, e));
|
|
2852
2918
|
case "contains": return typeof n == "string" && typeof i == "string" && n.toLowerCase().includes(i.toLowerCase());
|
|
2853
2919
|
case "starts_with": return typeof n == "string" && typeof i == "string" && n.toLowerCase().startsWith(i.toLowerCase());
|
|
2854
|
-
case "gt": return
|
|
2855
|
-
case "gte": return
|
|
2856
|
-
case "lt": return
|
|
2857
|
-
case "lte": return
|
|
2920
|
+
case "gt": return $r(t, n, i, (e, t) => e > t);
|
|
2921
|
+
case "gte": return $r(t, n, i, (e, t) => e >= t);
|
|
2922
|
+
case "lt": return $r(t, n, i, (e, t) => e < t);
|
|
2923
|
+
case "lte": return $r(t, n, i, (e, t) => e <= t);
|
|
2858
2924
|
case "between": {
|
|
2859
2925
|
if (!Array.isArray(i) || i.length !== 2) return !1;
|
|
2860
|
-
let e =
|
|
2926
|
+
let e = ei(t, n, i[0]), r = ei(t, n, i[1]);
|
|
2861
2927
|
return e === void 0 || r === void 0 ? !1 : e >= 0 && r <= 0;
|
|
2862
2928
|
}
|
|
2863
2929
|
default: return !1;
|
|
2864
2930
|
}
|
|
2865
2931
|
}
|
|
2866
|
-
function
|
|
2932
|
+
function Xr(e) {
|
|
2867
2933
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
2868
2934
|
}
|
|
2869
|
-
function
|
|
2870
|
-
return
|
|
2935
|
+
function Zr(e, t, n) {
|
|
2936
|
+
return Qr(e, t, n) ? Hr.has(e) ? ei(e, t, n) === 0 : t === n : !1;
|
|
2871
2937
|
}
|
|
2872
|
-
function
|
|
2873
|
-
return
|
|
2938
|
+
function Qr(e, t, n) {
|
|
2939
|
+
return ei(e, t, n) !== void 0;
|
|
2874
2940
|
}
|
|
2875
|
-
function
|
|
2876
|
-
let i =
|
|
2941
|
+
function $r(e, t, n, r) {
|
|
2942
|
+
let i = ei(e, t, n);
|
|
2877
2943
|
return i !== void 0 && r(i, 0);
|
|
2878
2944
|
}
|
|
2879
|
-
function
|
|
2880
|
-
if (
|
|
2881
|
-
if (
|
|
2882
|
-
if (
|
|
2945
|
+
function ei(e, t, n) {
|
|
2946
|
+
if (Vr.has(e)) return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) ? void 0 : t === n ? 0 : t < n ? -1 : 1;
|
|
2947
|
+
if (Hr.has(e)) return typeof t != "string" || typeof n != "string" || !ti(e, t) || !ti(e, n) ? void 0 : t === n ? 0 : t < n ? -1 : 1;
|
|
2948
|
+
if (Br.has(e) || e === "enum" || e === "ref" || e === "uuid") return typeof t != "string" || typeof n != "string" ? void 0 : t === n ? 0 : t < n ? -1 : 1;
|
|
2883
2949
|
if (e === "bool") return typeof t != "boolean" || typeof n != "boolean" ? void 0 : t === n ? 0 : t ? 1 : -1;
|
|
2884
2950
|
}
|
|
2885
|
-
function
|
|
2951
|
+
function ti(e, t) {
|
|
2886
2952
|
switch (e) {
|
|
2887
2953
|
case "date": return /^\d{4}-\d{2}-\d{2}$/.test(t);
|
|
2888
2954
|
case "time": return /^\d{2}:\d{2}:\d{2}(?:\.\d+)?$/.test(t);
|
|
@@ -2892,23 +2958,23 @@ function qr(e, t) {
|
|
|
2892
2958
|
}
|
|
2893
2959
|
//#endregion
|
|
2894
2960
|
//#region src/lib/variants.ts
|
|
2895
|
-
function
|
|
2961
|
+
function ni(e, t) {
|
|
2896
2962
|
let n = e.variants;
|
|
2897
2963
|
if (!n || n.length === 0) return;
|
|
2898
2964
|
let r = {};
|
|
2899
2965
|
for (let [t, n] of e.fields) r[t] = n;
|
|
2900
|
-
for (let [e, i] of n) if (e !== "default" && i.when &&
|
|
2966
|
+
for (let [e, i] of n) if (e !== "default" && i.when && qr(i.when, r, t)) return e;
|
|
2901
2967
|
return n.has("default") ? "default" : void 0;
|
|
2902
2968
|
}
|
|
2903
|
-
function
|
|
2969
|
+
function ri(e, t) {
|
|
2904
2970
|
let n = e?.variants;
|
|
2905
2971
|
if (!n || !n.items().some((e) => e.actions !== void 0)) return;
|
|
2906
|
-
let r =
|
|
2972
|
+
let r = ni(e, t), i = n.get("default"), a = (r ? n.get(r)?.actions : void 0) ?? i?.actions ?? [];
|
|
2907
2973
|
return new Set(a);
|
|
2908
2974
|
}
|
|
2909
|
-
function
|
|
2975
|
+
function ii(e, t) {
|
|
2910
2976
|
if (t.length === 0) return;
|
|
2911
|
-
let n = t.map((t) =>
|
|
2977
|
+
let n = t.map((t) => ri(e, t));
|
|
2912
2978
|
if (n.every((e) => e === void 0)) return;
|
|
2913
2979
|
let r = n[0] ?? /* @__PURE__ */ new Set(), i = new Set(r);
|
|
2914
2980
|
for (let e of n.slice(1)) {
|
|
@@ -2920,18 +2986,18 @@ function Xr(e, t) {
|
|
|
2920
2986
|
}
|
|
2921
2987
|
return i;
|
|
2922
2988
|
}
|
|
2923
|
-
function
|
|
2989
|
+
function ai(e, t, n) {
|
|
2924
2990
|
if (!t.variants || t.variants.length === 0) return;
|
|
2925
2991
|
if (e.variants) {
|
|
2926
|
-
let r =
|
|
2992
|
+
let r = ni(e, n) ?? "default";
|
|
2927
2993
|
return t.variants.has(r) ? r : "default";
|
|
2928
2994
|
}
|
|
2929
2995
|
let r = {};
|
|
2930
2996
|
for (let [t, n] of e.fields) r[t] = n;
|
|
2931
|
-
for (let [e, i] of t.variants) if (e !== "default" && i.when &&
|
|
2997
|
+
for (let [e, i] of t.variants) if (e !== "default" && i.when && qr(i.when, r, n)) return e;
|
|
2932
2998
|
return "default";
|
|
2933
2999
|
}
|
|
2934
|
-
var
|
|
3000
|
+
var oi = [
|
|
2935
3001
|
"items",
|
|
2936
3002
|
"sidebar",
|
|
2937
3003
|
"sidebar_width",
|
|
@@ -2943,35 +3009,35 @@ var Qr = [
|
|
|
2943
3009
|
"card",
|
|
2944
3010
|
"quick_peek"
|
|
2945
3011
|
];
|
|
2946
|
-
function
|
|
3012
|
+
function si(e, t, n) {
|
|
2947
3013
|
if (!e || !t?.variants) return t;
|
|
2948
|
-
let r =
|
|
3014
|
+
let r = ai(e, t, n), i = r ? t.variants.get(r) : void 0;
|
|
2949
3015
|
if (!i) return t;
|
|
2950
3016
|
let a = { ...t };
|
|
2951
|
-
for (let e of
|
|
3017
|
+
for (let e of oi) i[e] !== void 0 && (a[e] = i[e]);
|
|
2952
3018
|
return a;
|
|
2953
3019
|
}
|
|
2954
3020
|
//#endregion
|
|
2955
3021
|
//#region src/components/shared/RowActionsKebab.tsx
|
|
2956
|
-
function
|
|
2957
|
-
let u =
|
|
3022
|
+
function ci({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu: o, divider: s, size: c = 22, align: l = "end" }) {
|
|
3023
|
+
let u = J(null), [d, f] = Y(!1), [p, m] = Y(null), { run: h } = ee(), g = q(() => {
|
|
2958
3024
|
let e = {};
|
|
2959
3025
|
for (let { code: n, action: r } of t) e[n] = r;
|
|
2960
3026
|
return e;
|
|
2961
|
-
}, [t]), v =
|
|
3027
|
+
}, [t]), v = q(() => {
|
|
2962
3028
|
let e = t.map(({ code: e }) => ({
|
|
2963
3029
|
kind: "action",
|
|
2964
3030
|
code: e,
|
|
2965
3031
|
enabled: !0,
|
|
2966
3032
|
reason: null
|
|
2967
3033
|
}));
|
|
2968
|
-
return r ? j(e, g, void 0, r, [],
|
|
3034
|
+
return r ? j(e, g, void 0, r, [], ri(i, r)) : e;
|
|
2969
3035
|
}, [
|
|
2970
3036
|
t,
|
|
2971
3037
|
g,
|
|
2972
3038
|
r,
|
|
2973
3039
|
i
|
|
2974
|
-
]), y =
|
|
3040
|
+
]), y = G((e, t) => {
|
|
2975
3041
|
f(!1);
|
|
2976
3042
|
let i = t.entity ? `${t.entity}.${e}` : e;
|
|
2977
3043
|
return h({
|
|
@@ -2979,7 +3045,7 @@ function ei({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu
|
|
|
2979
3045
|
title: C(t.display?.name) || e,
|
|
2980
3046
|
row: r,
|
|
2981
3047
|
execute: async (e) => {
|
|
2982
|
-
let t = await F(i,
|
|
3048
|
+
let t = await F(i, z(e, n));
|
|
2983
3049
|
return a?.(), t;
|
|
2984
3050
|
}
|
|
2985
3051
|
});
|
|
@@ -2997,13 +3063,13 @@ function ei({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu
|
|
|
2997
3063
|
alignItems: "center",
|
|
2998
3064
|
justifyContent: "flex-end"
|
|
2999
3065
|
},
|
|
3000
|
-
children: [/* @__PURE__ */ X(
|
|
3066
|
+
children: [/* @__PURE__ */ X(V, {
|
|
3001
3067
|
ref: u,
|
|
3002
3068
|
size: c,
|
|
3003
3069
|
icon: /* @__PURE__ */ X(e.more, { size: Math.round(c * .55) }),
|
|
3004
3070
|
onClick: () => f((e) => !e),
|
|
3005
3071
|
title: "Actions"
|
|
3006
|
-
}), /* @__PURE__ */ Z(
|
|
3072
|
+
}), /* @__PURE__ */ Z(H, {
|
|
3007
3073
|
open: d,
|
|
3008
3074
|
anchor: u.current,
|
|
3009
3075
|
onClose: () => f(!1),
|
|
@@ -3012,7 +3078,7 @@ function ei({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu
|
|
|
3012
3078
|
children: [
|
|
3013
3079
|
o,
|
|
3014
3080
|
o && s && v.length > 0 && /* @__PURE__ */ X(_, { divider: !0 }),
|
|
3015
|
-
/* @__PURE__ */ X(
|
|
3081
|
+
/* @__PURE__ */ X(Tr, {
|
|
3016
3082
|
layout: v,
|
|
3017
3083
|
entityActions: g,
|
|
3018
3084
|
onRun: y,
|
|
@@ -3026,7 +3092,7 @@ function ei({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu
|
|
|
3026
3092
|
}
|
|
3027
3093
|
//#endregion
|
|
3028
3094
|
//#region src/components/detail-layout/AssociatedToolbar.tsx
|
|
3029
|
-
function
|
|
3095
|
+
function li({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearchChange: a, filters: o, onFilterChange: s, allEntities: c }) {
|
|
3030
3096
|
let l = n === !0, u = r && r.length > 0;
|
|
3031
3097
|
return !l && !u ? null : /* @__PURE__ */ Z("div", {
|
|
3032
3098
|
style: {
|
|
@@ -3050,7 +3116,7 @@ function ti({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
|
|
|
3050
3116
|
let n = t.fields.get(e);
|
|
3051
3117
|
if (!n) return null;
|
|
3052
3118
|
let r = o[e] ?? "__all__", i = b(n, e, c);
|
|
3053
|
-
if (n.type === "ref" && n.ref?.entity) return /* @__PURE__ */ X(
|
|
3119
|
+
if (n.type === "ref" && n.ref?.entity) return /* @__PURE__ */ X(ui, {
|
|
3054
3120
|
field: n,
|
|
3055
3121
|
label: i,
|
|
3056
3122
|
value: r,
|
|
@@ -3076,8 +3142,8 @@ function ti({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
|
|
|
3076
3142
|
})]
|
|
3077
3143
|
});
|
|
3078
3144
|
}
|
|
3079
|
-
function
|
|
3080
|
-
let i = u(e.ref?.entity), a = e.display?.ref_display_field ?? i?.display?.display_field, o =
|
|
3145
|
+
function ui({ field: e, label: t, value: n, onChange: r }) {
|
|
3146
|
+
let i = u(e.ref?.entity), a = e.display?.ref_display_field ?? i?.display?.display_field, o = q(() => i ? [...i.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [i]), { data: s } = O(e.ref?.entity, {
|
|
3081
3147
|
per_page: 200,
|
|
3082
3148
|
sort: a ? `${a}:asc` : void 0
|
|
3083
3149
|
}), c = s?.data ?? [], l = (e) => {
|
|
@@ -3091,7 +3157,7 @@ function ni({ field: e, label: t, value: n, onChange: r }) {
|
|
|
3091
3157
|
value: "__all__",
|
|
3092
3158
|
label: `All ${t}`
|
|
3093
3159
|
}, ...c.map((e) => {
|
|
3094
|
-
let t = String(e[o]), n = e[
|
|
3160
|
+
let t = String(e[o]), n = e[re];
|
|
3095
3161
|
return {
|
|
3096
3162
|
value: t,
|
|
3097
3163
|
label: typeof n == "string" && n !== "" ? n : a ? l(e[a] ?? t) : t
|
|
@@ -3109,12 +3175,12 @@ function ni({ field: e, label: t, value: n, onChange: r }) {
|
|
|
3109
3175
|
}
|
|
3110
3176
|
//#endregion
|
|
3111
3177
|
//#region src/lib/action-dispatch.ts
|
|
3112
|
-
function
|
|
3113
|
-
return L(t) ? (
|
|
3178
|
+
function di(e, t, n, r) {
|
|
3179
|
+
return L(t) ? (ce(t.ui_steps, n), null) : t.entity ? `${t.entity}.${e}` : r ? `${r}.${e}` : e;
|
|
3114
3180
|
}
|
|
3115
3181
|
//#endregion
|
|
3116
3182
|
//#region src/components/detail-layout/AssociatedBlock.tsx
|
|
3117
|
-
function
|
|
3183
|
+
function fi(e) {
|
|
3118
3184
|
if (!e) return [];
|
|
3119
3185
|
let t = [];
|
|
3120
3186
|
for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association || s(n) || t.push({
|
|
@@ -3123,7 +3189,7 @@ function ii(e) {
|
|
|
3123
3189
|
}));
|
|
3124
3190
|
return t;
|
|
3125
3191
|
}
|
|
3126
|
-
function
|
|
3192
|
+
function pi(e, t, n) {
|
|
3127
3193
|
if (!e) return [];
|
|
3128
3194
|
let r = [];
|
|
3129
3195
|
for (let [i, a] of Object.entries(e)) {
|
|
@@ -3149,7 +3215,7 @@ function ai(e, t, n) {
|
|
|
3149
3215
|
}
|
|
3150
3216
|
return r;
|
|
3151
3217
|
}
|
|
3152
|
-
function
|
|
3218
|
+
function mi(e, t, n) {
|
|
3153
3219
|
let r = e[n];
|
|
3154
3220
|
if (!r) return null;
|
|
3155
3221
|
let i = e[t], a = i?.children?.find((e) => e.entity === n);
|
|
@@ -3171,22 +3237,22 @@ function oi(e, t, n) {
|
|
|
3171
3237
|
}
|
|
3172
3238
|
return null;
|
|
3173
3239
|
}
|
|
3174
|
-
function
|
|
3175
|
-
let r = new Set(
|
|
3240
|
+
function hi(e, t, n) {
|
|
3241
|
+
let r = new Set(de(e));
|
|
3176
3242
|
return new Set(t.filter((t) => {
|
|
3177
3243
|
if (t === n || r.has(t)) return !1;
|
|
3178
3244
|
let i = e.fields.get(t);
|
|
3179
3245
|
return !(!i || i.auto || i.primary || i.source);
|
|
3180
3246
|
}));
|
|
3181
3247
|
}
|
|
3182
|
-
function
|
|
3248
|
+
function gi(e, t, n) {
|
|
3183
3249
|
return new Set(t.filter((t) => {
|
|
3184
3250
|
if (t === n) return !1;
|
|
3185
3251
|
let r = e.fields.get(t);
|
|
3186
3252
|
return !(!r || r.auto);
|
|
3187
3253
|
}));
|
|
3188
3254
|
}
|
|
3189
|
-
function
|
|
3255
|
+
function _i(e, t, n, r) {
|
|
3190
3256
|
let i = [];
|
|
3191
3257
|
for (let a of t) {
|
|
3192
3258
|
let t = n.fields.get(a);
|
|
@@ -3196,7 +3262,7 @@ function li(e, t, n, r) {
|
|
|
3196
3262
|
}
|
|
3197
3263
|
return i;
|
|
3198
3264
|
}
|
|
3199
|
-
function
|
|
3265
|
+
function vi({ node: e, ctx: t }) {
|
|
3200
3266
|
let n = e.associated;
|
|
3201
3267
|
if (!n || t.isNew) return null;
|
|
3202
3268
|
let r = t.schema.entities[n];
|
|
@@ -3208,8 +3274,8 @@ function ui({ node: e, ctx: t }) {
|
|
|
3208
3274
|
},
|
|
3209
3275
|
children: ["Entity not found: ", n]
|
|
3210
3276
|
});
|
|
3211
|
-
let i =
|
|
3212
|
-
return i ? /* @__PURE__ */ X(
|
|
3277
|
+
let i = mi(t.schema.entities, t.entityCode, n);
|
|
3278
|
+
return i ? /* @__PURE__ */ X(yi, {
|
|
3213
3279
|
node: e,
|
|
3214
3280
|
ctx: t,
|
|
3215
3281
|
assocCode: n,
|
|
@@ -3229,23 +3295,23 @@ function ui({ node: e, ctx: t }) {
|
|
|
3229
3295
|
]
|
|
3230
3296
|
});
|
|
3231
3297
|
}
|
|
3232
|
-
function
|
|
3298
|
+
function yi({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
3233
3299
|
let c = r.columns && r.columns.length > 0 ? r.columns.filter((e) => e !== s && !!o.fields.get(e)) : o.fields.names().filter((e) => {
|
|
3234
3300
|
if (e === s) return !1;
|
|
3235
3301
|
let t = o.fields.get(e);
|
|
3236
3302
|
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
3237
|
-
}), l = P(o, "update"), u = r.interaction ?? (l ? "navigate" : "readonly"), d = (u === "inline_edit" || u === "row_edit") && l && r.editable !== !1, f = C(o.display?.name_plural) || C(o.display?.name) || a, p = r.searchable === !0 || r.filters && r.filters.length > 0, m =
|
|
3303
|
+
}), l = P(o, "update"), u = r.interaction ?? (l ? "navigate" : "readonly"), d = (u === "inline_edit" || u === "row_edit") && l && r.editable !== !1, f = C(o.display?.name_plural) || C(o.display?.name) || a, p = r.searchable === !0 || r.filters && r.filters.length > 0, m = q(() => pi(o.actions, s, i.recordId), [
|
|
3238
3304
|
o.actions,
|
|
3239
3305
|
s,
|
|
3240
3306
|
i.recordId
|
|
3241
|
-
]), h =
|
|
3307
|
+
]), h = q(() => {
|
|
3242
3308
|
let e = {};
|
|
3243
3309
|
for (let { code: t, action: n } of m) e[t] = n;
|
|
3244
3310
|
return e;
|
|
3245
|
-
}, [m]), g =
|
|
3311
|
+
}, [m]), g = q(() => {
|
|
3246
3312
|
let e = o.action_layout ?? null;
|
|
3247
|
-
return j(e ??
|
|
3248
|
-
}, [o.action_layout, h]), { run: _ } =
|
|
3313
|
+
return j(e ?? le(h, "list_toolbar"), h, void 0, {}, []);
|
|
3314
|
+
}, [o.action_layout, h]), { run: _ } = ee(), v = Vt(), y = n(), b = q(() => ({
|
|
3249
3315
|
entity: o,
|
|
3250
3316
|
entityCode: a,
|
|
3251
3317
|
screenRoute: typeof window < "u" ? window.location.pathname : "",
|
|
@@ -3263,18 +3329,18 @@ function di({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3263
3329
|
a,
|
|
3264
3330
|
y,
|
|
3265
3331
|
v
|
|
3266
|
-
]), x = Ue(), S =
|
|
3332
|
+
]), x = Ue(), S = G(() => {
|
|
3267
3333
|
x.invalidateQueries({ predicate: (e) => {
|
|
3268
3334
|
let t = e.queryKey;
|
|
3269
3335
|
return t[0] === "entity-children" && t[3] === a;
|
|
3270
3336
|
} });
|
|
3271
|
-
}, [x, a]), w =
|
|
3272
|
-
let n =
|
|
3337
|
+
}, [x, a]), w = G((e, t) => {
|
|
3338
|
+
let n = di(e, t, {}, a);
|
|
3273
3339
|
if (n !== null) return _({
|
|
3274
3340
|
action: t,
|
|
3275
3341
|
title: C(t.display?.name) || e,
|
|
3276
3342
|
execute: async (e) => {
|
|
3277
|
-
let t = await F(n,
|
|
3343
|
+
let t = await F(n, z(e, void 0));
|
|
3278
3344
|
return S(), t;
|
|
3279
3345
|
}
|
|
3280
3346
|
});
|
|
@@ -3282,7 +3348,7 @@ function di({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3282
3348
|
_,
|
|
3283
3349
|
a,
|
|
3284
3350
|
S
|
|
3285
|
-
]), [T, E] =
|
|
3351
|
+
]), [T, E] = Y(0), D = /* @__PURE__ */ Z("div", {
|
|
3286
3352
|
style: {
|
|
3287
3353
|
display: "flex",
|
|
3288
3354
|
alignItems: "center",
|
|
@@ -3291,28 +3357,28 @@ function di({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3291
3357
|
minWidth: 0,
|
|
3292
3358
|
justifyContent: "flex-end"
|
|
3293
3359
|
},
|
|
3294
|
-
children: [o.action_layout ? g.length > 0 && /* @__PURE__ */ X(
|
|
3360
|
+
children: [o.action_layout ? g.length > 0 && /* @__PURE__ */ X(zr, {
|
|
3295
3361
|
kind: "toolbar",
|
|
3296
3362
|
layout: g,
|
|
3297
3363
|
entityActions: h,
|
|
3298
3364
|
onRun: w,
|
|
3299
3365
|
widgetContext: b,
|
|
3300
3366
|
ariaLabel: `${f} toolbar actions`
|
|
3301
|
-
}) : m.map(({ code: e, action: t }) => /* @__PURE__ */ X(
|
|
3367
|
+
}) : m.map(({ code: e, action: t }) => /* @__PURE__ */ X(cr, {
|
|
3302
3368
|
actionCode: e,
|
|
3303
3369
|
action: t,
|
|
3304
3370
|
entityCode: a,
|
|
3305
3371
|
variant: "ghost",
|
|
3306
3372
|
size: "sm",
|
|
3307
3373
|
onSuccess: S
|
|
3308
|
-
}, e)), d && /* @__PURE__ */ X(
|
|
3374
|
+
}, e)), d && /* @__PURE__ */ X(W, {
|
|
3309
3375
|
kind: "ghost",
|
|
3310
3376
|
size: "xs",
|
|
3311
3377
|
icon: /* @__PURE__ */ X(e.plus, { size: 12 }),
|
|
3312
3378
|
onClick: () => E((e) => e + 1),
|
|
3313
3379
|
children: "Add row"
|
|
3314
3380
|
})]
|
|
3315
|
-
}), O = p ? /* @__PURE__ */ X(
|
|
3381
|
+
}), O = p ? /* @__PURE__ */ X(xi, {
|
|
3316
3382
|
entityCode: a,
|
|
3317
3383
|
entity: o,
|
|
3318
3384
|
parentEntity: i.entityCode,
|
|
@@ -3326,7 +3392,7 @@ function di({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3326
3392
|
filterFields: r.filters,
|
|
3327
3393
|
sort: r.sort,
|
|
3328
3394
|
startDraftSignal: T
|
|
3329
|
-
}) : /* @__PURE__ */ X(
|
|
3395
|
+
}) : /* @__PURE__ */ X(bi, {
|
|
3330
3396
|
entityCode: a,
|
|
3331
3397
|
entity: o,
|
|
3332
3398
|
parentEntity: i.entityCode,
|
|
@@ -3346,7 +3412,7 @@ function di({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3346
3412
|
marginBottom: 8
|
|
3347
3413
|
},
|
|
3348
3414
|
children: D
|
|
3349
|
-
}), O] }) : /* @__PURE__ */ X(
|
|
3415
|
+
}), O] }) : /* @__PURE__ */ X(Ye, {
|
|
3350
3416
|
title: f,
|
|
3351
3417
|
icon: o.display?.icon ? /* @__PURE__ */ X(t, {
|
|
3352
3418
|
name: o.display.icon,
|
|
@@ -3356,10 +3422,10 @@ function di({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3356
3422
|
children: O
|
|
3357
3423
|
});
|
|
3358
3424
|
}
|
|
3359
|
-
function
|
|
3360
|
-
let d = Ue(), { data: f, isLoading: p, isError: m } =
|
|
3425
|
+
function bi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, sort: l, startDraftSignal: u }) {
|
|
3426
|
+
let d = Ue(), { data: f, isLoading: p, isError: m } = ir(n, r, e, i, l), h = f?.data ?? [], g = f?.$refs, _ = G(() => {
|
|
3361
3427
|
d.invalidateQueries({ queryKey: [
|
|
3362
|
-
|
|
3428
|
+
rr,
|
|
3363
3429
|
n,
|
|
3364
3430
|
r,
|
|
3365
3431
|
e
|
|
@@ -3370,7 +3436,7 @@ function fi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3370
3436
|
r,
|
|
3371
3437
|
e
|
|
3372
3438
|
]);
|
|
3373
|
-
return /* @__PURE__ */ X(
|
|
3439
|
+
return /* @__PURE__ */ X(Si, {
|
|
3374
3440
|
entityCode: e,
|
|
3375
3441
|
entity: t,
|
|
3376
3442
|
parentId: r,
|
|
@@ -3387,14 +3453,14 @@ function fi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3387
3453
|
startDraftSignal: u
|
|
3388
3454
|
});
|
|
3389
3455
|
}
|
|
3390
|
-
function
|
|
3391
|
-
let p = Ue(), [m, h] =
|
|
3392
|
-
|
|
3456
|
+
function xi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: l, filterFields: u, sort: d, startDraftSignal: f }) {
|
|
3457
|
+
let p = Ue(), [m, h] = Y(""), [g, _] = Y(""), [v, y] = Y({}), b = J(void 0);
|
|
3458
|
+
K(() => (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
3393
3459
|
_(m);
|
|
3394
3460
|
}, 300), () => {
|
|
3395
3461
|
b.current && clearTimeout(b.current);
|
|
3396
3462
|
}), [m]);
|
|
3397
|
-
let x =
|
|
3463
|
+
let x = G((e, t) => {
|
|
3398
3464
|
y((n) => {
|
|
3399
3465
|
if (t === "__all__") {
|
|
3400
3466
|
let { [e]: t, ...r } = n;
|
|
@@ -3405,7 +3471,7 @@ function pi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3405
3471
|
[e]: t
|
|
3406
3472
|
};
|
|
3407
3473
|
});
|
|
3408
|
-
}, []), S =
|
|
3474
|
+
}, []), S = q(() => Object.keys(v).length > 0 ? v : void 0, [v]), { data: C, isLoading: w, isError: T, hasNextPage: E, fetchNextPage: D, isFetchingNextPage: O } = sr(n, r, e, i, d, void 0, g || void 0, S), { rows: k, refs: j } = q(() => {
|
|
3409
3475
|
if (!C?.pages) return {
|
|
3410
3476
|
rows: [],
|
|
3411
3477
|
refs: void 0
|
|
@@ -3422,14 +3488,14 @@ function pi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3422
3488
|
rows: e,
|
|
3423
3489
|
refs: t
|
|
3424
3490
|
};
|
|
3425
|
-
}, [C]), M =
|
|
3491
|
+
}, [C]), M = G(() => {
|
|
3426
3492
|
p.invalidateQueries({ predicate: (t) => {
|
|
3427
3493
|
let n = t.queryKey;
|
|
3428
3494
|
return n[0] === "entity-children" && n[3] === e;
|
|
3429
3495
|
} });
|
|
3430
3496
|
}, [p, e]);
|
|
3431
3497
|
return /* @__PURE__ */ Z("div", { children: [
|
|
3432
|
-
/* @__PURE__ */ X(
|
|
3498
|
+
/* @__PURE__ */ X(li, {
|
|
3433
3499
|
entity: t,
|
|
3434
3500
|
searchable: l,
|
|
3435
3501
|
filterFields: u,
|
|
@@ -3439,7 +3505,7 @@ function pi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3439
3505
|
onFilterChange: x,
|
|
3440
3506
|
allEntities: c.schema.entities
|
|
3441
3507
|
}),
|
|
3442
|
-
/* @__PURE__ */ X(
|
|
3508
|
+
/* @__PURE__ */ X(Si, {
|
|
3443
3509
|
entityCode: e,
|
|
3444
3510
|
entity: t,
|
|
3445
3511
|
parentId: r,
|
|
@@ -3457,7 +3523,7 @@ function pi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3457
3523
|
}),
|
|
3458
3524
|
E && /* @__PURE__ */ X("div", {
|
|
3459
3525
|
style: { marginTop: 4 },
|
|
3460
|
-
children: /* @__PURE__ */ X(
|
|
3526
|
+
children: /* @__PURE__ */ X(W, {
|
|
3461
3527
|
kind: "ghost",
|
|
3462
3528
|
size: "xs",
|
|
3463
3529
|
icon: O ? /* @__PURE__ */ X(A, { size: 12 }) : void 0,
|
|
@@ -3468,44 +3534,44 @@ function pi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3468
3534
|
})
|
|
3469
3535
|
] });
|
|
3470
3536
|
}
|
|
3471
|
-
function
|
|
3472
|
-
let m = se(), h = m.isPhone && s.relatedRecordsPresentation === "table", g = i.find((e) => e !== r), _ =
|
|
3537
|
+
function Si({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: a, interaction: o, ctx: s, rows: c, refs: l, isLoading: u, isError: d, invalidateQuery: f, startDraftSignal: p }) {
|
|
3538
|
+
let m = se(), h = m.isPhone && s.relatedRecordsPresentation === "table", g = i.find((e) => e !== r), _ = q(() => o === "navigate" ? te(void 0, t, s.schema.screens) : null, [
|
|
3473
3539
|
o,
|
|
3474
3540
|
t,
|
|
3475
3541
|
s.schema.screens
|
|
3476
|
-
]), v =
|
|
3542
|
+
]), v = q(() => a ? hi(t, i, r) : /* @__PURE__ */ new Set(), [
|
|
3477
3543
|
i,
|
|
3478
3544
|
r,
|
|
3479
3545
|
t,
|
|
3480
3546
|
a
|
|
3481
|
-
]), y =
|
|
3547
|
+
]), y = q(() => gi(t, i, r), [
|
|
3482
3548
|
i,
|
|
3483
3549
|
r,
|
|
3484
3550
|
t
|
|
3485
|
-
]), x =
|
|
3551
|
+
]), x = q(() => {
|
|
3486
3552
|
let e = /* @__PURE__ */ new Map();
|
|
3487
3553
|
for (let n of c) {
|
|
3488
|
-
let r =
|
|
3489
|
-
e.set(
|
|
3554
|
+
let r = pe(t, n);
|
|
3555
|
+
e.set(me(r), r);
|
|
3490
3556
|
}
|
|
3491
3557
|
return e;
|
|
3492
|
-
}, [c, t]), S =
|
|
3558
|
+
}, [c, t]), S = q(() => {
|
|
3493
3559
|
let e = /* @__PURE__ */ new Map();
|
|
3494
3560
|
for (let n of c) {
|
|
3495
3561
|
let r = n.$row_version;
|
|
3496
|
-
typeof r == "string" && r !== "" && e.set(
|
|
3562
|
+
typeof r == "string" && r !== "" && e.set(me(pe(t, n)), r);
|
|
3497
3563
|
}
|
|
3498
3564
|
return e;
|
|
3499
|
-
}, [c, t]), w =
|
|
3565
|
+
}, [c, t]), w = q(() => fi(t.actions), [t.actions]), [T, E] = Y(null), [D, O] = Y(null), [k, A] = Y([]), [j, N] = Y({}), P = J(j);
|
|
3500
3566
|
P.current = j;
|
|
3501
|
-
let F =
|
|
3502
|
-
|
|
3567
|
+
let F = J({});
|
|
3568
|
+
K(() => {
|
|
3503
3569
|
let e = F.current;
|
|
3504
3570
|
return () => {
|
|
3505
3571
|
for (let t of Object.values(e)) clearTimeout(t);
|
|
3506
3572
|
};
|
|
3507
3573
|
}, []);
|
|
3508
|
-
let [I, L] =
|
|
3574
|
+
let [I, L] = Y(null), [R, z] = Y([]), [B, V] = Y(!1), { run: re } = ee(), [H, ie] = Y(/* @__PURE__ */ new Set()), ae = G(async (t, n, r) => {
|
|
3509
3575
|
N((e) => ({
|
|
3510
3576
|
...e,
|
|
3511
3577
|
[t]: {
|
|
@@ -3519,7 +3585,7 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3519
3585
|
...n,
|
|
3520
3586
|
$row_version: i
|
|
3521
3587
|
} : n;
|
|
3522
|
-
return await
|
|
3588
|
+
return await ne(e, x.get(t) ?? t, a), N((e) => {
|
|
3523
3589
|
let n = e[t];
|
|
3524
3590
|
if (!n) return e;
|
|
3525
3591
|
if (n.ver > r) return {
|
|
@@ -3548,7 +3614,7 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3548
3614
|
f,
|
|
3549
3615
|
x,
|
|
3550
3616
|
S
|
|
3551
|
-
]),
|
|
3617
|
+
]), U = G((e, t, n) => {
|
|
3552
3618
|
N((r) => {
|
|
3553
3619
|
let i = r[e] ?? {
|
|
3554
3620
|
buffer: {},
|
|
@@ -3568,44 +3634,44 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3568
3634
|
};
|
|
3569
3635
|
}), o === "inline_edit" && (F.current[e] && clearTimeout(F.current[e]), F.current[e] = setTimeout(() => {
|
|
3570
3636
|
let t = P.current[e];
|
|
3571
|
-
t && Object.keys(t.buffer).length > 0 &&
|
|
3637
|
+
t && Object.keys(t.buffer).length > 0 && ae(e, { ...t.buffer }, t.ver);
|
|
3572
3638
|
}, 500));
|
|
3573
|
-
}, [
|
|
3639
|
+
}, [ae, o]), oe = G(() => {
|
|
3574
3640
|
let e = {};
|
|
3575
3641
|
e[r] = n;
|
|
3576
3642
|
for (let n of i) {
|
|
3577
3643
|
let r = t.fields.get(n);
|
|
3578
3644
|
r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
|
|
3579
3645
|
}
|
|
3580
|
-
L(e),
|
|
3646
|
+
L(e), z([]);
|
|
3581
3647
|
}, [
|
|
3582
3648
|
r,
|
|
3583
3649
|
n,
|
|
3584
3650
|
i,
|
|
3585
3651
|
t.fields
|
|
3586
|
-
]),
|
|
3587
|
-
|
|
3588
|
-
p !== void 0 && p !==
|
|
3652
|
+
]), ce = J(p);
|
|
3653
|
+
K(() => {
|
|
3654
|
+
p !== void 0 && p !== ce.current && (ce.current = p, !I && oe());
|
|
3589
3655
|
}, [
|
|
3590
3656
|
p,
|
|
3591
3657
|
I,
|
|
3592
|
-
|
|
3658
|
+
oe
|
|
3593
3659
|
]);
|
|
3594
|
-
let
|
|
3660
|
+
let W = G(async () => {
|
|
3595
3661
|
if (!I) return;
|
|
3596
|
-
let n =
|
|
3662
|
+
let n = _i(I, i, t, r);
|
|
3597
3663
|
if (n.length > 0) {
|
|
3598
|
-
|
|
3664
|
+
z(n);
|
|
3599
3665
|
return;
|
|
3600
3666
|
}
|
|
3601
|
-
|
|
3667
|
+
V(!0);
|
|
3602
3668
|
try {
|
|
3603
|
-
await M(e, I), L(null),
|
|
3669
|
+
await M(e, I), L(null), z([]), f();
|
|
3604
3670
|
} catch (e) {
|
|
3605
3671
|
let t = e instanceof Error ? e.message : "Create failed";
|
|
3606
|
-
|
|
3672
|
+
z([`_error:${t}`]);
|
|
3607
3673
|
} finally {
|
|
3608
|
-
|
|
3674
|
+
V(!1);
|
|
3609
3675
|
}
|
|
3610
3676
|
}, [
|
|
3611
3677
|
I,
|
|
@@ -3614,49 +3680,49 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3614
3680
|
r,
|
|
3615
3681
|
e,
|
|
3616
3682
|
f
|
|
3617
|
-
]),
|
|
3683
|
+
]), le = G((e) => {
|
|
3618
3684
|
N({}), A([]), O(e);
|
|
3619
|
-
}, []),
|
|
3685
|
+
}, []), de = G(async (e) => {
|
|
3620
3686
|
let n = P.current[e], a = n?.buffer ?? {};
|
|
3621
3687
|
if (Object.keys(a).length === 0) {
|
|
3622
3688
|
O(null), A([]);
|
|
3623
3689
|
return;
|
|
3624
3690
|
}
|
|
3625
|
-
let o =
|
|
3626
|
-
...c.find((n) =>
|
|
3691
|
+
let o = _i({
|
|
3692
|
+
...c.find((n) => me(pe(t, n)) === e) ?? {},
|
|
3627
3693
|
...a
|
|
3628
3694
|
}, i, t, r);
|
|
3629
3695
|
if (o.length > 0) {
|
|
3630
3696
|
A(o);
|
|
3631
3697
|
return;
|
|
3632
3698
|
}
|
|
3633
|
-
await
|
|
3699
|
+
await ae(e, { ...a }, n?.ver ?? 0) && (O(null), A([]));
|
|
3634
3700
|
}, [
|
|
3635
3701
|
c,
|
|
3636
3702
|
t,
|
|
3637
3703
|
i,
|
|
3638
3704
|
r,
|
|
3639
|
-
|
|
3640
|
-
]),
|
|
3705
|
+
ae
|
|
3706
|
+
]), fe = G((e) => {
|
|
3641
3707
|
N((t) => {
|
|
3642
3708
|
if (!t[e]) return t;
|
|
3643
3709
|
let { [e]: n, ...r } = t;
|
|
3644
3710
|
return r;
|
|
3645
3711
|
}), A([]), O(null);
|
|
3646
|
-
}, []),
|
|
3712
|
+
}, []), he = G((n, r) => {
|
|
3647
3713
|
let i = x.get(n) ?? n;
|
|
3648
|
-
return
|
|
3714
|
+
return re({
|
|
3649
3715
|
action: t.actions?.__delete,
|
|
3650
3716
|
destructive: !0,
|
|
3651
3717
|
title: C(t.display?.name) || "Delete",
|
|
3652
3718
|
row: r,
|
|
3653
3719
|
entity: e,
|
|
3654
3720
|
execute: async () => {
|
|
3655
|
-
|
|
3721
|
+
ie((e) => new Set(e).add(n));
|
|
3656
3722
|
try {
|
|
3657
|
-
return await
|
|
3723
|
+
return await ue(e, i);
|
|
3658
3724
|
} finally {
|
|
3659
|
-
|
|
3725
|
+
ie((e) => {
|
|
3660
3726
|
let t = new Set(e);
|
|
3661
3727
|
return t.delete(n), t;
|
|
3662
3728
|
});
|
|
@@ -3665,7 +3731,7 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3665
3731
|
onSuccess: () => f()
|
|
3666
3732
|
});
|
|
3667
3733
|
}, [
|
|
3668
|
-
|
|
3734
|
+
re,
|
|
3669
3735
|
t,
|
|
3670
3736
|
e,
|
|
3671
3737
|
f,
|
|
@@ -3696,23 +3762,23 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3696
3762
|
borderRadius: 6
|
|
3697
3763
|
} })]
|
|
3698
3764
|
});
|
|
3699
|
-
let
|
|
3700
|
-
return m.isPhone && !h ? /* @__PURE__ */ Z("div", { children: [
|
|
3765
|
+
let ge = c.length === 0 && !I;
|
|
3766
|
+
return m.isPhone && !h ? /* @__PURE__ */ Z("div", { children: [ge && !a && /* @__PURE__ */ X("div", {
|
|
3701
3767
|
style: {
|
|
3702
3768
|
fontSize: 12.5,
|
|
3703
3769
|
color: "var(--text-3)",
|
|
3704
3770
|
padding: "12px 0"
|
|
3705
3771
|
},
|
|
3706
3772
|
children: "No records yet."
|
|
3707
|
-
}), (!
|
|
3773
|
+
}), (!ge || a) && /* @__PURE__ */ Z("div", {
|
|
3708
3774
|
style: {
|
|
3709
3775
|
display: "flex",
|
|
3710
3776
|
flexDirection: "column",
|
|
3711
3777
|
gap: 10
|
|
3712
3778
|
},
|
|
3713
3779
|
children: [c.map((n) => {
|
|
3714
|
-
let r =
|
|
3715
|
-
return /* @__PURE__ */ X(
|
|
3780
|
+
let r = me(pe(t, n)), c = H.has(r), u = j[r], d = _ && r ? _.replace(/:\w+/, r) : void 0;
|
|
3781
|
+
return /* @__PURE__ */ X(Ci, {
|
|
3716
3782
|
rowId: r,
|
|
3717
3783
|
row: n,
|
|
3718
3784
|
entity: t,
|
|
@@ -3728,11 +3794,11 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3728
3794
|
activeCell: T,
|
|
3729
3795
|
setActiveCell: E,
|
|
3730
3796
|
rowState: u,
|
|
3731
|
-
onCellChange:
|
|
3732
|
-
onDeleteClick: (e) => void
|
|
3733
|
-
onStartEdit:
|
|
3734
|
-
onConfirmEdit:
|
|
3735
|
-
onCancelEdit:
|
|
3797
|
+
onCellChange: U,
|
|
3798
|
+
onDeleteClick: (e) => void he(e, n),
|
|
3799
|
+
onStartEdit: le,
|
|
3800
|
+
onConfirmEdit: de,
|
|
3801
|
+
onCancelEdit: fe,
|
|
3736
3802
|
refs: l,
|
|
3737
3803
|
identityCol: g,
|
|
3738
3804
|
href: d,
|
|
@@ -3740,40 +3806,40 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3740
3806
|
entityCode: e,
|
|
3741
3807
|
onRowActionSuccess: f
|
|
3742
3808
|
}, r);
|
|
3743
|
-
}), I && /* @__PURE__ */ X(
|
|
3809
|
+
}), I && /* @__PURE__ */ X(Oi, {
|
|
3744
3810
|
draftRow: I,
|
|
3745
3811
|
entity: t,
|
|
3746
3812
|
columns: i,
|
|
3747
3813
|
editableColumns: y,
|
|
3748
3814
|
foreignKey: r,
|
|
3749
|
-
draftErrors:
|
|
3750
|
-
draftSaving:
|
|
3815
|
+
draftErrors: R,
|
|
3816
|
+
draftSaving: B,
|
|
3751
3817
|
onChange: (e, t) => L((n) => n && {
|
|
3752
3818
|
...n,
|
|
3753
3819
|
[e]: t
|
|
3754
3820
|
}),
|
|
3755
|
-
onConfirm:
|
|
3821
|
+
onConfirm: W,
|
|
3756
3822
|
onCancel: () => {
|
|
3757
|
-
L(null),
|
|
3823
|
+
L(null), z([]);
|
|
3758
3824
|
},
|
|
3759
3825
|
refs: l
|
|
3760
3826
|
})]
|
|
3761
|
-
})] }) : /* @__PURE__ */ Z("div", { children: [
|
|
3827
|
+
})] }) : /* @__PURE__ */ Z("div", { children: [ge && !a && /* @__PURE__ */ X("div", {
|
|
3762
3828
|
style: {
|
|
3763
3829
|
fontSize: 12.5,
|
|
3764
3830
|
color: "var(--text-3)",
|
|
3765
3831
|
padding: "12px 0"
|
|
3766
3832
|
},
|
|
3767
3833
|
children: "No records yet."
|
|
3768
|
-
}), (!
|
|
3834
|
+
}), (!ge || a) && /* @__PURE__ */ X("div", {
|
|
3769
3835
|
style: { overflowX: "auto" },
|
|
3770
3836
|
children: /* @__PURE__ */ Z("table", {
|
|
3771
|
-
style:
|
|
3837
|
+
style: Ae,
|
|
3772
3838
|
children: [/* @__PURE__ */ X("thead", { children: /* @__PURE__ */ Z("tr", { children: [
|
|
3773
3839
|
i.map((e) => {
|
|
3774
3840
|
let n = t.fields.get(e);
|
|
3775
3841
|
return /* @__PURE__ */ X("th", {
|
|
3776
|
-
style:
|
|
3842
|
+
style: ke,
|
|
3777
3843
|
children: n ? b(n, e, s.schema.entities) : e
|
|
3778
3844
|
}, e);
|
|
3779
3845
|
}),
|
|
@@ -3786,8 +3852,8 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3786
3852
|
width: 40
|
|
3787
3853
|
} })
|
|
3788
3854
|
] }) }), /* @__PURE__ */ Z("tbody", { children: [c.map((n) => {
|
|
3789
|
-
let r =
|
|
3790
|
-
return /* @__PURE__ */ X(
|
|
3855
|
+
let r = me(pe(t, n)), c = H.has(r), u = j[r], d = _ && r ? _.replace(/:\w+/, r) : void 0;
|
|
3856
|
+
return /* @__PURE__ */ X(wi, {
|
|
3791
3857
|
rowId: r,
|
|
3792
3858
|
row: n,
|
|
3793
3859
|
entity: t,
|
|
@@ -3803,11 +3869,11 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3803
3869
|
activeCell: T,
|
|
3804
3870
|
setActiveCell: E,
|
|
3805
3871
|
rowState: u,
|
|
3806
|
-
onCellChange:
|
|
3807
|
-
onDeleteClick: (e) => void
|
|
3808
|
-
onStartEdit:
|
|
3809
|
-
onConfirmEdit:
|
|
3810
|
-
onCancelEdit:
|
|
3872
|
+
onCellChange: U,
|
|
3873
|
+
onDeleteClick: (e) => void he(e, n),
|
|
3874
|
+
onStartEdit: le,
|
|
3875
|
+
onConfirmEdit: de,
|
|
3876
|
+
onCancelEdit: fe,
|
|
3811
3877
|
refs: l,
|
|
3812
3878
|
identityCol: g,
|
|
3813
3879
|
href: d,
|
|
@@ -3815,35 +3881,35 @@ function mi({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3815
3881
|
entityCode: e,
|
|
3816
3882
|
onRowActionSuccess: f
|
|
3817
3883
|
}, r);
|
|
3818
|
-
}), I && /* @__PURE__ */ X(
|
|
3884
|
+
}), I && /* @__PURE__ */ X(Di, {
|
|
3819
3885
|
draftRow: I,
|
|
3820
3886
|
entity: t,
|
|
3821
3887
|
columns: i,
|
|
3822
3888
|
editableColumns: y,
|
|
3823
3889
|
foreignKey: r,
|
|
3824
|
-
draftErrors:
|
|
3825
|
-
draftSaving:
|
|
3890
|
+
draftErrors: R,
|
|
3891
|
+
draftSaving: B,
|
|
3826
3892
|
onChange: (e, t) => L((n) => n && {
|
|
3827
3893
|
...n,
|
|
3828
3894
|
[e]: t
|
|
3829
3895
|
}),
|
|
3830
|
-
onConfirm:
|
|
3896
|
+
onConfirm: W,
|
|
3831
3897
|
onCancel: () => {
|
|
3832
|
-
L(null),
|
|
3898
|
+
L(null), z([]);
|
|
3833
3899
|
},
|
|
3834
3900
|
refs: l
|
|
3835
3901
|
})] })]
|
|
3836
3902
|
})
|
|
3837
3903
|
})] });
|
|
3838
3904
|
}
|
|
3839
|
-
function
|
|
3840
|
-
let D = n(), O = Ie(), k =
|
|
3905
|
+
function Ci({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: u, isEditing: d, editErrors: f, isDeleting: m, rowState: h, onCellChange: g, onDeleteClick: _, onStartEdit: v, onConfirmEdit: y, onCancelEdit: x, refs: S, identityCol: C, href: w, rowActions: T, onRowActionSuccess: E }) {
|
|
3906
|
+
let D = n(), O = Ie(), k = q(() => !h || Object.keys(h.buffer).length === 0 ? r : {
|
|
3841
3907
|
...r,
|
|
3842
3908
|
...h.buffer
|
|
3843
3909
|
}, [r, h]);
|
|
3844
3910
|
if (u === "row_edit" && d) {
|
|
3845
3911
|
let e = h?.error ? [...f, `_error:${h.error}`] : f;
|
|
3846
|
-
return /* @__PURE__ */ X(
|
|
3912
|
+
return /* @__PURE__ */ X(Ei, {
|
|
3847
3913
|
values: k,
|
|
3848
3914
|
entity: i,
|
|
3849
3915
|
columns: s,
|
|
@@ -3876,7 +3942,7 @@ function hi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3876
3942
|
fontSize: 11.5,
|
|
3877
3943
|
fontWeight: 600,
|
|
3878
3944
|
color: "var(--text-3)"
|
|
3879
|
-
}, _ = n ?
|
|
3945
|
+
}, _ = n ? B({
|
|
3880
3946
|
field: n,
|
|
3881
3947
|
fieldName: e,
|
|
3882
3948
|
value: k[e],
|
|
@@ -3932,7 +3998,7 @@ function hi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3932
3998
|
justifyContent: "flex-end",
|
|
3933
3999
|
gap: 6
|
|
3934
4000
|
},
|
|
3935
|
-
children: [l && /* @__PURE__ */ Z(
|
|
4001
|
+
children: [l && /* @__PURE__ */ Z(We, { children: [
|
|
3936
4002
|
h?.saving && /* @__PURE__ */ X(A, { size: 12 }),
|
|
3937
4003
|
h?.error && /* @__PURE__ */ X("span", {
|
|
3938
4004
|
style: {
|
|
@@ -3942,19 +4008,19 @@ function hi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3942
4008
|
title: h.error,
|
|
3943
4009
|
children: "!"
|
|
3944
4010
|
}),
|
|
3945
|
-
u === "row_edit" && /* @__PURE__ */ X(
|
|
4011
|
+
u === "row_edit" && /* @__PURE__ */ X(V, {
|
|
3946
4012
|
size: 32,
|
|
3947
4013
|
icon: /* @__PURE__ */ X(e.edit, { size: 14 }),
|
|
3948
4014
|
onClick: () => v(t),
|
|
3949
4015
|
title: "Edit row"
|
|
3950
4016
|
}),
|
|
3951
|
-
/* @__PURE__ */ X(
|
|
4017
|
+
/* @__PURE__ */ X(V, {
|
|
3952
4018
|
size: 32,
|
|
3953
4019
|
icon: /* @__PURE__ */ X(e.trash, { size: 14 }),
|
|
3954
4020
|
onClick: () => _(t),
|
|
3955
4021
|
title: "Delete row"
|
|
3956
4022
|
})
|
|
3957
|
-
] }), !l && T && T.length > 0 && /* @__PURE__ */ X(
|
|
4023
|
+
] }), !l && T && T.length > 0 && /* @__PURE__ */ X(ci, {
|
|
3958
4024
|
entity: i,
|
|
3959
4025
|
actions: T,
|
|
3960
4026
|
objectIds: [t],
|
|
@@ -3964,14 +4030,14 @@ function hi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3964
4030
|
})]
|
|
3965
4031
|
});
|
|
3966
4032
|
}
|
|
3967
|
-
function
|
|
3968
|
-
let O = n(), k =
|
|
4033
|
+
function wi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: u, isEditing: d, editErrors: f, isDeleting: m, activeCell: h, setActiveCell: g, rowState: _, onCellChange: v, onDeleteClick: y, onStartEdit: b, onConfirmEdit: x, onCancelEdit: S, refs: C, identityCol: w, href: T, rowActions: E, onRowActionSuccess: D }) {
|
|
4034
|
+
let O = n(), k = q(() => !_ || Object.keys(_.buffer).length === 0 ? r : {
|
|
3969
4035
|
...r,
|
|
3970
4036
|
..._.buffer
|
|
3971
4037
|
}, [r, _]);
|
|
3972
4038
|
if (u === "row_edit" && d) {
|
|
3973
4039
|
let e = _?.error ? [...f, `_error:${_.error}`] : f;
|
|
3974
|
-
return /* @__PURE__ */ X(
|
|
4040
|
+
return /* @__PURE__ */ X(Ti, {
|
|
3975
4041
|
values: k,
|
|
3976
4042
|
entity: i,
|
|
3977
4043
|
columns: s,
|
|
@@ -3984,7 +4050,7 @@ function gi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3984
4050
|
refs: C
|
|
3985
4051
|
});
|
|
3986
4052
|
}
|
|
3987
|
-
let j =
|
|
4053
|
+
let j = je, M = {
|
|
3988
4054
|
padding: "4px 4px",
|
|
3989
4055
|
borderBottom: "1px solid var(--divider)",
|
|
3990
4056
|
verticalAlign: "middle"
|
|
@@ -3996,7 +4062,7 @@ function gi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3996
4062
|
let n = i.fields.get(e), r = c.has(e);
|
|
3997
4063
|
if (N && h?.rowId === t && h?.col === e && r) return /* @__PURE__ */ X("td", {
|
|
3998
4064
|
style: M,
|
|
3999
|
-
children: n ?
|
|
4065
|
+
children: n ? B({
|
|
4000
4066
|
field: n,
|
|
4001
4067
|
fieldName: e,
|
|
4002
4068
|
value: k[e],
|
|
@@ -4008,7 +4074,7 @@ function gi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
4008
4074
|
locale: O
|
|
4009
4075
|
}) : p(k[e])
|
|
4010
4076
|
}, e);
|
|
4011
|
-
let s = T && e === w, l = n ?
|
|
4077
|
+
let s = T && e === w, l = n ? B({
|
|
4012
4078
|
field: n,
|
|
4013
4079
|
fieldName: e,
|
|
4014
4080
|
value: k[e],
|
|
@@ -4064,13 +4130,13 @@ function gi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
4064
4130
|
title: _.error,
|
|
4065
4131
|
children: "!"
|
|
4066
4132
|
}),
|
|
4067
|
-
u === "row_edit" && /* @__PURE__ */ X(
|
|
4133
|
+
u === "row_edit" && /* @__PURE__ */ X(V, {
|
|
4068
4134
|
size: 24,
|
|
4069
4135
|
icon: /* @__PURE__ */ X(e.edit, { size: 12 }),
|
|
4070
4136
|
onClick: () => b(t),
|
|
4071
4137
|
title: "Edit row"
|
|
4072
4138
|
}),
|
|
4073
|
-
/* @__PURE__ */ X(
|
|
4139
|
+
/* @__PURE__ */ X(V, {
|
|
4074
4140
|
size: 24,
|
|
4075
4141
|
icon: /* @__PURE__ */ X(e.trash, { size: 12 }),
|
|
4076
4142
|
onClick: () => y(t),
|
|
@@ -4085,7 +4151,7 @@ function gi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
4085
4151
|
borderBottom: "1px solid var(--divider)",
|
|
4086
4152
|
verticalAlign: "middle"
|
|
4087
4153
|
},
|
|
4088
|
-
children: /* @__PURE__ */ X(
|
|
4154
|
+
children: /* @__PURE__ */ X(ci, {
|
|
4089
4155
|
entity: i,
|
|
4090
4156
|
actions: E,
|
|
4091
4157
|
objectIds: [t],
|
|
@@ -4096,7 +4162,7 @@ function gi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
4096
4162
|
]
|
|
4097
4163
|
});
|
|
4098
4164
|
}
|
|
4099
|
-
function
|
|
4165
|
+
function Ti({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: u, refs: d, accent: f }) {
|
|
4100
4166
|
let m = n(), h = o.find((e) => e.startsWith("_error:")), g = new Set(o.filter((e) => !e.startsWith("_error:"))), _ = {
|
|
4101
4167
|
padding: "6px 12px",
|
|
4102
4168
|
borderBottom: "1px solid var(--divider)",
|
|
@@ -4125,7 +4191,7 @@ function _i({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4125
4191
|
title: o ? `${e} is required` : void 0,
|
|
4126
4192
|
children: /* @__PURE__ */ X("div", {
|
|
4127
4193
|
style: v,
|
|
4128
|
-
children: n ?
|
|
4194
|
+
children: n ? B({
|
|
4129
4195
|
field: n,
|
|
4130
4196
|
fieldName: e,
|
|
4131
4197
|
value: t[e],
|
|
@@ -4162,13 +4228,13 @@ function _i({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4162
4228
|
title: h.slice(7),
|
|
4163
4229
|
children: "!"
|
|
4164
4230
|
}),
|
|
4165
|
-
/* @__PURE__ */ X(
|
|
4231
|
+
/* @__PURE__ */ X(V, {
|
|
4166
4232
|
size: 24,
|
|
4167
4233
|
icon: X(s ? A : e.check, { size: 12 }),
|
|
4168
4234
|
onClick: l,
|
|
4169
4235
|
title: "Confirm (Enter)"
|
|
4170
4236
|
}),
|
|
4171
|
-
/* @__PURE__ */ X(
|
|
4237
|
+
/* @__PURE__ */ X(V, {
|
|
4172
4238
|
size: 24,
|
|
4173
4239
|
icon: /* @__PURE__ */ X(e.x, { size: 12 }),
|
|
4174
4240
|
onClick: u,
|
|
@@ -4179,7 +4245,7 @@ function _i({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4179
4245
|
})]
|
|
4180
4246
|
});
|
|
4181
4247
|
}
|
|
4182
|
-
function
|
|
4248
|
+
function Ei({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: u, refs: d, accent: f }) {
|
|
4183
4249
|
let m = n(), h = Ie(), g = o.find((e) => e.startsWith("_error:")), _ = new Set(o.filter((e) => !e.startsWith("_error:")));
|
|
4184
4250
|
return /* @__PURE__ */ Z("div", {
|
|
4185
4251
|
style: {
|
|
@@ -4229,7 +4295,7 @@ function vi({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4229
4295
|
borderRadius: o ? 5 : 0
|
|
4230
4296
|
},
|
|
4231
4297
|
title: o ? `${e} is required` : void 0,
|
|
4232
|
-
children: i ? n ?
|
|
4298
|
+
children: i ? n ? B({
|
|
4233
4299
|
field: n,
|
|
4234
4300
|
fieldName: e,
|
|
4235
4301
|
value: t[e],
|
|
@@ -4264,13 +4330,13 @@ function vi({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4264
4330
|
title: g.slice(7),
|
|
4265
4331
|
children: "!"
|
|
4266
4332
|
}),
|
|
4267
|
-
/* @__PURE__ */ X(
|
|
4333
|
+
/* @__PURE__ */ X(V, {
|
|
4268
4334
|
size: 32,
|
|
4269
4335
|
icon: X(s ? A : e.check, { size: 14 }),
|
|
4270
4336
|
onClick: l,
|
|
4271
4337
|
title: "Confirm (Enter)"
|
|
4272
4338
|
}),
|
|
4273
|
-
/* @__PURE__ */ X(
|
|
4339
|
+
/* @__PURE__ */ X(V, {
|
|
4274
4340
|
size: 32,
|
|
4275
4341
|
icon: /* @__PURE__ */ X(e.x, { size: 14 }),
|
|
4276
4342
|
onClick: u,
|
|
@@ -4280,12 +4346,12 @@ function vi({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4280
4346
|
})]
|
|
4281
4347
|
});
|
|
4282
4348
|
}
|
|
4283
|
-
function
|
|
4284
|
-
let d =
|
|
4349
|
+
function Di({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
|
|
4350
|
+
let d = q(() => {
|
|
4285
4351
|
let e = new Set(r);
|
|
4286
4352
|
return e.delete(i), e;
|
|
4287
4353
|
}, [r, i]);
|
|
4288
|
-
return /* @__PURE__ */ X(
|
|
4354
|
+
return /* @__PURE__ */ X(Ti, {
|
|
4289
4355
|
values: e,
|
|
4290
4356
|
entity: t,
|
|
4291
4357
|
columns: n,
|
|
@@ -4299,12 +4365,12 @@ function yi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
4299
4365
|
accent: !0
|
|
4300
4366
|
});
|
|
4301
4367
|
}
|
|
4302
|
-
function
|
|
4303
|
-
let d =
|
|
4368
|
+
function Oi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
|
|
4369
|
+
let d = q(() => {
|
|
4304
4370
|
let e = new Set(r);
|
|
4305
4371
|
return e.delete(i), e;
|
|
4306
4372
|
}, [r, i]);
|
|
4307
|
-
return /* @__PURE__ */ X(
|
|
4373
|
+
return /* @__PURE__ */ X(Ei, {
|
|
4308
4374
|
values: e,
|
|
4309
4375
|
entity: t,
|
|
4310
4376
|
columns: n,
|
|
@@ -4320,76 +4386,76 @@ function bi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
4320
4386
|
}
|
|
4321
4387
|
//#endregion
|
|
4322
4388
|
//#region src/hooks/useMutations.ts
|
|
4323
|
-
function
|
|
4324
|
-
|
|
4389
|
+
function ki(e) {
|
|
4390
|
+
U.error(e.message);
|
|
4325
4391
|
}
|
|
4326
|
-
function
|
|
4327
|
-
e.invalidateQueries({ queryKey: ["entity-data", t] }), e.invalidateQueries({ queryKey: ["entity-count", t] }), n.item && e.invalidateQueries({ queryKey: ["entity-item", t] }), n.children && e.invalidateQueries({ queryKey: [
|
|
4392
|
+
function Ai(e, t, n = {}) {
|
|
4393
|
+
e.invalidateQueries({ queryKey: ["entity-data", t] }), e.invalidateQueries({ queryKey: ["entity-count", t] }), n.item && e.invalidateQueries({ queryKey: ["entity-item", t] }), n.children && e.invalidateQueries({ queryKey: [rr, t] }), n.objectMeta && (e.invalidateQueries({ queryKey: ["object-status", t] }), e.invalidateQueries({ queryKey: ["object-properties", t] }));
|
|
4328
4394
|
}
|
|
4329
|
-
function
|
|
4395
|
+
function ji(e) {
|
|
4330
4396
|
let t = Ue();
|
|
4331
4397
|
return Ve({
|
|
4332
4398
|
mutationFn: (t) => M(e, t),
|
|
4333
4399
|
onSuccess: () => {
|
|
4334
|
-
|
|
4400
|
+
Ai(t, e), U.success("Record created");
|
|
4335
4401
|
},
|
|
4336
|
-
onError:
|
|
4402
|
+
onError: ki
|
|
4337
4403
|
});
|
|
4338
4404
|
}
|
|
4339
|
-
function
|
|
4405
|
+
function Mi(e) {
|
|
4340
4406
|
let t = Ue();
|
|
4341
4407
|
return Ve({
|
|
4342
|
-
mutationFn: ({ pkValues: t, data: n }) =>
|
|
4408
|
+
mutationFn: ({ pkValues: t, data: n }) => ne(e, t, n),
|
|
4343
4409
|
onSuccess: () => {
|
|
4344
|
-
|
|
4410
|
+
Ai(t, e, {
|
|
4345
4411
|
item: !0,
|
|
4346
4412
|
children: !0,
|
|
4347
4413
|
objectMeta: !0
|
|
4348
|
-
}),
|
|
4414
|
+
}), U.success("Record updated");
|
|
4349
4415
|
},
|
|
4350
|
-
onError:
|
|
4416
|
+
onError: ki
|
|
4351
4417
|
});
|
|
4352
4418
|
}
|
|
4353
|
-
function
|
|
4419
|
+
function Ni(e) {
|
|
4354
4420
|
let t = Ue();
|
|
4355
4421
|
return Ve({
|
|
4356
|
-
mutationFn: (t) =>
|
|
4422
|
+
mutationFn: (t) => ue(e, t),
|
|
4357
4423
|
onSuccess: () => {
|
|
4358
|
-
|
|
4424
|
+
Ai(t, e, { item: !0 }), U.success("Record deleted");
|
|
4359
4425
|
},
|
|
4360
|
-
onError:
|
|
4426
|
+
onError: ki
|
|
4361
4427
|
});
|
|
4362
4428
|
}
|
|
4363
|
-
function
|
|
4429
|
+
function Pi(e) {
|
|
4364
4430
|
let t = Ue();
|
|
4365
4431
|
return Ve({
|
|
4366
4432
|
mutationFn: (t) => w(e, t),
|
|
4367
4433
|
onSuccess: () => {
|
|
4368
|
-
|
|
4434
|
+
Ai(t, e, {
|
|
4369
4435
|
item: !0,
|
|
4370
4436
|
objectMeta: !0
|
|
4371
|
-
}),
|
|
4437
|
+
}), U.success("Record restored");
|
|
4372
4438
|
},
|
|
4373
|
-
onError:
|
|
4439
|
+
onError: ki
|
|
4374
4440
|
});
|
|
4375
4441
|
}
|
|
4376
4442
|
//#endregion
|
|
4377
4443
|
//#region src/components/shared/LoadingSkeleton.tsx
|
|
4378
|
-
var
|
|
4444
|
+
var Fi = {
|
|
4379
4445
|
display: "block",
|
|
4380
4446
|
background: "linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%)",
|
|
4381
4447
|
backgroundSize: "200% 100%",
|
|
4382
4448
|
borderRadius: 6,
|
|
4383
4449
|
animation: "declarion-shimmer 1.2s ease-in-out infinite"
|
|
4384
4450
|
};
|
|
4385
|
-
function
|
|
4386
|
-
return /* @__PURE__ */ Z(
|
|
4387
|
-
...
|
|
4451
|
+
function Ii({ height: e, width: t }) {
|
|
4452
|
+
return /* @__PURE__ */ Z(We, { children: [/* @__PURE__ */ X("style", { children: "@keyframes declarion-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}" }), /* @__PURE__ */ X("span", { style: {
|
|
4453
|
+
...Fi,
|
|
4388
4454
|
height: e,
|
|
4389
4455
|
width: t ?? "100%"
|
|
4390
4456
|
} })] });
|
|
4391
4457
|
}
|
|
4392
|
-
function
|
|
4458
|
+
function Li({ rows: e = 8, cols: t = 4 }) {
|
|
4393
4459
|
return /* @__PURE__ */ Z("div", {
|
|
4394
4460
|
style: {
|
|
4395
4461
|
padding: 16,
|
|
@@ -4404,7 +4470,7 @@ function ki({ rows: e = 8, cols: t = 4 }) {
|
|
|
4404
4470
|
},
|
|
4405
4471
|
children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ X("div", {
|
|
4406
4472
|
style: { flex: 1 },
|
|
4407
|
-
children: /* @__PURE__ */ X(
|
|
4473
|
+
children: /* @__PURE__ */ X(Ii, { height: 14 })
|
|
4408
4474
|
}, t))
|
|
4409
4475
|
}), Array.from({ length: e }).map((e, n) => /* @__PURE__ */ X("div", {
|
|
4410
4476
|
style: {
|
|
@@ -4413,12 +4479,12 @@ function ki({ rows: e = 8, cols: t = 4 }) {
|
|
|
4413
4479
|
},
|
|
4414
4480
|
children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ X("div", {
|
|
4415
4481
|
style: { flex: 1 },
|
|
4416
|
-
children: /* @__PURE__ */ X(
|
|
4482
|
+
children: /* @__PURE__ */ X(Ii, { height: 28 })
|
|
4417
4483
|
}, t))
|
|
4418
4484
|
}, n))]
|
|
4419
4485
|
});
|
|
4420
4486
|
}
|
|
4421
|
-
function
|
|
4487
|
+
function Ri() {
|
|
4422
4488
|
return /* @__PURE__ */ Z("div", {
|
|
4423
4489
|
style: {
|
|
4424
4490
|
padding: 20,
|
|
@@ -4427,7 +4493,7 @@ function Ai() {
|
|
|
4427
4493
|
gap: 16
|
|
4428
4494
|
},
|
|
4429
4495
|
children: [
|
|
4430
|
-
/* @__PURE__ */ X(
|
|
4496
|
+
/* @__PURE__ */ X(Ii, {
|
|
4431
4497
|
height: 12,
|
|
4432
4498
|
width: 160
|
|
4433
4499
|
}),
|
|
@@ -4438,11 +4504,11 @@ function Ai() {
|
|
|
4438
4504
|
gap: 12
|
|
4439
4505
|
},
|
|
4440
4506
|
children: [/* @__PURE__ */ X("span", { style: {
|
|
4441
|
-
...
|
|
4507
|
+
...Fi,
|
|
4442
4508
|
width: 32,
|
|
4443
4509
|
height: 32,
|
|
4444
4510
|
borderRadius: 8
|
|
4445
|
-
} }), /* @__PURE__ */ X(
|
|
4511
|
+
} }), /* @__PURE__ */ X(Ii, {
|
|
4446
4512
|
height: 22,
|
|
4447
4513
|
width: 240
|
|
4448
4514
|
})]
|
|
@@ -4459,7 +4525,7 @@ function Ai() {
|
|
|
4459
4525
|
padding: "11px 14px",
|
|
4460
4526
|
borderBottom: "1px solid var(--divider)"
|
|
4461
4527
|
},
|
|
4462
|
-
children: /* @__PURE__ */ X(
|
|
4528
|
+
children: /* @__PURE__ */ X(Ii, {
|
|
4463
4529
|
height: 13,
|
|
4464
4530
|
width: 150
|
|
4465
4531
|
})
|
|
@@ -4475,12 +4541,12 @@ function Ai() {
|
|
|
4475
4541
|
display: "flex",
|
|
4476
4542
|
gap: 16
|
|
4477
4543
|
},
|
|
4478
|
-
children: [/* @__PURE__ */ X(
|
|
4544
|
+
children: [/* @__PURE__ */ X(Ii, {
|
|
4479
4545
|
height: 13,
|
|
4480
4546
|
width: 110
|
|
4481
4547
|
}), /* @__PURE__ */ X("div", {
|
|
4482
4548
|
style: { flex: 1 },
|
|
4483
|
-
children: /* @__PURE__ */ X(
|
|
4549
|
+
children: /* @__PURE__ */ X(Ii, { height: 13 })
|
|
4484
4550
|
})]
|
|
4485
4551
|
}, t))
|
|
4486
4552
|
})]
|
|
@@ -4490,11 +4556,11 @@ function Ai() {
|
|
|
4490
4556
|
}
|
|
4491
4557
|
//#endregion
|
|
4492
4558
|
//#region src/lib/sort.ts
|
|
4493
|
-
var
|
|
4559
|
+
var zi = {
|
|
4494
4560
|
nulls_first: "first",
|
|
4495
4561
|
nulls_last: "last"
|
|
4496
4562
|
};
|
|
4497
|
-
function
|
|
4563
|
+
function Bi(e) {
|
|
4498
4564
|
if (!e) return [];
|
|
4499
4565
|
let t = [];
|
|
4500
4566
|
for (let n of e.split(",")) {
|
|
@@ -4507,14 +4573,14 @@ function Mi(e) {
|
|
|
4507
4573
|
dir: r[1]?.trim().toLowerCase() === "desc" ? "desc" : "asc"
|
|
4508
4574
|
}, o = r[2]?.trim().toLowerCase();
|
|
4509
4575
|
if (o) {
|
|
4510
|
-
let e =
|
|
4576
|
+
let e = zi[o];
|
|
4511
4577
|
e && (a.nulls = e);
|
|
4512
4578
|
}
|
|
4513
4579
|
t.push(a);
|
|
4514
4580
|
}
|
|
4515
4581
|
return t;
|
|
4516
4582
|
}
|
|
4517
|
-
function
|
|
4583
|
+
function Vi(e) {
|
|
4518
4584
|
if (!e) return;
|
|
4519
4585
|
let t = [];
|
|
4520
4586
|
for (let n of e.split(",")) {
|
|
@@ -4525,39 +4591,39 @@ function Ni(e) {
|
|
|
4525
4591
|
}
|
|
4526
4592
|
return t.length > 0 ? t.join(",") : void 0;
|
|
4527
4593
|
}
|
|
4528
|
-
function
|
|
4594
|
+
function Hi(e) {
|
|
4529
4595
|
return e.map((e) => {
|
|
4530
4596
|
let t = `${e.field}:${e.dir}`;
|
|
4531
4597
|
return e.nulls === "first" ? `${t}:nulls_first` : e.nulls === "last" ? `${t}:nulls_last` : t;
|
|
4532
4598
|
}).join(",");
|
|
4533
4599
|
}
|
|
4534
|
-
function
|
|
4600
|
+
function Ui(e, t) {
|
|
4535
4601
|
let n = e.findIndex((e) => e.field === t);
|
|
4536
4602
|
return n >= 0 ? [...e.slice(0, n), ...e.slice(n + 1)] : e.length >= 5 ? e : [...e, {
|
|
4537
4603
|
field: t,
|
|
4538
4604
|
dir: "asc"
|
|
4539
4605
|
}];
|
|
4540
4606
|
}
|
|
4541
|
-
function
|
|
4607
|
+
function Wi(e, t) {
|
|
4542
4608
|
let n = e.filter((e) => e.field !== t.field);
|
|
4543
4609
|
return n.length >= 5 ? e : [...n, t];
|
|
4544
4610
|
}
|
|
4545
|
-
function
|
|
4611
|
+
function Gi(e, t) {
|
|
4546
4612
|
let n = e.findIndex((e) => e.field === t);
|
|
4547
4613
|
return n < 0 ? e : [...e.slice(0, n), ...e.slice(n + 1)];
|
|
4548
4614
|
}
|
|
4549
4615
|
//#endregion
|
|
4550
4616
|
//#region src/hooks/useScreenBack.ts
|
|
4551
|
-
function
|
|
4552
|
-
let t = ze(), n =
|
|
4617
|
+
function Ki(e) {
|
|
4618
|
+
let t = ze(), n = ae(), i = ie(), a = jt((e) => e.depth), { data: o } = r(), s = e?.fallback, c = At((e) => {
|
|
4553
4619
|
let t = e.tabs.find((t) => t.id === e.activeTabId);
|
|
4554
4620
|
return t ? t.returnTo : void 0;
|
|
4555
|
-
}), { hasOriginBack: l, allowFallbackBack: u } =
|
|
4621
|
+
}), { hasOriginBack: l, allowFallbackBack: u } = q(() => Lt(c, n.enabled), [c, n.enabled]), d = G(() => {
|
|
4556
4622
|
if (n.enabled) {
|
|
4557
|
-
|
|
4623
|
+
jt.getState().depth > 0 ? i() : s?.();
|
|
4558
4624
|
return;
|
|
4559
4625
|
}
|
|
4560
|
-
let e =
|
|
4626
|
+
let e = At.getState(), r = Rt(e.tabs.find((t) => t.id === e.activeTabId)?.returnTo, e.tabs, !1);
|
|
4561
4627
|
if (!r) {
|
|
4562
4628
|
s?.();
|
|
4563
4629
|
return;
|
|
@@ -4576,7 +4642,7 @@ function Ri(e) {
|
|
|
4576
4642
|
}
|
|
4577
4643
|
t({
|
|
4578
4644
|
pathname: r.pathname,
|
|
4579
|
-
search:
|
|
4645
|
+
search: Ft(r.search),
|
|
4580
4646
|
hash: r.hash || void 0
|
|
4581
4647
|
});
|
|
4582
4648
|
}, [
|
|
@@ -4596,40 +4662,40 @@ function Ri(e) {
|
|
|
4596
4662
|
}
|
|
4597
4663
|
//#endregion
|
|
4598
4664
|
//#region src/lib/field-classification.ts
|
|
4599
|
-
function
|
|
4665
|
+
function qi(e, t) {
|
|
4600
4666
|
let n = e?.field_access?.[t];
|
|
4601
4667
|
return !n || n.read === "granted";
|
|
4602
4668
|
}
|
|
4603
|
-
function
|
|
4669
|
+
function Ji(e, t) {
|
|
4604
4670
|
let n = e?.field_access?.[t];
|
|
4605
4671
|
return !n || n.write === "granted";
|
|
4606
4672
|
}
|
|
4607
|
-
function
|
|
4673
|
+
function Yi(e, t) {
|
|
4608
4674
|
return e?.field_access?.[t]?.classification;
|
|
4609
4675
|
}
|
|
4610
|
-
function
|
|
4676
|
+
function Xi(e, t) {
|
|
4611
4677
|
return e?.field_access?.[t]?.required_permission;
|
|
4612
4678
|
}
|
|
4613
|
-
function
|
|
4614
|
-
let r =
|
|
4679
|
+
function Zi(e, t, n) {
|
|
4680
|
+
let r = Yi(t, n);
|
|
4615
4681
|
if (r) return e?.classifications?.[r];
|
|
4616
4682
|
}
|
|
4617
|
-
function
|
|
4618
|
-
return !!
|
|
4683
|
+
function Qi(e, t, n) {
|
|
4684
|
+
return !!Zi(e, t, n)?.sod_protected;
|
|
4619
4685
|
}
|
|
4620
|
-
function
|
|
4686
|
+
function $i(e, t) {
|
|
4621
4687
|
return e?.field_access?.[t];
|
|
4622
4688
|
}
|
|
4623
4689
|
//#endregion
|
|
4624
4690
|
//#region src/components/pages/list/cardProjection.ts
|
|
4625
|
-
var
|
|
4691
|
+
var ea = 4, ta = 2, na = 2, ra = [
|
|
4626
4692
|
"screen_card",
|
|
4627
4693
|
"entity_card",
|
|
4628
4694
|
"saved_view_columns",
|
|
4629
4695
|
"screen_default_columns",
|
|
4630
4696
|
"screen_columns",
|
|
4631
4697
|
"entity_inference"
|
|
4632
|
-
],
|
|
4698
|
+
], ia = /* @__PURE__ */ new Set(["_select", "_actions"]), aa = /* @__PURE__ */ new Set([
|
|
4633
4699
|
"text",
|
|
4634
4700
|
"rich_text",
|
|
4635
4701
|
"multilang_text",
|
|
@@ -4638,11 +4704,11 @@ var Ki = 4, qi = 2, Ji = 2, Yi = [
|
|
|
4638
4704
|
"secret",
|
|
4639
4705
|
"password",
|
|
4640
4706
|
"bytes"
|
|
4641
|
-
]),
|
|
4707
|
+
]), oa = /* @__PURE__ */ new Set(["enum", "bool"]), sa = /* @__PURE__ */ new Set([
|
|
4642
4708
|
"date",
|
|
4643
4709
|
"time",
|
|
4644
4710
|
"timestamp"
|
|
4645
|
-
]),
|
|
4711
|
+
]), ca = /* @__PURE__ */ new Set([
|
|
4646
4712
|
"string",
|
|
4647
4713
|
"text",
|
|
4648
4714
|
"email",
|
|
@@ -4668,22 +4734,22 @@ var Ki = 4, qi = 2, Ji = 2, Yi = [
|
|
|
4668
4734
|
"enum",
|
|
4669
4735
|
"status"
|
|
4670
4736
|
]);
|
|
4671
|
-
function
|
|
4737
|
+
function la(e) {
|
|
4672
4738
|
let { entity: t, screen: n, savedViewColumns: r } = e, i = n?.card;
|
|
4673
|
-
if (i) return
|
|
4674
|
-
if (t?.card) return
|
|
4675
|
-
let a =
|
|
4676
|
-
return
|
|
4677
|
-
}
|
|
4678
|
-
function
|
|
4679
|
-
let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new
|
|
4680
|
-
for (let e of p) f.addField(e, "render"),
|
|
4681
|
-
for (let e of m) p.includes(e) || (f.addField(e, "variant"),
|
|
4682
|
-
let h =
|
|
4739
|
+
if (i) return ma(t, i, "screen_card");
|
|
4740
|
+
if (t?.card) return ma(t, t.card, "entity_card");
|
|
4741
|
+
let a = _a(t, n, r);
|
|
4742
|
+
return ha(t, a.columns, a.source);
|
|
4743
|
+
}
|
|
4744
|
+
function ua(e) {
|
|
4745
|
+
let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new Ka(), p = r === "cards" ? a.renderFields : ya(t, i, { explicit: !0 }), m = r === "cards" ? fa(t, n) : [];
|
|
4746
|
+
for (let e of p) f.addField(e, "render"), Ua(t, e, f, "render");
|
|
4747
|
+
for (let e of m) p.includes(e) || (f.addField(e, "variant"), Ua(t, e, f, "variant"));
|
|
4748
|
+
let h = Aa(t, f), g = Fa(t, [
|
|
4683
4749
|
o,
|
|
4684
4750
|
s,
|
|
4685
4751
|
c
|
|
4686
|
-
], f), _ =
|
|
4752
|
+
], f), _ = da(t, n, f), v = Ia(t, l, f), y = La(t, n, d, f);
|
|
4687
4753
|
if (u) for (let e of h) f.addField(e, "detail_handoff");
|
|
4688
4754
|
let b = new $();
|
|
4689
4755
|
for (let e of h) b.add(e);
|
|
@@ -4693,9 +4759,9 @@ function na(e) {
|
|
|
4693
4759
|
for (let e of v) b.add(e);
|
|
4694
4760
|
for (let e of y) b.add(e);
|
|
4695
4761
|
let x = new $();
|
|
4696
|
-
for (let e of p)
|
|
4697
|
-
for (let e of b.values())
|
|
4698
|
-
let S = x.values(), C =
|
|
4762
|
+
for (let e of p) Ha(t, e, x, f);
|
|
4763
|
+
for (let e of b.values()) Ha(t, e, x, f);
|
|
4764
|
+
let S = x.values(), C = Wa(f);
|
|
4699
4765
|
return {
|
|
4700
4766
|
renderFields: p,
|
|
4701
4767
|
dependencyFields: b.values().filter((e) => !p.includes(e)),
|
|
@@ -4707,7 +4773,7 @@ function na(e) {
|
|
|
4707
4773
|
reasons: f.snapshot()
|
|
4708
4774
|
};
|
|
4709
4775
|
}
|
|
4710
|
-
function
|
|
4776
|
+
function da(e, t, n) {
|
|
4711
4777
|
let r = new $(), i = (t) => {
|
|
4712
4778
|
for (let n of t) n.and ? i(n.and) : n.or ? i(n.or) : n.field && e?.fields.has(n.field) && r.add(n.field);
|
|
4713
4779
|
};
|
|
@@ -4716,9 +4782,9 @@ function ra(e, t, n) {
|
|
|
4716
4782
|
for (let e of r.values()) n.addField(e, "variant");
|
|
4717
4783
|
return r.values();
|
|
4718
4784
|
}
|
|
4719
|
-
function
|
|
4785
|
+
function fa(e, t, n) {
|
|
4720
4786
|
let r = new $();
|
|
4721
|
-
for (let i of
|
|
4787
|
+
for (let i of la({
|
|
4722
4788
|
entity: e,
|
|
4723
4789
|
screen: t,
|
|
4724
4790
|
savedViewColumns: n
|
|
@@ -4726,7 +4792,7 @@ function ia(e, t, n) {
|
|
|
4726
4792
|
for (let i of t?.variants?.items() ?? []) {
|
|
4727
4793
|
let a = { ...t };
|
|
4728
4794
|
i.card !== void 0 && (a.card = i.card);
|
|
4729
|
-
for (let t of
|
|
4795
|
+
for (let t of la({
|
|
4730
4796
|
entity: e,
|
|
4731
4797
|
screen: a,
|
|
4732
4798
|
savedViewColumns: n
|
|
@@ -4734,22 +4800,22 @@ function ia(e, t, n) {
|
|
|
4734
4800
|
}
|
|
4735
4801
|
return r.values();
|
|
4736
4802
|
}
|
|
4737
|
-
function
|
|
4803
|
+
function pa(e, t, n) {
|
|
4738
4804
|
if (!e || t?.on_row_click !== "peek" || t.quick_peek?.enabled === !1) return [];
|
|
4739
4805
|
let r = t.quick_peek?.fields;
|
|
4740
|
-
if (r && r.length > 0) return
|
|
4806
|
+
if (r && r.length > 0) return ya(e, r, { explicit: !0 });
|
|
4741
4807
|
let i = t.quick_peek?.sections;
|
|
4742
4808
|
if (i && i.length > 0) {
|
|
4743
4809
|
let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new $();
|
|
4744
|
-
|
|
4745
|
-
let o =
|
|
4810
|
+
Ra(r?.items, new Set(i.map(String)), a);
|
|
4811
|
+
let o = ya(e, a.values(), { explicit: !0 });
|
|
4746
4812
|
if (o.length > 0) return o;
|
|
4747
4813
|
}
|
|
4748
|
-
return
|
|
4814
|
+
return Va(e);
|
|
4749
4815
|
}
|
|
4750
|
-
function
|
|
4751
|
-
let r = t.max_body_fields ??
|
|
4752
|
-
return
|
|
4816
|
+
function ma(e, t, n) {
|
|
4817
|
+
let r = t.max_body_fields ?? ea, i = ba(e, t.title_field, { explicit: !0 }), a = ba(e, t.subtitle_field, { explicit: !0 }), o = ya(e, t.badge_fields ?? [], { explicit: !0 }), s = ya(e, t.fields ?? [], { explicit: !0 }), c = ya(e, t.meta_fields ?? [], { explicit: !0 });
|
|
4818
|
+
return ga({
|
|
4753
4819
|
source: n,
|
|
4754
4820
|
explicit: !0,
|
|
4755
4821
|
titleField: i,
|
|
@@ -4762,28 +4828,28 @@ function oa(e, t, n) {
|
|
|
4762
4828
|
maxBodyFields: r
|
|
4763
4829
|
});
|
|
4764
4830
|
}
|
|
4765
|
-
function
|
|
4766
|
-
let r =
|
|
4831
|
+
function ha(e, t, n) {
|
|
4832
|
+
let r = ya(e, t, { explicit: !1 }), i = ea, a = ba(e, e?.display?.display_field, { explicit: !1 }), o = a ?? xa(e, r, {
|
|
4767
4833
|
allowLong: !1,
|
|
4768
4834
|
allowAuto: !1
|
|
4769
|
-
}), s = a !== void 0, c = o ? /* @__PURE__ */ new Set([o]) : void 0, l = r.find((t) => !c?.has(t) &&
|
|
4835
|
+
}), s = a !== void 0, c = o ? /* @__PURE__ */ new Set([o]) : void 0, l = r.find((t) => !c?.has(t) && Ca(e, t)), u = new Set([o, l].filter((e) => !!e)), d = Ta(e, r).filter((e) => !u.has(e)).slice(0, ta);
|
|
4770
4836
|
for (let e of d) u.add(e);
|
|
4771
|
-
let f = r.filter((t) => !u.has(t) &&
|
|
4837
|
+
let f = r.filter((t) => !u.has(t) && Ea(e, t)).slice(0, na);
|
|
4772
4838
|
for (let e of f) u.add(e);
|
|
4773
|
-
return
|
|
4839
|
+
return ga({
|
|
4774
4840
|
source: n,
|
|
4775
4841
|
explicit: !1,
|
|
4776
4842
|
titleField: o,
|
|
4777
4843
|
titleUsesDisplay: s,
|
|
4778
4844
|
subtitleField: l,
|
|
4779
4845
|
badgeFields: d,
|
|
4780
|
-
bodyFields: r.filter((t) => !u.has(t) &&
|
|
4846
|
+
bodyFields: r.filter((t) => !u.has(t) && Sa(e, t)).slice(0, i),
|
|
4781
4847
|
metaFields: f,
|
|
4782
4848
|
hideEmptyFields: !0,
|
|
4783
4849
|
maxBodyFields: i
|
|
4784
4850
|
});
|
|
4785
4851
|
}
|
|
4786
|
-
function
|
|
4852
|
+
function ga(e) {
|
|
4787
4853
|
let t = new $(), n = [], r = (r, i) => {
|
|
4788
4854
|
!r || t.has(r) || (t.add(r), n.push({
|
|
4789
4855
|
field: r,
|
|
@@ -4808,10 +4874,10 @@ function ca(e) {
|
|
|
4808
4874
|
maxBodyFields: e.maxBodyFields,
|
|
4809
4875
|
renderFields: t.values(),
|
|
4810
4876
|
fields: n,
|
|
4811
|
-
sourcePrecedence:
|
|
4877
|
+
sourcePrecedence: ra
|
|
4812
4878
|
};
|
|
4813
4879
|
}
|
|
4814
|
-
function
|
|
4880
|
+
function _a(e, t, n) {
|
|
4815
4881
|
return n && n.length > 0 ? {
|
|
4816
4882
|
source: "saved_view_columns",
|
|
4817
4883
|
columns: n
|
|
@@ -4823,10 +4889,10 @@ function la(e, t, n) {
|
|
|
4823
4889
|
columns: t.columns
|
|
4824
4890
|
} : {
|
|
4825
4891
|
source: "entity_inference",
|
|
4826
|
-
columns:
|
|
4892
|
+
columns: va(e)
|
|
4827
4893
|
};
|
|
4828
4894
|
}
|
|
4829
|
-
function
|
|
4895
|
+
function va(e) {
|
|
4830
4896
|
if (!e) return [];
|
|
4831
4897
|
let t = [];
|
|
4832
4898
|
e.display.display_field && t.push(e.display.display_field);
|
|
@@ -4836,16 +4902,16 @@ function ua(e) {
|
|
|
4836
4902
|
if (e.evidence_covered && t.push("$evidence"), e.files) for (let [n] of e.files) t.push(n);
|
|
4837
4903
|
return t;
|
|
4838
4904
|
}
|
|
4839
|
-
function
|
|
4905
|
+
function ya(e, t, n) {
|
|
4840
4906
|
let r = new $();
|
|
4841
4907
|
for (let i of t) {
|
|
4842
|
-
let t =
|
|
4908
|
+
let t = ba(e, i, n);
|
|
4843
4909
|
t && r.add(t);
|
|
4844
4910
|
}
|
|
4845
4911
|
return r.values();
|
|
4846
4912
|
}
|
|
4847
|
-
function
|
|
4848
|
-
if (!t ||
|
|
4913
|
+
function ba(e, t, n) {
|
|
4914
|
+
if (!t || ia.has(t)) return;
|
|
4849
4915
|
if (!e) return t.startsWith("$") ? void 0 : t;
|
|
4850
4916
|
if (t.startsWith("$status.")) {
|
|
4851
4917
|
let n = t.slice(8);
|
|
@@ -4860,55 +4926,55 @@ function fa(e, t, n) {
|
|
|
4860
4926
|
let r = e.fields.get(t), i = e.files?.get(t);
|
|
4861
4927
|
if (!(!r && !i) && (n.explicit || !(r && r.display?.is_listable === !1) && !(i && i.display?.is_listable === !1))) return t;
|
|
4862
4928
|
}
|
|
4863
|
-
function
|
|
4864
|
-
return t.find((t) => n.exclude?.has(t) || !n.allowAuto &&
|
|
4929
|
+
function xa(e, t, n) {
|
|
4930
|
+
return t.find((t) => n.exclude?.has(t) || !n.allowAuto && Oa(e, t) || !n.allowLong && ka(e, t) ? !1 : Da(e, t));
|
|
4865
4931
|
}
|
|
4866
|
-
function
|
|
4867
|
-
return !(!
|
|
4932
|
+
function Sa(e, t) {
|
|
4933
|
+
return !(!Da(e, t) || Oa(e, t) || ka(e, t));
|
|
4868
4934
|
}
|
|
4869
|
-
function
|
|
4870
|
-
return !(!
|
|
4935
|
+
function Ca(e, t) {
|
|
4936
|
+
return !(!Da(e, t) || Oa(e, t) || ka(e, t) || Ea(e, t) || wa(e, t));
|
|
4871
4937
|
}
|
|
4872
|
-
function
|
|
4938
|
+
function wa(e, t) {
|
|
4873
4939
|
if (t.startsWith("$status.") || t.startsWith("$property.") || t === "$evidence") return !0;
|
|
4874
|
-
let n =
|
|
4875
|
-
return n.kind === "field" &&
|
|
4940
|
+
let n = Ga(e, t);
|
|
4941
|
+
return n.kind === "field" && oa.has(n.field.type);
|
|
4876
4942
|
}
|
|
4877
|
-
function
|
|
4943
|
+
function Ta(e, t) {
|
|
4878
4944
|
let n = new $();
|
|
4879
4945
|
for (let e of t) (e.startsWith("$status.") || e.startsWith("$property.") || e === "$evidence") && n.add(e);
|
|
4880
|
-
for (let r of t)
|
|
4946
|
+
for (let r of t) wa(e, r) && n.add(r);
|
|
4881
4947
|
return n.values();
|
|
4882
4948
|
}
|
|
4883
|
-
function
|
|
4884
|
-
if (
|
|
4885
|
-
let n =
|
|
4886
|
-
return n.kind === "field" &&
|
|
4949
|
+
function Ea(e, t) {
|
|
4950
|
+
if (Oa(e, t)) return !1;
|
|
4951
|
+
let n = Ga(e, t);
|
|
4952
|
+
return n.kind === "field" && sa.has(n.field.type);
|
|
4887
4953
|
}
|
|
4888
|
-
function
|
|
4889
|
-
return
|
|
4954
|
+
function Da(e, t) {
|
|
4955
|
+
return Ga(e, t).kind !== "missing";
|
|
4890
4956
|
}
|
|
4891
|
-
function
|
|
4892
|
-
let n =
|
|
4957
|
+
function Oa(e, t) {
|
|
4958
|
+
let n = Ga(e, t);
|
|
4893
4959
|
return n.kind === "field" && (n.field.primary === !0 || n.field.auto === !0);
|
|
4894
4960
|
}
|
|
4895
|
-
function
|
|
4896
|
-
let n =
|
|
4897
|
-
return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" &&
|
|
4961
|
+
function ka(e, t) {
|
|
4962
|
+
let n = Ga(e, t);
|
|
4963
|
+
return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" && aa.has(n.field.type);
|
|
4898
4964
|
}
|
|
4899
|
-
function
|
|
4965
|
+
function Aa(e, t) {
|
|
4900
4966
|
if (!e) return [];
|
|
4901
4967
|
let n = new $();
|
|
4902
|
-
for (let r of
|
|
4903
|
-
let r =
|
|
4904
|
-
r && (n.add(r), t.addField(r, "display"),
|
|
4905
|
-
for (let r of
|
|
4906
|
-
let i =
|
|
4907
|
-
i && (n.add(i), t.addField(i, "display_template"),
|
|
4968
|
+
for (let r of de(e)) n.add(r), t.addField(r, "identity");
|
|
4969
|
+
let r = ba(e, e.display.display_field, { explicit: !0 });
|
|
4970
|
+
r && (n.add(r), t.addField(r, "display"), Ua(e, r, t, "display"));
|
|
4971
|
+
for (let r of ja(e.display.display_template)) {
|
|
4972
|
+
let i = ba(e, r, { explicit: !0 });
|
|
4973
|
+
i && (n.add(i), t.addField(i, "display_template"), Ua(e, i, t, "display_template"));
|
|
4908
4974
|
}
|
|
4909
4975
|
return n.values();
|
|
4910
4976
|
}
|
|
4911
|
-
function
|
|
4977
|
+
function ja(e) {
|
|
4912
4978
|
if (!e) return [];
|
|
4913
4979
|
let t = new $(), n = 0;
|
|
4914
4980
|
for (; n < e.length;) {
|
|
@@ -4918,14 +4984,14 @@ function Ca(e) {
|
|
|
4918
4984
|
n = r + 2;
|
|
4919
4985
|
continue;
|
|
4920
4986
|
}
|
|
4921
|
-
let i =
|
|
4987
|
+
let i = Ma(e, r + 2);
|
|
4922
4988
|
if (i < 0) break;
|
|
4923
|
-
for (let n of
|
|
4989
|
+
for (let n of Na(e.slice(r + 2, i))) t.add(n);
|
|
4924
4990
|
n = i + 1;
|
|
4925
4991
|
}
|
|
4926
4992
|
return t.values();
|
|
4927
4993
|
}
|
|
4928
|
-
function
|
|
4994
|
+
function Ma(e, t) {
|
|
4929
4995
|
let n = 0;
|
|
4930
4996
|
for (let r = t; r < e.length; r += 1) {
|
|
4931
4997
|
let t = e[r];
|
|
@@ -4940,71 +5006,71 @@ function wa(e, t) {
|
|
|
4940
5006
|
}
|
|
4941
5007
|
return -1;
|
|
4942
5008
|
}
|
|
4943
|
-
function
|
|
5009
|
+
function Na(e) {
|
|
4944
5010
|
let t = new $(), n = 0;
|
|
4945
5011
|
for (; n < e.length;) {
|
|
4946
5012
|
let r = e.indexOf("row.", n);
|
|
4947
5013
|
if (r < 0) break;
|
|
4948
|
-
if (r > 0 &&
|
|
5014
|
+
if (r > 0 && Pa(e.charCodeAt(r - 1))) {
|
|
4949
5015
|
n = r + 4;
|
|
4950
5016
|
continue;
|
|
4951
5017
|
}
|
|
4952
5018
|
let i = r + 4, a = i;
|
|
4953
|
-
for (; a < e.length &&
|
|
5019
|
+
for (; a < e.length && Pa(e.charCodeAt(a));) a += 1;
|
|
4954
5020
|
a > i && t.add(e.slice(i, a)), n = a;
|
|
4955
5021
|
}
|
|
4956
5022
|
return t.values();
|
|
4957
5023
|
}
|
|
4958
|
-
function
|
|
5024
|
+
function Pa(e) {
|
|
4959
5025
|
return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 95;
|
|
4960
5026
|
}
|
|
4961
|
-
function
|
|
5027
|
+
function Fa(e, t, n) {
|
|
4962
5028
|
let r = new $();
|
|
4963
5029
|
for (let i of t) for (let t of i ?? []) for (let i of [
|
|
4964
5030
|
...t.action.visible_if ?? [],
|
|
4965
5031
|
...t.action.enabled_if ?? [],
|
|
4966
5032
|
...t.action.conditions ?? []
|
|
4967
5033
|
]) {
|
|
4968
|
-
let t =
|
|
4969
|
-
t && (r.add(t), n.addField(t, "condition"),
|
|
5034
|
+
let t = ba(e, i.field, { explicit: !0 });
|
|
5035
|
+
t && (r.add(t), n.addField(t, "condition"), Ua(e, t, n, "condition"));
|
|
4970
5036
|
}
|
|
4971
5037
|
return r.values();
|
|
4972
5038
|
}
|
|
4973
|
-
function
|
|
4974
|
-
let r = typeof t == "string" ?
|
|
5039
|
+
function Ia(e, t, n) {
|
|
5040
|
+
let r = typeof t == "string" ? Bi(t) : t ?? [], i = new $();
|
|
4975
5041
|
for (let t of r) {
|
|
4976
|
-
let r =
|
|
4977
|
-
r && (i.add(r), n.addField(r, "sort"),
|
|
5042
|
+
let r = ba(e, t.field, { explicit: !0 });
|
|
5043
|
+
r && (i.add(r), n.addField(r, "sort"), Ua(e, r, n, "sort"));
|
|
4978
5044
|
}
|
|
4979
5045
|
return i.values();
|
|
4980
5046
|
}
|
|
4981
|
-
function
|
|
5047
|
+
function La(e, t, n, r) {
|
|
4982
5048
|
let i = new $(), a = t?.variants?.items() ?? [];
|
|
4983
|
-
if (a.length === 0 || a.some((e) => e.quick_peek === void 0)) for (let r of
|
|
5049
|
+
if (a.length === 0 || a.some((e) => e.quick_peek === void 0)) for (let r of pa(e, t, n)) i.add(r);
|
|
4984
5050
|
for (let r of a) {
|
|
4985
5051
|
if (r.quick_peek === void 0) continue;
|
|
4986
5052
|
let a = {
|
|
4987
5053
|
...t,
|
|
4988
5054
|
quick_peek: r.quick_peek
|
|
4989
5055
|
};
|
|
4990
|
-
for (let t of
|
|
5056
|
+
for (let t of pa(e, a, n)) i.add(t);
|
|
4991
5057
|
}
|
|
4992
|
-
for (let t of i.values()) r.addField(t, "quick_peek"),
|
|
5058
|
+
for (let t of i.values()) r.addField(t, "quick_peek"), Ua(e, t, r, "quick_peek");
|
|
4993
5059
|
return i.values();
|
|
4994
5060
|
}
|
|
4995
|
-
function
|
|
5061
|
+
function Ra(e, t, n) {
|
|
4996
5062
|
if (Array.isArray(e)) {
|
|
4997
5063
|
for (let r of e) if (!(!r || typeof r != "object")) {
|
|
4998
5064
|
if ("section" in r) {
|
|
4999
|
-
let e = r.section, i =
|
|
5000
|
-
i && t.has(i) &&
|
|
5065
|
+
let e = r.section, i = Ba(e?.name);
|
|
5066
|
+
i && t.has(i) && za(e?.items, n);
|
|
5001
5067
|
continue;
|
|
5002
5068
|
}
|
|
5003
|
-
"fields" in r &&
|
|
5069
|
+
"fields" in r && za([r], n);
|
|
5004
5070
|
}
|
|
5005
5071
|
}
|
|
5006
5072
|
}
|
|
5007
|
-
function
|
|
5073
|
+
function za(e, t) {
|
|
5008
5074
|
if (Array.isArray(e)) {
|
|
5009
5075
|
for (let n of e) if (!(!n || typeof n != "object")) {
|
|
5010
5076
|
if ("fields" in n) {
|
|
@@ -5017,11 +5083,11 @@ function ja(e, t) {
|
|
|
5017
5083
|
}
|
|
5018
5084
|
}
|
|
5019
5085
|
}
|
|
5020
|
-
"section" in n &&
|
|
5086
|
+
"section" in n && za(n.section?.items, t);
|
|
5021
5087
|
}
|
|
5022
5088
|
}
|
|
5023
5089
|
}
|
|
5024
|
-
function
|
|
5090
|
+
function Ba(e) {
|
|
5025
5091
|
if (typeof e == "string") return e;
|
|
5026
5092
|
if (e && typeof e == "object") {
|
|
5027
5093
|
let t = Object.values(e).find((e) => typeof e == "string");
|
|
@@ -5029,21 +5095,21 @@ function Ma(e) {
|
|
|
5029
5095
|
}
|
|
5030
5096
|
return "";
|
|
5031
5097
|
}
|
|
5032
|
-
function
|
|
5098
|
+
function Va(e) {
|
|
5033
5099
|
let t = [];
|
|
5034
5100
|
for (let [n, r] of e.fields) {
|
|
5035
5101
|
if (r.primary || r.auto || r.ref || r.array || r.structure || r.display?.is_listable === !1) continue;
|
|
5036
5102
|
let e = (r.type || "").toLowerCase(), i = !!(r.enum || r.values);
|
|
5037
|
-
if (!(!
|
|
5103
|
+
if (!(!ca.has(e) && !i) && (t.push(n), t.length >= 8)) break;
|
|
5038
5104
|
}
|
|
5039
5105
|
return t;
|
|
5040
5106
|
}
|
|
5041
|
-
function
|
|
5107
|
+
function Ha(e, t, n, r) {
|
|
5042
5108
|
if (!t || t.startsWith("$")) return;
|
|
5043
|
-
let i =
|
|
5109
|
+
let i = Ga(e, t);
|
|
5044
5110
|
i.kind !== "missing" && (n.add(t), i.kind === "file" && r.addField(t, "file_metadata"));
|
|
5045
5111
|
}
|
|
5046
|
-
function
|
|
5112
|
+
function Ua(e, t, n, r) {
|
|
5047
5113
|
if (t.startsWith("$status.")) {
|
|
5048
5114
|
n.addExpand("statuses", "status_expand"), r !== "status_expand" && n.addExpand("statuses", r), r !== "status_expand" && n.addField(t, r);
|
|
5049
5115
|
return;
|
|
@@ -5058,14 +5124,14 @@ function Fa(e, t, n, r) {
|
|
|
5058
5124
|
n.addExpand("evidence", "evidence_expand"), r !== "evidence_expand" && n.addExpand("evidence", r), r !== "evidence_expand" && n.addField(t, r);
|
|
5059
5125
|
return;
|
|
5060
5126
|
}
|
|
5061
|
-
let i =
|
|
5127
|
+
let i = Ga(e, t);
|
|
5062
5128
|
i.kind === "field" && i.field.type === "ref" && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
|
|
5063
5129
|
}
|
|
5064
|
-
function
|
|
5130
|
+
function Wa(e) {
|
|
5065
5131
|
let t = e.snapshot().expand, n = [];
|
|
5066
5132
|
return t.refs && n.push("refs"), t.statuses && n.push("statuses"), t.properties && n.push("properties"), t.evidence && n.push("evidence"), n;
|
|
5067
5133
|
}
|
|
5068
|
-
function
|
|
5134
|
+
function Ga(e, t) {
|
|
5069
5135
|
if (!e) return { kind: t.startsWith("$") ? "synthetic" : "missing" };
|
|
5070
5136
|
if (t.startsWith("$status.")) return e.status_groups?.[t.slice(8)] ? { kind: "synthetic" } : { kind: "missing" };
|
|
5071
5137
|
if (t.startsWith("$property.")) return e.properties?.[t.slice(10)] ? { kind: "synthetic" } : { kind: "missing" };
|
|
@@ -5093,7 +5159,7 @@ var $ = class {
|
|
|
5093
5159
|
values() {
|
|
5094
5160
|
return [...this.#e];
|
|
5095
5161
|
}
|
|
5096
|
-
},
|
|
5162
|
+
}, Ka = class {
|
|
5097
5163
|
#e = /* @__PURE__ */ new Map();
|
|
5098
5164
|
#t = /* @__PURE__ */ new Map();
|
|
5099
5165
|
addField(e, t) {
|
|
@@ -5116,7 +5182,7 @@ var $ = class {
|
|
|
5116
5182
|
}
|
|
5117
5183
|
r.includes(n) || r.push(n);
|
|
5118
5184
|
}
|
|
5119
|
-
},
|
|
5185
|
+
}, qa = class extends Me {
|
|
5120
5186
|
constructor(e) {
|
|
5121
5187
|
super(e), this.state = {
|
|
5122
5188
|
hasError: !1,
|
|
@@ -5173,7 +5239,7 @@ var $ = class {
|
|
|
5173
5239
|
},
|
|
5174
5240
|
children: this.state.error?.message || "An unexpected error occurred."
|
|
5175
5241
|
}),
|
|
5176
|
-
/* @__PURE__ */ X("div", { children: /* @__PURE__ */ X(
|
|
5242
|
+
/* @__PURE__ */ X("div", { children: /* @__PURE__ */ X(W, {
|
|
5177
5243
|
onClick: this.handleRetry,
|
|
5178
5244
|
children: "Try again"
|
|
5179
5245
|
}) })
|
|
@@ -5184,15 +5250,15 @@ var $ = class {
|
|
|
5184
5250
|
};
|
|
5185
5251
|
//#endregion
|
|
5186
5252
|
//#region src/hooks/useObject.ts
|
|
5187
|
-
function
|
|
5253
|
+
function Ja(e, t) {
|
|
5188
5254
|
return [
|
|
5189
5255
|
"entity-item",
|
|
5190
5256
|
e,
|
|
5191
5257
|
t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]])
|
|
5192
5258
|
];
|
|
5193
5259
|
}
|
|
5194
|
-
function
|
|
5195
|
-
let n =
|
|
5260
|
+
function Ya(e, t) {
|
|
5261
|
+
let n = Ja(e, t), r = n[2];
|
|
5196
5262
|
return He({
|
|
5197
5263
|
queryKey: n,
|
|
5198
5264
|
queryFn: () => x(e, t),
|
|
@@ -5201,15 +5267,15 @@ function Va(e, t) {
|
|
|
5201
5267
|
}
|
|
5202
5268
|
//#endregion
|
|
5203
5269
|
//#region src/components/detail-layout/widgets/registry.ts
|
|
5204
|
-
var
|
|
5205
|
-
function
|
|
5206
|
-
|
|
5270
|
+
var Xa = /* @__PURE__ */ new Map();
|
|
5271
|
+
function Za(e, t) {
|
|
5272
|
+
Xa.set(e, t);
|
|
5207
5273
|
}
|
|
5208
|
-
function
|
|
5209
|
-
return
|
|
5274
|
+
function Qa(e) {
|
|
5275
|
+
return Xa.get(e);
|
|
5210
5276
|
}
|
|
5211
|
-
function
|
|
5212
|
-
return
|
|
5277
|
+
function $a(e) {
|
|
5278
|
+
return Xa.has(e);
|
|
5213
5279
|
}
|
|
5214
5280
|
//#endregion
|
|
5215
|
-
export {
|
|
5281
|
+
export { Dn as $, Mi as A, Tr as B, Hi as C, ji as D, Li as E, ni as F, ir as G, or as H, ai as I, nr as J, Vn as K, ri as L, di as M, ii as N, Ni as O, si as P, Tn as Q, qr as R, Gi as S, Ye as St, Ri as T, ar as U, cr as V, rr as W, Rn as X, Zn as Y, zn as Z, Ji as _, xt as _t, Ya as a, sn as at, Ui as b, pt as bt, ua as c, Gt as ct, Zi as d, Ht as dt, An as et, $i as f, Vt as ft, Qi as g, Dt as gt, qi as h, jt as ht, Ja as i, cn as it, vi as j, Pi as k, pa as l, Kt as lt, Xi as m, Nt as mt, $a as n, On as nt, qa as o, Xt as ot, Yi as p, Mt as pt, $n as q, Za as r, ln as rt, la as s, Yt as st, Qa as t, kn as tt, fa as u, Wt as ut, Ki as v, At as vt, Vi as w, Bi as x, Xe as xt, Wi as y, lt as yt, zr as z };
|