Skip to content

Commit

Permalink
fix(CommonProps): add type definitions for HTML attributes (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas742 authored Sep 25, 2020
1 parent 825a629 commit 07c5b6a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 1 addition & 3 deletions packages/main/src/components/AnalyticalTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { TitleBar } from './TitleBar';
import { orderByFn } from './util';
import { VirtualTableBody } from './virtualization/VirtualTableBody';

export interface TableProps extends CommonProps {
export interface TableProps extends Omit<CommonProps, 'title'> {
/**
* Please look at the [AnalyticalTableColumnDefinition interface](#column-properties) for a full list of options.
*/
Expand Down Expand Up @@ -213,8 +213,6 @@ const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, ref: Ref<
setColumnOrder,
dispatch,
totalColumnsWidth,
toggleRowSelected,
toggleAllRowsSelected,
setGroupBy
} = useTable(
{
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/components/FilterBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ const FilterBar: FC<FilterBarPropTypes> = forwardRef((props: FilterBarPropTypes,
child.props.children?.props?.children?.map((item) => item.props.selected).join(',') !==
prevChildren?.current?.[child.key]?.children?.map((item) => item.props.selected).join(','))
) {
// @ts-ignore
const { [child.key]: omit, ...rest } = dialogRefs;
setDialogRefs(rest);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/components/FilterItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import React, { FC, forwardRef, ReactNode, RefObject, useEffect, useMemo } from
import { CommonProps } from '../../interfaces/CommonProps';
import styles from './FilterItem.jss';

export interface FilterItemPropTypes extends CommonProps {
export interface FilterItemPropTypes extends Omit<CommonProps, 'onChange'> {
placeholder?: string;
type?: FilterType;
label?: string;
Expand Down
3 changes: 2 additions & 1 deletion packages/main/src/components/VariantManagement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export interface VariantItem {
label: string;
}

export interface VariantManagementPropTypes extends CommonProps {

export interface VariantManagementPropTypes extends Omit<CommonProps, 'onSelect'> {
/**
* Determines on which side the VariantManagement popover is placed at.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/interfaces/CommonProps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CSSProperties, Ref } from 'react';
import { CSSProperties, Ref, HTMLAttributes } from 'react';

export interface CommonProps {
export interface CommonProps extends HTMLAttributes<HTMLElement> {
/**
* Element style which will be appended to the most outer element of a component.
* Use this prop carefully, some css properties might break the component.
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/internal/withWebComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const createEventPropName = (eventName) => `on${capitalizeFirstLetter(kebabToCam

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

export interface WithWebComponentPropTypes extends CommonProps, HTMLAttributes<HTMLElement> {
export interface WithWebComponentPropTypes extends CommonProps {
ref?: Ref<any>;
children?: any | void;
}
Expand Down

0 comments on commit 07c5b6a

Please sign in to comment.