Skip to content

Commit

Permalink
fix: emit event for when mini table is used
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelagoffe authored and cristinecula committed Dec 10, 2024
1 parent 33abe79 commit f58c6d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/use-omnitable.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const useOmnitable = (host) => {
filters,
setFilterState,
selectedItems,
isMini,
...sortAndGroupOptions,
});

Expand Down
7 changes: 4 additions & 3 deletions lib/use-public-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,21 @@ export const usePublicInterface = ({ host, visibleData, filters, ...api }) => {
useNotifyProperty('visibleData', visibleData);
useNotifyProperty(
'sortedFilteredGroupedItems',
api.sortedFilteredGroupedItems
api.sortedFilteredGroupedItems,
);
useNotifyProperty('selectedItems', api.selectedItems);
useNotifyProperty('sortOn', api.sortOn);
useNotifyProperty('descending', api.descending);
useNotifyProperty('isMini', api.isMini);

const filterValues = useMemo(
() =>
Object.fromEntries(
Object.entries(filters)
.filter(([, { filter }]) => filter !== undefined)
.map(([key, { filter }]) => [key, filter])
.map(([key, { filter }]) => [key, filter]),
),
[filters]
[filters],
);

useNotifyProperty('filters', filterValues, Object.values(filterValues));
Expand Down

0 comments on commit f58c6d2

Please sign in to comment.