@ea-lab/reactive-json 1.0.1 → 1.1.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/component/action/CustomEventListener.js +34 -0
- package/dist/component/action/ReactOnEvent.js +38 -57
- package/dist/component/action/index.js +22 -20
- package/dist/component/index.js +121 -119
- package/dist/component/reaction/fetchData.js +1 -1
- package/dist/component/reaction/index.js +1 -1
- package/dist/component/reaction/submitData.js +1 -1
- package/dist/component/reaction/utility/httpRequestCommon.js +1 -1
- package/dist/component/reaction/utility/index.js +1 -1
- package/dist/coreComponentsPlugin.js +1 -1
- package/dist/engine/Actions.js +93 -74
- package/dist/engine/ReactiveJsonRoot.js +25 -24
- package/dist/engine/index.js +23 -21
- package/dist/engine/utility/eventPlaceholderSystem.js +42 -0
- package/dist/engine/utility/index.js +16 -14
- package/dist/engine/utility/reactEventProps.js +82 -0
- package/dist/{httpRequestCommon-DUo2Oxgl.js → httpRequestCommon-vfSMynsl.js} +339 -333
- package/dist/index-BQyEEFVW.js +50 -0
- package/dist/main.js +167 -163
- package/package.json +1 -1
- package/dist/index-BA09SSaJ.js +0 -26
package/dist/engine/Actions.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
-
import { J as
|
|
3
|
-
import { l as
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { GlobalDataContext as
|
|
2
|
+
import { J as A } from "../jsonpath-B9kE9k9e.js";
|
|
3
|
+
import { l as C } from "../lodash-CYNxjS-I.js";
|
|
4
|
+
import { useContext as O } from "react";
|
|
5
|
+
import { GlobalDataContext as g } from "./GlobalDataContext.js";
|
|
6
6
|
import { TemplateContext as x } from "./TemplateContext.js";
|
|
7
|
-
import { isTemplateValue as
|
|
8
|
-
|
|
7
|
+
import { isTemplateValue as E, evaluateTemplateValue as b } from "./TemplateSystem.js";
|
|
8
|
+
import { reactEventProps as D } from "./utility/reactEventProps.js";
|
|
9
|
+
const P = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), p = (e, c, s) => {
|
|
9
10
|
const { globalDataContext: h, templateContext: l } = c;
|
|
10
11
|
if (Array.isArray(e.andConditions))
|
|
11
|
-
return e.andConditions.reduce((t,
|
|
12
|
+
return e.andConditions.reduce((t, o) => t && p(o, c, s), !0);
|
|
12
13
|
if (Array.isArray(e.orConditions)) {
|
|
13
14
|
const t = e.orConditions;
|
|
14
|
-
for (const
|
|
15
|
-
if (
|
|
15
|
+
for (const o of t)
|
|
16
|
+
if (p(o, c, s))
|
|
16
17
|
return !0;
|
|
17
18
|
return !1;
|
|
18
19
|
}
|
|
19
|
-
if (e.when !== void 0 && !
|
|
20
|
+
if (e.when !== void 0 && !E(e.when))
|
|
20
21
|
return !1;
|
|
21
|
-
const
|
|
22
|
+
const i = (t) => b({
|
|
22
23
|
globalDataContext: h,
|
|
23
24
|
templateContext: l,
|
|
24
25
|
valueToEvaluate: t
|
|
25
26
|
});
|
|
26
|
-
let
|
|
27
|
+
let n;
|
|
27
28
|
if (e.when === void 0 && e.hasOwnProperty("whenDataCountOf")) {
|
|
28
29
|
let t;
|
|
29
30
|
switch (e.inContext) {
|
|
@@ -37,127 +38,145 @@ const P = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), m = (e, c, u) => {
|
|
|
37
38
|
t = h.templateData;
|
|
38
39
|
break;
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
n = A.query(t, e.whenDataCountOf).length;
|
|
41
42
|
} else
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
for (const [t,
|
|
43
|
+
n = (() => {
|
|
44
|
+
if (s) {
|
|
45
|
+
for (const [t, o] of s)
|
|
45
46
|
if (e.hasOwnProperty(t))
|
|
46
|
-
return
|
|
47
|
+
return o({
|
|
47
48
|
condition: e,
|
|
48
49
|
templateContexts: c,
|
|
49
|
-
evaluateAgainstTemplates: (a) =>
|
|
50
|
+
evaluateAgainstTemplates: (a) => i(a)
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
|
-
return
|
|
53
|
+
return i(e.when);
|
|
53
54
|
})();
|
|
54
55
|
if (e.hasOwnProperty("isEmpty") || e.hasOwnProperty("isNotEmpty")) {
|
|
55
|
-
const t = (
|
|
56
|
-
if (
|
|
56
|
+
const t = (o) => e.hasOwnProperty("isEmpty") ? e.isEmpty === "not" ? !o : o : !o;
|
|
57
|
+
if (n === null)
|
|
57
58
|
return t(!0);
|
|
58
|
-
switch (typeof
|
|
59
|
+
switch (typeof n) {
|
|
59
60
|
case "undefined":
|
|
60
61
|
return t(!0);
|
|
61
62
|
case "string":
|
|
62
|
-
return t(
|
|
63
|
+
return t(n.length === 0);
|
|
63
64
|
case "object":
|
|
64
|
-
return t(Object.keys(
|
|
65
|
+
return t(Object.keys(n).length === 0);
|
|
65
66
|
default:
|
|
66
|
-
return t(!
|
|
67
|
+
return t(!n);
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
const
|
|
70
|
+
const r = e.compareAsDates;
|
|
70
71
|
if (e.hasOwnProperty("isNot"))
|
|
71
|
-
return
|
|
72
|
+
return u(r, n) !== u(r, i(e.isNot));
|
|
72
73
|
if (e.hasOwnProperty("is"))
|
|
73
|
-
return
|
|
74
|
+
return u(r, n) === u(r, i(e.is));
|
|
74
75
|
if (e.hasOwnProperty("containsNot") || e.hasOwnProperty("contains")) {
|
|
75
|
-
const t = e.hasOwnProperty("containsNot"),
|
|
76
|
-
if (typeof
|
|
76
|
+
const t = e.hasOwnProperty("containsNot"), o = t ? e.containsNot : e.contains, a = u(r, i(o));
|
|
77
|
+
if (typeof n == "string") {
|
|
77
78
|
if (typeof a != "string")
|
|
78
79
|
return t;
|
|
79
|
-
const
|
|
80
|
-
return t ? !
|
|
80
|
+
const f = n.toLowerCase().indexOf(a.toLowerCase()) !== -1;
|
|
81
|
+
return t ? !f : f;
|
|
81
82
|
} else
|
|
82
|
-
for (const
|
|
83
|
-
if (
|
|
83
|
+
for (const f of Object.values(n))
|
|
84
|
+
if (C.isEqual(u(r, f), a))
|
|
84
85
|
return !t;
|
|
85
86
|
return t;
|
|
86
87
|
}
|
|
87
88
|
if (e.hasOwnProperty("containedByNot") || e.hasOwnProperty("containedBy")) {
|
|
88
|
-
const t = e.hasOwnProperty("containedByNot"),
|
|
89
|
-
if (typeof
|
|
89
|
+
const t = e.hasOwnProperty("containedByNot"), o = t ? e.containedByNot : e.containedBy, a = u(r, i(o));
|
|
90
|
+
if (typeof n == "string") {
|
|
90
91
|
if (typeof a != "string")
|
|
91
92
|
return t;
|
|
92
|
-
const
|
|
93
|
-
return t ? !
|
|
93
|
+
const f = a.toLowerCase().indexOf(n.toLowerCase()) !== -1;
|
|
94
|
+
return t ? !f : f;
|
|
94
95
|
} else
|
|
95
|
-
for (const
|
|
96
|
-
if (
|
|
96
|
+
for (const f of Object.values(a))
|
|
97
|
+
if (C.isEqual(u(r, f), n))
|
|
97
98
|
return !t;
|
|
98
99
|
return t;
|
|
99
100
|
}
|
|
100
|
-
return e.hasOwnProperty(">") ?
|
|
101
|
-
},
|
|
102
|
-
const
|
|
101
|
+
return e.hasOwnProperty(">") ? u(r, n) > u(r, i(e[">"])) : e.hasOwnProperty(">=") ? u(r, n) >= u(r, i(e[">="])) : e.hasOwnProperty("<") ? u(r, n) < u(r, i(e["<"])) : e.hasOwnProperty("<=") ? u(r, n) <= u(r, i(e["<="])) : !0;
|
|
102
|
+
}, L = (e, c) => {
|
|
103
|
+
const s = [];
|
|
103
104
|
let h = !1;
|
|
104
105
|
const l = {};
|
|
105
106
|
if (!Array.isArray(e))
|
|
106
|
-
return
|
|
107
|
-
const { globalDataContext:
|
|
108
|
-
if (!
|
|
109
|
-
return
|
|
110
|
-
for (const [
|
|
111
|
-
const
|
|
112
|
-
if (!
|
|
107
|
+
return s;
|
|
108
|
+
const { globalDataContext: i } = c, n = i.plugins ?? {}, r = (n == null ? void 0 : n.action) ?? {}, t = (n == null ? void 0 : n.reaction) ?? {};
|
|
109
|
+
if (!r)
|
|
110
|
+
return s;
|
|
111
|
+
for (const [o, a] of e.entries()) {
|
|
112
|
+
const f = (a == null ? void 0 : a.what) ?? void 0;
|
|
113
|
+
if (!f)
|
|
113
114
|
continue;
|
|
114
|
-
let
|
|
115
|
-
if (!
|
|
116
|
-
if (!w || a.on === void 0 || !
|
|
115
|
+
let m = r[f] ?? void 0, w = t[f] ?? void 0;
|
|
116
|
+
if (!m && !w && (m = r[P(f)]), !m) {
|
|
117
|
+
if (!w || a.on === void 0 || !p(a, c))
|
|
117
118
|
continue;
|
|
118
119
|
if (a.on === "message") {
|
|
119
|
-
if (!
|
|
120
|
+
if (!r.MessageListener)
|
|
120
121
|
continue;
|
|
121
|
-
|
|
122
|
+
s.push({
|
|
123
|
+
ActionComponent: r.MessageListener,
|
|
124
|
+
actionProps: a,
|
|
125
|
+
actionIndex: o
|
|
126
|
+
});
|
|
122
127
|
continue;
|
|
123
128
|
}
|
|
124
129
|
if (a.on === "hashchange") {
|
|
125
|
-
if (!
|
|
130
|
+
if (!r.HashChangeListener)
|
|
126
131
|
continue;
|
|
127
|
-
|
|
132
|
+
s.push({
|
|
133
|
+
ActionComponent: r.HashChangeListener,
|
|
134
|
+
actionProps: a,
|
|
135
|
+
actionIndex: o
|
|
136
|
+
});
|
|
128
137
|
continue;
|
|
129
138
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
139
|
+
if (D.has(a.on)) {
|
|
140
|
+
h = !0;
|
|
141
|
+
const y = "on" + P(a.on);
|
|
142
|
+
Array.isArray(l[y]) || (l[y] = []), l[y].push(a);
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (!r.CustomEventListener)
|
|
146
|
+
continue;
|
|
147
|
+
s.push({
|
|
148
|
+
ActionComponent: r.CustomEventListener,
|
|
149
|
+
actionProps: a,
|
|
150
|
+
actionIndex: o
|
|
151
|
+
});
|
|
133
152
|
continue;
|
|
134
153
|
}
|
|
135
|
-
|
|
154
|
+
p(a, c) && s.push({ ActionComponent: m, actionProps: a, actionIndex: o });
|
|
136
155
|
}
|
|
137
156
|
if (h) {
|
|
138
|
-
if (!
|
|
139
|
-
return
|
|
140
|
-
|
|
141
|
-
ActionComponent:
|
|
157
|
+
if (!r.ReactOnEvent)
|
|
158
|
+
return s;
|
|
159
|
+
s.push({
|
|
160
|
+
ActionComponent: r.ReactOnEvent,
|
|
142
161
|
actionProps: l,
|
|
143
162
|
actionIndex: "_reactOnEvent"
|
|
144
163
|
});
|
|
145
164
|
}
|
|
146
|
-
return
|
|
147
|
-
},
|
|
148
|
-
const c =
|
|
149
|
-
return e ?
|
|
150
|
-
|
|
165
|
+
return s;
|
|
166
|
+
}, u = (e, c) => e ? new Date(c) : c, F = (e) => {
|
|
167
|
+
const c = O(g), s = O(x);
|
|
168
|
+
return e ? L((e == null ? void 0 : e.actions) ?? [], { globalDataContext: c, templateContext: s }).reverse().reduce((l, { ActionComponent: i, actionProps: n, actionIndex: r }) => /* @__PURE__ */ v(
|
|
169
|
+
i,
|
|
151
170
|
{
|
|
152
171
|
componentProps: e,
|
|
153
|
-
actionProps:
|
|
154
|
-
actionIndex:
|
|
172
|
+
actionProps: n,
|
|
173
|
+
actionIndex: r,
|
|
155
174
|
attributesHolderRef: e.attributesHolderRef,
|
|
156
175
|
children: l
|
|
157
176
|
}
|
|
158
177
|
), (e == null ? void 0 : e.children) ?? null) : null;
|
|
159
178
|
};
|
|
160
179
|
export {
|
|
161
|
-
|
|
162
|
-
|
|
180
|
+
F as ActionDependant,
|
|
181
|
+
p as isValid
|
|
163
182
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as C, jsxs as L, Fragment as pt } from "react/jsx-runtime";
|
|
2
|
-
import { a as _ } from "../httpRequestCommon-
|
|
2
|
+
import { a as _ } from "../httpRequestCommon-vfSMynsl.js";
|
|
3
3
|
import { l as ut } from "../lodash-CYNxjS-I.js";
|
|
4
|
-
import { useReducer as dt, useState as
|
|
4
|
+
import { useReducer as dt, useState as w, useRef as ft, useEffect as q } from "react";
|
|
5
5
|
import { r as mt } from "../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|
|
6
6
|
import { coreComponentsPlugin as tt } from "../coreComponentsPlugin.js";
|
|
7
7
|
import { mergeComponentCollections as ht } from "./ComponentCollector.js";
|
|
@@ -16,7 +16,7 @@ import { parseRjBuild as vt } from "./utility/parseRjBuild.js";
|
|
|
16
16
|
import { stringToBoolean as wt } from "./utility/stringToBoolean.js";
|
|
17
17
|
import { View as St } from "./View.js";
|
|
18
18
|
const xt = ({
|
|
19
|
-
dataOverride:
|
|
19
|
+
dataOverride: S,
|
|
20
20
|
dataFetchMethod: M,
|
|
21
21
|
dataUrl: z,
|
|
22
22
|
debugMode: et,
|
|
@@ -48,7 +48,7 @@ const xt = ({
|
|
|
48
48
|
}), d = $), h.length > 0 && console.warn(
|
|
49
49
|
"A ReactiveJsonRoot component got the following deprecated properties that must be replaced: " + h.map((t) => t.deprecatedProperty + " -> " + t.newProperty).join(", ")
|
|
50
50
|
);
|
|
51
|
-
const [
|
|
51
|
+
const [x, g] = dt(
|
|
52
52
|
(t, a) => {
|
|
53
53
|
switch (a.type) {
|
|
54
54
|
case "setData":
|
|
@@ -60,14 +60,14 @@ const xt = ({
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
{ updateId: 0, realCurrentData: {} }
|
|
63
|
-
), [at, ot] =
|
|
63
|
+
), [at, ot] = w({}), [nt, Q] = w({}), [st, Y] = w([]), [I, T] = w(() => {
|
|
64
64
|
if (d)
|
|
65
65
|
return typeof d == "string" ? d : JSON.stringify(d);
|
|
66
|
-
}), [V, Z] =
|
|
66
|
+
}), [V, Z] = w(null), n = ft(null);
|
|
67
67
|
q(() => () => {
|
|
68
68
|
typeof document < "u" && n.current && n.current.parentNode && (n.current.parentNode.removeChild(n.current), n.current = null);
|
|
69
69
|
}, []);
|
|
70
|
-
const
|
|
70
|
+
const E = H ? ht([tt, H]) : tt;
|
|
71
71
|
q(() => {
|
|
72
72
|
f && (typeof b == "string" && b.toLowerCase() === "post" ? _.post(f, {
|
|
73
73
|
headers: c
|
|
@@ -79,9 +79,9 @@ const xt = ({
|
|
|
79
79
|
T(t.data);
|
|
80
80
|
}));
|
|
81
81
|
}, [f, c]), q(() => {
|
|
82
|
-
if (!
|
|
82
|
+
if (!I)
|
|
83
83
|
return;
|
|
84
|
-
const t = vt(
|
|
84
|
+
const t = vt(I);
|
|
85
85
|
if (!t.success) {
|
|
86
86
|
if (console.group(
|
|
87
87
|
`Tried to load the app's RjBuild but the ${t.format} content could not be parsed.`
|
|
@@ -90,7 +90,7 @@ const xt = ({
|
|
|
90
90
|
rjBuildFetchMethod: b,
|
|
91
91
|
headersForRjBuild: c,
|
|
92
92
|
maybeRawAppRjBuild: d,
|
|
93
|
-
dataOverride:
|
|
93
|
+
dataOverride: S
|
|
94
94
|
}), console.debug("Error details:", t.error), console.groupEnd(), typeof document < "u") {
|
|
95
95
|
let e = document.getElementById("rj-parsing-error-root");
|
|
96
96
|
if (e || (e = document.createElement("div"), e.id = "rj-parsing-error-root", document.body.appendChild(e)), !n.current) {
|
|
@@ -125,7 +125,7 @@ const xt = ({
|
|
|
125
125
|
ot(a.templates ?? a.listForms), !a.templates && a.listForms && console.log(
|
|
126
126
|
"'listForms' needs to be renamed to 'templates'. The support for 'listForms' will be removed in the next releases of reactive-json."
|
|
127
127
|
);
|
|
128
|
-
let i =
|
|
128
|
+
let i = S === void 0 ? a.data : S;
|
|
129
129
|
const s = a.additionalDataSource;
|
|
130
130
|
if (!Array.isArray(s) || s.length === 0) {
|
|
131
131
|
g({ type: "setData", data: i }), Q(a.renderView), Y(Object.keys(a.renderView));
|
|
@@ -133,6 +133,7 @@ const xt = ({
|
|
|
133
133
|
}
|
|
134
134
|
const m = {
|
|
135
135
|
headersForRjBuild: c,
|
|
136
|
+
plugins: E,
|
|
136
137
|
templateData: i,
|
|
137
138
|
templatePath: "data",
|
|
138
139
|
setData: R,
|
|
@@ -140,7 +141,7 @@ const xt = ({
|
|
|
140
141
|
}, r = {
|
|
141
142
|
templateData: i,
|
|
142
143
|
templatePath: "data"
|
|
143
|
-
}, l = s.filter((e) => e.blocking === !0),
|
|
144
|
+
}, l = s.filter((e) => e.blocking === !0), v = s.filter((e) => e.blocking !== !0), o = async (e, p) => {
|
|
144
145
|
var y;
|
|
145
146
|
try {
|
|
146
147
|
if (!e.src) {
|
|
@@ -167,7 +168,7 @@ const xt = ({
|
|
|
167
168
|
responseBody: k.data,
|
|
168
169
|
// additionalDataSource always processes raw data, not RjBuild.
|
|
169
170
|
isRjBuild: !1,
|
|
170
|
-
dataProcessors: (
|
|
171
|
+
dataProcessors: (E == null ? void 0 : E.dataProcessor) || {}
|
|
171
172
|
});
|
|
172
173
|
if (e.dataMapping)
|
|
173
174
|
try {
|
|
@@ -234,14 +235,14 @@ const xt = ({
|
|
|
234
235
|
console.error("Error processing blocking additionalDataSource:", p);
|
|
235
236
|
});
|
|
236
237
|
}
|
|
237
|
-
if (Q(a.renderView), Y(Object.keys(a.renderView)),
|
|
238
|
-
const e =
|
|
238
|
+
if (Q(a.renderView), Y(Object.keys(a.renderView)), v.length > 0) {
|
|
239
|
+
const e = v.map(
|
|
239
240
|
(p, y) => o(p, l.length + y)
|
|
240
241
|
);
|
|
241
242
|
Promise.allSettled(e);
|
|
242
243
|
}
|
|
243
244
|
})();
|
|
244
|
-
}, [
|
|
245
|
+
}, [I, S, c]);
|
|
245
246
|
function j(t, a, i) {
|
|
246
247
|
if (!N || N.size === 0)
|
|
247
248
|
return !1;
|
|
@@ -276,9 +277,9 @@ const xt = ({
|
|
|
276
277
|
const m = a.split(".");
|
|
277
278
|
(typeof t.realCurrentData != "object" || t.realCurrentData === null || Array.isArray(t.realCurrentData)) && (t.realCurrentData = {});
|
|
278
279
|
let r = t.realCurrentData;
|
|
279
|
-
for (let l = 0,
|
|
280
|
+
for (let l = 0, v = m.length; l < v; l++) {
|
|
280
281
|
const o = m[l];
|
|
281
|
-
if (l ===
|
|
282
|
+
if (l === v - 1) {
|
|
282
283
|
if (s === "remove" && Array.isArray(r))
|
|
283
284
|
r.splice(o, 1);
|
|
284
285
|
else if (s === "move")
|
|
@@ -318,7 +319,7 @@ const xt = ({
|
|
|
318
319
|
}
|
|
319
320
|
throw new Error("Could not update data.");
|
|
320
321
|
}
|
|
321
|
-
if (!
|
|
322
|
+
if (!I)
|
|
322
323
|
return null;
|
|
323
324
|
const U = st.map((t) => {
|
|
324
325
|
var a;
|
|
@@ -328,7 +329,7 @@ const xt = ({
|
|
|
328
329
|
datafield: t,
|
|
329
330
|
props: nt[t],
|
|
330
331
|
path: "data." + t,
|
|
331
|
-
currentData: (a =
|
|
332
|
+
currentData: (a = x.realCurrentData) == null ? void 0 : a[t]
|
|
332
333
|
},
|
|
333
334
|
t
|
|
334
335
|
);
|
|
@@ -338,12 +339,12 @@ const xt = ({
|
|
|
338
339
|
value: {
|
|
339
340
|
element: at,
|
|
340
341
|
headersForRjBuild: c,
|
|
341
|
-
plugins:
|
|
342
|
+
plugins: E,
|
|
342
343
|
// Expose the root component to avoid import cycles in core plugins.
|
|
343
344
|
ReactiveJsonRoot: xt,
|
|
344
345
|
setData: R,
|
|
345
346
|
setRawAppRjBuild: T,
|
|
346
|
-
templateData:
|
|
347
|
+
templateData: x.realCurrentData,
|
|
347
348
|
templatePath: "data",
|
|
348
349
|
updateData: W
|
|
349
350
|
},
|
|
@@ -352,13 +353,13 @@ const xt = ({
|
|
|
352
353
|
Pt.Provider,
|
|
353
354
|
{
|
|
354
355
|
value: {
|
|
355
|
-
templateData:
|
|
356
|
+
templateData: x.realCurrentData,
|
|
356
357
|
templatePath: "data"
|
|
357
358
|
},
|
|
358
359
|
children: O && A ? /* @__PURE__ */ C(A, { children: U }) : U
|
|
359
360
|
}
|
|
360
361
|
),
|
|
361
|
-
O ? K && /* @__PURE__ */ C(K, { children: JSON.stringify(
|
|
362
|
+
O ? K && /* @__PURE__ */ C(K, { children: JSON.stringify(x.realCurrentData, null, " ") }) : null
|
|
362
363
|
]
|
|
363
364
|
}
|
|
364
365
|
) });
|
package/dist/engine/index.js
CHANGED
|
@@ -1,50 +1,52 @@
|
|
|
1
1
|
import { ActionDependant as o, isValid as r } from "./Actions.js";
|
|
2
2
|
import { mergeComponentCollections as p } from "./ComponentCollector.js";
|
|
3
3
|
import { EventDispatcherContext as m } from "./EventDispatcherContext.js";
|
|
4
|
-
import { EventDispatcherProvider as
|
|
4
|
+
import { EventDispatcherProvider as i, addEventListener as x, removeEventListener as f } from "./EventDispatcherProvider.js";
|
|
5
5
|
import { GlobalDataContext as u } from "./GlobalDataContext.js";
|
|
6
6
|
import { GlobalDataContextProvider as c } from "./GlobalDataContextProvider.js";
|
|
7
7
|
import { PaginationContext as D } from "./PaginationContext.js";
|
|
8
8
|
import { ReactiveJsonRoot as b } from "./ReactiveJsonRoot.js";
|
|
9
9
|
import { TemplateContext as g } from "./TemplateContext.js";
|
|
10
|
-
import { dataLocationToPath as
|
|
10
|
+
import { dataLocationToPath as E, evaluateAttributes as P, evaluateTemplateValue as R, evaluateTemplateValueCollection as V, isTemplateValue as h, useEvaluatedAttributes as L } from "./TemplateSystem.js";
|
|
11
11
|
import { alterData as z } from "./utility/alterData.js";
|
|
12
12
|
import { analyzeDataOverrideReferences as J } from "./utility/analyzeDataOverrideReferences.js";
|
|
13
13
|
import { applyDataMapping as G } from "./utility/dataMappingSystem.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
14
|
+
import { replaceEventPlaceholders as j } from "./utility/eventPlaceholderSystem.js";
|
|
15
|
+
import { formatString as M, maybeFormatString as N } from "./utility/formatString.js";
|
|
16
|
+
import { propsDataLocationToPathAndValue as k } from "./utility/formElementsCommon.js";
|
|
17
|
+
import { parseRjBuild as H } from "./utility/parseRjBuild.js";
|
|
18
|
+
import { normalizeAttributeNameForReactJsx as K, normalizeAttributesForReactJsx as Q } from "./utility/reactJsxHelpers.js";
|
|
19
|
+
import { stringToBoolean as W } from "./utility/stringToBoolean.js";
|
|
20
|
+
import { View as Y } from "./View.js";
|
|
20
21
|
export {
|
|
21
22
|
o as ActionDependant,
|
|
22
23
|
m as EventDispatcherContext,
|
|
23
|
-
|
|
24
|
+
i as EventDispatcherProvider,
|
|
24
25
|
u as GlobalDataContext,
|
|
25
26
|
c as GlobalDataContextProvider,
|
|
26
27
|
D as PaginationContext,
|
|
27
28
|
b as ReactiveJsonRoot,
|
|
28
29
|
g as TemplateContext,
|
|
29
|
-
|
|
30
|
+
Y as View,
|
|
30
31
|
x as addEventListener,
|
|
31
32
|
z as alterData,
|
|
32
33
|
J as analyzeDataOverrideReferences,
|
|
33
34
|
G as applyDataMapping,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
E as dataLocationToPath,
|
|
36
|
+
P as evaluateAttributes,
|
|
37
|
+
R as evaluateTemplateValue,
|
|
38
|
+
V as evaluateTemplateValueCollection,
|
|
39
|
+
M as formatString,
|
|
39
40
|
h as isTemplateValue,
|
|
40
41
|
r as isValid,
|
|
41
|
-
|
|
42
|
+
N as maybeFormatString,
|
|
42
43
|
p as mergeComponentCollections,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
K as normalizeAttributeNameForReactJsx,
|
|
45
|
+
Q as normalizeAttributesForReactJsx,
|
|
46
|
+
H as parseRjBuild,
|
|
47
|
+
k as propsDataLocationToPathAndValue,
|
|
47
48
|
f as removeEventListener,
|
|
48
|
-
|
|
49
|
+
j as replaceEventPlaceholders,
|
|
50
|
+
W as stringToBoolean,
|
|
49
51
|
L as useEvaluatedAttributes
|
|
50
52
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const f = "<reactive-json:event>", d = "<reactive-json:event-new-value>", s = (e) => {
|
|
2
|
+
var n;
|
|
3
|
+
if (e) {
|
|
4
|
+
if (e instanceof CustomEvent)
|
|
5
|
+
return (n = e == null ? void 0 : e.detail) == null ? void 0 : n.value;
|
|
6
|
+
if (e.target) {
|
|
7
|
+
const t = e.target;
|
|
8
|
+
if (t.type === "checkbox")
|
|
9
|
+
return t.checked;
|
|
10
|
+
if (t.type === "radio")
|
|
11
|
+
return t.checked ? t.value : void 0;
|
|
12
|
+
if (typeof t.value < "u")
|
|
13
|
+
return t.value;
|
|
14
|
+
if (typeof t.checked < "u")
|
|
15
|
+
return t.checked;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}, o = (e, n) => {
|
|
19
|
+
if (typeof e != "string")
|
|
20
|
+
return e;
|
|
21
|
+
let t;
|
|
22
|
+
if (e.startsWith(d) && (t = d), e.startsWith(f) && (t = f), !t)
|
|
23
|
+
return e;
|
|
24
|
+
let i, r;
|
|
25
|
+
if (t === d && (i = s(n), r = e.slice(d.length)), t === f && (i = n, r = e.slice(f.length)), r.startsWith(".") && (r = r.slice(1)), !r)
|
|
26
|
+
return t === f ? void 0 : i;
|
|
27
|
+
if (!(typeof i != "object" || !i))
|
|
28
|
+
return r.split(".").reduce((c, a) => c ? c[a] : void 0, i);
|
|
29
|
+
}, u = (e, n) => {
|
|
30
|
+
if (Array.isArray(e))
|
|
31
|
+
return e.map((t) => u(t, n));
|
|
32
|
+
if (e && typeof e == "object") {
|
|
33
|
+
const t = {};
|
|
34
|
+
for (const [i, r] of Object.entries(e))
|
|
35
|
+
t[i] = u(r, n);
|
|
36
|
+
return t;
|
|
37
|
+
}
|
|
38
|
+
return o(e, n);
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
u as replaceEventPlaceholders
|
|
42
|
+
};
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { alterData as
|
|
1
|
+
import { alterData as o } from "./alterData.js";
|
|
2
2
|
import { analyzeDataOverrideReferences as a } from "./analyzeDataOverrideReferences.js";
|
|
3
3
|
import { applyDataMapping as m } from "./dataMappingSystem.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { replaceEventPlaceholders as f } from "./eventPlaceholderSystem.js";
|
|
5
|
+
import { formatString as l, maybeFormatString as x } from "./formatString.js";
|
|
6
|
+
import { propsDataLocationToPathAndValue as c } from "./formElementsCommon.js";
|
|
7
|
+
import { parseRjBuild as g } from "./parseRjBuild.js";
|
|
8
|
+
import { normalizeAttributeNameForReactJsx as D, normalizeAttributesForReactJsx as R } from "./reactJsxHelpers.js";
|
|
9
|
+
import { stringToBoolean as y } from "./stringToBoolean.js";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
o as alterData,
|
|
11
12
|
a as analyzeDataOverrideReferences,
|
|
12
13
|
m as applyDataMapping,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
l as formatString,
|
|
15
|
+
x as maybeFormatString,
|
|
16
|
+
D as normalizeAttributeNameForReactJsx,
|
|
17
|
+
R as normalizeAttributesForReactJsx,
|
|
18
|
+
g as parseRjBuild,
|
|
19
|
+
c as propsDataLocationToPathAndValue,
|
|
20
|
+
f as replaceEventPlaceholders,
|
|
21
|
+
y as stringToBoolean
|
|
20
22
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const e = /* @__PURE__ */ new Set([
|
|
2
|
+
"abort",
|
|
3
|
+
"animationEnd",
|
|
4
|
+
"animationIteration",
|
|
5
|
+
"animationStart",
|
|
6
|
+
"blur",
|
|
7
|
+
"canPlay",
|
|
8
|
+
"canPlayThrough",
|
|
9
|
+
"change",
|
|
10
|
+
"click",
|
|
11
|
+
"contextMenu",
|
|
12
|
+
"copy",
|
|
13
|
+
"cut",
|
|
14
|
+
"doubleClick",
|
|
15
|
+
"drag",
|
|
16
|
+
"dragEnd",
|
|
17
|
+
"dragEnter",
|
|
18
|
+
"dragExit",
|
|
19
|
+
"dragLeave",
|
|
20
|
+
"dragOver",
|
|
21
|
+
"dragStart",
|
|
22
|
+
"drop",
|
|
23
|
+
"durationChange",
|
|
24
|
+
"emptied",
|
|
25
|
+
"encrypted",
|
|
26
|
+
"ended",
|
|
27
|
+
"error",
|
|
28
|
+
"focus",
|
|
29
|
+
"gotPointerCapture",
|
|
30
|
+
"input",
|
|
31
|
+
"invalid",
|
|
32
|
+
"keyDown",
|
|
33
|
+
"keyPress",
|
|
34
|
+
"keyUp",
|
|
35
|
+
"load",
|
|
36
|
+
"loadedData",
|
|
37
|
+
"loadedMetadata",
|
|
38
|
+
"loadStart",
|
|
39
|
+
"lostPointerCapture",
|
|
40
|
+
"mouseDown",
|
|
41
|
+
"mouseEnter",
|
|
42
|
+
"mouseLeave",
|
|
43
|
+
"mouseMove",
|
|
44
|
+
"mouseOut",
|
|
45
|
+
"mouseOver",
|
|
46
|
+
"mouseUp",
|
|
47
|
+
"paste",
|
|
48
|
+
"pause",
|
|
49
|
+
"play",
|
|
50
|
+
"playing",
|
|
51
|
+
"pointerCancel",
|
|
52
|
+
"pointerDown",
|
|
53
|
+
"pointerEnter",
|
|
54
|
+
"pointerLeave",
|
|
55
|
+
"pointerMove",
|
|
56
|
+
"pointerOut",
|
|
57
|
+
"pointerOver",
|
|
58
|
+
"pointerUp",
|
|
59
|
+
"progress",
|
|
60
|
+
"rateChange",
|
|
61
|
+
"reset",
|
|
62
|
+
"scroll",
|
|
63
|
+
"seeked",
|
|
64
|
+
"seeking",
|
|
65
|
+
"select",
|
|
66
|
+
"stalled",
|
|
67
|
+
"submit",
|
|
68
|
+
"suspend",
|
|
69
|
+
"timeUpdate",
|
|
70
|
+
"toggle",
|
|
71
|
+
"touchCancel",
|
|
72
|
+
"touchEnd",
|
|
73
|
+
"touchMove",
|
|
74
|
+
"touchStart",
|
|
75
|
+
"transitionEnd",
|
|
76
|
+
"volumeChange",
|
|
77
|
+
"waiting",
|
|
78
|
+
"wheel"
|
|
79
|
+
]);
|
|
80
|
+
export {
|
|
81
|
+
e as reactEventProps
|
|
82
|
+
};
|