From 2b3a83b1c8c01a9bf2b56d5e9936e1470e04c0f4 Mon Sep 17 00:00:00 2001
From: Naegelin <>
Date: Fri, 12 Aug 2022 18:26:13 +0200
Subject: [PATCH] resolve merge conflicts
---
COMPONENT_INDEX.md | 7 ++++---
docs/src/COMPONENT_API.json | 12 ++++++++++++
src/DataTable/ToolbarBatchActions.svelte | 8 +++++++-
types/DataTable/ToolbarBatchActions.svelte.d.ts | 6 ++++++
4 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md
index c0bb3fc0..d43e129c 100644
--- a/COMPONENT_INDEX.md
+++ b/COMPONENT_INDEX.md
@@ -4422,9 +4422,10 @@ None.
### Props
-| Prop name | Required | Kind | Reactive | Type | Default value | Description |
-| :------------------ | :------- | :--------------- | :------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------------------------------------- |
-| formatTotalSelected | No | let
| No | (totalSelected: number) => string
| (totalSelected) => \`${totalSelected} item${totalSelected === 1 ? "" : "s"} selected\`
| Override the total items selected text |
+| Prop name | Required | Kind | Reactive | Type | Default value | Description |
+| :------------------ | :------- | :--------------- | :------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
+| formatTotalSelected | No | let
| No | (totalSelected: number) => string
| (totalSelected) => \`${totalSelected} item${totalSelected === 1 ? "" : "s"} selected\`
| Override the total items selected text |
+| active | No | let
| No | boolean
| false
| Set to `true` to show the toolbar regardless of row selection |
### Slots
diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json
index de37420f..e149ae27 100644
--- a/docs/src/COMPONENT_API.json
+++ b/docs/src/COMPONENT_API.json
@@ -13672,6 +13672,18 @@
"isRequired": false,
"constant": false,
"reactive": false
+ },
+ {
+ "name": "active",
+ "kind": "let",
+ "description": "Set to `true` to show the toolbar regardless of row selection",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "isFunctionDeclaration": false,
+ "isRequired": false,
+ "constant": false,
+ "reactive": false
}
],
"moduleExports": [],
diff --git a/src/DataTable/ToolbarBatchActions.svelte b/src/DataTable/ToolbarBatchActions.svelte
index 9f539412..d65e3801 100644
--- a/src/DataTable/ToolbarBatchActions.svelte
+++ b/src/DataTable/ToolbarBatchActions.svelte
@@ -10,6 +10,12 @@
export let formatTotalSelected = (totalSelected) =>
`${totalSelected} item${totalSelected === 1 ? "" : "s"} selected`;
+ /**
+ * Set to `true` to show the toolbar regardless of row selection
+ * @type {boolean}
+ */
+ export let active = false;
+
import { onMount, getContext, createEventDispatcher } from "svelte";
import Button from "../Button/Button.svelte";
@@ -17,7 +23,7 @@
const dispatch = createEventDispatcher();
- $: showActions = batchSelectedIds.length > 0;
+ $: showActions = batchSelectedIds.length > 0 || active;
const ctx = getContext("DataTable");
diff --git a/types/DataTable/ToolbarBatchActions.svelte.d.ts b/types/DataTable/ToolbarBatchActions.svelte.d.ts
index f9dfa900..2778e7f6 100644
--- a/types/DataTable/ToolbarBatchActions.svelte.d.ts
+++ b/types/DataTable/ToolbarBatchActions.svelte.d.ts
@@ -8,6 +8,12 @@ export interface ToolbarBatchActionsProps
* @default (totalSelected) => `${totalSelected} item${totalSelected === 1 ? "" : "s"} selected`
*/
formatTotalSelected?: (totalSelected: number) => string;
+
+ /**
+ * Set to `true` to show the toolbar regardless of row selection
+ * @default false
+ */
+ active?: boolean;
}
export default class ToolbarBatchActions extends SvelteComponentTyped<