Fixed #1711 - Better types for selects
parent
45d4a5ac46
commit
ad8e2796f7
|
@ -1,12 +1,16 @@
|
|||
import { VNode } from 'vue';
|
||||
|
||||
type CascadeSelectOptionLabelType = string | ((data: any) => string) | undefined;
|
||||
type CascadeSelectOptionValueType = string | ((data: any) => any) | undefined;
|
||||
type CascadeSelectOptionChildrenType = string[] | string | ((data: any) => any[]) | undefined;
|
||||
|
||||
interface CascadeSelectProps {
|
||||
modelValue?: any;
|
||||
options?: any[];
|
||||
optionLabel?: string;
|
||||
optionValue?: any;
|
||||
optionGroupLabel?: string;
|
||||
optionGroupChildren?: string[];
|
||||
optionLabel?: CascadeSelectOptionLabelType;
|
||||
optionValue?: CascadeSelectOptionValueType;
|
||||
optionGroupLabel?: CascadeSelectOptionLabelType;
|
||||
optionGroupChildren?: CascadeSelectOptionChildrenType;
|
||||
placeholder?: string;
|
||||
disabled?: boolean;
|
||||
dataKey?: string;
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
import { VNode } from 'vue';
|
||||
import VirtualScrollerProps from '../virtualscroller';
|
||||
|
||||
type DropdownOptionLabelType = string | ((data: any) => string) | undefined;
|
||||
type DropdownOptionValueType = string | ((data: any) => any) | undefined;
|
||||
type DropdownOptionDisabledType = string | ((data: any) => boolean) | undefined;
|
||||
type DropdownOptionChildrenType = string | ((data: any) => any[]) | undefined;
|
||||
|
||||
interface DropdownProps {
|
||||
modelValue?: any;
|
||||
options?: any[];
|
||||
optionLabel?: string;
|
||||
optionValue?: any;
|
||||
optionLabel?: DropdownOptionLabelType;
|
||||
optionValue?: DropdownOptionValueType;
|
||||
optionDisabled?: DropdownOptionDisabledType;
|
||||
optionGroupLabel?: string;
|
||||
optionGroupChildren?: string;
|
||||
optionGroupLabel?: DropdownOptionLabelType;
|
||||
optionGroupChildren?: DropdownOptionChildrenType;
|
||||
scrollHeight?: string;
|
||||
filter?: boolean;
|
||||
filterPlaceholder?: string;
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
import { VNode } from 'vue';
|
||||
import VirtualScrollerProps from '../virtualscroller';
|
||||
|
||||
type ListboxOptionLabelType = string | ((data: any) => string) | undefined;
|
||||
type ListboxOptionValueType = string | ((data: any) => any) | undefined;
|
||||
type ListboxOptionDisabledType = string | ((data: any) => boolean) | undefined;
|
||||
type ListboxOptionChildrenType = string | ((data: any) => any[]) | undefined;
|
||||
|
||||
interface ListboxProps {
|
||||
modelValue?: any;
|
||||
options?: any[];
|
||||
optionLabel?: string;
|
||||
optionValue?: any;
|
||||
optionLabel?: ListboxOptionLabelType;
|
||||
optionValue?: ListboxOptionValueType;
|
||||
optionDisabled?: ListboxOptionDisabledType;
|
||||
optionGroupLabel?: string;
|
||||
optionGroupChildren?: string;
|
||||
optionGroupLabel?: ListboxOptionLabelType;
|
||||
optionGroupChildren?: ListboxOptionChildrenType;
|
||||
listStyle?: string;
|
||||
disabled?: boolean;
|
||||
dataKey?: string;
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
import { VNode } from 'vue';
|
||||
import VirtualScrollerProps from '../virtualscroller';
|
||||
|
||||
type MultiSelectOptionLabelType = string | ((data: any) => string) | undefined;
|
||||
type MultiSelectOptionValueType = string | ((data: any) => any) | undefined;
|
||||
type MultiSelectOptionDisabledType = string | ((data: any) => boolean) | undefined;
|
||||
type MultiSelectOptionChildrenType = string | ((data: any) => any[]) | undefined;
|
||||
|
||||
interface MultiSelectProps {
|
||||
modelValue?: any;
|
||||
options?: any[];
|
||||
optionLabel?: string;
|
||||
optionValue?: any;
|
||||
optionLabel?: MultiSelectOptionLabelType;
|
||||
optionValue?: MultiSelectOptionValueType;
|
||||
optionDisabled?: MultiSelectOptionDisabledType;
|
||||
optionGroupLabel?: string;
|
||||
optionGroupChildren?: string;
|
||||
optionGroupLabel?: MultiSelectOptionLabelType;
|
||||
optionGroupChildren?: MultiSelectOptionChildrenType;
|
||||
scrollHeight?: string;
|
||||
placeholder?: string;
|
||||
disabled?: boolean;
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
type SelectButtonOptionLabelType = string | ((data: any) => string) | undefined;
|
||||
type SelectButtonOptionValueType = string | ((data: any) => any) | undefined;
|
||||
type SelectButtonOptionDisabledType = string | ((data: any) => boolean) | undefined;
|
||||
|
||||
interface SelectButtonProps {
|
||||
modelValue?: any;
|
||||
options?: any[];
|
||||
optionLabel?: string;
|
||||
optionValue?: any;
|
||||
optionLabel?: SelectButtonOptionLabelType;
|
||||
optionValue?: SelectButtonOptionValueType;
|
||||
optionDisabled?: SelectButtonOptionDisabledType;
|
||||
multiple?: boolean;
|
||||
disabled?: boolean;
|
||||
|
|
|
@ -145,13 +145,13 @@ export default {
|
|||
</tr>
|
||||
<tr>
|
||||
<td>optionLabel</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function to use as the label of an option.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>optionValue</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function to use as the value of an option, defaults to the option itself when not defined.</td>
|
||||
</tr>
|
||||
|
@ -163,13 +163,13 @@ export default {
|
|||
</tr>
|
||||
<tr>
|
||||
<td>optionGroupLabel</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function to use as the label of an option group.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>optionGroupChildren</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function that refers to the children options of option group.</td>
|
||||
</tr>
|
||||
|
|
|
@ -154,13 +154,13 @@ export default {
|
|||
</tr>
|
||||
<tr>
|
||||
<td>optionLabel</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function to use as the label of an option.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>optionValue</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function to use as the value of an option, defaults to the option itself when not defined.</td>
|
||||
</tr>
|
||||
|
@ -172,13 +172,13 @@ export default {
|
|||
</tr>
|
||||
<tr>
|
||||
<td>optionGroupLabel</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function to use as the label of an option group.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>optionGroupChildren</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function that refers to the children options of option group.</td>
|
||||
</tr>
|
||||
|
|
|
@ -84,13 +84,13 @@ export default {
|
|||
</tr>
|
||||
<tr>
|
||||
<td>optionLabel</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function to use as the label of an option.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>optionValue</td>
|
||||
<td>string</td>
|
||||
<td>string | function</td>
|
||||
<td>null</td>
|
||||
<td>Property name or getter function to use as the value of an option, defaults to the option itself when not defined.</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue