@ea-lab/reactive-json 0.2.2 → 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.
- package/README.md +1 -1
- package/dist/HashChangeListener-D2T1_KYz.js +18075 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/alterData-CjaFWyAA.js +3698 -0
- package/dist/component/action/HashChangeListener.js +1 -1
- package/dist/component/action/MessageListener.js +3 -2
- package/dist/component/action/Popover.js +1 -1
- package/dist/component/action/ReactOnEvent.js +1 -1
- package/dist/component/action/Redirect.js +1 -1
- package/dist/component/action/Tooltip.js +1 -1
- package/dist/component/action/index.js +1 -1
- package/dist/component/dataMapping/index.js +5 -0
- package/dist/component/dataMapping/simpleMapping.js +4 -0
- package/dist/component/dataProcessor/index.js +4 -0
- package/dist/component/element/form/CheckBoxField.js +1 -1
- package/dist/component/element/form/DateField.js +1 -1
- package/dist/component/element/form/NumberField.js +1 -1
- package/dist/component/element/form/SelectField.js +1 -1
- package/dist/component/element/form/TextAreaField.js +1 -1
- package/dist/component/element/form/TextField.js +1 -1
- package/dist/component/element/form/formElementsCommon.js +1 -1
- package/dist/component/element/form/index.js +5 -5
- package/dist/component/element/html/AccordionItem.js +1 -1
- package/dist/component/element/html/FolderSortableTree.js +3 -2
- package/dist/component/element/html/FormatNumeral.js +1 -1
- package/dist/component/element/html/Html.js +3 -3
- package/dist/component/element/html/LabelFromValue.js +1 -1
- package/dist/component/element/html/Modal.js +1 -1
- package/dist/component/element/html/PreformattedMarkup.js +1 -1
- package/dist/component/element/html/SortableTreeItemCollapseButton.js +1 -1
- package/dist/component/element/html/Tabs.js +1 -1
- package/dist/component/element/html/index.js +4 -4
- package/dist/component/element/index.js +4 -4
- package/dist/component/element/special/BootstrapElement.js +1 -1
- package/dist/component/element/special/Count.js +3 -2
- package/dist/component/element/special/DataFilter.js +1 -1
- package/dist/component/element/special/DelayedActions.js +1 -1
- package/dist/component/element/special/Phantom.js +1 -1
- package/dist/component/element/special/ReactiveJsonSubroot.js +3 -2
- package/dist/component/element/special/Switch.js +3 -3
- package/dist/component/element/special/index.js +1 -1
- package/dist/component/hook/index.js +1 -1
- package/dist/component/hook/usePagination.js +1 -1
- package/dist/component/index.js +48 -44
- package/dist/component/reaction/addData.js +3 -2
- package/dist/component/reaction/fetchData.js +1 -1
- package/dist/component/reaction/index.js +4 -4
- package/dist/component/reaction/moveData.js +1 -1
- package/dist/component/reaction/postMessage.js +1 -1
- package/dist/component/reaction/redirectNow.js +1 -1
- package/dist/component/reaction/removeData.js +1 -1
- package/dist/component/reaction/setClipboardData.js +1 -1
- package/dist/component/reaction/setData.js +3 -2
- package/dist/component/reaction/submitData.js +1 -1
- package/dist/component/reaction/utility/httpRequestCommon.js +5 -2
- package/dist/component/reaction/utility/index.js +2 -2
- package/dist/coreComponentsPlugin.js +5 -0
- package/dist/engine/Actions.js +4 -3
- package/dist/engine/ComponentCollector.js +15 -8
- package/dist/engine/ReactiveJsonRoot.js +5 -2
- package/dist/engine/TemplateSystem.js +1 -1
- package/dist/engine/View.js +1 -1
- package/dist/engine/index.js +21 -17
- package/dist/engine/utility/alterData.js +4 -0
- package/dist/engine/utility/analyzeDataOverrideReferences.js +1 -1
- package/dist/engine/utility/dataMappingSystem.js +21 -0
- package/dist/engine/utility/formatString.js +1 -1
- package/dist/engine/utility/index.js +12 -8
- package/dist/main.js +79 -71
- package/dist/{usePagination-D5Fkvhsw.js → usePagination-Bb6lefHG.js} +67 -72
- package/package.json +1 -1
- package/dist/HashChangeListener-CP5gq7tn.js +0 -21572
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c, jsxs as B } from "react/jsx-runtime";
|
|
2
2
|
import * as p from "react";
|
|
3
|
-
import { useContext as
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
15
|
-
function
|
|
16
|
-
return
|
|
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
|
-
}(
|
|
42
|
+
}(C)), C.exports;
|
|
46
43
|
}
|
|
47
|
-
var
|
|
48
|
-
const
|
|
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:
|
|
55
|
-
} =
|
|
51
|
+
Provider: cn
|
|
52
|
+
} = h;
|
|
56
53
|
function V(n, r) {
|
|
57
54
|
const {
|
|
58
55
|
prefixes: t
|
|
59
|
-
} =
|
|
56
|
+
} = y(h);
|
|
60
57
|
return n || t[r] || r;
|
|
61
58
|
}
|
|
62
59
|
function un() {
|
|
63
60
|
const {
|
|
64
61
|
breakpoints: n
|
|
65
|
-
} =
|
|
62
|
+
} = y(h);
|
|
66
63
|
return n;
|
|
67
64
|
}
|
|
68
|
-
function
|
|
65
|
+
function ln() {
|
|
69
66
|
const {
|
|
70
67
|
minBreakpoint: n
|
|
71
|
-
} =
|
|
68
|
+
} = y(h);
|
|
72
69
|
return n;
|
|
73
70
|
}
|
|
74
71
|
function fn() {
|
|
75
72
|
const {
|
|
76
73
|
dir: n
|
|
77
|
-
} =
|
|
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
|
|
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
|
-
},
|
|
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:
|
|
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
|
-
}] =
|
|
152
|
+
}] = j(Object.assign({
|
|
156
153
|
tagName: t,
|
|
157
154
|
disabled: s
|
|
158
155
|
}, o));
|
|
159
|
-
return /* @__PURE__ */
|
|
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] =
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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
|
|
210
|
-
return /* @__PURE__ */
|
|
206
|
+
const x = n || r ? "span" : d;
|
|
207
|
+
return /* @__PURE__ */ c("li", {
|
|
211
208
|
ref: m,
|
|
212
209
|
style: s,
|
|
213
|
-
className:
|
|
210
|
+
className: k(t, "page-item", {
|
|
214
211
|
active: n,
|
|
215
212
|
disabled: r
|
|
216
213
|
}),
|
|
217
|
-
children: /* @__PURE__ */
|
|
218
|
-
className:
|
|
214
|
+
children: /* @__PURE__ */ B(x, {
|
|
215
|
+
className: k("page-link", u),
|
|
219
216
|
style: i,
|
|
220
217
|
...f,
|
|
221
|
-
children: [e, n && o && /* @__PURE__ */
|
|
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
|
-
|
|
229
|
-
function
|
|
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__ */
|
|
230
|
+
}, i) => /* @__PURE__ */ B(N, {
|
|
234
231
|
...e,
|
|
235
232
|
ref: i,
|
|
236
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ c("span", {
|
|
237
234
|
"aria-hidden": "true",
|
|
238
235
|
children: o || r
|
|
239
|
-
}), /* @__PURE__ */
|
|
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 =
|
|
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__ */
|
|
250
|
+
return /* @__PURE__ */ c("ul", {
|
|
254
251
|
ref: o,
|
|
255
252
|
...s,
|
|
256
|
-
className:
|
|
253
|
+
className: k(r, e, t && `${e}-${t}`)
|
|
257
254
|
});
|
|
258
255
|
});
|
|
259
256
|
D.displayName = "Pagination";
|
|
260
|
-
const
|
|
257
|
+
const l = Object.assign(D, {
|
|
261
258
|
First: Z,
|
|
262
259
|
Prev: z,
|
|
263
260
|
Ellipsis: nn,
|
|
264
|
-
Item:
|
|
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] =
|
|
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__ */
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
|
|
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__ */
|
|
291
|
-
|
|
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
|
|
296
|
+
Math.min(o - i, a - t) > 0 ? /* @__PURE__ */ c(l.Ellipsis, { disabled: !0 }) : null,
|
|
300
297
|
(() => {
|
|
301
|
-
const
|
|
302
|
-
let
|
|
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
|
-
|
|
305
|
-
|
|
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 (;
|
|
313
|
+
for (; w && (E(P, w), ++P, --w, !(P >= a)); )
|
|
317
314
|
;
|
|
318
|
-
return
|
|
315
|
+
return O;
|
|
319
316
|
})(),
|
|
320
|
-
a > Math.max(i, o) + Math.ceil(t / 2) ? /* @__PURE__ */ l
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
|
|
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__ */
|
|
331
|
-
|
|
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
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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
|
};
|