@monolith-forensics/monolith-ui 1.2.96 → 1.2.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,6 +109,6 @@ const TableMenu = () => {
109
109
  style: { padding: "0px 4px", height: 24 },
110
110
  }, dropDownProps: {
111
111
  style: { width: 175, maxWidth: 400 },
112
- }, children: _jsx(Columns3Icon, { size: 14 }) })), (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.enabled) === true && (_jsx(TextInput, { size: "xs", placeholder: ((_d = tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.searchOptions) === null || _d === void 0 ? void 0 : _d.placeholder) || "Search", defaultValue: searchState, onChange: handleSearch }))] })] }), _jsx(QueryFilter, { queryFilter: queryFilter })] }));
112
+ }, children: _jsx(Columns3Icon, { size: 14 }) })), (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.enabled) === true && (_jsx(TextInput, { size: "xs", placeholder: ((_d = tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.searchOptions) === null || _d === void 0 ? void 0 : _d.placeholder) || "Search", value: searchState, onChange: handleSearch }))] })] }), _jsx(QueryFilter, { queryFilter: queryFilter })] }));
113
113
  };
114
114
  export default TableMenu;
@@ -116,6 +116,9 @@ const TableProvider = (_a) => {
116
116
  const runSearch = (searchText) => {
117
117
  setSearch(searchText);
118
118
  };
119
+ const clearSearch = () => {
120
+ setSearch("");
121
+ };
119
122
  const sortData = (sortState) => {
120
123
  // sort data
121
124
  return props.data.sort((a, b) => {
@@ -418,6 +421,7 @@ const TableProvider = (_a) => {
418
421
  selectAllRows,
419
422
  clearSelections,
420
423
  runSearch,
424
+ clearSearch,
421
425
  };
422
426
  }
423
427
  }, [columnState]);
@@ -503,6 +507,7 @@ const TableProvider = (_a) => {
503
507
  clearSelections,
504
508
  toggleColumnVisibility,
505
509
  runSearch,
510
+ clearSearch,
506
511
  handleFilterChange,
507
512
  filterState,
508
513
  compactState,
@@ -126,6 +126,7 @@ export type TableContextType = {
126
126
  toggleCompact: () => void;
127
127
  toggleColumnVisibility: (dataField: string) => void;
128
128
  runSearch: (query: string) => void;
129
+ clearSearch: () => void;
129
130
  handleFilterChange: (query: Query) => void;
130
131
  selectAllRows: () => void;
131
132
  clearSelections: () => void;
@@ -301,5 +302,6 @@ export type TableInstance = {
301
302
  deselectRow: (row: any) => void;
302
303
  selectAllRows: () => void;
303
304
  runSearch: (query: string) => void;
305
+ clearSearch: () => void;
304
306
  clearSelections: () => void;
305
307
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.2.96",
3
+ "version": "1.2.98",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",