@ea-lab/reactive-json 0.0.22 → 0.0.24
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-DfQ_3Guk.js +20012 -0
- package/dist/NumberField-BCFUb50M.js +1129 -0
- package/dist/ThemeProvider-BTKQI5kV.js +88 -0
- package/dist/component/action/HashChangeListener.js +9 -0
- package/dist/component/action/Hide.js +4 -0
- package/dist/component/action/MessageListener.js +9 -0
- package/dist/component/action/Popover.js +6 -0
- package/dist/component/action/ReactOnEvent.js +10 -0
- package/dist/component/action/Redirect.js +7 -0
- package/dist/component/action/Tooltip.js +5 -0
- package/dist/component/action/VisuallyHide.js +5 -0
- package/dist/component/action/index.js +14 -0
- package/dist/component/element/form/CheckBoxField.js +9 -0
- package/dist/component/element/form/DateField.js +9 -0
- package/dist/component/element/form/NumberField.js +7 -0
- package/dist/component/element/form/SelectField.js +9 -0
- package/dist/component/element/form/TextAreaField.js +9 -0
- package/dist/component/element/form/TextField.js +9 -0
- package/dist/component/element/form/formElementsCommon.js +4 -0
- package/dist/component/element/form/index.js +11 -0
- package/dist/component/element/html/AccordionItem.js +6 -0
- package/dist/component/element/html/FolderSortableTree.js +8 -0
- package/dist/component/element/html/FormatNumeral.js +8 -0
- package/dist/component/element/html/Html.js +9 -0
- package/dist/component/element/html/LabelFromValue.js +8 -0
- package/dist/component/element/html/Modal.js +8 -0
- package/dist/component/element/html/PreformattedMarkup.js +8 -0
- package/dist/component/element/html/SortableTreeItemCollapseButton.js +7 -0
- package/dist/component/element/html/Tabs.js +8 -0
- package/dist/component/element/html/index.js +13 -0
- package/dist/component/element/index.js +30 -0
- package/dist/component/element/special/BootstrapElement.js +5 -0
- package/dist/component/element/special/Count.js +7 -0
- package/dist/component/element/special/DataFilter.js +8 -0
- package/dist/component/element/special/DelayedActions.js +9 -0
- package/dist/component/element/special/PageControls.js +10 -0
- package/dist/component/element/special/Phantom.js +5 -0
- package/dist/component/element/special/Switch.js +10 -0
- package/dist/component/element/special/index.js +12 -0
- package/dist/component/hook/index.js +4 -0
- package/dist/component/hook/usePagination.js +6 -0
- package/dist/component/index.js +54 -0
- package/dist/component/reaction/addData.js +4 -0
- package/dist/component/reaction/fetchData.js +4 -0
- package/dist/component/reaction/index.js +14 -0
- package/dist/component/reaction/moveData.js +4 -0
- package/dist/component/reaction/postMessage.js +4 -0
- package/dist/component/reaction/redirectNow.js +4 -0
- package/dist/component/reaction/removeData.js +4 -0
- package/dist/component/reaction/setClipboardData.js +4 -0
- package/dist/component/reaction/setData.js +4 -0
- package/dist/component/reaction/submitData.js +4 -0
- package/dist/component/reaction/triggerEvent.js +28 -0
- package/dist/engine/Actions.js +11 -0
- package/dist/engine/ComponentCollector.js +19 -0
- package/dist/engine/EventDispatcherContext.js +8 -0
- package/dist/engine/EventDispatcherProvider.js +20 -0
- package/dist/engine/GlobalDataContext.js +5 -0
- package/dist/engine/GlobalDataContextProvider.js +9 -0
- package/dist/engine/PaginationContext.js +5 -0
- package/dist/engine/PaginationProvider.js +30 -0
- package/dist/engine/ReactiveJsonRoot.js +1125 -0
- package/dist/engine/TemplateContext.js +5 -0
- package/dist/engine/TemplateSystem.js +13 -0
- package/dist/engine/View.js +10 -0
- package/dist/engine/index.js +32 -0
- package/dist/engine/utility/formatString.js +5 -0
- package/dist/engine/utility/stringToBoolean.js +26 -0
- package/dist/main.js +83 -0
- package/dist/usePagination-B0yFkBzE.js +276 -0
- package/package.json +41 -40
- package/dist/esm/types/component/action/HashChangeListener.d.ts +0 -9
- package/dist/esm/types/component/action/Hide.d.ts +0 -10
- package/dist/esm/types/component/action/MessageListener.d.ts +0 -9
- package/dist/esm/types/component/action/Popover.d.ts +0 -5
- package/dist/esm/types/component/action/ReactOnEvent.d.ts +0 -26
- package/dist/esm/types/component/action/Redirect.d.ts +0 -9
- package/dist/esm/types/component/action/Tooltip.d.ts +0 -5
- package/dist/esm/types/component/action/VisuallyHide.d.ts +0 -12
- package/dist/esm/types/component/element/form/CheckBoxField.d.ts +0 -7
- package/dist/esm/types/component/element/form/DateField.d.ts +0 -2
- package/dist/esm/types/component/element/form/NumberField.d.ts +0 -7
- package/dist/esm/types/component/element/form/SelectField.d.ts +0 -7
- package/dist/esm/types/component/element/form/TextAreaField.d.ts +0 -6
- package/dist/esm/types/component/element/form/TextField.d.ts +0 -6
- package/dist/esm/types/component/element/form/formElementsCommon.d.ts +0 -23
- package/dist/esm/types/component/element/html/AccordionItem.d.ts +0 -16
- package/dist/esm/types/component/element/html/FolderSortableTree.d.ts +0 -6
- package/dist/esm/types/component/element/html/FormatNumeral.d.ts +0 -7
- package/dist/esm/types/component/element/html/Html.d.ts +0 -8
- package/dist/esm/types/component/element/html/LabelFromValue.d.ts +0 -22
- package/dist/esm/types/component/element/html/Modal.d.ts +0 -6
- package/dist/esm/types/component/element/html/ModalForm.d.ts +0 -9
- package/dist/esm/types/component/element/html/Paragraph.d.ts +0 -5
- package/dist/esm/types/component/element/html/PreformattedMarkup.d.ts +0 -7
- package/dist/esm/types/component/element/html/SortableTreeItemCollapseButton.d.ts +0 -9
- package/dist/esm/types/component/element/html/Tabs.d.ts +0 -18
- package/dist/esm/types/component/element/special/BootstrapElement.d.ts +0 -10
- package/dist/esm/types/component/element/special/Count.d.ts +0 -13
- package/dist/esm/types/component/element/special/DataFilter.d.ts +0 -11
- package/dist/esm/types/component/element/special/DelayedActions.d.ts +0 -25
- package/dist/esm/types/component/element/special/PageControls.d.ts +0 -9
- package/dist/esm/types/component/element/special/Phantom.d.ts +0 -17
- package/dist/esm/types/component/element/special/Switch.d.ts +0 -6
- package/dist/esm/types/component/hook/usePagination.d.ts +0 -30
- package/dist/esm/types/component/index.d.ts +0 -5
- package/dist/esm/types/component/reaction/addData.d.ts +0 -6
- package/dist/esm/types/component/reaction/fetchData.d.ts +0 -8
- package/dist/esm/types/component/reaction/moveData.d.ts +0 -6
- package/dist/esm/types/component/reaction/postMessage.d.ts +0 -6
- package/dist/esm/types/component/reaction/redirectNow.d.ts +0 -6
- package/dist/esm/types/component/reaction/removeData.d.ts +0 -6
- package/dist/esm/types/component/reaction/setClipboardData.d.ts +0 -6
- package/dist/esm/types/component/reaction/setData.d.ts +0 -6
- package/dist/esm/types/component/reaction/submitData.d.ts +0 -8
- package/dist/esm/types/component/reaction/triggerEvent.d.ts +0 -6
- package/dist/esm/types/component/utility/formatString.d.ts +0 -17
- package/dist/esm/types/engine/Actions.d.ts +0 -19
- package/dist/esm/types/engine/ComponentCollector.d.ts +0 -12
- package/dist/esm/types/engine/EventDispatcherContext.d.ts +0 -13
- package/dist/esm/types/engine/EventDispatcherProvider.d.ts +0 -16
- package/dist/esm/types/engine/GlobalDataContext.d.ts +0 -10
- package/dist/esm/types/engine/GlobalDataContextProvider.d.ts +0 -11
- package/dist/esm/types/engine/PaginationContext.d.ts +0 -9
- package/dist/esm/types/engine/PaginationProvider.d.ts +0 -12
- package/dist/esm/types/engine/ReactiveJsonRoot.d.ts +0 -28
- package/dist/esm/types/engine/TemplateContext.d.ts +0 -10
- package/dist/esm/types/engine/TemplateSystem.d.ts +0 -89
- package/dist/esm/types/engine/View.d.ts +0 -7
- package/dist/esm/types/index.d.ts +0 -6
- package/dist/esm/types/main.d.ts +0 -10
- package/dist/index.cjs.js +0 -9201
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -44
- package/dist/index.esm.js +0 -9180
- package/dist/index.esm.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import "./GlobalDataContext.js";
|
|
3
|
+
import "./TemplateContext.js";
|
|
4
|
+
import { J as u, _ as o, K as i, N as m, O as p, Q as r, U as v } from "../HashChangeListener-DfQ_3Guk.js";
|
|
5
|
+
export {
|
|
6
|
+
u as dataLocationToPath,
|
|
7
|
+
o as default,
|
|
8
|
+
i as evaluateAttributes,
|
|
9
|
+
m as evaluateTemplateValue,
|
|
10
|
+
p as evaluateTemplateValueCollection,
|
|
11
|
+
r as isTemplateValue,
|
|
12
|
+
v as useEvaluatedAttributes
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { V as a } from "../HashChangeListener-DfQ_3Guk.js";
|
|
4
|
+
import "../NumberField-BCFUb50M.js";
|
|
5
|
+
import "../component/element/special/PageControls.js";
|
|
6
|
+
import "./GlobalDataContext.js";
|
|
7
|
+
import "./TemplateContext.js";
|
|
8
|
+
export {
|
|
9
|
+
a as View
|
|
10
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { I as o, V as a, J as r, K as n, N as i, O as l, Q as s, G as p, U as m } from "../HashChangeListener-DfQ_3Guk.js";
|
|
2
|
+
import { mergeComponentCollections as v } from "./ComponentCollector.js";
|
|
3
|
+
import { EventDispatcherContext as u } from "./EventDispatcherContext.js";
|
|
4
|
+
import { EventDispatcherProvider as C, addEventListener as c, removeEventListener as P } from "./EventDispatcherProvider.js";
|
|
5
|
+
import { GlobalDataContext as D } from "./GlobalDataContext.js";
|
|
6
|
+
import { GlobalDataContextProvider as T } from "./GlobalDataContextProvider.js";
|
|
7
|
+
import { PaginationContext as g } from "./PaginationContext.js";
|
|
8
|
+
import { PaginationProvider as A } from "./PaginationProvider.js";
|
|
9
|
+
import { ReactiveJsonRoot as L } from "./ReactiveJsonRoot.js";
|
|
10
|
+
import { TemplateContext as R } from "./TemplateContext.js";
|
|
11
|
+
export {
|
|
12
|
+
o as ActionDependant,
|
|
13
|
+
u as EventDispatcherContext,
|
|
14
|
+
C as EventDispatcherProvider,
|
|
15
|
+
D as GlobalDataContext,
|
|
16
|
+
T as GlobalDataContextProvider,
|
|
17
|
+
g as PaginationContext,
|
|
18
|
+
A as PaginationProvider,
|
|
19
|
+
L as ReactiveJsonRoot,
|
|
20
|
+
R as TemplateContext,
|
|
21
|
+
a as View,
|
|
22
|
+
c as addEventListener,
|
|
23
|
+
r as dataLocationToPath,
|
|
24
|
+
n as evaluateAttributes,
|
|
25
|
+
i as evaluateTemplateValue,
|
|
26
|
+
l as evaluateTemplateValueCollection,
|
|
27
|
+
s as isTemplateValue,
|
|
28
|
+
p as isValid,
|
|
29
|
+
v as mergeComponentCollections,
|
|
30
|
+
P as removeEventListener,
|
|
31
|
+
m as useEvaluatedAttributes
|
|
32
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function f(e) {
|
|
2
|
+
var o;
|
|
3
|
+
if (!e)
|
|
4
|
+
return !1;
|
|
5
|
+
if (typeof e == "boolean")
|
|
6
|
+
return e;
|
|
7
|
+
if (typeof e != "string")
|
|
8
|
+
return !0;
|
|
9
|
+
switch ((o = e == null ? void 0 : e.toLowerCase()) == null ? void 0 : o.trim()) {
|
|
10
|
+
case "true":
|
|
11
|
+
case "yes":
|
|
12
|
+
case "1":
|
|
13
|
+
return !0;
|
|
14
|
+
case "false":
|
|
15
|
+
case "no":
|
|
16
|
+
case "0":
|
|
17
|
+
case "null":
|
|
18
|
+
case "undefined":
|
|
19
|
+
return !1;
|
|
20
|
+
default:
|
|
21
|
+
return e.length > 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
f as stringToBoolean
|
|
26
|
+
};
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { A as t, I 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 x, e as u, L as c, M as f, f as v, o as D, P as C, g as F, R as T, a as b, S as P, h as g, q as h, i as E, b as A, c as V, T as L, V as R, s as H, J as M, K as N, N as S, O as w, t as B, m as k, Q as y, G, u as I, n as J, v as z, p as O, r as j, w as q, x as K, y as Q, z as U, E as W, U as X } from "./HashChangeListener-DfQ_3Guk.js";
|
|
2
|
+
import { Hide as Z } from "./component/action/Hide.js";
|
|
3
|
+
import { VisuallyHide as $ } from "./component/action/VisuallyHide.js";
|
|
4
|
+
import { N as ae } from "./NumberField-BCFUb50M.js";
|
|
5
|
+
import { PageControls as oe } from "./component/element/special/PageControls.js";
|
|
6
|
+
import { u as re } from "./usePagination-B0yFkBzE.js";
|
|
7
|
+
import { triggerEvent as ne } from "./component/reaction/triggerEvent.js";
|
|
8
|
+
import { mergeComponentCollections as me } from "./engine/ComponentCollector.js";
|
|
9
|
+
import { EventDispatcherContext as de } from "./engine/EventDispatcherContext.js";
|
|
10
|
+
import { EventDispatcherProvider as ue, addEventListener as ce, removeEventListener as fe } from "./engine/EventDispatcherProvider.js";
|
|
11
|
+
import { GlobalDataContext as De } from "./engine/GlobalDataContext.js";
|
|
12
|
+
import { GlobalDataContextProvider as Fe } from "./engine/GlobalDataContextProvider.js";
|
|
13
|
+
import { PaginationContext as be } from "./engine/PaginationContext.js";
|
|
14
|
+
import { PaginationProvider as ge } from "./engine/PaginationProvider.js";
|
|
15
|
+
import { ReactiveJsonRoot as Ee } from "./engine/ReactiveJsonRoot.js";
|
|
16
|
+
import { TemplateContext as Ve } from "./engine/TemplateContext.js";
|
|
17
|
+
export {
|
|
18
|
+
t as AccordionItem,
|
|
19
|
+
o as ActionDependant,
|
|
20
|
+
s as BootstrapElement,
|
|
21
|
+
r as CheckBoxField,
|
|
22
|
+
i as Count,
|
|
23
|
+
n as DataFilter,
|
|
24
|
+
l as DateField,
|
|
25
|
+
m as DelayedActions,
|
|
26
|
+
de as EventDispatcherContext,
|
|
27
|
+
ue as EventDispatcherProvider,
|
|
28
|
+
p as FolderSortableTree,
|
|
29
|
+
d as FormatNumeral,
|
|
30
|
+
De as GlobalDataContext,
|
|
31
|
+
Fe as GlobalDataContextProvider,
|
|
32
|
+
x as HashChangeListener,
|
|
33
|
+
Z as Hide,
|
|
34
|
+
u as Html,
|
|
35
|
+
c as LabelFromValue,
|
|
36
|
+
f as MessageListener,
|
|
37
|
+
v as Modal,
|
|
38
|
+
ae as NumberField,
|
|
39
|
+
oe as PageControls,
|
|
40
|
+
be as PaginationContext,
|
|
41
|
+
ge as PaginationProvider,
|
|
42
|
+
D as Phantom,
|
|
43
|
+
C as Popover,
|
|
44
|
+
F as PreformattedMarkup,
|
|
45
|
+
T as ReactOnEvent,
|
|
46
|
+
Ee as ReactiveJsonRoot,
|
|
47
|
+
b as Redirect,
|
|
48
|
+
P as SelectField,
|
|
49
|
+
g as SortableTreeItemCollapseButton,
|
|
50
|
+
h as Switch,
|
|
51
|
+
E as Tabs,
|
|
52
|
+
Ve as TemplateContext,
|
|
53
|
+
A as TextAreaField,
|
|
54
|
+
V as TextField,
|
|
55
|
+
L as Tooltip,
|
|
56
|
+
R as View,
|
|
57
|
+
$ as VisuallyHide,
|
|
58
|
+
H as addData,
|
|
59
|
+
ce as addEventListener,
|
|
60
|
+
M as dataLocationToPath,
|
|
61
|
+
N as evaluateAttributes,
|
|
62
|
+
S as evaluateTemplateValue,
|
|
63
|
+
w as evaluateTemplateValueCollection,
|
|
64
|
+
B as fetchData,
|
|
65
|
+
k as getReactionFunctionsToExecute,
|
|
66
|
+
y as isTemplateValue,
|
|
67
|
+
G as isValid,
|
|
68
|
+
me as mergeComponentCollections,
|
|
69
|
+
I as moveData,
|
|
70
|
+
J as normalizeAttributesForReactJsx,
|
|
71
|
+
z as postMessage,
|
|
72
|
+
O as propsDataLocationToPathAndValue,
|
|
73
|
+
j as reactionFunctions,
|
|
74
|
+
q as redirectNow,
|
|
75
|
+
K as removeData,
|
|
76
|
+
fe as removeEventListener,
|
|
77
|
+
Q as setClipboardData,
|
|
78
|
+
U as setData,
|
|
79
|
+
W as submitData,
|
|
80
|
+
ne as triggerEvent,
|
|
81
|
+
X as useEvaluatedAttributes,
|
|
82
|
+
re as usePagination
|
|
83
|
+
};
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { jsx as l, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { useRef as K, useEffect as R, useCallback as A, useState as B } from "react";
|
|
4
|
+
import { c as g, u as E } from "./ThemeProvider-BTKQI5kV.js";
|
|
5
|
+
function M(n) {
|
|
6
|
+
const t = K(n);
|
|
7
|
+
return R(() => {
|
|
8
|
+
t.current = n;
|
|
9
|
+
}, [n]), t;
|
|
10
|
+
}
|
|
11
|
+
function I(n) {
|
|
12
|
+
const t = M(n);
|
|
13
|
+
return A(function(...e) {
|
|
14
|
+
return t.current && t.current(...e);
|
|
15
|
+
}, [t]);
|
|
16
|
+
}
|
|
17
|
+
const $ = ["as", "disabled"];
|
|
18
|
+
function F(n, t) {
|
|
19
|
+
if (n == null) return {};
|
|
20
|
+
var e = {};
|
|
21
|
+
for (var r in n) if ({}.hasOwnProperty.call(n, r)) {
|
|
22
|
+
if (t.indexOf(r) >= 0) continue;
|
|
23
|
+
e[r] = n[r];
|
|
24
|
+
}
|
|
25
|
+
return e;
|
|
26
|
+
}
|
|
27
|
+
function L(n) {
|
|
28
|
+
return !n || n.trim() === "#";
|
|
29
|
+
}
|
|
30
|
+
function C({
|
|
31
|
+
tagName: n,
|
|
32
|
+
disabled: t,
|
|
33
|
+
href: e,
|
|
34
|
+
target: r,
|
|
35
|
+
rel: s,
|
|
36
|
+
role: o,
|
|
37
|
+
onClick: a,
|
|
38
|
+
tabIndex: u = 0,
|
|
39
|
+
type: d
|
|
40
|
+
}) {
|
|
41
|
+
n || (e != null || r != null || s != null ? n = "a" : n = "button");
|
|
42
|
+
const f = {
|
|
43
|
+
tagName: n
|
|
44
|
+
};
|
|
45
|
+
if (n === "button")
|
|
46
|
+
return [{
|
|
47
|
+
type: d || "button",
|
|
48
|
+
disabled: t
|
|
49
|
+
}, f];
|
|
50
|
+
const p = (i) => {
|
|
51
|
+
if ((t || n === "a" && L(e)) && i.preventDefault(), t) {
|
|
52
|
+
i.stopPropagation();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
a == null || a(i);
|
|
56
|
+
}, b = (i) => {
|
|
57
|
+
i.key === " " && (i.preventDefault(), p(i));
|
|
58
|
+
};
|
|
59
|
+
return n === "a" && (e || (e = "#"), t && (e = void 0)), [{
|
|
60
|
+
role: o ?? "button",
|
|
61
|
+
// explicitly undefined so that it overrides the props disabled in a spread
|
|
62
|
+
// e.g. <Tag {...props} {...hookProps} />
|
|
63
|
+
disabled: void 0,
|
|
64
|
+
tabIndex: t ? void 0 : u,
|
|
65
|
+
href: e,
|
|
66
|
+
target: n === "a" ? r : void 0,
|
|
67
|
+
"aria-disabled": t || void 0,
|
|
68
|
+
rel: n === "a" ? s : void 0,
|
|
69
|
+
onClick: p,
|
|
70
|
+
onKeyDown: b
|
|
71
|
+
}, f];
|
|
72
|
+
}
|
|
73
|
+
const H = /* @__PURE__ */ m.forwardRef((n, t) => {
|
|
74
|
+
let {
|
|
75
|
+
as: e,
|
|
76
|
+
disabled: r
|
|
77
|
+
} = n, s = F(n, $);
|
|
78
|
+
const [o, {
|
|
79
|
+
tagName: a
|
|
80
|
+
}] = C(Object.assign({
|
|
81
|
+
tagName: e,
|
|
82
|
+
disabled: r
|
|
83
|
+
}, s));
|
|
84
|
+
return /* @__PURE__ */ l(a, Object.assign({}, s, o, {
|
|
85
|
+
ref: t
|
|
86
|
+
}));
|
|
87
|
+
});
|
|
88
|
+
H.displayName = "Button";
|
|
89
|
+
const V = ["onKeyDown"];
|
|
90
|
+
function W(n, t) {
|
|
91
|
+
if (n == null) return {};
|
|
92
|
+
var e = {};
|
|
93
|
+
for (var r in n) if ({}.hasOwnProperty.call(n, r)) {
|
|
94
|
+
if (t.indexOf(r) >= 0) continue;
|
|
95
|
+
e[r] = n[r];
|
|
96
|
+
}
|
|
97
|
+
return e;
|
|
98
|
+
}
|
|
99
|
+
function _(n) {
|
|
100
|
+
return !n || n.trim() === "#";
|
|
101
|
+
}
|
|
102
|
+
const j = /* @__PURE__ */ m.forwardRef((n, t) => {
|
|
103
|
+
let {
|
|
104
|
+
onKeyDown: e
|
|
105
|
+
} = n, r = W(n, V);
|
|
106
|
+
const [s] = C(Object.assign({
|
|
107
|
+
tagName: "a"
|
|
108
|
+
}, r)), o = I((a) => {
|
|
109
|
+
s.onKeyDown(a), e == null || e(a);
|
|
110
|
+
});
|
|
111
|
+
return _(r.href) || r.role === "button" ? /* @__PURE__ */ l("a", Object.assign({
|
|
112
|
+
ref: t
|
|
113
|
+
}, r, s, {
|
|
114
|
+
onKeyDown: o
|
|
115
|
+
})) : /* @__PURE__ */ l("a", Object.assign({
|
|
116
|
+
ref: t
|
|
117
|
+
}, r, {
|
|
118
|
+
onKeyDown: e
|
|
119
|
+
}));
|
|
120
|
+
});
|
|
121
|
+
j.displayName = "Anchor";
|
|
122
|
+
const k = /* @__PURE__ */ m.forwardRef(({
|
|
123
|
+
active: n = !1,
|
|
124
|
+
disabled: t = !1,
|
|
125
|
+
className: e,
|
|
126
|
+
style: r,
|
|
127
|
+
activeLabel: s = "(current)",
|
|
128
|
+
children: o,
|
|
129
|
+
linkStyle: a,
|
|
130
|
+
linkClassName: u,
|
|
131
|
+
as: d = j,
|
|
132
|
+
...f
|
|
133
|
+
}, p) => {
|
|
134
|
+
const b = n || t ? "span" : d;
|
|
135
|
+
return /* @__PURE__ */ l("li", {
|
|
136
|
+
ref: p,
|
|
137
|
+
style: r,
|
|
138
|
+
className: g(e, "page-item", {
|
|
139
|
+
active: n,
|
|
140
|
+
disabled: t
|
|
141
|
+
}),
|
|
142
|
+
children: /* @__PURE__ */ x(b, {
|
|
143
|
+
className: g("page-link", u),
|
|
144
|
+
style: a,
|
|
145
|
+
...f,
|
|
146
|
+
children: [o, n && s && /* @__PURE__ */ l("span", {
|
|
147
|
+
className: "visually-hidden",
|
|
148
|
+
children: s
|
|
149
|
+
})]
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
k.displayName = "PageItem";
|
|
154
|
+
function h(n, t, e = n) {
|
|
155
|
+
const r = /* @__PURE__ */ m.forwardRef(({
|
|
156
|
+
children: s,
|
|
157
|
+
...o
|
|
158
|
+
}, a) => /* @__PURE__ */ x(k, {
|
|
159
|
+
...o,
|
|
160
|
+
ref: a,
|
|
161
|
+
children: [/* @__PURE__ */ l("span", {
|
|
162
|
+
"aria-hidden": "true",
|
|
163
|
+
children: s || t
|
|
164
|
+
}), /* @__PURE__ */ l("span", {
|
|
165
|
+
className: "visually-hidden",
|
|
166
|
+
children: e
|
|
167
|
+
})]
|
|
168
|
+
}));
|
|
169
|
+
return r.displayName = n, r;
|
|
170
|
+
}
|
|
171
|
+
const S = h("First", "«"), T = h("Prev", "‹", "Previous"), q = h("Ellipsis", "…", "More"), G = h("Next", "›"), J = h("Last", "»"), D = /* @__PURE__ */ m.forwardRef(({
|
|
172
|
+
bsPrefix: n,
|
|
173
|
+
className: t,
|
|
174
|
+
size: e,
|
|
175
|
+
...r
|
|
176
|
+
}, s) => {
|
|
177
|
+
const o = E(n, "pagination");
|
|
178
|
+
return /* @__PURE__ */ l("ul", {
|
|
179
|
+
ref: s,
|
|
180
|
+
...r,
|
|
181
|
+
className: g(t, o, e && `${o}-${e}`)
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
D.displayName = "Pagination";
|
|
185
|
+
const c = Object.assign(D, {
|
|
186
|
+
First: S,
|
|
187
|
+
Prev: T,
|
|
188
|
+
Ellipsis: q,
|
|
189
|
+
Item: k,
|
|
190
|
+
Next: G,
|
|
191
|
+
Last: J
|
|
192
|
+
}), Y = ({
|
|
193
|
+
dataToPaginate: n = [],
|
|
194
|
+
forcePaginationDisplay: t = !1,
|
|
195
|
+
maxPageButtonsCount: e = 5,
|
|
196
|
+
pageMaxItemCount: r = 10
|
|
197
|
+
}) => {
|
|
198
|
+
const [s, o] = B(0), a = Math.floor(e / 2), u = s * r, d = u + r, f = (i) => Math.ceil(i.length / r);
|
|
199
|
+
return {
|
|
200
|
+
firstShownItemIndex: u,
|
|
201
|
+
getPageCountForContent: f,
|
|
202
|
+
maxShownItemIndexExcluded: d,
|
|
203
|
+
PageControls: () => {
|
|
204
|
+
const i = f(n);
|
|
205
|
+
return !t && i <= 1 ? null : /* @__PURE__ */ x(c, { children: [
|
|
206
|
+
/* @__PURE__ */ l(
|
|
207
|
+
c.First,
|
|
208
|
+
{
|
|
209
|
+
disabled: s <= 0,
|
|
210
|
+
onClick: () => {
|
|
211
|
+
o(0);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ l(
|
|
216
|
+
c.Prev,
|
|
217
|
+
{
|
|
218
|
+
disabled: s <= 0,
|
|
219
|
+
onClick: () => {
|
|
220
|
+
o(s - 1);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
Math.min(s - a, i - e) > 0 ? /* @__PURE__ */ l(c.Ellipsis, { disabled: !0 }) : null,
|
|
225
|
+
(() => {
|
|
226
|
+
const v = [];
|
|
227
|
+
let y = Math.min(Math.max(0, i - e), Math.max(0, s - a)), P = e;
|
|
228
|
+
const N = (w, O) => {
|
|
229
|
+
v.push(/* @__PURE__ */ l(
|
|
230
|
+
c.Item,
|
|
231
|
+
{
|
|
232
|
+
active: s === w,
|
|
233
|
+
onClick: () => {
|
|
234
|
+
o(w);
|
|
235
|
+
},
|
|
236
|
+
children: w + 1
|
|
237
|
+
},
|
|
238
|
+
e - O
|
|
239
|
+
));
|
|
240
|
+
};
|
|
241
|
+
for (; P && (N(y, P), ++y, --P, !(y >= i)); )
|
|
242
|
+
;
|
|
243
|
+
return v;
|
|
244
|
+
})(),
|
|
245
|
+
i > Math.max(a, s) + Math.ceil(e / 2) ? /* @__PURE__ */ l(c.Ellipsis, { disabled: !0 }) : null,
|
|
246
|
+
/* @__PURE__ */ l(
|
|
247
|
+
c.Next,
|
|
248
|
+
{
|
|
249
|
+
disabled: s + 1 >= i,
|
|
250
|
+
onClick: () => {
|
|
251
|
+
o(s + 1);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
/* @__PURE__ */ l(
|
|
256
|
+
c.Last,
|
|
257
|
+
{
|
|
258
|
+
disabled: s + 1 >= i,
|
|
259
|
+
onClick: () => {
|
|
260
|
+
o(i - 1);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
] });
|
|
265
|
+
},
|
|
266
|
+
pageMaxItemCount: r,
|
|
267
|
+
sliceVisibleContent: (i) => Array.isArray(i) ? i.slice(u, d) : i
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
export {
|
|
271
|
+
j as A,
|
|
272
|
+
H as B,
|
|
273
|
+
C as a,
|
|
274
|
+
I as b,
|
|
275
|
+
Y as u
|
|
276
|
+
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ea-lab/reactive-json",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
],
|
|
7
|
-
"main": "dist/index.cjs.js",
|
|
8
|
-
"module": "dist/index.esm.js",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"dev": "vite",
|
|
11
|
-
"build": "vite build",
|
|
12
|
-
"lint": "eslint .",
|
|
13
|
-
"preview": "vite preview",
|
|
14
|
-
"rollup": "rollup -c"
|
|
15
|
-
},
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.24",
|
|
5
|
+
"type": "module",
|
|
16
6
|
"repository": {
|
|
17
7
|
"type": "git",
|
|
18
8
|
"url": "git+https://bitbucket.org/ea-lab/reactive-json.git"
|
|
@@ -34,49 +24,60 @@
|
|
|
34
24
|
"url": "https://bitbucket.org/ea-lab/reactive-json/issues"
|
|
35
25
|
},
|
|
36
26
|
"homepage": "https://bitbucket.org/ea-lab/reactive-json#readme",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"@types/react": "^18",
|
|
46
|
-
"@types/react-dom": "^18",
|
|
47
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dev": "vite",
|
|
29
|
+
"build": "tsc -b ./tsconfig.lib.json && vite build",
|
|
30
|
+
"lint": "eslint .",
|
|
31
|
+
"prepublishOnly": "npm run build",
|
|
32
|
+
"preview": "vite preview"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
48
35
|
"axios": "^1.8.4",
|
|
49
|
-
"bootstrap": "^5.3.5",
|
|
50
36
|
"clsx": "^2.1.1",
|
|
51
37
|
"dnd-kit-sortable-tree": "^0.1.73",
|
|
52
|
-
"eslint": "^9.21.0",
|
|
53
|
-
"eslint-plugin-react-hooks": "^5.1.0",
|
|
54
|
-
"eslint-plugin-react-refresh": "^0.4.19",
|
|
55
|
-
"globals": "^15.15.0",
|
|
56
38
|
"html-react-parser": "^5.2.3",
|
|
57
39
|
"js-yaml": "^4.1.0",
|
|
58
40
|
"jsonpath": "^1.1.1",
|
|
59
41
|
"lodash": "^4.17.21",
|
|
60
|
-
"react": "
|
|
42
|
+
"react": "^19.1.0",
|
|
61
43
|
"react-bootstrap": "^2.10.9",
|
|
62
|
-
"react-
|
|
63
|
-
"rollup-plugin-dts": "^6.2.1",
|
|
64
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
65
|
-
"tslib": "^2.8.1",
|
|
66
|
-
"typescript": "^5.8.3",
|
|
67
|
-
"vite": "^6.2.0"
|
|
44
|
+
"react-dom": "^19.1.0"
|
|
68
45
|
},
|
|
69
|
-
"
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@eslint/js": "^9.25.0",
|
|
48
|
+
"@types/js-yaml": "^4.0.9",
|
|
49
|
+
"@types/lodash": "^4.17.16",
|
|
50
|
+
"@types/node": "^22.15.17",
|
|
51
|
+
"@types/react": "^19.1.2",
|
|
52
|
+
"@types/react-dom": "^19.1.2",
|
|
53
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
70
54
|
"axios": "^1.8.4",
|
|
55
|
+
"bootstrap": "^5.3.5",
|
|
71
56
|
"clsx": "^2.1.1",
|
|
72
57
|
"dnd-kit-sortable-tree": "^0.1.73",
|
|
58
|
+
"eslint": "^9.25.0",
|
|
59
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
60
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
61
|
+
"glob": "^11.0.2",
|
|
62
|
+
"globals": "^16.0.0",
|
|
73
63
|
"html-react-parser": "^5.2.3",
|
|
74
64
|
"js-yaml": "^4.1.0",
|
|
75
65
|
"jsonpath": "^1.1.1",
|
|
76
66
|
"lodash": "^4.17.21",
|
|
77
|
-
"react": ">=18",
|
|
78
67
|
"react-bootstrap": "^2.10.9",
|
|
79
|
-
"react-dom": "
|
|
68
|
+
"react-router-dom": "^7.5.0",
|
|
69
|
+
"typescript": "~5.8.3",
|
|
70
|
+
"typescript-eslint": "^8.30.1",
|
|
71
|
+
"vite": "^6.3.5",
|
|
72
|
+
"vite-plugin-dts": "^4.5.3",
|
|
73
|
+
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
80
74
|
},
|
|
81
|
-
"
|
|
75
|
+
"main": "dist/main.js",
|
|
76
|
+
"types": "dist/main.d.ts",
|
|
77
|
+
"files": [
|
|
78
|
+
"dist"
|
|
79
|
+
],
|
|
80
|
+
"sideEffects": [
|
|
81
|
+
"**/*.css"
|
|
82
|
+
]
|
|
82
83
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Listens to hash changes (URL fragment) on the window object and executes a reaction function in response.
|
|
3
|
-
*
|
|
4
|
-
* @param {{}} props
|
|
5
|
-
* @returns {JSX.Element}
|
|
6
|
-
* @constructor
|
|
7
|
-
*/
|
|
8
|
-
declare const HashChangeListener: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default HashChangeListener;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Listens to messages on the window object and executes a reaction function in response.
|
|
3
|
-
*
|
|
4
|
-
* @param {{}} props
|
|
5
|
-
* @returns {JSX.Element}
|
|
6
|
-
* @constructor
|
|
7
|
-
*/
|
|
8
|
-
declare const MessageListener: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default MessageListener;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Functions that will be executed on specific events.
|
|
3
|
-
*
|
|
4
|
-
* @type {{}}
|
|
5
|
-
*/
|
|
6
|
-
export declare const reactionFunctions: {
|
|
7
|
-
addData: (props: any) => void;
|
|
8
|
-
fetchData: (props: any) => void;
|
|
9
|
-
moveData: (props: any) => void;
|
|
10
|
-
postMessage: (props: any) => void;
|
|
11
|
-
redirectNow: (props: any) => void;
|
|
12
|
-
removeData: (props: any) => void;
|
|
13
|
-
setClipboardData: (props: any) => Promise<void>;
|
|
14
|
-
setData: (props: any) => void;
|
|
15
|
-
submitData: (props: any) => void;
|
|
16
|
-
triggerEvent: (props: any) => void;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Action component which will append one or more event listeners on the element.
|
|
20
|
-
*
|
|
21
|
-
* @param {Object} props
|
|
22
|
-
*
|
|
23
|
-
* @constructor
|
|
24
|
-
*/
|
|
25
|
-
declare const ReactOnEvent: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export default ReactOnEvent;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Action which will render the children, but hide it using a wrapping div.
|
|
3
|
-
*
|
|
4
|
-
* This action is used when the element to hide must still be present in the DOM
|
|
5
|
-
* to respond to events.
|
|
6
|
-
*
|
|
7
|
-
* @param {{}} props
|
|
8
|
-
* @returns {JSX.Element}
|
|
9
|
-
* @constructor
|
|
10
|
-
*/
|
|
11
|
-
declare const VisuallyHide: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export default VisuallyHide;
|