Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NcSelect): Update @nextcloud/vue-select and add translated options for aria-labels #4751

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions l10n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ msgstr ""
msgid "Clear search"
msgstr ""

msgid "Clear selected"
msgstr ""

msgid "Clear text"
msgstr ""

Expand Down Expand Up @@ -83,6 +86,9 @@ msgstr ""
msgid "Custom"
msgstr ""

msgid "Deselect {option}"
msgstr ""

msgid "do not disturb"
msgstr ""

Expand Down Expand Up @@ -218,6 +224,9 @@ msgstr ""
msgid "Search emoji"
msgstr ""

msgid "Search for options"
msgstr ""

msgid "Search results"
msgstr ""

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@nextcloud/l10n": "^2.0.1",
"@nextcloud/logger": "^2.2.1",
"@nextcloud/router": "^2.0.0",
"@nextcloud/vue-select": "^3.23.0",
"@nextcloud/vue-select": "^3.24.0",
"@vueuse/components": "^10.0.2",
"@vueuse/core": "^10.1.2",
"clone": "^2.1.2",
Expand Down
31 changes: 29 additions & 2 deletions src/components/NcSelect/NcSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,9 @@ export default {
</template>

<script>
import { VueSelect } from '@nextcloud/vue-select'
import '@nextcloud/vue-select/dist/vue-select.css'

import { VueSelect } from '@nextcloud/vue-select'
import {
autoUpdate,
computePosition,
Expand All @@ -543,6 +544,7 @@ import {
offset,
shift,
} from '@floating-ui/dom'
import { t } from '../../l10n.js'

import ChevronDown from 'vue-material-design-icons/ChevronDown.vue'
import Close from 'vue-material-design-icons/Close.vue'
Expand All @@ -552,7 +554,6 @@ import NcListItemIcon from '../NcListItemIcon/index.js'
import NcLoadingIcon from '../NcLoadingIcon/index.js'

import l10n from '../../mixins/l10n.js'

import GenRandomId from '../../utils/GenRandomId.js'

export default {
Expand All @@ -574,6 +575,32 @@ export default {
// Add VueSelect props to $props
...VueSelect.props,

/**
* `aria-label` for the clear input button
*/
ariaLabelClearSelected: {
type: String,
default: t('Clear selected'),
},

/**
* `aria-label` for the search input
*/
ariaLabelCombobox: {
type: String,
default: t('Search for options'),
},

/**
* Allows to customize the `aria-label` for the deselect-option button
* The default is "Deselect " + optionLabel
* @type {(optionLabel: string) => string}
*/
ariaLabelDeselectOption: {
type: Function,
default: (optionLabel) => t('Deselect {option}', { option: optionLabel }),
},

/**
* Append the dropdown element to the end of the body
* and size/position it dynamically.
Expand Down
Loading