@ktnpm_devops/react-component 0.12.1 → 0.13.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/README.md +39 -0
- package/dist/constants.d.ts +26 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/geo/GeoMapCard/GeoMapCard.d.ts +7 -0
- package/dist/geo/GeoMapCard/GeoMapCard.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/GeoMapCard.types.d.ts +91 -0
- package/dist/geo/GeoMapCard/GeoMapCard.types.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/MapLegend.d.ts +12 -0
- package/dist/geo/GeoMapCard/MapLegend.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/MapViewport.d.ts +17 -0
- package/dist/geo/GeoMapCard/MapViewport.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/PointListing.d.ts +14 -0
- package/dist/geo/GeoMapCard/PointListing.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/buildMarkerStyle.d.ts +47 -0
- package/dist/geo/GeoMapCard/buildMarkerStyle.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/buildMarkerStyle.test.d.ts +2 -0
- package/dist/geo/GeoMapCard/buildMarkerStyle.test.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/index.d.ts +3 -0
- package/dist/geo/GeoMapCard/index.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/normalizePoints.d.ts +26 -0
- package/dist/geo/GeoMapCard/normalizePoints.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/normalizePoints.test.d.ts +2 -0
- package/dist/geo/GeoMapCard/normalizePoints.test.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.d.ts +13 -0
- package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.d.ts.map +1 -0
- package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.test.d.ts +2 -0
- package/dist/geo/GeoMapCard/warnMissingLeafletStylesheet.test.d.ts.map +1 -0
- package/dist/geo/index.d.ts +3 -0
- package/dist/geo/index.d.ts.map +1 -0
- package/dist/hooks/useThemeMode.d.ts +8 -0
- package/dist/hooks/useThemeMode.d.ts.map +1 -0
- package/dist/index.cjs +52 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -48
- package/dist/index.js.map +1 -1
- package/dist/index10.cjs +45 -14
- package/dist/index10.cjs.map +1 -1
- package/dist/index10.js +46 -15
- package/dist/index10.js.map +1 -1
- package/dist/index100.cjs +35 -2
- package/dist/index100.cjs.map +1 -1
- package/dist/index100.js +36 -3
- package/dist/index100.js.map +1 -1
- package/dist/index101.cjs +52 -10
- package/dist/index101.cjs.map +1 -1
- package/dist/index101.js +52 -10
- package/dist/index101.js.map +1 -1
- package/dist/index102.cjs +134 -22
- package/dist/index102.cjs.map +1 -1
- package/dist/index102.js +133 -21
- package/dist/index102.js.map +1 -1
- package/dist/index103.cjs +42 -36
- package/dist/index103.cjs.map +1 -1
- package/dist/index103.js +42 -36
- package/dist/index103.js.map +1 -1
- package/dist/index104.cjs +35 -21
- package/dist/index104.cjs.map +1 -1
- package/dist/index104.js +34 -20
- package/dist/index104.js.map +1 -1
- package/dist/index105.cjs +43 -24
- package/dist/index105.cjs.map +1 -1
- package/dist/index105.js +42 -23
- package/dist/index105.js.map +1 -1
- package/dist/index106.cjs +27 -0
- package/dist/index106.cjs.map +1 -0
- package/dist/index106.js +27 -0
- package/dist/index106.js.map +1 -0
- package/dist/index107.cjs +22 -0
- package/dist/index107.cjs.map +1 -0
- package/dist/index107.js +22 -0
- package/dist/index107.js.map +1 -0
- package/dist/index108.cjs +16 -0
- package/dist/index108.cjs.map +1 -0
- package/dist/index108.js +16 -0
- package/dist/index108.js.map +1 -0
- package/dist/index109.cjs +63 -0
- package/dist/index109.cjs.map +1 -0
- package/dist/index109.js +63 -0
- package/dist/index109.js.map +1 -0
- package/dist/index11.cjs +14 -15
- package/dist/index11.cjs.map +1 -1
- package/dist/index11.js +15 -16
- package/dist/index11.js.map +1 -1
- package/dist/index110.cjs +36 -0
- package/dist/index110.cjs.map +1 -0
- package/dist/index110.js +36 -0
- package/dist/index110.js.map +1 -0
- package/dist/index111.cjs +18 -0
- package/dist/index111.cjs.map +1 -0
- package/dist/index111.js +18 -0
- package/dist/index111.js.map +1 -0
- package/dist/index112.cjs +27 -0
- package/dist/index112.cjs.map +1 -0
- package/dist/index112.js +27 -0
- package/dist/index112.js.map +1 -0
- package/dist/index113.cjs +21 -0
- package/dist/index113.cjs.map +1 -0
- package/dist/index113.js +21 -0
- package/dist/index113.js.map +1 -0
- package/dist/index12.cjs +15 -4
- package/dist/index12.cjs.map +1 -1
- package/dist/index12.js +15 -4
- package/dist/index12.js.map +1 -1
- package/dist/index13.cjs +4 -16
- package/dist/index13.cjs.map +1 -1
- package/dist/index13.js +4 -16
- package/dist/index13.js.map +1 -1
- package/dist/index14.cjs +16 -10
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +16 -10
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +10 -100
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +11 -101
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +100 -20
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +101 -21
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +20 -54
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +20 -54
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +52 -16
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +54 -18
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +16 -24
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +17 -25
- package/dist/index19.js.map +1 -1
- package/dist/index20.cjs +22 -39
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +23 -40
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +38 -85
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +40 -87
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +84 -152
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +87 -155
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +149 -127
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +150 -128
- package/dist/index23.js.map +1 -1
- package/dist/index24.cjs +121 -106
- package/dist/index24.cjs.map +1 -1
- package/dist/index24.js +122 -107
- package/dist/index24.js.map +1 -1
- package/dist/index25.cjs +121 -17
- package/dist/index25.cjs.map +1 -1
- package/dist/index25.js +121 -17
- package/dist/index25.js.map +1 -1
- package/dist/index26.cjs +16 -163
- package/dist/index26.cjs.map +1 -1
- package/dist/index26.js +16 -163
- package/dist/index26.js.map +1 -1
- package/dist/index27.cjs +163 -21
- package/dist/index27.cjs.map +1 -1
- package/dist/index27.js +164 -22
- package/dist/index27.js.map +1 -1
- package/dist/index28.cjs +20 -129
- package/dist/index28.cjs.map +1 -1
- package/dist/index28.js +21 -130
- package/dist/index28.js.map +1 -1
- package/dist/index29.cjs +129 -75
- package/dist/index29.cjs.map +1 -1
- package/dist/index29.js +131 -77
- package/dist/index29.js.map +1 -1
- package/dist/index30.cjs +152 -7
- package/dist/index30.cjs.map +1 -1
- package/dist/index30.js +154 -9
- package/dist/index30.js.map +1 -1
- package/dist/index31.cjs +74 -128
- package/dist/index31.cjs.map +1 -1
- package/dist/index31.js +75 -129
- package/dist/index31.js.map +1 -1
- package/dist/index32.cjs +6 -54
- package/dist/index32.cjs.map +1 -1
- package/dist/index32.js +8 -56
- package/dist/index32.js.map +1 -1
- package/dist/index33.cjs +128 -35
- package/dist/index33.cjs.map +1 -1
- package/dist/index33.js +129 -36
- package/dist/index33.js.map +1 -1
- package/dist/index34.cjs +50 -220
- package/dist/index34.cjs.map +1 -1
- package/dist/index34.js +53 -223
- package/dist/index34.js.map +1 -1
- package/dist/index35.cjs +38 -34
- package/dist/index35.cjs.map +1 -1
- package/dist/index35.js +39 -35
- package/dist/index35.js.map +1 -1
- package/dist/index36.cjs +221 -105
- package/dist/index36.cjs.map +1 -1
- package/dist/index36.js +224 -108
- package/dist/index36.js.map +1 -1
- package/dist/index37.cjs +30 -64
- package/dist/index37.cjs.map +1 -1
- package/dist/index37.js +31 -65
- package/dist/index37.js.map +1 -1
- package/dist/index38.cjs +105 -73
- package/dist/index38.cjs.map +1 -1
- package/dist/index38.js +108 -76
- package/dist/index38.js.map +1 -1
- package/dist/index39.cjs +63 -54
- package/dist/index39.cjs.map +1 -1
- package/dist/index39.js +64 -55
- package/dist/index39.js.map +1 -1
- package/dist/index40.cjs +68 -143
- package/dist/index40.cjs.map +1 -1
- package/dist/index40.js +70 -145
- package/dist/index40.js.map +1 -1
- package/dist/index41.cjs +57 -96
- package/dist/index41.cjs.map +1 -1
- package/dist/index41.js +59 -98
- package/dist/index41.js.map +1 -1
- package/dist/index42.cjs +147 -66
- package/dist/index42.cjs.map +1 -1
- package/dist/index42.js +149 -68
- package/dist/index42.js.map +1 -1
- package/dist/index43.cjs +97 -7
- package/dist/index43.cjs.map +1 -1
- package/dist/index43.js +99 -9
- package/dist/index43.js.map +1 -1
- package/dist/index44.cjs +72 -17
- package/dist/index44.cjs.map +1 -1
- package/dist/index44.js +73 -18
- package/dist/index44.js.map +1 -1
- package/dist/index45.cjs +7 -76
- package/dist/index45.cjs.map +1 -1
- package/dist/index45.js +9 -78
- package/dist/index45.js.map +1 -1
- package/dist/index46.cjs +17 -143
- package/dist/index46.cjs.map +1 -1
- package/dist/index46.js +17 -143
- package/dist/index46.js.map +1 -1
- package/dist/index47.cjs +72 -59
- package/dist/index47.cjs.map +1 -1
- package/dist/index47.js +74 -61
- package/dist/index47.js.map +1 -1
- package/dist/index48.cjs +135 -97
- package/dist/index48.cjs.map +1 -1
- package/dist/index48.js +136 -98
- package/dist/index48.js.map +1 -1
- package/dist/index49.cjs +49 -32
- package/dist/index49.cjs.map +1 -1
- package/dist/index49.js +49 -32
- package/dist/index49.js.map +1 -1
- package/dist/index50.cjs +105 -6
- package/dist/index50.cjs.map +1 -1
- package/dist/index50.js +106 -7
- package/dist/index50.js.map +1 -1
- package/dist/index51.cjs +44 -144
- package/dist/index51.cjs.map +1 -1
- package/dist/index51.js +45 -145
- package/dist/index51.js.map +1 -1
- package/dist/index52.cjs +6 -8
- package/dist/index52.cjs.map +1 -1
- package/dist/index52.js +6 -8
- package/dist/index52.js.map +1 -1
- package/dist/index53.cjs +145 -15
- package/dist/index53.cjs.map +1 -1
- package/dist/index53.js +147 -17
- package/dist/index53.js.map +1 -1
- package/dist/index54.cjs +7 -65
- package/dist/index54.cjs.map +1 -1
- package/dist/index54.js +9 -67
- package/dist/index54.js.map +1 -1
- package/dist/index55.cjs +19 -16
- package/dist/index55.cjs.map +1 -1
- package/dist/index55.js +18 -15
- package/dist/index55.js.map +1 -1
- package/dist/index56.cjs +67 -24
- package/dist/index56.cjs.map +1 -1
- package/dist/index56.js +66 -23
- package/dist/index56.js.map +1 -1
- package/dist/index57.cjs +15 -69
- package/dist/index57.cjs.map +1 -1
- package/dist/index57.js +15 -69
- package/dist/index57.js.map +1 -1
- package/dist/index59.cjs +26 -0
- package/dist/index59.cjs.map +1 -1
- package/dist/index59.js +26 -0
- package/dist/index59.js.map +1 -1
- package/dist/index60.cjs +13 -16
- package/dist/index60.cjs.map +1 -1
- package/dist/index60.js +13 -16
- package/dist/index60.js.map +1 -1
- package/dist/index61.cjs +10 -22
- package/dist/index61.cjs.map +1 -1
- package/dist/index61.js +11 -23
- package/dist/index61.js.map +1 -1
- package/dist/index62.cjs +13 -13
- package/dist/index62.js +13 -13
- package/dist/index63.cjs +20 -14
- package/dist/index63.cjs.map +1 -1
- package/dist/index63.js +20 -14
- package/dist/index63.js.map +1 -1
- package/dist/index64.cjs +34 -13
- package/dist/index64.cjs.map +1 -1
- package/dist/index64.js +34 -13
- package/dist/index64.js.map +1 -1
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +1 -1
- package/dist/index66.cjs +2 -20
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +3 -21
- package/dist/index66.js.map +1 -1
- package/dist/index67.cjs +5 -23
- package/dist/index67.cjs.map +1 -1
- package/dist/index67.js +6 -24
- package/dist/index67.js.map +1 -1
- package/dist/index68.cjs +19 -19
- package/dist/index68.js +20 -20
- package/dist/index69.cjs +20 -5
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +21 -6
- package/dist/index69.js.map +1 -1
- package/dist/index7.cjs +32 -64
- package/dist/index7.cjs.map +1 -1
- package/dist/index7.js +32 -64
- package/dist/index7.js.map +1 -1
- package/dist/index70.cjs +15 -15
- package/dist/index70.js +15 -15
- package/dist/index71.cjs +13 -28
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +14 -29
- package/dist/index71.js.map +1 -1
- package/dist/index72.cjs +2 -20
- package/dist/index72.cjs.map +1 -1
- package/dist/index72.js +2 -20
- package/dist/index72.js.map +1 -1
- package/dist/index73.cjs +30 -3
- package/dist/index73.cjs.map +1 -1
- package/dist/index73.js +30 -3
- package/dist/index73.js.map +1 -1
- package/dist/index74.cjs +36 -3
- package/dist/index74.cjs.map +1 -1
- package/dist/index74.js +36 -3
- package/dist/index74.js.map +1 -1
- package/dist/index75.cjs +34 -13
- package/dist/index75.cjs.map +1 -1
- package/dist/index75.js +35 -14
- package/dist/index75.js.map +1 -1
- package/dist/index76.cjs +22 -13
- package/dist/index76.cjs.map +1 -1
- package/dist/index76.js +23 -14
- package/dist/index76.js.map +1 -1
- package/dist/index77.cjs +3 -30
- package/dist/index77.cjs.map +1 -1
- package/dist/index77.js +3 -30
- package/dist/index77.js.map +1 -1
- package/dist/index78.cjs +16 -10
- package/dist/index78.cjs.map +1 -1
- package/dist/index78.js +16 -10
- package/dist/index78.js.map +1 -1
- package/dist/index79.cjs +10 -34
- package/dist/index79.cjs.map +1 -1
- package/dist/index79.js +11 -35
- package/dist/index79.js.map +1 -1
- package/dist/index8.cjs +58 -75
- package/dist/index8.cjs.map +1 -1
- package/dist/index8.js +58 -75
- package/dist/index8.js.map +1 -1
- package/dist/index80.cjs +64 -10
- package/dist/index80.cjs.map +1 -1
- package/dist/index80.js +65 -11
- package/dist/index80.js.map +1 -1
- package/dist/index81.cjs +16 -4
- package/dist/index81.cjs.map +1 -1
- package/dist/index81.js +17 -5
- package/dist/index81.js.map +1 -1
- package/dist/index82.cjs +52 -134
- package/dist/index82.cjs.map +1 -1
- package/dist/index82.js +51 -133
- package/dist/index82.js.map +1 -1
- package/dist/index83.cjs +50 -38
- package/dist/index83.cjs.map +1 -1
- package/dist/index83.js +50 -38
- package/dist/index83.js.map +1 -1
- package/dist/index84.cjs +16 -76
- package/dist/index84.cjs.map +1 -1
- package/dist/index84.js +16 -76
- package/dist/index84.js.map +1 -1
- package/dist/index85.cjs +20 -2
- package/dist/index85.cjs.map +1 -1
- package/dist/index85.js +20 -2
- package/dist/index85.js.map +1 -1
- package/dist/index86.cjs +77 -44
- package/dist/index86.cjs.map +1 -1
- package/dist/index86.js +78 -45
- package/dist/index86.js.map +1 -1
- package/dist/index87.cjs +2 -53
- package/dist/index87.cjs.map +1 -1
- package/dist/index87.js +3 -54
- package/dist/index87.js.map +1 -1
- package/dist/index88.cjs +15 -36
- package/dist/index88.cjs.map +1 -1
- package/dist/index88.js +16 -37
- package/dist/index88.js.map +1 -1
- package/dist/index89.cjs +26 -14
- package/dist/index89.cjs.map +1 -1
- package/dist/index89.js +26 -14
- package/dist/index89.js.map +1 -1
- package/dist/index9.cjs +81 -45
- package/dist/index9.cjs.map +1 -1
- package/dist/index9.js +81 -45
- package/dist/index9.js.map +1 -1
- package/dist/index90.cjs +22 -116
- package/dist/index90.cjs.map +1 -1
- package/dist/index90.js +21 -115
- package/dist/index90.js.map +1 -1
- package/dist/index91.cjs +116 -43
- package/dist/index91.cjs.map +1 -1
- package/dist/index91.js +115 -42
- package/dist/index91.js.map +1 -1
- package/dist/index92.cjs +35 -32
- package/dist/index92.cjs.map +1 -1
- package/dist/index92.js +35 -32
- package/dist/index92.js.map +1 -1
- package/dist/index93.cjs +26 -17
- package/dist/index93.cjs.map +1 -1
- package/dist/index93.js +27 -18
- package/dist/index93.js.map +1 -1
- package/dist/index94.cjs +9 -39
- package/dist/index94.cjs.map +1 -1
- package/dist/index94.js +8 -38
- package/dist/index94.js.map +1 -1
- package/dist/index95.cjs +21 -92
- package/dist/index95.cjs.map +1 -1
- package/dist/index95.js +20 -91
- package/dist/index95.js.map +1 -1
- package/dist/index96.cjs +47 -32
- package/dist/index96.cjs.map +1 -1
- package/dist/index96.js +47 -32
- package/dist/index96.js.map +1 -1
- package/dist/index97.cjs +25 -49
- package/dist/index97.cjs.map +1 -1
- package/dist/index97.js +25 -49
- package/dist/index97.js.map +1 -1
- package/dist/index98.cjs +39 -30
- package/dist/index98.cjs.map +1 -1
- package/dist/index98.js +38 -29
- package/dist/index98.js.map +1 -1
- package/dist/index99.cjs +92 -57
- package/dist/index99.cjs.map +1 -1
- package/dist/index99.js +91 -56
- package/dist/index99.js.map +1 -1
- package/dist/style.css +207 -0
- package/dist/types/geo.types.d.ts +45 -0
- package/dist/types/geo.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +16 -2
package/dist/index37.js
CHANGED
|
@@ -1,72 +1,38 @@
|
|
|
1
|
-
import { jsxs,
|
|
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
|
-
min,
|
|
13
|
-
max,
|
|
14
|
-
step = RANGE_SLIDER.DEFAULT_STEP,
|
|
15
|
-
value,
|
|
16
|
-
onChange,
|
|
17
|
-
disabled = false,
|
|
18
|
-
minAriaLabel = "Minimum value",
|
|
19
|
-
maxAriaLabel = "Maximum value",
|
|
20
|
-
showTicks = false
|
|
21
|
-
}, ref) => {
|
|
22
|
-
const percentage = (val) => Math.min(100, Math.max(0, (val - min) / (max - min) * 100));
|
|
23
|
-
const handleMinChange = (raw) => onChange([Math.min(raw, value[1]), value[1]]);
|
|
24
|
-
const handleMaxChange = (raw) => onChange([value[0], Math.max(raw, value[0])]);
|
|
25
|
-
return /* @__PURE__ */ jsxs("div", { ref, className: clsx(styles.root, disabled && styles.disabled), children: [
|
|
26
|
-
/* @__PURE__ */ jsx("div", { className: styles.rail, title: `${min} – ${max}` }),
|
|
27
|
-
showTicks && buildTicks(min, max, step).map((tick) => /* @__PURE__ */ jsx("span", { className: styles.tick, style: { left: `${percentage(tick)}%` } }, tick)),
|
|
28
|
-
/* @__PURE__ */ jsx(
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
className: styles.fill,
|
|
32
|
-
style: { left: `${percentage(value[0])}%`, right: `${100 - percentage(value[1])}%` }
|
|
33
|
-
}
|
|
34
|
-
),
|
|
35
|
-
/* @__PURE__ */ jsx(
|
|
36
|
-
"input",
|
|
37
|
-
{
|
|
38
|
-
type: "range",
|
|
39
|
-
className: styles.thumb,
|
|
40
|
-
min,
|
|
41
|
-
max,
|
|
42
|
-
step,
|
|
43
|
-
value: value[0],
|
|
44
|
-
disabled,
|
|
45
|
-
"aria-label": minAriaLabel,
|
|
46
|
-
onChange: (e) => handleMinChange(Number(e.target.value))
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
/* @__PURE__ */ jsx("span", { className: styles.valueTooltip, style: { left: `${percentage(value[0])}%` }, "aria-hidden": "true", children: value[0] }),
|
|
50
|
-
/* @__PURE__ */ jsx(
|
|
51
|
-
"input",
|
|
52
|
-
{
|
|
53
|
-
type: "range",
|
|
54
|
-
className: styles.thumb,
|
|
55
|
-
min,
|
|
56
|
-
max,
|
|
57
|
-
step,
|
|
58
|
-
value: value[1],
|
|
59
|
-
disabled,
|
|
60
|
-
"aria-label": maxAriaLabel,
|
|
61
|
-
onChange: (e) => handleMaxChange(Number(e.target.value))
|
|
62
|
-
}
|
|
63
|
-
),
|
|
64
|
-
/* @__PURE__ */ jsx("span", { className: styles.valueTooltip, style: { left: `${percentage(value[1])}%` }, "aria-hidden": "true", children: value[1] })
|
|
3
|
+
import { clsx } from "./index57.js";
|
|
4
|
+
import styles from "./index85.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 })
|
|
65
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
|
|
17
|
+
};
|
|
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
|
+
);
|
|
66
32
|
}
|
|
67
33
|
);
|
|
68
|
-
|
|
34
|
+
NavItem.displayName = "NavItem";
|
|
69
35
|
export {
|
|
70
|
-
|
|
36
|
+
NavItem
|
|
71
37
|
};
|
|
72
38
|
//# sourceMappingURL=index37.js.map
|
package/dist/index37.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index37.js","sources":["../src/primitives/
|
|
1
|
+
{"version":3,"file":"index37.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/index38.cjs
CHANGED
|
@@ -2,81 +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("./index57.cjs");
|
|
5
6
|
const constants = require("./index59.cjs");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[minLeftWidth, minRightWidth]
|
|
7
|
+
const Pagination_module = require("./index78.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
21
|
);
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, []);
|
|
26
|
-
const handleMouseMove = react.useCallback(
|
|
27
|
-
(e) => {
|
|
28
|
-
if (!isDragging || !containerRef.current) return;
|
|
29
|
-
const rect = containerRef.current.getBoundingClientRect();
|
|
30
|
-
const pct = (e.clientX - rect.left) / rect.width * FULL_PERCENT;
|
|
31
|
-
setLeftWidth(clampWidth(pct));
|
|
32
|
-
},
|
|
33
|
-
[isDragging, clampWidth]
|
|
22
|
+
const siblingsEnd = Math.min(
|
|
23
|
+
Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),
|
|
24
|
+
endPages[0] - 2
|
|
34
25
|
);
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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" })
|
|
56
47
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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);
|
|
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",
|
|
73
|
+
{
|
|
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" })
|
|
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)
|
|
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
|
+
] }) });
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
Pagination.displayName = "Pagination";
|
|
113
|
+
exports.Pagination = Pagination;
|
|
82
114
|
//# sourceMappingURL=index38.cjs.map
|
package/dist/index38.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index38.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index38.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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"}
|
package/dist/index38.js
CHANGED
|
@@ -1,82 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { clsx } from "./index57.js";
|
|
4
|
+
import { PAGINATION, SVG_STROKE_WIDTH, SVG_VIEWBOX, ICON_SIZE } from "./index59.js";
|
|
5
|
+
import styles from "./index78.js";
|
|
6
|
+
function range(start, end) {
|
|
7
|
+
const out = [];
|
|
8
|
+
for (let page = start; page <= end; page += 1) out.push(page);
|
|
9
|
+
return out;
|
|
10
|
+
}
|
|
11
|
+
function getPaginationItems(currentPage, totalPages, siblingCount, boundaryCount) {
|
|
12
|
+
const totalNumbers = boundaryCount * 2 + siblingCount * 2 + 3;
|
|
13
|
+
if (totalPages <= totalNumbers) return range(1, totalPages);
|
|
14
|
+
const startPages = range(1, boundaryCount);
|
|
15
|
+
const endPages = range(totalPages - boundaryCount + 1, totalPages);
|
|
16
|
+
const siblingsStart = Math.max(
|
|
17
|
+
Math.min(currentPage - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),
|
|
18
|
+
boundaryCount + 2
|
|
19
19
|
);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, []);
|
|
24
|
-
const handleMouseMove = useCallback(
|
|
25
|
-
(e) => {
|
|
26
|
-
if (!isDragging || !containerRef.current) return;
|
|
27
|
-
const rect = containerRef.current.getBoundingClientRect();
|
|
28
|
-
const pct = (e.clientX - rect.left) / rect.width * FULL_PERCENT;
|
|
29
|
-
setLeftWidth(clampWidth(pct));
|
|
30
|
-
},
|
|
31
|
-
[isDragging, clampWidth]
|
|
20
|
+
const siblingsEnd = Math.min(
|
|
21
|
+
Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),
|
|
22
|
+
endPages[0] - 2
|
|
32
23
|
);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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" })
|
|
54
45
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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);
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ jsx("nav", { ref, "aria-label": ariaLabel, className: clsx(styles.root, className), ...props, children: /* @__PURE__ */ jsxs("ul", { className: styles.list, children: [
|
|
69
|
+
showPrevNext && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
type: "button",
|
|
73
|
+
className: styles.arrow,
|
|
74
|
+
onClick: () => goTo(page - 1),
|
|
75
|
+
disabled: page <= 1,
|
|
76
|
+
"aria-label": "Go to previous page",
|
|
77
|
+
children: /* @__PURE__ */ jsx(Chevron, { direction: "left" })
|
|
78
|
+
}
|
|
79
|
+
) }),
|
|
80
|
+
items.map(
|
|
81
|
+
(item, index) => item === "ellipsis" ? (
|
|
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
|
+
] }) });
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
Pagination.displayName = "Pagination";
|
|
79
111
|
export {
|
|
80
|
-
|
|
112
|
+
Pagination
|
|
81
113
|
};
|
|
82
114
|
//# sourceMappingURL=index38.js.map
|