From 6734211489017ceea7e7b806b66250236a145ff6 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Thu, 17 Mar 2022 19:51:09 -0700 Subject: [PATCH] Run "yarn build:docs" --- COMPONENT_INDEX.md | 19 ++++++++++--------- docs/src/COMPONENT_API.json | 13 ++++++++++++- types/DataTable/ToolbarSearch.svelte.d.ts | 17 +++++++++++++++++ 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 052c625c..f0492c1e 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -988,8 +988,8 @@ export interface DataTableCell { | selectable | let | Yes | boolean | false | Set to `true` for the selectable variant
Automatically set to `true` if `radio` or `batchSelection` are `true` | | expandedRowIds | let | Yes | DataTableRowId[] | [] | Specify the row ids to be expanded | | expandable | let | Yes | boolean | false | Set to `true` for the expandable variant
Automatically set to `true` if `batchExpansion` is `true` | -| rows | let | Yes | DataTableRow[] | [] | Specify the rows the data table should render
keys defined in `headers` are used for the row ids | | headers | let | No | DataTableHeader[] | [] | Specify the data table headers | +| rows | let | No | DataTableRow[] | [] | Specify the rows the data table should render
keys defined in `headers` are used for the row ids | | size | let | No | "compact" | "short" | "medium" | "tall" | undefined | Set the size of the data table | | title | let | No | string | "" | Specify the title of the data table | | description | let | No | string | "" | Specify the description of the data table | @@ -4623,14 +4623,15 @@ None. ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :--------- | :--------------- | :------- | :---------------------------------------- | ------------------ | --------------------------------------------- | -| ref | let | Yes | null | HTMLInputElement | null | Obtain a reference to the input HTML element | -| expanded | let | Yes | boolean | false | Set to `true` to expand the search bar | -| value | let | Yes | number | string | "" | Specify the value of the search input | -| persistent | let | No | boolean | false | Set to `true` to keep the search bar expanded | -| disabled | let | No | boolean | false | Set to `true` to disable the search bar | -| tabindex | let | No | string | "0" | Specify the tabindex | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :--------------- | :--------------- | :------- | :---------------------------------------------------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ref | let | Yes | null | HTMLInputElement | null | Obtain a reference to the input HTML element | +| expanded | let | Yes | boolean | false | Set to `true` to expand the search bar | +| value | let | Yes | number | string | "" | Specify the value of the search input | +| persistent | let | No | boolean | false | Set to `true` to keep the search bar expanded | +| disabled | let | No | boolean | false | Set to `true` to disable the search bar | +| shouldFilterRows | let | No | boolean | ((rows: import("./DataTable.svelte").DataTableRow, value: number | string) => boolean) | false | Set to `true` to filter table rows using the search value.

If `true`, the default search excludes `id`, `cells` fields and
only does a basic comparison on string and number type cell values.

To implement your own client-side filtering, pass a function
that accepts a row and value and returns a boolean. | +| tabindex | let | No | string | "0" | Specify the tabindex | ### Slots diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index f7698d84..5e1a9f09 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -2269,7 +2269,7 @@ "isFunction": false, "isFunctionDeclaration": false, "constant": false, - "reactive": true + "reactive": false }, { "name": "size", @@ -13137,6 +13137,17 @@ "constant": false, "reactive": false }, + { + "name": "shouldFilterRows", + "kind": "let", + "description": "Set to `true` to filter table rows using the search value.\n\nIf `true`, the default search excludes `id`, `cells` fields and\nonly does a basic comparison on string and number type cell values.\n\nTo implement your own client-side filtering, pass a function\nthat accepts a row and value and returns a boolean.", + "type": "boolean | ((rows: import(\"./DataTable.svelte\").DataTableRow, value: number | string) => boolean)", + "value": "false", + "isFunction": false, + "isFunctionDeclaration": false, + "constant": false, + "reactive": false + }, { "name": "tabindex", "kind": "let", diff --git a/types/DataTable/ToolbarSearch.svelte.d.ts b/types/DataTable/ToolbarSearch.svelte.d.ts index b3ced787..83653277 100644 --- a/types/DataTable/ToolbarSearch.svelte.d.ts +++ b/types/DataTable/ToolbarSearch.svelte.d.ts @@ -27,6 +27,23 @@ export interface ToolbarSearchProps */ disabled?: boolean; + /** + * Set to `true` to filter table rows using the search value. + * + * If `true`, the default search excludes `id`, `cells` fields and + * only does a basic comparison on string and number type cell values. + * + * To implement your own client-side filtering, pass a function + * that accepts a row and value and returns a boolean. + * @default false + */ + shouldFilterRows?: + | boolean + | (( + rows: import("./DataTable.svelte").DataTableRow, + value: number | string + ) => boolean); + /** * Specify the tabindex * @default "0"