@declarion/react 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{DraggableChildrenTable-G4Sw1XAD.js → DraggableChildrenTable-BDnJK0AU.js} +38 -38
- package/dist-lib/{Grid-CXn-IK3H.js → Grid-CcCveEE7.js} +2 -2
- package/dist-lib/{LayoutRenderer-DX8pFS5A.js → LayoutRenderer-BReuhVdX.js} +377 -377
- package/dist-lib/{MarkdownRenderer-CreI9x2m.js → MarkdownRenderer-DPKDFR60.js} +1 -1
- package/dist-lib/{RefreshControl-DFh0-gCb.js → RefreshControl-KddgOhUG.js} +166 -166
- package/dist-lib/{SmartDetailPage.impl-K6Jj1-9z.js → SmartDetailPage.impl-D_hMxiHy.js} +589 -562
- package/dist-lib/{SmartRecordListPage.impl-DQW_uVfL.js → SmartRecordListPage.impl-GIo_mPIJ.js} +182 -182
- package/dist-lib/components/pages/exportRequest.d.ts +3 -3
- package/dist-lib/components/pages/list/filter-meta.d.ts +22 -8
- package/dist-lib/hooks/useCursorEntityData.d.ts +3 -2
- package/dist-lib/index.js +1429 -1524
- package/dist-lib/lib/anchor.d.ts +37 -0
- package/dist-lib/{registry-r4hiflwC.js → registry-DJKp0yaV.js} +564 -564
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/api.d.ts +3 -10
- package/dist-lib/types/schema.d.ts +25 -13
- package/dist-lib/{useCurrentScreen-CpQjVmrT.js → useCurrentScreen-A3xZDs7U.js} +1255 -1207
- package/dist-lib/{useProperties-CULxrNT4.js → useProperties-TlltWwLv.js} +33 -33
- package/dist-lib/{value-fUHxMV4r.js → value-CHY7LgZ-.js} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Gt as e,
|
|
2
|
-
import { ut as c } from "./registry-
|
|
1
|
+
import { Gt as e, Kt as t, Ln as n, Tn as r, bt as i, pn as a, pt as o, rt as s } from "./useCurrentScreen-A3xZDs7U.js";
|
|
2
|
+
import { ut as c } from "./registry-DJKp0yaV.js";
|
|
3
3
|
import { useEffect as l, useLayoutEffect as u, useMemo as d } from "react";
|
|
4
4
|
import { useSearchParams as f } from "react-router";
|
|
5
5
|
import { useInfiniteQuery as p, useMutation as m, useQueryClient as h } from "@tanstack/react-query";
|
|
@@ -54,11 +54,11 @@ var x = class {
|
|
|
54
54
|
let n, r = !1;
|
|
55
55
|
try {
|
|
56
56
|
n = await e(b(this.entity, t));
|
|
57
|
-
} catch (
|
|
58
|
-
if (t.after && i
|
|
57
|
+
} catch (i) {
|
|
58
|
+
if (t.after && a(i)) {
|
|
59
59
|
let { after: i, ...a } = t;
|
|
60
60
|
n = await e(b(this.entity, a)), r = !0;
|
|
61
|
-
} else throw
|
|
61
|
+
} else throw i;
|
|
62
62
|
}
|
|
63
63
|
return this.refs.merge(n.$refs), {
|
|
64
64
|
data: n.data.map((e) => v(e)),
|
|
@@ -72,7 +72,7 @@ var x = class {
|
|
|
72
72
|
}
|
|
73
73
|
async createMany(e) {
|
|
74
74
|
if (e.length === 0) return [];
|
|
75
|
-
let
|
|
75
|
+
let n = await t("system.batch", {
|
|
76
76
|
actions: e.map((e) => ({
|
|
77
77
|
action: `${this.entity}.__create`,
|
|
78
78
|
params: {
|
|
@@ -82,7 +82,7 @@ var x = class {
|
|
|
82
82
|
})),
|
|
83
83
|
atomic: !0
|
|
84
84
|
});
|
|
85
|
-
return S(
|
|
85
|
+
return S(n, `${this.entity}.__create`), n.results.map((e) => v(C(e)));
|
|
86
86
|
}
|
|
87
87
|
async update(e, t) {
|
|
88
88
|
return (await this.updateMany([{
|
|
@@ -92,7 +92,7 @@ var x = class {
|
|
|
92
92
|
}
|
|
93
93
|
async updateMany(e) {
|
|
94
94
|
if (e.length === 0) return [];
|
|
95
|
-
let
|
|
95
|
+
let n = await t("system.batch", {
|
|
96
96
|
actions: e.map(({ id: e, ...t }) => ({
|
|
97
97
|
action: `${this.entity}.__update`,
|
|
98
98
|
params: {
|
|
@@ -103,13 +103,13 @@ var x = class {
|
|
|
103
103
|
})),
|
|
104
104
|
atomic: !0
|
|
105
105
|
});
|
|
106
|
-
return S(
|
|
106
|
+
return S(n, `${this.entity}.__update`), n.results.map((e) => v(C(e)));
|
|
107
107
|
}
|
|
108
108
|
async delete(e) {
|
|
109
109
|
await this.deleteMany([e]);
|
|
110
110
|
}
|
|
111
111
|
async deleteMany(e) {
|
|
112
|
-
return e.length === 0 ? { count: 0 } : { count: (await
|
|
112
|
+
return e.length === 0 ? { count: 0 } : { count: (await i(`${this.entity}.__delete`, {
|
|
113
113
|
object_ids: e,
|
|
114
114
|
entity: this.entity
|
|
115
115
|
})).object_count ?? e.length };
|
|
@@ -118,7 +118,7 @@ var x = class {
|
|
|
118
118
|
await this.restoreMany([e]);
|
|
119
119
|
}
|
|
120
120
|
async restoreMany(e) {
|
|
121
|
-
return e.length === 0 ? { count: 0 } : { count: (await
|
|
121
|
+
return e.length === 0 ? { count: 0 } : { count: (await i(`${this.entity}.__restore`, {
|
|
122
122
|
object_ids: e,
|
|
123
123
|
entity: this.entity
|
|
124
124
|
})).object_count ?? e.length };
|
|
@@ -126,15 +126,15 @@ var x = class {
|
|
|
126
126
|
async upsert(e, t) {
|
|
127
127
|
return (await this.upsertMany([e], t))[0];
|
|
128
128
|
}
|
|
129
|
-
async upsertMany(e,
|
|
129
|
+
async upsertMany(e, n) {
|
|
130
130
|
if (e.length === 0) return [];
|
|
131
|
-
let r = await
|
|
131
|
+
let r = await t("system.batch", {
|
|
132
132
|
actions: e.map((e) => ({
|
|
133
133
|
action: `${this.entity}.__upsert`,
|
|
134
134
|
params: {
|
|
135
135
|
entity: this.entity,
|
|
136
136
|
fields: e,
|
|
137
|
-
unique_by:
|
|
137
|
+
unique_by: n
|
|
138
138
|
}
|
|
139
139
|
})),
|
|
140
140
|
atomic: !0
|
|
@@ -233,7 +233,7 @@ function k(e, t, n) {
|
|
|
233
233
|
//#endregion
|
|
234
234
|
//#region src/hooks/useTabSearchMirror.ts
|
|
235
235
|
function A(e) {
|
|
236
|
-
let t =
|
|
236
|
+
let t = o(), [n] = f();
|
|
237
237
|
u(() => {
|
|
238
238
|
if (!e || t.enabled) return;
|
|
239
239
|
let r = c.getState(), i = r.findTabByPathname(e);
|
|
@@ -247,7 +247,7 @@ function A(e) {
|
|
|
247
247
|
//#endregion
|
|
248
248
|
//#region src/hooks/useRegisterScreenTab.ts
|
|
249
249
|
function j(e, t, n, r) {
|
|
250
|
-
let i =
|
|
250
|
+
let i = o();
|
|
251
251
|
l(() => {
|
|
252
252
|
!e || i.enabled || c.getState().openTab({
|
|
253
253
|
pathname: e,
|
|
@@ -264,8 +264,8 @@ function j(e, t, n, r) {
|
|
|
264
264
|
]);
|
|
265
265
|
}
|
|
266
266
|
function M(e, t, n) {
|
|
267
|
-
let
|
|
268
|
-
j(t ?
|
|
267
|
+
let i = e?.route, a = t ? r(e?.display?.name) || r(t.display.name_plural) : "", o = e?.display?.icon || t?.display.icon;
|
|
268
|
+
j(t ? i : void 0, a, o, n);
|
|
269
269
|
}
|
|
270
270
|
//#endregion
|
|
271
271
|
//#region src/lib/filters.ts
|
|
@@ -328,16 +328,16 @@ function z(e) {
|
|
|
328
328
|
function B(e) {
|
|
329
329
|
return z(e).length;
|
|
330
330
|
}
|
|
331
|
-
function V(e,
|
|
331
|
+
function V(e, t) {
|
|
332
332
|
if (!e.field || !e.op) return "";
|
|
333
333
|
let r = F[e.op] || e.op;
|
|
334
334
|
if (N.has(e.op)) return `${r}`;
|
|
335
335
|
let i = e.field, a = (e) => {
|
|
336
|
-
if (
|
|
337
|
-
let
|
|
338
|
-
return
|
|
336
|
+
if (t) {
|
|
337
|
+
let n = t(i, e);
|
|
338
|
+
return n.label != null && (n.status === "special" || n.status === "resolved") ? n.label : n.raw;
|
|
339
339
|
}
|
|
340
|
-
return
|
|
340
|
+
return n(e);
|
|
341
341
|
};
|
|
342
342
|
return `${r} ${Array.isArray(e.value) ? e.value.map(a).join(", ") : a(e.value)}`;
|
|
343
343
|
}
|
|
@@ -373,13 +373,13 @@ function U(e, t) {
|
|
|
373
373
|
}
|
|
374
374
|
//#endregion
|
|
375
375
|
//#region src/api/status.ts
|
|
376
|
-
async function W(e, t, n,
|
|
376
|
+
async function W(e, t, n, r, a) {
|
|
377
377
|
let o = {
|
|
378
378
|
status_group_code: n,
|
|
379
|
-
status_code:
|
|
379
|
+
status_code: r
|
|
380
380
|
};
|
|
381
381
|
a != null && (o.note = a);
|
|
382
|
-
let s = (await
|
|
382
|
+
let s = (await i(`${e}.__update`, {
|
|
383
383
|
object_ids: [t],
|
|
384
384
|
entity: e,
|
|
385
385
|
fields: { $statuses: [o] }
|
|
@@ -396,25 +396,25 @@ function G(e, t) {
|
|
|
396
396
|
n.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
397
397
|
},
|
|
398
398
|
onError: (e) => {
|
|
399
|
-
|
|
399
|
+
s.error(e.message);
|
|
400
400
|
}
|
|
401
401
|
});
|
|
402
402
|
}
|
|
403
403
|
//#endregion
|
|
404
404
|
//#region src/api/properties.ts
|
|
405
|
-
async function K(e, t, n,
|
|
406
|
-
let a = (await
|
|
405
|
+
async function K(e, t, n, r) {
|
|
406
|
+
let a = (await i(`${e}.__update`, {
|
|
407
407
|
object_ids: [t],
|
|
408
408
|
entity: e,
|
|
409
409
|
fields: { $properties: [{
|
|
410
410
|
property_code: n,
|
|
411
|
-
value:
|
|
411
|
+
value: r
|
|
412
412
|
}] }
|
|
413
413
|
})).result?.rows?.[0]?.$properties ?? [];
|
|
414
414
|
return a.find((e) => e.property_code === n) ?? a[0];
|
|
415
415
|
}
|
|
416
416
|
async function q(e, t, n) {
|
|
417
|
-
await
|
|
417
|
+
await i(`${e}.__update`, {
|
|
418
418
|
object_ids: [t],
|
|
419
419
|
entity: e,
|
|
420
420
|
fields: { $properties: [{
|
|
@@ -433,7 +433,7 @@ function J(e, t) {
|
|
|
433
433
|
n.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
434
434
|
},
|
|
435
435
|
onError: (e) => {
|
|
436
|
-
|
|
436
|
+
s.error(e.message);
|
|
437
437
|
}
|
|
438
438
|
});
|
|
439
439
|
}
|
|
@@ -445,7 +445,7 @@ function Y(e, t) {
|
|
|
445
445
|
n.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
446
446
|
},
|
|
447
447
|
onError: (e) => {
|
|
448
|
-
|
|
448
|
+
s.error(e.message);
|
|
449
449
|
}
|
|
450
450
|
});
|
|
451
451
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as e, en as t, rn as n } from "./useCurrentScreen-
|
|
1
|
+
import { $t as e, en as t, rn as n } from "./useCurrentScreen-A3xZDs7U.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";
|