@declarion/react 0.40.0 → 0.40.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-Ctmn0liO.js → DraggableChildrenTable-BkqtkJuz.js} +29 -29
- package/dist-lib/{Grid-BsIkTp3u.js → Grid-CTxov4x2.js} +2 -2
- package/dist-lib/{LayoutRenderer-D4oTfZhV.js → LayoutRenderer-Cbh-pY26.js} +307 -307
- package/dist-lib/{MarkdownRenderer-B-2CrtjU.js → MarkdownRenderer-DeguFsZL.js} +1 -1
- package/dist-lib/{RefreshControl-VQf34HKZ.js → RefreshControl-DG2kMABB.js} +165 -165
- package/dist-lib/{SmartDetailPage.impl-HMaLVDlV.js → SmartDetailPage.impl-DCJ_V-Nh.js} +458 -458
- package/dist-lib/{SmartRecordListPage.impl-Cxm7qvlZ.js → SmartRecordListPage.impl-sYCMQw8V.js} +183 -183
- package/dist-lib/components/primitives/Fields.d.ts +7 -0
- package/dist-lib/components/primitives/index.d.ts +2 -2
- package/dist-lib/index.js +1927 -1894
- package/dist-lib/lib/filters.d.ts +5 -0
- package/dist-lib/{registry-DFtAh6zc.js → registry-DbZX1hy8.js} +410 -410
- package/dist-lib/testing.js +25 -25
- package/dist-lib/{useCurrentScreen-mw8TfE8q.js → useCurrentScreen-C33VZcNn.js} +1118 -967
- package/dist-lib/{useProperties-gMdnhdhO.js → useProperties-BgAEk8X9.js} +27 -27
- package/dist-lib/{value-t9ETvWIJ.js → value-VOi8Svry.js} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Fn as e, Kt as t, Tn as n, it as r, mn as i, mt as a, qt as o, xt as s } from "./useCurrentScreen-
|
|
2
|
-
import { ut as c } from "./registry-
|
|
1
|
+
import { Fn as e, Kt as t, Tn as n, it as r, mn as i, mt as a, qt as o, xt as s } from "./useCurrentScreen-C33VZcNn.js";
|
|
2
|
+
import { ut as c } from "./registry-DbZX1hy8.js";
|
|
3
3
|
import { useEffect as l, useLayoutEffect as u, useMemo as d } from "react";
|
|
4
4
|
import { useSearchParams as f } from "react-router-dom";
|
|
5
5
|
import { useInfiniteQuery as p, useMutation as m, useQueryClient as h } from "@tanstack/react-query";
|
|
@@ -279,7 +279,7 @@ var N = /* @__PURE__ */ new Set([
|
|
|
279
279
|
"last_30_days",
|
|
280
280
|
"last_hour",
|
|
281
281
|
"last_24_hours"
|
|
282
|
-
]), P = {
|
|
282
|
+
]), P = /* @__PURE__ */ new Set(["in", "not_in"]), F = {
|
|
283
283
|
eq: "is",
|
|
284
284
|
not_eq: "is not",
|
|
285
285
|
gt: ">",
|
|
@@ -301,7 +301,7 @@ var N = /* @__PURE__ */ new Set([
|
|
|
301
301
|
last_hour: "last hour",
|
|
302
302
|
last_24_hours: "last 24 hours"
|
|
303
303
|
};
|
|
304
|
-
function
|
|
304
|
+
function I(e) {
|
|
305
305
|
let t = e.get("filters");
|
|
306
306
|
if (!t) return [];
|
|
307
307
|
try {
|
|
@@ -311,26 +311,26 @@ function F(e) {
|
|
|
311
311
|
return [];
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function L(e, t) {
|
|
315
315
|
e.length === 0 ? t.delete("filters") : t.set("filters", JSON.stringify(e));
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function R(e) {
|
|
318
318
|
return e.some((e) => e.or != null);
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function z(e) {
|
|
321
321
|
let t = [];
|
|
322
322
|
for (let n of e) if (!(!n || typeof n != "object")) {
|
|
323
|
-
if (n.field && n.op && t.push(n), n.or) for (let e of n.or) t.push(...
|
|
324
|
-
n.and && t.push(...
|
|
323
|
+
if (n.field && n.op && t.push(n), n.or) for (let e of n.or) t.push(...z(e));
|
|
324
|
+
n.and && t.push(...z(n.and));
|
|
325
325
|
}
|
|
326
326
|
return t;
|
|
327
327
|
}
|
|
328
|
-
function
|
|
329
|
-
return
|
|
328
|
+
function B(e) {
|
|
329
|
+
return z(e).length;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function V(t, n) {
|
|
332
332
|
if (!t.field || !t.op) return "";
|
|
333
|
-
let r =
|
|
333
|
+
let r = F[t.op] || t.op;
|
|
334
334
|
if (N.has(t.op)) return `${r}`;
|
|
335
335
|
let i = t.field, a = (t) => {
|
|
336
336
|
if (n) {
|
|
@@ -341,18 +341,18 @@ function B(t, n) {
|
|
|
341
341
|
};
|
|
342
342
|
return `${r} ${Array.isArray(t.value) ? t.value.map(a).join(", ") : a(t.value)}`;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function H(e, t) {
|
|
345
345
|
return {
|
|
346
346
|
field: e,
|
|
347
347
|
op: "eq",
|
|
348
348
|
value: t
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function U(e, t) {
|
|
352
352
|
let n = [];
|
|
353
353
|
for (let r of e) if (r.field !== t) {
|
|
354
354
|
if (r.or) {
|
|
355
|
-
let e = r.or.map((e) =>
|
|
355
|
+
let e = r.or.map((e) => U(e, t)).filter((e) => e.length > 0);
|
|
356
356
|
e.length > 0 && n.push({
|
|
357
357
|
...r,
|
|
358
358
|
or: e
|
|
@@ -360,7 +360,7 @@ function H(e, t) {
|
|
|
360
360
|
continue;
|
|
361
361
|
}
|
|
362
362
|
if (r.and) {
|
|
363
|
-
let e =
|
|
363
|
+
let e = U(r.and, t);
|
|
364
364
|
e.length > 0 && n.push({
|
|
365
365
|
...r,
|
|
366
366
|
and: e
|
|
@@ -373,7 +373,7 @@ function H(e, t) {
|
|
|
373
373
|
}
|
|
374
374
|
//#endregion
|
|
375
375
|
//#region src/api/status.ts
|
|
376
|
-
async function
|
|
376
|
+
async function W(e, t, n, r, i) {
|
|
377
377
|
let a = {
|
|
378
378
|
status_group_code: n,
|
|
379
379
|
status_code: r
|
|
@@ -388,10 +388,10 @@ async function U(e, t, n, r, i) {
|
|
|
388
388
|
}
|
|
389
389
|
//#endregion
|
|
390
390
|
//#region src/hooks/useObjectStatus.ts
|
|
391
|
-
function
|
|
391
|
+
function G(e, t) {
|
|
392
392
|
let n = h();
|
|
393
393
|
return m({
|
|
394
|
-
mutationFn: ({ groupCode: n, statusCode: r, note: i }) =>
|
|
394
|
+
mutationFn: ({ groupCode: n, statusCode: r, note: i }) => W(e, t, n, r, i),
|
|
395
395
|
onSuccess: () => {
|
|
396
396
|
n.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
397
397
|
},
|
|
@@ -402,7 +402,7 @@ function W(e, t) {
|
|
|
402
402
|
}
|
|
403
403
|
//#endregion
|
|
404
404
|
//#region src/api/properties.ts
|
|
405
|
-
async function
|
|
405
|
+
async function K(e, t, n, r) {
|
|
406
406
|
let i = (await s(`${e}.__update`, {
|
|
407
407
|
object_ids: [t],
|
|
408
408
|
entity: e,
|
|
@@ -413,7 +413,7 @@ async function G(e, t, n, r) {
|
|
|
413
413
|
})).result?.rows?.[0]?.$properties ?? [];
|
|
414
414
|
return i.find((e) => e.property_code === n) ?? i[0];
|
|
415
415
|
}
|
|
416
|
-
async function
|
|
416
|
+
async function q(e, t, n) {
|
|
417
417
|
await s(`${e}.__update`, {
|
|
418
418
|
object_ids: [t],
|
|
419
419
|
entity: e,
|
|
@@ -425,10 +425,10 @@ async function K(e, t, n) {
|
|
|
425
425
|
}
|
|
426
426
|
//#endregion
|
|
427
427
|
//#region src/hooks/useProperties.ts
|
|
428
|
-
function
|
|
428
|
+
function J(e, t) {
|
|
429
429
|
let n = h();
|
|
430
430
|
return m({
|
|
431
|
-
mutationFn: ({ propertyCode: n, value: r }) =>
|
|
431
|
+
mutationFn: ({ propertyCode: n, value: r }) => K(e, t, n, r),
|
|
432
432
|
onSuccess: () => {
|
|
433
433
|
n.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
434
434
|
},
|
|
@@ -437,10 +437,10 @@ function q(e, t) {
|
|
|
437
437
|
}
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Y(e, t) {
|
|
441
441
|
let n = h();
|
|
442
442
|
return m({
|
|
443
|
-
mutationFn: (n) =>
|
|
443
|
+
mutationFn: (n) => q(e, t, n),
|
|
444
444
|
onSuccess: () => {
|
|
445
445
|
n.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
446
446
|
},
|
|
@@ -450,4 +450,4 @@ function J(e, t) {
|
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
452
|
//#endregion
|
|
453
|
-
export {
|
|
453
|
+
export { y as C, x as S, A as _, N as a, D as b, H as c, R as d, I as f, j as g, M as h, P as i, z as l, L as m, J as n, F as o, U as p, G as r, B as s, Y as t, V as u, E as v, T as w, k as x, O as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { en as e, in as t, tn as n } from "./useCurrentScreen-
|
|
1
|
+
import { en as e, in as t, tn as n } from "./useCurrentScreen-C33VZcNn.js";
|
|
2
2
|
import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
3
3
|
//#region src/embed/file-src.ts
|
|
4
4
|
var s = "/api/files";
|