From 4561acfb8b1f30d432551b59459dbb76d398fe33 Mon Sep 17 00:00:00 2001 From: Mert Sincan Date: Wed, 23 Oct 2024 14:04:38 +0100 Subject: [PATCH] Rename `updateValue` with `writeValue` in BaseEditableHolder --- .../src/baseeditableholder/BaseEditableHolder.vue | 2 +- packages/primevue/src/autocomplete/AutoComplete.vue | 2 +- .../primevue/src/cascadeselect/CascadeSelect.vue | 2 +- packages/primevue/src/checkbox/Checkbox.vue | 2 +- packages/primevue/src/colorpicker/ColorPicker.vue | 2 +- packages/primevue/src/datepicker/DatePicker.vue | 2 +- packages/primevue/src/editor/Editor.vue | 2 +- packages/primevue/src/inputmask/InputMask.vue | 8 ++++---- packages/primevue/src/inputotp/InputOtp.vue | 2 +- packages/primevue/src/inputtext/InputText.vue | 2 +- packages/primevue/src/knob/Knob.vue | 12 ++++++------ packages/primevue/src/listbox/Listbox.vue | 2 +- packages/primevue/src/multiselect/MultiSelect.vue | 2 +- packages/primevue/src/password/Password.vue | 2 +- packages/primevue/src/radiobutton/RadioButton.vue | 2 +- packages/primevue/src/rating/Rating.vue | 2 +- packages/primevue/src/select/Select.vue | 2 +- packages/primevue/src/selectbutton/SelectButton.vue | 2 +- packages/primevue/src/slider/Slider.vue | 2 +- packages/primevue/src/textarea/Textarea.vue | 2 +- packages/primevue/src/togglebutton/ToggleButton.vue | 2 +- packages/primevue/src/toggleswitch/ToggleSwitch.vue | 2 +- packages/primevue/src/treeselect/TreeSelect.vue | 2 +- 23 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/core/src/baseeditableholder/BaseEditableHolder.vue b/packages/core/src/baseeditableholder/BaseEditableHolder.vue index c88a28385..d24f5c332 100644 --- a/packages/core/src/baseeditableholder/BaseEditableHolder.vue +++ b/packages/core/src/baseeditableholder/BaseEditableHolder.vue @@ -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); diff --git a/packages/primevue/src/autocomplete/AutoComplete.vue b/packages/primevue/src/autocomplete/AutoComplete.vue index 4f5eccf76..b810ab6a9 100755 --- a/packages/primevue/src/autocomplete/AutoComplete.vue +++ b/packages/primevue/src/autocomplete/AutoComplete.vue @@ -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 }); } diff --git a/packages/primevue/src/cascadeselect/CascadeSelect.vue b/packages/primevue/src/cascadeselect/CascadeSelect.vue index 5c33cd6f6..188a388f6 100644 --- a/packages/primevue/src/cascadeselect/CascadeSelect.vue +++ b/packages/primevue/src/cascadeselect/CascadeSelect.vue @@ -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 = '') { diff --git a/packages/primevue/src/checkbox/Checkbox.vue b/packages/primevue/src/checkbox/Checkbox.vue index a7838f938..ebeac0ba3 100755 --- a/packages/primevue/src/checkbox/Checkbox.vue +++ b/packages/primevue/src/checkbox/Checkbox.vue @@ -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); } }, diff --git a/packages/primevue/src/colorpicker/ColorPicker.vue b/packages/primevue/src/colorpicker/ColorPicker.vue index dc0b9256c..7980f5fb8 100755 --- a/packages/primevue/src/colorpicker/ColorPicker.vue +++ b/packages/primevue/src/colorpicker/ColorPicker.vue @@ -137,7 +137,7 @@ export default { break; } - this.updateValue(value, event); + this.writeValue(value, event); this.$emit('change', { event, value }); }, updateColorSelector() { diff --git a/packages/primevue/src/datepicker/DatePicker.vue b/packages/primevue/src/datepicker/DatePicker.vue index a30f208cb..5fdaa3c26 100755 --- a/packages/primevue/src/datepicker/DatePicker.vue +++ b/packages/primevue/src/datepicker/DatePicker.vue @@ -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; diff --git a/packages/primevue/src/editor/Editor.vue b/packages/primevue/src/editor/Editor.vue index 659a86003..893f8f6ef 100755 --- a/packages/primevue/src/editor/Editor.vue +++ b/packages/primevue/src/editor/Editor.vue @@ -140,7 +140,7 @@ export default { html = ''; } - this.updateValue(html); + this.writeValue(html); this.$emit('text-change', { htmlValue: html, textValue: text, diff --git a/packages/primevue/src/inputmask/InputMask.vue b/packages/primevue/src/inputmask/InputMask.vue index 9575702d1..549feed3f 100755 --- a/packages/primevue/src/inputmask/InputMask.vue +++ b/packages/primevue/src/inputmask/InputMask.vue @@ -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; diff --git a/packages/primevue/src/inputotp/InputOtp.vue b/packages/primevue/src/inputotp/InputOtp.vue index 5a3571a7f..fb90682e6 100755 --- a/packages/primevue/src/inputotp/InputOtp.vue +++ b/packages/primevue/src/inputotp/InputOtp.vue @@ -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 diff --git a/packages/primevue/src/inputtext/InputText.vue b/packages/primevue/src/inputtext/InputText.vue index 49c7f4eae..72e82ea59 100755 --- a/packages/primevue/src/inputtext/InputText.vue +++ b/packages/primevue/src/inputtext/InputText.vue @@ -12,7 +12,7 @@ export default { inheritAttrs: false, methods: { onInput(event) { - this.updateValue(event.target.value, event); + this.writeValue(event.target.value, event); } }, computed: { diff --git a/packages/primevue/src/knob/Knob.vue b/packages/primevue/src/knob/Knob.vue index 25a1bd312..330e25d94 100644 --- a/packages/primevue/src/knob/Knob.vue +++ b/packages/primevue/src/knob/Knob.vue @@ -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; } diff --git a/packages/primevue/src/listbox/Listbox.vue b/packages/primevue/src/listbox/Listbox.vue index 28e914879..b2a473ac3 100755 --- a/packages/primevue/src/listbox/Listbox.vue +++ b/packages/primevue/src/listbox/Listbox.vue @@ -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) { diff --git a/packages/primevue/src/multiselect/MultiSelect.vue b/packages/primevue/src/multiselect/MultiSelect.vue index f0e9590d9..ef8171d06 100755 --- a/packages/primevue/src/multiselect/MultiSelect.vue +++ b/packages/primevue/src/multiselect/MultiSelect.vue @@ -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) { diff --git a/packages/primevue/src/password/Password.vue b/packages/primevue/src/password/Password.vue index d07b0c62d..7a95d3023 100755 --- a/packages/primevue/src/password/Password.vue +++ b/packages/primevue/src/password/Password.vue @@ -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) { diff --git a/packages/primevue/src/radiobutton/RadioButton.vue b/packages/primevue/src/radiobutton/RadioButton.vue index bb48b4c5d..d13a39428 100755 --- a/packages/primevue/src/radiobutton/RadioButton.vue +++ b/packages/primevue/src/radiobutton/RadioButton.vue @@ -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); } }, diff --git a/packages/primevue/src/rating/Rating.vue b/packages/primevue/src/rating/Rating.vue index 642d8485c..9beeeec9a 100755 --- a/packages/primevue/src/rating/Rating.vue +++ b/packages/primevue/src/rating/Rating.vue @@ -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) { diff --git a/packages/primevue/src/select/Select.vue b/packages/primevue/src/select/Select.vue index 4f7366e18..48f4d762c 100755 --- a/packages/primevue/src/select/Select.vue +++ b/packages/primevue/src/select/Select.vue @@ -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) { diff --git a/packages/primevue/src/selectbutton/SelectButton.vue b/packages/primevue/src/selectbutton/SelectButton.vue index 0bae9077f..9a18db690 100755 --- a/packages/primevue/src/selectbutton/SelectButton.vue +++ b/packages/primevue/src/selectbutton/SelectButton.vue @@ -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) { diff --git a/packages/primevue/src/slider/Slider.vue b/packages/primevue/src/slider/Slider.vue index 4b702576a..49a69b533 100755 --- a/packages/primevue/src/slider/Slider.vue +++ b/packages/primevue/src/slider/Slider.vue @@ -139,7 +139,7 @@ export default { modelValue = newValue; } - this.updateValue(modelValue, event); + this.writeValue(modelValue, event); this.$emit('change', modelValue); }, onDragStart(event, index) { diff --git a/packages/primevue/src/textarea/Textarea.vue b/packages/primevue/src/textarea/Textarea.vue index 7fb30c2b5..9e482724a 100755 --- a/packages/primevue/src/textarea/Textarea.vue +++ b/packages/primevue/src/textarea/Textarea.vue @@ -37,7 +37,7 @@ export default { this.resize(); } - this.updateValue(event.target.value, event); + this.writeValue(event.target.value, event); } }, computed: { diff --git a/packages/primevue/src/togglebutton/ToggleButton.vue b/packages/primevue/src/togglebutton/ToggleButton.vue index ecf49694d..49c216b4a 100755 --- a/packages/primevue/src/togglebutton/ToggleButton.vue +++ b/packages/primevue/src/togglebutton/ToggleButton.vue @@ -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); } }, diff --git a/packages/primevue/src/toggleswitch/ToggleSwitch.vue b/packages/primevue/src/toggleswitch/ToggleSwitch.vue index 752c4807a..5363ebf06 100755 --- a/packages/primevue/src/toggleswitch/ToggleSwitch.vue +++ b/packages/primevue/src/toggleswitch/ToggleSwitch.vue @@ -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); } }, diff --git a/packages/primevue/src/treeselect/TreeSelect.vue b/packages/primevue/src/treeselect/TreeSelect.vue index f436eba81..ec7183fe4 100644 --- a/packages/primevue/src/treeselect/TreeSelect.vue +++ b/packages/primevue/src/treeselect/TreeSelect.vue @@ -226,7 +226,7 @@ export default { }, onSelectionChange(keys) { this.selfChange = true; - this.updateValue(keys); + this.writeValue(keys); this.$emit('change', keys); }, onNodeSelect(node) {