Skip to content

Commit

Permalink
Fix #2741: SelectItemOptionsType definition (#2742)
Browse files Browse the repository at this point in the history
* Fix #2741: SelectButton options TypeScript def

* Fix #2741: SelectButton options TypeScript def
  • Loading branch information
melloware authored Apr 15, 2022
1 parent 4da42d8 commit 32cc409
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion components/lib/cascadeselect/CascadeSelect.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { CSSTransitionProps } from '../csstransition';
import { SelectItemOptionsType } from '../selectitem/SelectItem';

type CascadeSelectItemTemplateType = React.ReactNode | ((option: any) => React.ReactNode);

Expand All @@ -19,7 +20,7 @@ export interface CascadeSelectProps extends Omit<React.DetailedHTMLProps<React.I
className?: string;
value?: any;
name?: string;
options?: any[];
options?: SelectItemOptionsType;
optionLabel?: string;
optionValue?: string;
optionGroupLabel?: string;
Expand Down
3 changes: 2 additions & 1 deletion components/lib/dropdown/Dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import TooltipOptions from '../tooltip/tooltipoptions';
import { CSSTransitionProps } from '../csstransition';
import { VirtualScrollerProps } from '../virtualscroller';
import { SelectItemOptionsType } from '../selectitem/SelectItem';

type DropdownOptionGroupTemplateType = React.ReactNode | ((option: any, index: number) => React.ReactNode);

Expand Down Expand Up @@ -41,7 +42,7 @@ export interface DropdownProps extends Omit<React.DetailedHTMLProps<React.InputH
inputRef?: React.Ref<HTMLSelectElement>;
name?: string;
value?: any;
options?: any[];
options?: SelectItemOptionsType;
optionLabel?: string;
optionValue?: string;
optionDisabled?: DropdownOptionDisabledType;
Expand Down
3 changes: 2 additions & 1 deletion components/lib/listbox/ListBox.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { SelectItemOptionsType } from '../selectitem/SelectItem';
import TooltipOptions from '../tooltip/tooltipoptions';
import { VirtualScrollerProps } from '../virtualscroller';

Expand Down Expand Up @@ -31,7 +32,7 @@ interface ListBoxFilterValueChangeParams {
export interface ListBoxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange' | 'ref'> {
id?: string;
value?: any;
options?: any[];
options?: SelectItemOptionsType;
optionLabel?: string;
optionValue?: string;
optionDisabled?: ListBoxOptionDisabledType;
Expand Down
3 changes: 2 additions & 1 deletion components/lib/multiselect/MultiSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import TooltipOptions from '../tooltip/tooltipoptions';
import { CSSTransitionProps } from '../csstransition';
import { IconType } from '../utils';
import { VirtualScrollerProps } from '../virtualscroller';
import { SelectItemOptionsType } from '../selectitem/SelectItem';

type MultiSelectOptionGroupTemplateType = React.ReactNode | ((option: any, index: number) => React.ReactNode);

Expand Down Expand Up @@ -70,7 +71,7 @@ export interface MultiSelectProps extends Omit<React.DetailedHTMLProps<React.Inp
inputRef?: React.Ref<HTMLSelectElement>;
name?: string;
value?: any;
options?: any[];
options?: SelectItemOptionsType;
optionLabel?: string;
optionValue?: string;
optionDisabled?: MultiSelectOptionDisabledType;
Expand Down
3 changes: 2 additions & 1 deletion components/lib/selectbutton/SelectButton.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import TooltipOptions from '../tooltip/tooltipoptions';
import { SelectItemOptionsType } from '../selectitem/SelectItem';

type SelectButtonOptionDisabledType = string | ((option: any) => boolean);

Expand All @@ -20,7 +21,7 @@ interface SelectButtonChangeParams {
export interface SelectButtonProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'unselectable' | 'onChange' | 'ref'> {
id?: string;
value?: any;
options?: any[];
options?: SelectItemOptionsType;
optionLabel?: string;
optionValue?: string;
optionDisabled?: SelectButtonOptionDisabledType;
Expand Down
2 changes: 2 additions & 0 deletions components/lib/selectitem/SelectItem.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { IconType } from '../utils';

export type SelectItemOptionsType = SelectItem[] | any[];

export interface SelectItem {
label?: string;
value?: any;
Expand Down

0 comments on commit 32cc409

Please sign in to comment.