@declarion/react 0.38.0 → 0.38.5
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-CI5a0Emm.js → DraggableChildrenTable-DvJO6-m0.js} +1 -1
- package/dist-lib/{Grid-BZEMUmjI.js → Grid-D2ArPFCz.js} +2 -2
- package/dist-lib/{LayoutRenderer-CnKUYh8M.js → LayoutRenderer-C8DQ61Vo.js} +3 -3
- package/dist-lib/{MarkdownRenderer-DNmOqp_M.js → MarkdownRenderer-CSuODN70.js} +1 -1
- package/dist-lib/{RefreshControl-DsEXi6WF.js → RefreshControl-CHvOUn0o.js} +115 -115
- package/dist-lib/{SmartDetailPage.impl-BrIZmjFF.js → SmartDetailPage.impl-Cl306lX3.js} +7 -5
- package/dist-lib/{SmartRecordListPage.impl-Bi_FPbGy.js → SmartRecordListPage.impl-j8bhyL4e.js} +4 -4
- package/dist-lib/components/shared/ActionRunner.d.ts +15 -0
- package/dist-lib/index.js +1063 -1047
- package/dist-lib/{registry-B_AmhRdj.js → registry-C3hbFTDQ.js} +4 -3
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/schema.d.ts +3 -0
- package/dist-lib/{useCurrentScreen-CcsD2NAk.js → useCurrentScreen-DD3KdlMj.js} +829 -816
- package/dist-lib/{useProperties-CPtQIWXp.js → useProperties-CliP5qvg.js} +2 -2
- package/dist-lib/{value-BCjHI_Ai.js → value-CNy3_xCA.js} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DeRpAaXm.js";
|
|
2
|
-
import { Gn as t, Kn as n, bn as r, g as i, h as a, sn as o } from "./useCurrentScreen-
|
|
2
|
+
import { Gn as t, Kn as n, bn as r, g as i, h as a, sn as o } from "./useCurrentScreen-DD3KdlMj.js";
|
|
3
3
|
import { n as s, r as c, t as l } from "./dataTableStyles-vwD1mVOP.js";
|
|
4
4
|
import { useCallback as u, useMemo as d, useRef as f } from "react";
|
|
5
5
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as e, S as t, T as n, w as r, x as i, y as a } from "./useCurrentScreen-
|
|
2
|
-
import { c as o, i as s, l as c, t as l } from "./value-
|
|
1
|
+
import { C as e, S as t, T as n, w as r, x as i, y as a } from "./useCurrentScreen-DD3KdlMj.js";
|
|
2
|
+
import { c as o, i as s, l as c, t as l } from "./value-CNy3_xCA.js";
|
|
3
3
|
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
4
4
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
5
5
|
import { DndContext as v, PointerSensor as y, closestCenter as b, useSensor as x, useSensors as ee } from "@dnd-kit/core";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DeRpAaXm.js";
|
|
2
|
-
import { F as n, Gn as r, Kn as i, L as a, Nn as o, On as s, R as c, U as l, Wn as u, _ as d, an as f, at as p, bn as m, dn as h, en as g, fn as _, g as v, gn as y, h as b, hn as x, ht as S, it as C, jt as w, ln as T, m as E, on as D, rt as O, sn as k, un as A, zn as j } from "./useCurrentScreen-
|
|
3
|
-
import { E as M, J as N, K as ee, St as P, T as F, Y as I, d as L, dt as R, et as z, k as B, o as V, pt as te, q as ne, r as re, t as ie, tt as ae, u as oe, xt as se } from "./registry-
|
|
2
|
+
import { F as n, Gn as r, Kn as i, L as a, Nn as o, On as s, R as c, U as l, Wn as u, _ as d, an as f, at as p, bn as m, dn as h, en as g, fn as _, g as v, gn as y, h as b, hn as x, ht as S, it as C, jt as w, ln as T, m as E, on as D, rt as O, sn as k, un as A, zn as j } from "./useCurrentScreen-DD3KdlMj.js";
|
|
3
|
+
import { E as M, J as N, K as ee, St as P, T as F, Y as I, d as L, dt as R, et as z, k as B, o as V, pt as te, q as ne, r as re, t as ie, tt as ae, u as oe, xt as se } from "./registry-C3hbFTDQ.js";
|
|
4
4
|
import { n as ce, r as le, t as ue } from "./dataTableStyles-vwD1mVOP.js";
|
|
5
5
|
import { Suspense as de, createContext as fe, lazy as pe, useCallback as H, useContext as me, useEffect as U, useId as he, useLayoutEffect as ge, useMemo as W, useRef as G, useState as K } from "react";
|
|
6
6
|
import { useInfiniteQuery as _e, useMutation as ve, useQueryClient as ye } from "@tanstack/react-query";
|
|
@@ -2161,7 +2161,7 @@ function gt({ config: t, childEntity: n, schema: a, rows: o, onChange: s, valida
|
|
|
2161
2161
|
}
|
|
2162
2162
|
//#endregion
|
|
2163
2163
|
//#region src/components/detail-layout/ChildrenBlock.tsx
|
|
2164
|
-
var _t = pe(() => import("./DraggableChildrenTable-
|
|
2164
|
+
var _t = pe(() => import("./DraggableChildrenTable-DvJO6-m0.js").then((e) => ({ default: e.DraggableChildrenTable })));
|
|
2165
2165
|
function vt({ node: e, ctx: n }) {
|
|
2166
2166
|
let r = j(), i = e.children;
|
|
2167
2167
|
if (!i) return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DeRpAaXm.js";
|
|
2
|
-
import { $ as t, Gn as n, Hn as r, Kn as i, Nn as a, Pn as o, Wn as s, _t as c, et as l, i as u, jt as d, ot as f, un as p, xn as m } from "./useCurrentScreen-
|
|
2
|
+
import { $ as t, Gn as n, Hn as r, Kn as i, Nn as a, Pn as o, Wn as s, _t as c, et as l, i as u, jt as d, ot as f, un as p, xn as m } from "./useCurrentScreen-DD3KdlMj.js";
|
|
3
3
|
import { useCallback as h, useEffect as g, useId as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
4
4
|
import { useLocation as x } from "react-router-dom";
|
|
5
5
|
import { useQuery as S, useQueryClient as C } from "@tanstack/react-query";
|
|
@@ -165,23 +165,23 @@ function ae(e) {
|
|
|
165
165
|
return oe(ie(e, L));
|
|
166
166
|
}
|
|
167
167
|
function oe(e) {
|
|
168
|
-
if (
|
|
168
|
+
if (ce(e)) return e;
|
|
169
169
|
}
|
|
170
170
|
function se(e) {
|
|
171
171
|
let t = ae(e)?.identity;
|
|
172
|
-
return
|
|
172
|
+
return ce(t) ? t : void 0;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function ce(e) {
|
|
175
175
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function le(e) {
|
|
178
178
|
if (!e) return !1;
|
|
179
179
|
let t = e.trim();
|
|
180
180
|
return t ? t.startsWith("/") || t.startsWith("http://") || t.startsWith("https://") || t.startsWith("data:image/") : !1;
|
|
181
181
|
}
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region src/api/params.ts
|
|
184
|
-
async function
|
|
184
|
+
async function ue() {
|
|
185
185
|
let e = (await d("/api/params/public")).data;
|
|
186
186
|
if (Array.isArray(e)) return { parameters: e };
|
|
187
187
|
let t = e ?? {};
|
|
@@ -192,29 +192,29 @@ async function le() {
|
|
|
192
192
|
meta: t.meta
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
async function
|
|
195
|
+
async function R(e) {
|
|
196
196
|
return (await d(`/api/params/${encodeURIComponent(e)}`)).data;
|
|
197
197
|
}
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region src/hooks/useParams.ts
|
|
200
|
-
function
|
|
200
|
+
function z() {
|
|
201
201
|
return S({
|
|
202
202
|
queryKey: ["params-public"],
|
|
203
|
-
queryFn:
|
|
203
|
+
queryFn: ue,
|
|
204
204
|
staleTime: 300 * 1e3
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function B(e, t = {}) {
|
|
208
208
|
let n = t.enabled ?? !0;
|
|
209
209
|
return S({
|
|
210
210
|
queryKey: ["params", e],
|
|
211
|
-
queryFn: () =>
|
|
211
|
+
queryFn: () => R(e),
|
|
212
212
|
enabled: !!e && n,
|
|
213
213
|
staleTime: 60 * 1e3
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
let t = c((e) => e.isAuthenticated), n =
|
|
216
|
+
function V(e) {
|
|
217
|
+
let t = c((e) => e.isAuthenticated), n = z(), r = B(e, { enabled: t }), i = de(n.data?.parameters, e);
|
|
218
218
|
if (t && r.data?.found) return {
|
|
219
219
|
value: r.data.value,
|
|
220
220
|
found: !0,
|
|
@@ -231,13 +231,13 @@ function H(e) {
|
|
|
231
231
|
error: r.error ?? n.error ?? null
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function de(e, t) {
|
|
235
235
|
return e?.find((e) => e.code === t);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function H(e, t) {
|
|
238
238
|
let n = S({
|
|
239
239
|
queryKey: ["params", e],
|
|
240
|
-
queryFn: () =>
|
|
240
|
+
queryFn: () => R(e),
|
|
241
241
|
enabled: !!e,
|
|
242
242
|
staleTime: 60 * 1e3
|
|
243
243
|
}), r = n.data, i = !!r?.found;
|
|
@@ -251,55 +251,55 @@ function U(e, t) {
|
|
|
251
251
|
}
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region src/hooks/useBranding.ts
|
|
254
|
-
function
|
|
255
|
-
let e =
|
|
254
|
+
function U() {
|
|
255
|
+
let e = V(L);
|
|
256
256
|
return {
|
|
257
257
|
branding: oe(e.value),
|
|
258
258
|
isLoading: e.loading
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
return
|
|
261
|
+
function fe() {
|
|
262
|
+
return U().branding?.identity;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
return
|
|
264
|
+
function W() {
|
|
265
|
+
return U().branding?.chrome;
|
|
266
266
|
}
|
|
267
267
|
//#endregion
|
|
268
268
|
//#region src/stores/page-state.ts
|
|
269
|
-
var
|
|
270
|
-
function
|
|
271
|
-
|
|
269
|
+
var G = 1800 * 1e3, K = null;
|
|
270
|
+
function q(e) {
|
|
271
|
+
K = e;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
if (!(!e || !
|
|
273
|
+
function J(e) {
|
|
274
|
+
if (!(!e || !K)) for (let t of e.queryKeys) K.removeQueries({
|
|
275
275
|
queryKey: t,
|
|
276
276
|
exact: !0
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Y(e, t) {
|
|
280
280
|
let n = e[t];
|
|
281
281
|
if (!n) return e;
|
|
282
|
-
|
|
282
|
+
J(n);
|
|
283
283
|
let r = { ...e };
|
|
284
284
|
return delete r[t], r;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function pe(e, t) {
|
|
287
287
|
let n = e;
|
|
288
288
|
for (; Object.keys(n).length > 64;) {
|
|
289
289
|
let e = null, r = Infinity;
|
|
290
290
|
for (let [i, a] of Object.entries(n)) i !== t && a.lastActiveAt < r && (r = a.lastActiveAt, e = i);
|
|
291
291
|
if (e === null) break;
|
|
292
|
-
n =
|
|
292
|
+
n = Y(n, e);
|
|
293
293
|
}
|
|
294
294
|
return n;
|
|
295
295
|
}
|
|
296
|
-
var
|
|
296
|
+
var X = O((e, t) => ({
|
|
297
297
|
entries: {},
|
|
298
|
-
ttlMs:
|
|
298
|
+
ttlMs: G,
|
|
299
299
|
setTtl: (n) => {
|
|
300
300
|
if (n <= 0) {
|
|
301
301
|
let { entries: r } = t();
|
|
302
|
-
for (let e of Object.keys(r))
|
|
302
|
+
for (let e of Object.keys(r)) J(r[e]);
|
|
303
303
|
e({
|
|
304
304
|
ttlMs: n,
|
|
305
305
|
entries: {}
|
|
@@ -323,7 +323,7 @@ var Z = O((e, t) => ({
|
|
|
323
323
|
lastActiveAt: o,
|
|
324
324
|
queryKeys: []
|
|
325
325
|
};
|
|
326
|
-
e({ entries:
|
|
326
|
+
e({ entries: pe({
|
|
327
327
|
...a.entries,
|
|
328
328
|
[n]: c
|
|
329
329
|
}, n) });
|
|
@@ -347,7 +347,7 @@ var Z = O((e, t) => ({
|
|
|
347
347
|
registerQueryKey: (n, r) => {
|
|
348
348
|
let i = t();
|
|
349
349
|
if (i.ttlMs <= 0) return;
|
|
350
|
-
let a = Date.now(), o = i.entries[n], s = o?.queryKeys.some((e) =>
|
|
350
|
+
let a = Date.now(), o = i.entries[n], s = o?.queryKeys.some((e) => me(e, r));
|
|
351
351
|
if (o && s) return;
|
|
352
352
|
let c = o ? {
|
|
353
353
|
...o,
|
|
@@ -358,29 +358,29 @@ var Z = O((e, t) => ({
|
|
|
358
358
|
lastActiveAt: a,
|
|
359
359
|
queryKeys: [r]
|
|
360
360
|
};
|
|
361
|
-
e({ entries:
|
|
361
|
+
e({ entries: pe({
|
|
362
362
|
...i.entries,
|
|
363
363
|
[n]: c
|
|
364
364
|
}, n) });
|
|
365
365
|
},
|
|
366
366
|
kill: (n) => {
|
|
367
|
-
let r = t(), i =
|
|
367
|
+
let r = t(), i = Y(r.entries, n);
|
|
368
368
|
i !== r.entries && e({ entries: i });
|
|
369
369
|
},
|
|
370
370
|
sweep: (n) => {
|
|
371
371
|
let { ttlMs: r, entries: i } = t(), a = i;
|
|
372
|
-
for (let [e, t] of Object.entries(i)) (r <= 0 || n - t.lastActiveAt > r) && (a =
|
|
372
|
+
for (let [e, t] of Object.entries(i)) (r <= 0 || n - t.lastActiveAt > r) && (a = Y(a, e));
|
|
373
373
|
a !== i && e({ entries: a });
|
|
374
374
|
},
|
|
375
375
|
clear: () => {
|
|
376
376
|
let { entries: n } = t();
|
|
377
377
|
if (Object.keys(n).length !== 0) {
|
|
378
|
-
for (let e of Object.keys(n))
|
|
378
|
+
for (let e of Object.keys(n)) J(n[e]);
|
|
379
379
|
e({ entries: {} });
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
}));
|
|
383
|
-
function
|
|
383
|
+
function me(e, t) {
|
|
384
384
|
if (e === t) return !0;
|
|
385
385
|
try {
|
|
386
386
|
return JSON.stringify(e) === JSON.stringify(t);
|
|
@@ -390,29 +390,29 @@ function pe(e, t) {
|
|
|
390
390
|
}
|
|
391
391
|
//#endregion
|
|
392
392
|
//#region src/lib/canonical-url.ts
|
|
393
|
-
function
|
|
393
|
+
function he(e) {
|
|
394
394
|
return e.length > 1 && e.endsWith("/") ? e.replace(/\/+$/, "") || "/" : e;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
let t =
|
|
396
|
+
function Z(e) {
|
|
397
|
+
let t = he(e.pathname), n = e.search ?? "", r = n.startsWith("?") ? n.slice(1) : n, i = new URLSearchParams(r);
|
|
398
398
|
for (let e of l) i.delete(e);
|
|
399
399
|
i.sort();
|
|
400
400
|
let a = i.toString();
|
|
401
401
|
return a ? `${t}?${a}` : t;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
404
|
-
return
|
|
403
|
+
function ge(e) {
|
|
404
|
+
return he(e.pathname);
|
|
405
405
|
}
|
|
406
406
|
//#endregion
|
|
407
407
|
//#region src/hooks/usePageStateTtl.ts
|
|
408
|
-
var
|
|
409
|
-
function
|
|
410
|
-
let { value: e } =
|
|
411
|
-
return typeof e != "number" || !Number.isFinite(e) || e < 0 ?
|
|
408
|
+
var _e = "ui_page_state_ttl_ms";
|
|
409
|
+
function ve() {
|
|
410
|
+
let { value: e } = H(_e, G);
|
|
411
|
+
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? G : e;
|
|
412
412
|
}
|
|
413
413
|
//#endregion
|
|
414
414
|
//#region src/hooks/usePageStateRuntime.ts
|
|
415
|
-
var
|
|
415
|
+
var ye = [
|
|
416
416
|
["entity-data"],
|
|
417
417
|
["entity-count"],
|
|
418
418
|
["entity-item"],
|
|
@@ -420,27 +420,27 @@ var ve = [
|
|
|
420
420
|
["entity-data-all"],
|
|
421
421
|
["action-data"],
|
|
422
422
|
["action-data-cursor"]
|
|
423
|
-
],
|
|
424
|
-
function
|
|
425
|
-
for (let n of
|
|
426
|
-
}
|
|
427
|
-
function
|
|
428
|
-
let e = C(), t =
|
|
429
|
-
r.current = n, g(() => (
|
|
430
|
-
if (
|
|
423
|
+
], be = 6e4;
|
|
424
|
+
function xe(e, t) {
|
|
425
|
+
for (let n of ye) e.setQueryDefaults(n, { gcTime: t });
|
|
426
|
+
}
|
|
427
|
+
function Se() {
|
|
428
|
+
let e = C(), t = ve(), n = x(), r = y(n);
|
|
429
|
+
r.current = n, g(() => (q(e), () => q(null)), [e]), g(() => {
|
|
430
|
+
if (X.getState().setTtl(t), xe(e, t), t <= 0) for (let t of ye) e.removeQueries({ queryKey: t });
|
|
431
431
|
}, [e, t]), g(() => {
|
|
432
432
|
if (t <= 0) return;
|
|
433
433
|
let e = setInterval(() => {
|
|
434
|
-
let e =
|
|
435
|
-
e.touch(
|
|
436
|
-
},
|
|
434
|
+
let e = X.getState(), t = r.current;
|
|
435
|
+
e.touch(Z(t)), e.touch(ge(t)), e.sweep(Date.now());
|
|
436
|
+
}, be);
|
|
437
437
|
return () => clearInterval(e);
|
|
438
438
|
}, [t]);
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
let n =
|
|
440
|
+
function Ce(e, t = !0) {
|
|
441
|
+
let n = Z(x());
|
|
442
442
|
g(() => {
|
|
443
|
-
!t || !e ||
|
|
443
|
+
!t || !e || X.getState().registerQueryKey(n, e);
|
|
444
444
|
}, [
|
|
445
445
|
n,
|
|
446
446
|
e ? JSON.stringify(e) : "",
|
|
@@ -449,15 +449,15 @@ function Se(e, t = !0) {
|
|
|
449
449
|
}
|
|
450
450
|
//#endregion
|
|
451
451
|
//#region src/lib/record-documents-key.ts
|
|
452
|
-
var
|
|
452
|
+
var we = "record-documents";
|
|
453
453
|
//#endregion
|
|
454
454
|
//#region src/hooks/useBrandingChrome.ts
|
|
455
|
-
function
|
|
456
|
-
let e = t(), n =
|
|
455
|
+
function Te() {
|
|
456
|
+
let e = t(), n = W();
|
|
457
457
|
return (e.enabled ? n?.embed?.viewport : n?.full?.viewport) ?? "auto";
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
let n = t(), r =
|
|
459
|
+
function Ee(e) {
|
|
460
|
+
let n = t(), r = W();
|
|
461
461
|
return v(() => {
|
|
462
462
|
let t = { ...n.enabled ? r?.embed?.surfaces?.[e] : r?.full?.surfaces?.[e] };
|
|
463
463
|
return {
|
|
@@ -470,8 +470,8 @@ function Te(e) {
|
|
|
470
470
|
e
|
|
471
471
|
]);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
let e =
|
|
473
|
+
function De() {
|
|
474
|
+
let e = W();
|
|
475
475
|
return v(() => {
|
|
476
476
|
let t = { ...e?.full?.shell };
|
|
477
477
|
return {
|
|
@@ -482,26 +482,26 @@ function Ee() {
|
|
|
482
482
|
}
|
|
483
483
|
//#endregion
|
|
484
484
|
//#region src/components/pages/exportRequest.ts
|
|
485
|
-
var
|
|
486
|
-
function
|
|
485
|
+
var Oe = /* @__PURE__ */ new Set(["_select", "_actions"]);
|
|
486
|
+
function ke(e) {
|
|
487
487
|
let t = {};
|
|
488
488
|
return e.screenCode && (t.screen = e.screenCode), e.jsonFilters && e.jsonFilters.length > 0 && (t.filters = e.jsonFilters), e.search && (t.search = e.search), e.sort && (t.sort = e.sort), e.includeDeleted && (t.include_deleted = !0), e.page && (t.page = e.page), e.perPage && (t.per_page = e.perPage), t;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
let n = t.visibleColumns.filter((e) => !
|
|
490
|
+
function Ae(e, t) {
|
|
491
|
+
let n = t.visibleColumns.filter((e) => !Oe.has(e)), r = {
|
|
492
492
|
format: "csv",
|
|
493
493
|
scope: t.scope,
|
|
494
|
-
query:
|
|
494
|
+
query: ke(e),
|
|
495
495
|
columns: n
|
|
496
496
|
};
|
|
497
497
|
return t.scope === "selected_rows" && t.selectedRowPKs && t.selectedRowPKs.length > 0 && (r.selection = t.selectedRowPKs), t.locale && (r.locale = t.locale), t.filename && (r.filename = t.filename), r;
|
|
498
498
|
}
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region src/components/pages/DocumentsMenu.tsx
|
|
501
|
-
var
|
|
502
|
-
function
|
|
501
|
+
var je = "document-templates-available";
|
|
502
|
+
function Me({ entityCode: t, scope: n, objectIds: a = [], viewState: s, selectedIds: c = [], capability: l, canManageTemplates: d = !1 }) {
|
|
503
503
|
let { run: m } = u(), h = y(null), [g, _] = b(!1), x = n === "detail" ? !!l?.generate_one : !!l?.generate_many, C = d && !x, { data: D, isLoading: O, error: k } = S({
|
|
504
|
-
queryKey: [
|
|
504
|
+
queryKey: [je, t],
|
|
505
505
|
queryFn: async () => (await f("document.templates.available", { entity: t })).result?.templates ?? [],
|
|
506
506
|
enabled: g || C,
|
|
507
507
|
staleTime: 6e4
|
|
@@ -519,7 +519,7 @@ function je({ entityCode: t, scope: n, objectIds: a = [], viewState: s, selected
|
|
|
519
519
|
let e = [];
|
|
520
520
|
return s && e.push({
|
|
521
521
|
kind: "current_view",
|
|
522
|
-
query:
|
|
522
|
+
query: ke(s)
|
|
523
523
|
}), c.length > 0 && e.push({
|
|
524
524
|
kind: "selected",
|
|
525
525
|
objectIds: c
|
|
@@ -528,7 +528,7 @@ function je({ entityCode: t, scope: n, objectIds: a = [], viewState: s, selected
|
|
|
528
528
|
return [];
|
|
529
529
|
}
|
|
530
530
|
function I(e, t, n) {
|
|
531
|
-
let r =
|
|
531
|
+
let r = Ne(e), i = p(e.name) || e.code;
|
|
532
532
|
_(!1), m({
|
|
533
533
|
action: r,
|
|
534
534
|
title: i,
|
|
@@ -577,17 +577,17 @@ function je({ entityCode: t, scope: n, objectIds: a = [], viewState: s, selected
|
|
|
577
577
|
}),
|
|
578
578
|
!A && !k && j.map((t) => {
|
|
579
579
|
let n = F(t);
|
|
580
|
-
return n.length === 0 ? null :
|
|
580
|
+
return n.length === 0 ? null : Pe(t).flatMap((r) => n.map((n) => r.available ? /* @__PURE__ */ T(o, {
|
|
581
581
|
icon: /* @__PURE__ */ T(e.file, { size: 12 }),
|
|
582
582
|
onClick: () => I(t, n, r.format),
|
|
583
583
|
title: p(t.description),
|
|
584
|
-
children:
|
|
584
|
+
children: Fe(t, n, r.format)
|
|
585
585
|
}, `${t.source}:${t.code}:${n.kind}:${r.format}`) : /* @__PURE__ */ E(o, {
|
|
586
586
|
disabled: !0,
|
|
587
587
|
icon: /* @__PURE__ */ T(e.file, { size: 12 }),
|
|
588
588
|
title: r.disabled_reason,
|
|
589
589
|
children: [
|
|
590
|
-
|
|
590
|
+
Fe(t, n, r.format),
|
|
591
591
|
" - ",
|
|
592
592
|
r.disabled_reason || "Unavailable"
|
|
593
593
|
]
|
|
@@ -596,7 +596,7 @@ function je({ entityCode: t, scope: n, objectIds: a = [], viewState: s, selected
|
|
|
596
596
|
]
|
|
597
597
|
})] }) : null;
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function Ne(e) {
|
|
600
600
|
let t = new m((e.params ?? []).map((e) => ({
|
|
601
601
|
...e,
|
|
602
602
|
name: e.name ?? ""
|
|
@@ -611,13 +611,13 @@ function Me(e) {
|
|
|
611
611
|
resolved_params: t
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Pe(e) {
|
|
615
615
|
return e.outputs && e.outputs.length > 0 ? e.outputs : (e.allowed_outputs && e.allowed_outputs.length > 0 ? e.allowed_outputs : [e.output_format || "xlsx"]).map((e) => ({
|
|
616
616
|
format: e,
|
|
617
617
|
available: !0
|
|
618
618
|
}));
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function Fe(e, t, n) {
|
|
621
621
|
let r = p(e.name) || e.code, i = n ? ` (${n.toUpperCase()})` : "";
|
|
622
622
|
switch (t.kind) {
|
|
623
623
|
case "one": return `${r}${i}`;
|
|
@@ -628,16 +628,16 @@ function Pe(e, t, n) {
|
|
|
628
628
|
}
|
|
629
629
|
//#endregion
|
|
630
630
|
//#region src/lib/document-templates.ts
|
|
631
|
-
function
|
|
631
|
+
function Ie(e) {
|
|
632
632
|
return !!e?.entities?.document_template;
|
|
633
633
|
}
|
|
634
634
|
//#endregion
|
|
635
635
|
//#region src/lib/scroll-restoration.ts
|
|
636
|
-
var
|
|
637
|
-
function
|
|
636
|
+
var Le = "scroll", Re = 120, ze = 24, Be = 600;
|
|
637
|
+
function Ve(e, t) {
|
|
638
638
|
return Number.isFinite(e) ? Math.max(0, Math.min(e, Number.isFinite(t) && t > 0 ? t : 0)) : 0;
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function He(e, t, n) {
|
|
641
641
|
let r = Number.isFinite(e) ? e : 0;
|
|
642
642
|
if (t) {
|
|
643
643
|
let e = n[t.index];
|
|
@@ -653,33 +653,33 @@ function Ve(e, t, n) {
|
|
|
653
653
|
offset: r
|
|
654
654
|
};
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function Ue(e, t, n, r) {
|
|
657
657
|
if (!e) return null;
|
|
658
658
|
if (e.key) {
|
|
659
659
|
let i = t.indexOf(e.key);
|
|
660
660
|
if (i >= 0) {
|
|
661
661
|
let t = n(i);
|
|
662
|
-
if (t !== void 0) return
|
|
662
|
+
if (t !== void 0) return Ve(t + e.delta, r);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
return
|
|
665
|
+
return Ve(e.offset, r);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function We(e = Le) {
|
|
668
668
|
let t = x(), n = y(null);
|
|
669
669
|
if (n.current === null) {
|
|
670
|
-
let r =
|
|
670
|
+
let r = Z(t), i = X.getState().read(r, e);
|
|
671
671
|
n.current = i && Number.isFinite(i.offset) ? Math.max(0, i.offset) : 0;
|
|
672
672
|
}
|
|
673
673
|
return n.current;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Ge(e) {
|
|
676
676
|
let t = 0, n = null, r = () => {
|
|
677
677
|
n = null, t = Date.now(), e();
|
|
678
678
|
};
|
|
679
679
|
return {
|
|
680
680
|
trigger() {
|
|
681
681
|
let e = Date.now() - t;
|
|
682
|
-
e >=
|
|
682
|
+
e >= Re ? r() : n === null && (n = setTimeout(r, Re - e));
|
|
683
683
|
},
|
|
684
684
|
flush() {
|
|
685
685
|
n !== null && (clearTimeout(n), n = null), e();
|
|
@@ -689,8 +689,8 @@ function We(e) {
|
|
|
689
689
|
}
|
|
690
690
|
};
|
|
691
691
|
}
|
|
692
|
-
function
|
|
693
|
-
let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o =
|
|
692
|
+
function Ke(e) {
|
|
693
|
+
let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o = Z(x()), s = y(t);
|
|
694
694
|
s.current = t;
|
|
695
695
|
let c = y(r);
|
|
696
696
|
c.current = r;
|
|
@@ -701,7 +701,7 @@ function Ge(e) {
|
|
|
701
701
|
if (!a) return;
|
|
702
702
|
let e = s.current;
|
|
703
703
|
if (!e || r.length === 0) return;
|
|
704
|
-
let t =
|
|
704
|
+
let t = X.getState().read(o, i), n = l.current !== o;
|
|
705
705
|
if (l.current = o, !t) {
|
|
706
706
|
n && e.scrollToOffset(0, {
|
|
707
707
|
align: "start",
|
|
@@ -712,11 +712,11 @@ function Ge(e) {
|
|
|
712
712
|
let u = 0, d = 0, f = NaN, p = () => {
|
|
713
713
|
let e = s.current;
|
|
714
714
|
if (!e) return;
|
|
715
|
-
let n =
|
|
715
|
+
let n = Ue(t, c.current, (t) => e.getOffsetForIndex(t, "start")?.[0], e.getTotalSize());
|
|
716
716
|
n !== null && (Number.isNaN(f) || Math.abs(n - f) > 1) && (e.scrollToOffset(n, {
|
|
717
717
|
align: "start",
|
|
718
718
|
behavior: "auto"
|
|
719
|
-
}), f = n, d++ <
|
|
719
|
+
}), f = n, d++ < ze && (u = requestAnimationFrame(p)));
|
|
720
720
|
};
|
|
721
721
|
return p(), () => {
|
|
722
722
|
u && cancelAnimationFrame(u);
|
|
@@ -726,27 +726,27 @@ function Ge(e) {
|
|
|
726
726
|
o,
|
|
727
727
|
r,
|
|
728
728
|
i
|
|
729
|
-
]),
|
|
729
|
+
]), Q(n, a, o, i, (e) => {
|
|
730
730
|
let t = s.current;
|
|
731
731
|
if (!t) return null;
|
|
732
732
|
let n = e.scrollTop, r = n > 0 ? n : t.scrollOffset ?? 0;
|
|
733
|
-
return
|
|
733
|
+
return He(r, t.getVirtualItemForOffset(r), c.current);
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function Q(e, t, n, r, i) {
|
|
737
737
|
let a = y(i);
|
|
738
738
|
a.current = i, g(() => {
|
|
739
739
|
if (!t) return;
|
|
740
|
-
let i = 0, o =
|
|
740
|
+
let i = 0, o = Be, s = null, c = null, l = (e) => {
|
|
741
741
|
let t = a.current(e);
|
|
742
|
-
t &&
|
|
742
|
+
t && X.getState().set(n, r, t);
|
|
743
743
|
}, u = () => c?.trigger(), d = () => {
|
|
744
744
|
let t = e.current;
|
|
745
745
|
if (!t) {
|
|
746
746
|
o-- > 0 && (i = requestAnimationFrame(d));
|
|
747
747
|
return;
|
|
748
748
|
}
|
|
749
|
-
s = t, c =
|
|
749
|
+
s = t, c = Ge(() => l(t)), t.addEventListener("scroll", u, { passive: !0 });
|
|
750
750
|
};
|
|
751
751
|
return d(), () => {
|
|
752
752
|
i && cancelAnimationFrame(i), s && s.removeEventListener("scroll", u), c?.flush();
|
|
@@ -759,17 +759,17 @@ function Ke(e, t, n, r, i) {
|
|
|
759
759
|
]);
|
|
760
760
|
}
|
|
761
761
|
function qe(e) {
|
|
762
|
-
let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i =
|
|
762
|
+
let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i = Z(x()), a = y(null);
|
|
763
763
|
g(() => {
|
|
764
764
|
if (!r || a.current === i) return;
|
|
765
|
-
let e = 0, o =
|
|
765
|
+
let e = 0, o = Be, s = () => {
|
|
766
766
|
let r = t.current;
|
|
767
767
|
if (!r) {
|
|
768
768
|
o-- > 0 && (e = requestAnimationFrame(s));
|
|
769
769
|
return;
|
|
770
770
|
}
|
|
771
771
|
a.current = i;
|
|
772
|
-
let c =
|
|
772
|
+
let c = X.getState().read(i, n);
|
|
773
773
|
c && (r.scrollTop = Number.isFinite(c.offset) ? Math.max(0, c.offset) : 0);
|
|
774
774
|
};
|
|
775
775
|
return s(), () => {
|
|
@@ -780,7 +780,7 @@ function qe(e) {
|
|
|
780
780
|
i,
|
|
781
781
|
n,
|
|
782
782
|
t
|
|
783
|
-
]),
|
|
783
|
+
]), Q(t, r, i, n, (e) => ({
|
|
784
784
|
key: "",
|
|
785
785
|
delta: 0,
|
|
786
786
|
offset: e.scrollTop
|
|
@@ -832,4 +832,4 @@ function Ze({ liveObject: t, realtime: r = !0 }) {
|
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
834
|
//#endregion
|
|
835
|
-
export {
|
|
835
|
+
export { B as A, G as C, V as D, fe as E, I as F, F as I, k as L, le as M, re as N, H as O, ee as P, Z as S, U as T, Se as _, Le as a, ve as b, Ke as c, Ae as d, Ee as f, xe as g, we as h, Ye as i, se as j, z as k, Ie as l, Te as m, Xe as n, qe as o, De as p, Je as r, We as s, Ze as t, Me as u, Ce as v, X as w, ge as x, _e as y };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DeRpAaXm.js";
|
|
2
|
-
import { $ as n, B as r, Gn as i, I as a, Kn as o, L as s, Nn as c, S as l, W as u, Wn as d, Xt as f, Z as p, _t as m, an as h, b as g, bn as _, cn as v, fn as y, g as b, gt as ee, h as te, i as x, ln as ne, lt as S, mn as C, nt as w, on as re, ot as T, sn as ie, un as E, ut as D, v as O, z as k, zn as ae } from "./useCurrentScreen-
|
|
3
|
-
import {
|
|
4
|
-
import { $ as he, D as ge, G as _e, H as ve, K as ye, L as P, M as be, O as xe, Q as Se, St as Ce, U as we, W as Te, X as Ee, Z as De, _ as Oe, a as ke, dt as Ae, et as je, ft as Me, i as Ne, nt as Pe, q as Fe, s as Ie, tt as Le, vt as Re, w as ze, z as Be } from "./registry-
|
|
2
|
+
import { $ as n, B as r, Gn as i, I as a, Kn as o, L as s, Nn as c, S as l, W as u, Wn as d, Xt as f, Z as p, _t as m, an as h, b as g, bn as _, cn as v, fn as y, g as b, gt as ee, h as te, i as x, ln as ne, lt as S, mn as C, nt as w, on as re, ot as T, sn as ie, un as E, ut as D, v as O, z as k, zn as ae } from "./useCurrentScreen-DD3KdlMj.js";
|
|
3
|
+
import { L as oe, N as se, P as ce, S as le, f as A, h as j, i as ue, l as de, o as fe, t as M, u as N, v as pe, w as me } from "./RefreshControl-CHvOUn0o.js";
|
|
4
|
+
import { $ as he, D as ge, G as _e, H as ve, K as ye, L as P, M as be, O as xe, Q as Se, St as Ce, U as we, W as Te, X as Ee, Z as De, _ as Oe, a as ke, dt as Ae, et as je, ft as Me, i as Ne, nt as Pe, q as Fe, s as Ie, tt as Le, vt as Re, w as ze, z as Be } from "./registry-C3hbFTDQ.js";
|
|
5
5
|
import { n as Ve, r as He, t as Ue } from "./dataTableStyles-vwD1mVOP.js";
|
|
6
|
-
import { n as We, t as Ge } from "./LayoutRenderer-
|
|
6
|
+
import { n as We, t as Ge } from "./LayoutRenderer-C8DQ61Vo.js";
|
|
7
7
|
import { Fragment as Ke, useCallback as F, useEffect as I, useMemo as L, useRef as qe, useState as R } from "react";
|
|
8
8
|
import { useLocation as Je, useParams as Ye, useSearchParams as Xe } from "react-router-dom";
|
|
9
9
|
import { useQuery as Ze, useQueryClient as Qe } from "@tanstack/react-query";
|
|
@@ -1680,6 +1680,7 @@ function Ct({ title: n, recordId: r, editing: i, isNew: a, isRecordDeleted: s, d
|
|
|
1680
1680
|
return ce({
|
|
1681
1681
|
action: t,
|
|
1682
1682
|
title: E(t.display?.name) || e,
|
|
1683
|
+
row: y ?? void 0,
|
|
1683
1684
|
execute: (e) => T(n, w(e, r)),
|
|
1684
1685
|
onSuccess: i ? () => {
|
|
1685
1686
|
me.getState().kill(le(location)), de(i, { replace: !0 });
|
|
@@ -1693,7 +1694,8 @@ function Ct({ title: n, recordId: r, editing: i, isNew: a, isRecordDeleted: s, d
|
|
|
1693
1694
|
entityActions: h?.actions,
|
|
1694
1695
|
globalActions: _,
|
|
1695
1696
|
reservedRightWidth: 0,
|
|
1696
|
-
widgetContext: ve
|
|
1697
|
+
widgetContext: ve,
|
|
1698
|
+
constrain: !1
|
|
1697
1699
|
}) : null, Se = !a && b ? /* @__PURE__ */ z(M, {
|
|
1698
1700
|
liveObject: ae,
|
|
1699
1701
|
realtime: oe
|