@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
@@ -1,19 +1,16 @@
1
- import { jsx as l, jsxs as O } from "react/jsx-runtime";
1
+ import { jsx as c, jsxs as B } from "react/jsx-runtime";
2
2
  import * as p from "react";
3
- import { useContext as P, useRef as I, useEffect as K, useCallback as M, useState as T } from "react";
4
- var on = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
- function F(n) {
6
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
7
- }
8
- var g = { exports: {} };
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: {} };
9
6
  /*!
10
7
  Copyright (c) 2018 Jed Watson.
11
8
  Licensed under the MIT License (MIT), see
12
9
  http://jedwatson.github.io/classnames
13
10
  */
14
- var B;
15
- function L() {
16
- return B || (B = 1, function(n) {
11
+ var g;
12
+ function S() {
13
+ return g || (g = 1, function(n) {
17
14
  (function() {
18
15
  var r = {}.hasOwnProperty;
19
16
  function t() {
@@ -42,39 +39,39 @@ function L() {
42
39
  }
43
40
  n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
44
41
  })();
45
- }(g)), g.exports;
42
+ }(C)), C.exports;
46
43
  }
47
- var S = L();
48
- const C = /* @__PURE__ */ F(S), _ = ["xxl", "xl", "lg", "md", "sm", "xs"], $ = "xs", b = /* @__PURE__ */ p.createContext({
44
+ var T = S();
45
+ const k = /* @__PURE__ */ L(T), $ = ["xxl", "xl", "lg", "md", "sm", "xs"], _ = "xs", h = /* @__PURE__ */ p.createContext({
49
46
  prefixes: {},
50
- breakpoints: _,
51
- minBreakpoint: $
47
+ breakpoints: $,
48
+ minBreakpoint: _
52
49
  }), {
53
50
  Consumer: an,
54
- Provider: ln
55
- } = b;
51
+ Provider: cn
52
+ } = h;
56
53
  function V(n, r) {
57
54
  const {
58
55
  prefixes: t
59
- } = P(b);
56
+ } = y(h);
60
57
  return n || t[r] || r;
61
58
  }
62
59
  function un() {
63
60
  const {
64
61
  breakpoints: n
65
- } = P(b);
62
+ } = y(h);
66
63
  return n;
67
64
  }
68
- function cn() {
65
+ function ln() {
69
66
  const {
70
67
  minBreakpoint: n
71
- } = P(b);
68
+ } = y(h);
72
69
  return n;
73
70
  }
74
71
  function fn() {
75
72
  const {
76
73
  dir: n
77
- } = P(b);
74
+ } = y(h);
78
75
  return n === "rtl";
79
76
  }
80
77
  function q(n) {
@@ -102,7 +99,7 @@ function W(n, r) {
102
99
  function G(n) {
103
100
  return !n || n.trim() === "#";
104
101
  }
105
- function N({
102
+ function j({
106
103
  tagName: n,
107
104
  disabled: r,
108
105
  href: t,
@@ -128,7 +125,7 @@ function N({
128
125
  return;
129
126
  }
130
127
  i == null || i(a);
131
- }, y = (a) => {
128
+ }, x = (a) => {
132
129
  a.key === " " && (a.preventDefault(), m(a));
133
130
  };
134
131
  return n === "a" && (t || (t = "#"), r && (t = void 0)), [{
@@ -142,7 +139,7 @@ function N({
142
139
  "aria-disabled": r || void 0,
143
140
  rel: n === "a" ? o : void 0,
144
141
  onClick: m,
145
- onKeyDown: y
142
+ onKeyDown: x
146
143
  }, f];
147
144
  }
148
145
  const J = /* @__PURE__ */ p.forwardRef((n, r) => {
@@ -152,11 +149,11 @@ const J = /* @__PURE__ */ p.forwardRef((n, r) => {
152
149
  } = n, o = W(n, U);
153
150
  const [e, {
154
151
  tagName: i
155
- }] = N(Object.assign({
152
+ }] = j(Object.assign({
156
153
  tagName: t,
157
154
  disabled: s
158
155
  }, o));
159
- return /* @__PURE__ */ l(i, Object.assign({}, o, e, {
156
+ return /* @__PURE__ */ c(i, Object.assign({}, o, e, {
160
157
  ref: r
161
158
  }));
162
159
  });
@@ -178,23 +175,23 @@ const A = /* @__PURE__ */ p.forwardRef((n, r) => {
178
175
  let {
179
176
  onKeyDown: t
180
177
  } = n, s = X(n, Q);
181
- const [o] = N(Object.assign({
178
+ const [o] = j(Object.assign({
182
179
  tagName: "a"
183
180
  }, s)), e = H((i) => {
184
181
  o.onKeyDown(i), t == null || t(i);
185
182
  });
186
- return Y(s.href) || s.role === "button" ? /* @__PURE__ */ l("a", Object.assign({
183
+ return Y(s.href) || s.role === "button" ? /* @__PURE__ */ c("a", Object.assign({
187
184
  ref: r
188
185
  }, s, o, {
189
186
  onKeyDown: e
190
- })) : /* @__PURE__ */ l("a", Object.assign({
187
+ })) : /* @__PURE__ */ c("a", Object.assign({
191
188
  ref: r
192
189
  }, s, {
193
190
  onKeyDown: t
194
191
  }));
195
192
  });
196
193
  A.displayName = "Anchor";
197
- const j = /* @__PURE__ */ p.forwardRef(({
194
+ const N = /* @__PURE__ */ p.forwardRef(({
198
195
  active: n = !1,
199
196
  disabled: r = !1,
200
197
  className: t,
@@ -206,62 +203,62 @@ const j = /* @__PURE__ */ p.forwardRef(({
206
203
  as: d = A,
207
204
  ...f
208
205
  }, m) => {
209
- const y = n || r ? "span" : d;
210
- return /* @__PURE__ */ l("li", {
206
+ const x = n || r ? "span" : d;
207
+ return /* @__PURE__ */ c("li", {
211
208
  ref: m,
212
209
  style: s,
213
- className: C(t, "page-item", {
210
+ className: k(t, "page-item", {
214
211
  active: n,
215
212
  disabled: r
216
213
  }),
217
- children: /* @__PURE__ */ O(y, {
218
- className: C("page-link", u),
214
+ children: /* @__PURE__ */ B(x, {
215
+ className: k("page-link", u),
219
216
  style: i,
220
217
  ...f,
221
- children: [e, n && o && /* @__PURE__ */ l("span", {
218
+ children: [e, n && o && /* @__PURE__ */ c("span", {
222
219
  className: "visually-hidden",
223
220
  children: o
224
221
  })]
225
222
  })
226
223
  });
227
224
  });
228
- j.displayName = "PageItem";
229
- function h(n, r, t = n) {
225
+ N.displayName = "PageItem";
226
+ function b(n, r, t = n) {
230
227
  const s = /* @__PURE__ */ p.forwardRef(({
231
228
  children: o,
232
229
  ...e
233
- }, i) => /* @__PURE__ */ O(j, {
230
+ }, i) => /* @__PURE__ */ B(N, {
234
231
  ...e,
235
232
  ref: i,
236
- children: [/* @__PURE__ */ l("span", {
233
+ children: [/* @__PURE__ */ c("span", {
237
234
  "aria-hidden": "true",
238
235
  children: o || r
239
- }), /* @__PURE__ */ l("span", {
236
+ }), /* @__PURE__ */ c("span", {
240
237
  className: "visually-hidden",
241
238
  children: t
242
239
  })]
243
240
  }));
244
241
  return s.displayName = n, s;
245
242
  }
246
- const Z = h("First", "«"), z = h("Prev", "‹", "Previous"), nn = h("Ellipsis", "…", "More"), tn = h("Next", "›"), en = h("Last", "»"), D = /* @__PURE__ */ p.forwardRef(({
243
+ const Z = b("First", "«"), z = b("Prev", "‹", "Previous"), nn = b("Ellipsis", "…", "More"), tn = b("Next", "›"), en = b("Last", "»"), D = /* @__PURE__ */ p.forwardRef(({
247
244
  bsPrefix: n,
248
245
  className: r,
249
246
  size: t,
250
247
  ...s
251
248
  }, o) => {
252
249
  const e = V(n, "pagination");
253
- return /* @__PURE__ */ l("ul", {
250
+ return /* @__PURE__ */ c("ul", {
254
251
  ref: o,
255
252
  ...s,
256
- className: C(r, e, t && `${e}-${t}`)
253
+ className: k(r, e, t && `${e}-${t}`)
257
254
  });
258
255
  });
259
256
  D.displayName = "Pagination";
260
- const c = Object.assign(D, {
257
+ const l = Object.assign(D, {
261
258
  First: Z,
262
259
  Prev: z,
263
260
  Ellipsis: nn,
264
- Item: j,
261
+ Item: N,
265
262
  Next: tn,
266
263
  Last: en
267
264
  }), dn = ({
@@ -270,16 +267,16 @@ const c = Object.assign(D, {
270
267
  maxPageButtonsCount: t = 5,
271
268
  pageMaxItemCount: s = 10
272
269
  }) => {
273
- const [o, e] = T(0), i = Math.floor(t / 2), u = o * s, d = u + s, f = (a) => Math.ceil(a.length / s);
270
+ const [o, e] = F(0), i = Math.floor(t / 2), u = o * s, d = u + s, f = (a) => Math.ceil(a.length / s);
274
271
  return {
275
272
  firstShownItemIndex: u,
276
273
  getPageCountForContent: f,
277
274
  maxShownItemIndexExcluded: d,
278
275
  PageControls: () => {
279
276
  const a = f(n);
280
- return !r && a <= 1 ? null : /* @__PURE__ */ O(c, { children: [
281
- /* @__PURE__ */ l(
282
- c.First,
277
+ return !r && a <= 1 ? null : /* @__PURE__ */ B(l, { children: [
278
+ /* @__PURE__ */ c(
279
+ l.First,
283
280
  {
284
281
  disabled: o <= 0,
285
282
  onClick: () => {
@@ -287,8 +284,8 @@ const c = Object.assign(D, {
287
284
  }
288
285
  }
289
286
  ),
290
- /* @__PURE__ */ l(
291
- c.Prev,
287
+ /* @__PURE__ */ c(
288
+ l.Prev,
292
289
  {
293
290
  disabled: o <= 0,
294
291
  onClick: () => {
@@ -296,13 +293,13 @@ const c = Object.assign(D, {
296
293
  }
297
294
  }
298
295
  ),
299
- Math.min(o - i, a - t) > 0 ? /* @__PURE__ */ l(c.Ellipsis, { disabled: !0 }) : null,
296
+ Math.min(o - i, a - t) > 0 ? /* @__PURE__ */ c(l.Ellipsis, { disabled: !0 }) : null,
300
297
  (() => {
301
- const k = [];
302
- let w = Math.min(Math.max(0, a - t), Math.max(0, o - i)), x = t;
298
+ const O = [];
299
+ let P = Math.min(Math.max(0, a - t), Math.max(0, o - i)), w = t;
303
300
  const E = (v, R) => {
304
- k.push(/* @__PURE__ */ l(
305
- c.Item,
301
+ O.push(/* @__PURE__ */ c(
302
+ l.Item,
306
303
  {
307
304
  active: o === v,
308
305
  onClick: () => {
@@ -313,13 +310,13 @@ const c = Object.assign(D, {
313
310
  t - R
314
311
  ));
315
312
  };
316
- for (; x && (E(w, x), ++w, --x, !(w >= a)); )
313
+ for (; w && (E(P, w), ++P, --w, !(P >= a)); )
317
314
  ;
318
- return k;
315
+ return O;
319
316
  })(),
320
- a > Math.max(i, o) + Math.ceil(t / 2) ? /* @__PURE__ */ l(c.Ellipsis, { disabled: !0 }) : null,
321
- /* @__PURE__ */ l(
322
- c.Next,
317
+ a > Math.max(i, o) + Math.ceil(t / 2) ? /* @__PURE__ */ c(l.Ellipsis, { disabled: !0 }) : null,
318
+ /* @__PURE__ */ c(
319
+ l.Next,
323
320
  {
324
321
  disabled: o + 1 >= a,
325
322
  onClick: () => {
@@ -327,8 +324,8 @@ const c = Object.assign(D, {
327
324
  }
328
325
  }
329
326
  ),
330
- /* @__PURE__ */ l(
331
- c.Last,
327
+ /* @__PURE__ */ c(
328
+ l.Last,
332
329
  {
333
330
  disabled: o + 1 >= a,
334
331
  onClick: () => {
@@ -347,12 +344,10 @@ export {
347
344
  J as B,
348
345
  V as a,
349
346
  un as b,
350
- C as c,
351
- cn as d,
352
- on as e,
353
- N as f,
354
- F as g,
355
- H as h,
356
- fn as i,
347
+ k as c,
348
+ ln as d,
349
+ j as e,
350
+ H as f,
351
+ fn as g,
357
352
  dn as u
358
353
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ea-lab/reactive-json",
3
3
  "private": false,
4
- "version": "0.2.1",
4
+ "version": "0.3.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",