diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-07 15:08:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-07 15:08:52 +0300 |
commit | 28f0cd8e0725320c294f9dbf74c698ee727de594 (patch) | |
tree | 5e2ba5fc09fbddc0ac88d8b726795f8c62922a3b /app/assets/javascripts/vue_shared/components | |
parent | 929712792964c31c895cb83ebf0862da038c57a0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/components')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/registry/persisted_dropdown_selection.vue | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/app/assets/javascripts/vue_shared/components/registry/persisted_dropdown_selection.vue b/app/assets/javascripts/vue_shared/components/registry/persisted_dropdown_selection.vue index 32d7cdad568..3404423b5bb 100644 --- a/app/assets/javascripts/vue_shared/components/registry/persisted_dropdown_selection.vue +++ b/app/assets/javascripts/vue_shared/components/registry/persisted_dropdown_selection.vue @@ -1,12 +1,11 @@ <script> -import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; +import { GlCollapsibleListbox } from '@gitlab/ui'; import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; export default { name: 'PersistedDropdownSelection', components: { - GlDropdown, - GlDropdownItem, + GlCollapsibleListbox, LocalStorageSync, }, props: { @@ -21,16 +20,15 @@ export default { }, data() { return { - selected: null, + selected: this.options[0].value, }; }, computed: { - dropdownText() { - const selected = this.parsedOptions.find((o) => o.selected); - return selected?.label || this.options[0].label; - }, - parsedOptions() { - return this.options.map((o) => ({ ...o, selected: o.value === this.selected })); + listboxItems() { + return this.options.map((option) => ({ + value: option.value, + text: option.label, + })); }, }, methods: { @@ -44,16 +42,6 @@ export default { <template> <local-storage-sync :storage-key="storageKey" :value="selected" as-string @input="setSelected"> - <gl-dropdown :text="dropdownText" lazy> - <gl-dropdown-item - v-for="option in parsedOptions" - :key="option.value" - :is-checked="option.selected" - is-check-item - @click="setSelected(option.value)" - > - {{ option.label }} - </gl-dropdown-item> - </gl-dropdown> + <gl-collapsible-listbox v-model="selected" :items="listboxItems" @select="setSelected" /> </local-storage-sync> </template> |