Rename `updateValue` with `writeValue` in BaseEditableHolder
parent
a60230fb68
commit
4561acfb8b
|
@ -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);
|
||||
|
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
@ -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 = '') {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -137,7 +137,7 @@ export default {
|
|||
break;
|
||||
}
|
||||
|
||||
this.updateValue(value, event);
|
||||
this.writeValue(value, event);
|
||||
this.$emit('change', { event, value });
|
||||
},
|
||||
updateColorSelector() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -140,7 +140,7 @@ export default {
|
|||
html = '';
|
||||
}
|
||||
|
||||
this.updateValue(html);
|
||||
this.writeValue(html);
|
||||
this.$emit('text-change', {
|
||||
htmlValue: html,
|
||||
textValue: text,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -12,7 +12,7 @@ export default {
|
|||
inheritAttrs: false,
|
||||
methods: {
|
||||
onInput(event) {
|
||||
this.updateValue(event.target.value, event);
|
||||
this.writeValue(event.target.value, event);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -139,7 +139,7 @@ export default {
|
|||
modelValue = newValue;
|
||||
}
|
||||
|
||||
this.updateValue(modelValue, event);
|
||||
this.writeValue(modelValue, event);
|
||||
this.$emit('change', modelValue);
|
||||
},
|
||||
onDragStart(event, index) {
|
||||
|
|
|
@ -37,7 +37,7 @@ export default {
|
|||
this.resize();
|
||||
}
|
||||
|
||||
this.updateValue(event.target.value, event);
|
||||
this.writeValue(event.target.value, event);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -226,7 +226,7 @@ export default {
|
|||
},
|
||||
onSelectionChange(keys) {
|
||||
this.selfChange = true;
|
||||
this.updateValue(keys);
|
||||
this.writeValue(keys);
|
||||
this.$emit('change', keys);
|
||||
},
|
||||
onNodeSelect(node) {
|
||||
|
|
Loading…
Reference in New Issue