@declarion/react 0.40.0 → 0.40.2
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
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: [] };
|
|
@@ -85,10 +85,10 @@ function C(e) {
|
|
|
85
85
|
}
|
|
86
86
|
return e;
|
|
87
87
|
}
|
|
88
|
-
function w(
|
|
89
|
-
let
|
|
88
|
+
function w(e) {
|
|
89
|
+
let n = e.entityData ?? {};
|
|
90
90
|
a((e, t) => {
|
|
91
|
-
let
|
|
91
|
+
let r = n[e], i = C(r), a = i.meta?.per_page ?? 50, o = i.meta?.total ?? i.rows.length;
|
|
92
92
|
return t.count === "only" ? {
|
|
93
93
|
data: [],
|
|
94
94
|
meta: {
|
|
@@ -108,8 +108,8 @@ function w(t) {
|
|
|
108
108
|
...i.refs === void 0 ? {} : { $refs: i.refs }
|
|
109
109
|
};
|
|
110
110
|
});
|
|
111
|
-
let o =
|
|
112
|
-
|
|
111
|
+
let o = e.entityItems ?? {}, s = e.entityItemResponses ?? {};
|
|
112
|
+
r((e, t) => {
|
|
113
113
|
let n = typeof t == "string" ? t : i(t), r = s[e]?.[n];
|
|
114
114
|
if (r instanceof Error) throw r;
|
|
115
115
|
if (r !== void 0) return r;
|
|
@@ -117,49 +117,49 @@ function w(t) {
|
|
|
117
117
|
if (a instanceof Error) throw a;
|
|
118
118
|
return { data: a };
|
|
119
119
|
});
|
|
120
|
-
let c =
|
|
121
|
-
|
|
120
|
+
let c = e.actionResults ?? {};
|
|
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
|
-
a(null),
|
|
128
|
+
a(null), r(null), t(null), n.setState({
|
|
129
129
|
user: null,
|
|
130
130
|
isAuthenticated: !1,
|
|
131
131
|
activeTenant: null,
|
|
132
132
|
tenants: []
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
function E(
|
|
136
|
-
let
|
|
135
|
+
function E(t, n = {}) {
|
|
136
|
+
let r = new u({ defaultOptions: { queries: {
|
|
137
137
|
retry: !1,
|
|
138
138
|
gcTime: Infinity
|
|
139
139
|
} } });
|
|
140
|
-
S(),
|
|
141
|
-
let i =
|
|
142
|
-
code:
|
|
143
|
-
children:
|
|
144
|
-
}) :
|
|
145
|
-
client:
|
|
140
|
+
S(), r.setQueryData(["schema", !0], n.schema ?? g()), w(n);
|
|
141
|
+
let i = n.screenCode ? /* @__PURE__ */ p(s, {
|
|
142
|
+
code: n.screenCode,
|
|
143
|
+
children: t
|
|
144
|
+
}) : t, a = /* @__PURE__ */ m(d, {
|
|
145
|
+
client: r,
|
|
146
146
|
children: [/* @__PURE__ */ p(l, {
|
|
147
|
-
initialEntries: [
|
|
147
|
+
initialEntries: [n.route ?? "/"],
|
|
148
148
|
children: /* @__PURE__ */ p(o, { children: i })
|
|
149
149
|
}), /* @__PURE__ */ p(f, {})]
|
|
150
|
-
}), c = h(
|
|
151
|
-
viewportOverride:
|
|
150
|
+
}), c = h(n.viewport ? /* @__PURE__ */ p(e, {
|
|
151
|
+
viewportOverride: n.viewport,
|
|
152
152
|
children: a
|
|
153
153
|
}) : a);
|
|
154
|
-
return Object.assign(c, { queryClient:
|
|
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,
|