mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(pagination): use toLocaleString
for default text formatting (#2161)
This commit is contained in:
parent
ed3928bb01
commit
cdf5659fa0
6 changed files with 85 additions and 33 deletions
8
types/Pagination/Pagination.svelte.d.ts
vendored
8
types/Pagination/Pagination.svelte.d.ts
vendored
|
@ -53,13 +53,13 @@ type $Props = {
|
|||
|
||||
/**
|
||||
* Override the item text
|
||||
* @default (min, max) => `${min}–${max} item${max === 1 ? "" : "s"}`
|
||||
* @default (min, max) => `${min.toLocaleString()}–${max.toLocaleString()} item${max === 1 ? "" : "s"}`
|
||||
*/
|
||||
itemText?: (min: number, max: number) => string;
|
||||
|
||||
/**
|
||||
* Override the item range text
|
||||
* @default (min, max, total) => `${min}–${max} of ${total} item${max === 1 ? "" : "s"}`
|
||||
* @default (min, max, total) => `${min.toLocaleString()}–${max.toLocaleString()} of ${total.toLocaleString()} item${max === 1 ? "" : "s"}`
|
||||
*/
|
||||
itemRangeText?: (min: number, max: number, total: number) => string;
|
||||
|
||||
|
@ -95,13 +95,13 @@ type $Props = {
|
|||
|
||||
/**
|
||||
* Override the page text
|
||||
* @default (page) => `page ${page}`
|
||||
* @default (page) => `page ${page.toLocaleString()}`
|
||||
*/
|
||||
pageText?: (page: number) => string;
|
||||
|
||||
/**
|
||||
* Override the page range text
|
||||
* @default (current, total) => `of ${total} page${total === 1 ? "" : "s"}`
|
||||
* @default (current, total) => `of ${total.toLocaleString()} page${total === 1 ? "" : "s"}`
|
||||
*/
|
||||
pageRangeText?: (current: number, total: number) => string;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue