@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.
Files changed (29) hide show
  1. package/dist/component/action/CustomEventListener.js +3 -2
  2. package/dist/component/action/ReactOnEvent.js +6 -5
  3. package/dist/component/attributeTransformer/setAttributeValue.js +20 -19
  4. package/dist/component/attributeTransformer/toggleAttributeValue.js +15 -14
  5. package/dist/component/attributeTransformer/unsetAttributeValue.js +8 -7
  6. package/dist/component/element/debug/VariablesDebug/VariablesDebug.js +74 -60
  7. package/dist/component/element/html/LabelFromValue.js +30 -18
  8. package/dist/component/element/index.js +28 -26
  9. package/dist/component/element/special/DataFilter.js +49 -40
  10. package/dist/component/element/special/DataSync.js +94 -0
  11. package/dist/component/element/special/index.js +15 -13
  12. package/dist/component/index.js +57 -55
  13. package/dist/component/reaction/fetchData.js +1 -1
  14. package/dist/component/reaction/index.js +1 -1
  15. package/dist/component/reaction/submitData.js +1 -1
  16. package/dist/component/reaction/utility/httpRequestCommon.js +118 -5
  17. package/dist/component/reaction/utility/index.js +1 -1
  18. package/dist/engine/DataStore.js +120 -0
  19. package/dist/engine/ReactiveJsonRoot.js +218 -277
  20. package/dist/engine/StoreContext.js +17 -0
  21. package/dist/engine/View.js +94 -58
  22. package/dist/engine/hook/useReactiveData.js +9 -0
  23. package/dist/engine/index.js +53 -45
  24. package/dist/engine/utility/formElementsCommon.js +36 -23
  25. package/dist/{httpRequestCommon-C7MsJIKA.js → index-BUPRVmV-.js} +616 -733
  26. package/dist/index-DJuOXIM5.js +25 -0
  27. package/dist/main.js +156 -146
  28. package/package.json +1 -1
  29. 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 j = (o) => {
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
- j as CustomEventListener
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 H = (s) => {
16
- const p = l(A), g = l(E), n = p.plugins ?? {}, b = (n == null ? void 0 : n.reaction) ?? {}, { actionProps: P } = s, c = {};
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: p,
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(s.children);
62
+ }, F = m(p.children);
62
63
  return /* @__PURE__ */ d(x, { children: F });
63
64
  };
64
65
  export {
65
- H as ReactOnEvent
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, p, u, a) => {
17
+ const f = (e, s, m, a) => {
17
18
  const l = { ...e };
18
- for (const r in p)
19
- if (Object.prototype.hasOwnProperty.call(p, r)) {
20
- const n = p[r], t = l[r];
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, u, a) : l[r] = 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 s = t ? t.split(a) : [];
25
- if (!u || !s.includes(n)) {
26
- const o = [...s, n];
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
- }, P = ({ attributes: e, globalDataContext: p, singleTransformProps: u, templateContext: a }) => {
35
- const { name: l, mode: r = "append", value: n, preventDuplicateValues: t = !0, separator: s = " " } = u, o = V({
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: p,
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] || {}, m = typeof c == "object" && !Array.isArray(c) ? c : {};
47
+ const c = e[i] || {}, u = typeof c == "object" && !Array.isArray(c) ? c : {};
47
48
  e[i] = f(
48
- m,
49
+ u,
49
50
  o,
50
51
  t,
51
- s
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 m = c ? c.split(s) : [];
61
- if (!t || !m.includes(o)) {
62
- const y = [...m, o];
63
- e[i] = y.join(s);
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
- P as setAttributeValue
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 q = ({ attributes: o, globalDataContext: V, singleTransformProps: x, templateContext: g }) => {
17
- const { name: p, value: u, separator: m = " ", keepAttributeWhenEmpty: h = !1 } = x || {};
18
- if (!p || u === void 0)
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: u,
22
+ valueToEvaluate: m,
22
23
  globalDataContext: V,
23
24
  templateContext: g
24
- }), i = A(p), f = o[i] || "";
25
- let l = [...f ? f.split(m).filter((e) => e.trim() !== "") : []];
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], n = l.indexOf(t);
32
- n > -1 ? l.splice(n, 1) : t !== "" && l.push(t);
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, n = -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, n = r;
39
+ t = d, i = r;
39
40
  break;
40
41
  }
41
42
  }
42
43
  if (t > -1) {
43
- const r = (n + 1) % e.length, a = e[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(m);
55
- return c.trim() === "" ? h ? o[i] = "" : delete o[i] : o[i] = c, 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
- q as toggleAttributeValue
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 y = ({ attributes: t, globalDataContext: l, singleTransformProps: A, templateContext: a }) => {
17
- const { name: s, value: m, separator: c = " ", unsetAllOccurrences: C, unsetCount: p } = A || {};
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 = p !== void 0 ? V({
27
- valueToEvaluate: p,
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(c)];
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(c);
56
+ const v = e.join(p);
56
57
  return v.trim() === "" ? delete t[i] : t[i] = v, t;
57
58
  };
58
59
  export {
59
- y as unsetAttributeValue
60
+ B as unsetAttributeValue
60
61
  };
@@ -1,86 +1,100 @@
1
- import { jsx as e, jsxs as a, Fragment as x } from "react/jsx-runtime";
2
- import { useState as p, useContext as B, useRef as g, useEffect as q, useMemo as m } from "react";
3
- import { r as E } from "../../../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
4
- import { ActionDependant as L } from "../../../../engine/Actions.js";
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 "../../../../lodash-CYNxjS-I.js";
10
- import { TemplateContext as $ } from "../../../../engine/TemplateContext.js";
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 c } from "./DebugMode.enum.js";
16
- import R from "./ModeDisplay/DebugList/DebugList.js";
17
- import D from "./ModeDisplay/DebugJson/DebugJson.js";
18
- import { flattenObject as J } from "./utils.js";
19
- import '../../../../assets/VariablesDebug.css';const O = "_debugRoot_1ny7q_1", j = "_container_1ny7q_16", k = "_expanded_1ny7q_34", T = "_header_1ny7q_39", I = "_actions_1ny7q_45", P = "_btn_1ny7q_50", M = "_active_1ny7q_58", w = "_path_1ny7q_62", A = "_value_1ny7q_66", H = "_copyBtn_1ny7q_70", V = "_copyBtnSuccess_1ny7q_74", F = "_copyBtnError_1ny7q_78", W = "_info_1ny7q_82", n = {
20
- debugRoot: O,
21
- container: j,
22
- expanded: k,
23
- header: T,
24
- actions: I,
25
- btn: P,
26
- active: M,
27
- path: w,
28
- value: A,
29
- copyBtn: H,
30
- copyBtnSuccess: V,
31
- copyBtnError: F,
32
- info: W
33
- }, dt = ({ props: v }) => {
34
- const [r, u] = p(!1), [i, _] = p(c.LIST), o = B($), d = g(null), [y, S] = p(null), f = g(null);
35
- q(() => {
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(n.debugRoot), document.body.appendChild(t)), S(t);
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 l = m(() => (o == null ? void 0 : o.templateData) ?? {}, [o]), b = m(() => JSON.stringify(l, null, 2), [l, o]), h = m(() => J(l), [l, o]), C = async () => {
41
- const t = d.current;
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
- i === c.JSON ? b : h.map((s) => `${s.path}: ${JSON.stringify(s.value)}`).join(`
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(n.copyBtnSuccess), t.textContent = "Copied!", setTimeout(() => {
48
- var s;
49
- (s = d.current) == null || s.classList.remove(n.copyBtnSuccess, n.copyBtnError);
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(n.copyBtnError), setTimeout(() => {
53
- t == null || t.classList.remove(n.copyBtnError);
66
+ t == null || t.classList.add(o.copyBtnError), setTimeout(() => {
67
+ t == null || t.classList.remove(o.copyBtnError);
54
68
  }, 3e3);
55
69
  }
56
- }, N = /* @__PURE__ */ e(L, { ...v, attributesHolderRef: f, children: /* @__PURE__ */ a(
70
+ }, k = /* @__PURE__ */ e(T, { ...D, attributesHolderRef: h, children: /* @__PURE__ */ i(
57
71
  "div",
58
72
  {
59
- className: `${n.container} ${r ? n.expanded : ""}`,
60
- onClick: () => u((t) => !t),
73
+ className: `${o.container} ${a ? o.expanded : ""}`,
74
+ onClick: () => _((t) => !t),
61
75
  role: "button",
62
- ref: f,
76
+ ref: h,
63
77
  children: [
64
- /* @__PURE__ */ a("div", { className: n.header, children: [
65
- /* @__PURE__ */ a("p", { style: { margin: 0, fontWeight: 600 }, children: [
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: o.templatePath })
81
+ /* @__PURE__ */ e("code", { children: n.templatePath })
68
82
  ] }),
69
- /* @__PURE__ */ a("div", { className: n.actions, onClick: (t) => t.stopPropagation(), children: [
70
- r && /* @__PURE__ */ a(x, { children: [
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: `${n.btn} ${i === c.LIST ? n.active : ""}`,
75
- onClick: () => _(c.LIST),
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: `${n.btn} ${i === c.JSON ? n.active : ""}`,
83
- onClick: () => _(c.JSON),
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: n.btn,
92
- onClick: () => u((t) => !t),
93
- children: r ? "Collapse" : "Expand"
105
+ className: o.btn,
106
+ onClick: () => _((t) => !t),
107
+ children: a ? "Collapse" : "Expand"
94
108
  }
95
109
  ),
96
- r && /* @__PURE__ */ e(
110
+ a && /* @__PURE__ */ e(
97
111
  "button",
98
112
  {
99
- className: `${n.btn} ${n.copyBtn}`,
100
- onClick: C,
101
- ref: d,
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
- r && /* @__PURE__ */ e("div", { className: n.info, onClick: (t) => t.stopPropagation(), children: i === c.JSON ? /* @__PURE__ */ e(D, { jsonString: b }) : /* @__PURE__ */ e(R, { flatRows: h }) })
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 y ? E.createPortal(N, y) : null;
125
+ return b ? C.createPortal(k, b) : null;
112
126
  };
113
127
  export {
114
- dt as VariablesDebug
128
+ St as VariablesDebug
115
129
  };
@@ -1,29 +1,41 @@
1
- import { jsx as u } from "react/jsx-runtime";
1
+ import { jsx as c } from "react/jsx-runtime";
2
2
  import { useContext as f } from "react";
3
- import { ActionDependant as D } from "../../../engine/Actions.js";
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 c } from "../../../engine/TemplateSystem.js";
6
+ import { evaluateTemplateValue as s } from "../../../engine/TemplateSystem.js";
7
7
  import { View as V } from "../../../engine/View.js";
8
- const O = ({ currentData: s, datafield: o, path: v, props: e }) => {
9
- const n = f(x), t = f(b), m = e.dynamicOptions ?? void 0;
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
- m ? i = c({ valueToEvaluate: m, globalDataContext: n, templateContext: t }) ?? [] : i = e.options ?? [];
12
- let a;
13
- const r = e.defaultFieldValue ?? void 0, p = e.dataLocation ?? void 0;
14
- p ? a = c({
15
- globalDataContext: n,
16
- templateContext: t,
17
- valueToEvaluate: p
18
- }) ?? r : ((t.templateData[o] ?? void 0) === void 0 && (t.templateData = typeof t.templateData == "object" ? t.templateData : {}, t.templateData[o] = r), a = t.templateData[o]);
19
- let l = i.find((d) => d.value === a);
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 (!a)
33
+ if (!o)
22
34
  return null;
23
- l = a;
35
+ l = o;
24
36
  }
25
- return /* @__PURE__ */ u(D, { ...e, children: /* @__PURE__ */ u(V, { currentData: s, datafield: o, path: v, props: l.label }) });
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
- O as LabelFromValue
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-Ya6_R5yr.js";
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 D } from "./form/EmailField.js";
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 A } from "./form/NumberField.js";
16
- import { PasswordField as I } from "./form/PasswordField.js";
17
- import { RangeField as M } from "./form/RangeField.js";
18
- import { SearchField as V } from "./form/SearchField.js";
19
- import { SelectField as y } from "./form/SelectField.js";
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 { DelayedActions as uo, getReactionFunctionsToExecute as Co } from "./special/DelayedActions.js";
35
- import { PageControls as To } from "./special/PageControls.js";
36
- import { Phantom as So } from "./special/Phantom.js";
37
- import { ReactiveJsonBasicComponentWrapper as Do } from "./special/ReactiveJsonBasicComponentWrapper.js";
38
- import { ReactiveJsonSubroot as Ro } from "./special/ReactiveJsonSubroot.js";
39
- import { Switch as Bo } from "./special/Switch.js";
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
- uo as DelayedActions,
54
- D as EmailField,
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
- A as NumberField,
64
- To as PageControls,
65
- I as PasswordField,
66
- So as Phantom,
65
+ y as NumberField,
66
+ So as PageControls,
67
+ H as PasswordField,
68
+ go as Phantom,
67
69
  lo as PreformattedMarkup,
68
- M as RangeField,
69
- Do as ReactiveJsonBasicComponentWrapper,
70
- Ro as ReactiveJsonSubroot,
71
- V as SearchField,
72
- y as SelectField,
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
- Bo as Switch,
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
- Co as getReactionFunctionsToExecute
85
+ To as getReactionFunctionsToExecute
84
86
  };