From d956265c3a85cc5706dec96ed92c0b4e7901ef67 Mon Sep 17 00:00:00 2001 From: Elena Makarova Date: Tue, 18 Nov 2025 11:31:41 +0300 Subject: [PATCH] fix: pass all needed props to renderToolbar --- src/StructuredYson/StructuredYson.tsx | 9 ++++++++- src/StructuredYson/types.ts | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/StructuredYson/StructuredYson.tsx b/src/StructuredYson/StructuredYson.tsx index 76741cf..a0ad2cb 100644 --- a/src/StructuredYson/StructuredYson.tsx +++ b/src/StructuredYson/StructuredYson.tsx @@ -356,9 +356,16 @@ export class StructuredYson extends React.PureComponent { if (renderToolbar) { return renderToolbar({ - onFilterChange: this.onFilterChange, + filter, + matchIndex: matchIndex, + matchedRows: matchedRows, + allMatchPaths: allMatchPaths, onExpandAll: this.onExpandAll, onCollapseAll: this.onCollapseAll, + onFilterChange: this.onFilterChange, + onNextMatch: this.onNextMatch, + onPrevMatch: this.onPrevMatch, + onEnterKeyDown: this.onEnterKeyDown, isCollapsed, }); } diff --git a/src/StructuredYson/types.ts b/src/StructuredYson/types.ts index 4dd323c..0d532c2 100644 --- a/src/StructuredYson/types.ts +++ b/src/StructuredYson/types.ts @@ -22,9 +22,16 @@ export type UnipikaSettings = { export type CollapseIconType = 'chevron'; export interface ToolbarProps { - onFilterChange: (filter: string) => void; + filter: string; + matchIndex: number; + matchedRows: Array; + allMatchPaths: Array; onExpandAll: () => void; onCollapseAll: () => void; + onFilterChange: (filter: string) => void; + onNextMatch: (event: unknown, diff?: number) => void; + onPrevMatch: () => void; + onEnterKeyDown: (e: React.KeyboardEvent) => void; isCollapsed: boolean; }