Skip to content

Commit 07c5b6a

Browse files
authored
fix(CommonProps): add type definitions for HTML attributes (#692)
1 parent 825a629 commit 07c5b6a

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

packages/main/src/components/AnalyticalTable/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import { TitleBar } from './TitleBar';
5252
import { orderByFn } from './util';
5353
import { VirtualTableBody } from './virtualization/VirtualTableBody';
5454

55-
export interface TableProps extends CommonProps {
55+
export interface TableProps extends Omit<CommonProps, 'title'> {
5656
/**
5757
* Please look at the [AnalyticalTableColumnDefinition interface](#column-properties) for a full list of options.
5858
*/
@@ -213,8 +213,6 @@ const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, ref: Ref<
213213
setColumnOrder,
214214
dispatch,
215215
totalColumnsWidth,
216-
toggleRowSelected,
217-
toggleAllRowsSelected,
218216
setGroupBy
219217
} = useTable(
220218
{

packages/main/src/components/FilterBar/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ const FilterBar: FC<FilterBarPropTypes> = forwardRef((props: FilterBarPropTypes,
275275
child.props.children?.props?.children?.map((item) => item.props.selected).join(',') !==
276276
prevChildren?.current?.[child.key]?.children?.map((item) => item.props.selected).join(','))
277277
) {
278+
// @ts-ignore
278279
const { [child.key]: omit, ...rest } = dialogRefs;
279280
setDialogRefs(rest);
280281
}

packages/main/src/components/FilterItem/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import React, { FC, forwardRef, ReactNode, RefObject, useEffect, useMemo } from
1616
import { CommonProps } from '../../interfaces/CommonProps';
1717
import styles from './FilterItem.jss';
1818

19-
export interface FilterItemPropTypes extends CommonProps {
19+
export interface FilterItemPropTypes extends Omit<CommonProps, 'onChange'> {
2020
placeholder?: string;
2121
type?: FilterType;
2222
label?: string;

packages/main/src/components/VariantManagement/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export interface VariantItem {
2727
label: string;
2828
}
2929

30-
export interface VariantManagementPropTypes extends CommonProps {
30+
31+
export interface VariantManagementPropTypes extends Omit<CommonProps, 'onSelect'> {
3132
/**
3233
* Determines on which side the VariantManagement popover is placed at.
3334
*/

packages/main/src/interfaces/CommonProps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { CSSProperties, Ref } from 'react';
1+
import { CSSProperties, Ref, HTMLAttributes } from 'react';
22

3-
export interface CommonProps {
3+
export interface CommonProps extends HTMLAttributes<HTMLElement> {
44
/**
55
* Element style which will be appended to the most outer element of a component.
66
* Use this prop carefully, some css properties might break the component.

packages/main/src/internal/withWebComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const createEventPropName = (eventName) => `on${capitalizeFirstLetter(kebabToCam
2323

2424
type EventHandler = (event: CustomEvent<unknown>) => void;
2525

26-
export interface WithWebComponentPropTypes extends CommonProps, HTMLAttributes<HTMLElement> {
26+
export interface WithWebComponentPropTypes extends CommonProps {
2727
ref?: Ref<any>;
2828
children?: any | void;
2929
}

0 commit comments

Comments
 (0)