fix(pagination): use toLocaleString for default text formatting (#2161)

This commit is contained in:
Eric Liu 2025-04-26 13:39:26 -07:00 committed by GitHub
commit cdf5659fa0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 85 additions and 33 deletions

View file

@ -10113,7 +10113,7 @@
"kind": "let",
"description": "Override the item text",
"type": "(min: number, max: number) => string",
"value": "(min, max) =>\n `${min}${max} item${max === 1 ? \"\" : \"s\"}`",
"value": "(min, max) =>\n `${min.toLocaleString()}${max.toLocaleString()} item${max === 1 ? \"\" : \"s\"}`",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -10125,7 +10125,7 @@
"kind": "let",
"description": "Override the item range text",
"type": "(min: number, max: number, total: number) => string",
"value": "(\n min,\n max,\n total,\n) =>\n `${min}${max} of ${total} item${max === 1 ? \"\" : \"s\"}`",
"value": "(\n min,\n max,\n total,\n) =>\n `${min.toLocaleString()}${max.toLocaleString()} of ${total.toLocaleString()} item${max === 1 ? \"\" : \"s\"}`",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -10197,7 +10197,7 @@
"kind": "let",
"description": "Override the page text",
"type": "(page: number) => string",
"value": "(page) => `page ${page}`",
"value": "(page) => `page ${page.toLocaleString()}`",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -10209,7 +10209,7 @@
"kind": "let",
"description": "Override the page range text",
"type": "(current: number, total: number) => string",
"value": "(\n current,\n total,\n) =>\n `of ${total} page${total === 1 ? \"\" : \"s\"}`",
"value": "(\n current,\n total,\n) =>\n `of ${total.toLocaleString()} page${total === 1 ? \"\" : \"s\"}`",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,