@ea-lab/reactive-json 0.7.1 → 1.0.0-alpha.1

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 (93) hide show
  1. package/README.md +1 -3
  2. package/dist/View-D8TN1L2h.js +126 -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 -12
  18. package/dist/component/element/debug/index.js +2 -2
  19. package/dist/component/element/html/FolderSortableTree.js +133 -7
  20. package/dist/component/element/html/FormatNumeral.js +58 -6
  21. package/dist/component/element/html/Html.js +5 -3
  22. package/dist/component/element/html/LabelFromValue.js +27 -6
  23. package/dist/component/element/html/PreformattedMarkup.js +51 -6
  24. package/dist/component/element/html/SortableTreeItemCollapseButton.js +10 -5
  25. package/dist/component/element/html/index.js +11 -10
  26. package/dist/component/element/index.js +34 -29
  27. package/dist/component/element/special/Count.js +23 -12
  28. package/dist/component/element/special/DataFilter.js +76 -6
  29. package/dist/component/element/special/DelayedActions.js +47 -7
  30. package/dist/component/element/special/Phantom.js +13 -3
  31. package/dist/component/element/special/ReactiveJsonBasicComponentWrapper.js +32 -0
  32. package/dist/component/element/special/ReactiveJsonSubroot.js +8 -5
  33. package/dist/component/element/special/Switch.js +80 -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 +84 -62
  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 +5 -4
  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 +161 -10
  53. package/dist/engine/ParsingDebugDisplay/ParsingDebugDisplay.js +692 -3
  54. package/dist/engine/ReactiveJsonRoot.js +10 -5
  55. package/dist/engine/TemplateSystem.js +117 -11
  56. package/dist/engine/View.js +3 -6
  57. package/dist/engine/index.js +45 -40
  58. package/dist/engine/utility/alterData.js +27 -2
  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 +15 -12
  63. package/dist/engine/utility/parseRjBuild.js +23 -1002
  64. package/dist/engine/utility/reactJsxHelpers.js +15 -0
  65. package/dist/httpRequestCommon-DUo2Oxgl.js +1799 -0
  66. package/dist/index-B3RKTGQ2.js +18 -0
  67. package/dist/index-BA09SSaJ.js +26 -0
  68. package/dist/index-BYLJtf9L.js +462 -0
  69. package/dist/index-CACLSxWi.js +8 -0
  70. package/dist/index-NNBvIV0S.js +1873 -0
  71. package/dist/js-yaml-Bw0KO4XO.js +983 -0
  72. package/dist/jsonpath-B9kE9k9e.js +3168 -0
  73. package/dist/{alterData-CjaFWyAA.js → lodash-CYNxjS-I.js} +1348 -1368
  74. package/dist/main.js +127 -101
  75. package/package.json +4 -4
  76. package/dist/ParsingDebugDisplay-8f4yL4Jw.js +0 -696
  77. package/dist/VariablesDebug-1UzZWgD7.js +0 -17782
  78. package/dist/component/action/Popover.js +0 -6
  79. package/dist/component/action/Tooltip.js +0 -5
  80. package/dist/component/element/form/CheckBoxField.js +0 -8
  81. package/dist/component/element/form/DateField.js +0 -8
  82. package/dist/component/element/form/NumberField.js +0 -8
  83. package/dist/component/element/form/SelectField.js +0 -8
  84. package/dist/component/element/form/TextAreaField.js +0 -8
  85. package/dist/component/element/form/TextField.js +0 -8
  86. package/dist/component/element/form/formElementsCommon.js +0 -4
  87. package/dist/component/element/form/index.js +0 -10
  88. package/dist/component/element/html/AccordionItem.js +0 -6
  89. package/dist/component/element/html/Modal.js +0 -8
  90. package/dist/component/element/html/Tabs.js +0 -8
  91. package/dist/component/element/special/BootstrapElement.js +0 -5
  92. package/dist/engine/PaginationProvider.js +0 -30
  93. package/dist/usePagination-Bb6lefHG.js +0 -353
@@ -1,4 +1,95 @@
1
- import { s as a } from "../../VariablesDebug-1UzZWgD7.js";
1
+ import { dataLocationToPath as V, evaluateTemplateValueCollection as v } from "../../engine/TemplateSystem.js";
2
+ function T({ config: h, globalDataContext: a, templateContext: i, responseData: m }) {
3
+ const { stringMap: M = {}, onErrorMap: p } = h, { updateData: g } = a;
4
+ try {
5
+ Object.entries(M).map(([r, t]) => l({
6
+ destinationDataLocation: r,
7
+ mappingConfig: t,
8
+ sourceDataRetriever: ({ location: n }) => s({ location: n, data: m })
9
+ })).filter(Boolean).forEach(u);
10
+ } catch (e) {
11
+ if (!p)
12
+ throw e;
13
+ Object.entries(p).map(([t, n]) => l({
14
+ destinationDataLocation: t,
15
+ mappingConfig: n,
16
+ sourceDataRetriever: w
17
+ })).filter(Boolean).forEach(u);
18
+ }
19
+ function u({ destinationPath: e, value: r, updateMode: t }) {
20
+ g(r, e, t);
21
+ }
22
+ function s({ location: e, data: r }) {
23
+ if (typeof r != "object")
24
+ throw new Error("simpleMapping: Could not find location in response data: " + e + ".");
25
+ if (!e || e === "")
26
+ throw new Error("simpleMapping: Location is empty.");
27
+ const t = e.split(".")[0];
28
+ if (t in r) {
29
+ const n = e.split(".").slice(1).join(".");
30
+ return n === "" ? r[t] : s({ location: n, data: r[t] });
31
+ }
32
+ throw new Error(
33
+ "simpleMapping: Could not find location in response data: " + e + " (location not found in data)."
34
+ );
35
+ }
36
+ function w({ location: e }) {
37
+ return v({
38
+ valueToEvaluate: e,
39
+ globalDataContext: a,
40
+ templateContext: i,
41
+ evaluationDepth: -1
42
+ });
43
+ }
44
+ function l({ destinationDataLocation: e, mappingConfig: r, sourceDataRetriever: t }) {
45
+ const { value: n, required: E = !0, defaultValue: c } = r;
46
+ let f = "";
47
+ if (!n) {
48
+ console.warn("simpleMapping: 'value' is missing for", e);
49
+ return;
50
+ }
51
+ const o = V({
52
+ dataLocation: e,
53
+ // TODO: This is incorrect because simpleMapping could be called from a fetchData reaction that is not located at the root of the data.
54
+ currentPath: "data",
55
+ globalDataContext: a,
56
+ templateContext: i
57
+ });
58
+ if (typeof o != "string" || !o.startsWith("data")) {
59
+ console.warn(
60
+ "simpleMapping: the given destination path is invalid:",
61
+ e,
62
+ "->",
63
+ o
64
+ );
65
+ return;
66
+ }
67
+ try {
68
+ const d = t({ location: n });
69
+ return {
70
+ destinationPath: o,
71
+ value: d,
72
+ updateMode: f
73
+ };
74
+ } catch {
75
+ if (E)
76
+ throw new Error("simpleMapping: Required value not found in response data: " + n + ".");
77
+ if (c !== void 0) {
78
+ const y = v({
79
+ valueToEvaluate: c,
80
+ globalDataContext: a,
81
+ templateContext: i,
82
+ evaluationDepth: -1
83
+ });
84
+ return {
85
+ destinationPath: o,
86
+ value: y,
87
+ updateMode: f
88
+ };
89
+ }
90
+ }
91
+ }
92
+ }
2
93
  export {
3
- a as simpleMapping
94
+ T as simpleMapping
4
95
  };
@@ -1,18 +1,116 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { V as D } from "../../../../VariablesDebug-1UzZWgD7.js";
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";
4
5
  import "../../../../engine/EventDispatcherContext.js";
5
6
  import "../../../../engine/EventDispatcherProvider.js";
6
7
  import "../../../../engine/GlobalDataContext.js";
7
8
  import "../../../../engine/PaginationContext.js";
8
- import "../../../../engine/TemplateContext.js";
9
- import "../../../../alterData-CjaFWyAA.js";
10
- import "../../../../engine/utility/parseRjBuild.js";
11
- import "../../../../ParsingDebugDisplay-8f4yL4Jw.js";
12
- import "./DebugMode.enum.js";
13
- import "./ModeDisplay/DebugList/DebugList.js";
14
- import "./ModeDisplay/DebugJson/DebugJson.js";
15
- import "./utils.js";
9
+ import "../../../../lodash-CYNxjS-I.js";
10
+ import { TemplateContext as $ } from "../../../../engine/TemplateContext.js";
11
+ import "../../../../index-NNBvIV0S.js";
12
+ import "../../../../jsonpath-B9kE9k9e.js";
13
+ import "../../../../js-yaml-Bw0KO4XO.js";
14
+ import "../../../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
15
+ import { DebugMode as r } from "./DebugMode.enum.js";
16
+ import R from "./ModeDisplay/DebugList/DebugList.js";
17
+ import D from "./ModeDisplay/DebugJson/DebugJson.js";
18
+ import '../../../../assets/reset.css';import '../../../../assets/VariablesDebug.css';/* empty css */
19
+ import { flattenObject as J } from "./utils.js";
20
+ 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 = {
21
+ debugRoot: O,
22
+ container: j,
23
+ expanded: k,
24
+ header: T,
25
+ actions: I,
26
+ btn: P,
27
+ active: M,
28
+ path: w,
29
+ value: A,
30
+ copyBtn: H,
31
+ copyBtnSuccess: V,
32
+ copyBtnError: F,
33
+ info: W
34
+ }, pt = ({ props: v }) => {
35
+ const [c, u] = p(!1), [i, _] = p(r.LIST), o = B($), d = g(null), [y, S] = p(null), f = g(null);
36
+ q(() => {
37
+ if (typeof document > "u") return;
38
+ let t = document.getElementById("rj-debug-root");
39
+ t || (t = document.createElement("div"), t.id = "rj-debug-root", t.classList.add(n.debugRoot), document.body.appendChild(t)), S(t);
40
+ }, []);
41
+ 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 () => {
42
+ const t = d.current;
43
+ try {
44
+ if (await navigator.clipboard.writeText(
45
+ i === r.JSON ? b : h.map((s) => `${s.path}: ${JSON.stringify(s.value)}`).join(`
46
+ `)
47
+ ), !t) return;
48
+ t.classList.add(n.copyBtnSuccess), t.textContent = "Copied!", setTimeout(() => {
49
+ var s;
50
+ (s = d.current) == null || s.classList.remove(n.copyBtnSuccess, n.copyBtnError);
51
+ }, 3e3);
52
+ } catch {
53
+ t == null || t.classList.add(n.copyBtnError), setTimeout(() => {
54
+ t == null || t.classList.remove(n.copyBtnError);
55
+ }, 3e3);
56
+ }
57
+ }, N = /* @__PURE__ */ e(L, { ...v, attributesHolderRef: f, children: /* @__PURE__ */ a(
58
+ "div",
59
+ {
60
+ className: `${n.container} ${c ? n.expanded : ""}`,
61
+ onClick: () => u((t) => !t),
62
+ role: "button",
63
+ ref: f,
64
+ children: [
65
+ /* @__PURE__ */ a("div", { className: n.header, children: [
66
+ /* @__PURE__ */ a("p", { style: { margin: 0, fontWeight: 600 }, children: [
67
+ "Debug Variables ",
68
+ /* @__PURE__ */ e("code", { children: o.templatePath })
69
+ ] }),
70
+ /* @__PURE__ */ a("div", { className: n.actions, onClick: (t) => t.stopPropagation(), children: [
71
+ c && /* @__PURE__ */ a(x, { children: [
72
+ /* @__PURE__ */ e(
73
+ "button",
74
+ {
75
+ className: `${n.btn} ${i === r.LIST ? n.active : ""}`,
76
+ onClick: () => _(r.LIST),
77
+ children: "List"
78
+ }
79
+ ),
80
+ /* @__PURE__ */ e(
81
+ "button",
82
+ {
83
+ className: `${n.btn} ${i === r.JSON ? n.active : ""}`,
84
+ onClick: () => _(r.JSON),
85
+ children: "JSON"
86
+ }
87
+ )
88
+ ] }),
89
+ /* @__PURE__ */ e(
90
+ "button",
91
+ {
92
+ className: n.btn,
93
+ onClick: () => u((t) => !t),
94
+ children: c ? "Collapse" : "Expand"
95
+ }
96
+ ),
97
+ c && /* @__PURE__ */ e(
98
+ "button",
99
+ {
100
+ className: `${n.btn} ${n.copyBtn}`,
101
+ onClick: C,
102
+ ref: d,
103
+ children: "Copy"
104
+ }
105
+ )
106
+ ] })
107
+ ] }),
108
+ c && /* @__PURE__ */ e("div", { className: n.info, onClick: (t) => t.stopPropagation(), children: i === r.JSON ? /* @__PURE__ */ e(D, { jsonString: b }) : /* @__PURE__ */ e(R, { flatRows: h }) })
109
+ ]
110
+ }
111
+ ) });
112
+ return y ? E.createPortal(N, y) : null;
113
+ };
16
114
  export {
17
- D as VariablesDebug
115
+ pt as VariablesDebug
18
116
  };
@@ -1,4 +1,4 @@
1
- import { V as r } from "../../../VariablesDebug-1UzZWgD7.js";
1
+ import { VariablesDebug as a } from "./VariablesDebug/VariablesDebug.js";
2
2
  export {
3
- r as VariablesDebug
3
+ a as VariablesDebug
4
4
  };
@@ -1,9 +1,135 @@
1
- import "react/jsx-runtime";
2
- import { F as a } from "../../../VariablesDebug-1UzZWgD7.js";
3
- import "../../../alterData-CjaFWyAA.js";
4
- import "react";
5
- import "../../../engine/GlobalDataContext.js";
6
- import "../../../engine/TemplateContext.js";
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { F as k, S as B } from "../../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
3
+ import { l as _ } from "../../../lodash-CYNxjS-I.js";
4
+ import { useContext as A, forwardRef as R } from "react";
5
+ import { ActionDependant as G } from "../../../engine/Actions.js";
6
+ import { GlobalDataContext as H } from "../../../engine/GlobalDataContext.js";
7
+ import { TemplateContext as V } from "../../../engine/TemplateContext.js";
8
+ import { evaluateTemplateValue as O } from "../../../engine/TemplateSystem.js";
9
+ import { V as W } from "../../../View-D8TN1L2h.js";
10
+ import { propsDataLocationToPathAndValue as q } from "../../../engine/utility/formElementsCommon.js";
11
+ function y(t) {
12
+ var r, n, a = "";
13
+ if (typeof t == "string" || typeof t == "number") a += t;
14
+ else if (typeof t == "object") if (Array.isArray(t)) {
15
+ var s = t.length;
16
+ for (r = 0; r < s; r++) t[r] && (n = y(t[r])) && (a && (a += " "), a += n);
17
+ } else for (n in t) t[n] && (a && (a += " "), a += n);
18
+ return a;
19
+ }
20
+ function z() {
21
+ for (var t, r, n = 0, a = "", s = arguments.length; n < s; n++) (t = arguments[n]) && (r = y(t)) && (a && (a += " "), a += r);
22
+ return a;
23
+ }
24
+ const ae = ({ props: t, path: r, datafield: n }) => {
25
+ var P, T;
26
+ const a = A(H), s = A(V);
27
+ let { formData: i, formDataPath: u } = q({
28
+ currentPath: r,
29
+ datafield: n,
30
+ dataLocation: t.dataLocation,
31
+ defaultValue: t.defaultFieldValue,
32
+ globalDataContext: a,
33
+ templateContext: s
34
+ });
35
+ if (i === void 0)
36
+ return null;
37
+ const L = t.itemTemplate ?? null, c = O({
38
+ valueToEvaluate: t.treeRootPath ?? void 0,
39
+ globalDataContext: a,
40
+ templateContext: s
41
+ }), v = t.maxDepth, w = typeof c != "string" ? !0 : t.maxDepthIsAbsolute ?? !0, C = t.keepBaseItem ?? !1;
42
+ let f = 0, b = null, I;
43
+ if (typeof c == "string" && c.length > 0) {
44
+ const e = c.split(".");
45
+ let m = b, o = i, d = u;
46
+ for (; e.length > 0; ) {
47
+ const l = Number.parseInt(e.shift());
48
+ if (Number.isNaN(l) || (m = (i == null ? void 0 : i.id) ?? null, o = i, d = u, I = l, b = (P = i[l]) == null ? void 0 : P.id, i = ((T = i[l]) == null ? void 0 : T.children) ?? void 0, u = u + "." + l + ".children", i === void 0))
49
+ return null;
50
+ ++f;
51
+ }
52
+ C && (b = m, i = o, u = d, i = [i[I]]);
53
+ }
54
+ const F = (e) => {
55
+ let m = e, o = u;
56
+ if (f > 0) {
57
+ m = _.cloneDeep(m);
58
+ const d = (l, p = 0) => {
59
+ var x;
60
+ p === 0 && (l.parentId = b), l.depth += f, (x = l.children) == null || x.forEach((D) => {
61
+ d(D, p + 1);
62
+ });
63
+ };
64
+ m.forEach((l) => {
65
+ d(l, 0);
66
+ });
67
+ }
68
+ c !== void 0 && C && (m = e[0], o = u + "." + I), a.updateData(m, o);
69
+ }, N = R((e, m) => {
70
+ const o = e.item.value ?? {}, d = [];
71
+ let l = e.item;
72
+ for (d.push(l.index); l.parent; )
73
+ d.push("children"), l = l.parent, d.push(l.index);
74
+ d.reverse();
75
+ const x = u + "." + d.join(".") + ".value";
76
+ o._treeItemDepth = e.item.depth, o._treeItemIndex = e.item.index, o._treeItemIndex1 = e.item.index + 1;
77
+ const D = {};
78
+ return D._treeAddCollapseButton = () => !!e.onCollapse && !!e.childCount && /* @__PURE__ */ h(
79
+ "button",
80
+ {
81
+ onClick: (S) => {
82
+ var g;
83
+ S.preventDefault(), (g = e.onCollapse) == null || g.call(e);
84
+ },
85
+ className: z(
86
+ "dnd-sortable-tree_folder_tree-item-collapse_button",
87
+ e.collapsed && "dnd-sortable-tree_folder_tree-item-collapse_button-collapsed"
88
+ )
89
+ }
90
+ ), v && (w ? e.item.canHaveChildren = f + e.item.depth < v : e.item.canHaveChildren = e.item.depth < v), /* @__PURE__ */ h(
91
+ k,
92
+ {
93
+ ...e,
94
+ "data-htmlbuilder-tree-item-children-count": e.childCount || "0",
95
+ "data-htmlbuilder-tree-item-collapsed": e.collapsed,
96
+ "data-htmlbuilder-tree-item-depth": e.item.depth,
97
+ "data-htmlbuilder-tree-item-depth-list": J(e.item.depth),
98
+ "data-htmlbuilder-tree-item-index": e.item.index,
99
+ "data-htmlbuilder-tree-item-index1": e.item.index + 1,
100
+ "data-htmlbuilder-tree-item-is-last": e.isLast,
101
+ ref: m,
102
+ children: /* @__PURE__ */ h(
103
+ V.Provider,
104
+ {
105
+ value: {
106
+ templateData: o,
107
+ templatePath: x,
108
+ sortableTreeData: D
109
+ },
110
+ children: /* @__PURE__ */ h(W, { props: L, currentData: o })
111
+ }
112
+ )
113
+ }
114
+ );
115
+ }), j = _.cloneDeep(i), E = t.sortableTreeOptions ?? {};
116
+ return /* @__PURE__ */ h(G, { ...t, children: /* @__PURE__ */ h(
117
+ B,
118
+ {
119
+ ...E,
120
+ items: j,
121
+ onItemsChanged: F,
122
+ TreeItemComponent: N
123
+ }
124
+ ) });
125
+ };
126
+ function J(t) {
127
+ const r = [];
128
+ let n = t ?? 0;
129
+ for (; n >= 0; )
130
+ r.push(n), --n;
131
+ return r.reverse().join(" ");
132
+ }
7
133
  export {
8
- a as FolderSortableTree
134
+ ae as FolderSortableTree
9
135
  };
@@ -1,8 +1,60 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { h as a } from "../../../VariablesDebug-1UzZWgD7.js";
4
- import "../../../engine/GlobalDataContext.js";
5
- import "../../../engine/TemplateContext.js";
1
+ import { jsx as u, Fragment as s } from "react/jsx-runtime";
2
+ import { useContext as f } from "react";
3
+ import { ActionDependant as d } from "../../../engine/Actions.js";
4
+ import { GlobalDataContext as p } from "../../../engine/GlobalDataContext.js";
5
+ import { TemplateContext as v } from "../../../engine/TemplateContext.js";
6
+ import { evaluateTemplateValue as c } from "../../../engine/TemplateSystem.js";
7
+ const h = ({ props: t }) => {
8
+ const r = f(p), l = f(v);
9
+ let o = !1, e, a;
10
+ if (t.content !== void 0 && (e = c({ valueToEvaluate: t.content, globalDataContext: r, templateContext: l })), e == null || e === "")
11
+ return null;
12
+ switch (t.format !== void 0 && (a = c({ valueToEvaluate: t.format, globalDataContext: r, templateContext: l })), a) {
13
+ case "roman-upper":
14
+ o = m(e);
15
+ break;
16
+ case "roman-lower":
17
+ o = m(e, !0);
18
+ break;
19
+ case "latin-upper":
20
+ o = n(e);
21
+ break;
22
+ case "latin-lower":
23
+ o = n(e, !0);
24
+ break;
25
+ default:
26
+ o = e;
27
+ break;
28
+ }
29
+ return /* @__PURE__ */ u(d, { ...t, children: /* @__PURE__ */ u(s, { children: o !== !1 && o }) });
30
+ };
31
+ function n(t, r = !1) {
32
+ if (t < 1)
33
+ return !1;
34
+ let l = t % 26, o = t / 26 | 0, e = l ? String.fromCharCode(64 + l) : (--o, "Z");
35
+ const a = o ? n(o) + e : e;
36
+ return r ? a.toLowerCase() : a;
37
+ }
38
+ function m(t, r = !1) {
39
+ if (t < 1)
40
+ return !1;
41
+ const o = [
42
+ ["M", 1e3],
43
+ ["CM", 900],
44
+ ["D", 500],
45
+ ["CD", 400],
46
+ ["C", 100],
47
+ ["XC", 90],
48
+ ["L", 50],
49
+ ["XL", 40],
50
+ ["X", 10],
51
+ ["IX", 9],
52
+ ["V", 5],
53
+ ["IV", 4],
54
+ ["I", 1]
55
+ ].reduce((e, [a, i]) => (e += a.repeat(Math.floor(t / i)), t = t % i, e), "");
56
+ return r ? o.toLowerCase() : o;
57
+ }
6
58
  export {
7
- a as FormatNumeral
59
+ h as FormatNumeral
8
60
  };
@@ -1,9 +1,11 @@
1
1
  import "react/jsx-runtime";
2
- import { i as a, n as e } from "../../../VariablesDebug-1UzZWgD7.js";
3
2
  import "react";
3
+ import "../../../engine/Actions.js";
4
4
  import "../../../engine/GlobalDataContext.js";
5
+ import "../../../engine/utility/reactJsxHelpers.js";
5
6
  import "../../../engine/TemplateContext.js";
7
+ import "../../../engine/TemplateSystem.js";
8
+ import { H as f } from "../../../View-D8TN1L2h.js";
6
9
  export {
7
- a as Html,
8
- e as normalizeAttributesForReactJsx
10
+ f as Html
9
11
  };
@@ -1,8 +1,29 @@
1
- import "react/jsx-runtime";
2
- import { L as a } from "../../../VariablesDebug-1UzZWgD7.js";
3
- import "../../../engine/GlobalDataContext.js";
4
- import "../../../engine/TemplateContext.js";
5
- import "react";
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { useContext as f } from "react";
3
+ import { ActionDependant as D } from "../../../engine/Actions.js";
4
+ import { GlobalDataContext as x } from "../../../engine/GlobalDataContext.js";
5
+ import { TemplateContext as V } from "../../../engine/TemplateContext.js";
6
+ import { evaluateTemplateValue as c } from "../../../engine/TemplateSystem.js";
7
+ import { V as b } from "../../../View-D8TN1L2h.js";
8
+ const O = ({ currentData: s, datafield: o, path: v, props: e }) => {
9
+ const n = f(x), t = f(V), m = e.dynamicOptions ?? void 0;
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);
20
+ if (!l || !l.label) {
21
+ if (!a)
22
+ return null;
23
+ l = a;
24
+ }
25
+ return /* @__PURE__ */ u(D, { ...e, children: /* @__PURE__ */ u(b, { currentData: s, datafield: o, path: v, props: l.label }) });
26
+ };
6
27
  export {
7
- a as LabelFromValue
28
+ O as LabelFromValue
8
29
  };
@@ -1,8 +1,53 @@
1
- import "react/jsx-runtime";
2
- import { k as a } from "../../../VariablesDebug-1UzZWgD7.js";
3
- import "../../../engine/GlobalDataContext.js";
4
- import "../../../engine/TemplateContext.js";
5
- import "react";
1
+ import { jsx as a, Fragment as m } from "react/jsx-runtime";
2
+ import { p as s } from "../../../index-NNBvIV0S.js";
3
+ import { useContext as l } from "react";
4
+ import { ActionDependant as c } from "../../../engine/Actions.js";
5
+ import { GlobalDataContext as p } from "../../../engine/GlobalDataContext.js";
6
+ import { TemplateContext as f } from "../../../engine/TemplateContext.js";
7
+ import { evaluateTemplateValue as h } from "../../../engine/TemplateSystem.js";
8
+ const u = [
9
+ "abbr",
10
+ "acronym",
11
+ "b",
12
+ "blockquote",
13
+ "br",
14
+ "caption",
15
+ "code",
16
+ "div",
17
+ "em",
18
+ "h1",
19
+ "h2",
20
+ "h3",
21
+ "h4",
22
+ "h5",
23
+ "h6",
24
+ "i",
25
+ "li",
26
+ "ol",
27
+ "p",
28
+ "span",
29
+ "sup",
30
+ "strong",
31
+ "table",
32
+ "tbody",
33
+ "td",
34
+ "tfoot",
35
+ "th",
36
+ "thead",
37
+ "tr",
38
+ "ul"
39
+ ], L = ({ props: t }) => {
40
+ const r = l(f), n = l(p), o = h({ valueToEvaluate: t.content, templateContext: r, globalDataContext: n });
41
+ if (typeof o != "string")
42
+ return console.error("PreformattedMarkup: the given content is not a string."), null;
43
+ const i = [...Array.isArray(t.htmlTagAllowList) ? t.htmlTagAllowList : u, ...t.additionalAllowedTags ?? []];
44
+ return /* @__PURE__ */ a(c, { ...t, children: s(o, {
45
+ replace(e) {
46
+ if (e.type === "tag" && i.indexOf(e.name) < 0)
47
+ return /* @__PURE__ */ a(m, {});
48
+ }
49
+ }) });
50
+ };
6
51
  export {
7
- a as PreformattedMarkup
52
+ L as PreformattedMarkup
8
53
  };
@@ -1,7 +1,12 @@
1
- import "react/jsx-runtime";
2
- import { l as p } from "../../../VariablesDebug-1UzZWgD7.js";
3
- import "../../../engine/TemplateContext.js";
4
- import "react";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { ActionDependant as m } from "../../../engine/Actions.js";
3
+ import { TemplateContext as p } from "../../../engine/TemplateContext.js";
4
+ import { useContext as a } from "react";
5
+ const C = ({ props: o }) => {
6
+ var t, e;
7
+ const r = a(p);
8
+ return /* @__PURE__ */ n(m, { ...o, children: (e = (t = r.sortableTreeData)._treeAddCollapseButton) == null ? void 0 : e.call(t) });
9
+ };
5
10
  export {
6
- p as SortableTreeItemCollapseButton
11
+ C as SortableTreeItemCollapseButton
7
12
  };
@@ -1,13 +1,14 @@
1
- import { A as r, F as o, h as t, i as s, L as l, j as m, k as b, l as u, m as F, n as d } from "../../../VariablesDebug-1UzZWgD7.js";
1
+ import { FolderSortableTree as o } from "./FolderSortableTree.js";
2
+ import { FormatNumeral as m } from "./FormatNumeral.js";
3
+ import { H as l } from "../../../View-D8TN1L2h.js";
4
+ import { LabelFromValue as f } from "./LabelFromValue.js";
5
+ import { PreformattedMarkup as u } from "./PreformattedMarkup.js";
6
+ import { SortableTreeItemCollapseButton as F } from "./SortableTreeItemCollapseButton.js";
2
7
  export {
3
- r as AccordionItem,
4
8
  o as FolderSortableTree,
5
- t as FormatNumeral,
6
- s as Html,
7
- l as LabelFromValue,
8
- m as Modal,
9
- b as PreformattedMarkup,
10
- u as SortableTreeItemCollapseButton,
11
- F as Tabs,
12
- d as normalizeAttributesForReactJsx
9
+ m as FormatNumeral,
10
+ l as Html,
11
+ f as LabelFromValue,
12
+ u as PreformattedMarkup,
13
+ F as SortableTreeItemCollapseButton
13
14
  };
@@ -1,31 +1,36 @@
1
- import { A as t, B as s, C as o, o as r, q as l, D as i, t as n, F as m, h as u, i as F, L as c, j as d, N as b, v as p, k as x, w as T, e as A, l as D, x as h, m as C, f as S, g as f, V as g, u as B, n as P, p as V } from "../../VariablesDebug-1UzZWgD7.js";
2
- import { PageControls as L } from "./special/PageControls.js";
1
+ import "../../index-CACLSxWi.js";
2
+ import "../../index-B3RKTGQ2.js";
3
+ import { R as m, c as a } from "../../index-BYLJtf9L.js";
4
+ import { VariablesDebug as f } from "./debug/VariablesDebug/VariablesDebug.js";
5
+ import { FolderSortableTree as n } from "./html/FolderSortableTree.js";
6
+ import { FormatNumeral as s } from "./html/FormatNumeral.js";
7
+ import { H as c } from "../../View-D8TN1L2h.js";
8
+ import { LabelFromValue as b } from "./html/LabelFromValue.js";
9
+ import { PreformattedMarkup as F } from "./html/PreformattedMarkup.js";
10
+ import { SortableTreeItemCollapseButton as S } from "./html/SortableTreeItemCollapseButton.js";
11
+ import { Count as g } from "./special/Count.js";
12
+ import { DataFilter as P } from "./special/DataFilter.js";
13
+ import { DelayedActions as h, getReactionFunctionsToExecute as v } from "./special/DelayedActions.js";
14
+ import { PageControls as E } from "./special/PageControls.js";
15
+ import { Phantom as J } from "./special/Phantom.js";
16
+ import { ReactiveJsonBasicComponentWrapper as k } from "./special/ReactiveJsonBasicComponentWrapper.js";
17
+ import { Switch as y } from "./special/Switch.js";
3
18
  export {
4
- t as AccordionItem,
5
- s as BootstrapElement,
6
- o as CheckBoxField,
7
- r as Count,
8
- l as DataFilter,
9
- i as DateField,
10
- n as DelayedActions,
11
- m as FolderSortableTree,
12
- u as FormatNumeral,
13
- F as Html,
14
- c as LabelFromValue,
15
- d as Modal,
16
- b as NumberField,
17
- L as PageControls,
18
- p as Phantom,
19
- x as PreformattedMarkup,
20
- T as ReactiveJsonSubroot,
21
- A as SelectField,
22
- D as SortableTreeItemCollapseButton,
23
- h as Switch,
24
- C as Tabs,
25
- S as TextAreaField,
26
- f as TextField,
27
- g as VariablesDebug,
28
- B as getReactionFunctionsToExecute,
29
- P as normalizeAttributesForReactJsx,
30
- V as propsDataLocationToPathAndValue
19
+ g as Count,
20
+ P as DataFilter,
21
+ h as DelayedActions,
22
+ n as FolderSortableTree,
23
+ s as FormatNumeral,
24
+ c as Html,
25
+ b as LabelFromValue,
26
+ E as PageControls,
27
+ J as Phantom,
28
+ F as PreformattedMarkup,
29
+ k as ReactiveJsonBasicComponentWrapper,
30
+ m as ReactiveJsonSubroot,
31
+ S as SortableTreeItemCollapseButton,
32
+ y as Switch,
33
+ f as VariablesDebug,
34
+ a as coreElementComponents,
35
+ v as getReactionFunctionsToExecute
31
36
  };