@ktnpm_devops/react-component 0.14.0 → 0.15.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/dist/charts/GroupedBarChartCard/GroupedBarChartCard.d.ts +7 -0
- package/dist/charts/GroupedBarChartCard/GroupedBarChartCard.d.ts.map +1 -0
- package/dist/charts/GroupedBarChartCard/GroupedBarChartCard.types.d.ts +38 -0
- package/dist/charts/GroupedBarChartCard/GroupedBarChartCard.types.d.ts.map +1 -0
- package/dist/charts/GroupedBarChartCard/buildGroupedBarOption.d.ts +69 -0
- package/dist/charts/GroupedBarChartCard/buildGroupedBarOption.d.ts.map +1 -0
- package/dist/charts/GroupedBarChartCard/buildGroupedBarOption.test.d.ts +2 -0
- package/dist/charts/GroupedBarChartCard/buildGroupedBarOption.test.d.ts.map +1 -0
- package/dist/charts/GroupedBarChartCard/defaultLabels.d.ts +5 -0
- package/dist/charts/GroupedBarChartCard/defaultLabels.d.ts.map +1 -0
- package/dist/charts/GroupedBarChartCard/index.d.ts +3 -0
- package/dist/charts/GroupedBarChartCard/index.d.ts.map +1 -0
- package/dist/charts/GroupedBarChartCard/pivotGroupedBars.d.ts +22 -0
- package/dist/charts/GroupedBarChartCard/pivotGroupedBars.d.ts.map +1 -0
- package/dist/charts/GroupedBarChartCard/pivotGroupedBars.test.d.ts +2 -0
- package/dist/charts/GroupedBarChartCard/pivotGroupedBars.test.d.ts.map +1 -0
- package/dist/constants.d.ts +28 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.cjs +29 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -27
- package/dist/index.js.map +1 -1
- package/dist/index10.cjs +2 -2
- package/dist/index10.js +2 -2
- package/dist/index100.cjs +8 -50
- package/dist/index100.cjs.map +1 -1
- package/dist/index100.js +9 -51
- package/dist/index100.js.map +1 -1
- package/dist/index101.cjs +2 -17
- package/dist/index101.cjs.map +1 -1
- package/dist/index101.js +3 -18
- package/dist/index101.js.map +1 -1
- package/dist/index102.cjs +2 -50
- package/dist/index102.cjs.map +1 -1
- package/dist/index102.js +3 -51
- package/dist/index102.js.map +1 -1
- package/dist/index103.cjs +64 -13
- package/dist/index103.cjs.map +1 -1
- package/dist/index103.js +65 -14
- package/dist/index103.js.map +1 -1
- package/dist/index104.cjs +19 -4
- package/dist/index104.cjs.map +1 -1
- package/dist/index104.js +19 -4
- package/dist/index104.js.map +1 -1
- package/dist/index105.cjs +16 -10
- package/dist/index105.cjs.map +1 -1
- package/dist/index105.js +17 -11
- package/dist/index105.js.map +1 -1
- package/dist/index106.cjs +134 -34
- package/dist/index106.cjs.map +1 -1
- package/dist/index106.js +133 -33
- package/dist/index106.js.map +1 -1
- package/dist/index107.cjs +38 -50
- package/dist/index107.cjs.map +1 -1
- package/dist/index107.js +38 -50
- package/dist/index107.js.map +1 -1
- package/dist/index108.cjs +25 -28
- package/dist/index108.cjs.map +1 -1
- package/dist/index108.js +25 -28
- package/dist/index108.js.map +1 -1
- package/dist/index109.cjs +34 -19
- package/dist/index109.cjs.map +1 -1
- package/dist/index109.js +35 -20
- package/dist/index109.js.map +1 -1
- package/dist/index11.cjs +2 -2
- package/dist/index11.js +2 -2
- package/dist/index110.cjs +52 -16
- package/dist/index110.cjs.map +1 -1
- package/dist/index110.js +52 -16
- package/dist/index110.js.map +1 -1
- package/dist/index111.cjs +15 -6
- package/dist/index111.cjs.map +1 -1
- package/dist/index111.js +16 -7
- package/dist/index111.js.map +1 -1
- package/dist/index112.cjs +2 -17
- package/dist/index112.cjs.map +1 -1
- package/dist/index112.js +3 -18
- package/dist/index112.js.map +1 -1
- package/dist/index113.cjs +18 -33
- package/dist/index113.cjs.map +1 -1
- package/dist/index113.js +19 -34
- package/dist/index113.js.map +1 -1
- package/dist/index114.cjs +40 -116
- package/dist/index114.cjs.map +1 -1
- package/dist/index114.js +39 -115
- package/dist/index114.js.map +1 -1
- package/dist/index115.cjs +39 -42
- package/dist/index115.cjs.map +1 -1
- package/dist/index115.js +38 -41
- package/dist/index115.js.map +1 -1
- package/dist/index116.cjs +92 -30
- package/dist/index116.cjs.map +1 -1
- package/dist/index116.js +91 -29
- package/dist/index116.js.map +1 -1
- package/dist/index117.cjs +40 -1164
- package/dist/index117.cjs.map +1 -1
- package/dist/index117.js +38 -1163
- package/dist/index117.js.map +1 -1
- package/dist/index118.cjs +102 -1562
- package/dist/index118.cjs.map +1 -1
- package/dist/index118.js +101 -1562
- package/dist/index118.js.map +1 -1
- package/dist/index119.cjs +45 -0
- package/dist/index119.cjs.map +1 -0
- package/dist/index119.js +45 -0
- package/dist/index119.js.map +1 -0
- package/dist/index12.cjs +2 -2
- package/dist/index12.js +2 -2
- package/dist/index120.cjs +87 -0
- package/dist/index120.cjs.map +1 -0
- package/dist/index120.js +87 -0
- package/dist/index120.js.map +1 -0
- package/dist/index121.cjs +27 -0
- package/dist/index121.cjs.map +1 -0
- package/dist/index121.js +27 -0
- package/dist/index121.js.map +1 -0
- package/dist/index122.cjs +1166 -0
- package/dist/index122.cjs.map +1 -0
- package/dist/index122.js +1167 -0
- package/dist/index122.js.map +1 -0
- package/dist/index123.cjs +1578 -0
- package/dist/index123.cjs.map +1 -0
- package/dist/index123.js +1579 -0
- package/dist/index123.js.map +1 -0
- package/dist/index13.cjs +2 -2
- package/dist/index13.js +2 -2
- package/dist/index14.cjs +2 -2
- package/dist/index14.js +2 -2
- package/dist/index15.cjs +2 -2
- package/dist/index15.js +2 -2
- package/dist/index16.cjs +3 -3
- package/dist/index16.js +3 -3
- package/dist/index17.cjs +2 -2
- package/dist/index17.js +2 -2
- package/dist/index18.cjs +2 -2
- package/dist/index18.js +2 -2
- package/dist/index19.cjs +2 -2
- package/dist/index19.js +2 -2
- package/dist/index20.cjs +2 -2
- package/dist/index20.js +2 -2
- package/dist/index21.cjs +2 -2
- package/dist/index21.js +2 -2
- package/dist/index22.cjs +3 -3
- package/dist/index22.js +3 -3
- package/dist/index23.cjs +3 -3
- package/dist/index23.js +3 -3
- package/dist/index24.cjs +3 -3
- package/dist/index24.js +3 -3
- package/dist/index25.cjs +2 -2
- package/dist/index25.js +2 -2
- package/dist/index26.cjs +2 -2
- package/dist/index26.js +2 -2
- package/dist/index27.cjs +2 -2
- package/dist/index27.js +2 -2
- package/dist/index28.cjs +2 -2
- package/dist/index28.js +2 -2
- package/dist/index29.cjs +3 -3
- package/dist/index29.js +3 -3
- package/dist/index30.cjs +8 -8
- package/dist/index30.js +8 -8
- package/dist/index31.cjs +84 -76
- package/dist/index31.cjs.map +1 -1
- package/dist/index31.js +86 -78
- package/dist/index31.js.map +1 -1
- package/dist/index32.cjs +75 -6
- package/dist/index32.cjs.map +1 -1
- package/dist/index32.js +76 -7
- package/dist/index32.js.map +1 -1
- package/dist/index33.cjs +7 -130
- package/dist/index33.cjs.map +1 -1
- package/dist/index33.js +9 -132
- package/dist/index33.js.map +1 -1
- package/dist/index34.cjs +127 -52
- package/dist/index34.cjs.map +1 -1
- package/dist/index34.js +129 -54
- package/dist/index34.js.map +1 -1
- package/dist/index35.cjs +49 -13
- package/dist/index35.cjs.map +1 -1
- package/dist/index35.js +51 -15
- package/dist/index35.js.map +1 -1
- package/dist/index36.cjs +20 -38
- package/dist/index36.cjs.map +1 -1
- package/dist/index36.js +21 -39
- package/dist/index36.js.map +1 -1
- package/dist/index37.cjs +36 -224
- package/dist/index37.cjs.map +1 -1
- package/dist/index37.js +37 -225
- package/dist/index37.js.map +1 -1
- package/dist/index38.cjs +220 -28
- package/dist/index38.cjs.map +1 -1
- package/dist/index38.js +222 -30
- package/dist/index38.js.map +1 -1
- package/dist/index39.cjs +30 -106
- package/dist/index39.cjs.map +1 -1
- package/dist/index39.js +31 -107
- package/dist/index39.js.map +1 -1
- package/dist/index40.cjs +100 -58
- package/dist/index40.cjs.map +1 -1
- package/dist/index40.js +101 -59
- package/dist/index40.js.map +1 -1
- package/dist/index41.cjs +66 -76
- package/dist/index41.cjs.map +1 -1
- package/dist/index41.js +67 -77
- package/dist/index41.js.map +1 -1
- package/dist/index42.cjs +76 -57
- package/dist/index42.cjs.map +1 -1
- package/dist/index42.js +78 -59
- package/dist/index42.js.map +1 -1
- package/dist/index43.cjs +56 -150
- package/dist/index43.cjs.map +1 -1
- package/dist/index43.js +58 -152
- package/dist/index43.js.map +1 -1
- package/dist/index44.cjs +128 -73
- package/dist/index44.cjs.map +1 -1
- package/dist/index44.js +123 -68
- package/dist/index44.js.map +1 -1
- package/dist/index45.cjs +94 -68
- package/dist/index45.cjs.map +1 -1
- package/dist/index45.js +96 -70
- package/dist/index45.js.map +1 -1
- package/dist/index46.cjs +71 -7
- package/dist/index46.cjs.map +1 -1
- package/dist/index46.js +72 -8
- package/dist/index46.js.map +1 -1
- package/dist/index47.cjs +8 -17
- package/dist/index47.cjs.map +1 -1
- package/dist/index47.js +9 -18
- package/dist/index47.js.map +1 -1
- package/dist/index48.cjs +15 -75
- package/dist/index48.cjs.map +1 -1
- package/dist/index48.js +16 -76
- package/dist/index48.js.map +1 -1
- package/dist/index49.cjs +68 -134
- package/dist/index49.cjs.map +1 -1
- package/dist/index49.js +70 -136
- package/dist/index49.js.map +1 -1
- package/dist/index50.cjs +137 -58
- package/dist/index50.cjs.map +1 -1
- package/dist/index50.js +138 -59
- package/dist/index50.js.map +1 -1
- package/dist/index51.cjs +61 -102
- package/dist/index51.cjs.map +1 -1
- package/dist/index51.js +62 -103
- package/dist/index51.js.map +1 -1
- package/dist/index52.cjs +102 -44
- package/dist/index52.cjs.map +1 -1
- package/dist/index52.js +103 -45
- package/dist/index52.js.map +1 -1
- package/dist/index53.cjs +47 -6
- package/dist/index53.cjs.map +1 -1
- package/dist/index53.js +48 -7
- package/dist/index53.js.map +1 -1
- package/dist/index54.cjs +6 -147
- package/dist/index54.cjs.map +1 -1
- package/dist/index54.js +7 -148
- package/dist/index54.js.map +1 -1
- package/dist/index55.cjs +146 -7
- package/dist/index55.cjs.map +1 -1
- package/dist/index55.js +148 -9
- package/dist/index55.js.map +1 -1
- package/dist/index56.cjs +6 -15
- package/dist/index56.cjs.map +1 -1
- package/dist/index56.js +6 -15
- package/dist/index56.js.map +1 -1
- package/dist/index57.cjs +14 -63
- package/dist/index57.cjs.map +1 -1
- package/dist/index57.js +16 -65
- package/dist/index57.js.map +1 -1
- package/dist/index58.cjs +67 -15
- package/dist/index58.cjs.map +1 -1
- package/dist/index58.js +66 -14
- package/dist/index58.js.map +1 -1
- package/dist/index59.cjs +15 -18
- package/dist/index59.cjs.map +1 -1
- package/dist/index59.js +15 -18
- package/dist/index59.js.map +1 -1
- package/dist/index60.cjs +7 -16
- package/dist/index60.cjs.map +1 -1
- package/dist/index60.js +8 -17
- package/dist/index60.js.map +1 -1
- package/dist/index61.cjs +5 -23
- package/dist/index61.cjs.map +1 -1
- package/dist/index61.js +6 -24
- package/dist/index61.js.map +1 -1
- package/dist/index62.cjs +17 -27
- package/dist/index62.cjs.map +1 -1
- package/dist/index62.js +16 -26
- package/dist/index62.js.map +1 -1
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +1 -1
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +1 -1
- package/dist/index65.cjs +141 -22
- package/dist/index65.cjs.map +1 -1
- package/dist/index65.js +139 -20
- package/dist/index65.js.map +1 -1
- package/dist/index66.cjs +17 -2
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +17 -2
- package/dist/index66.js.map +1 -1
- package/dist/index67.cjs +46 -10
- package/dist/index67.cjs.map +1 -1
- package/dist/index67.js +46 -10
- package/dist/index67.js.map +1 -1
- package/dist/index68.cjs +53 -2
- package/dist/index68.cjs.map +1 -1
- package/dist/index68.js +54 -3
- package/dist/index68.js.map +1 -1
- package/dist/index69.cjs +33 -17
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +32 -16
- package/dist/index69.js.map +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +1 -1
- package/dist/index71.cjs +19 -116
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +17 -114
- package/dist/index71.js.map +1 -1
- package/dist/index72.cjs +34 -28
- package/dist/index72.cjs.map +1 -1
- package/dist/index72.js +34 -28
- package/dist/index72.js.map +1 -1
- package/dist/index73.cjs +30 -18
- package/dist/index73.cjs.map +1 -1
- package/dist/index73.js +30 -18
- package/dist/index73.js.map +1 -1
- package/dist/index74.cjs +13 -19
- package/dist/index74.cjs.map +1 -1
- package/dist/index74.js +14 -20
- package/dist/index74.js.map +1 -1
- package/dist/index75.cjs +11 -5
- package/dist/index75.cjs.map +1 -1
- package/dist/index75.js +11 -5
- package/dist/index75.js.map +1 -1
- package/dist/index76.cjs +17 -2
- package/dist/index76.cjs.map +1 -1
- package/dist/index76.js +18 -3
- package/dist/index76.js.map +1 -1
- package/dist/index77.cjs +4 -64
- package/dist/index77.cjs.map +1 -1
- package/dist/index77.js +5 -65
- package/dist/index77.js.map +1 -1
- package/dist/index78.cjs +37 -19
- package/dist/index78.cjs.map +1 -1
- package/dist/index78.js +37 -19
- package/dist/index78.js.map +1 -1
- package/dist/index79.cjs +28 -13
- package/dist/index79.cjs.map +1 -1
- package/dist/index79.js +28 -13
- package/dist/index79.js.map +1 -1
- package/dist/index80.cjs +16 -19
- package/dist/index80.cjs.map +1 -1
- package/dist/index80.js +17 -20
- package/dist/index80.js.map +1 -1
- package/dist/index81.cjs +20 -33
- package/dist/index81.cjs.map +1 -1
- package/dist/index81.js +20 -33
- package/dist/index81.js.map +1 -1
- package/dist/index82.cjs +63 -37
- package/dist/index82.cjs.map +1 -1
- package/dist/index82.js +63 -37
- package/dist/index82.js.map +1 -1
- package/dist/index83.cjs +6 -23
- package/dist/index83.cjs.map +1 -1
- package/dist/index83.js +6 -23
- package/dist/index83.js.map +1 -1
- package/dist/index84.cjs +40 -20
- package/dist/index84.cjs.map +1 -1
- package/dist/index84.js +39 -19
- package/dist/index84.js.map +1 -1
- package/dist/index85.cjs +35 -13
- package/dist/index85.cjs.map +1 -1
- package/dist/index85.js +35 -13
- package/dist/index85.js.map +1 -1
- package/dist/index86.cjs +43 -60
- package/dist/index86.cjs.map +1 -1
- package/dist/index86.js +42 -59
- package/dist/index86.js.map +1 -1
- package/dist/index87.cjs +24 -51
- package/dist/index87.cjs.map +1 -1
- package/dist/index87.js +23 -50
- package/dist/index87.js.map +1 -1
- package/dist/index88.cjs +20 -40
- package/dist/index88.cjs.map +1 -1
- package/dist/index88.js +19 -39
- package/dist/index88.js.map +1 -1
- package/dist/index89.cjs +14 -85
- package/dist/index89.cjs.map +1 -1
- package/dist/index89.js +13 -84
- package/dist/index89.js.map +1 -1
- package/dist/index90.cjs +60 -39
- package/dist/index90.cjs.map +1 -1
- package/dist/index90.js +59 -38
- package/dist/index90.js.map +1 -1
- package/dist/index91.cjs +24 -92
- package/dist/index91.cjs.map +1 -1
- package/dist/index91.js +23 -91
- package/dist/index91.js.map +1 -1
- package/dist/index92.cjs +13 -34
- package/dist/index92.cjs.map +1 -1
- package/dist/index92.js +13 -34
- package/dist/index92.js.map +1 -1
- package/dist/index93.cjs +49 -13
- package/dist/index93.cjs.map +1 -1
- package/dist/index93.js +50 -14
- package/dist/index93.js.map +1 -1
- package/dist/index94.cjs +24 -36
- package/dist/index94.cjs.map +1 -1
- package/dist/index94.js +24 -36
- package/dist/index94.js.map +1 -1
- package/dist/index96.cjs +12 -36
- package/dist/index96.cjs.map +1 -1
- package/dist/index96.js +12 -36
- package/dist/index96.js.map +1 -1
- package/dist/index97.cjs +22 -16
- package/dist/index97.cjs.map +1 -1
- package/dist/index97.js +22 -16
- package/dist/index97.js.map +1 -1
- package/dist/index98.cjs +22 -134
- package/dist/index98.cjs.map +1 -1
- package/dist/index98.js +21 -133
- package/dist/index98.js.map +1 -1
- package/dist/index99.cjs +14 -38
- package/dist/index99.cjs.map +1 -1
- package/dist/index99.js +15 -39
- package/dist/index99.js.map +1 -1
- package/dist/style.css +111 -0
- package/dist/types/chart.types.d.ts +14 -0
- package/dist/types/chart.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index39.cjs
CHANGED
|
@@ -2,113 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const clsx = require("./
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Math.min(currentPage - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),
|
|
20
|
-
boundaryCount + 2
|
|
21
|
-
);
|
|
22
|
-
const siblingsEnd = Math.min(
|
|
23
|
-
Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),
|
|
24
|
-
endPages[0] - 2
|
|
25
|
-
);
|
|
26
|
-
const items = [...startPages];
|
|
27
|
-
items.push(siblingsStart > boundaryCount + 2 ? "ellipsis" : boundaryCount + 1);
|
|
28
|
-
items.push(...range(siblingsStart, siblingsEnd));
|
|
29
|
-
items.push(siblingsEnd < totalPages - boundaryCount - 1 ? "ellipsis" : totalPages - boundaryCount);
|
|
30
|
-
items.push(...endPages);
|
|
31
|
-
return items;
|
|
32
|
-
}
|
|
33
|
-
function Chevron({ direction }) {
|
|
34
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
|
-
"svg",
|
|
36
|
-
{
|
|
37
|
-
width: constants.ICON_SIZE.MD,
|
|
38
|
-
height: constants.ICON_SIZE.MD,
|
|
39
|
-
viewBox: constants.SVG_VIEWBOX,
|
|
40
|
-
fill: "none",
|
|
41
|
-
stroke: "currentColor",
|
|
42
|
-
strokeWidth: constants.SVG_STROKE_WIDTH,
|
|
43
|
-
strokeLinecap: "round",
|
|
44
|
-
strokeLinejoin: "round",
|
|
45
|
-
"aria-hidden": "true",
|
|
46
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: direction === "left" ? "15 18 9 12 15 6" : "9 18 15 12 9 6" })
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
const Pagination = react.forwardRef(
|
|
51
|
-
({
|
|
52
|
-
currentPage,
|
|
53
|
-
totalItems,
|
|
54
|
-
pageSize,
|
|
55
|
-
onPageChange,
|
|
56
|
-
siblingCount = constants.PAGINATION.SIBLING_COUNT,
|
|
57
|
-
boundaryCount = constants.PAGINATION.BOUNDARY_COUNT,
|
|
58
|
-
showPrevNext = true,
|
|
59
|
-
className,
|
|
60
|
-
"aria-label": ariaLabel = "Pagination",
|
|
61
|
-
...props
|
|
62
|
-
}, ref) => {
|
|
63
|
-
const totalPages = Math.max(1, Math.ceil(totalItems / Math.max(1, pageSize)));
|
|
64
|
-
const page = Math.min(Math.max(currentPage, 1), totalPages);
|
|
65
|
-
const items = getPaginationItems(page, totalPages, siblingCount, boundaryCount);
|
|
66
|
-
const goTo = (target) => {
|
|
67
|
-
const next = Math.min(Math.max(target, 1), totalPages);
|
|
68
|
-
if (next !== page) onPageChange(next);
|
|
5
|
+
const clsx = require("./index59.cjs");
|
|
6
|
+
const NavItem_module = require("./index104.cjs");
|
|
7
|
+
const NavItem = react.forwardRef(
|
|
8
|
+
({ icon, label, active = false, badge, collapsed = false, disabled = false, href, onClick, className }, ref) => {
|
|
9
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: NavItem_module.default.icon, children: icon }),
|
|
11
|
+
!collapsed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: NavItem_module.default.label, children: label }),
|
|
12
|
+
!collapsed && badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: NavItem_module.default.badge, children: badge })
|
|
13
|
+
] });
|
|
14
|
+
const sharedProps = {
|
|
15
|
+
className: clsx.clsx(NavItem_module.default.root, { [NavItem_module.default.active]: active, [NavItem_module.default.collapsed]: collapsed, [NavItem_module.default.disabled]: disabled }, className),
|
|
16
|
+
"aria-current": active ? "page" : void 0,
|
|
17
|
+
"aria-disabled": disabled || void 0,
|
|
18
|
+
title: collapsed ? label : void 0
|
|
69
19
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
85
|
-
/* @__PURE__ */ jsxRuntime.jsx("li", { className: Pagination_module.default.ellipsis, "aria-hidden": "true", children: "…" }, `ellipsis-${index}`)
|
|
86
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
-
"button",
|
|
88
|
-
{
|
|
89
|
-
type: "button",
|
|
90
|
-
className: clsx.clsx(Pagination_module.default.page, item === page && Pagination_module.default.isActive),
|
|
91
|
-
onClick: () => goTo(item),
|
|
92
|
-
"aria-current": item === page ? "page" : void 0,
|
|
93
|
-
"aria-label": `Go to page ${item}`,
|
|
94
|
-
children: item
|
|
95
|
-
}
|
|
96
|
-
) }, item)
|
|
97
|
-
),
|
|
98
|
-
showPrevNext && /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
-
"button",
|
|
100
|
-
{
|
|
101
|
-
type: "button",
|
|
102
|
-
className: Pagination_module.default.arrow,
|
|
103
|
-
onClick: () => goTo(page + 1),
|
|
104
|
-
disabled: page >= totalPages,
|
|
105
|
-
"aria-label": "Go to next page",
|
|
106
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Chevron, { direction: "right" })
|
|
107
|
-
}
|
|
108
|
-
) })
|
|
109
|
-
] }) });
|
|
20
|
+
if (href && !disabled) {
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { ref, href, ...sharedProps, children: content });
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
ref,
|
|
27
|
+
type: "button",
|
|
28
|
+
onClick: disabled ? void 0 : onClick,
|
|
29
|
+
disabled,
|
|
30
|
+
...sharedProps,
|
|
31
|
+
children: content
|
|
32
|
+
}
|
|
33
|
+
);
|
|
110
34
|
}
|
|
111
35
|
);
|
|
112
|
-
|
|
113
|
-
exports.
|
|
36
|
+
NavItem.displayName = "NavItem";
|
|
37
|
+
exports.NavItem = NavItem;
|
|
114
38
|
//# sourceMappingURL=index39.cjs.map
|
package/dist/index39.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index39.cjs","sources":["../src/primitives/
|
|
1
|
+
{"version":3,"file":"index39.cjs","sources":["../src/primitives/NavItem/NavItem.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport clsx from 'clsx';\nimport type { NavItemProps } from './NavItem.types';\nimport styles from './NavItem.module.css';\n\nexport const NavItem = forwardRef<HTMLElement, NavItemProps>(\n ({ icon, label, active = false, badge, collapsed = false, disabled = false, href, onClick, className }, ref) => {\n const content = (\n <>\n {icon && <span className={styles.icon}>{icon}</span>}\n {!collapsed && <span className={styles.label}>{label}</span>}\n {!collapsed && badge !== undefined && (\n <span className={styles.badge}>{badge}</span>\n )}\n </>\n );\n\n const sharedProps = {\n className: clsx(styles.root, { [styles.active]: active, [styles.collapsed]: collapsed, [styles.disabled]: disabled }, className),\n 'aria-current': active ? ('page' as const) : undefined,\n 'aria-disabled': disabled || undefined,\n title: collapsed ? label : undefined,\n };\n\n if (href && !disabled) {\n return (\n <a ref={ref as React.Ref<HTMLAnchorElement>} href={href} {...sharedProps}>\n {content}\n </a>\n );\n }\n\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n {...sharedProps}\n >\n {content}\n </button>\n );\n },\n);\n\nNavItem.displayName = 'NavItem';\n"],"names":["forwardRef","jsxs","Fragment","jsx","styles","clsx"],"mappings":";;;;;;AAKO,MAAM,UAAUA,MAAAA;AAAAA,EACrB,CAAC,EAAE,MAAM,OAAO,SAAS,OAAO,OAAO,YAAY,OAAO,WAAW,OAAO,MAAM,SAAS,UAAA,GAAa,QAAQ;AAC9G,UAAM,UACJC,2BAAAA,KAAAC,WAAAA,UAAA,EACG,UAAA;AAAA,MAAA,QAAQC,2BAAAA,IAAC,QAAA,EAAK,WAAWC,eAAAA,QAAO,MAAO,UAAA,MAAK;AAAA,MAC5C,CAAC,aAAaD,+BAAC,UAAK,WAAWC,eAAAA,QAAO,OAAQ,UAAA,OAAM;AAAA,MACpD,CAAC,aAAa,UAAU,yCACtB,QAAA,EAAK,WAAWA,eAAAA,QAAO,OAAQ,UAAA,MAAA,CAAM;AAAA,IAAA,GAE1C;AAGF,UAAM,cAAc;AAAA,MAClB,WAAWC,KAAAA,KAAKD,uBAAO,MAAM,EAAE,CAACA,eAAAA,QAAO,MAAM,GAAG,QAAQ,CAACA,eAAAA,QAAO,SAAS,GAAG,WAAW,CAACA,eAAAA,QAAO,QAAQ,GAAG,SAAA,GAAY,SAAS;AAAA,MAC/H,gBAAgB,SAAU,SAAmB;AAAA,MAC7C,iBAAiB,YAAY;AAAA,MAC7B,OAAO,YAAY,QAAQ;AAAA,IAAA;AAG7B,QAAI,QAAQ,CAAC,UAAU;AACrB,4CACG,KAAA,EAAE,KAA0C,MAAa,GAAG,aAC1D,UAAA,SACH;AAAA,IAEJ;AAEA,WACED,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,SAAS,WAAW,SAAY;AAAA,QAChC;AAAA,QACC,GAAG;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,QAAQ,cAAc;;"}
|
package/dist/index39.js
CHANGED
|
@@ -1,114 +1,38 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { clsx } from "./
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Math.min(currentPage - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),
|
|
18
|
-
boundaryCount + 2
|
|
19
|
-
);
|
|
20
|
-
const siblingsEnd = Math.min(
|
|
21
|
-
Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),
|
|
22
|
-
endPages[0] - 2
|
|
23
|
-
);
|
|
24
|
-
const items = [...startPages];
|
|
25
|
-
items.push(siblingsStart > boundaryCount + 2 ? "ellipsis" : boundaryCount + 1);
|
|
26
|
-
items.push(...range(siblingsStart, siblingsEnd));
|
|
27
|
-
items.push(siblingsEnd < totalPages - boundaryCount - 1 ? "ellipsis" : totalPages - boundaryCount);
|
|
28
|
-
items.push(...endPages);
|
|
29
|
-
return items;
|
|
30
|
-
}
|
|
31
|
-
function Chevron({ direction }) {
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
-
"svg",
|
|
34
|
-
{
|
|
35
|
-
width: ICON_SIZE.MD,
|
|
36
|
-
height: ICON_SIZE.MD,
|
|
37
|
-
viewBox: SVG_VIEWBOX,
|
|
38
|
-
fill: "none",
|
|
39
|
-
stroke: "currentColor",
|
|
40
|
-
strokeWidth: SVG_STROKE_WIDTH,
|
|
41
|
-
strokeLinecap: "round",
|
|
42
|
-
strokeLinejoin: "round",
|
|
43
|
-
"aria-hidden": "true",
|
|
44
|
-
children: /* @__PURE__ */ jsx("polyline", { points: direction === "left" ? "15 18 9 12 15 6" : "9 18 15 12 9 6" })
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
const Pagination = forwardRef(
|
|
49
|
-
({
|
|
50
|
-
currentPage,
|
|
51
|
-
totalItems,
|
|
52
|
-
pageSize,
|
|
53
|
-
onPageChange,
|
|
54
|
-
siblingCount = PAGINATION.SIBLING_COUNT,
|
|
55
|
-
boundaryCount = PAGINATION.BOUNDARY_COUNT,
|
|
56
|
-
showPrevNext = true,
|
|
57
|
-
className,
|
|
58
|
-
"aria-label": ariaLabel = "Pagination",
|
|
59
|
-
...props
|
|
60
|
-
}, ref) => {
|
|
61
|
-
const totalPages = Math.max(1, Math.ceil(totalItems / Math.max(1, pageSize)));
|
|
62
|
-
const page = Math.min(Math.max(currentPage, 1), totalPages);
|
|
63
|
-
const items = getPaginationItems(page, totalPages, siblingCount, boundaryCount);
|
|
64
|
-
const goTo = (target) => {
|
|
65
|
-
const next = Math.min(Math.max(target, 1), totalPages);
|
|
66
|
-
if (next !== page) onPageChange(next);
|
|
3
|
+
import { clsx } from "./index59.js";
|
|
4
|
+
import styles from "./index104.js";
|
|
5
|
+
const NavItem = forwardRef(
|
|
6
|
+
({ icon, label, active = false, badge, collapsed = false, disabled = false, href, onClick, className }, ref) => {
|
|
7
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8
|
+
icon && /* @__PURE__ */ jsx("span", { className: styles.icon, children: icon }),
|
|
9
|
+
!collapsed && /* @__PURE__ */ jsx("span", { className: styles.label, children: label }),
|
|
10
|
+
!collapsed && badge !== void 0 && /* @__PURE__ */ jsx("span", { className: styles.badge, children: badge })
|
|
11
|
+
] });
|
|
12
|
+
const sharedProps = {
|
|
13
|
+
className: clsx(styles.root, { [styles.active]: active, [styles.collapsed]: collapsed, [styles.disabled]: disabled }, className),
|
|
14
|
+
"aria-current": active ? "page" : void 0,
|
|
15
|
+
"aria-disabled": disabled || void 0,
|
|
16
|
+
title: collapsed ? label : void 0
|
|
67
17
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
83
|
-
/* @__PURE__ */ jsx("li", { className: styles.ellipsis, "aria-hidden": "true", children: "…" }, `ellipsis-${index}`)
|
|
84
|
-
) : /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
85
|
-
"button",
|
|
86
|
-
{
|
|
87
|
-
type: "button",
|
|
88
|
-
className: clsx(styles.page, item === page && styles.isActive),
|
|
89
|
-
onClick: () => goTo(item),
|
|
90
|
-
"aria-current": item === page ? "page" : void 0,
|
|
91
|
-
"aria-label": `Go to page ${item}`,
|
|
92
|
-
children: item
|
|
93
|
-
}
|
|
94
|
-
) }, item)
|
|
95
|
-
),
|
|
96
|
-
showPrevNext && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
97
|
-
"button",
|
|
98
|
-
{
|
|
99
|
-
type: "button",
|
|
100
|
-
className: styles.arrow,
|
|
101
|
-
onClick: () => goTo(page + 1),
|
|
102
|
-
disabled: page >= totalPages,
|
|
103
|
-
"aria-label": "Go to next page",
|
|
104
|
-
children: /* @__PURE__ */ jsx(Chevron, { direction: "right" })
|
|
105
|
-
}
|
|
106
|
-
) })
|
|
107
|
-
] }) });
|
|
18
|
+
if (href && !disabled) {
|
|
19
|
+
return /* @__PURE__ */ jsx("a", { ref, href, ...sharedProps, children: content });
|
|
20
|
+
}
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
ref,
|
|
25
|
+
type: "button",
|
|
26
|
+
onClick: disabled ? void 0 : onClick,
|
|
27
|
+
disabled,
|
|
28
|
+
...sharedProps,
|
|
29
|
+
children: content
|
|
30
|
+
}
|
|
31
|
+
);
|
|
108
32
|
}
|
|
109
33
|
);
|
|
110
|
-
|
|
34
|
+
NavItem.displayName = "NavItem";
|
|
111
35
|
export {
|
|
112
|
-
|
|
36
|
+
NavItem
|
|
113
37
|
};
|
|
114
38
|
//# sourceMappingURL=index39.js.map
|
package/dist/index39.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index39.js","sources":["../src/primitives/
|
|
1
|
+
{"version":3,"file":"index39.js","sources":["../src/primitives/NavItem/NavItem.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport clsx from 'clsx';\nimport type { NavItemProps } from './NavItem.types';\nimport styles from './NavItem.module.css';\n\nexport const NavItem = forwardRef<HTMLElement, NavItemProps>(\n ({ icon, label, active = false, badge, collapsed = false, disabled = false, href, onClick, className }, ref) => {\n const content = (\n <>\n {icon && <span className={styles.icon}>{icon}</span>}\n {!collapsed && <span className={styles.label}>{label}</span>}\n {!collapsed && badge !== undefined && (\n <span className={styles.badge}>{badge}</span>\n )}\n </>\n );\n\n const sharedProps = {\n className: clsx(styles.root, { [styles.active]: active, [styles.collapsed]: collapsed, [styles.disabled]: disabled }, className),\n 'aria-current': active ? ('page' as const) : undefined,\n 'aria-disabled': disabled || undefined,\n title: collapsed ? label : undefined,\n };\n\n if (href && !disabled) {\n return (\n <a ref={ref as React.Ref<HTMLAnchorElement>} href={href} {...sharedProps}>\n {content}\n </a>\n );\n }\n\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={disabled ? undefined : onClick}\n disabled={disabled}\n {...sharedProps}\n >\n {content}\n </button>\n );\n },\n);\n\nNavItem.displayName = 'NavItem';\n"],"names":[],"mappings":";;;;AAKO,MAAM,UAAU;AAAA,EACrB,CAAC,EAAE,MAAM,OAAO,SAAS,OAAO,OAAO,YAAY,OAAO,WAAW,OAAO,MAAM,SAAS,UAAA,GAAa,QAAQ;AAC9G,UAAM,UACJ,qBAAA,UAAA,EACG,UAAA;AAAA,MAAA,QAAQ,oBAAC,QAAA,EAAK,WAAW,OAAO,MAAO,UAAA,MAAK;AAAA,MAC5C,CAAC,aAAa,oBAAC,UAAK,WAAW,OAAO,OAAQ,UAAA,OAAM;AAAA,MACpD,CAAC,aAAa,UAAU,8BACtB,QAAA,EAAK,WAAW,OAAO,OAAQ,UAAA,MAAA,CAAM;AAAA,IAAA,GAE1C;AAGF,UAAM,cAAc;AAAA,MAClB,WAAW,KAAK,OAAO,MAAM,EAAE,CAAC,OAAO,MAAM,GAAG,QAAQ,CAAC,OAAO,SAAS,GAAG,WAAW,CAAC,OAAO,QAAQ,GAAG,SAAA,GAAY,SAAS;AAAA,MAC/H,gBAAgB,SAAU,SAAmB;AAAA,MAC7C,iBAAiB,YAAY;AAAA,MAC7B,OAAO,YAAY,QAAQ;AAAA,IAAA;AAG7B,QAAI,QAAQ,CAAC,UAAU;AACrB,iCACG,KAAA,EAAE,KAA0C,MAAa,GAAG,aAC1D,UAAA,SACH;AAAA,IAEJ;AAEA,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,SAAS,WAAW,SAAY;AAAA,QAChC;AAAA,QACC,GAAG;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,QAAQ,cAAc;"}
|
package/dist/index40.cjs
CHANGED
|
@@ -2,71 +2,113 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const clsx = require("./
|
|
6
|
-
const constants = require("./
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
const clsx = require("./index59.cjs");
|
|
6
|
+
const constants = require("./index65.cjs");
|
|
7
|
+
const Pagination_module = require("./index66.cjs");
|
|
8
|
+
function range(start, end) {
|
|
9
|
+
const out = [];
|
|
10
|
+
for (let page = start; page <= end; page += 1) out.push(page);
|
|
11
|
+
return out;
|
|
12
|
+
}
|
|
13
|
+
function getPaginationItems(currentPage, totalPages, siblingCount, boundaryCount) {
|
|
14
|
+
const totalNumbers = boundaryCount * 2 + siblingCount * 2 + 3;
|
|
15
|
+
if (totalPages <= totalNumbers) return range(1, totalPages);
|
|
16
|
+
const startPages = range(1, boundaryCount);
|
|
17
|
+
const endPages = range(totalPages - boundaryCount + 1, totalPages);
|
|
18
|
+
const siblingsStart = Math.max(
|
|
19
|
+
Math.min(currentPage - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),
|
|
20
|
+
boundaryCount + 2
|
|
21
|
+
);
|
|
22
|
+
const siblingsEnd = Math.min(
|
|
23
|
+
Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),
|
|
24
|
+
endPages[0] - 2
|
|
25
|
+
);
|
|
26
|
+
const items = [...startPages];
|
|
27
|
+
items.push(siblingsStart > boundaryCount + 2 ? "ellipsis" : boundaryCount + 1);
|
|
28
|
+
items.push(...range(siblingsStart, siblingsEnd));
|
|
29
|
+
items.push(siblingsEnd < totalPages - boundaryCount - 1 ? "ellipsis" : totalPages - boundaryCount);
|
|
30
|
+
items.push(...endPages);
|
|
31
|
+
return items;
|
|
32
|
+
}
|
|
33
|
+
function Chevron({ direction }) {
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
|
+
"svg",
|
|
36
|
+
{
|
|
37
|
+
width: constants.ICON_SIZE.MD,
|
|
38
|
+
height: constants.ICON_SIZE.MD,
|
|
39
|
+
viewBox: constants.SVG_VIEWBOX,
|
|
40
|
+
fill: "none",
|
|
41
|
+
stroke: "currentColor",
|
|
42
|
+
strokeWidth: constants.SVG_STROKE_WIDTH,
|
|
43
|
+
strokeLinecap: "round",
|
|
44
|
+
strokeLinejoin: "round",
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: direction === "left" ? "15 18 9 12 15 6" : "9 18 15 12 9 6" })
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
const Pagination = react.forwardRef(
|
|
13
51
|
({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
52
|
+
currentPage,
|
|
53
|
+
totalItems,
|
|
54
|
+
pageSize,
|
|
55
|
+
onPageChange,
|
|
56
|
+
siblingCount = constants.PAGINATION.SIBLING_COUNT,
|
|
57
|
+
boundaryCount = constants.PAGINATION.BOUNDARY_COUNT,
|
|
58
|
+
showPrevNext = true,
|
|
59
|
+
className,
|
|
60
|
+
"aria-label": ariaLabel = "Pagination",
|
|
61
|
+
...props
|
|
23
62
|
}, ref) => {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
63
|
+
const totalPages = Math.max(1, Math.ceil(totalItems / Math.max(1, pageSize)));
|
|
64
|
+
const page = Math.min(Math.max(currentPage, 1), totalPages);
|
|
65
|
+
const items = getPaginationItems(page, totalPages, siblingCount, boundaryCount);
|
|
66
|
+
const goTo = (target) => {
|
|
67
|
+
const next = Math.min(Math.max(target, 1), totalPages);
|
|
68
|
+
if (next !== page) onPageChange(next);
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": ariaLabel, className: clsx.clsx(Pagination_module.default.root, className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: Pagination_module.default.list, children: [
|
|
71
|
+
showPrevNext && /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
"button",
|
|
32
73
|
{
|
|
33
|
-
|
|
34
|
-
|
|
74
|
+
type: "button",
|
|
75
|
+
className: Pagination_module.default.arrow,
|
|
76
|
+
onClick: () => goTo(page - 1),
|
|
77
|
+
disabled: page <= 1,
|
|
78
|
+
"aria-label": "Go to previous page",
|
|
79
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Chevron, { direction: "left" })
|
|
35
80
|
}
|
|
81
|
+
) }),
|
|
82
|
+
items.map(
|
|
83
|
+
(item, index) => item === "ellipsis" ? (
|
|
84
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
85
|
+
/* @__PURE__ */ jsxRuntime.jsx("li", { className: Pagination_module.default.ellipsis, "aria-hidden": "true", children: "…" }, `ellipsis-${index}`)
|
|
86
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
+
"button",
|
|
88
|
+
{
|
|
89
|
+
type: "button",
|
|
90
|
+
className: clsx.clsx(Pagination_module.default.page, item === page && Pagination_module.default.isActive),
|
|
91
|
+
onClick: () => goTo(item),
|
|
92
|
+
"aria-current": item === page ? "page" : void 0,
|
|
93
|
+
"aria-label": `Go to page ${item}`,
|
|
94
|
+
children: item
|
|
95
|
+
}
|
|
96
|
+
) }, item)
|
|
36
97
|
),
|
|
37
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
-
"
|
|
98
|
+
showPrevNext && /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
+
"button",
|
|
39
100
|
{
|
|
40
|
-
type: "
|
|
41
|
-
className:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
disabled,
|
|
47
|
-
"aria-label": minAriaLabel,
|
|
48
|
-
onChange: (e) => handleMinChange(Number(e.target.value))
|
|
101
|
+
type: "button",
|
|
102
|
+
className: Pagination_module.default.arrow,
|
|
103
|
+
onClick: () => goTo(page + 1),
|
|
104
|
+
disabled: page >= totalPages,
|
|
105
|
+
"aria-label": "Go to next page",
|
|
106
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Chevron, { direction: "right" })
|
|
49
107
|
}
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
-
"input",
|
|
54
|
-
{
|
|
55
|
-
type: "range",
|
|
56
|
-
className: RangeSlider_module.default.thumb,
|
|
57
|
-
min,
|
|
58
|
-
max,
|
|
59
|
-
step,
|
|
60
|
-
value: value[1],
|
|
61
|
-
disabled,
|
|
62
|
-
"aria-label": maxAriaLabel,
|
|
63
|
-
onChange: (e) => handleMaxChange(Number(e.target.value))
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: RangeSlider_module.default.valueTooltip, style: { left: `${percentage(value[1])}%` }, "aria-hidden": "true", children: value[1] })
|
|
67
|
-
] });
|
|
108
|
+
) })
|
|
109
|
+
] }) });
|
|
68
110
|
}
|
|
69
111
|
);
|
|
70
|
-
|
|
71
|
-
exports.
|
|
112
|
+
Pagination.displayName = "Pagination";
|
|
113
|
+
exports.Pagination = Pagination;
|
|
72
114
|
//# sourceMappingURL=index40.cjs.map
|
package/dist/index40.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index40.cjs","sources":["../src/primitives/
|
|
1
|
+
{"version":3,"file":"index40.cjs","sources":["../src/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport clsx from 'clsx';\nimport { ICON_SIZE, PAGINATION, SVG_STROKE_WIDTH, SVG_VIEWBOX } from '../../constants';\nimport type { PaginationItem, PaginationProps } from './Pagination.types';\nimport styles from './Pagination.module.css';\n\nfunction range(start: number, end: number): number[] {\n const out: number[] = [];\n for (let page = start; page <= end; page += 1) out.push(page);\n return out;\n}\n\n/**\n * Builds the sequence of page numbers and ellipsis gaps to render, keeping the\n * first/last boundaries and a window of siblings around the current page.\n */\nfunction getPaginationItems(\n currentPage: number,\n totalPages: number,\n siblingCount: number,\n boundaryCount: number,\n): PaginationItem[] {\n const totalNumbers = boundaryCount * 2 + siblingCount * 2 + 3;\n if (totalPages <= totalNumbers) return range(1, totalPages);\n\n const startPages = range(1, boundaryCount);\n const endPages = range(totalPages - boundaryCount + 1, totalPages);\n\n const siblingsStart = Math.max(\n Math.min(currentPage - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n );\n const siblingsEnd = Math.min(\n Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages[0] - 2,\n );\n\n const items: PaginationItem[] = [...startPages];\n items.push(siblingsStart > boundaryCount + 2 ? 'ellipsis' : boundaryCount + 1);\n items.push(...range(siblingsStart, siblingsEnd));\n items.push(siblingsEnd < totalPages - boundaryCount - 1 ? 'ellipsis' : totalPages - boundaryCount);\n items.push(...endPages);\n\n return items;\n}\n\nfunction Chevron({ direction }: { direction: 'left' | 'right' }) {\n return (\n <svg\n width={ICON_SIZE.MD}\n height={ICON_SIZE.MD}\n viewBox={SVG_VIEWBOX}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={SVG_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points={direction === 'left' ? '15 18 9 12 15 6' : '9 18 15 12 9 6'} />\n </svg>\n );\n}\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n (\n {\n currentPage,\n totalItems,\n pageSize,\n onPageChange,\n siblingCount = PAGINATION.SIBLING_COUNT,\n boundaryCount = PAGINATION.BOUNDARY_COUNT,\n showPrevNext = true,\n className,\n 'aria-label': ariaLabel = 'Pagination',\n ...props\n },\n ref,\n ) => {\n const totalPages = Math.max(1, Math.ceil(totalItems / Math.max(1, pageSize)));\n const page = Math.min(Math.max(currentPage, 1), totalPages);\n const items = getPaginationItems(page, totalPages, siblingCount, boundaryCount);\n\n const goTo = (target: number) => {\n const next = Math.min(Math.max(target, 1), totalPages);\n if (next !== page) onPageChange(next);\n };\n\n return (\n <nav ref={ref} aria-label={ariaLabel} className={clsx(styles.root, className)} {...props}>\n <ul className={styles.list}>\n {showPrevNext && (\n <li>\n <button\n type=\"button\"\n className={styles.arrow}\n onClick={() => goTo(page - 1)}\n disabled={page <= 1}\n aria-label=\"Go to previous page\"\n >\n <Chevron direction=\"left\" />\n </button>\n </li>\n )}\n\n {items.map((item, index) =>\n item === 'ellipsis' ? (\n // eslint-disable-next-line react/no-array-index-key\n <li key={`ellipsis-${index}`} className={styles.ellipsis} aria-hidden=\"true\">\n …\n </li>\n ) : (\n <li key={item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === page && styles.isActive)}\n onClick={() => goTo(item)}\n aria-current={item === page ? 'page' : undefined}\n aria-label={`Go to page ${item}`}\n >\n {item}\n </button>\n </li>\n ),\n )}\n\n {showPrevNext && (\n <li>\n <button\n type=\"button\"\n className={styles.arrow}\n onClick={() => goTo(page + 1)}\n disabled={page >= totalPages}\n aria-label=\"Go to next page\"\n >\n <Chevron direction=\"right\" />\n </button>\n </li>\n )}\n </ul>\n </nav>\n );\n },\n);\n\nPagination.displayName = 'Pagination';\n"],"names":["jsx","ICON_SIZE","SVG_VIEWBOX","SVG_STROKE_WIDTH","forwardRef","PAGINATION","clsx","styles"],"mappings":"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"}
|