@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.
Files changed (89) hide show
  1. package/README.md +1 -3
  2. package/dist/TemplateSystem-kQJEKjik.js +3568 -0
  3. package/dist/assets/VariablesDebug.css +1 -4
  4. package/dist/assets/reset.css +4 -0
  5. package/dist/assets/usePagination.css +1 -0
  6. package/dist/component/action/HashChangeListener.js +29 -7
  7. package/dist/component/action/MessageListener.js +26 -8
  8. package/dist/component/action/ReactOnEvent.js +64 -8
  9. package/dist/component/action/Redirect.js +9 -5
  10. package/dist/component/action/SetAttributeValue.js +37 -5
  11. package/dist/component/action/ToggleAttributeValue.js +56 -5
  12. package/dist/component/action/UnsetAttribute.js +20 -5
  13. package/dist/component/action/UnsetAttributeValue.js +58 -5
  14. package/dist/component/action/index.js +19 -15
  15. package/dist/component/dataMapping/index.js +6 -3
  16. package/dist/component/dataMapping/simpleMapping.js +93 -2
  17. package/dist/component/element/debug/VariablesDebug/VariablesDebug.js +110 -13
  18. package/dist/component/element/debug/index.js +2 -2
  19. package/dist/component/element/html/FolderSortableTree.js +131 -8
  20. package/dist/component/element/html/FormatNumeral.js +57 -6
  21. package/dist/component/element/html/Html.js +1 -1
  22. package/dist/component/element/html/LabelFromValue.js +25 -6
  23. package/dist/component/element/html/PreformattedMarkup.js +50 -7
  24. package/dist/component/element/html/SortableTreeItemCollapseButton.js +10 -5
  25. package/dist/component/element/html/index.js +12 -10
  26. package/dist/component/element/index.js +35 -30
  27. package/dist/component/element/special/Count.js +21 -10
  28. package/dist/component/element/special/DataFilter.js +75 -6
  29. package/dist/component/element/special/DelayedActions.js +46 -7
  30. package/dist/component/element/special/Phantom.js +12 -3
  31. package/dist/component/element/special/ReactiveJsonBasicComponentWrapper.js +29 -0
  32. package/dist/component/element/special/ReactiveJsonSubroot.js +4 -3
  33. package/dist/component/element/special/Switch.js +78 -8
  34. package/dist/component/element/special/index.js +16 -10
  35. package/dist/component/hook/index.js +1 -1
  36. package/dist/component/hook/usePagination.js +172 -4
  37. package/dist/component/index.js +85 -63
  38. package/dist/component/reaction/addData.js +23 -3
  39. package/dist/component/reaction/fetchData.js +12 -2
  40. package/dist/component/reaction/index.js +34 -12
  41. package/dist/component/reaction/moveData.js +34 -2
  42. package/dist/component/reaction/postMessage.js +23 -2
  43. package/dist/component/reaction/redirectNow.js +6 -2
  44. package/dist/component/reaction/removeData.js +27 -2
  45. package/dist/component/reaction/setClipboardData.js +16 -2
  46. package/dist/component/reaction/setData.js +22 -3
  47. package/dist/component/reaction/submitData.js +25 -2
  48. package/dist/component/reaction/utility/httpRequestCommon.js +3 -2
  49. package/dist/component/reaction/utility/index.js +1 -1
  50. package/dist/coreComponentsPlugin.js +5 -2
  51. package/dist/dnd-kit-sortable-tree.esm-Cz1RJyIg.js +4135 -0
  52. package/dist/engine/Actions.js +4 -7
  53. package/dist/engine/ParsingDebugDisplay/ParsingDebugDisplay.js +692 -3
  54. package/dist/engine/ReactiveJsonRoot.js +8 -6
  55. package/dist/engine/TemplateSystem.js +3 -3
  56. package/dist/engine/View.js +2 -7
  57. package/dist/engine/index.js +38 -37
  58. package/dist/engine/utility/alterData.js +7 -1
  59. package/dist/engine/utility/analyzeDataOverrideReferences.js +41 -2
  60. package/dist/engine/utility/formElementsCommon.js +34 -0
  61. package/dist/engine/utility/formatString.js +19 -3
  62. package/dist/engine/utility/index.js +12 -11
  63. package/dist/httpRequestCommon-BFntjNdS.js +1799 -0
  64. package/dist/index-BA09SSaJ.js +26 -0
  65. package/dist/index-Bzk15m61.js +19 -0
  66. package/dist/index-CACLSxWi.js +8 -0
  67. package/dist/index-NNBvIV0S.js +1873 -0
  68. package/dist/index-OhHUX6nj.js +460 -0
  69. package/dist/main.js +124 -102
  70. package/package.json +4 -4
  71. package/dist/HashChangeListener-D6HwdXBJ.js +0 -8526
  72. package/dist/ParsingDebugDisplay-8f4yL4Jw.js +0 -696
  73. package/dist/VariablesDebug-pv5GGWel.js +0 -9262
  74. package/dist/component/action/Popover.js +0 -6
  75. package/dist/component/action/Tooltip.js +0 -5
  76. package/dist/component/element/form/CheckBoxField.js +0 -8
  77. package/dist/component/element/form/DateField.js +0 -8
  78. package/dist/component/element/form/NumberField.js +0 -8
  79. package/dist/component/element/form/SelectField.js +0 -8
  80. package/dist/component/element/form/TextAreaField.js +0 -8
  81. package/dist/component/element/form/TextField.js +0 -8
  82. package/dist/component/element/form/formElementsCommon.js +0 -4
  83. package/dist/component/element/form/index.js +0 -10
  84. package/dist/component/element/html/AccordionItem.js +0 -6
  85. package/dist/component/element/html/Modal.js +0 -8
  86. package/dist/component/element/html/Tabs.js +0 -8
  87. package/dist/component/element/special/BootstrapElement.js +0 -5
  88. package/dist/engine/PaginationProvider.js +0 -30
  89. package/dist/usePagination-Bb6lefHG.js +0 -353
@@ -1,5 +1,25 @@
1
- import { y as t } from "../../HashChangeListener-D6HwdXBJ.js";
2
- import "../../lodash-CYNxjS-I.js";
1
+ import { d as n, b as s } from "../../TemplateSystem-kQJEKjik.js";
2
+ import { l as u } from "../../lodash-CYNxjS-I.js";
3
+ const i = (o) => {
4
+ const { globalDataContext: a, templateContext: t } = o, { path: l, value: d } = o.args;
5
+ if (l === void 0)
6
+ return;
7
+ const c = n({
8
+ currentPath: t.templatePath,
9
+ dataLocation: l,
10
+ globalDataContext: a,
11
+ templateContext: t
12
+ }), e = s({
13
+ valueToEvaluate: d,
14
+ globalDataContext: a,
15
+ templateContext: t
16
+ });
17
+ a == null || a.updateData(
18
+ typeof e != "object" ? e : u.cloneDeep(e),
19
+ c,
20
+ "add"
21
+ );
22
+ };
3
23
  export {
4
- t as addData
24
+ i as addData
5
25
  };
@@ -1,4 +1,14 @@
1
- import { z as e } from "../../HashChangeListener-D6HwdXBJ.js";
1
+ import { e as a } from "../../httpRequestCommon-BFntjNdS.js";
2
+ const c = (t) => {
3
+ var e;
4
+ a(
5
+ t,
6
+ {
7
+ method: ((e = t == null ? void 0 : t.args) == null ? void 0 : e.httpMethod) ?? "get"
8
+ },
9
+ "fetchData"
10
+ );
11
+ };
2
12
  export {
3
- e as fetchData
13
+ c as fetchData
4
14
  };
@@ -1,15 +1,37 @@
1
- import { y as e, E as s, z as r, G as o, I as D, J as m, K as p, O as d, Q as i, V as c } from "../../HashChangeListener-D6HwdXBJ.js";
2
- import { triggerEvent as g } from "./triggerEvent.js";
1
+ import { addData as t } from "./addData.js";
2
+ import { fetchData as o } from "./fetchData.js";
3
+ import { moveData as r } from "./moveData.js";
4
+ import { postMessage as m } from "./postMessage.js";
5
+ import { redirectNow as e } from "./redirectNow.js";
6
+ import { removeData as a } from "./removeData.js";
7
+ import { setClipboardData as p } from "./setClipboardData.js";
8
+ import { setData as i } from "./setData.js";
9
+ import { submitData as f } from "./submitData.js";
10
+ import { triggerEvent as s } from "./triggerEvent.js";
11
+ import { e as q } from "../../httpRequestCommon-BFntjNdS.js";
12
+ const R = {
13
+ addData: t,
14
+ fetchData: o,
15
+ moveData: r,
16
+ postMessage: m,
17
+ redirectNow: e,
18
+ removeData: a,
19
+ setClipboardData: p,
20
+ setData: i,
21
+ submitData: f,
22
+ triggerEvent: s
23
+ };
3
24
  export {
4
- e as addData,
5
- s as executeHttpRequest,
6
- r as fetchData,
7
- o as moveData,
8
- D as postMessage,
9
- m as redirectNow,
10
- p as removeData,
11
- d as setClipboardData,
25
+ t as addData,
26
+ R as coreReactionComponents,
27
+ q as executeHttpRequest,
28
+ o as fetchData,
29
+ r as moveData,
30
+ m as postMessage,
31
+ e as redirectNow,
32
+ a as removeData,
33
+ p as setClipboardData,
12
34
  i as setData,
13
- c as submitData,
14
- g as triggerEvent
35
+ f as submitData,
36
+ s as triggerEvent
15
37
  };
@@ -1,4 +1,36 @@
1
- import { G as e } from "../../HashChangeListener-D6HwdXBJ.js";
1
+ import { d as i } from "../../TemplateSystem-kQJEKjik.js";
2
+ const d = (e) => {
3
+ const { globalDataContext: a, templateContext: n } = e, { path: r, target: l } = e.args;
4
+ if (r === void 0 && l !== "currentTemplateData")
5
+ return;
6
+ let t;
7
+ if (r)
8
+ t = i({
9
+ currentPath: n.templatePath,
10
+ dataLocation: r,
11
+ globalDataContext: a,
12
+ templateContext: n
13
+ });
14
+ else {
15
+ t = n.templatePath;
16
+ let o = e.args.parentLevel ?? 0;
17
+ for (; o > 0; ) {
18
+ --o;
19
+ const s = t.lastIndexOf(".");
20
+ if (s < 1)
21
+ return;
22
+ t = t.substring(0, s);
23
+ }
24
+ }
25
+ const { increment: c } = e.args;
26
+ a == null || a.updateData(
27
+ {
28
+ increment: c
29
+ },
30
+ t,
31
+ "move"
32
+ );
33
+ };
2
34
  export {
3
- e as moveData
35
+ d as moveData
4
36
  };
@@ -1,4 +1,25 @@
1
- import { I as o } from "../../HashChangeListener-D6HwdXBJ.js";
1
+ import { b as x } from "../../TemplateSystem-kQJEKjik.js";
2
+ const V = (e) => {
3
+ var n, l, c, i, m, d, u, w, T, h, v;
4
+ const t = {
5
+ parent: window.parent,
6
+ self: window
7
+ }[((n = e == null ? void 0 : e.args) == null ? void 0 : n.messageTarget) ?? "parent"] ?? window, g = ((l = e == null ? void 0 : e.args) == null ? void 0 : l.targetOrigin) ?? window.location.origin, a = x({
8
+ globalDataContext: e.globalDataContext,
9
+ templateContext: e.templateContext,
10
+ valueToEvaluate: (c = e == null ? void 0 : e.args) == null ? void 0 : c.message
11
+ });
12
+ if (((i = e == null ? void 0 : e.args) == null ? void 0 : i.on) === "change" && typeof a == "object" && ((m = e == null ? void 0 : e.args) != null && m.includeChangedValue) && ((u = (d = e == null ? void 0 : e.event) == null ? void 0 : d.target) == null ? void 0 : u.nodeName) === "INPUT") {
13
+ let b;
14
+ switch ((T = (w = e == null ? void 0 : e.event) == null ? void 0 : w.target) == null ? void 0 : T.type) {
15
+ case "checkbox":
16
+ b = (v = (h = e == null ? void 0 : e.event) == null ? void 0 : h.target) == null ? void 0 : v.checked;
17
+ break;
18
+ }
19
+ a.changedValue = b;
20
+ }
21
+ t && g && t.postMessage(a, g);
22
+ };
2
23
  export {
3
- o as postMessage
24
+ V as postMessage
4
25
  };
@@ -1,4 +1,8 @@
1
- import { J as o } from "../../HashChangeListener-D6HwdXBJ.js";
1
+ import { a as l } from "../../TemplateSystem-kQJEKjik.js";
2
+ const r = (e) => {
3
+ const { globalDataContext: a, templateContext: o } = e, { to: t } = e.args;
4
+ !t || typeof t != "string" || (window.location.href = l({ valueToEvaluate: t, globalDataContext: a, templateContext: o }));
5
+ };
2
6
  export {
3
- o as redirectNow
7
+ r as redirectNow
4
8
  };
@@ -1,4 +1,29 @@
1
- import { K as o } from "../../HashChangeListener-D6HwdXBJ.js";
1
+ import { d as i } from "../../TemplateSystem-kQJEKjik.js";
2
+ const c = (a) => {
3
+ const { globalDataContext: e, templateContext: r } = a, { path: n, target: s } = a.args;
4
+ if (n === void 0 && s !== "currentTemplateData")
5
+ return;
6
+ let t;
7
+ if (n)
8
+ t = i({
9
+ currentPath: r.templatePath,
10
+ dataLocation: n,
11
+ globalDataContext: e,
12
+ templateContext: r
13
+ });
14
+ else {
15
+ t = r.templatePath;
16
+ let o = a.args.parentLevel ?? 0;
17
+ for (; o > 0; ) {
18
+ --o;
19
+ const l = t.lastIndexOf(".");
20
+ if (l < 1)
21
+ return;
22
+ t = t.substring(0, l);
23
+ }
24
+ }
25
+ e == null || e.updateData(void 0, t, "remove");
26
+ };
2
27
  export {
3
- o as removeData
28
+ c as removeData
4
29
  };
@@ -1,4 +1,18 @@
1
- import { O as r } from "../../HashChangeListener-D6HwdXBJ.js";
1
+ import { a as i } from "../../TemplateSystem-kQJEKjik.js";
2
+ const n = async (a) => {
3
+ var e;
4
+ const { globalDataContext: o, templateContext: l } = a, t = i({
5
+ valueToEvaluate: (e = a == null ? void 0 : a.args) == null ? void 0 : e.value,
6
+ globalDataContext: o,
7
+ templateContext: l
8
+ });
9
+ if (typeof t == "string")
10
+ try {
11
+ await navigator.clipboard.writeText(t.toString());
12
+ } catch (r) {
13
+ console.error("Failed to copy data to the clipboard:", r);
14
+ }
15
+ };
2
16
  export {
3
- r as setClipboardData
17
+ n as setClipboardData
4
18
  };
@@ -1,5 +1,24 @@
1
- import { Q as r } from "../../HashChangeListener-D6HwdXBJ.js";
2
- import "../../lodash-CYNxjS-I.js";
1
+ import { d as n, b as u } from "../../TemplateSystem-kQJEKjik.js";
2
+ import { l as r } from "../../lodash-CYNxjS-I.js";
3
+ const i = (o) => {
4
+ const { globalDataContext: t, templateContext: a } = o, { path: l, value: s } = o.args;
5
+ if (l === void 0)
6
+ return;
7
+ const c = n({
8
+ currentPath: a.templatePath,
9
+ dataLocation: l,
10
+ globalDataContext: t,
11
+ templateContext: a
12
+ }), e = u({
13
+ valueToEvaluate: s,
14
+ globalDataContext: t,
15
+ templateContext: a
16
+ });
17
+ t == null || t.updateData(
18
+ typeof e != "object" ? e : r.cloneDeep(e),
19
+ c
20
+ );
21
+ };
3
22
  export {
4
- r as setData
23
+ i as setData
5
24
  };
@@ -1,4 +1,27 @@
1
- import { V as m } from "../../HashChangeListener-D6HwdXBJ.js";
1
+ import { e as d } from "../../httpRequestCommon-BFntjNdS.js";
2
+ import { a as D } from "../../TemplateSystem-kQJEKjik.js";
3
+ const x = (t) => {
4
+ var m, o, s;
5
+ const { globalDataContext: n, templateContext: _ } = t, l = n.getRootContext ? n.getRootContext() : n;
6
+ let e = {};
7
+ (m = t == null ? void 0 : t.args) != null && m.hasOwnProperty("data") ? (e = t.args.data, e = ((a, i) => {
8
+ if (Array.isArray(a))
9
+ return a.map(i);
10
+ if (typeof a == "object" && a !== null) {
11
+ const r = Object.entries(a).map(([u, b]) => [u, i(b)]);
12
+ return Object.fromEntries(r);
13
+ } else
14
+ return i(a);
15
+ })(e, (a) => D({ valueToEvaluate: a, globalDataContext: l, templateContext: _ })), l.templateData.__state !== void 0 && (e.__state = l.templateData.__state)) : (e.data = l.templateData, l.templateData.__state !== void 0 && (e.data.__state = l.templateData.__state)), d(
16
+ t,
17
+ {
18
+ method: ((o = t == null ? void 0 : t.args) == null ? void 0 : o.httpMethod) ?? "post",
19
+ data: e,
20
+ submitSilently: (s = t == null ? void 0 : t.args) == null ? void 0 : s.submitSilently
21
+ },
22
+ "submitData"
23
+ );
24
+ };
2
25
  export {
3
- m as submitData
26
+ x as submitData
4
27
  };
@@ -1,7 +1,8 @@
1
- import { E as m } from "../../../HashChangeListener-D6HwdXBJ.js";
1
+ import { e as i } from "../../../httpRequestCommon-BFntjNdS.js";
2
+ import "../../../TemplateSystem-kQJEKjik.js";
2
3
  import "../../../engine/utility/alterData.js";
3
4
  import "../../../engine/utility/dataMappingSystem.js";
4
5
  import "../../../js-yaml-Bw0KO4XO.js";
5
6
  export {
6
- m as executeHttpRequest
7
+ i as executeHttpRequest
7
8
  };
@@ -1,4 +1,4 @@
1
- import { E as o } from "../../../HashChangeListener-D6HwdXBJ.js";
1
+ import { e as o } from "../../../httpRequestCommon-BFntjNdS.js";
2
2
  export {
3
3
  o as executeHttpRequest
4
4
  };
@@ -1,5 +1,8 @@
1
- import { a7 as m } from "./HashChangeListener-D6HwdXBJ.js";
1
+ import "./index-BA09SSaJ.js";
2
+ import "./component/dataMapping/index.js";
2
3
  import "./component/dataProcessor/index.js";
4
+ import { b as e } from "./index-OhHUX6nj.js";
5
+ import "./component/reaction/index.js";
3
6
  export {
4
- m as coreComponentsPlugin
7
+ e as coreComponentsPlugin
5
8
  };