@pismo/marola 0.0.1-alpha.16 → 0.0.1-alpha.18
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/{Button-B1umG8kJ.js → Button-2b1peDFT.js} +25 -26
- package/dist/{ClickAwayListener-HI1G6ob9.js → ClickAwayListener-BSW-Nd-y.js} +3 -3
- package/dist/{Popup-DFJQc_jn.js → Popup-B6ZSGIEI.js} +12 -13
- package/dist/{Portal-D__zvwbZ.js → Portal-DIeBsWdL.js} +2 -2
- package/dist/{SelectButton-DWZ2BRaX.js → SelectButton-pciwIWcj.js} +24 -22
- package/dist/assets/Chip.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/PageHeader.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- package/dist/assets/TextDisplay.css +1 -0
- package/dist/{combineHooksSlotProps-BHqhiBfc.js → combineHooksSlotProps-DVjg9PRh.js} +18 -19
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +15 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +31 -0
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +1 -1
- package/dist/components/Dialog/Dialog.js +15 -16
- package/dist/components/Dialog/Dialog.stories.d.ts +3 -3
- package/dist/components/Icon/Icon.d.ts +10 -1
- package/dist/components/Icon/Icon.js +39 -25
- package/dist/components/Icon/Icon.stories.d.ts +16 -0
- package/dist/components/IconButton/Icon.stories.d.ts +15 -0
- package/dist/components/IconButton/IconButton.d.ts +14 -0
- package/dist/components/IconButton/IconButton.js +1 -1
- package/dist/components/Input/Input.js +38 -39
- package/dist/components/PageHeader/PageHeader.js +23 -23
- package/dist/components/Pagination/Pagination.d.ts +24 -5
- package/dist/components/Pagination/Pagination.js +119 -116
- package/dist/components/Pagination/Pagination.stories.d.ts +17 -0
- package/dist/components/Select/Select.js +137 -138
- package/dist/components/Select/SelectButton.js +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +10 -3
- package/dist/components/Skeleton/Skeleton.js +12 -15
- package/dist/components/Skeleton/Skeleton.stories.d.ts +14 -0
- package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +14 -0
- package/dist/components/Skeleton/SkeletonTable.stories.d.ts +16 -0
- package/dist/components/Snackbar/Snackbar.js +6 -7
- package/dist/components/Snackbar/Snackbar.stories.d.ts +3 -3
- package/dist/components/SortTooltip/SortTooltip.d.ts +3 -1
- package/dist/components/SortTooltip/SortTooltip.js +27 -16
- package/dist/components/Stepper/Stepper.d.ts +11 -1
- package/dist/components/Stepper/Stepper.stories.d.ts +16 -0
- package/dist/components/Table/Table.js +38 -40
- package/dist/components/Tabs/Tab.d.ts +5 -0
- package/dist/components/Tabs/Tab.js +9 -10
- package/dist/components/Tabs/Tab.stories.d.ts +15 -0
- package/dist/components/Tabs/TabPanel.d.ts +4 -0
- package/dist/components/Tabs/TabPanel.js +13 -14
- package/dist/components/Tabs/TabPanel.stories.d.ts +14 -0
- package/dist/components/Tabs/Tabs.d.ts +5 -1
- package/dist/components/Tabs/Tabs.js +36 -37
- package/dist/components/Tabs/Tabs.stories.d.ts +14 -0
- package/dist/components/TextDisplay/TextDisplay.d.ts +23 -0
- package/dist/components/TextDisplay/TextDisplay.js +37 -0
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +13 -0
- package/dist/components/TextDisplay/textDisplay.test.d.ts +1 -0
- package/dist/components/Toggle/Toggle.js +7 -8
- package/dist/components/Tooltip/Tooltip.d.ts +18 -6
- package/dist/components/Tooltip/Tooltip.js +104 -92
- package/dist/components/Tooltip/Tooltip.stories.d.ts +33 -0
- package/dist/components/Typography/Typography.d.ts +2 -0
- package/dist/components/Typography/Typography.js +40 -29
- package/dist/components/Typography/Typography.stories.d.ts +1 -0
- package/dist/{index-CqjC7P5Y.js → index-CH45lKw7.js} +333 -307
- package/dist/{index-BJ8HbRCy.js → index-CjW42-M-.js} +5 -6
- package/dist/main.d.ts +5 -1
- package/dist/main.js +34 -32
- package/dist/marola.css +1 -0
- package/dist/{useButton-Bc8IAgyk.js → useButton-DNk3wrQp.js} +3 -4
- package/dist/{useEventCallback-vAfOD-oT.js → useEventCallback-xTG9piMa.js} +1 -1
- package/dist/{useList-ByMguSS_.js → useList-B0hog_3-.js} +48 -49
- package/package.json +2 -2
- package/dist/_commonjsHelpers-CT_km90n.js +0 -30
- package/dist/components/Advice/Advice.stories.js +0 -48
- package/dist/components/Button/Button.stories.js +0 -40
- package/dist/components/Chip/Chip.stories.js +0 -59
- package/dist/components/Chip/chip.test.js +0 -17303
- package/dist/components/Dialog/Dialog.stories.js +0 -59
- package/dist/components/Input/Input.stories.js +0 -106
- package/dist/components/InputSearch/InputSearch.stories.js +0 -73
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +0 -38
- package/dist/components/PageHeader/PageHeader.stories.js +0 -49
- package/dist/components/Select/Select.stories.js +0 -89
- package/dist/components/Snackbar/Snackbar.stories.js +0 -62
- package/dist/components/Toggle/Toggle.stories.js +0 -33
- package/dist/components/Typography/Typography.stories.js +0 -30
- package/dist/components/Typography/typography.test.js +0 -234
- package/dist/magic-string.es-O_8lTkE3.js +0 -738
- package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +0 -26
- package/dist/react.esm-DGd9_oKA.js +0 -11126
- package/dist/utils/styleStrings.test.js +0 -41
- package/dist/vi.Y_w82WR8-XVYrIxgm.js +0 -9861
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import '../../assets/PageHeader.css';
|
|
2
2
|
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as n } from "../../clsx-DB4S2d7J.js";
|
|
4
4
|
import * as _ from "react";
|
|
5
|
-
const
|
|
5
|
+
const w = (c) => /* @__PURE__ */ _.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", "data-waves-icon": "fa/solid/arrow-left", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
|
|
6
6
|
fill: "currentcolor",
|
|
7
7
|
color: "currentcolor",
|
|
8
8
|
width: "1em",
|
|
9
9
|
height: "1em"
|
|
10
|
-
}, ...
|
|
11
|
-
"page-header": "_page-
|
|
12
|
-
"page-header__top-content": "_page-header__top-
|
|
13
|
-
"page-header__main-content": "_page-header__main-
|
|
14
|
-
"page-header__bottom-content": "_page-header__bottom-
|
|
15
|
-
"page-header__main-left-content": "_page-header__main-left-
|
|
10
|
+
}, ...c }, /* @__PURE__ */ _.createElement("path", { d: "M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z" })), b = "_title_fxc86_47", N = "_subtitle_fxc86_48", e = {
|
|
11
|
+
"page-header": "_page-header_fxc86_1",
|
|
12
|
+
"page-header__top-content": "_page-header__top-content_fxc86_10",
|
|
13
|
+
"page-header__main-content": "_page-header__main-content_fxc86_13",
|
|
14
|
+
"page-header__bottom-content": "_page-header__bottom-content_fxc86_13",
|
|
15
|
+
"page-header__main-left-content": "_page-header__main-left-content_fxc86_41",
|
|
16
16
|
title: b,
|
|
17
|
-
subtitle:
|
|
18
|
-
"page-header__main-right-content": "_page-header__main-right-
|
|
19
|
-
},
|
|
20
|
-
title:
|
|
17
|
+
subtitle: N,
|
|
18
|
+
"page-header__main-right-content": "_page-header__main-right-content_fxc86_65"
|
|
19
|
+
}, H = ({
|
|
20
|
+
title: c,
|
|
21
21
|
subtitle: d,
|
|
22
|
-
backLinkText:
|
|
22
|
+
backLinkText: r,
|
|
23
23
|
onBackLinkClick: s,
|
|
24
24
|
rightChildren: i,
|
|
25
25
|
bottomChildren: o,
|
|
@@ -29,23 +29,23 @@ const z = (n) => /* @__PURE__ */ _.createElement("svg", { xmlns: "http://www.w3.
|
|
|
29
29
|
classNameSubtitle: p,
|
|
30
30
|
"data-testid-wrapper": g,
|
|
31
31
|
"data-testid-backLink": f,
|
|
32
|
-
"data-testid-title":
|
|
33
|
-
"data-testid-subtitle":
|
|
34
|
-
...
|
|
35
|
-
}) => /* @__PURE__ */ a("div", { className:
|
|
36
|
-
|
|
37
|
-
/* @__PURE__ */ t(
|
|
38
|
-
|
|
32
|
+
"data-testid-title": x,
|
|
33
|
+
"data-testid-subtitle": u,
|
|
34
|
+
...v
|
|
35
|
+
}) => /* @__PURE__ */ a("div", { className: n([e["page-header"], l]), "data-testid": g, ...v, children: [
|
|
36
|
+
r && /* @__PURE__ */ t("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ a("button", { type: "button", onClick: s, className: h, "data-testid": f, children: [
|
|
37
|
+
/* @__PURE__ */ t(w, { fontSize: 16 }),
|
|
38
|
+
r
|
|
39
39
|
] }) }),
|
|
40
40
|
/* @__PURE__ */ a("div", { className: e["page-header__main-content"], children: [
|
|
41
41
|
/* @__PURE__ */ a("div", { className: e["page-header__main-left-content"], children: [
|
|
42
|
-
/* @__PURE__ */ t("h1", { className:
|
|
43
|
-
/* @__PURE__ */ t("h2", { className:
|
|
42
|
+
/* @__PURE__ */ t("h1", { className: n(e.title, m), "data-testid": x, children: c }),
|
|
43
|
+
/* @__PURE__ */ t("h2", { className: n(e.subtitle, p), "data-testid": u, children: d })
|
|
44
44
|
] }),
|
|
45
45
|
i && /* @__PURE__ */ t("div", { className: e["page-header__main-right-content"], children: i })
|
|
46
46
|
] }),
|
|
47
47
|
o && /* @__PURE__ */ t("div", { className: e["page-header__bottom-content"], children: o })
|
|
48
48
|
] });
|
|
49
49
|
export {
|
|
50
|
-
|
|
50
|
+
H as PageHeader
|
|
51
51
|
};
|
|
@@ -1,36 +1,55 @@
|
|
|
1
1
|
export type PaginationParams = {
|
|
2
|
+
/** Total number of items to paginate */
|
|
2
3
|
totalItems: number;
|
|
4
|
+
/** Number of items to show per page */
|
|
3
5
|
perPage: number;
|
|
6
|
+
/** Current page */
|
|
4
7
|
currentPage: number;
|
|
5
8
|
};
|
|
6
9
|
export type PaginationTranslations = {
|
|
10
|
+
/** Translation text for `showing` */
|
|
7
11
|
showing: string;
|
|
12
|
+
/** Translation text for `of` */
|
|
8
13
|
of: string;
|
|
14
|
+
/** Translation text for `result` */
|
|
9
15
|
results: string;
|
|
16
|
+
/** Translation text for `previous` */
|
|
10
17
|
previous: string;
|
|
18
|
+
/** Translation text for `next` */
|
|
11
19
|
next: string;
|
|
12
20
|
};
|
|
13
21
|
type PaginationLanguages = 'pt' | 'en';
|
|
14
22
|
type PaginationCommonProps = {
|
|
23
|
+
/** CSS classes to be applied on the container element */
|
|
15
24
|
className?: string;
|
|
16
|
-
|
|
25
|
+
/** CSS classes to be applied on the per page element */
|
|
17
26
|
classNamePerPage?: string;
|
|
18
|
-
|
|
27
|
+
/** CSS classes to be applied on the pages navigation element */
|
|
19
28
|
classNamePagesNav?: string;
|
|
20
|
-
|
|
29
|
+
/** Id to be applied as `data-testid` on the container element */
|
|
30
|
+
'data-testid'?: string;
|
|
31
|
+
/** Id to be applied as `data-testid` on per page element */
|
|
32
|
+
'data-testid-per-page'?: string;
|
|
33
|
+
/** Id to be applied as `data-testid` on the pages navigation element */
|
|
34
|
+
'data-testid-pages-nav'?: string;
|
|
21
35
|
};
|
|
22
36
|
export type PaginationProps = {
|
|
37
|
+
/** Array of options to be rendered as per page options. */
|
|
23
38
|
perPageOptions?: (number | {
|
|
24
39
|
value: number;
|
|
25
40
|
label: string;
|
|
26
41
|
})[] | undefined;
|
|
42
|
+
/** Callback called when page changes. */
|
|
27
43
|
onPageChange: (page: number) => void;
|
|
28
|
-
|
|
44
|
+
/** Callback called when items per page changes. */
|
|
45
|
+
onRowsPerPageChange: (perPage: number) => void;
|
|
46
|
+
/** Language to be used for texts. */
|
|
29
47
|
language?: PaginationLanguages;
|
|
48
|
+
/** Custom translation object to be used for texts. */
|
|
30
49
|
t?: PaginationTranslations;
|
|
31
50
|
} & PaginationParams & PaginationCommonProps;
|
|
32
51
|
export declare const paginationDefaultTranslations: {
|
|
33
52
|
[key in PaginationLanguages]: PaginationTranslations;
|
|
34
53
|
};
|
|
35
|
-
export declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare const Pagination: ({ perPageOptions, language, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
55
|
export {};
|
|
@@ -1,112 +1,114 @@
|
|
|
1
1
|
import '../../assets/Pagination.css';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { jsxs as m, jsx as o, Fragment as M } from "react/jsx-runtime";
|
|
3
|
+
import { c as p } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import { Select as k } from "../Select/Select.js";
|
|
5
|
+
import { _ as A, b as E } from "../../index-CH45lKw7.js";
|
|
6
|
+
import { u as $ } from "../../useControlled-CCMYYdCM.js";
|
|
7
|
+
const R = ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"];
|
|
8
|
+
function T(g = {}) {
|
|
8
9
|
const {
|
|
9
10
|
boundaryCount: a = 1,
|
|
10
|
-
componentName:
|
|
11
|
+
componentName: e = "usePagination",
|
|
11
12
|
count: s = 1,
|
|
12
|
-
defaultPage:
|
|
13
|
-
disabled:
|
|
14
|
-
hideNextButton:
|
|
15
|
-
hidePrevButton:
|
|
16
|
-
onChange:
|
|
17
|
-
page:
|
|
18
|
-
showFirstButton:
|
|
19
|
-
showLastButton:
|
|
20
|
-
siblingCount:
|
|
21
|
-
} =
|
|
22
|
-
controlled:
|
|
23
|
-
default:
|
|
24
|
-
name:
|
|
13
|
+
defaultPage: v = 1,
|
|
14
|
+
disabled: _ = !1,
|
|
15
|
+
hideNextButton: f = !1,
|
|
16
|
+
hidePrevButton: u = !1,
|
|
17
|
+
onChange: h,
|
|
18
|
+
page: n,
|
|
19
|
+
showFirstButton: r = !1,
|
|
20
|
+
showLastButton: x = !1,
|
|
21
|
+
siblingCount: d = 1
|
|
22
|
+
} = g, b = A(g, R), [i, S] = $({
|
|
23
|
+
controlled: n,
|
|
24
|
+
default: v,
|
|
25
|
+
name: e,
|
|
25
26
|
state: "page"
|
|
26
|
-
}), N = (
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
const F =
|
|
27
|
+
}), N = (t, c) => {
|
|
28
|
+
n || S(c), h && h(t, c);
|
|
29
|
+
}, C = (t, c) => {
|
|
30
|
+
const F = c - t + 1;
|
|
30
31
|
return Array.from({
|
|
31
32
|
length: F
|
|
32
|
-
}, (
|
|
33
|
-
},
|
|
33
|
+
}, (z, I) => t + I);
|
|
34
|
+
}, L = C(1, Math.min(a, s)), P = C(Math.max(s - a + 1, a + 1), s), y = Math.max(
|
|
34
35
|
Math.min(
|
|
35
36
|
// Natural start
|
|
36
|
-
|
|
37
|
+
i - d,
|
|
37
38
|
// Lower boundary when page is high
|
|
38
|
-
s - a -
|
|
39
|
+
s - a - d * 2 - 1
|
|
39
40
|
),
|
|
40
41
|
// Greater than startPages
|
|
41
42
|
a + 2
|
|
42
43
|
), B = Math.min(
|
|
43
44
|
Math.max(
|
|
44
45
|
// Natural end
|
|
45
|
-
|
|
46
|
+
i + d,
|
|
46
47
|
// Upper boundary when page is low
|
|
47
|
-
a +
|
|
48
|
+
a + d * 2 + 2
|
|
48
49
|
),
|
|
49
50
|
// Less than endPages
|
|
50
51
|
P.length > 0 ? P[0] - 2 : s - 1
|
|
51
|
-
),
|
|
52
|
-
...
|
|
53
|
-
...
|
|
54
|
-
...
|
|
52
|
+
), j = [
|
|
53
|
+
...r ? ["first"] : [],
|
|
54
|
+
...u ? [] : ["previous"],
|
|
55
|
+
...L,
|
|
55
56
|
// Start ellipsis
|
|
56
57
|
// eslint-disable-next-line no-nested-ternary
|
|
57
|
-
...
|
|
58
|
+
...y > a + 2 ? ["start-ellipsis"] : a + 1 < s - a ? [a + 1] : [],
|
|
58
59
|
// Sibling pages
|
|
59
|
-
...
|
|
60
|
+
...C(y, B),
|
|
60
61
|
// End ellipsis
|
|
61
62
|
// eslint-disable-next-line no-nested-ternary
|
|
62
63
|
...B < s - a - 1 ? ["end-ellipsis"] : s - a > a ? [s - a] : [],
|
|
63
64
|
...P,
|
|
64
|
-
...
|
|
65
|
-
...
|
|
66
|
-
],
|
|
67
|
-
switch (
|
|
65
|
+
...f ? [] : ["next"],
|
|
66
|
+
...x ? ["last"] : []
|
|
67
|
+
], w = (t) => {
|
|
68
|
+
switch (t) {
|
|
68
69
|
case "first":
|
|
69
70
|
return 1;
|
|
70
71
|
case "previous":
|
|
71
|
-
return
|
|
72
|
+
return i - 1;
|
|
72
73
|
case "next":
|
|
73
|
-
return
|
|
74
|
+
return i + 1;
|
|
74
75
|
case "last":
|
|
75
76
|
return s;
|
|
76
77
|
default:
|
|
77
78
|
return null;
|
|
78
79
|
}
|
|
79
|
-
}, D =
|
|
80
|
-
onClick: (
|
|
81
|
-
N(
|
|
80
|
+
}, D = j.map((t) => typeof t == "number" ? {
|
|
81
|
+
onClick: (c) => {
|
|
82
|
+
N(c, t);
|
|
82
83
|
},
|
|
83
84
|
type: "page",
|
|
84
|
-
page:
|
|
85
|
-
selected:
|
|
86
|
-
disabled:
|
|
87
|
-
"aria-current":
|
|
85
|
+
page: t,
|
|
86
|
+
selected: t === i,
|
|
87
|
+
disabled: _,
|
|
88
|
+
"aria-current": t === i ? "true" : void 0
|
|
88
89
|
} : {
|
|
89
|
-
onClick: (
|
|
90
|
-
N(
|
|
90
|
+
onClick: (c) => {
|
|
91
|
+
N(c, w(t));
|
|
91
92
|
},
|
|
92
|
-
type:
|
|
93
|
-
page:
|
|
93
|
+
type: t,
|
|
94
|
+
page: w(t),
|
|
94
95
|
selected: !1,
|
|
95
|
-
disabled:
|
|
96
|
+
disabled: _ || t.indexOf("ellipsis") === -1 && (t === "next" || t === "last" ? i >= s : i <= 1)
|
|
96
97
|
});
|
|
97
|
-
return
|
|
98
|
+
return E({
|
|
98
99
|
items: D
|
|
99
|
-
},
|
|
100
|
+
}, b);
|
|
100
101
|
}
|
|
101
|
-
const
|
|
102
|
-
pagination:
|
|
103
|
-
"per-page-container": "_per-page-
|
|
104
|
-
"
|
|
105
|
-
"pages-navigator-
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
|
|
102
|
+
const W = "_pagination_n3y7g_1", l = {
|
|
103
|
+
pagination: W,
|
|
104
|
+
"per-page-container": "_per-page-container_n3y7g_8",
|
|
105
|
+
"per-page-container__select": "_per-page-container__select_n3y7g_17",
|
|
106
|
+
"pages-navigator-container": "_pages-navigator-container_n3y7g_22",
|
|
107
|
+
"pages-navigator-container__label": "_pages-navigator-container__label_n3y7g_37",
|
|
108
|
+
"page-number__btn": "_page-number__btn_n3y7g_37",
|
|
109
|
+
"pages-navigator-container__previous-next-btn": "_pages-navigator-container__previous-next-btn_n3y7g_50",
|
|
110
|
+
"page-number__btn--selected": "_page-number__btn--selected_n3y7g_75"
|
|
111
|
+
}, q = {
|
|
110
112
|
pt: {
|
|
111
113
|
showing: "Exibindo",
|
|
112
114
|
of: "de",
|
|
@@ -121,90 +123,91 @@ const R = "_pagination_9gf1w_1", g = {
|
|
|
121
123
|
previous: "Previous",
|
|
122
124
|
next: "Next"
|
|
123
125
|
}
|
|
124
|
-
},
|
|
125
|
-
const
|
|
126
|
-
count:
|
|
126
|
+
}, U = ({ perPageOptions: g = [5, 10, 25, 50, 100], language: a = "en", ...e }) => {
|
|
127
|
+
const s = Math.ceil(e.totalItems / e.perPage), v = e.currentPage <= 1, _ = e.currentPage >= s, f = e.t || q[a], u = (n) => f[n], { items: h } = T({
|
|
128
|
+
count: s,
|
|
127
129
|
hideNextButton: !0,
|
|
128
130
|
hidePrevButton: !0,
|
|
129
131
|
page: e.currentPage,
|
|
130
|
-
onChange: (t, o) => e.onPageChange(o),
|
|
131
132
|
siblingCount: 1,
|
|
132
|
-
boundaryCount: 2
|
|
133
|
+
boundaryCount: 2,
|
|
134
|
+
onChange: (n, r) => e.onPageChange(r)
|
|
133
135
|
});
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ m("div", { className: p(l.pagination, e.className), "data-testid": e["data-testid"], children: [
|
|
137
|
+
/* @__PURE__ */ o(
|
|
136
138
|
"div",
|
|
137
139
|
{
|
|
138
|
-
className:
|
|
139
|
-
"data-testid": e["data-
|
|
140
|
-
children:
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
140
|
+
className: p(l["per-page-container"], e.classNamePerPage),
|
|
141
|
+
"data-testid": e["data-testid-per-page"],
|
|
142
|
+
children: g && /* @__PURE__ */ m(M, { children: [
|
|
143
|
+
/* @__PURE__ */ o("span", { children: u`showing` }),
|
|
144
|
+
/* @__PURE__ */ o(
|
|
145
|
+
k,
|
|
144
146
|
{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"option",
|
|
147
|
+
className: l["per-page-container__select"],
|
|
148
|
+
value: String(e.perPage),
|
|
149
|
+
onChange: (n) => e.onRowsPerPageChange(Number(n)),
|
|
150
|
+
children: g == null ? void 0 : g.map((n) => {
|
|
151
|
+
const r = typeof n == "number";
|
|
152
|
+
return /* @__PURE__ */ o(
|
|
153
|
+
k.Option,
|
|
153
154
|
{
|
|
154
|
-
value:
|
|
155
|
-
children:
|
|
155
|
+
value: String(r ? n : n.value),
|
|
156
|
+
children: r ? n : n.label
|
|
156
157
|
},
|
|
157
|
-
`per-page__${
|
|
158
|
+
`per-page__${r ? n : n.value}`
|
|
158
159
|
);
|
|
159
160
|
})
|
|
160
161
|
}
|
|
161
162
|
),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
/* @__PURE__ */ m("span", { children: [
|
|
164
|
+
u`of`,
|
|
165
|
+
" ",
|
|
166
|
+
/* @__PURE__ */ o("strong", { children: e.totalItems }),
|
|
167
|
+
" ",
|
|
168
|
+
u`results`
|
|
169
|
+
] })
|
|
167
170
|
] })
|
|
168
171
|
}
|
|
169
172
|
),
|
|
170
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ m(
|
|
171
174
|
"div",
|
|
172
175
|
{
|
|
173
|
-
className:
|
|
174
|
-
"data-testid": e["data-
|
|
176
|
+
className: p(l["pages-navigator-container"], e.classNamePagesNav),
|
|
177
|
+
"data-testid": e["data-testid-pages-nav"],
|
|
175
178
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ o(
|
|
177
180
|
"button",
|
|
178
181
|
{
|
|
179
|
-
className:
|
|
180
|
-
disabled:
|
|
182
|
+
className: l["pages-navigator-container__previous-next-btn"],
|
|
183
|
+
disabled: v,
|
|
181
184
|
onClick: () => e.onPageChange(e.currentPage - 1),
|
|
182
185
|
type: "button",
|
|
183
|
-
children:
|
|
186
|
+
children: u`previous`
|
|
184
187
|
},
|
|
185
188
|
"page__previous"
|
|
186
189
|
),
|
|
187
|
-
|
|
188
|
-
let
|
|
189
|
-
return
|
|
190
|
+
/* @__PURE__ */ o("ul", { children: h.map(({ page: n, type: r, selected: x, ...d }, b) => {
|
|
191
|
+
let i = /* @__PURE__ */ o(M, {});
|
|
192
|
+
return r === "start-ellipsis" || r === "end-ellipsis" ? i = /* @__PURE__ */ o("span", { className: l["pages-navigator-container__label"], children: "..." }) : r === "page" ? i = /* @__PURE__ */ o(
|
|
190
193
|
"button",
|
|
191
194
|
{
|
|
192
|
-
className: [
|
|
193
|
-
onClick: () => e.onPageChange(
|
|
195
|
+
className: p(l["page-number__btn"], x && l["page-number__btn--selected"]),
|
|
196
|
+
onClick: () => e.onPageChange(n || 0),
|
|
194
197
|
type: "button",
|
|
195
|
-
children:
|
|
198
|
+
children: n
|
|
196
199
|
},
|
|
197
|
-
`page__${
|
|
198
|
-
) :
|
|
199
|
-
}),
|
|
200
|
-
/* @__PURE__ */
|
|
200
|
+
`page__${b}`
|
|
201
|
+
) : i = /* @__PURE__ */ o("button", { type: "button", ...d, children: r }), /* @__PURE__ */ o("li", { children: i }, b);
|
|
202
|
+
}) }),
|
|
203
|
+
/* @__PURE__ */ o(
|
|
201
204
|
"button",
|
|
202
205
|
{
|
|
203
|
-
className:
|
|
204
|
-
disabled:
|
|
206
|
+
className: l["pages-navigator-container__previous-next-btn"],
|
|
207
|
+
disabled: _,
|
|
205
208
|
onClick: () => e.onPageChange(e.currentPage + 1),
|
|
206
209
|
type: "button",
|
|
207
|
-
children:
|
|
210
|
+
children: u`next`
|
|
208
211
|
},
|
|
209
212
|
"page__next"
|
|
210
213
|
)
|
|
@@ -214,6 +217,6 @@ const R = "_pagination_9gf1w_1", g = {
|
|
|
214
217
|
] });
|
|
215
218
|
};
|
|
216
219
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
220
|
+
U as Pagination,
|
|
221
|
+
q as paginationDefaultTranslations
|
|
219
222
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PaginationProps } from '../../main';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ perPageOptions, language, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Simple: Story;
|
|
15
|
+
export declare const WithCustomPerPageOptions: Story;
|
|
16
|
+
export declare const WithLanguage: Story;
|
|
17
|
+
export declare const WithCustomTexts: Story;
|