@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,17 +1,19 @@
1
1
  import "react/jsx-runtime";
2
- import { Y as J } from "../HashChangeListener-D6HwdXBJ.js";
2
+ import "../httpRequestCommon-BFntjNdS.js";
3
+ import "../lodash-CYNxjS-I.js";
4
+ import "react";
5
+ import "../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
6
+ import { a as d } from "../index-OhHUX6nj.js";
3
7
  import "./ComponentCollector.js";
4
8
  import "./EventDispatcherProvider.js";
5
9
  import "./GlobalDataContextProvider.js";
6
- import "../ParsingDebugDisplay-8f4yL4Jw.js";
10
+ import "./ParsingDebugDisplay/ParsingDebugDisplay.js";
7
11
  import "./TemplateContext.js";
12
+ import "../TemplateSystem-kQJEKjik.js";
8
13
  import "./utility/alterData.js";
9
14
  import "./utility/dataMappingSystem.js";
10
15
  import "./utility/parseRjBuild.js";
11
16
  import "./utility/stringToBoolean.js";
12
- import "../lodash-CYNxjS-I.js";
13
- import "react";
14
- import "../VariablesDebug-pv5GGWel.js";
15
17
  export {
16
- J as ReactiveJsonRoot
18
+ d as ReactiveJsonRoot
17
19
  };
@@ -1,13 +1,13 @@
1
1
  import "react";
2
2
  import "./GlobalDataContext.js";
3
3
  import "./TemplateContext.js";
4
- import { Z as u, a8 as o, _ as i, $ as m, a0 as p, a1 as r, a2 as v } from "../HashChangeListener-D6HwdXBJ.js";
4
+ import { d as s, T as o, e as i, a as m, b as p, c as r, u as T } from "../TemplateSystem-kQJEKjik.js";
5
5
  export {
6
- u as dataLocationToPath,
6
+ s as dataLocationToPath,
7
7
  o as default,
8
8
  i as evaluateAttributes,
9
9
  m as evaluateTemplateValue,
10
10
  p as evaluateTemplateValueCollection,
11
11
  r as isTemplateValue,
12
- v as useEvaluatedAttributes
12
+ T as useEvaluatedAttributes
13
13
  };
@@ -1,13 +1,8 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import "./EventDispatcherContext.js";
3
+ import { V as e } from "../TemplateSystem-kQJEKjik.js";
4
4
  import "./GlobalDataContext.js";
5
5
  import "./TemplateContext.js";
6
- import { a6 as x } from "../HashChangeListener-D6HwdXBJ.js";
7
- import "../lodash-CYNxjS-I.js";
8
- import "../js-yaml-Bw0KO4XO.js";
9
- import "../VariablesDebug-pv5GGWel.js";
10
- import "../component/element/special/PageControls.js";
11
6
  export {
12
- x as View
7
+ e as View
13
8
  };
@@ -1,42 +1,43 @@
1
- import { X as t, Y as o, a6 as r, a3 as n, Z as i, _ as s, $ as p, a0 as l, a4 as m, a1 as x, W as f, a5 as v, a2 as d } from "../HashChangeListener-D6HwdXBJ.js";
2
- import { mergeComponentCollections as c } from "./ComponentCollector.js";
3
- import { EventDispatcherContext as D } from "./EventDispatcherContext.js";
4
- import { EventDispatcherProvider as P, addEventListener as T, removeEventListener as b } from "./EventDispatcherProvider.js";
5
- import { GlobalDataContext as V } from "./GlobalDataContext.js";
6
- import { GlobalDataContextProvider as h } from "./GlobalDataContextProvider.js";
1
+ import { A as a, V as o, d as r, e as n, a as p, b as i, c as l, i as m, u as s } from "../TemplateSystem-kQJEKjik.js";
2
+ import { mergeComponentCollections as f } from "./ComponentCollector.js";
3
+ import { EventDispatcherContext as u } from "./EventDispatcherContext.js";
4
+ import { EventDispatcherProvider as c, addEventListener as C, removeEventListener as D } from "./EventDispatcherProvider.js";
5
+ import { GlobalDataContext as g } from "./GlobalDataContext.js";
6
+ import { GlobalDataContextProvider as V } from "./GlobalDataContextProvider.js";
7
7
  import { PaginationContext as A } from "./PaginationContext.js";
8
- import { PaginationProvider as B } from "./PaginationProvider.js";
9
- import { TemplateContext as S } from "./TemplateContext.js";
10
- import { alterData as w } from "./utility/alterData.js";
11
- import { applyDataMapping as F } from "./utility/dataMappingSystem.js";
12
- import { parseRjBuild as M } from "./utility/parseRjBuild.js";
13
- import { stringToBoolean as W } from "./utility/stringToBoolean.js";
8
+ import { a as R } from "../index-OhHUX6nj.js";
9
+ import { TemplateContext as y } from "./TemplateContext.js";
10
+ import { alterData as B } from "./utility/alterData.js";
11
+ import { analyzeDataOverrideReferences as S } from "./utility/analyzeDataOverrideReferences.js";
12
+ import { applyDataMapping as w } from "./utility/dataMappingSystem.js";
13
+ import { formatString as F, maybeFormatString as J } from "./utility/formatString.js";
14
+ import { parseRjBuild as O } from "./utility/parseRjBuild.js";
15
+ import { stringToBoolean as q } from "./utility/stringToBoolean.js";
14
16
  export {
15
- t as ActionDependant,
16
- D as EventDispatcherContext,
17
- P as EventDispatcherProvider,
18
- V as GlobalDataContext,
19
- h as GlobalDataContextProvider,
17
+ a as ActionDependant,
18
+ u as EventDispatcherContext,
19
+ c as EventDispatcherProvider,
20
+ g as GlobalDataContext,
21
+ V as GlobalDataContextProvider,
20
22
  A as PaginationContext,
21
- B as PaginationProvider,
22
- o as ReactiveJsonRoot,
23
- S as TemplateContext,
24
- r as View,
25
- T as addEventListener,
26
- w as alterData,
27
- n as analyzeDataOverrideReferences,
28
- F as applyDataMapping,
29
- i as dataLocationToPath,
30
- s as evaluateAttributes,
23
+ R as ReactiveJsonRoot,
24
+ y as TemplateContext,
25
+ o as View,
26
+ C as addEventListener,
27
+ B as alterData,
28
+ S as analyzeDataOverrideReferences,
29
+ w as applyDataMapping,
30
+ r as dataLocationToPath,
31
+ n as evaluateAttributes,
31
32
  p as evaluateTemplateValue,
32
- l as evaluateTemplateValueCollection,
33
- m as formatString,
34
- x as isTemplateValue,
35
- f as isValid,
36
- v as maybeFormatString,
37
- c as mergeComponentCollections,
38
- M as parseRjBuild,
39
- b as removeEventListener,
40
- W as stringToBoolean,
41
- d as useEvaluatedAttributes
33
+ i as evaluateTemplateValueCollection,
34
+ F as formatString,
35
+ l as isTemplateValue,
36
+ m as isValid,
37
+ J as maybeFormatString,
38
+ f as mergeComponentCollections,
39
+ O as parseRjBuild,
40
+ D as removeEventListener,
41
+ q as stringToBoolean,
42
+ s as useEvaluatedAttributes
42
43
  };
@@ -1,5 +1,11 @@
1
1
  import { l as n } from "../../lodash-CYNxjS-I.js";
2
- const D = ({ requestContext: l, responseContext: f, responseBody: e, isRjBuild: t = !1, dataProcessors: a = {} }) => {
2
+ const D = ({
3
+ requestContext: l,
4
+ responseContext: f,
5
+ responseBody: e,
6
+ isRjBuild: t = !1,
7
+ dataProcessors: a = {}
8
+ }) => {
3
9
  if (Object.keys(a).length === 0)
4
10
  return e;
5
11
  const o = n.cloneDeep(e), c = t ? o.data : o;
@@ -1,4 +1,43 @@
1
- import { a3 as r } from "../../HashChangeListener-D6HwdXBJ.js";
1
+ import { c as l } from "../../TemplateSystem-kQJEKjik.js";
2
+ const w = (n, u = "", y = {}) => {
3
+ const r = /* @__PURE__ */ new Map();
4
+ if (!n)
5
+ return r;
6
+ if (typeof n == "string" && l(n))
7
+ return r.set("", n), r;
8
+ const p = parseInt(y.maxDepth) || 50, c = (e, t, s = /* @__PURE__ */ new Set(), f = 0) => {
9
+ if (f > p) {
10
+ console.warn(
11
+ "Reactive-JSON: Maximum depth reached in dataOverride references analysis (traverseObject). Stopped the analysis."
12
+ );
13
+ return;
14
+ }
15
+ if (s.has(e)) {
16
+ console.warn(
17
+ "Reactive-JSON: Infinite recursion detected in dataOverride references analysis (traverseObject). Stopped the analysis."
18
+ );
19
+ return;
20
+ }
21
+ if (s.add(e), typeof e == "string" && l(e)) {
22
+ r.set(t, e);
23
+ return;
24
+ }
25
+ if (!(!e || typeof e != "object")) {
26
+ if (Array.isArray(e)) {
27
+ e.forEach((a, i) => {
28
+ const o = t ? `${t}.${i}` : i.toString();
29
+ c(a, o, s, f + 1);
30
+ });
31
+ return;
32
+ }
33
+ Object.entries(e).forEach(([a, i]) => {
34
+ const o = t ? `${t}.${a}` : a;
35
+ c(i, o, s, f + 1);
36
+ });
37
+ }
38
+ };
39
+ return c(n, u), r;
40
+ };
2
41
  export {
3
- r as analyzeDataOverrideReferences
42
+ w as analyzeDataOverrideReferences
4
43
  };
@@ -0,0 +1,34 @@
1
+ import { a as v, d as h } from "../../TemplateSystem-kQJEKjik.js";
2
+ const u = ({
3
+ currentPath: m,
4
+ datafield: D,
5
+ dataLocation: o,
6
+ defaultValue: f,
7
+ globalDataContext: s,
8
+ templateContext: a
9
+ }) => {
10
+ const r = {
11
+ // This is the data that contains the current checked state.
12
+ formData: void 0,
13
+ // This is the path that leads to the data.
14
+ formDataPath: void 0
15
+ };
16
+ return o && typeof o == "string" ? (r.formData = v({
17
+ globalDataContext: s,
18
+ templateContext: a,
19
+ valueToEvaluate: o
20
+ }) ?? f, r.formDataPath = h({
21
+ dataLocation: o,
22
+ currentPath: m,
23
+ globalDataContext: s,
24
+ templateContext: a
25
+ })) : ((a.templateData[D] ?? void 0) === void 0 && (a.templateData = typeof a.templateData == "object" ? a.templateData : {}, a.templateData[D] = f), r.formData = a.templateData[D], r.formDataPath = h({
26
+ dataLocation: "~." + D,
27
+ currentPath: a.templatePath,
28
+ globalDataContext: s,
29
+ templateContext: a
30
+ })), r;
31
+ };
32
+ export {
33
+ u as propsDataLocationToPathAndValue
34
+ };
@@ -1,5 +1,21 @@
1
- import { a4 as t, a5 as m } from "../../HashChangeListener-D6HwdXBJ.js";
1
+ import { a as l } from "../../TemplateSystem-kQJEKjik.js";
2
+ const r = (e, ...t) => t.length ? r(e = e.replace(r.token || "$token", t.shift()), ...t) : e, u = ({ templateContexts: e }, t, ...a) => {
3
+ const n = a.map((o) => l({
4
+ globalDataContext: e.globalDataContext,
5
+ templateContext: e.templateContext,
6
+ valueToEvaluate: o
7
+ }));
8
+ return r(t, ...n);
9
+ }, s = (e, t) => {
10
+ if (typeof t == "string")
11
+ return t;
12
+ if (Array.isArray(t)) {
13
+ const [a, ...n] = t;
14
+ return u(e, a, ...n);
15
+ }
16
+ return "";
17
+ };
2
18
  export {
3
- t as formatString,
4
- m as maybeFormatString
19
+ u as formatString,
20
+ s as maybeFormatString
5
21
  };
@@ -1,14 +1,15 @@
1
- import { alterData as e } from "./alterData.js";
2
- import { a3 as t, a4 as p, a5 as m } from "../../HashChangeListener-D6HwdXBJ.js";
3
- import { applyDataMapping as n } from "./dataMappingSystem.js";
4
- import { parseRjBuild as s } from "./parseRjBuild.js";
5
- import { stringToBoolean as x } from "./stringToBoolean.js";
1
+ import { alterData as o } from "./alterData.js";
2
+ import { analyzeDataOverrideReferences as t } from "./analyzeDataOverrideReferences.js";
3
+ import { applyDataMapping as m } from "./dataMappingSystem.js";
4
+ import { formatString as n, maybeFormatString as i } from "./formatString.js";
5
+ import { parseRjBuild as l } from "./parseRjBuild.js";
6
+ import { stringToBoolean as s } from "./stringToBoolean.js";
6
7
  export {
7
- e as alterData,
8
+ o as alterData,
8
9
  t as analyzeDataOverrideReferences,
9
- n as applyDataMapping,
10
- p as formatString,
11
- m as maybeFormatString,
12
- s as parseRjBuild,
13
- x as stringToBoolean
10
+ m as applyDataMapping,
11
+ n as formatString,
12
+ i as maybeFormatString,
13
+ l as parseRjBuild,
14
+ s as stringToBoolean
14
15
  };