@snack-uikit/pagination
Advanced tools
Comparing version 0.6.11 to 0.6.12-preview-d907dbcf.0
@@ -8,2 +8,4 @@ import { WithSupportProps } from '@snack-uikit/utils'; | ||
page: number; | ||
/** Максимальное количество страниц/элементов, помещающихся до транкейта */ | ||
maxLength?: number; | ||
/** Колбек смены значения */ | ||
@@ -18,2 +20,2 @@ onChange(page: number): void; | ||
}>; | ||
export declare function Pagination({ total, page, onChange, className, size, ...rest }: PaginationProps): import("react/jsx-runtime").JSX.Element; | ||
export declare function Pagination({ total, page, onChange, className, size, maxLength, ...rest }: PaginationProps): import("react/jsx-runtime").JSX.Element; |
@@ -27,3 +27,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
export function Pagination(_a) { | ||
var { total, page, onChange, className, size = SIZE.S } = _a, rest = __rest(_a, ["total", "page", "onChange", "className", "size"]); | ||
var { total, page, onChange, className, size = SIZE.S, maxLength = MAX_LENGTH } = _a, rest = __rest(_a, ["total", "page", "onChange", "className", "size", "maxLength"]); | ||
const entries = getPaginationEntries({ | ||
@@ -33,3 +33,3 @@ firstPage: FIRST_PAGE, | ||
currentPage: page, | ||
maxLength: MAX_LENGTH, | ||
maxLength, | ||
}); | ||
@@ -36,0 +36,0 @@ const buttonRefs = useRef([]); |
@@ -53,4 +53,4 @@ import { getRange } from './getRange'; | ||
const { firstPage, lastPage, currentPage, currentPageSiblingsCount } = state; | ||
const groupFirstPage = currentPage - currentPageSiblingsCount / 2; | ||
const groupLastPage = currentPage + currentPageSiblingsCount / 2; | ||
const groupFirstPage = Math.floor(currentPage - currentPageSiblingsCount / 2); | ||
const groupLastPage = Math.floor(currentPage + currentPageSiblingsCount / 2); | ||
const group = getRange(groupFirstPage, groupLastPage).map(createPageEntry); | ||
@@ -57,0 +57,0 @@ return [ |
@@ -7,3 +7,3 @@ { | ||
"title": "Pagination", | ||
"version": "0.6.11", | ||
"version": "0.6.12-preview-d907dbcf.0", | ||
"sideEffects": [ | ||
@@ -40,3 +40,3 @@ "*.css", | ||
}, | ||
"gitHead": "b5cf5887d7e1a31571c4ca424b022ef391ed4fef" | ||
"gitHead": "75e1b1c158ad3540a0aa132333a4cccbce3e7217" | ||
} |
@@ -40,2 +40,3 @@ # Pagination | ||
| total* | `number` | - | Общее количество страниц | | ||
| maxLength | `number` | 7 | Максимальное количество страниц/элементов, помещающихся до транкейта | | ||
| className | `string` | - | CSS класснейм | | ||
@@ -42,0 +43,0 @@ | size | enum Size: `"xs"`, `"s"` | s | Размер | |
@@ -84,4 +84,4 @@ import { getRange } from './getRange'; | ||
const { firstPage, lastPage, currentPage, currentPageSiblingsCount } = state; | ||
const groupFirstPage = currentPage - currentPageSiblingsCount / 2; | ||
const groupLastPage = currentPage + currentPageSiblingsCount / 2; | ||
const groupFirstPage = Math.floor(currentPage - currentPageSiblingsCount / 2); | ||
const groupLastPage = Math.floor(currentPage + currentPageSiblingsCount / 2); | ||
const group = getRange(groupFirstPage, groupLastPage).map(createPageEntry); | ||
@@ -88,0 +88,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67992
867
55