Skip to content

Commit

Permalink
fix: unify modelValue naming
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler committed Dec 25, 2023
1 parent 9f839df commit 6514aa3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions src/components/NcActionTextEditable/NcActionTextEditable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ All undocumented attributes will be bound to the textarea. e.g. `maxlength`
```
<template>
<NcActions>
<NcActionTextEditable value="This is a textarea">
<NcActionTextEditable model-value="This is a textarea">
<template #icon>
<Pencil :size="20" />
</template>
</NcActionTextEditable>
<NcActionTextEditable :disabled="true" value="This is a disabled textarea">
<NcActionTextEditable :disabled="true" model-value="This is a disabled textarea">
<template #icon>
<Pencil :size="20" />
</template>
</NcActionTextEditable>
<NcActionTextEditable name="Please edit the text" value="This is a textarea with name">
<NcActionTextEditable name="Please edit the text" model-value="This is a textarea with name">
<template #icon>
<Pencil :size="20" />
</template>
Expand Down Expand Up @@ -84,7 +84,7 @@ export default {

<textarea :id="computedId"
:disabled="disabled"
:value="value"
:value="modelValue"
v-bind="$attrs"
:class="['action-text-editable__textarea', { focusable: isFocusable }]"
@input="onInput" />
Expand Down Expand Up @@ -133,15 +133,15 @@ export default {
/**
* value attribute of the input field
*/
value: {
modelValue: {
type: String,
default: '',
},
},
emits: [
'input',
'update:value',
'update:modelValue',
'submit',
],
Expand Down Expand Up @@ -173,7 +173,7 @@ export default {
*
* @type {string|Date}
*/
this.$emit('update:value', event.target.value)
this.$emit('update:modelValue', event.target.value)
},
onSubmit(event) {
event.preventDefault()
Expand Down
10 changes: 5 additions & 5 deletions src/components/NcAppNavigationItem/NcInputConfirmCancel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ export default {
type: String,
},
value: {
modelValue: {
default: '',
type: String,
},
},
emits: [
'input',
'confirm',
'cancel',
'confirm',
'update:modelValue',
],
data() {
Expand All @@ -109,9 +109,9 @@ export default {
computed: {
valueModel: {
get() { return this.value },
get() { return this.modelValue },
set(newValue) {
this.$emit('input', newValue)
this.$emit('update:modelValue', newValue)
},
},
},
Expand Down
12 changes: 6 additions & 6 deletions src/components/NcSettingsInputText/NcSettingsInputText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

```vue
<NcSettingsInputText label="Label" hint="Hint" />
<NcSettingsInputText label="Label" value="Value" hint="Hint" disabled />
<NcSettingsInputText label="Label" model-value="Value" hint="Hint" disabled />
```

</docs>
Expand All @@ -37,7 +37,7 @@
<label :for="id" class="action-input__label">{{ label }}</label>
<input :id="id"
type="text"
:value="value"
:value="modelValue"
:disabled="disabled"
@input="onInput"
@change="onChange">
Expand Down Expand Up @@ -78,7 +78,7 @@ export default {
/**
* value of the select group input
*/
value: {
modelValue: {
type: String,
default: '',
},
Expand All @@ -102,10 +102,10 @@ export default {
},
emits: [
'update:value',
'change',
'input',
'submit',
'change',
'update:modelValue',
],
data() {
Expand All @@ -130,7 +130,7 @@ export default {
*
* @type {string}
*/
this.$emit('update:value', event.target.value)
this.$emit('update:modelValue', event.target.value)
},
onSubmit(event) {
if (!this.disabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default {
/**
* If the value is changed, check that all groups are loaded so we show the correct display name
*/
value: {
modelValue: {
handler() {
const loadedGroupIds = Object.keys(this.groups)
const missing = this.filteredValue.filter(group => !loadedGroupIds.includes(group))
Expand Down

0 comments on commit 6514aa3

Please sign in to comment.