@cfx-dev/ui-components 4.2.24 → 4.3.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.
- package/dist/Combination-CSgOhzm-.js +2198 -0
- package/dist/Combination-N-vN9BB-.js +823 -0
- package/dist/Table.module-DHI1mXN2.js +17 -0
- package/dist/assets/all_css.css +1 -0
- package/dist/assets/css/Checkbox.css +1 -1
- package/dist/assets/css/DataTable.css +1 -0
- package/dist/assets/css/Table.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/cfxIcons-B9nzO6TW.js +98 -0
- package/dist/components/Accordion/Accordion.js +25 -26
- package/dist/components/Accordion/AccordionShowcase.js +1 -1
- package/dist/components/Avatar/Avatar.d.ts +2 -1
- package/dist/components/Avatar/Avatar.js +21 -20
- package/dist/components/Avatar/AvatarShowcase.js +1 -1
- package/dist/components/Badge/Badge.d.ts +2 -1
- package/dist/components/Badge/Badge.js +29 -29
- package/dist/components/Badge/BadgeShowcase.js +1 -1
- package/dist/components/BurgerMenu/BurgerMenu.js +2 -2
- package/dist/components/BurgerMenu/BurgerMenuButton.js +1 -1
- package/dist/components/BurgerMenu/BurgerMenuShowcase.js +1 -1
- package/dist/components/Button/Button.d.ts +5 -2
- package/dist/components/Button/Button.js +83 -81
- package/dist/components/Button/ButtonShowcase.js +2 -2
- package/dist/components/Button/LinkButton.d.ts +1 -1
- package/dist/components/Button/LinkButton.js +18 -17
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.js +7 -7
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.js +154 -242
- package/dist/components/ClipboardButton/ClipboardButton.js +7 -7
- package/dist/components/ControlBox/ControlBox.d.ts +3 -2
- package/dist/components/ControlBox/ControlBox.js +13 -10
- package/dist/components/CountryFlag/CountryFlag.d.ts +3 -2
- package/dist/components/CountryFlag/CountryFlag.js +14 -11
- package/dist/components/DataTable/DataTable.d.ts +40 -0
- package/dist/components/DataTable/DataTable.js +163 -0
- package/dist/components/DataTable/DataTableShowcase.d.ts +5 -0
- package/dist/components/DataTable/DataTableShowcase.js +60 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.js +6 -0
- package/dist/components/Decorate/Decorate.d.ts +3 -2
- package/dist/components/Decorate/Decorate.js +19 -15
- package/dist/components/Dot/Dot.d.ts +2 -1
- package/dist/components/Dot/Dot.js +15 -13
- package/dist/components/DropdownSelect/DropdownSelect.d.ts +2 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +665 -1836
- package/dist/components/DropdownSelect/DropdownSelectShowcase.js +1 -1
- package/dist/components/Flyout/Flyout.d.ts +2 -1
- package/dist/components/Flyout/Flyout.js +22 -20
- package/dist/components/Icon/Icon.d.ts +2 -1
- package/dist/components/Icon/Icon.js +19 -17
- package/dist/components/IconBig/IconBig.d.ts +2 -1
- package/dist/components/IconBig/IconBig.js +16 -14
- package/dist/components/Icons/IconsShowcase.js +1 -1
- package/dist/components/Icons/cfx-icons/Radio.d.ts +5 -0
- package/dist/components/Icons/cfx-icons/Radio.js +36 -0
- package/dist/components/Icons/cfx-icons/Square.js +15 -9
- package/dist/components/Icons/cfxIcons.d.ts +1 -0
- package/dist/components/Icons/cfxIcons.js +62 -60
- package/dist/components/Icons/index.js +1 -1
- package/dist/components/Indicator/Indicator.js +9 -10
- package/dist/components/InfoPanel/InfoPanelShowcase.js +1 -1
- package/dist/components/Input/Input.d.ts +4 -1
- package/dist/components/Input/Input.js +101 -88
- package/dist/components/Input/InputShowcase.js +1 -1
- package/dist/components/Input/RichInput.d.ts +2 -1
- package/dist/components/Input/RichInput.js +37 -34
- package/dist/components/InputDropzone/InputDropzone.d.ts +1 -1
- package/dist/components/InputDropzone/InputDropzone.js +1723 -625
- package/dist/components/Interactive/Interactive.d.ts +2 -1
- package/dist/components/Interactive/Interactive.js +14 -12
- package/dist/components/Island/Island.d.ts +2 -1
- package/dist/components/Island/Island.js +24 -24
- package/dist/components/Layout/Box/Box.d.ts +8 -2
- package/dist/components/Layout/Box/Box.js +53 -51
- package/dist/components/Layout/Box/Box.types.d.ts +22 -0
- package/dist/components/Layout/Box/Box.types.js +4 -0
- package/dist/components/Layout/Box/index.d.ts +1 -1
- package/dist/components/Layout/Box/index.js +3 -3
- package/dist/components/Layout/Center/Center.d.ts +2 -1
- package/dist/components/Layout/Center/Center.js +19 -18
- package/dist/components/Layout/Flex/Flex.d.ts +6 -10
- package/dist/components/Layout/Flex/Flex.js +53 -64
- package/dist/components/Layout/Flex/FlexRestricter.d.ts +2 -1
- package/dist/components/Layout/Flex/FlexRestricter.js +13 -12
- package/dist/components/Layout/Flex/FlexShowcase.js +1 -1
- package/dist/components/Layout/Flex/index.d.ts +2 -2
- package/dist/components/Layout/Flex/index.js +8 -8
- package/dist/components/Layout/Page/Page.js +11 -12
- package/dist/components/Layout/Scrollable/Rail.d.ts +1 -1
- package/dist/components/Layout/Scrollable/Scrollable.d.ts +2 -1
- package/dist/components/Layout/Scrollable/Scrollable.js +40 -38
- package/dist/components/Layout/Scrollable/ScrollableShowcase.js +1 -1
- package/dist/components/Layout/Scrollable/VirtualScrollable.js +98 -98
- package/dist/components/Link/LinkShowcase.js +1 -1
- package/dist/components/Loaf/Loaf.d.ts +2 -1
- package/dist/components/Loaf/Loaf.js +17 -16
- package/dist/components/Logos/LogosShowcase.js +1 -1
- package/dist/components/Modal/Modal.js +16 -17
- package/dist/components/Modal/ModalShowcase.js +14 -11
- package/dist/components/NavList/NavList.d.ts +2 -1
- package/dist/components/NavList/NavList.js +19 -18
- package/dist/components/OnScreenSensor.js +1 -1
- package/dist/components/Overlay/Overlay.d.ts +4 -2
- package/dist/components/Overlay/Overlay.js +31 -23
- package/dist/components/Popover/Popover.d.ts +3 -2
- package/dist/components/Popover/Popover.js +31 -30
- package/dist/components/Popover/PopoverShowcase.js +4 -4
- package/dist/components/PremiumBadge/PremiumBadge.d.ts +2 -1
- package/dist/components/PremiumBadge/PremiumBadge.js +12 -11
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +666 -1617
- package/dist/components/Select/SelectShowcase.js +1 -1
- package/dist/components/Shroud/Shroud.d.ts +2 -1
- package/dist/components/Shroud/Shroud.js +16 -14
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +26 -27
- package/dist/components/Skeleton/SkeletonShowcase.js +4 -4
- package/dist/components/Slider/Slider.d.ts +2 -1
- package/dist/components/Slider/Slider.js +326 -377
- package/dist/components/Slider/SliderShowcase.js +1 -1
- package/dist/components/Switch/Switch.js +109 -155
- package/dist/components/Table/TableBody.d.ts +8 -0
- package/dist/components/Table/TableBody.js +14 -0
- package/dist/components/Table/TableCell.d.ts +11 -0
- package/dist/components/Table/TableCell.js +54 -0
- package/dist/components/Table/TableCellCheckbox.d.ts +11 -0
- package/dist/components/Table/TableCellCheckbox.js +20 -0
- package/dist/components/Table/TableHeader.d.ts +9 -0
- package/dist/components/Table/TableHeader.js +24 -0
- package/dist/components/Table/TableIconButton.d.ts +6 -0
- package/dist/components/Table/TableIconButton.js +16 -0
- package/dist/components/Table/TableRoot.d.ts +8 -0
- package/dist/components/Table/TableRoot.js +23 -0
- package/dist/components/Table/TableRow.d.ts +13 -0
- package/dist/components/Table/TableRow.js +46 -0
- package/dist/components/Table/TableShowcase.js +56 -57
- package/dist/components/Table/index.d.ts +21 -2
- package/dist/components/Table/index.js +18 -5
- package/dist/components/Tabular/TabularShowcase.js +1 -1
- package/dist/components/Text/Text.d.ts +6 -3
- package/dist/components/Text/Text.js +67 -63
- package/dist/components/Text/TextShowcase.js +40 -33
- package/dist/components/Title/Title.d.ts +3 -1
- package/dist/components/Title/TitleShowcase.js +1 -1
- package/dist/components/ToggleGroup/ToggleGroupShowcase.js +1 -1
- package/dist/index-BHuChyf5.js +238 -0
- package/dist/index-Cl_RnsqN.js +386 -0
- package/dist/index-DZEAOJqB.js +53 -0
- package/dist/index-HDl8nGsm.js +70 -0
- package/dist/main.d.ts +6 -4
- package/dist/main.js +73 -70
- package/dist/{medium-BA3EQDZW.js → medium-Bq5NvyU7.js} +1 -1
- package/dist/styles-scss/global.scss +1 -0
- package/dist/tslib.es6-CtHwNPxX.js +72 -0
- package/dist/utils/hooks/useClipboardComponent.d.ts +1 -1
- package/dist/utils/hooks/useOutlet.js +1 -1
- package/dist/utils/hooks/usePopoverController.d.ts +1 -1
- package/dist/utils/links.js +1 -1
- package/dist/utils/mergeRefs.d.ts +1 -1
- package/dist/utils/mergeRefs.js +1 -1
- package/dist/utils/ui/ui.d.ts +1 -0
- package/dist/utils/ui/ui.js +45 -36
- package/dist/utils/ui/ui.types.d.ts +4 -0
- package/package.json +6 -5
- package/dist/Combination-Cbiw1XRb.js +0 -792
- package/dist/cfxIcons-BNd1WgpX.js +0 -96
- package/dist/components/Table/Table.d.ts +0 -42
- package/dist/components/Table/Table.js +0 -170
- package/dist/index-2hJuj4UN.js +0 -19069
- package/dist/index-AweK2ufS.js +0 -171
- package/dist/index-BlbvKsmN.js +0 -82
- package/dist/index-ByaXH_ih.js +0 -10
- package/dist/index-Bz27DCHt.js +0 -1342
- package/dist/index-Cf5Yu9oD.js +0 -67
- package/dist/tslib.es6-CBKHJX9H.js +0 -151
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { clsx as
|
|
3
|
-
const d = "cfxui__Page__root__3b40d",
|
|
1
|
+
import { jsxs as c, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as _ } from "../../../utils/clsx.js";
|
|
3
|
+
const d = "cfxui__Page__root__3b40d", n = "cfxui__Page__loader__df597", o = {
|
|
4
4
|
root: d,
|
|
5
|
-
loader:
|
|
6
|
-
wtf: n
|
|
5
|
+
loader: n
|
|
7
6
|
};
|
|
8
|
-
function
|
|
7
|
+
function f(s) {
|
|
9
8
|
const {
|
|
10
9
|
children: r,
|
|
11
|
-
className:
|
|
12
|
-
showLoader:
|
|
13
|
-
} = s,
|
|
14
|
-
return /* @__PURE__ */
|
|
10
|
+
className: a,
|
|
11
|
+
showLoader: e = !1
|
|
12
|
+
} = s, t = _(o.root, a);
|
|
13
|
+
return /* @__PURE__ */ c("div", { className: t, children: [
|
|
15
14
|
r,
|
|
16
|
-
|
|
15
|
+
e && /* @__PURE__ */ l("div", { className: o.loader })
|
|
17
16
|
] });
|
|
18
17
|
}
|
|
19
18
|
export {
|
|
20
|
-
|
|
19
|
+
f as Page
|
|
21
20
|
};
|
|
@@ -4,6 +4,7 @@ export interface ScrollableProps {
|
|
|
4
4
|
minThumbSize?: number;
|
|
5
5
|
className?: string;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
7
8
|
onScroll?: (event: WheelEvent | React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
8
9
|
scrollerRef?: React.Ref<HTMLDivElement>;
|
|
9
10
|
/**
|
|
@@ -11,4 +12,4 @@ export interface ScrollableProps {
|
|
|
11
12
|
*/
|
|
12
13
|
verticalAsHorizontal?: boolean;
|
|
13
14
|
}
|
|
14
|
-
export declare
|
|
15
|
+
export declare function Scrollable(props: ScrollableProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as W, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { clsx as b } from "../../../utils/clsx.js";
|
|
3
|
+
import { clsx as x } from "../../../utils/clsx.js";
|
|
5
4
|
import { mergeRefs as k } from "../../../utils/mergeRefs.js";
|
|
6
|
-
import { s as o, R as
|
|
7
|
-
const
|
|
5
|
+
import { s as o, R as N } from "../../../Rail-DcVowhML.js";
|
|
6
|
+
const P = {
|
|
8
7
|
size: 0,
|
|
9
8
|
scrollPos: 0,
|
|
10
9
|
scrollSize: 0
|
|
11
|
-
}
|
|
10
|
+
};
|
|
11
|
+
function G(b) {
|
|
12
12
|
const {
|
|
13
|
-
children:
|
|
13
|
+
children: w,
|
|
14
14
|
className: A,
|
|
15
15
|
onScroll: l,
|
|
16
|
-
minThumbSize:
|
|
17
|
-
verticalAsHorizontal:
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
minThumbSize: u = 20,
|
|
17
|
+
verticalAsHorizontal: f = !1,
|
|
18
|
+
ref: L,
|
|
19
|
+
scrollerRef: E
|
|
20
|
+
} = b, e = r.useRef(null), a = r.useRef(null), [T, S] = r.useState(!1), [c, y] = r.useState(P), [g, I] = r.useState(0), [n, X] = r.useState(P), [Y, _] = r.useState(0), C = x(o.root, A, {
|
|
21
|
+
[o.active]: T
|
|
20
22
|
});
|
|
21
23
|
r.useLayoutEffect(() => {
|
|
22
24
|
if (!a.current)
|
|
23
25
|
throw new Error("No scrollable content ref");
|
|
24
26
|
const s = new ResizeObserver(() => {
|
|
25
|
-
var t, d, h, v, p
|
|
26
|
-
|
|
27
|
+
var t, R, d, h, v, p;
|
|
28
|
+
X({
|
|
27
29
|
size: ((t = e.current) == null ? void 0 : t.clientHeight) || 0,
|
|
28
|
-
scrollPos: ((
|
|
29
|
-
scrollSize: ((
|
|
30
|
-
}),
|
|
31
|
-
size: ((
|
|
32
|
-
scrollPos: ((
|
|
33
|
-
scrollSize: ((
|
|
30
|
+
scrollPos: ((R = e.current) == null ? void 0 : R.scrollTop) || 0,
|
|
31
|
+
scrollSize: ((d = e.current) == null ? void 0 : d.scrollHeight) || 0
|
|
32
|
+
}), y({
|
|
33
|
+
size: ((h = e.current) == null ? void 0 : h.clientWidth) || 0,
|
|
34
|
+
scrollPos: ((v = e.current) == null ? void 0 : v.scrollLeft) || 0,
|
|
35
|
+
scrollSize: ((p = e.current) == null ? void 0 : p.scrollWidth) || 0
|
|
34
36
|
});
|
|
35
37
|
});
|
|
36
38
|
return s.observe(a.current), () => s.disconnect();
|
|
37
39
|
}, []);
|
|
38
|
-
const
|
|
40
|
+
const H = r.useCallback(
|
|
39
41
|
(s) => {
|
|
40
|
-
e.current && (l == null || l(s),
|
|
42
|
+
e.current && (l == null || l(s), _(e.current.scrollTop), I(e.current.scrollLeft));
|
|
41
43
|
},
|
|
42
44
|
[l]
|
|
43
45
|
);
|
|
44
46
|
r.useEffect(() => {
|
|
45
|
-
if (!
|
|
47
|
+
if (!f || !e.current)
|
|
46
48
|
return;
|
|
47
49
|
const s = (t) => {
|
|
48
50
|
t.preventDefault(), t.stopPropagation(), e.current && (e.current.scrollLeft += t.deltaY);
|
|
@@ -51,39 +53,39 @@ const N = {
|
|
|
51
53
|
var t;
|
|
52
54
|
return (t = e.current) == null ? void 0 : t.removeEventListener("wheel", s);
|
|
53
55
|
};
|
|
54
|
-
}, [
|
|
55
|
-
const z = c.scrollSize - c.size > 1,
|
|
56
|
+
}, [f]);
|
|
57
|
+
const z = c.scrollSize - c.size > 1, m = n.scrollSize - n.size > 1, j = x(o.scroller, {
|
|
56
58
|
[o["no-x-scroll"]]: !z,
|
|
57
|
-
[o["no-y-scroll"]]: !
|
|
59
|
+
[o["no-y-scroll"]]: !m
|
|
58
60
|
});
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */ i("div", { ref: k(e,
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
return /* @__PURE__ */ W("div", { ref: L, className: C, children: [
|
|
62
|
+
/* @__PURE__ */ i("div", { ref: k(e, E), className: j, onScroll: H, children: /* @__PURE__ */ i("div", { ref: a, className: o.content, children: w }) }),
|
|
63
|
+
m && /* @__PURE__ */ i(
|
|
64
|
+
N,
|
|
63
65
|
{
|
|
64
66
|
rootRef: e,
|
|
65
67
|
axis: "y",
|
|
66
68
|
size: n.size,
|
|
67
|
-
pos:
|
|
69
|
+
pos: Y,
|
|
68
70
|
scrollSize: n.scrollSize,
|
|
69
|
-
setRootActive:
|
|
70
|
-
minThumbSize:
|
|
71
|
+
setRootActive: S,
|
|
72
|
+
minThumbSize: u
|
|
71
73
|
}
|
|
72
74
|
),
|
|
73
75
|
z && /* @__PURE__ */ i(
|
|
74
|
-
|
|
76
|
+
N,
|
|
75
77
|
{
|
|
76
78
|
rootRef: e,
|
|
77
79
|
axis: "x",
|
|
78
80
|
size: c.size,
|
|
79
|
-
pos:
|
|
81
|
+
pos: g,
|
|
80
82
|
scrollSize: c.scrollSize,
|
|
81
|
-
setRootActive:
|
|
82
|
-
minThumbSize:
|
|
83
|
+
setRootActive: S,
|
|
84
|
+
minThumbSize: u
|
|
83
85
|
}
|
|
84
86
|
)
|
|
85
87
|
] });
|
|
86
|
-
}
|
|
88
|
+
}
|
|
87
89
|
export {
|
|
88
|
-
|
|
90
|
+
G as Scrollable
|
|
89
91
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import d from "react";
|
|
3
|
-
import
|
|
3
|
+
import i from "../Flex/Flex.js";
|
|
4
4
|
import { Text as t } from "../../Text/Text.js";
|
|
5
5
|
import "../../../utils/ui/ui.js";
|
|
6
6
|
import { LOREM_IPSUM as e } from "../../../utils/loremipsum.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
2
|
+
import W, { createElement as k, PureComponent as re } from "react";
|
|
3
3
|
import { _ as ie, a as ne } from "../../../inheritsLoose-CyjgKRgL.js";
|
|
4
4
|
import { clsx as oe } from "../../../utils/clsx.js";
|
|
5
5
|
import { Scrollable as le } from "./Scrollable.js";
|
|
@@ -17,18 +17,18 @@ function ae(r, t) {
|
|
|
17
17
|
function ce(r, t) {
|
|
18
18
|
if (r.length !== t.length)
|
|
19
19
|
return !1;
|
|
20
|
-
for (var
|
|
21
|
-
if (!ae(r[
|
|
20
|
+
for (var o = 0; o < r.length; o++)
|
|
21
|
+
if (!ae(r[o], t[o]))
|
|
22
22
|
return !1;
|
|
23
23
|
return !0;
|
|
24
24
|
}
|
|
25
25
|
function D(r, t) {
|
|
26
26
|
t === void 0 && (t = ce);
|
|
27
|
-
var
|
|
27
|
+
var o, l = [], a, I = !1;
|
|
28
28
|
function m() {
|
|
29
29
|
for (var v = [], S = 0; S < arguments.length; S++)
|
|
30
30
|
v[S] = arguments[S];
|
|
31
|
-
return I &&
|
|
31
|
+
return I && o === this && t(v, l) || (a = r.apply(this, v), I = !0, o = this, l = v), a;
|
|
32
32
|
}
|
|
33
33
|
return m;
|
|
34
34
|
}
|
|
@@ -41,9 +41,9 @@ function K(r) {
|
|
|
41
41
|
cancelAnimationFrame(r.id);
|
|
42
42
|
}
|
|
43
43
|
function de(r, t) {
|
|
44
|
-
var
|
|
44
|
+
var o = H();
|
|
45
45
|
function l() {
|
|
46
|
-
H() -
|
|
46
|
+
H() - o >= t ? r.call(null) : a.id = requestAnimationFrame(l);
|
|
47
47
|
}
|
|
48
48
|
var a = {
|
|
49
49
|
id: requestAnimationFrame(l)
|
|
@@ -53,28 +53,28 @@ function de(r, t) {
|
|
|
53
53
|
var L = -1;
|
|
54
54
|
function j(r) {
|
|
55
55
|
if (r === void 0 && (r = !1), L === -1 || r) {
|
|
56
|
-
var t = document.createElement("div"),
|
|
57
|
-
|
|
56
|
+
var t = document.createElement("div"), o = t.style;
|
|
57
|
+
o.width = "50px", o.height = "50px", o.overflow = "scroll", document.body.appendChild(t), L = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
58
58
|
}
|
|
59
59
|
return L;
|
|
60
60
|
}
|
|
61
61
|
var _ = null;
|
|
62
62
|
function B(r) {
|
|
63
63
|
if (r === void 0 && (r = !1), _ === null || r) {
|
|
64
|
-
var t = document.createElement("div"),
|
|
65
|
-
|
|
64
|
+
var t = document.createElement("div"), o = t.style;
|
|
65
|
+
o.width = "50px", o.height = "50px", o.overflow = "scroll", o.direction = "rtl";
|
|
66
66
|
var l = document.createElement("div"), a = l.style;
|
|
67
67
|
return a.width = "100px", a.height = "100px", t.appendChild(l), document.body.appendChild(t), t.scrollLeft > 0 ? _ = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? _ = "negative" : _ = "positive-ascending"), document.body.removeChild(t), _;
|
|
68
68
|
}
|
|
69
69
|
return _;
|
|
70
70
|
}
|
|
71
71
|
process.env.NODE_ENV;
|
|
72
|
-
var fe = 150, he = function(t,
|
|
72
|
+
var fe = 150, he = function(t, o) {
|
|
73
73
|
return t;
|
|
74
|
-
},
|
|
75
|
-
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (
|
|
74
|
+
}, R = null, P = null;
|
|
75
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (R = /* @__PURE__ */ new WeakSet(), P = /* @__PURE__ */ new WeakSet());
|
|
76
76
|
function pe(r) {
|
|
77
|
-
var t,
|
|
77
|
+
var t, o = r.getItemOffset, l = r.getEstimatedTotalSize, a = r.getItemSize, I = r.getOffsetForIndexAndAlignment, m = r.getStartIndexForOffset, v = r.getStopIndexForStartIndex, S = r.initInstanceProps, y = r.shouldResetStyleCacheOnItemSizeChange, g = r.validateProps;
|
|
78
78
|
return t = /* @__PURE__ */ function(w) {
|
|
79
79
|
ie(b, w);
|
|
80
80
|
function b(p) {
|
|
@@ -85,26 +85,26 @@ function pe(r) {
|
|
|
85
85
|
scrollDirection: "forward",
|
|
86
86
|
scrollOffset: typeof e.props.initialScrollOffset == "number" ? e.props.initialScrollOffset : 0,
|
|
87
87
|
scrollUpdateWasRequested: !1
|
|
88
|
-
}, e._callOnItemsRendered = void 0, e._callOnItemsRendered = D(function(
|
|
88
|
+
}, e._callOnItemsRendered = void 0, e._callOnItemsRendered = D(function(i, n, s, u) {
|
|
89
89
|
return e.props.onItemsRendered({
|
|
90
|
-
overscanStartIndex:
|
|
91
|
-
overscanStopIndex:
|
|
90
|
+
overscanStartIndex: i,
|
|
91
|
+
overscanStopIndex: n,
|
|
92
92
|
visibleStartIndex: s,
|
|
93
93
|
visibleStopIndex: u
|
|
94
94
|
});
|
|
95
|
-
}), e._callOnScroll = void 0, e._callOnScroll = D(function(
|
|
95
|
+
}), e._callOnScroll = void 0, e._callOnScroll = D(function(i, n, s) {
|
|
96
96
|
return e.props.onScroll({
|
|
97
|
-
scrollDirection:
|
|
98
|
-
scrollOffset:
|
|
97
|
+
scrollDirection: i,
|
|
98
|
+
scrollOffset: n,
|
|
99
99
|
scrollUpdateWasRequested: s
|
|
100
100
|
});
|
|
101
|
-
}), e._getItemStyle = void 0, e._getItemStyle = function(
|
|
102
|
-
var
|
|
103
|
-
if (c.hasOwnProperty(
|
|
104
|
-
d = c[
|
|
101
|
+
}), e._getItemStyle = void 0, e._getItemStyle = function(i) {
|
|
102
|
+
var n = e.props, s = n.direction, u = n.itemSize, f = n.layout, c = e._getItemStyleCache(y && u, y && f, y && s), d;
|
|
103
|
+
if (c.hasOwnProperty(i))
|
|
104
|
+
d = c[i];
|
|
105
105
|
else {
|
|
106
|
-
var h =
|
|
107
|
-
c[
|
|
106
|
+
var h = o(e.props, i, e._instanceProps), T = a(e.props, i, e._instanceProps), O = s === "horizontal" || f === "horizontal", x = s === "rtl", E = O ? h : 0;
|
|
107
|
+
c[i] = d = {
|
|
108
108
|
position: "absolute",
|
|
109
109
|
left: x ? void 0 : E,
|
|
110
110
|
right: x ? E : void 0,
|
|
@@ -114,10 +114,10 @@ function pe(r) {
|
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
return d;
|
|
117
|
-
}, e._getItemStyleCache = void 0, e._getItemStyleCache = D(function(
|
|
117
|
+
}, e._getItemStyleCache = void 0, e._getItemStyleCache = D(function(i, n, s) {
|
|
118
118
|
return {};
|
|
119
|
-
}), e._onScrollHorizontal = function(
|
|
120
|
-
var
|
|
119
|
+
}), e._onScrollHorizontal = function(i) {
|
|
120
|
+
var n = i.currentTarget, s = n.clientWidth, u = n.scrollLeft, f = n.scrollWidth;
|
|
121
121
|
e.setState(function(c) {
|
|
122
122
|
if (c.scrollOffset === u)
|
|
123
123
|
return null;
|
|
@@ -138,8 +138,8 @@ function pe(r) {
|
|
|
138
138
|
scrollUpdateWasRequested: !1
|
|
139
139
|
};
|
|
140
140
|
}, e._resetIsScrollingDebounced);
|
|
141
|
-
}, e._onScrollVertical = function(
|
|
142
|
-
var
|
|
141
|
+
}, e._onScrollVertical = function(i) {
|
|
142
|
+
var n = i.currentTarget, s = n.clientHeight, u = n.scrollHeight, f = n.scrollTop;
|
|
143
143
|
e.setState(function(c) {
|
|
144
144
|
if (c.scrollOffset === f)
|
|
145
145
|
return null;
|
|
@@ -151,9 +151,9 @@ function pe(r) {
|
|
|
151
151
|
scrollUpdateWasRequested: !1
|
|
152
152
|
};
|
|
153
153
|
}, e._resetIsScrollingDebounced);
|
|
154
|
-
}, e._outerRefSetter = function(
|
|
155
|
-
var
|
|
156
|
-
e._outerRef =
|
|
154
|
+
}, e._outerRefSetter = function(i) {
|
|
155
|
+
var n = e.props.outerRef;
|
|
156
|
+
e._outerRef = i, typeof n == "function" ? n(i) : n != null && typeof n == "object" && n.hasOwnProperty("current") && (n.current = i);
|
|
157
157
|
}, e._resetIsScrollingDebounced = function() {
|
|
158
158
|
e._resetIsScrollingTimeoutId !== null && K(e._resetIsScrollingTimeoutId), e._resetIsScrollingTimeoutId = de(e._resetIsScrolling, fe);
|
|
159
159
|
}, e._resetIsScrolling = function() {
|
|
@@ -164,41 +164,41 @@ function pe(r) {
|
|
|
164
164
|
});
|
|
165
165
|
}, e;
|
|
166
166
|
}
|
|
167
|
-
b.getDerivedStateFromProps = function(e,
|
|
168
|
-
return me(e,
|
|
167
|
+
b.getDerivedStateFromProps = function(e, i) {
|
|
168
|
+
return me(e, i), g(e), null;
|
|
169
169
|
};
|
|
170
170
|
var z = b.prototype;
|
|
171
171
|
return z.scrollTo = function(e) {
|
|
172
|
-
e = Math.max(0, e), this.setState(function(
|
|
173
|
-
return
|
|
174
|
-
scrollDirection:
|
|
172
|
+
e = Math.max(0, e), this.setState(function(i) {
|
|
173
|
+
return i.scrollOffset === e ? null : {
|
|
174
|
+
scrollDirection: i.scrollOffset < e ? "forward" : "backward",
|
|
175
175
|
scrollOffset: e,
|
|
176
176
|
scrollUpdateWasRequested: !0
|
|
177
177
|
};
|
|
178
178
|
}, this._resetIsScrollingDebounced);
|
|
179
|
-
}, z.scrollToItem = function(e,
|
|
180
|
-
|
|
181
|
-
var
|
|
179
|
+
}, z.scrollToItem = function(e, i) {
|
|
180
|
+
i === void 0 && (i = "auto");
|
|
181
|
+
var n = this.props, s = n.itemCount, u = n.layout, f = this.state.scrollOffset;
|
|
182
182
|
e = Math.max(0, Math.min(e, s - 1));
|
|
183
183
|
var c = 0;
|
|
184
184
|
if (this._outerRef) {
|
|
185
185
|
var d = this._outerRef;
|
|
186
186
|
u === "vertical" ? c = d.scrollWidth > d.clientWidth ? j() : 0 : c = d.scrollHeight > d.clientHeight ? j() : 0;
|
|
187
187
|
}
|
|
188
|
-
this.scrollTo(I(this.props, e,
|
|
188
|
+
this.scrollTo(I(this.props, e, i, f, this._instanceProps, c));
|
|
189
189
|
}, z.componentDidMount = function() {
|
|
190
|
-
var e = this.props,
|
|
191
|
-
if (typeof
|
|
190
|
+
var e = this.props, i = e.direction, n = e.initialScrollOffset, s = e.layout;
|
|
191
|
+
if (typeof n == "number" && this._outerRef != null) {
|
|
192
192
|
var u = this._outerRef;
|
|
193
|
-
|
|
193
|
+
i === "horizontal" || s === "horizontal" ? u.scrollLeft = n : u.scrollTop = n;
|
|
194
194
|
}
|
|
195
195
|
this._callPropsCallbacks();
|
|
196
196
|
}, z.componentDidUpdate = function() {
|
|
197
|
-
var e = this.props,
|
|
197
|
+
var e = this.props, i = e.direction, n = e.layout, s = this.state, u = s.scrollOffset, f = s.scrollUpdateWasRequested;
|
|
198
198
|
if (f && this._outerRef != null) {
|
|
199
199
|
var c = this._outerRef;
|
|
200
|
-
if (
|
|
201
|
-
if (
|
|
200
|
+
if (i === "horizontal" || n === "horizontal")
|
|
201
|
+
if (i === "rtl")
|
|
202
202
|
switch (B()) {
|
|
203
203
|
case "negative":
|
|
204
204
|
c.scrollLeft = -u;
|
|
@@ -220,10 +220,10 @@ function pe(r) {
|
|
|
220
220
|
}, z.componentWillUnmount = function() {
|
|
221
221
|
this._resetIsScrollingTimeoutId !== null && K(this._resetIsScrollingTimeoutId);
|
|
222
222
|
}, z.render = function() {
|
|
223
|
-
var e = this.props,
|
|
223
|
+
var e = this.props, i = e.children, n = e.className, s = e.direction, u = e.height, f = e.innerRef, c = e.innerElementType, d = e.innerTagName, h = e.itemCount, T = e.itemData, O = e.itemKey, x = O === void 0 ? he : O, E = e.layout, G = e.outerElementType, J = e.outerTagName, Q = e.style, X = e.useIsScrolling, Y = e.width, A = this.state.isScrolling, M = s === "horizontal" || E === "horizontal", Z = M ? this._onScrollHorizontal : this._onScrollVertical, F = this._getRangeToRender(), ee = F[0], te = F[1], V = [];
|
|
224
224
|
if (h > 0)
|
|
225
225
|
for (var C = ee; C <= te; C++)
|
|
226
|
-
V.push(k(
|
|
226
|
+
V.push(k(i, {
|
|
227
227
|
data: T,
|
|
228
228
|
key: x(C, T),
|
|
229
229
|
index: C,
|
|
@@ -232,7 +232,7 @@ function pe(r) {
|
|
|
232
232
|
}));
|
|
233
233
|
var U = l(this.props, this._instanceProps);
|
|
234
234
|
return k(G || J || "div", {
|
|
235
|
-
className:
|
|
235
|
+
className: n,
|
|
236
236
|
onScroll: Z,
|
|
237
237
|
ref: this._outerRefSetter,
|
|
238
238
|
style: ne({
|
|
@@ -248,17 +248,17 @@ function pe(r) {
|
|
|
248
248
|
children: V,
|
|
249
249
|
ref: f,
|
|
250
250
|
style: {
|
|
251
|
-
height:
|
|
251
|
+
height: M ? "100%" : U,
|
|
252
252
|
pointerEvents: A ? "none" : void 0,
|
|
253
|
-
width:
|
|
253
|
+
width: M ? U : "100%"
|
|
254
254
|
}
|
|
255
255
|
}));
|
|
256
256
|
}, z._callPropsCallbacks = function() {
|
|
257
257
|
if (typeof this.props.onItemsRendered == "function") {
|
|
258
258
|
var e = this.props.itemCount;
|
|
259
259
|
if (e > 0) {
|
|
260
|
-
var
|
|
261
|
-
this._callOnItemsRendered(
|
|
260
|
+
var i = this._getRangeToRender(), n = i[0], s = i[1], u = i[2], f = i[3];
|
|
261
|
+
this._callOnItemsRendered(n, s, u, f);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
if (typeof this.props.onScroll == "function") {
|
|
@@ -266,11 +266,11 @@ function pe(r) {
|
|
|
266
266
|
this._callOnScroll(d, h, T);
|
|
267
267
|
}
|
|
268
268
|
}, z._getRangeToRender = function() {
|
|
269
|
-
var e = this.props,
|
|
270
|
-
if (
|
|
269
|
+
var e = this.props, i = e.itemCount, n = e.overscanCount, s = this.state, u = s.isScrolling, f = s.scrollDirection, c = s.scrollOffset;
|
|
270
|
+
if (i === 0)
|
|
271
271
|
return [0, 0, 0, 0];
|
|
272
|
-
var d = m(this.props, c, this._instanceProps), h = v(this.props, d, c, this._instanceProps), T = !u || f === "backward" ? Math.max(1,
|
|
273
|
-
return [Math.max(0, d - T), Math.max(0, Math.min(
|
|
272
|
+
var d = m(this.props, c, this._instanceProps), h = v(this.props, d, c, this._instanceProps), T = !u || f === "backward" ? Math.max(1, n) : 1, O = !u || f === "forward" ? Math.max(1, n) : 1;
|
|
273
|
+
return [Math.max(0, d - T), Math.max(0, Math.min(i - 1, h + O)), d, h];
|
|
274
274
|
}, b;
|
|
275
275
|
}(re), t.defaultProps = {
|
|
276
276
|
direction: "ltr",
|
|
@@ -280,15 +280,15 @@ function pe(r) {
|
|
|
280
280
|
useIsScrolling: !1
|
|
281
281
|
}, t;
|
|
282
282
|
}
|
|
283
|
-
var me = function(t,
|
|
284
|
-
var l = t.children, a = t.direction, I = t.height, m = t.layout, v = t.innerTagName, S = t.outerTagName, y = t.width, g =
|
|
283
|
+
var me = function(t, o) {
|
|
284
|
+
var l = t.children, a = t.direction, I = t.height, m = t.layout, v = t.innerTagName, S = t.outerTagName, y = t.width, g = o.instance;
|
|
285
285
|
if (process.env.NODE_ENV !== "production") {
|
|
286
|
-
(v != null || S != null) &&
|
|
286
|
+
(v != null || S != null) && P && !P.has(g) && (P.add(g), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));
|
|
287
287
|
var w = a === "horizontal" || m === "horizontal";
|
|
288
288
|
switch (a) {
|
|
289
289
|
case "horizontal":
|
|
290
290
|
case "vertical":
|
|
291
|
-
|
|
291
|
+
R && !R.has(g) && (R.add(g), console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));
|
|
292
292
|
break;
|
|
293
293
|
case "ltr":
|
|
294
294
|
case "rtl":
|
|
@@ -311,43 +311,43 @@ var me = function(t, i) {
|
|
|
311
311
|
throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. ' + ('"' + (I === null ? "null" : typeof I) + '" was specified.'));
|
|
312
312
|
}
|
|
313
313
|
}, ve = /* @__PURE__ */ pe({
|
|
314
|
-
getItemOffset: function(t,
|
|
314
|
+
getItemOffset: function(t, o) {
|
|
315
315
|
var l = t.itemSize;
|
|
316
|
-
return
|
|
316
|
+
return o * l;
|
|
317
317
|
},
|
|
318
|
-
getItemSize: function(t,
|
|
318
|
+
getItemSize: function(t, o) {
|
|
319
319
|
var l = t.itemSize;
|
|
320
320
|
return l;
|
|
321
321
|
},
|
|
322
322
|
getEstimatedTotalSize: function(t) {
|
|
323
|
-
var
|
|
324
|
-
return l *
|
|
323
|
+
var o = t.itemCount, l = t.itemSize;
|
|
324
|
+
return l * o;
|
|
325
325
|
},
|
|
326
|
-
getOffsetForIndexAndAlignment: function(t,
|
|
327
|
-
var v = t.direction, S = t.height, y = t.itemCount, g = t.itemSize, w = t.layout, b = t.width, z = v === "horizontal" || w === "horizontal", p = z ? b : S, e = Math.max(0, y * g - p),
|
|
328
|
-
switch (l === "smart" && (a >=
|
|
326
|
+
getOffsetForIndexAndAlignment: function(t, o, l, a, I, m) {
|
|
327
|
+
var v = t.direction, S = t.height, y = t.itemCount, g = t.itemSize, w = t.layout, b = t.width, z = v === "horizontal" || w === "horizontal", p = z ? b : S, e = Math.max(0, y * g - p), i = Math.min(e, o * g), n = Math.max(0, o * g - p + g + m);
|
|
328
|
+
switch (l === "smart" && (a >= n - p && a <= i + p ? l = "auto" : l = "center"), l) {
|
|
329
329
|
case "start":
|
|
330
|
-
return
|
|
330
|
+
return i;
|
|
331
331
|
case "end":
|
|
332
|
-
return
|
|
332
|
+
return n;
|
|
333
333
|
case "center": {
|
|
334
|
-
var s = Math.round(
|
|
334
|
+
var s = Math.round(n + (i - n) / 2);
|
|
335
335
|
return s < Math.ceil(p / 2) ? 0 : s > e + Math.floor(p / 2) ? e : s;
|
|
336
336
|
}
|
|
337
337
|
case "auto":
|
|
338
338
|
default:
|
|
339
|
-
return a >=
|
|
339
|
+
return a >= n && a <= i ? a : a < n ? n : i;
|
|
340
340
|
}
|
|
341
341
|
},
|
|
342
|
-
getStartIndexForOffset: function(t,
|
|
342
|
+
getStartIndexForOffset: function(t, o) {
|
|
343
343
|
var l = t.itemCount, a = t.itemSize;
|
|
344
|
-
return Math.max(0, Math.min(l - 1, Math.floor(
|
|
344
|
+
return Math.max(0, Math.min(l - 1, Math.floor(o / a)));
|
|
345
345
|
},
|
|
346
|
-
getStopIndexForStartIndex: function(t,
|
|
347
|
-
var a = t.direction, I = t.height, m = t.itemCount, v = t.itemSize, S = t.layout, y = t.width, g = a === "horizontal" || S === "horizontal", w =
|
|
346
|
+
getStopIndexForStartIndex: function(t, o, l) {
|
|
347
|
+
var a = t.direction, I = t.height, m = t.itemCount, v = t.itemSize, S = t.layout, y = t.width, g = a === "horizontal" || S === "horizontal", w = o * v, b = g ? y : I, z = Math.ceil((b + l - w) / v);
|
|
348
348
|
return Math.max(0, Math.min(
|
|
349
349
|
m - 1,
|
|
350
|
-
|
|
350
|
+
o + z - 1
|
|
351
351
|
// -1 is because stop index is inclusive
|
|
352
352
|
));
|
|
353
353
|
},
|
|
@@ -355,51 +355,51 @@ var me = function(t, i) {
|
|
|
355
355
|
},
|
|
356
356
|
shouldResetStyleCacheOnItemSizeChange: !0,
|
|
357
357
|
validateProps: function(t) {
|
|
358
|
-
var
|
|
359
|
-
if (process.env.NODE_ENV !== "production" && typeof
|
|
360
|
-
throw Error('An invalid "itemSize" prop has been specified. Value should be a number. ' + ('"' + (
|
|
358
|
+
var o = t.itemSize;
|
|
359
|
+
if (process.env.NODE_ENV !== "production" && typeof o != "number")
|
|
360
|
+
throw Error('An invalid "itemSize" prop has been specified. Value should be a number. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
function ge() {
|
|
364
|
-
const [r, t] =
|
|
365
|
-
return
|
|
364
|
+
const [r, t] = W.useState([500, 500]), o = W.useRef(null);
|
|
365
|
+
return W.useEffect(() => {
|
|
366
366
|
const l = () => {
|
|
367
|
-
if (
|
|
368
|
-
const a =
|
|
367
|
+
if (o.current) {
|
|
368
|
+
const a = o.current.getBoundingClientRect();
|
|
369
369
|
t([a.width, a.height]);
|
|
370
370
|
}
|
|
371
371
|
};
|
|
372
372
|
return l(), window.addEventListener("resize", l), () => {
|
|
373
373
|
window.removeEventListener("resize", l);
|
|
374
374
|
};
|
|
375
|
-
}, []), [
|
|
375
|
+
}, []), [o, ...r];
|
|
376
|
+
}
|
|
377
|
+
function Se(r) {
|
|
378
|
+
return /* @__PURE__ */ N(le, { ...r });
|
|
376
379
|
}
|
|
377
|
-
const Se = N.forwardRef(function(t, i) {
|
|
378
|
-
return /* @__PURE__ */ R(le, { scrollerRef: i, ...t });
|
|
379
|
-
});
|
|
380
380
|
function Oe(r) {
|
|
381
381
|
const {
|
|
382
382
|
className: t,
|
|
383
|
-
itemCount:
|
|
383
|
+
itemCount: o,
|
|
384
384
|
itemHeight: l,
|
|
385
385
|
renderItem: a,
|
|
386
386
|
initialScrollOffset: I,
|
|
387
387
|
onScrollUpdate: m
|
|
388
388
|
} = r, v = m ? (w) => m == null ? void 0 : m(w.scrollOffset) : void 0, [S, y, g] = ge();
|
|
389
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ N("div", { ref: S, className: oe(se.virtual, t), children: /* @__PURE__ */ N(
|
|
390
390
|
ve,
|
|
391
391
|
{
|
|
392
392
|
outerElementType: Se,
|
|
393
393
|
width: y,
|
|
394
394
|
height: g,
|
|
395
|
-
itemCount:
|
|
395
|
+
itemCount: o,
|
|
396
396
|
itemSize: l,
|
|
397
397
|
initialScrollOffset: I,
|
|
398
398
|
onScroll: v,
|
|
399
399
|
children: ({
|
|
400
400
|
index: w,
|
|
401
401
|
style: b
|
|
402
|
-
}) => /* @__PURE__ */
|
|
402
|
+
}) => /* @__PURE__ */ N("div", { style: b, children: a(w) })
|
|
403
403
|
}
|
|
404
404
|
) });
|
|
405
405
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import d from "react";
|
|
3
|
-
import
|
|
3
|
+
import l from "../Layout/Flex/Flex.js";
|
|
4
4
|
import { Text as i } from "../Text/Text.js";
|
|
5
5
|
import "../../utils/ui/ui.js";
|
|
6
6
|
import t from "./ButtonLink.js";
|
|
@@ -8,5 +8,6 @@ export interface LoafProps {
|
|
|
8
8
|
bright?: boolean;
|
|
9
9
|
className?: string;
|
|
10
10
|
children: React.ReactNode;
|
|
11
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
11
12
|
}
|
|
12
|
-
export declare
|
|
13
|
+
export declare function Loaf(props: LoafProps): import("react/jsx-runtime").JSX.Element;
|