diff --git a/packages/react/.changeset/eleven-carrots-press.md b/packages/react/.changeset/eleven-carrots-press.md new file mode 100644 index 000000000..d595cb808 --- /dev/null +++ b/packages/react/.changeset/eleven-carrots-press.md @@ -0,0 +1,5 @@ +--- +"@gadgetinc/react": patch +--- + +Added `searchValue` property to `AutoTable` component to control the table's search value diff --git a/packages/react/src/auto/AutoTable.tsx b/packages/react/src/auto/AutoTable.tsx index d02f5d9aa..dc57d9d01 100644 --- a/packages/react/src/auto/AutoTable.tsx +++ b/packages/react/src/auto/AutoTable.tsx @@ -40,5 +40,6 @@ export type AutoTableProps< resourceName?: { singular: string; plural: string }; condensed?: boolean; searchable?: boolean; + searchValue?: string; paginate?: boolean; }; diff --git a/packages/react/src/auto/polaris/PolarisAutoTable.tsx b/packages/react/src/auto/polaris/PolarisAutoTable.tsx index b812b0620..8925f3df8 100644 --- a/packages/react/src/auto/polaris/PolarisAutoTable.tsx +++ b/packages/react/src/auto/polaris/PolarisAutoTable.tsx @@ -92,6 +92,7 @@ const PolarisAutoTableComponent = < live: props.live, initialSort: props.initialSort, filter: props.filter, + search: props.searchValue, } as any); const { columns, rows, page, fetching, error, search, selection, sort, metadata, data: rawRecords } = methods;