From 5a91e0026347b087e9a9bf95684995d428e0da13 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 17 Nov 2021 12:45:57 +0300 Subject: [PATCH] Fixed #1705 - optionDisabled prop on Dropdown wrongly typed --- src/components/dropdown/Dropdown.d.ts | 4 +++- src/components/listbox/Listbox.d.ts | 4 +++- src/components/multiselect/MultiSelect.d.ts | 4 +++- src/components/selectbutton/SelectButton.d.ts | 4 +++- src/views/dropdown/DropdownDoc.vue | 2 +- src/views/listbox/ListboxDoc.vue | 2 +- src/views/multiselect/MultiSelectDoc.vue | 2 +- src/views/selectbutton/SelectButtonDoc.vue | 2 +- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/dropdown/Dropdown.d.ts b/src/components/dropdown/Dropdown.d.ts index 55f48a341..2f7efd3ff 100755 --- a/src/components/dropdown/Dropdown.d.ts +++ b/src/components/dropdown/Dropdown.d.ts @@ -1,12 +1,14 @@ import { VNode } from 'vue'; import VirtualScrollerProps from '../virtualscroller'; +type DropdownOptionDisabledType = string | ((data: any) => boolean) | undefined; + interface DropdownProps { modelValue?: any; options?: any[]; optionLabel?: string; optionValue?: any; - optionDisabled?: boolean; + optionDisabled?: DropdownOptionDisabledType; optionGroupLabel?: string; optionGroupChildren?: string; scrollHeight?: string; diff --git a/src/components/listbox/Listbox.d.ts b/src/components/listbox/Listbox.d.ts index 594eb1710..35979dfff 100755 --- a/src/components/listbox/Listbox.d.ts +++ b/src/components/listbox/Listbox.d.ts @@ -1,12 +1,14 @@ import { VNode } from 'vue'; import VirtualScrollerProps from '../virtualscroller'; +type ListboxOptionDisabledType = string | ((data: any) => boolean) | undefined; + interface ListboxProps { modelValue?: any; options?: any[]; optionLabel?: string; optionValue?: any; - optionDisabled?: boolean; + optionDisabled?: ListboxOptionDisabledType; optionGroupLabel?: string; optionGroupChildren?: string; listStyle?: string; diff --git a/src/components/multiselect/MultiSelect.d.ts b/src/components/multiselect/MultiSelect.d.ts index f55f2052e..1eeab73d0 100755 --- a/src/components/multiselect/MultiSelect.d.ts +++ b/src/components/multiselect/MultiSelect.d.ts @@ -1,12 +1,14 @@ import { VNode } from 'vue'; import VirtualScrollerProps from '../virtualscroller'; +type MultiSelectOptionDisabledType = string | ((data: any) => boolean) | undefined; + interface MultiSelectProps { modelValue?: any; options?: any[]; optionLabel?: string; optionValue?: any; - optionDisabled?: boolean; + optionDisabled?: MultiSelectOptionDisabledType; optionGroupLabel?: string; optionGroupChildren?: string; scrollHeight?: string; diff --git a/src/components/selectbutton/SelectButton.d.ts b/src/components/selectbutton/SelectButton.d.ts index b5fa64f26..4f6921010 100755 --- a/src/components/selectbutton/SelectButton.d.ts +++ b/src/components/selectbutton/SelectButton.d.ts @@ -1,9 +1,11 @@ +type SelectButtonOptionDisabledType = string | ((data: any) => boolean) | undefined; + interface SelectButtonProps { modelValue?: any; options?: any[]; optionLabel?: string; optionValue?: any; - optionDisabled?: boolean; + optionDisabled?: SelectButtonOptionDisabledType; multiple?: boolean; disabled?: boolean; dataKey?: string; diff --git a/src/views/dropdown/DropdownDoc.vue b/src/views/dropdown/DropdownDoc.vue index 8cea9e481..4a66e7b2e 100755 --- a/src/views/dropdown/DropdownDoc.vue +++ b/src/views/dropdown/DropdownDoc.vue @@ -157,7 +157,7 @@ export default { optionDisabled - boolean + string | function null Property name or getter function to use as the disabled flag of an option, defaults to false when not defined. diff --git a/src/views/listbox/ListboxDoc.vue b/src/views/listbox/ListboxDoc.vue index 599dfc61b..d303f6579 100755 --- a/src/views/listbox/ListboxDoc.vue +++ b/src/views/listbox/ListboxDoc.vue @@ -154,7 +154,7 @@ export default { optionDisabled - boolean + string | function null Property name or getter function to use as the disabled flag of an option, defaults to false when not defined. diff --git a/src/views/multiselect/MultiSelectDoc.vue b/src/views/multiselect/MultiSelectDoc.vue index 014a9c5fd..aa618d015 100755 --- a/src/views/multiselect/MultiSelectDoc.vue +++ b/src/views/multiselect/MultiSelectDoc.vue @@ -166,7 +166,7 @@ export default { optionDisabled - boolean + string | function null Property name or getter function to use as the disabled flag of an option, defaults to false when not defined. diff --git a/src/views/selectbutton/SelectButtonDoc.vue b/src/views/selectbutton/SelectButtonDoc.vue index 8eab68eae..ae4715c19 100755 --- a/src/views/selectbutton/SelectButtonDoc.vue +++ b/src/views/selectbutton/SelectButtonDoc.vue @@ -96,7 +96,7 @@ export default { optionDisabled - boolean + string | function null Property name or getter function to use as the disabled flag of an option, defaults to false when not defined.