@ea-lab/reactive-json 1.4.0 → 2.0.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 +3 -2
- package/dist/component/action/ReactOnEvent.js +6 -5
- package/dist/component/attributeTransformer/setAttributeValue.js +20 -19
- package/dist/component/attributeTransformer/toggleAttributeValue.js +15 -14
- package/dist/component/attributeTransformer/unsetAttributeValue.js +8 -7
- package/dist/component/element/debug/VariablesDebug/VariablesDebug.js +74 -60
- package/dist/component/element/html/LabelFromValue.js +30 -18
- package/dist/component/element/index.js +28 -26
- package/dist/component/element/special/DataFilter.js +49 -40
- package/dist/component/element/special/DataSync.js +94 -0
- package/dist/component/element/special/index.js +15 -13
- package/dist/component/index.js +57 -55
- 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 +118 -5
- package/dist/component/reaction/utility/index.js +1 -1
- package/dist/engine/DataStore.js +120 -0
- package/dist/engine/ReactiveJsonRoot.js +218 -277
- package/dist/engine/StoreContext.js +17 -0
- package/dist/engine/View.js +94 -58
- package/dist/engine/hook/useReactiveData.js +9 -0
- package/dist/engine/index.js +53 -45
- package/dist/engine/utility/formElementsCommon.js +36 -23
- package/dist/{httpRequestCommon-C7MsJIKA.js → index-BUPRVmV-.js} +616 -733
- package/dist/index-DJuOXIM5.js +25 -0
- package/dist/main.js +156 -146
- package/package.json +1 -1
- package/dist/index-Ya6_R5yr.js +0 -23
|
@@ -8,11 +8,12 @@ import "../../engine/EventDispatcherContext.js";
|
|
|
8
8
|
import "../../engine/EventDispatcherProvider.js";
|
|
9
9
|
import "../../engine/PaginationContext.js";
|
|
10
10
|
import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|
|
11
|
+
import "../../engine/StoreContext.js";
|
|
11
12
|
import "../../index-NNBvIV0S.js";
|
|
12
13
|
import { replaceEventPlaceholders as E } from "../../engine/utility/eventPlaceholderSystem.js";
|
|
13
14
|
import "../../js-yaml-CFDLc3Ha.js";
|
|
14
15
|
import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
|
|
15
|
-
const
|
|
16
|
+
const k = (o) => {
|
|
16
17
|
const e = l(C), i = l(x), d = o.attributesHolderRef, n = e.plugins ?? {}, f = (n == null ? void 0 : n.reaction) ?? {}, t = (o == null ? void 0 : o.actionProps) ?? void 0;
|
|
17
18
|
return v(() => {
|
|
18
19
|
const p = t ?? void 0, m = (t == null ? void 0 : t.what) ?? void 0, c = (a) => {
|
|
@@ -29,5 +30,5 @@ const j = (o) => {
|
|
|
29
30
|
}, [e, t, i]), o.children;
|
|
30
31
|
};
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
+
k as CustomEventListener
|
|
33
34
|
};
|
|
@@ -8,12 +8,13 @@ import "../../engine/EventDispatcherContext.js";
|
|
|
8
8
|
import "../../engine/EventDispatcherProvider.js";
|
|
9
9
|
import "../../engine/PaginationContext.js";
|
|
10
10
|
import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|
|
11
|
+
import "../../engine/StoreContext.js";
|
|
11
12
|
import "../../index-NNBvIV0S.js";
|
|
12
13
|
import { replaceEventPlaceholders as j } from "../../engine/utility/eventPlaceholderSystem.js";
|
|
13
14
|
import "../../js-yaml-CFDLc3Ha.js";
|
|
14
15
|
import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
|
|
15
|
-
const
|
|
16
|
-
const
|
|
16
|
+
const I = (p) => {
|
|
17
|
+
const s = l(A), g = l(E), n = s.plugins ?? {}, b = (n == null ? void 0 : n.reaction) ?? {}, { actionProps: P } = p, c = {};
|
|
17
18
|
for (const [o, a] of Object.entries(P))
|
|
18
19
|
c[o] = (t) => {
|
|
19
20
|
let r = !0;
|
|
@@ -42,7 +43,7 @@ const H = (s) => {
|
|
|
42
43
|
timeStamp: t.timeStamp,
|
|
43
44
|
type: t.type
|
|
44
45
|
},
|
|
45
|
-
globalDataContext:
|
|
46
|
+
globalDataContext: s,
|
|
46
47
|
templateContext: g
|
|
47
48
|
}), i.stopPropagation === !0)
|
|
48
49
|
break;
|
|
@@ -58,9 +59,9 @@ const H = (s) => {
|
|
|
58
59
|
var r;
|
|
59
60
|
return t.type === C ? m((r = t == null ? void 0 : t.props) == null ? void 0 : r.children) : typeof t != "object" || !y(t) ? t : T(t, c);
|
|
60
61
|
});
|
|
61
|
-
}, F = m(
|
|
62
|
+
}, F = m(p.children);
|
|
62
63
|
return /* @__PURE__ */ d(x, { children: F });
|
|
63
64
|
};
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
+
I as ReactOnEvent
|
|
66
67
|
};
|
|
@@ -10,20 +10,21 @@ import "../../engine/EventDispatcherProvider.js";
|
|
|
10
10
|
import "../../engine/PaginationContext.js";
|
|
11
11
|
import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|
|
12
12
|
import { normalizeAttributeNameForReactJsx as d } from "../../engine/utility/reactJsxHelpers.js";
|
|
13
|
+
import "../../engine/StoreContext.js";
|
|
13
14
|
import "../../index-NNBvIV0S.js";
|
|
14
15
|
import "../../js-yaml-CFDLc3Ha.js";
|
|
15
16
|
import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
|
|
16
|
-
const f = (e,
|
|
17
|
+
const f = (e, s, m, a) => {
|
|
17
18
|
const l = { ...e };
|
|
18
|
-
for (const r in
|
|
19
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
20
|
-
const n =
|
|
19
|
+
for (const r in s)
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(s, r)) {
|
|
21
|
+
const n = s[r], t = l[r];
|
|
21
22
|
if (n !== null && typeof n == "object" && !Array.isArray(n))
|
|
22
|
-
t !== null && typeof t == "object" && !Array.isArray(t) ? l[r] = f(t, n,
|
|
23
|
+
t !== null && typeof t == "object" && !Array.isArray(t) ? l[r] = f(t, n, m, a) : l[r] = n;
|
|
23
24
|
else if (typeof t == "string" && typeof n == "string") {
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
const o = [...
|
|
25
|
+
const p = t ? t.split(a) : [];
|
|
26
|
+
if (!m || !p.includes(n)) {
|
|
27
|
+
const o = [...p, n];
|
|
27
28
|
l[r] = o.join(a);
|
|
28
29
|
} else
|
|
29
30
|
l[r] = t;
|
|
@@ -31,10 +32,10 @@ const f = (e, p, u, a) => {
|
|
|
31
32
|
l[r] = n;
|
|
32
33
|
}
|
|
33
34
|
return l;
|
|
34
|
-
},
|
|
35
|
-
const { name: l, mode: r = "append", value: n, preventDuplicateValues: t = !0, separator:
|
|
35
|
+
}, q = ({ attributes: e, globalDataContext: s, singleTransformProps: m, templateContext: a }) => {
|
|
36
|
+
const { name: l, mode: r = "append", value: n, preventDuplicateValues: t = !0, separator: p = " " } = m, o = V({
|
|
36
37
|
valueToEvaluate: n,
|
|
37
|
-
globalDataContext:
|
|
38
|
+
globalDataContext: s,
|
|
38
39
|
templateContext: a
|
|
39
40
|
}), i = d(l);
|
|
40
41
|
if (o === void 0)
|
|
@@ -43,12 +44,12 @@ const f = (e, p, u, a) => {
|
|
|
43
44
|
if (r === "replace")
|
|
44
45
|
e[i] = o;
|
|
45
46
|
else {
|
|
46
|
-
const c = e[i] || {},
|
|
47
|
+
const c = e[i] || {}, u = typeof c == "object" && !Array.isArray(c) ? c : {};
|
|
47
48
|
e[i] = f(
|
|
48
|
-
|
|
49
|
+
u,
|
|
49
50
|
o,
|
|
50
51
|
t,
|
|
51
|
-
|
|
52
|
+
p
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
55
|
else if (r === "replace")
|
|
@@ -57,14 +58,14 @@ const f = (e, p, u, a) => {
|
|
|
57
58
|
const c = e[i] || "";
|
|
58
59
|
if (typeof c != "string")
|
|
59
60
|
return e[i] = o, e;
|
|
60
|
-
const
|
|
61
|
-
if (!t || !
|
|
62
|
-
const y = [...
|
|
63
|
-
e[i] = y.join(
|
|
61
|
+
const u = c ? c.split(p) : [];
|
|
62
|
+
if (!t || !u.includes(o)) {
|
|
63
|
+
const y = [...u, o];
|
|
64
|
+
e[i] = y.join(p);
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
return e;
|
|
67
68
|
};
|
|
68
69
|
export {
|
|
69
|
-
|
|
70
|
+
q as setAttributeValue
|
|
70
71
|
};
|
|
@@ -10,37 +10,38 @@ import "../../engine/EventDispatcherProvider.js";
|
|
|
10
10
|
import "../../engine/PaginationContext.js";
|
|
11
11
|
import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|
|
12
12
|
import { normalizeAttributeNameForReactJsx as A } from "../../engine/utility/reactJsxHelpers.js";
|
|
13
|
+
import "../../engine/StoreContext.js";
|
|
13
14
|
import "../../index-NNBvIV0S.js";
|
|
14
15
|
import "../../js-yaml-CFDLc3Ha.js";
|
|
15
16
|
import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
|
|
16
|
-
const
|
|
17
|
-
const { name: p, value:
|
|
18
|
-
if (!p ||
|
|
17
|
+
const B = ({ attributes: o, globalDataContext: V, singleTransformProps: x, templateContext: g }) => {
|
|
18
|
+
const { name: p, value: m, separator: u = " ", keepAttributeWhenEmpty: h = !1 } = x || {};
|
|
19
|
+
if (!p || m === void 0)
|
|
19
20
|
return o;
|
|
20
21
|
const s = v({
|
|
21
|
-
valueToEvaluate:
|
|
22
|
+
valueToEvaluate: m,
|
|
22
23
|
globalDataContext: V,
|
|
23
24
|
templateContext: g
|
|
24
|
-
}),
|
|
25
|
-
let l = [...f ? f.split(
|
|
25
|
+
}), n = A(p), f = o[n] || "";
|
|
26
|
+
let l = [...f ? f.split(u).filter((e) => e.trim() !== "") : []];
|
|
26
27
|
if (Array.isArray(s)) {
|
|
27
28
|
const e = s.map((t) => String(t));
|
|
28
29
|
if (e.length === 0)
|
|
29
30
|
return o;
|
|
30
31
|
if (e.length === 1) {
|
|
31
|
-
const t = e[0],
|
|
32
|
-
|
|
32
|
+
const t = e[0], i = l.indexOf(t);
|
|
33
|
+
i > -1 ? l.splice(i, 1) : t !== "" && l.push(t);
|
|
33
34
|
} else {
|
|
34
|
-
let t = -1,
|
|
35
|
+
let t = -1, i = -1;
|
|
35
36
|
for (let r = 0; r < e.length; r++) {
|
|
36
37
|
const a = e[r], d = l.indexOf(a);
|
|
37
38
|
if (d > -1) {
|
|
38
|
-
t = d,
|
|
39
|
+
t = d, i = r;
|
|
39
40
|
break;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
if (t > -1) {
|
|
43
|
-
const r = (
|
|
44
|
+
const r = (i + 1) % e.length, a = e[r];
|
|
44
45
|
l.splice(t, 1), a !== "" && l.push(a);
|
|
45
46
|
} else {
|
|
46
47
|
const r = e[0];
|
|
@@ -51,9 +52,9 @@ const q = ({ attributes: o, globalDataContext: V, singleTransformProps: x, templ
|
|
|
51
52
|
const e = String(s), t = l.indexOf(e);
|
|
52
53
|
t > -1 ? l.splice(t, 1) : l.push(e);
|
|
53
54
|
}
|
|
54
|
-
const c = l.join(
|
|
55
|
-
return c.trim() === "" ? h ? o[
|
|
55
|
+
const c = l.join(u);
|
|
56
|
+
return c.trim() === "" ? h ? o[n] = "" : delete o[n] : o[n] = c, o;
|
|
56
57
|
};
|
|
57
58
|
export {
|
|
58
|
-
|
|
59
|
+
B as toggleAttributeValue
|
|
59
60
|
};
|
|
@@ -10,11 +10,12 @@ import "../../engine/EventDispatcherProvider.js";
|
|
|
10
10
|
import "../../engine/PaginationContext.js";
|
|
11
11
|
import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|
|
12
12
|
import { normalizeAttributeNameForReactJsx as w } from "../../engine/utility/reactJsxHelpers.js";
|
|
13
|
+
import "../../engine/StoreContext.js";
|
|
13
14
|
import "../../index-NNBvIV0S.js";
|
|
14
15
|
import "../../js-yaml-CFDLc3Ha.js";
|
|
15
16
|
import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
|
|
16
|
-
const
|
|
17
|
-
const { name: s, value: m, separator:
|
|
17
|
+
const B = ({ attributes: t, globalDataContext: l, singleTransformProps: A, templateContext: a }) => {
|
|
18
|
+
const { name: s, value: m, separator: p = " ", unsetAllOccurrences: C, unsetCount: c } = A || {};
|
|
18
19
|
if (!s || m === void 0)
|
|
19
20
|
return t;
|
|
20
21
|
const n = String(
|
|
@@ -23,14 +24,14 @@ const y = ({ attributes: t, globalDataContext: l, singleTransformProps: A, templ
|
|
|
23
24
|
globalDataContext: l,
|
|
24
25
|
templateContext: a
|
|
25
26
|
})
|
|
26
|
-
), u =
|
|
27
|
-
valueToEvaluate:
|
|
27
|
+
), u = c !== void 0 ? V({
|
|
28
|
+
valueToEvaluate: c,
|
|
28
29
|
globalDataContext: l,
|
|
29
30
|
templateContext: a
|
|
30
31
|
}) : void 0, i = w(s), f = t[i] || "";
|
|
31
32
|
if (!f)
|
|
32
33
|
return t;
|
|
33
|
-
let e = [...f.split(
|
|
34
|
+
let e = [...f.split(p)];
|
|
34
35
|
(() => {
|
|
35
36
|
if (C === !0) {
|
|
36
37
|
e = e.filter((r) => r !== n);
|
|
@@ -52,9 +53,9 @@ const y = ({ attributes: t, globalDataContext: l, singleTransformProps: A, templ
|
|
|
52
53
|
let d = 0;
|
|
53
54
|
e = e.reverse().filter((r) => r === n && d < N ? (d++, !1) : !0).reverse();
|
|
54
55
|
})();
|
|
55
|
-
const v = e.join(
|
|
56
|
+
const v = e.join(p);
|
|
56
57
|
return v.trim() === "" ? delete t[i] : t[i] = v, t;
|
|
57
58
|
};
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
B as unsetAttributeValue
|
|
60
61
|
};
|
|
@@ -1,86 +1,100 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { r as
|
|
4
|
-
import { ActionDependant as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useContext as B, useRef as E, useEffect as O, useCallback as q, useSyncExternalStore as j, useMemo as f } from "react";
|
|
3
|
+
import { r as C } from "../../../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|
|
4
|
+
import { ActionDependant as T } from "../../../../engine/Actions.js";
|
|
5
|
+
import "../../../../lodash-CYNxjS-I.js";
|
|
5
6
|
import "../../../../engine/EventDispatcherContext.js";
|
|
6
7
|
import "../../../../engine/EventDispatcherProvider.js";
|
|
7
|
-
import "../../../../engine/GlobalDataContext.js";
|
|
8
|
+
import { GlobalDataContext as x } from "../../../../engine/GlobalDataContext.js";
|
|
8
9
|
import "../../../../engine/PaginationContext.js";
|
|
9
|
-
import "../../../../
|
|
10
|
-
import
|
|
10
|
+
import { TemplateContext as I } from "../../../../engine/TemplateContext.js";
|
|
11
|
+
import "../../../../engine/StoreContext.js";
|
|
11
12
|
import "../../../../index-NNBvIV0S.js";
|
|
12
13
|
import "../../../../jsonpath-B9kE9k9e.js";
|
|
13
14
|
import "../../../../js-yaml-CFDLc3Ha.js";
|
|
14
15
|
import "../../../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
|
|
15
|
-
import { DebugMode as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { flattenObject as
|
|
19
|
-
import '../../../../assets/VariablesDebug.css';const
|
|
20
|
-
debugRoot:
|
|
21
|
-
container:
|
|
22
|
-
expanded:
|
|
23
|
-
header:
|
|
24
|
-
actions:
|
|
25
|
-
btn:
|
|
26
|
-
active:
|
|
27
|
-
path:
|
|
28
|
-
value:
|
|
29
|
-
copyBtn:
|
|
30
|
-
copyBtnSuccess:
|
|
31
|
-
copyBtnError:
|
|
32
|
-
info:
|
|
33
|
-
},
|
|
34
|
-
const [
|
|
35
|
-
|
|
16
|
+
import { DebugMode as s } from "./DebugMode.enum.js";
|
|
17
|
+
import M from "./ModeDisplay/DebugList/DebugList.js";
|
|
18
|
+
import w from "./ModeDisplay/DebugJson/DebugJson.js";
|
|
19
|
+
import { flattenObject as A } from "./utils.js";
|
|
20
|
+
import '../../../../assets/VariablesDebug.css';const H = "_debugRoot_1ny7q_1", V = "_container_1ny7q_16", W = "_expanded_1ny7q_34", z = "_header_1ny7q_39", F = "_actions_1ny7q_45", G = "_btn_1ny7q_50", K = "_active_1ny7q_58", Q = "_path_1ny7q_62", U = "_value_1ny7q_66", X = "_copyBtn_1ny7q_70", Y = "_copyBtnSuccess_1ny7q_74", Z = "_copyBtnError_1ny7q_78", tt = "_info_1ny7q_82", o = {
|
|
21
|
+
debugRoot: H,
|
|
22
|
+
container: V,
|
|
23
|
+
expanded: W,
|
|
24
|
+
header: z,
|
|
25
|
+
actions: F,
|
|
26
|
+
btn: G,
|
|
27
|
+
active: K,
|
|
28
|
+
path: Q,
|
|
29
|
+
value: U,
|
|
30
|
+
copyBtn: X,
|
|
31
|
+
copyBtnSuccess: Y,
|
|
32
|
+
copyBtnError: Z,
|
|
33
|
+
info: tt
|
|
34
|
+
}, St = ({ props: D }) => {
|
|
35
|
+
const [a, _] = m(!1), [d, y] = m(s.LIST), n = B(I), u = E(null), [b, L] = m(null), h = E(null);
|
|
36
|
+
O(() => {
|
|
36
37
|
if (typeof document > "u") return;
|
|
37
38
|
let t = document.getElementById("rj-debug-root");
|
|
38
|
-
t || (t = document.createElement("div"), t.id = "rj-debug-root", t.classList.add(
|
|
39
|
+
t || (t = document.createElement("div"), t.id = "rj-debug-root", t.classList.add(o.debugRoot), document.body.appendChild(t)), L(t);
|
|
39
40
|
}, []);
|
|
40
|
-
const
|
|
41
|
-
|
|
41
|
+
const p = B(x), c = p == null ? void 0 : p.store, g = (t) => !t || t === "data" ? "" : t.startsWith("data.") ? t.substring(5) : t, P = q((t) => {
|
|
42
|
+
if (c) {
|
|
43
|
+
const r = g(n == null ? void 0 : n.templatePath);
|
|
44
|
+
return c.subscribe(r, t);
|
|
45
|
+
}
|
|
46
|
+
return () => {
|
|
47
|
+
};
|
|
48
|
+
}, [c, n == null ? void 0 : n.templatePath]), $ = q(() => {
|
|
49
|
+
if (c) {
|
|
50
|
+
const t = g(n == null ? void 0 : n.templatePath);
|
|
51
|
+
return c.get(t);
|
|
52
|
+
}
|
|
53
|
+
return n == null ? void 0 : n.templateData;
|
|
54
|
+
}, [c, n == null ? void 0 : n.templateData, n == null ? void 0 : n.templatePath]), S = j(P, $), l = f(() => S ?? {}, [S]), v = f(() => JSON.stringify(l, null, 2), [l]), N = f(() => A(l), [l]), R = async () => {
|
|
55
|
+
const t = u.current;
|
|
42
56
|
try {
|
|
43
57
|
if (await navigator.clipboard.writeText(
|
|
44
|
-
|
|
58
|
+
d === s.JSON ? v : N.map((r) => `${r.path}: ${JSON.stringify(r.value)}`).join(`
|
|
45
59
|
`)
|
|
46
60
|
), !t) return;
|
|
47
|
-
t.classList.add(
|
|
48
|
-
var
|
|
49
|
-
(
|
|
61
|
+
t.classList.add(o.copyBtnSuccess), t.textContent = "Copied!", setTimeout(() => {
|
|
62
|
+
var r;
|
|
63
|
+
(r = u.current) == null || r.classList.remove(o.copyBtnSuccess, o.copyBtnError);
|
|
50
64
|
}, 3e3);
|
|
51
65
|
} catch {
|
|
52
|
-
t == null || t.classList.add(
|
|
53
|
-
t == null || t.classList.remove(
|
|
66
|
+
t == null || t.classList.add(o.copyBtnError), setTimeout(() => {
|
|
67
|
+
t == null || t.classList.remove(o.copyBtnError);
|
|
54
68
|
}, 3e3);
|
|
55
69
|
}
|
|
56
|
-
},
|
|
70
|
+
}, k = /* @__PURE__ */ e(T, { ...D, attributesHolderRef: h, children: /* @__PURE__ */ i(
|
|
57
71
|
"div",
|
|
58
72
|
{
|
|
59
|
-
className: `${
|
|
60
|
-
onClick: () =>
|
|
73
|
+
className: `${o.container} ${a ? o.expanded : ""}`,
|
|
74
|
+
onClick: () => _((t) => !t),
|
|
61
75
|
role: "button",
|
|
62
|
-
ref:
|
|
76
|
+
ref: h,
|
|
63
77
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ i("div", { className: o.header, children: [
|
|
79
|
+
/* @__PURE__ */ i("p", { style: { margin: 0, fontWeight: 600 }, children: [
|
|
66
80
|
"Debug Variables ",
|
|
67
|
-
/* @__PURE__ */ e("code", { children:
|
|
81
|
+
/* @__PURE__ */ e("code", { children: n.templatePath })
|
|
68
82
|
] }),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
83
|
+
/* @__PURE__ */ i("div", { className: o.actions, onClick: (t) => t.stopPropagation(), children: [
|
|
84
|
+
a && /* @__PURE__ */ i(J, { children: [
|
|
71
85
|
/* @__PURE__ */ e(
|
|
72
86
|
"button",
|
|
73
87
|
{
|
|
74
|
-
className: `${
|
|
75
|
-
onClick: () =>
|
|
88
|
+
className: `${o.btn} ${d === s.LIST ? o.active : ""}`,
|
|
89
|
+
onClick: () => y(s.LIST),
|
|
76
90
|
children: "List"
|
|
77
91
|
}
|
|
78
92
|
),
|
|
79
93
|
/* @__PURE__ */ e(
|
|
80
94
|
"button",
|
|
81
95
|
{
|
|
82
|
-
className: `${
|
|
83
|
-
onClick: () =>
|
|
96
|
+
className: `${o.btn} ${d === s.JSON ? o.active : ""}`,
|
|
97
|
+
onClick: () => y(s.JSON),
|
|
84
98
|
children: "JSON"
|
|
85
99
|
}
|
|
86
100
|
)
|
|
@@ -88,28 +102,28 @@ import '../../../../assets/VariablesDebug.css';const O = "_debugRoot_1ny7q_1", j
|
|
|
88
102
|
/* @__PURE__ */ e(
|
|
89
103
|
"button",
|
|
90
104
|
{
|
|
91
|
-
className:
|
|
92
|
-
onClick: () =>
|
|
93
|
-
children:
|
|
105
|
+
className: o.btn,
|
|
106
|
+
onClick: () => _((t) => !t),
|
|
107
|
+
children: a ? "Collapse" : "Expand"
|
|
94
108
|
}
|
|
95
109
|
),
|
|
96
|
-
|
|
110
|
+
a && /* @__PURE__ */ e(
|
|
97
111
|
"button",
|
|
98
112
|
{
|
|
99
|
-
className: `${
|
|
100
|
-
onClick:
|
|
101
|
-
ref:
|
|
113
|
+
className: `${o.btn} ${o.copyBtn}`,
|
|
114
|
+
onClick: R,
|
|
115
|
+
ref: u,
|
|
102
116
|
children: "Copy"
|
|
103
117
|
}
|
|
104
118
|
)
|
|
105
119
|
] })
|
|
106
120
|
] }),
|
|
107
|
-
|
|
121
|
+
a && /* @__PURE__ */ e("div", { className: o.info, onClick: (t) => t.stopPropagation(), children: d === s.JSON ? /* @__PURE__ */ e(w, { jsonString: v }) : /* @__PURE__ */ e(M, { flatRows: N }) })
|
|
108
122
|
]
|
|
109
123
|
}
|
|
110
124
|
) });
|
|
111
|
-
return
|
|
125
|
+
return b ? C.createPortal(k, b) : null;
|
|
112
126
|
};
|
|
113
127
|
export {
|
|
114
|
-
|
|
128
|
+
St as VariablesDebug
|
|
115
129
|
};
|
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as f } from "react";
|
|
3
|
-
import { ActionDependant as
|
|
3
|
+
import { ActionDependant as d } from "../../../engine/Actions.js";
|
|
4
4
|
import { GlobalDataContext as x } from "../../../engine/GlobalDataContext.js";
|
|
5
5
|
import { TemplateContext as b } from "../../../engine/TemplateContext.js";
|
|
6
|
-
import { evaluateTemplateValue as
|
|
6
|
+
import { evaluateTemplateValue as s } from "../../../engine/TemplateSystem.js";
|
|
7
7
|
import { View as V } from "../../../engine/View.js";
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const E = ({ currentData: v, datafield: e, path: D, props: a }) => {
|
|
9
|
+
const m = f(x), t = f(b), r = a.dynamicOptions ?? void 0;
|
|
10
10
|
let i;
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
r ? i = s({ valueToEvaluate: r, globalDataContext: m, templateContext: t }) ?? [] : i = a.options ?? [];
|
|
12
|
+
let o;
|
|
13
|
+
const n = a.defaultFieldValue ?? void 0, p = a.dataLocation ?? void 0;
|
|
14
|
+
if (p)
|
|
15
|
+
o = s({
|
|
16
|
+
globalDataContext: m,
|
|
17
|
+
templateContext: t,
|
|
18
|
+
valueToEvaluate: p
|
|
19
|
+
}) ?? n;
|
|
20
|
+
else {
|
|
21
|
+
if ((t.templateData[e] ?? void 0) === void 0)
|
|
22
|
+
if (typeof t.templateData == "object" && t.templateData !== null)
|
|
23
|
+
t.templateData[e] = n;
|
|
24
|
+
else
|
|
25
|
+
try {
|
|
26
|
+
t.templateData = {}, t.templateData[e] = n;
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
o = t.templateData[e];
|
|
30
|
+
}
|
|
31
|
+
let l = i.find((u) => u.value === o);
|
|
20
32
|
if (!l || !l.label) {
|
|
21
|
-
if (!
|
|
33
|
+
if (!o)
|
|
22
34
|
return null;
|
|
23
|
-
l =
|
|
35
|
+
l = o;
|
|
24
36
|
}
|
|
25
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ c(d, { ...a, children: /* @__PURE__ */ c(V, { currentData: v, datafield: e, path: D, props: l.label }) });
|
|
26
38
|
};
|
|
27
39
|
export {
|
|
28
|
-
|
|
40
|
+
E as LabelFromValue
|
|
29
41
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { d as o } from "../../index-CACLSxWi.js";
|
|
2
2
|
import { f as e } from "../../index-CpGvV5AF.js";
|
|
3
3
|
import { h as r } from "../../index-BNvY8PkY.js";
|
|
4
|
-
import { s as t } from "../../index-
|
|
4
|
+
import { s as t } from "../../index-DJuOXIM5.js";
|
|
5
5
|
import { VariablesDebug as n } from "./debug/VariablesDebug/VariablesDebug.js";
|
|
6
6
|
import { Input as F } from "./form/Input.js";
|
|
7
7
|
import { CheckBoxField as c } from "./form/CheckBoxField.js";
|
|
8
8
|
import { ColorField as C } from "./form/ColorField.js";
|
|
9
9
|
import { DateField as T } from "./form/DateField.js";
|
|
10
10
|
import { DateTimeField as S } from "./form/DateTimeField.js";
|
|
11
|
-
import { EmailField as
|
|
11
|
+
import { EmailField as g } from "./form/EmailField.js";
|
|
12
12
|
import { FileField as R } from "./form/FileField.js";
|
|
13
13
|
import { HiddenField as B } from "./form/HiddenField.js";
|
|
14
14
|
import { MonthField as v } from "./form/MonthField.js";
|
|
15
|
-
import { NumberField as
|
|
16
|
-
import { PasswordField as
|
|
17
|
-
import { RangeField as
|
|
18
|
-
import { SearchField as
|
|
19
|
-
import { SelectField as
|
|
15
|
+
import { NumberField as y } from "./form/NumberField.js";
|
|
16
|
+
import { PasswordField as H } from "./form/PasswordField.js";
|
|
17
|
+
import { RangeField as J } from "./form/RangeField.js";
|
|
18
|
+
import { SearchField as N } from "./form/SearchField.js";
|
|
19
|
+
import { SelectField as W } from "./form/SelectField.js";
|
|
20
20
|
import { TelField as U } from "./form/TelField.js";
|
|
21
21
|
import { TextAreaField as q } from "./form/TextAreaField.js";
|
|
22
22
|
import { TextField as G } from "./form/TextField.js";
|
|
@@ -31,12 +31,13 @@ import { PreformattedMarkup as lo } from "./html/PreformattedMarkup.js";
|
|
|
31
31
|
import { SortableTreeItemCollapseButton as io } from "./html/SortableTreeItemCollapseButton.js";
|
|
32
32
|
import { Count as no } from "./special/Count.js";
|
|
33
33
|
import { DataFilter as so } from "./special/DataFilter.js";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
34
|
+
import { DataSync as uo } from "./special/DataSync.js";
|
|
35
|
+
import { DelayedActions as bo, getReactionFunctionsToExecute as To } from "./special/DelayedActions.js";
|
|
36
|
+
import { PageControls as So } from "./special/PageControls.js";
|
|
37
|
+
import { Phantom as go } from "./special/Phantom.js";
|
|
38
|
+
import { ReactiveJsonBasicComponentWrapper as Ro } from "./special/ReactiveJsonBasicComponentWrapper.js";
|
|
39
|
+
import { ReactiveJsonSubroot as Bo } from "./special/ReactiveJsonSubroot.js";
|
|
40
|
+
import { Switch as vo } from "./special/Switch.js";
|
|
40
41
|
const x = {
|
|
41
42
|
...o,
|
|
42
43
|
...e,
|
|
@@ -48,10 +49,11 @@ export {
|
|
|
48
49
|
C as ColorField,
|
|
49
50
|
no as Count,
|
|
50
51
|
so as DataFilter,
|
|
52
|
+
uo as DataSync,
|
|
51
53
|
T as DateField,
|
|
52
54
|
S as DateTimeField,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
bo as DelayedActions,
|
|
56
|
+
g as EmailField,
|
|
55
57
|
R as FileField,
|
|
56
58
|
$ as FolderSortableTree,
|
|
57
59
|
eo as FormatNumeral,
|
|
@@ -60,18 +62,18 @@ export {
|
|
|
60
62
|
F as Input,
|
|
61
63
|
po as LabelFromValue,
|
|
62
64
|
v as MonthField,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
y as NumberField,
|
|
66
|
+
So as PageControls,
|
|
67
|
+
H as PasswordField,
|
|
68
|
+
go as Phantom,
|
|
67
69
|
lo as PreformattedMarkup,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
J as RangeField,
|
|
71
|
+
Ro as ReactiveJsonBasicComponentWrapper,
|
|
72
|
+
Bo as ReactiveJsonSubroot,
|
|
73
|
+
N as SearchField,
|
|
74
|
+
W as SelectField,
|
|
73
75
|
io as SortableTreeItemCollapseButton,
|
|
74
|
-
|
|
76
|
+
vo as Switch,
|
|
75
77
|
U as TelField,
|
|
76
78
|
q as TextAreaField,
|
|
77
79
|
G as TextField,
|
|
@@ -80,5 +82,5 @@ export {
|
|
|
80
82
|
n as VariablesDebug,
|
|
81
83
|
Z as WeekField,
|
|
82
84
|
x as coreElementComponents,
|
|
83
|
-
|
|
85
|
+
To as getReactionFunctionsToExecute
|
|
84
86
|
};
|