@ea-lab/reactive-json 0.2.1 → 0.3.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 (72) hide show
  1. package/README.md +1 -1
  2. package/dist/HashChangeListener-D2T1_KYz.js +18075 -0
  3. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  4. package/dist/alterData-CjaFWyAA.js +3698 -0
  5. package/dist/component/action/HashChangeListener.js +1 -1
  6. package/dist/component/action/MessageListener.js +3 -2
  7. package/dist/component/action/Popover.js +1 -1
  8. package/dist/component/action/ReactOnEvent.js +1 -1
  9. package/dist/component/action/Redirect.js +1 -1
  10. package/dist/component/action/Tooltip.js +1 -1
  11. package/dist/component/action/index.js +1 -1
  12. package/dist/component/dataMapping/index.js +5 -0
  13. package/dist/component/dataMapping/simpleMapping.js +4 -0
  14. package/dist/component/dataProcessor/index.js +4 -0
  15. package/dist/component/element/form/CheckBoxField.js +1 -1
  16. package/dist/component/element/form/DateField.js +1 -1
  17. package/dist/component/element/form/NumberField.js +1 -1
  18. package/dist/component/element/form/SelectField.js +1 -1
  19. package/dist/component/element/form/TextAreaField.js +1 -1
  20. package/dist/component/element/form/TextField.js +1 -1
  21. package/dist/component/element/form/formElementsCommon.js +1 -1
  22. package/dist/component/element/form/index.js +5 -5
  23. package/dist/component/element/html/AccordionItem.js +1 -1
  24. package/dist/component/element/html/FolderSortableTree.js +3 -2
  25. package/dist/component/element/html/FormatNumeral.js +1 -1
  26. package/dist/component/element/html/Html.js +3 -3
  27. package/dist/component/element/html/LabelFromValue.js +1 -1
  28. package/dist/component/element/html/Modal.js +1 -1
  29. package/dist/component/element/html/PreformattedMarkup.js +1 -1
  30. package/dist/component/element/html/SortableTreeItemCollapseButton.js +1 -1
  31. package/dist/component/element/html/Tabs.js +1 -1
  32. package/dist/component/element/html/index.js +4 -4
  33. package/dist/component/element/index.js +4 -4
  34. package/dist/component/element/special/BootstrapElement.js +1 -1
  35. package/dist/component/element/special/Count.js +3 -2
  36. package/dist/component/element/special/DataFilter.js +1 -1
  37. package/dist/component/element/special/DelayedActions.js +1 -1
  38. package/dist/component/element/special/Phantom.js +1 -1
  39. package/dist/component/element/special/ReactiveJsonSubroot.js +3 -2
  40. package/dist/component/element/special/Switch.js +3 -3
  41. package/dist/component/element/special/index.js +1 -1
  42. package/dist/component/hook/index.js +1 -1
  43. package/dist/component/hook/usePagination.js +1 -1
  44. package/dist/component/index.js +48 -44
  45. package/dist/component/reaction/addData.js +3 -2
  46. package/dist/component/reaction/fetchData.js +1 -1
  47. package/dist/component/reaction/index.js +4 -4
  48. package/dist/component/reaction/moveData.js +1 -1
  49. package/dist/component/reaction/postMessage.js +1 -1
  50. package/dist/component/reaction/redirectNow.js +1 -1
  51. package/dist/component/reaction/removeData.js +1 -1
  52. package/dist/component/reaction/setClipboardData.js +1 -1
  53. package/dist/component/reaction/setData.js +3 -2
  54. package/dist/component/reaction/submitData.js +1 -1
  55. package/dist/component/reaction/utility/httpRequestCommon.js +5 -2
  56. package/dist/component/reaction/utility/index.js +2 -2
  57. package/dist/coreComponentsPlugin.js +5 -0
  58. package/dist/engine/Actions.js +4 -3
  59. package/dist/engine/ComponentCollector.js +15 -8
  60. package/dist/engine/ReactiveJsonRoot.js +5 -2
  61. package/dist/engine/TemplateSystem.js +1 -1
  62. package/dist/engine/View.js +1 -1
  63. package/dist/engine/index.js +21 -17
  64. package/dist/engine/utility/alterData.js +4 -0
  65. package/dist/engine/utility/analyzeDataOverrideReferences.js +1 -1
  66. package/dist/engine/utility/dataMappingSystem.js +21 -0
  67. package/dist/engine/utility/formatString.js +1 -1
  68. package/dist/engine/utility/index.js +12 -8
  69. package/dist/main.js +79 -71
  70. package/dist/{usePagination-D5Fkvhsw.js → usePagination-Bb6lefHG.js} +67 -72
  71. package/package.json +1 -1
  72. package/dist/HashChangeListener-BrTnLmiF.js +0 -21571
@@ -2,10 +2,11 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "./GlobalDataContext.js";
4
4
  import "./TemplateContext.js";
5
- import { K as n, J as s } from "../HashChangeListener-BrTnLmiF.js";
5
+ import { Q as s, O as d } from "../HashChangeListener-D2T1_KYz.js";
6
6
  import "../component/action/Hide.js";
7
7
  import "../component/action/VisuallyHide.js";
8
+ import "../alterData-CjaFWyAA.js";
8
9
  export {
9
- n as ActionDependant,
10
- s as isValid
10
+ s as ActionDependant,
11
+ d as isValid
11
12
  };
@@ -1,19 +1,26 @@
1
- function s(t) {
1
+ function l(m) {
2
2
  const o = {
3
3
  action: {},
4
+ dataMapping: {},
5
+ dataProcessor: {},
4
6
  element: {},
5
7
  hook: {},
6
8
  reaction: {},
7
9
  utility: {}
8
10
  };
9
- return t.forEach((n) => {
10
- for (const [e, r] of Object.entries(n)) {
11
- o.hasOwnProperty(e) || (o[e] = []);
12
- for (const [c, i] of Object.entries(r))
13
- o[e][c] = i;
11
+ m.forEach((r) => {
12
+ for (const [e, n] of Object.entries(r)) {
13
+ o.hasOwnProperty(e) || (o[e] = {});
14
+ for (const [t, c] of Object.entries(n))
15
+ o[e][t] = c;
14
16
  }
15
- }), o;
17
+ });
18
+ const a = Object.entries(o.dataProcessor);
19
+ return a.sort((r, e) => {
20
+ const [n, t] = r, [c, s] = e, d = (t == null ? void 0 : t.order) || 0, f = (s == null ? void 0 : s.order) || 0, i = d - f;
21
+ return i !== 0 ? i : n.localeCompare(c);
22
+ }), o.dataProcessor = Object.fromEntries(a), o;
16
23
  }
17
24
  export {
18
- s as mergeComponentCollections
25
+ l as mergeComponentCollections
19
26
  };
@@ -1,11 +1,14 @@
1
1
  import "react/jsx-runtime";
2
+ import { U as n } from "../HashChangeListener-D2T1_KYz.js";
3
+ import "./ComponentCollector.js";
2
4
  import "./EventDispatcherProvider.js";
3
5
  import "./GlobalDataContextProvider.js";
4
6
  import "./TemplateContext.js";
5
- import { O as R } from "../HashChangeListener-BrTnLmiF.js";
7
+ import "../alterData-CjaFWyAA.js";
8
+ import "./utility/dataMappingSystem.js";
6
9
  import "./utility/parseRjBuild.js";
7
10
  import "./utility/stringToBoolean.js";
8
11
  import "react";
9
12
  export {
10
- R as ReactiveJsonRoot
13
+ n as ReactiveJsonRoot
11
14
  };
@@ -1,7 +1,7 @@
1
1
  import "react";
2
2
  import "./GlobalDataContext.js";
3
3
  import "./TemplateContext.js";
4
- import { Q as u, a1 as o, U as i, V as m, W as p, X as r, Y as v } from "../HashChangeListener-BrTnLmiF.js";
4
+ import { V as u, a4 as o, W as i, X as m, Y as p, Z as r, _ as v } from "../HashChangeListener-D2T1_KYz.js";
5
5
  export {
6
6
  u as dataLocationToPath,
7
7
  o as default,
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { a0 as e } from "../HashChangeListener-BrTnLmiF.js";
3
+ import { a2 as e } from "../HashChangeListener-D2T1_KYz.js";
4
4
  import "../component/element/special/PageControls.js";
5
5
  import "./GlobalDataContext.js";
6
6
  import "./TemplateContext.js";
@@ -1,38 +1,42 @@
1
- import { K as a, O as o, a0 as r, Z as n, Q as i, U as s, V as l, W as m, _ as p, X as x, J as v, $ as f, Y as d } from "../HashChangeListener-BrTnLmiF.js";
1
+ import { Q as t, U as o, a2 as r, $ as n, V as i, W as s, X as p, Y as l, a0 as m, Z as x, O as f, a1 as v, _ as d } from "../HashChangeListener-D2T1_KYz.js";
2
2
  import { mergeComponentCollections as c } from "./ComponentCollector.js";
3
- import { EventDispatcherContext as g } from "./EventDispatcherContext.js";
3
+ import { EventDispatcherContext as D } from "./EventDispatcherContext.js";
4
4
  import { EventDispatcherProvider as P, addEventListener as T, removeEventListener as V } from "./EventDispatcherProvider.js";
5
5
  import { GlobalDataContext as E } from "./GlobalDataContext.js";
6
6
  import { GlobalDataContextProvider as h } from "./GlobalDataContextProvider.js";
7
- import { PaginationContext as L } from "./PaginationContext.js";
7
+ import { PaginationContext as A } from "./PaginationContext.js";
8
8
  import { PaginationProvider as B } from "./PaginationProvider.js";
9
- import { TemplateContext as J } from "./TemplateContext.js";
10
- import { parseRjBuild as S } from "./utility/parseRjBuild.js";
11
- import { stringToBoolean as w } from "./utility/stringToBoolean.js";
9
+ import { TemplateContext as O } from "./TemplateContext.js";
10
+ import { a as j } from "../alterData-CjaFWyAA.js";
11
+ import { applyDataMapping as z } from "./utility/dataMappingSystem.js";
12
+ import { parseRjBuild as J } from "./utility/parseRjBuild.js";
13
+ import { stringToBoolean as Q } from "./utility/stringToBoolean.js";
12
14
  export {
13
- a as ActionDependant,
14
- g as EventDispatcherContext,
15
+ t as ActionDependant,
16
+ D as EventDispatcherContext,
15
17
  P as EventDispatcherProvider,
16
18
  E as GlobalDataContext,
17
19
  h as GlobalDataContextProvider,
18
- L as PaginationContext,
20
+ A as PaginationContext,
19
21
  B as PaginationProvider,
20
22
  o as ReactiveJsonRoot,
21
- J as TemplateContext,
23
+ O as TemplateContext,
22
24
  r as View,
23
25
  T as addEventListener,
26
+ j as alterData,
24
27
  n as analyzeDataOverrideReferences,
28
+ z as applyDataMapping,
25
29
  i as dataLocationToPath,
26
30
  s as evaluateAttributes,
27
- l as evaluateTemplateValue,
28
- m as evaluateTemplateValueCollection,
29
- p as formatString,
31
+ p as evaluateTemplateValue,
32
+ l as evaluateTemplateValueCollection,
33
+ m as formatString,
30
34
  x as isTemplateValue,
31
- v as isValid,
32
- f as maybeFormatString,
35
+ f as isValid,
36
+ v as maybeFormatString,
33
37
  c as mergeComponentCollections,
34
- S as parseRjBuild,
38
+ J as parseRjBuild,
35
39
  V as removeEventListener,
36
- w as stringToBoolean,
40
+ Q as stringToBoolean,
37
41
  d as useEvaluatedAttributes
38
42
  };
@@ -0,0 +1,4 @@
1
+ import { a as t } from "../../alterData-CjaFWyAA.js";
2
+ export {
3
+ t as alterData
4
+ };
@@ -1,4 +1,4 @@
1
- import { Z as r } from "../../HashChangeListener-BrTnLmiF.js";
1
+ import { $ as r } from "../../HashChangeListener-D2T1_KYz.js";
2
2
  export {
3
3
  r as analyzeDataOverrideReferences
4
4
  };
@@ -0,0 +1,21 @@
1
+ const y = ({ dataMapping: r, responseData: c, globalDataContext: e, templateContext: p }) => {
2
+ var t;
3
+ if (!r || typeof r != "object")
4
+ return;
5
+ const o = ((t = e.plugins) == null ? void 0 : t.dataMapping) || {};
6
+ Object.keys(o).length !== 0 && Object.entries(r).forEach(([n, i]) => {
7
+ const s = o[n];
8
+ if (!s) {
9
+ console.warn("dataMappingSystem: Unknown processor: ", n);
10
+ return;
11
+ }
12
+ try {
13
+ s({ config: i, globalDataContext: e, responseData: c, templateContext: p });
14
+ } catch (a) {
15
+ console.error("dataMappingSystem: Error in processor ", n, ":", a);
16
+ }
17
+ });
18
+ };
19
+ export {
20
+ y as applyDataMapping
21
+ };
@@ -1,4 +1,4 @@
1
- import { _ as t, $ as m } from "../../HashChangeListener-BrTnLmiF.js";
1
+ import { a0 as t, a1 as m } from "../../HashChangeListener-D2T1_KYz.js";
2
2
  export {
3
3
  t as formatString,
4
4
  m as maybeFormatString
@@ -1,10 +1,14 @@
1
- import { Z as a, _ as o, $ as t } from "../../HashChangeListener-BrTnLmiF.js";
2
- import { parseRjBuild as n } from "./parseRjBuild.js";
3
- import { stringToBoolean as f } from "./stringToBoolean.js";
1
+ import { a as e } from "../../alterData-CjaFWyAA.js";
2
+ import { $ as t, a0 as p, a1 as m } from "../../HashChangeListener-D2T1_KYz.js";
3
+ import { applyDataMapping as n } from "./dataMappingSystem.js";
4
+ import { parseRjBuild as i } from "./parseRjBuild.js";
5
+ import { stringToBoolean as x } from "./stringToBoolean.js";
4
6
  export {
5
- a as analyzeDataOverrideReferences,
6
- o as formatString,
7
- t as maybeFormatString,
8
- n as parseRjBuild,
9
- f as stringToBoolean
7
+ e as alterData,
8
+ t as analyzeDataOverrideReferences,
9
+ n as applyDataMapping,
10
+ p as formatString,
11
+ m as maybeFormatString,
12
+ i as parseRjBuild,
13
+ x as stringToBoolean
10
14
  };
package/dist/main.js CHANGED
@@ -1,19 +1,22 @@
1
- import { A as t, K as o, B as s, C as r, j as i, k as n, D as l, l as m, F as p, d, H as u, e as c, L as x, M as f, f as v, N as D, o as b, P as g, g as C, R as F, O as T, q as P, a as h, S as R, h as E, s as A, i as V, b as L, c as S, T as B, a0 as H, t as y, Z as M, Q as w, U as J, V as N, W as k, v as z, u as G, _ as I, m as O, X as j, J as q, $ as K, w as Q, n as U, x as W, p as X, r as Y, y as Z, z as _, E as $, G as ee, I as ae, Y as te } from "./HashChangeListener-BrTnLmiF.js";
2
- import { Hide as se } from "./component/action/Hide.js";
3
- import { VisuallyHide as ie } from "./component/action/VisuallyHide.js";
4
- import { PageControls as le } from "./component/element/special/PageControls.js";
5
- import { u as pe } from "./usePagination-D5Fkvhsw.js";
6
- import { triggerEvent as ue } from "./component/reaction/triggerEvent.js";
7
- import { mergeComponentCollections as xe } from "./engine/ComponentCollector.js";
8
- import { EventDispatcherContext as ve } from "./engine/EventDispatcherContext.js";
9
- import { EventDispatcherProvider as be, addEventListener as ge, removeEventListener as Ce } from "./engine/EventDispatcherProvider.js";
10
- import { GlobalDataContext as Te } from "./engine/GlobalDataContext.js";
11
- import { GlobalDataContextProvider as he } from "./engine/GlobalDataContextProvider.js";
12
- import { PaginationContext as Ee } from "./engine/PaginationContext.js";
13
- import { PaginationProvider as Ve } from "./engine/PaginationProvider.js";
14
- import { TemplateContext as Se } from "./engine/TemplateContext.js";
15
- import { parseRjBuild as He } from "./engine/utility/parseRjBuild.js";
16
- import { stringToBoolean as Me } from "./engine/utility/stringToBoolean.js";
1
+ import { A as t, Q as o, B as s, C as r, k as i, l as n, D as l, m as p, F as m, e as c, H as d, f as x, L as u, M as f, g as D, N as v, q as g, P as C, h as b, R as F, U as T, t as P, a as h, S as R, i as E, u as A, j as V, b as L, d as M, T as S, a2 as y, v as B, $ as H, c as w, V as J, W as N, X as k, Y as z, x as G, w as I, a0 as O, o as j, Z as q, O as K, a1 as Q, y as U, n as W, z as X, p as Y, r as Z, E as _, G as $, I as aa, J as ea, s as ta, K as oa, _ as sa } from "./HashChangeListener-D2T1_KYz.js";
2
+ import { Hide as ia } from "./component/action/Hide.js";
3
+ import { VisuallyHide as la } from "./component/action/VisuallyHide.js";
4
+ import { coreDataProcessorComponents as ma } from "./component/dataProcessor/index.js";
5
+ import { PageControls as da } from "./component/element/special/PageControls.js";
6
+ import { u as ua } from "./usePagination-Bb6lefHG.js";
7
+ import { triggerEvent as Da } from "./component/reaction/triggerEvent.js";
8
+ import { mergeComponentCollections as ga } from "./engine/ComponentCollector.js";
9
+ import { EventDispatcherContext as ba } from "./engine/EventDispatcherContext.js";
10
+ import { EventDispatcherProvider as Ta, addEventListener as Pa, removeEventListener as ha } from "./engine/EventDispatcherProvider.js";
11
+ import { GlobalDataContext as Ea } from "./engine/GlobalDataContext.js";
12
+ import { GlobalDataContextProvider as Va } from "./engine/GlobalDataContextProvider.js";
13
+ import { PaginationContext as Ma } from "./engine/PaginationContext.js";
14
+ import { PaginationProvider as ya } from "./engine/PaginationProvider.js";
15
+ import { TemplateContext as Ha } from "./engine/TemplateContext.js";
16
+ import { a as Ja } from "./alterData-CjaFWyAA.js";
17
+ import { applyDataMapping as ka } from "./engine/utility/dataMappingSystem.js";
18
+ import { parseRjBuild as Ga } from "./engine/utility/parseRjBuild.js";
19
+ import { stringToBoolean as Oa } from "./engine/utility/stringToBoolean.js";
17
20
  export {
18
21
  t as AccordionItem,
19
22
  o as ActionDependant,
@@ -22,26 +25,26 @@ export {
22
25
  i as Count,
23
26
  n as DataFilter,
24
27
  l as DateField,
25
- m as DelayedActions,
26
- ve as EventDispatcherContext,
27
- be as EventDispatcherProvider,
28
- p as FolderSortableTree,
29
- d as FormatNumeral,
30
- Te as GlobalDataContext,
31
- he as GlobalDataContextProvider,
32
- u as HashChangeListener,
33
- se as Hide,
34
- c as Html,
35
- x as LabelFromValue,
28
+ p as DelayedActions,
29
+ ba as EventDispatcherContext,
30
+ Ta as EventDispatcherProvider,
31
+ m as FolderSortableTree,
32
+ c as FormatNumeral,
33
+ Ea as GlobalDataContext,
34
+ Va as GlobalDataContextProvider,
35
+ d as HashChangeListener,
36
+ ia as Hide,
37
+ x as Html,
38
+ u as LabelFromValue,
36
39
  f as MessageListener,
37
- v as Modal,
38
- D as NumberField,
39
- le as PageControls,
40
- Ee as PaginationContext,
41
- Ve as PaginationProvider,
42
- b as Phantom,
43
- g as Popover,
44
- C as PreformattedMarkup,
40
+ D as Modal,
41
+ v as NumberField,
42
+ da as PageControls,
43
+ Ma as PaginationContext,
44
+ ya as PaginationProvider,
45
+ g as Phantom,
46
+ C as Popover,
47
+ b as PreformattedMarkup,
45
48
  F as ReactOnEvent,
46
49
  T as ReactiveJsonRoot,
47
50
  P as ReactiveJsonSubroot,
@@ -50,41 +53,46 @@ export {
50
53
  E as SortableTreeItemCollapseButton,
51
54
  A as Switch,
52
55
  V as Tabs,
53
- Se as TemplateContext,
56
+ Ha as TemplateContext,
54
57
  L as TextAreaField,
55
- S as TextField,
56
- B as Tooltip,
57
- H as View,
58
- ie as VisuallyHide,
59
- y as addData,
60
- ge as addEventListener,
61
- M as analyzeDataOverrideReferences,
62
- w as dataLocationToPath,
63
- J as evaluateAttributes,
64
- N as evaluateTemplateValue,
65
- k as evaluateTemplateValueCollection,
66
- z as executeHttpRequest,
67
- G as fetchData,
68
- I as formatString,
69
- O as getReactionFunctionsToExecute,
70
- j as isTemplateValue,
71
- q as isValid,
72
- K as maybeFormatString,
73
- xe as mergeComponentCollections,
74
- Q as moveData,
75
- U as normalizeAttributesForReactJsx,
76
- He as parseRjBuild,
77
- W as postMessage,
78
- X as propsDataLocationToPathAndValue,
79
- Y as reactionFunctions,
80
- Z as redirectNow,
81
- _ as removeData,
82
- Ce as removeEventListener,
83
- $ as setClipboardData,
84
- ee as setData,
85
- Me as stringToBoolean,
86
- ae as submitData,
87
- ue as triggerEvent,
88
- te as useEvaluatedAttributes,
89
- pe as usePagination
58
+ M as TextField,
59
+ S as Tooltip,
60
+ y as View,
61
+ la as VisuallyHide,
62
+ B as addData,
63
+ Pa as addEventListener,
64
+ Ja as alterData,
65
+ H as analyzeDataOverrideReferences,
66
+ ka as applyDataMapping,
67
+ w as coreDataMappingComponents,
68
+ ma as coreDataProcessorComponents,
69
+ J as dataLocationToPath,
70
+ N as evaluateAttributes,
71
+ k as evaluateTemplateValue,
72
+ z as evaluateTemplateValueCollection,
73
+ G as executeHttpRequest,
74
+ I as fetchData,
75
+ O as formatString,
76
+ j as getReactionFunctionsToExecute,
77
+ q as isTemplateValue,
78
+ K as isValid,
79
+ Q as maybeFormatString,
80
+ ga as mergeComponentCollections,
81
+ U as moveData,
82
+ W as normalizeAttributesForReactJsx,
83
+ Ga as parseRjBuild,
84
+ X as postMessage,
85
+ Y as propsDataLocationToPathAndValue,
86
+ Z as reactionFunctions,
87
+ _ as redirectNow,
88
+ $ as removeData,
89
+ ha as removeEventListener,
90
+ aa as setClipboardData,
91
+ ea as setData,
92
+ ta as simpleMapping,
93
+ Oa as stringToBoolean,
94
+ oa as submitData,
95
+ Da as triggerEvent,
96
+ sa as useEvaluatedAttributes,
97
+ ua as usePagination
90
98
  };