diff --git a/src/components/autocomplete/AutoComplete.vue b/src/components/autocomplete/AutoComplete.vue index 9a8239c88..45803f8a9 100755 --- a/src/components/autocomplete/AutoComplete.vue +++ b/src/components/autocomplete/AutoComplete.vue @@ -256,6 +256,9 @@ export default { isOptionDisabled(option) { return this.optionDisabled ? ObjectUtils.resolveFieldData(option, this.optionDisabled) : false; }, + isOptionGroup(option) { + return this.optionGroupLabel && option.optionGroup && option.group; + }, getOptionGroupLabel(optionGroup) { return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel); }, @@ -702,9 +705,6 @@ export default { isDropdownClicked(event) { return this.$refs.dropdownButton ? (event.target === this.$refs.dropdownButton || this.$refs.dropdownButton.$el.contains(event.target)) : false; }, - isOptionGroup(option) { - return this.optionGroupLabel && option.optionGroup && option.group; - }, isOptionMatched(option, value) { return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.searchLocale) === value.toLocaleLowerCase(this.searchLocale); }, diff --git a/src/components/dropdown/Dropdown.vue b/src/components/dropdown/Dropdown.vue index a08297bd7..11b647d99 100755 --- a/src/components/dropdown/Dropdown.vue +++ b/src/components/dropdown/Dropdown.vue @@ -243,6 +243,9 @@ export default { isOptionDisabled(option) { return this.optionDisabled ? ObjectUtils.resolveFieldData(option, this.optionDisabled) : false; }, + isOptionGroup(option) { + return this.optionGroupLabel && option.optionGroup && option.group; + }, getOptionGroupLabel(optionGroup) { return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel); }, @@ -661,9 +664,6 @@ export default { hasFocusableElements() { return DomHandler.getFocusableElements(this.overlay, ':not(.p-hidden-focusable)').length > 0; }, - isOptionGroup(option) { - return this.optionGroupLabel && option.optionGroup && option.group; - }, isOptionMatched(option) { return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)); }, diff --git a/src/components/listbox/Listbox.vue b/src/components/listbox/Listbox.vue index 68bf1474e..fb491abd1 100755 --- a/src/components/listbox/Listbox.vue +++ b/src/components/listbox/Listbox.vue @@ -171,6 +171,9 @@ export default { isOptionDisabled(option) { return this.optionDisabled ? ObjectUtils.resolveFieldData(option, this.optionDisabled) : false; }, + isOptionGroup(option) { + return this.optionGroupLabel && option.optionGroup && option.group; + }, getOptionGroupLabel(optionGroup) { return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel); }, @@ -486,9 +489,6 @@ export default { onShiftKey() { this.startRangeIndex = this.focusedOptionIndex; }, - isOptionGroup(option) { - return this.optionGroupLabel && option.optionGroup && option.group; - }, isOptionMatched(option) { return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)); }, diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index ffafad12a..6063c3ab1 100755 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -295,6 +295,9 @@ export default { return this.optionDisabled ? ObjectUtils.resolveFieldData(option, this.optionDisabled) : false; }, + isOptionGroup(option) { + return this.optionGroupLabel && option.optionGroup && option.group; + }, getOptionGroupLabel(optionGroup) { return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel); }, @@ -776,9 +779,6 @@ export default { hasFocusableElements() { return DomHandler.getFocusableElements(this.overlay, ':not(.p-hidden-focusable)').length > 0; }, - isOptionGroup(option) { - return this.optionGroupLabel && option.optionGroup && option.group; - }, isOptionMatched(option) { return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)); },