From 52eff3c5a8cd1b198074d597a1f8aac3568e3253 Mon Sep 17 00:00:00 2001 From: metonym Date: Sat, 30 Apr 2022 09:58:14 -0700 Subject: [PATCH] docs(data-table): add "Expandable and selectable" example (#1277) * docs(data-table): add "Expandable and selectable" example * docs(data-table): add "Batch selection" example * docs(data-table): rework "Batch selection with initial selected rows" example * docs(data-table): rework selectable examples to include selectedRowIds * docs: remove extra space from pre tags --- docs/src/pages/components/DataTable.svx | 32 ++++++++--------- .../pages/framed/Breakpoint/Breakpoint.svelte | 4 +-- .../DataTable/DataTableBatchSelection.svelte | 31 +++++++--------- .../DataTableBatchSelectionInitial.svelte | 24 +++++++++++++ .../DataTableExpandableSelectable.svelte | 35 +++++++++++++++++++ .../DataTable/DataTableExpandableZebra.svelte | 4 +-- .../DataTableNonExpandableRows.svelte | 4 +-- .../DataTable/SelectableDataTable.svelte | 32 ++++++++--------- .../framed/LocalStorage/LocalStorage.svelte | 4 +-- 9 files changed, 108 insertions(+), 62 deletions(-) create mode 100644 docs/src/pages/framed/DataTable/DataTableBatchSelectionInitial.svelte create mode 100644 docs/src/pages/framed/DataTable/DataTableExpandableSelectable.svelte diff --git a/docs/src/pages/components/DataTable.svx b/docs/src/pages/components/DataTable.svx index 3fef0c40..2789d711 100644 --- a/docs/src/pages/components/DataTable.svx +++ b/docs/src/pages/components/DataTable.svx @@ -1077,10 +1077,16 @@ In the following example, each row in the sortable data table has an overflow me -### Initial selected rows +### Batch selection +### Batch selection with initial selected rows + +Use the `selectedRowIds` prop to specify which rows should be selected. + + + ### Selectable with batch actions @@ -1150,9 +1156,7 @@ Use `nonSelectableRowIds` to specify the ids for rows that should not be selecta ]}" > -
-      {JSON.stringify(row, null, 2)}
-    
+
{JSON.stringify(row, null, 2)}
@@ -1221,9 +1225,7 @@ Use `nonExpandableRowIds` to specify the ids for rows that should not be expanda ]}" > -
-      {JSON.stringify(row, null, 2)}
-    
+
{JSON.stringify(row, null, 2)}
@@ -1282,9 +1284,7 @@ Use `nonExpandableRowIds` to specify the ids for rows that should not be expanda ]}" > -
-      {JSON.stringify(row, null, 2)}
-    
+
{JSON.stringify(row, null, 2)}
@@ -1343,9 +1343,7 @@ Use `nonExpandableRowIds` to specify the ids for rows that should not be expanda ]}" > -
-      {JSON.stringify(row, null, 2)}
-    
+
{JSON.stringify(row, null, 2)}
@@ -1404,12 +1402,14 @@ Use `nonExpandableRowIds` to specify the ids for rows that should not be expanda ]}" > -
-      {JSON.stringify(row, null, 2)}
-    
+
{JSON.stringify(row, null, 2)}
+### Expandable and selectable + + + ### Skeleton diff --git a/docs/src/pages/framed/Breakpoint/Breakpoint.svelte b/docs/src/pages/framed/Breakpoint/Breakpoint.svelte index b1b7e0a1..9f2473f9 100644 --- a/docs/src/pages/framed/Breakpoint/Breakpoint.svelte +++ b/docs/src/pages/framed/Breakpoint/Breakpoint.svelte @@ -12,9 +12,7 @@

{size}

on:change
-
-  {JSON.stringify(events, null, 2)}
-
+
{JSON.stringify(events, null, 2)}