Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/StructuredYson/StructuredYson.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
: {};

return {
value: {} as any, // valid value will be provided from getDerivedStateFromProps call

Check warning on line 156 in src/StructuredYson/StructuredYson.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected any. Specify a different type
flattenResult: {data: [], searchIndex: {}},
settings: {},
yson: true,
Expand All @@ -166,7 +166,7 @@
};
}

onTogglePathCollapse = (path: string) => {

Check warning on line 169 in src/StructuredYson/StructuredYson.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

onTogglePathCollapse should be placed after render
const {collapsedState: oldState} = this.state;
const collapsedState = {...oldState};
if (collapsedState[path]) {
Expand Down Expand Up @@ -356,9 +356,16 @@

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,
});
}
Expand Down
9 changes: 8 additions & 1 deletion src/StructuredYson/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ export type UnipikaSettings = {
export type CollapseIconType = 'chevron';

export interface ToolbarProps {
onFilterChange: (filter: string) => void;
filter: string;
matchIndex: number;
matchedRows: Array<number>;
allMatchPaths: Array<string>;
onExpandAll: () => void;
onCollapseAll: () => void;
onFilterChange: (filter: string) => void;
onNextMatch: (event: unknown, diff?: number) => void;
onPrevMatch: () => void;
onEnterKeyDown: (e: React.KeyboardEvent) => void;
isCollapsed: boolean;
}

Expand Down
Loading