Rename `updateValue` with `writeValue` in BaseEditableHolder

pull/6632/head
Mert Sincan 2024-10-23 14:04:38 +01:00
parent a60230fb68
commit 4561acfb8b
23 changed files with 31 additions and 31 deletions

View File

@ -73,7 +73,7 @@ export default {
},
formField: {},
methods: {
updateValue(value, event) {
writeValue(value, event) {
if (this.controlled) {
this.d_value = value;
this.$emit('update:modelValue', value);

View File

@ -679,7 +679,7 @@ export default {
const removedValue = this.d_value[this.d_value.length - 1];
const newValue = this.d_value.slice(0, -1);
this.updateValue(newValue, event);
this.writeValue(newValue, event);
this.$emit('item-unselect', { originalEvent: event, value: removedValue });
this.$emit('option-unselect', { originalEvent: event, value: removedValue });
}

View File

@ -762,7 +762,7 @@ export default {
}
},
updateModel(event, value) {
this.updateValue(value, event);
this.writeValue(value, event);
this.$emit('change', { originalEvent: event, value });
},
createProcessedOptions(options, level = 0, parent = {}, parentKey = '') {

View File

@ -85,7 +85,7 @@ export default {
this.$emit('update:indeterminate', this.d_indeterminate);
}
this.$pcCheckboxGroup ? this.$pcCheckboxGroup.updateValue(newModelValue, event) : this.updateValue(newModelValue, event);
this.$pcCheckboxGroup ? this.$pcCheckboxGroup.writeValue(newModelValue, event) : this.writeValue(newModelValue, event);
this.$emit('change', event);
}
},

View File

@ -137,7 +137,7 @@ export default {
break;
}
this.updateValue(value, event);
this.writeValue(value, event);
this.$emit('change', { event, value });
},
updateColorSelector() {

View File

@ -1234,7 +1234,7 @@ export default {
this.$emit('date-select', date);
},
updateModel(value) {
this.updateValue(value);
this.writeValue(value);
},
shouldSelectDate() {
if (this.isMultipleSelection()) return this.maxDateCount != null ? this.maxDateCount > (this.d_value ? this.d_value.length : 0) : true;

View File

@ -140,7 +140,7 @@ export default {
html = '';
}
this.updateValue(html);
this.writeValue(html);
this.$emit('text-change', {
htmlValue: html,
textValue: text,

View File

@ -53,7 +53,7 @@ export default {
},
updated() {
if (this.isValueUpdated()) {
this.updateValueByModel();
this.updateValue();
}
},
methods: {
@ -450,9 +450,9 @@ export default {
this.currentVal = value;
this.updateValue(this.defaultBuffer !== val ? val : '');
this.writeValue(this.defaultBuffer !== val ? val : '');
},
updateValueByModel(updateModel = true) {
updateValue(updateModel = true) {
if (this.$el) {
if (this.d_value == null) {
this.$el.value = '';
@ -524,7 +524,7 @@ export default {
}
this.defaultBuffer = this.buffer.join('');
this.updateValueByModel(false);
this.updateValue(false);
},
isValueUpdated() {
return this.unmask ? this.d_value != this.getUnmaskedValue() : this.defaultBuffer !== this.$el.value && this.$el.value !== this.d_value;

View File

@ -77,7 +77,7 @@ export default {
updateModel(event) {
const newValue = this.tokens.join('');
this.updateValue(newValue, event);
this.writeValue(newValue, event);
this.$emit('change', {
originalEvent: event,
value: newValue

View File

@ -12,7 +12,7 @@ export default {
inheritAttrs: false,
methods: {
onInput(event) {
this.updateValue(event.target.value, event);
this.writeValue(event.target.value, event);
}
},
computed: {

View File

@ -65,13 +65,13 @@ export default {
let newValue = Math.round((mappedValue - this.min) / this.step) * this.step + this.min;
this.updateValue(newValue);
this.writeValue(newValue);
this.$emit('change', newValue);
},
updateModelValue(newValue) {
if (newValue > this.max) this.updateValue(this.max);
else if (newValue < this.min) this.updateValue(this.min);
else this.updateValue(newValue);
if (newValue > this.max) this.writeValue(this.max);
else if (newValue < this.min) this.writeValue(this.min);
else this.writeValue(newValue);
},
mapRange(x, inMin, inMax, outMin, outMax) {
return ((x - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
@ -149,13 +149,13 @@ export default {
case 'Home': {
event.preventDefault();
this.updateValue(this.min);
this.writeValue(this.min);
break;
}
case 'End': {
event.preventDefault();
this.updateValue(this.max);
this.writeValue(this.max);
break;
}

View File

@ -700,7 +700,7 @@ export default {
}
},
updateModel(event, value) {
this.updateValue(value, event);
this.writeValue(value, event);
this.$emit('change', { originalEvent: event, value });
},
flatOptions(options) {

View File

@ -989,7 +989,7 @@ export default {
}
},
updateModel(event, value) {
this.updateValue(value, event);
this.writeValue(value, event);
this.$emit('change', { originalEvent: event, value });
},
flatOptions(options) {

View File

@ -159,7 +159,7 @@ export default {
return level;
},
onInput(event) {
this.updateValue(event.target.value, event);
this.writeValue(event.target.value, event);
this.$emit('change', event);
},
onFocus(event) {

View File

@ -54,7 +54,7 @@ export default {
if (!this.disabled && !this.readonly) {
const newModelValue = this.binary ? !this.checked : this.value;
this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.updateValue(newModelValue, event) : this.updateValue(newModelValue, event);
this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.writeValue(newModelValue, event) : this.writeValue(newModelValue, event);
this.$emit('change', event);
}
},

View File

@ -97,7 +97,7 @@ export default {
}
},
updateModel(event, value) {
this.updateValue(value, event);
this.writeValue(value, event);
this.$emit('change', { originalEvent: event, value });
},
starAriaLabel(value) {

View File

@ -906,7 +906,7 @@ export default {
}
},
updateModel(event, value) {
this.updateValue(value, event);
this.writeValue(value, event);
this.$emit('change', { originalEvent: event, value });
},
flatOptions(options) {

View File

@ -65,7 +65,7 @@ export default {
newValue = selected ? null : optionValue;
}
this.updateValue(newValue, event);
this.writeValue(newValue, event);
this.$emit('change', { event: event, value: newValue });
},
isSelected(option) {

View File

@ -139,7 +139,7 @@ export default {
modelValue = newValue;
}
this.updateValue(modelValue, event);
this.writeValue(modelValue, event);
this.$emit('change', modelValue);
},
onDragStart(event, index) {

View File

@ -37,7 +37,7 @@ export default {
this.resize();
}
this.updateValue(event.target.value, event);
this.writeValue(event.target.value, event);
}
},
computed: {

View File

@ -47,7 +47,7 @@ export default {
},
onChange(event) {
if (!this.disabled && !this.readonly) {
this.updateValue(!this.d_value, event);
this.writeValue(!this.d_value, event);
this.$emit('change', event);
}
},

View File

@ -50,7 +50,7 @@ export default {
if (!this.disabled && !this.readonly) {
const newValue = this.checked ? this.falseValue : this.trueValue;
this.updateValue(newValue, event);
this.writeValue(newValue, event);
this.$emit('change', event);
}
},

View File

@ -226,7 +226,7 @@ export default {
},
onSelectionChange(keys) {
this.selfChange = true;
this.updateValue(keys);
this.writeValue(keys);
this.$emit('change', keys);
},
onNodeSelect(node) {