Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-grid): fix typescript for grouping panel #3580

Merged
merged 2 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 6 additions & 9 deletions packages/dx-react-grid/api/dx-react-grid.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,14 @@ export const GroupingPanel: React_2.ComponentType<GroupingPanelProps>;
export namespace GroupingPanel {
export interface ContainerProps {
children?: React_2.ReactNode;
forwardedRef?: React_2.RefObject<Element>;
}
export interface EmptyMessageProps {
forwardedRef?: React_2.Ref<Element>;
getMessage: (messageKey: string) => string;
}
export interface ItemProps {
forwardedRef?: React_2.Ref<Element>;
groupingEnabled: boolean;
item: GroupingPanelItem;
onGroup: () => void;
Expand All @@ -529,15 +532,9 @@ export interface GroupingPanelItem {

// @public (undocumented)
export interface GroupingPanelProps {
containerComponent: React_2.ComponentType<GroupingPanel.ContainerProps & {
forwardedRef?: React_2.RefObject<Element>;
}>;
emptyMessageComponent: React_2.ComponentType<GroupingPanel.EmptyMessageProps & {
forwardedRef?: React_2.Ref<Element>;
}>;
itemComponent: React_2.ComponentType<GroupingPanel.ItemProps & {
forwardedRef?: React_2.Ref<Element>;
}>;
containerComponent: React_2.ComponentType<GroupingPanel.ContainerProps>;
emptyMessageComponent: React_2.ComponentType<GroupingPanel.EmptyMessageProps>;
itemComponent: React_2.ComponentType<GroupingPanel.ItemProps>;
messages?: GroupingPanel.LocalizationMessages;
showGroupingControls?: boolean;
showSortingControls?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export namespace GroupingPanel {
export interface ContainerProps {
/** A React node to be placed in the root layout. */
children?: React.ReactNode;
/** A reference to the group panel container or a function that accepts it. */
forwardedRef?: React.RefObject<Element>;
}

/** Describes properties passed to a group panel item template when it is being rendered. */
Expand All @@ -26,12 +28,16 @@ export namespace GroupingPanel {
onSort: (parameters: { direction?: 'asc' | 'desc' | null, keepOther?: boolean }) => void;
/** An event that initiates grouping by column. */
onGroup: () => void;
/** A reference to the group panel item or a function that accepts it. */
forwardedRef?: React.Ref<Element>;
}

/** Describes properties passed to a component that renders an empty group panel message. */
export interface EmptyMessageProps {
/** Returns the text displayed in the group panel if grid data is not grouped. */
getMessage: (messageKey: string) => string;
/** A reference to the group panel message or a function that accepts it. */
forwardedRef?: React.Ref<Element>;
}

export interface LocalizationMessages {
Expand Down Expand Up @@ -86,15 +92,15 @@ export interface GroupingPanelProps {
showGroupingControls?: boolean;
/** A component that renders a group panel container. */
containerComponent: React.ComponentType<
GroupingPanel.ContainerProps & { forwardedRef?: React.RefObject<Element> }
GroupingPanel.ContainerProps
>;
/** A component that renders a group panel item. */
itemComponent: React.ComponentType<
GroupingPanel.ItemProps & { forwardedRef?: React.Ref<Element> }
GroupingPanel.ItemProps
>;
/** A component that renders an empty group panel message. */
emptyMessageComponent: React.ComponentType<
GroupingPanel.EmptyMessageProps & { forwardedRef?: React.Ref<Element> }
GroupingPanel.EmptyMessageProps
>;
/** An object that specifies the localization messages. */
messages?: GroupingPanel.LocalizationMessages;
Expand Down