- {#each currentPageData() as item, idx}
+ {#each currentPageData as item, idx}
{#each includedFields as field}
|
{/if}
{#if paginated}
-
- {/if}
+ {/if}
@@ -554,55 +506,4 @@
cursor: pointer;
}
}
-
- nav.pagination {
- display: flex;
- justify-content: center;
- align-items: center;
- margin-top: 1rem;
- font-size: 1rem;
- font-family: $font-family-display;
- font-weight: 400;
- button {
- padding: 5px 10px;
- border: 1px solid;
- border-color: $tr-contrast-grey;
- border-radius: 8px;
- background: $white;
- color: $tr-medium-grey;
- cursor: pointer;
- width: 40px;
- height: 40px;
- &:disabled {
- border-color: $tr-light-grey;
- color: $tr-light-grey;
- cursor: default;
- }
- .icon-wrapper {
- display: flex;
- align-items: center;
- justify-content: center;
- white-space: nowrap;
- transition: all 0.15s ease;
- .icon {
- height: 1rem;
- width: 1rem;
- fill: currentColor;
- }
- }
- }
- .label {
- margin: 0 1rem;
- }
- }
-
- .visually-hidden {
- clip: rect(0 0 0 0);
- clip-path: inset(50%);
- height: 1px;
- overflow: hidden;
- position: absolute;
- white-space: nowrap;
- width: 1px;
- }
diff --git a/src/components/Table/stories/docs/paginate.md b/src/components/Table/stories/docs/paginate.md
new file mode 100644
index 00000000..6fb7ad3a
--- /dev/null
+++ b/src/components/Table/stories/docs/paginate.md
@@ -0,0 +1,13 @@
+When you table has lots of rows you should consider breaking it up into pages. This can be done by setting the `paginated` option.
+
+When it is enabled, readers can leaf through the data using a set of buttons below the table. By default there are 25 records per page. You can change the number by adjusting the `pageSize` option.
+
+This is a good option when publishing large tables for readers to explore. It works well with interactive features like searching and filters.
+
+```svelte
+
+```
diff --git a/src/components/Table/utils.js b/src/components/Table/utils.js
index a0aa825c..ac5f8095 100644
--- a/src/components/Table/utils.js
+++ b/src/components/Table/utils.js
@@ -16,12 +16,6 @@ export function paginateArray(array, pageSize, pageNumber) {
return array.slice((pageNumber - 1) * pageSize, pageNumber * pageSize);
}
-export function numberWithCommas(n) {
- const parts = n.toString().split('.');
- parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
- return parts.join('.');
-}
-
export function uniqueAttr(array, attr) {
return array.map((e) => e[attr]).filter(unique);
}
|