@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,6 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { P as t } from "../../HashChangeListener-D6HwdXBJ.js";
4
- export {
5
- t as Popover
6
- };
@@ -1,5 +0,0 @@
1
- import "react/jsx-runtime";
2
- import { b as t } from "../../HashChangeListener-D6HwdXBJ.js";
3
- export {
4
- t as Tooltip
5
- };
@@ -1,8 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { C as e } from "../../../HashChangeListener-D6HwdXBJ.js";
4
- import "../../../engine/GlobalDataContext.js";
5
- import "../../../engine/TemplateContext.js";
6
- export {
7
- e as CheckBoxField
8
- };
@@ -1,8 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { D as e } from "../../../HashChangeListener-D6HwdXBJ.js";
4
- import "../../../engine/GlobalDataContext.js";
5
- import "../../../engine/TemplateContext.js";
6
- export {
7
- e as DateField
8
- };
@@ -1,8 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { N as e } from "../../../HashChangeListener-D6HwdXBJ.js";
4
- import "../../../engine/GlobalDataContext.js";
5
- import "../../../engine/TemplateContext.js";
6
- export {
7
- e as NumberField
8
- };
@@ -1,8 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { e as p } from "../../../HashChangeListener-D6HwdXBJ.js";
4
- import "../../../engine/GlobalDataContext.js";
5
- import "../../../engine/TemplateContext.js";
6
- export {
7
- p as SelectField
8
- };
@@ -1,8 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { f as e } from "../../../HashChangeListener-D6HwdXBJ.js";
4
- import "../../../engine/GlobalDataContext.js";
5
- import "../../../engine/TemplateContext.js";
6
- export {
7
- e as TextAreaField
8
- };
@@ -1,8 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import "../../../engine/GlobalDataContext.js";
4
- import { g as e } from "../../../HashChangeListener-D6HwdXBJ.js";
5
- import "../../../engine/TemplateContext.js";
6
- export {
7
- e as TextField
8
- };
@@ -1,4 +0,0 @@
1
- import { p } from "../../../HashChangeListener-D6HwdXBJ.js";
2
- export {
3
- p as propsDataLocationToPathAndValue
4
- };
@@ -1,10 +0,0 @@
1
- import { C as l, D as s, N as t, e as d, f as i, g as o, p as F } from "../../../HashChangeListener-D6HwdXBJ.js";
2
- export {
3
- l as CheckBoxField,
4
- s as DateField,
5
- t as NumberField,
6
- d as SelectField,
7
- i as TextAreaField,
8
- o as TextField,
9
- F as propsDataLocationToPathAndValue
10
- };
@@ -1,6 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { A as i } from "../../../HashChangeListener-D6HwdXBJ.js";
4
- export {
5
- i as AccordionItem
6
- };
@@ -1,8 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "../../../engine/GlobalDataContext.js";
3
- import "../../../engine/TemplateContext.js";
4
- import { j as a } from "../../../HashChangeListener-D6HwdXBJ.js";
5
- import "react";
6
- export {
7
- a as Modal
8
- };
@@ -1,8 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { m as a } from "../../../HashChangeListener-D6HwdXBJ.js";
4
- import "../../../engine/GlobalDataContext.js";
5
- import "../../../engine/TemplateContext.js";
6
- export {
7
- a as Tabs
8
- };
@@ -1,5 +0,0 @@
1
- import "react/jsx-runtime";
2
- import { B as e } from "../../../HashChangeListener-D6HwdXBJ.js";
3
- export {
4
- e as BootstrapElement
5
- };
@@ -1,30 +0,0 @@
1
- import { jsxs as m } from "react/jsx-runtime";
2
- import { useReducer as u } from "react";
3
- import { PaginationContext as s } from "./PaginationContext.js";
4
- const h = (t) => {
5
- const {
6
- after: i,
7
- before: o,
8
- contentToPaginate: e,
9
- pagination: n
10
- } = t;
11
- e.length;
12
- const a = t != null && t.paginated ? e.slice(n.firstShownItemIndex, n.maxShownItemIndexExcluded) : e, [l, c] = u((r, d) => {
13
- switch (d.type) {
14
- case "increment":
15
- return r + 1;
16
- case "decrement":
17
- return r - 1;
18
- default:
19
- return r;
20
- }
21
- }, { updateId: 0, realCurrentData: {} });
22
- return /* @__PURE__ */ m(s.Provider, { value: { dispatchItemCountAdjustment: c, pagination: n }, children: [
23
- o,
24
- a,
25
- i
26
- ] });
27
- };
28
- export {
29
- h as PaginationProvider
30
- };
@@ -1,353 +0,0 @@
1
- import { jsx as c, jsxs as B } from "react/jsx-runtime";
2
- import * as p from "react";
3
- import { useContext as y, useRef as I, useEffect as K, useCallback as M, useState as F } from "react";
4
- import { g as L } from "./_commonjsHelpers-DaMA6jEr.js";
5
- var C = { exports: {} };
6
- /*!
7
- Copyright (c) 2018 Jed Watson.
8
- Licensed under the MIT License (MIT), see
9
- http://jedwatson.github.io/classnames
10
- */
11
- var g;
12
- function S() {
13
- return g || (g = 1, function(n) {
14
- (function() {
15
- var r = {}.hasOwnProperty;
16
- function t() {
17
- for (var e = "", i = 0; i < arguments.length; i++) {
18
- var u = arguments[i];
19
- u && (e = o(e, s(u)));
20
- }
21
- return e;
22
- }
23
- function s(e) {
24
- if (typeof e == "string" || typeof e == "number")
25
- return e;
26
- if (typeof e != "object")
27
- return "";
28
- if (Array.isArray(e))
29
- return t.apply(null, e);
30
- if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
31
- return e.toString();
32
- var i = "";
33
- for (var u in e)
34
- r.call(e, u) && e[u] && (i = o(i, u));
35
- return i;
36
- }
37
- function o(e, i) {
38
- return i ? e ? e + " " + i : e + i : e;
39
- }
40
- n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
41
- })();
42
- }(C)), C.exports;
43
- }
44
- var T = S();
45
- const k = /* @__PURE__ */ L(T), $ = ["xxl", "xl", "lg", "md", "sm", "xs"], _ = "xs", h = /* @__PURE__ */ p.createContext({
46
- prefixes: {},
47
- breakpoints: $,
48
- minBreakpoint: _
49
- }), {
50
- Consumer: an,
51
- Provider: cn
52
- } = h;
53
- function V(n, r) {
54
- const {
55
- prefixes: t
56
- } = y(h);
57
- return n || t[r] || r;
58
- }
59
- function un() {
60
- const {
61
- breakpoints: n
62
- } = y(h);
63
- return n;
64
- }
65
- function ln() {
66
- const {
67
- minBreakpoint: n
68
- } = y(h);
69
- return n;
70
- }
71
- function fn() {
72
- const {
73
- dir: n
74
- } = y(h);
75
- return n === "rtl";
76
- }
77
- function q(n) {
78
- const r = I(n);
79
- return K(() => {
80
- r.current = n;
81
- }, [n]), r;
82
- }
83
- function H(n) {
84
- const r = q(n);
85
- return M(function(...t) {
86
- return r.current && r.current(...t);
87
- }, [r]);
88
- }
89
- const U = ["as", "disabled"];
90
- function W(n, r) {
91
- if (n == null) return {};
92
- var t = {};
93
- for (var s in n) if ({}.hasOwnProperty.call(n, s)) {
94
- if (r.indexOf(s) >= 0) continue;
95
- t[s] = n[s];
96
- }
97
- return t;
98
- }
99
- function G(n) {
100
- return !n || n.trim() === "#";
101
- }
102
- function j({
103
- tagName: n,
104
- disabled: r,
105
- href: t,
106
- target: s,
107
- rel: o,
108
- role: e,
109
- onClick: i,
110
- tabIndex: u = 0,
111
- type: d
112
- }) {
113
- n || (t != null || s != null || o != null ? n = "a" : n = "button");
114
- const f = {
115
- tagName: n
116
- };
117
- if (n === "button")
118
- return [{
119
- type: d || "button",
120
- disabled: r
121
- }, f];
122
- const m = (a) => {
123
- if ((r || n === "a" && G(t)) && a.preventDefault(), r) {
124
- a.stopPropagation();
125
- return;
126
- }
127
- i == null || i(a);
128
- }, x = (a) => {
129
- a.key === " " && (a.preventDefault(), m(a));
130
- };
131
- return n === "a" && (t || (t = "#"), r && (t = void 0)), [{
132
- role: e ?? "button",
133
- // explicitly undefined so that it overrides the props disabled in a spread
134
- // e.g. <Tag {...props} {...hookProps} />
135
- disabled: void 0,
136
- tabIndex: r ? void 0 : u,
137
- href: t,
138
- target: n === "a" ? s : void 0,
139
- "aria-disabled": r || void 0,
140
- rel: n === "a" ? o : void 0,
141
- onClick: m,
142
- onKeyDown: x
143
- }, f];
144
- }
145
- const J = /* @__PURE__ */ p.forwardRef((n, r) => {
146
- let {
147
- as: t,
148
- disabled: s
149
- } = n, o = W(n, U);
150
- const [e, {
151
- tagName: i
152
- }] = j(Object.assign({
153
- tagName: t,
154
- disabled: s
155
- }, o));
156
- return /* @__PURE__ */ c(i, Object.assign({}, o, e, {
157
- ref: r
158
- }));
159
- });
160
- J.displayName = "Button";
161
- const Q = ["onKeyDown"];
162
- function X(n, r) {
163
- if (n == null) return {};
164
- var t = {};
165
- for (var s in n) if ({}.hasOwnProperty.call(n, s)) {
166
- if (r.indexOf(s) >= 0) continue;
167
- t[s] = n[s];
168
- }
169
- return t;
170
- }
171
- function Y(n) {
172
- return !n || n.trim() === "#";
173
- }
174
- const A = /* @__PURE__ */ p.forwardRef((n, r) => {
175
- let {
176
- onKeyDown: t
177
- } = n, s = X(n, Q);
178
- const [o] = j(Object.assign({
179
- tagName: "a"
180
- }, s)), e = H((i) => {
181
- o.onKeyDown(i), t == null || t(i);
182
- });
183
- return Y(s.href) || s.role === "button" ? /* @__PURE__ */ c("a", Object.assign({
184
- ref: r
185
- }, s, o, {
186
- onKeyDown: e
187
- })) : /* @__PURE__ */ c("a", Object.assign({
188
- ref: r
189
- }, s, {
190
- onKeyDown: t
191
- }));
192
- });
193
- A.displayName = "Anchor";
194
- const N = /* @__PURE__ */ p.forwardRef(({
195
- active: n = !1,
196
- disabled: r = !1,
197
- className: t,
198
- style: s,
199
- activeLabel: o = "(current)",
200
- children: e,
201
- linkStyle: i,
202
- linkClassName: u,
203
- as: d = A,
204
- ...f
205
- }, m) => {
206
- const x = n || r ? "span" : d;
207
- return /* @__PURE__ */ c("li", {
208
- ref: m,
209
- style: s,
210
- className: k(t, "page-item", {
211
- active: n,
212
- disabled: r
213
- }),
214
- children: /* @__PURE__ */ B(x, {
215
- className: k("page-link", u),
216
- style: i,
217
- ...f,
218
- children: [e, n && o && /* @__PURE__ */ c("span", {
219
- className: "visually-hidden",
220
- children: o
221
- })]
222
- })
223
- });
224
- });
225
- N.displayName = "PageItem";
226
- function b(n, r, t = n) {
227
- const s = /* @__PURE__ */ p.forwardRef(({
228
- children: o,
229
- ...e
230
- }, i) => /* @__PURE__ */ B(N, {
231
- ...e,
232
- ref: i,
233
- children: [/* @__PURE__ */ c("span", {
234
- "aria-hidden": "true",
235
- children: o || r
236
- }), /* @__PURE__ */ c("span", {
237
- className: "visually-hidden",
238
- children: t
239
- })]
240
- }));
241
- return s.displayName = n, s;
242
- }
243
- const Z = b("First", "«"), z = b("Prev", "‹", "Previous"), nn = b("Ellipsis", "…", "More"), tn = b("Next", "›"), en = b("Last", "»"), D = /* @__PURE__ */ p.forwardRef(({
244
- bsPrefix: n,
245
- className: r,
246
- size: t,
247
- ...s
248
- }, o) => {
249
- const e = V(n, "pagination");
250
- return /* @__PURE__ */ c("ul", {
251
- ref: o,
252
- ...s,
253
- className: k(r, e, t && `${e}-${t}`)
254
- });
255
- });
256
- D.displayName = "Pagination";
257
- const l = Object.assign(D, {
258
- First: Z,
259
- Prev: z,
260
- Ellipsis: nn,
261
- Item: N,
262
- Next: tn,
263
- Last: en
264
- }), dn = ({
265
- dataToPaginate: n = [],
266
- forcePaginationDisplay: r = !1,
267
- maxPageButtonsCount: t = 5,
268
- pageMaxItemCount: s = 10
269
- }) => {
270
- const [o, e] = F(0), i = Math.floor(t / 2), u = o * s, d = u + s, f = (a) => Math.ceil(a.length / s);
271
- return {
272
- firstShownItemIndex: u,
273
- getPageCountForContent: f,
274
- maxShownItemIndexExcluded: d,
275
- PageControls: () => {
276
- const a = f(n);
277
- return !r && a <= 1 ? null : /* @__PURE__ */ B(l, { children: [
278
- /* @__PURE__ */ c(
279
- l.First,
280
- {
281
- disabled: o <= 0,
282
- onClick: () => {
283
- e(0);
284
- }
285
- }
286
- ),
287
- /* @__PURE__ */ c(
288
- l.Prev,
289
- {
290
- disabled: o <= 0,
291
- onClick: () => {
292
- e(o - 1);
293
- }
294
- }
295
- ),
296
- Math.min(o - i, a - t) > 0 ? /* @__PURE__ */ c(l.Ellipsis, { disabled: !0 }) : null,
297
- (() => {
298
- const O = [];
299
- let P = Math.min(Math.max(0, a - t), Math.max(0, o - i)), w = t;
300
- const E = (v, R) => {
301
- O.push(/* @__PURE__ */ c(
302
- l.Item,
303
- {
304
- active: o === v,
305
- onClick: () => {
306
- e(v);
307
- },
308
- children: v + 1
309
- },
310
- t - R
311
- ));
312
- };
313
- for (; w && (E(P, w), ++P, --w, !(P >= a)); )
314
- ;
315
- return O;
316
- })(),
317
- a > Math.max(i, o) + Math.ceil(t / 2) ? /* @__PURE__ */ c(l.Ellipsis, { disabled: !0 }) : null,
318
- /* @__PURE__ */ c(
319
- l.Next,
320
- {
321
- disabled: o + 1 >= a,
322
- onClick: () => {
323
- e(o + 1);
324
- }
325
- }
326
- ),
327
- /* @__PURE__ */ c(
328
- l.Last,
329
- {
330
- disabled: o + 1 >= a,
331
- onClick: () => {
332
- e(a - 1);
333
- }
334
- }
335
- )
336
- ] });
337
- },
338
- pageMaxItemCount: s,
339
- sliceVisibleContent: (a) => Array.isArray(a) ? a.slice(u, d) : a
340
- };
341
- };
342
- export {
343
- A,
344
- J as B,
345
- V as a,
346
- un as b,
347
- k as c,
348
- ln as d,
349
- j as e,
350
- H as f,
351
- fn as g,
352
- dn as u
353
- };