@declarion/react 0.39.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-DziCVhq6.js → DraggableChildrenTable-BkqtkJuz.js} +48 -48
- package/dist-lib/{Grid-BTX2tkCT.js → Grid-CTxov4x2.js} +42 -42
- package/dist-lib/{LayoutRenderer-CwMERoPJ.js → LayoutRenderer-Cbh-pY26.js} +597 -597
- package/dist-lib/{MarkdownRenderer-dHOTEhUa.js → MarkdownRenderer-DeguFsZL.js} +1 -1
- package/dist-lib/{RefreshControl--UAgflh7.js → RefreshControl-DG2kMABB.js} +65 -65
- package/dist-lib/SmartDetailPage.impl-DCJ_V-Nh.js +1802 -0
- package/dist-lib/{SmartRecordListPage.impl-CZXzVhPC.js → SmartRecordListPage.impl-sYCMQw8V.js} +219 -219
- package/dist-lib/components/primitives/Fields.d.ts +7 -0
- package/dist-lib/components/primitives/index.d.ts +2 -2
- package/dist-lib/components/shared/ActionButton.d.ts +1 -7
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/index.js +2549 -2394
- package/dist-lib/lib/actions.d.ts +27 -0
- package/dist-lib/lib/filters.d.ts +5 -0
- package/dist-lib/{registry-DXNFRlbB.js → registry-DbZX1hy8.js} +1777 -2406
- package/dist-lib/testing.js +16 -16
- package/dist-lib/{useCurrentScreen-BA2lb-d7.js → useCurrentScreen-C33VZcNn.js} +1438 -1085
- package/dist-lib/{useProperties-Br2DeOQh.js → useProperties-BgAEk8X9.js} +73 -73
- package/dist-lib/{value-C91loRXp.js → value-VOi8Svry.js} +4 -4
- package/package.json +1 -1
- package/dist-lib/SmartDetailPage.impl-Bj7MtHxi.js +0 -1827
- package/dist-lib/components/shared/ActionConfirmDialog.d.ts +0 -10
package/dist-lib/testing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as e, Dt as t, Mt as n, Ot as r, bt as i, kt as a, r as o, t as s } from "./useCurrentScreen-C33VZcNn.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { MemoryRouter as l } from "react-router-dom";
|
|
4
4
|
import { QueryClient as u, QueryClientProvider as d } from "@tanstack/react-query";
|
|
@@ -59,7 +59,7 @@ function S() {
|
|
|
59
59
|
code: "test",
|
|
60
60
|
name: "Test",
|
|
61
61
|
role: "admin"
|
|
62
|
-
},
|
|
62
|
+
}, t = {
|
|
63
63
|
id: "test-user",
|
|
64
64
|
email: "test@example.com",
|
|
65
65
|
display_name: "Test User",
|
|
@@ -70,7 +70,7 @@ function S() {
|
|
|
70
70
|
created_at: "2026-01-01T00:00:00Z",
|
|
71
71
|
updated_at: "2026-01-01T00:00:00Z"
|
|
72
72
|
};
|
|
73
|
-
|
|
73
|
+
n.getState().setUser(t, e);
|
|
74
74
|
}
|
|
75
75
|
function C(e) {
|
|
76
76
|
if (e === void 0) return { rows: [] };
|
|
@@ -86,10 +86,10 @@ function C(e) {
|
|
|
86
86
|
return e;
|
|
87
87
|
}
|
|
88
88
|
function w(e) {
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
let r =
|
|
92
|
-
return
|
|
89
|
+
let n = e.entityData ?? {};
|
|
90
|
+
a((e, t) => {
|
|
91
|
+
let r = n[e], i = C(r), a = i.meta?.per_page ?? 50, o = i.meta?.total ?? i.rows.length;
|
|
92
|
+
return t.count === "only" ? {
|
|
93
93
|
data: [],
|
|
94
94
|
meta: {
|
|
95
95
|
page: 1,
|
|
@@ -109,23 +109,23 @@ function w(e) {
|
|
|
109
109
|
};
|
|
110
110
|
});
|
|
111
111
|
let o = e.entityItems ?? {}, s = e.entityItemResponses ?? {};
|
|
112
|
-
|
|
113
|
-
let
|
|
114
|
-
if (
|
|
115
|
-
if (
|
|
116
|
-
let a = o[e]?.[
|
|
112
|
+
r((e, t) => {
|
|
113
|
+
let n = typeof t == "string" ? t : i(t), r = s[e]?.[n];
|
|
114
|
+
if (r instanceof Error) throw r;
|
|
115
|
+
if (r !== void 0) return r;
|
|
116
|
+
let a = o[e]?.[n];
|
|
117
117
|
if (a instanceof Error) throw a;
|
|
118
118
|
return { data: a };
|
|
119
119
|
});
|
|
120
120
|
let c = e.actionResults ?? {};
|
|
121
|
-
|
|
121
|
+
t(async (e, t) => {
|
|
122
122
|
if (!(e in c)) throw Error(`renderWithDeclarion: no action result registered for "${e}" (seed it via actionResults)`);
|
|
123
123
|
let n = c[e];
|
|
124
124
|
return x(typeof n == "function" ? await n(t) : n);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
function T() {
|
|
128
|
-
|
|
128
|
+
a(null), r(null), t(null), n.setState({
|
|
129
129
|
user: null,
|
|
130
130
|
isAuthenticated: !1,
|
|
131
131
|
activeTenant: null,
|
|
@@ -153,13 +153,13 @@ function E(t, n = {}) {
|
|
|
153
153
|
}) : a);
|
|
154
154
|
return Object.assign(c, { queryClient: r });
|
|
155
155
|
}
|
|
156
|
-
function D({ children: e, authenticated:
|
|
156
|
+
function D({ children: e, authenticated: t = !0, ...r }) {
|
|
157
157
|
let [i] = c(() => {
|
|
158
158
|
let e = new u({ defaultOptions: { queries: {
|
|
159
159
|
retry: !1,
|
|
160
160
|
gcTime: Infinity
|
|
161
161
|
} } });
|
|
162
|
-
return
|
|
162
|
+
return t ? (S(), e.setQueryData(["schema", !0], r.schema ?? g())) : n.setState({
|
|
163
163
|
user: null,
|
|
164
164
|
isAuthenticated: !1,
|
|
165
165
|
activeTenant: null,
|