Skip to content

Commit

Permalink
Add undo trailing icon
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Oct 18, 2022
1 parent 6f9dac3 commit 7b3a7cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/NcTextField/NcTextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export default {
<template v-if="type !== 'search'" #trailing-button-icon>
<Close v-if="trailingButtonIcon === 'close'" :size="20" />
<ArrowRight v-else-if="trailingButtonIcon === 'arrowRight'" :size="20" />
<Undo v-else-if="trailingButtonIcon === 'undo'" :size="20" />
</template>
</NcInputField>
</template>
Expand All @@ -141,6 +142,7 @@ import NcInputField from '../NcInputField/NcInputField.vue'
import Close from 'vue-material-design-icons/Close.vue'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
import Undo from 'vue-material-design-icons/UndoVariant.vue'
import { t } from '../../l10n.js'
Expand All @@ -151,6 +153,7 @@ export default {
NcInputField,
Close,
ArrowRight,
Undo,
},
props: {
Expand Down Expand Up @@ -230,14 +233,15 @@ export default {
/**
* Specifies which material design icon should be used for the trailing
* button. Values can be `close` anbd `arrowRight`.
* button. Value can be `close`, `arrowRight`, or `undo`.
*/
trailingButtonIcon: {
type: String,
default: 'close',
validator: (value) => [
'close',
'arrowRight',
'undo',
].includes(value),
},
Expand Down

0 comments on commit 7b3a7cf

Please sign in to comment.