@ea-lab/reactive-json 0.7.0 → 1.0.0-alpha.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/README.md +1 -3
- package/dist/TemplateSystem-kQJEKjik.js +3568 -0
- package/dist/assets/VariablesDebug.css +1 -4
- package/dist/assets/reset.css +4 -0
- package/dist/assets/usePagination.css +1 -0
- package/dist/component/action/HashChangeListener.js +29 -7
- package/dist/component/action/MessageListener.js +26 -8
- package/dist/component/action/ReactOnEvent.js +64 -8
- package/dist/component/action/Redirect.js +9 -5
- package/dist/component/action/SetAttributeValue.js +37 -5
- package/dist/component/action/ToggleAttributeValue.js +56 -5
- package/dist/component/action/UnsetAttribute.js +20 -5
- package/dist/component/action/UnsetAttributeValue.js +58 -5
- package/dist/component/action/index.js +19 -15
- package/dist/component/dataMapping/index.js +6 -3
- package/dist/component/dataMapping/simpleMapping.js +93 -2
- package/dist/component/element/debug/VariablesDebug/VariablesDebug.js +110 -13
- package/dist/component/element/debug/index.js +2 -2
- package/dist/component/element/html/FolderSortableTree.js +131 -8
- package/dist/component/element/html/FormatNumeral.js +57 -6
- package/dist/component/element/html/Html.js +1 -1
- package/dist/component/element/html/LabelFromValue.js +25 -6
- package/dist/component/element/html/PreformattedMarkup.js +50 -7
- package/dist/component/element/html/SortableTreeItemCollapseButton.js +10 -5
- package/dist/component/element/html/index.js +12 -10
- package/dist/component/element/index.js +35 -30
- package/dist/component/element/special/Count.js +21 -10
- package/dist/component/element/special/DataFilter.js +75 -6
- package/dist/component/element/special/DelayedActions.js +46 -7
- package/dist/component/element/special/Phantom.js +12 -3
- package/dist/component/element/special/ReactiveJsonBasicComponentWrapper.js +29 -0
- package/dist/component/element/special/ReactiveJsonSubroot.js +4 -3
- package/dist/component/element/special/Switch.js +78 -8
- package/dist/component/element/special/index.js +16 -10
- package/dist/component/hook/index.js +1 -1
- package/dist/component/hook/usePagination.js +172 -4
- package/dist/component/index.js +85 -63
- package/dist/component/reaction/addData.js +23 -3
- package/dist/component/reaction/fetchData.js +12 -2
- package/dist/component/reaction/index.js +34 -12
- package/dist/component/reaction/moveData.js +34 -2
- package/dist/component/reaction/postMessage.js +23 -2
- package/dist/component/reaction/redirectNow.js +6 -2
- package/dist/component/reaction/removeData.js +27 -2
- package/dist/component/reaction/setClipboardData.js +16 -2
- package/dist/component/reaction/setData.js +22 -3
- package/dist/component/reaction/submitData.js +25 -2
- package/dist/component/reaction/utility/httpRequestCommon.js +3 -2
- package/dist/component/reaction/utility/index.js +1 -1
- package/dist/coreComponentsPlugin.js +5 -2
- package/dist/dnd-kit-sortable-tree.esm-Cz1RJyIg.js +4135 -0
- package/dist/engine/Actions.js +4 -7
- package/dist/engine/ParsingDebugDisplay/ParsingDebugDisplay.js +692 -3
- package/dist/engine/ReactiveJsonRoot.js +8 -6
- package/dist/engine/TemplateSystem.js +3 -3
- package/dist/engine/View.js +2 -7
- package/dist/engine/index.js +38 -37
- package/dist/engine/utility/alterData.js +7 -1
- package/dist/engine/utility/analyzeDataOverrideReferences.js +41 -2
- package/dist/engine/utility/formElementsCommon.js +34 -0
- package/dist/engine/utility/formatString.js +19 -3
- package/dist/engine/utility/index.js +12 -11
- package/dist/httpRequestCommon-BFntjNdS.js +1799 -0
- package/dist/index-BA09SSaJ.js +26 -0
- package/dist/index-Bzk15m61.js +19 -0
- package/dist/index-CACLSxWi.js +8 -0
- package/dist/index-NNBvIV0S.js +1873 -0
- package/dist/index-OhHUX6nj.js +460 -0
- package/dist/main.js +124 -102
- package/package.json +4 -4
- package/dist/HashChangeListener-D6HwdXBJ.js +0 -8526
- package/dist/ParsingDebugDisplay-8f4yL4Jw.js +0 -696
- package/dist/VariablesDebug-pv5GGWel.js +0 -9262
- package/dist/component/action/Popover.js +0 -6
- package/dist/component/action/Tooltip.js +0 -5
- package/dist/component/element/form/CheckBoxField.js +0 -8
- package/dist/component/element/form/DateField.js +0 -8
- package/dist/component/element/form/NumberField.js +0 -8
- package/dist/component/element/form/SelectField.js +0 -8
- package/dist/component/element/form/TextAreaField.js +0 -8
- package/dist/component/element/form/TextField.js +0 -8
- package/dist/component/element/form/formElementsCommon.js +0 -4
- package/dist/component/element/form/index.js +0 -10
- package/dist/component/element/html/AccordionItem.js +0 -6
- package/dist/component/element/html/Modal.js +0 -8
- package/dist/component/element/html/Tabs.js +0 -8
- package/dist/component/element/special/BootstrapElement.js +0 -5
- package/dist/engine/PaginationProvider.js +0 -30
- package/dist/usePagination-Bb6lefHG.js +0 -353
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { d as ft } from "./index-CACLSxWi.js";
|
|
2
|
+
import { h as ht } from "./index-Bzk15m61.js";
|
|
3
|
+
import { Count as gt } from "./component/element/special/Count.js";
|
|
4
|
+
import { DataFilter as Dt } from "./component/element/special/DataFilter.js";
|
|
5
|
+
import { DelayedActions as yt, getReactionFunctionsToExecute as Ct } from "./component/element/special/DelayedActions.js";
|
|
6
|
+
import { PageControls as Pt } from "./component/element/special/PageControls.js";
|
|
7
|
+
import { Phantom as vt } from "./component/element/special/Phantom.js";
|
|
8
|
+
import { ReactiveJsonBasicComponentWrapper as bt } from "./component/element/special/ReactiveJsonBasicComponentWrapper.js";
|
|
9
|
+
import { jsx as y, jsxs as K, Fragment as Et } from "react/jsx-runtime";
|
|
10
|
+
import { V as wt, d as nt, b as rt, A as xt } from "./TemplateSystem-kQJEKjik.js";
|
|
11
|
+
import "./engine/EventDispatcherContext.js";
|
|
12
|
+
import { EventDispatcherProvider as St } from "./engine/EventDispatcherProvider.js";
|
|
13
|
+
import { GlobalDataContext as It } from "./engine/GlobalDataContext.js";
|
|
14
|
+
import "./engine/PaginationContext.js";
|
|
15
|
+
import { a as X } from "./httpRequestCommon-BFntjNdS.js";
|
|
16
|
+
import { l as Ot } from "./lodash-CYNxjS-I.js";
|
|
17
|
+
import { useReducer as Tt, useState as N, useRef as At, useEffect as H, useContext as at } from "react";
|
|
18
|
+
import { r as kt } from "./dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|
|
19
|
+
import { c as Nt } from "./index-BA09SSaJ.js";
|
|
20
|
+
import { coreDataMappingComponents as Vt } from "./component/dataMapping/index.js";
|
|
21
|
+
import { coreDataProcessorComponents as _t } from "./component/dataProcessor/index.js";
|
|
22
|
+
import "./component/element/debug/VariablesDebug/VariablesDebug.js";
|
|
23
|
+
import "./component/element/html/FolderSortableTree.js";
|
|
24
|
+
import "./component/element/html/FormatNumeral.js";
|
|
25
|
+
import "./component/element/html/LabelFromValue.js";
|
|
26
|
+
import "./component/element/html/PreformattedMarkup.js";
|
|
27
|
+
import "./component/element/html/SortableTreeItemCollapseButton.js";
|
|
28
|
+
import { Switch as Jt } from "./component/element/special/Switch.js";
|
|
29
|
+
import { coreReactionComponents as Mt } from "./component/reaction/index.js";
|
|
30
|
+
import { mergeComponentCollections as zt } from "./engine/ComponentCollector.js";
|
|
31
|
+
import { GlobalDataContextProvider as Gt } from "./engine/GlobalDataContextProvider.js";
|
|
32
|
+
import Lt from "./engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
|
|
33
|
+
import { TemplateContext as it } from "./engine/TemplateContext.js";
|
|
34
|
+
import { alterData as Rt } from "./engine/utility/alterData.js";
|
|
35
|
+
import { applyDataMapping as $t } from "./engine/utility/dataMappingSystem.js";
|
|
36
|
+
import { parseRjBuild as qt } from "./engine/utility/parseRjBuild.js";
|
|
37
|
+
import { stringToBoolean as jt } from "./engine/utility/stringToBoolean.js";
|
|
38
|
+
import { analyzeDataOverrideReferences as Kt } from "./engine/utility/analyzeDataOverrideReferences.js";
|
|
39
|
+
import "./js-yaml-Bw0KO4XO.js";
|
|
40
|
+
const ot = {
|
|
41
|
+
action: Nt,
|
|
42
|
+
dataMapping: Vt,
|
|
43
|
+
dataProcessor: _t,
|
|
44
|
+
element: Yt,
|
|
45
|
+
reaction: Mt
|
|
46
|
+
}, Xt = ({
|
|
47
|
+
dataOverride: o,
|
|
48
|
+
dataFetchMethod: D,
|
|
49
|
+
dataUrl: C,
|
|
50
|
+
debugMode: p,
|
|
51
|
+
DebugModeContentWrapper: P,
|
|
52
|
+
DebugModeDataWrapper: E,
|
|
53
|
+
DebugModeRootWrapper: G,
|
|
54
|
+
headersForData: T,
|
|
55
|
+
headersForRjBuild: l,
|
|
56
|
+
maybeRawAppData: V,
|
|
57
|
+
maybeRawAppRjBuild: u,
|
|
58
|
+
plugins: _,
|
|
59
|
+
rjBuildFetchMethod: v,
|
|
60
|
+
rjBuildUrl: d,
|
|
61
|
+
upstreamUpdateCallbacks: A
|
|
62
|
+
}) => {
|
|
63
|
+
const m = [];
|
|
64
|
+
D && (m.push({
|
|
65
|
+
deprecatedProperty: "dataFetchMethod",
|
|
66
|
+
newProperty: "rjBuildFetchMethod"
|
|
67
|
+
}), v = D), C && (m.push({
|
|
68
|
+
deprecatedProperty: "dataUrl",
|
|
69
|
+
newProperty: "rjBuildUrl"
|
|
70
|
+
}), d = C), T && (m.push({
|
|
71
|
+
deprecatedProperty: "headersForData",
|
|
72
|
+
newProperty: "headersForRjBuild"
|
|
73
|
+
}), l = T), V && (m.push({
|
|
74
|
+
deprecatedProperty: "maybeRawAppData",
|
|
75
|
+
newProperty: "maybeRawAppRjBuild"
|
|
76
|
+
}), u = V), m.length > 0 && console.warn(
|
|
77
|
+
"A ReactiveJsonRoot component got the following deprecated properties that must be replaced: " + m.map((t) => t.deprecatedProperty + " -> " + t.newProperty).join(", ")
|
|
78
|
+
);
|
|
79
|
+
const [w, x] = Tt(
|
|
80
|
+
(t, a) => {
|
|
81
|
+
switch (a.type) {
|
|
82
|
+
case "setData":
|
|
83
|
+
return { updateId: 0, realCurrentData: a.data };
|
|
84
|
+
case "updateData":
|
|
85
|
+
return mt(t, a.path, a.value, a.updateMode);
|
|
86
|
+
default:
|
|
87
|
+
return t;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{ updateId: 0, realCurrentData: {} }
|
|
91
|
+
), [st, ct] = N({}), [lt, Q] = N({}), [pt, Y] = N([]), [J, L] = N(() => {
|
|
92
|
+
if (u)
|
|
93
|
+
return typeof u == "string" ? u : JSON.stringify(u);
|
|
94
|
+
}), [R, Z] = N(null), i = At(null);
|
|
95
|
+
H(() => () => {
|
|
96
|
+
typeof document < "u" && i.current && i.current.parentNode && (i.current.parentNode.removeChild(i.current), i.current = null);
|
|
97
|
+
}, []);
|
|
98
|
+
const M = _ ? zt([ot, _]) : ot;
|
|
99
|
+
H(() => {
|
|
100
|
+
d && (typeof v == "string" && v.toLowerCase() === "post" ? X.post(d, {
|
|
101
|
+
headers: l
|
|
102
|
+
}).then((t) => {
|
|
103
|
+
L(t.data);
|
|
104
|
+
}) : X.get(d, {
|
|
105
|
+
headers: l
|
|
106
|
+
}).then((t) => {
|
|
107
|
+
L(t.data);
|
|
108
|
+
}));
|
|
109
|
+
}, [d, l]), H(() => {
|
|
110
|
+
if (!J)
|
|
111
|
+
return;
|
|
112
|
+
const t = qt(J);
|
|
113
|
+
if (!t.success) {
|
|
114
|
+
if (console.group(
|
|
115
|
+
`Tried to load the app's RjBuild but the ${t.format} content could not be parsed.`
|
|
116
|
+
), console.error(t.error.message), console.debug("Context:", {
|
|
117
|
+
rjBuildUrl: d,
|
|
118
|
+
rjBuildFetchMethod: v,
|
|
119
|
+
headersForRjBuild: l,
|
|
120
|
+
maybeRawAppRjBuild: u,
|
|
121
|
+
dataOverride: o
|
|
122
|
+
}), console.debug("Error details:", t.error), console.groupEnd(), typeof document < "u") {
|
|
123
|
+
let e = document.getElementById("rj-parsing-error-root");
|
|
124
|
+
if (e || (e = document.createElement("div"), e.id = "rj-parsing-error-root", document.body.appendChild(e)), !i.current) {
|
|
125
|
+
const h = document.createElement("div");
|
|
126
|
+
e.appendChild(h), i.current = h;
|
|
127
|
+
}
|
|
128
|
+
Z(
|
|
129
|
+
kt.createPortal(
|
|
130
|
+
/* @__PURE__ */ y(
|
|
131
|
+
Lt,
|
|
132
|
+
{
|
|
133
|
+
processedRjBuild: t,
|
|
134
|
+
errorContext: {
|
|
135
|
+
rjBuildUrl: d,
|
|
136
|
+
rjBuildFetchMethod: v,
|
|
137
|
+
headersForRjBuild: l,
|
|
138
|
+
maybeRawAppRjBuild: u
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
i.current,
|
|
143
|
+
() => {
|
|
144
|
+
i.current && (i.current.parentNode.removeChild(i.current), i.current = null);
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
R && (Z(null), typeof document < "u" && i.current && i.current.parentNode && (i.current.parentNode.removeChild(i.current), i.current = null));
|
|
152
|
+
const a = t.data;
|
|
153
|
+
ct(a.templates ?? a.listForms), !a.templates && a.listForms && console.log(
|
|
154
|
+
"'listForms' needs to be renamed to 'templates'. The support for 'listForms' will be removed in the next releases of reactive-json."
|
|
155
|
+
);
|
|
156
|
+
let c = o === void 0 ? a.data : o;
|
|
157
|
+
const s = a.additionalDataSource;
|
|
158
|
+
if (!Array.isArray(s) || s.length === 0) {
|
|
159
|
+
x({ type: "setData", data: c }), Q(a.renderView), Y(Object.keys(a.renderView));
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const b = {
|
|
163
|
+
headersForRjBuild: l,
|
|
164
|
+
templateData: c,
|
|
165
|
+
templatePath: "data",
|
|
166
|
+
setData: F,
|
|
167
|
+
updateData: W
|
|
168
|
+
}, r = {
|
|
169
|
+
templateData: c,
|
|
170
|
+
templatePath: "data"
|
|
171
|
+
}, f = s.filter((e) => e.blocking === !0), k = s.filter((e) => e.blocking !== !0), n = async (e, h) => {
|
|
172
|
+
var S;
|
|
173
|
+
try {
|
|
174
|
+
if (!e.src) {
|
|
175
|
+
console.warn("additionalDataSource item number " + h + " missing 'src' property.", e);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const I = {
|
|
179
|
+
method: ((S = e.method) == null ? void 0 : S.toUpperCase()) || "GET",
|
|
180
|
+
url: e.src
|
|
181
|
+
};
|
|
182
|
+
l && Object.keys(l).length > 0 && (I.headers = l);
|
|
183
|
+
const z = await X(I), ut = {
|
|
184
|
+
url: I.url,
|
|
185
|
+
method: I.method,
|
|
186
|
+
headers: I.headers || {},
|
|
187
|
+
body: I.data
|
|
188
|
+
}, dt = {
|
|
189
|
+
headers: z.headers || {},
|
|
190
|
+
status: z.status,
|
|
191
|
+
data: z.data
|
|
192
|
+
}, O = Rt({
|
|
193
|
+
requestContext: ut,
|
|
194
|
+
responseContext: dt,
|
|
195
|
+
responseBody: z.data,
|
|
196
|
+
// additionalDataSource always processes raw data, not RjBuild.
|
|
197
|
+
isRjBuild: !1,
|
|
198
|
+
dataProcessors: (M == null ? void 0 : M.dataProcessor) || {}
|
|
199
|
+
});
|
|
200
|
+
if (e.dataMapping)
|
|
201
|
+
try {
|
|
202
|
+
$t({
|
|
203
|
+
dataMapping: e.dataMapping,
|
|
204
|
+
responseData: O,
|
|
205
|
+
globalDataContext: b,
|
|
206
|
+
templateContext: r
|
|
207
|
+
});
|
|
208
|
+
return;
|
|
209
|
+
} catch (g) {
|
|
210
|
+
console.error("Error applying dataMapping for additionalDataSource:", g);
|
|
211
|
+
}
|
|
212
|
+
if (!e.path) {
|
|
213
|
+
if (typeof O != "object" || Array.isArray(O)) {
|
|
214
|
+
console.warn(
|
|
215
|
+
"additionalDataSource data cannot be merged at root - must be an object:",
|
|
216
|
+
O
|
|
217
|
+
);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
Object.entries(O).forEach(([g, j]) => {
|
|
221
|
+
x({
|
|
222
|
+
type: "updateData",
|
|
223
|
+
path: g,
|
|
224
|
+
value: j
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
try {
|
|
230
|
+
const g = nt({
|
|
231
|
+
dataLocation: e.path,
|
|
232
|
+
currentPath: "data",
|
|
233
|
+
globalDataContext: b,
|
|
234
|
+
templateContext: r
|
|
235
|
+
});
|
|
236
|
+
if (typeof g != "string") {
|
|
237
|
+
console.warn(
|
|
238
|
+
"additionalDataSource path evaluation did not result in a string:",
|
|
239
|
+
e.path,
|
|
240
|
+
"->",
|
|
241
|
+
g
|
|
242
|
+
);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const j = g.substring(5);
|
|
246
|
+
x({
|
|
247
|
+
type: "updateData",
|
|
248
|
+
path: j,
|
|
249
|
+
value: O
|
|
250
|
+
});
|
|
251
|
+
} catch (g) {
|
|
252
|
+
console.error("Error evaluating additionalDataSource path:", e.path, g);
|
|
253
|
+
}
|
|
254
|
+
} catch (et) {
|
|
255
|
+
console.error("Error fetching additional data source:", e.src, et);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
x({ type: "setData", data: c }), (async () => {
|
|
259
|
+
if (f.length > 0) {
|
|
260
|
+
const e = f.map((h, S) => n(h, S));
|
|
261
|
+
await Promise.allSettled(e).catch((h) => {
|
|
262
|
+
console.error("Error processing blocking additionalDataSource:", h);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
if (Q(a.renderView), Y(Object.keys(a.renderView)), k.length > 0) {
|
|
266
|
+
const e = k.map(
|
|
267
|
+
(h, S) => n(h, f.length + S)
|
|
268
|
+
);
|
|
269
|
+
Promise.allSettled(e);
|
|
270
|
+
}
|
|
271
|
+
})();
|
|
272
|
+
}, [J, o, l]);
|
|
273
|
+
function U(t, a, c) {
|
|
274
|
+
if (!A || A.size === 0)
|
|
275
|
+
return !1;
|
|
276
|
+
for (const [s, b] of A)
|
|
277
|
+
if (t === s || t.startsWith(s + ".") || s === "") {
|
|
278
|
+
const r = s === "" ? t : t.substring(s.length + 1);
|
|
279
|
+
try {
|
|
280
|
+
return b(a, r, c), !0;
|
|
281
|
+
} catch (f) {
|
|
282
|
+
console.warn("Error during upstream update:", f);
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return !1;
|
|
287
|
+
}
|
|
288
|
+
function W(t, a, c = void 0) {
|
|
289
|
+
let s = a.replace("data.", "");
|
|
290
|
+
U(s, t, c) || x({
|
|
291
|
+
type: "updateData",
|
|
292
|
+
path: s,
|
|
293
|
+
value: t,
|
|
294
|
+
updateMode: c
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
function F(t) {
|
|
298
|
+
U("", t, void 0) || x({
|
|
299
|
+
type: "setData",
|
|
300
|
+
data: t
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
function mt(t, a, c, s = void 0) {
|
|
304
|
+
const b = a.split(".");
|
|
305
|
+
(typeof t.realCurrentData != "object" || t.realCurrentData === null || Array.isArray(t.realCurrentData)) && (t.realCurrentData = {});
|
|
306
|
+
let r = t.realCurrentData;
|
|
307
|
+
for (let f = 0, k = b.length; f < k; f++) {
|
|
308
|
+
const n = b[f];
|
|
309
|
+
if (f === k - 1) {
|
|
310
|
+
if (s === "remove" && Array.isArray(r))
|
|
311
|
+
r.splice(n, 1);
|
|
312
|
+
else if (s === "move")
|
|
313
|
+
if (c.increment) {
|
|
314
|
+
if (!Array.isArray(r))
|
|
315
|
+
return t;
|
|
316
|
+
const q = Math.min(
|
|
317
|
+
r.length,
|
|
318
|
+
Math.max(0, parseInt(n) + parseInt(c.increment))
|
|
319
|
+
);
|
|
320
|
+
if (q === parseInt(n))
|
|
321
|
+
return t;
|
|
322
|
+
const e = r.splice(n, 1);
|
|
323
|
+
if (e.length < 1)
|
|
324
|
+
return t;
|
|
325
|
+
r.splice(q, 0, e[0]);
|
|
326
|
+
} else
|
|
327
|
+
return t;
|
|
328
|
+
else if (c === void 0)
|
|
329
|
+
delete r[n];
|
|
330
|
+
else {
|
|
331
|
+
if (Ot.isEqual(c, r[n]))
|
|
332
|
+
return t;
|
|
333
|
+
s === "add" ? (r[n] === void 0 && (r[n] = []), r[n].push(c)) : r[n] = c;
|
|
334
|
+
}
|
|
335
|
+
return {
|
|
336
|
+
// Using modulo in case of massive update counts in long frontend sessions.
|
|
337
|
+
updateId: (t.updateId ?? 0) % (Number.MAX_SAFE_INTEGER - 1) + 1,
|
|
338
|
+
realCurrentData: t.realCurrentData
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
if (r.hasOwnProperty(n)) {
|
|
342
|
+
(typeof r[n] != "object" || r[n] === null) && (r[n] = {}), r = r[n];
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
r[n] = {}, r = r[n];
|
|
346
|
+
}
|
|
347
|
+
throw new Error("Could not update data.");
|
|
348
|
+
}
|
|
349
|
+
if (!J)
|
|
350
|
+
return null;
|
|
351
|
+
const B = pt.map((t) => {
|
|
352
|
+
var a;
|
|
353
|
+
return /* @__PURE__ */ y(
|
|
354
|
+
wt,
|
|
355
|
+
{
|
|
356
|
+
datafield: t,
|
|
357
|
+
props: lt[t],
|
|
358
|
+
path: "data." + t,
|
|
359
|
+
currentData: (a = w.realCurrentData) == null ? void 0 : a[t]
|
|
360
|
+
},
|
|
361
|
+
t
|
|
362
|
+
);
|
|
363
|
+
}), $ = jt(p), tt = /* @__PURE__ */ y(St, { children: /* @__PURE__ */ K(
|
|
364
|
+
Gt,
|
|
365
|
+
{
|
|
366
|
+
value: {
|
|
367
|
+
element: st,
|
|
368
|
+
headersForRjBuild: l,
|
|
369
|
+
plugins: M,
|
|
370
|
+
setData: F,
|
|
371
|
+
setRawAppRjBuild: L,
|
|
372
|
+
templateData: w.realCurrentData,
|
|
373
|
+
templatePath: "data",
|
|
374
|
+
updateData: W
|
|
375
|
+
},
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ y(
|
|
378
|
+
it.Provider,
|
|
379
|
+
{
|
|
380
|
+
value: {
|
|
381
|
+
templateData: w.realCurrentData,
|
|
382
|
+
templatePath: "data"
|
|
383
|
+
},
|
|
384
|
+
children: $ && P ? /* @__PURE__ */ y(P, { children: B }) : B
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
$ ? E && /* @__PURE__ */ y(E, { children: JSON.stringify(w.realCurrentData, null, " ") }) : null
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
) });
|
|
391
|
+
return $ && P ? /* @__PURE__ */ K(G, { children: [
|
|
392
|
+
tt,
|
|
393
|
+
R
|
|
394
|
+
] }) : /* @__PURE__ */ K(Et, { children: [
|
|
395
|
+
tt,
|
|
396
|
+
R
|
|
397
|
+
] });
|
|
398
|
+
}, Ht = ({ props: o }) => {
|
|
399
|
+
var T;
|
|
400
|
+
const D = at(It), C = at(it), p = rt({
|
|
401
|
+
valueToEvaluate: o == null ? void 0 : o.rjOptions,
|
|
402
|
+
globalDataContext: D,
|
|
403
|
+
templateContext: C
|
|
404
|
+
}) || {};
|
|
405
|
+
if (typeof p != "object")
|
|
406
|
+
return;
|
|
407
|
+
let P;
|
|
408
|
+
if ((o == null ? void 0 : o.sharedUpdates) === !0 && ((T = o == null ? void 0 : o.rjOptions) != null && T.dataOverride)) {
|
|
409
|
+
const l = Kt(o.rjOptions.dataOverride);
|
|
410
|
+
if (l.size > 0) {
|
|
411
|
+
P = /* @__PURE__ */ new Map();
|
|
412
|
+
for (const [V, u] of l) {
|
|
413
|
+
const _ = (v, d, A) => {
|
|
414
|
+
try {
|
|
415
|
+
const m = nt({
|
|
416
|
+
dataLocation: u,
|
|
417
|
+
currentPath: C.templatePath,
|
|
418
|
+
globalDataContext: D,
|
|
419
|
+
templateContext: C
|
|
420
|
+
}), w = d ? `${m}.${d}` : m;
|
|
421
|
+
D.updateData(v, w, A);
|
|
422
|
+
} catch (m) {
|
|
423
|
+
console.warn(`Error during upstream propagation for ${u}:`, m);
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
P.set(V, _);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
const E = Number.isInteger(parseInt(o == null ? void 0 : o.dataOverrideEvaluationDepth)) ? parseInt(o == null ? void 0 : o.dataOverrideEvaluationDepth) : 10;
|
|
431
|
+
p != null && p.dataOverride && Number.isInteger(E) && E !== 0 && (p.dataOverride = rt({
|
|
432
|
+
valueToEvaluate: p == null ? void 0 : p.dataOverride,
|
|
433
|
+
globalDataContext: D,
|
|
434
|
+
templateContext: C,
|
|
435
|
+
evaluationDepth: E
|
|
436
|
+
}) || {});
|
|
437
|
+
const G = D.plugins ?? {};
|
|
438
|
+
return /* @__PURE__ */ y(xt, { ...o, children: /* @__PURE__ */ y(Xt, { ...p, plugins: G, upstreamUpdateCallbacks: P }) });
|
|
439
|
+
}, Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
440
|
+
__proto__: null,
|
|
441
|
+
Count: gt,
|
|
442
|
+
DataFilter: Dt,
|
|
443
|
+
DelayedActions: yt,
|
|
444
|
+
PageControls: Pt,
|
|
445
|
+
Phantom: vt,
|
|
446
|
+
ReactiveJsonBasicComponentWrapper: bt,
|
|
447
|
+
ReactiveJsonSubroot: Ht,
|
|
448
|
+
Switch: Jt,
|
|
449
|
+
getReactionFunctionsToExecute: Ct
|
|
450
|
+
}, Symbol.toStringTag, { value: "Module" })), Yt = {
|
|
451
|
+
...ft,
|
|
452
|
+
...ht,
|
|
453
|
+
...Qt
|
|
454
|
+
};
|
|
455
|
+
export {
|
|
456
|
+
Ht as R,
|
|
457
|
+
Xt as a,
|
|
458
|
+
ot as b,
|
|
459
|
+
Yt as c
|
|
460
|
+
};
|