Skip to content

Commit b0bbea4

Browse files
authored
fix: pass all needed props to renderToolbar (#26)
1 parent b7163ea commit b0bbea4

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/StructuredYson/StructuredYson.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,16 @@ export class StructuredYson extends React.PureComponent<Props, State> {
356356

357357
if (renderToolbar) {
358358
return renderToolbar({
359-
onFilterChange: this.onFilterChange,
359+
filter,
360+
matchIndex: matchIndex,
361+
matchedRows: matchedRows,
362+
allMatchPaths: allMatchPaths,
360363
onExpandAll: this.onExpandAll,
361364
onCollapseAll: this.onCollapseAll,
365+
onFilterChange: this.onFilterChange,
366+
onNextMatch: this.onNextMatch,
367+
onPrevMatch: this.onPrevMatch,
368+
onEnterKeyDown: this.onEnterKeyDown,
362369
isCollapsed,
363370
});
364371
}

src/StructuredYson/types.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ export type UnipikaSettings = {
2222
export type CollapseIconType = 'chevron';
2323

2424
export interface ToolbarProps {
25-
onFilterChange: (filter: string) => void;
25+
filter: string;
26+
matchIndex: number;
27+
matchedRows: Array<number>;
28+
allMatchPaths: Array<string>;
2629
onExpandAll: () => void;
2730
onCollapseAll: () => void;
31+
onFilterChange: (filter: string) => void;
32+
onNextMatch: (event: unknown, diff?: number) => void;
33+
onPrevMatch: () => void;
34+
onEnterKeyDown: (e: React.KeyboardEvent) => void;
2835
isCollapsed: boolean;
2936
}
3037

0 commit comments

Comments
 (0)