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: {}, formField: {},
methods: { methods: {
updateValue(value, event) { writeValue(value, event) {
if (this.controlled) { if (this.controlled) {
this.d_value = value; this.d_value = value;
this.$emit('update:modelValue', 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 removedValue = this.d_value[this.d_value.length - 1];
const newValue = this.d_value.slice(0, -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('item-unselect', { originalEvent: event, value: removedValue });
this.$emit('option-unselect', { originalEvent: event, value: removedValue }); this.$emit('option-unselect', { originalEvent: event, value: removedValue });
} }

View File

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

View File

@ -85,7 +85,7 @@ export default {
this.$emit('update:indeterminate', this.d_indeterminate); 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); this.$emit('change', event);
} }
}, },

View File

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

View File

@ -1234,7 +1234,7 @@ export default {
this.$emit('date-select', date); this.$emit('date-select', date);
}, },
updateModel(value) { updateModel(value) {
this.updateValue(value); this.writeValue(value);
}, },
shouldSelectDate() { shouldSelectDate() {
if (this.isMultipleSelection()) return this.maxDateCount != null ? this.maxDateCount > (this.d_value ? this.d_value.length : 0) : true; 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 = ''; html = '';
} }
this.updateValue(html); this.writeValue(html);
this.$emit('text-change', { this.$emit('text-change', {
htmlValue: html, htmlValue: html,
textValue: text, textValue: text,

View File

@ -53,7 +53,7 @@ export default {
}, },
updated() { updated() {
if (this.isValueUpdated()) { if (this.isValueUpdated()) {
this.updateValueByModel(); this.updateValue();
} }
}, },
methods: { methods: {
@ -450,9 +450,9 @@ export default {
this.currentVal = value; 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.$el) {
if (this.d_value == null) { if (this.d_value == null) {
this.$el.value = ''; this.$el.value = '';
@ -524,7 +524,7 @@ export default {
} }
this.defaultBuffer = this.buffer.join(''); this.defaultBuffer = this.buffer.join('');
this.updateValueByModel(false); this.updateValue(false);
}, },
isValueUpdated() { isValueUpdated() {
return this.unmask ? this.d_value != this.getUnmaskedValue() : this.defaultBuffer !== this.$el.value && this.$el.value !== this.d_value; 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) { updateModel(event) {
const newValue = this.tokens.join(''); const newValue = this.tokens.join('');
this.updateValue(newValue, event); this.writeValue(newValue, event);
this.$emit('change', { this.$emit('change', {
originalEvent: event, originalEvent: event,
value: newValue value: newValue

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -54,7 +54,7 @@ export default {
if (!this.disabled && !this.readonly) { if (!this.disabled && !this.readonly) {
const newModelValue = this.binary ? !this.checked : this.value; 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); this.$emit('change', event);
} }
}, },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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