From a674358076c3809e918b7502b73f7257e5195c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Parani=C4=8D?= Date: Tue, 12 Nov 2024 18:19:57 +0100 Subject: [PATCH 1/4] 6755 - update input value after form reset --- .../src/baseeditableholder/BaseEditableHolder.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/core/src/baseeditableholder/BaseEditableHolder.vue b/packages/core/src/baseeditableholder/BaseEditableHolder.vue index b37a722548..a51355053d 100644 --- a/packages/core/src/baseeditableholder/BaseEditableHolder.vue +++ b/packages/core/src/baseeditableholder/BaseEditableHolder.vue @@ -72,6 +72,14 @@ export default { handler(newValue) { this.d_value !== newValue && (this.d_value = newValue); } + }, + formValue: { + immediate: false, + handler(newValue) { + if (this.$pcForm?.states?.[this.$formName] && newValue !== this.d_value) { + this.d_value = newValue; + } + } } }, formField: {}, @@ -109,6 +117,9 @@ export default { // @deprecated use $filled instead filled() { return this.$filled; + }, + formValue() { + return this.$pcForm?.states?.[this.name]?.value; } } }; From be89f54a7b8008ef9dfb5da42b33d6daf12933ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Parani=C4=8D?= <30797402+damuso@users.noreply.github.com> Date: Sun, 17 Nov 2024 18:26:41 +0100 Subject: [PATCH 2/4] code refactoring --- .../core/src/baseeditableholder/BaseEditableHolder.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/src/baseeditableholder/BaseEditableHolder.vue b/packages/core/src/baseeditableholder/BaseEditableHolder.vue index a51355053d..49c78f1f9b 100644 --- a/packages/core/src/baseeditableholder/BaseEditableHolder.vue +++ b/packages/core/src/baseeditableholder/BaseEditableHolder.vue @@ -73,7 +73,7 @@ export default { this.d_value !== newValue && (this.d_value = newValue); } }, - formValue: { + $formValue: { immediate: false, handler(newValue) { if (this.$pcForm?.states?.[this.$formName] && newValue !== this.d_value) { @@ -111,15 +111,15 @@ export default { $formDefaultValue() { return this.d_value ?? this.$pcFormField?.initialValue ?? this.$pcForm?.initialValues?.[this.$formName]; }, + $formValue() { + return this.$pcForm?.states?.[this.$formName]?.value; + }, controlled() { return this.$inProps.hasOwnProperty('modelValue') || (!this.$inProps.hasOwnProperty('modelValue') && !this.$inProps.hasOwnProperty('defaultValue')); }, // @deprecated use $filled instead filled() { return this.$filled; - }, - formValue() { - return this.$pcForm?.states?.[this.name]?.value; } } }; From 84574724338dc67c9a5a46a14845e940d179d545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Parani=C4=8D?= Date: Mon, 25 Nov 2024 19:04:58 +0100 Subject: [PATCH 3/4] fix: select button --- packages/core/src/baseeditableholder/BaseEditableHolder.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/baseeditableholder/BaseEditableHolder.vue b/packages/core/src/baseeditableholder/BaseEditableHolder.vue index 49c78f1f9b..496ab04572 100644 --- a/packages/core/src/baseeditableholder/BaseEditableHolder.vue +++ b/packages/core/src/baseeditableholder/BaseEditableHolder.vue @@ -76,7 +76,7 @@ export default { $formValue: { immediate: false, handler(newValue) { - if (this.$pcForm?.states?.[this.$formName] && newValue !== this.d_value) { + if (this.$formName !== undefined && this.$pcForm?.states?.[this.$formName] && newValue !== this.d_value) { this.d_value = newValue; } } @@ -120,6 +120,9 @@ export default { // @deprecated use $filled instead filled() { return this.$filled; + }, + formValue() { + return this.$pcForm?.states?.[this.$formName]?.value; } } }; From b17116824744d2fbc74f04bd7572363f287cf1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Parani=C4=8D?= Date: Tue, 26 Nov 2024 21:08:02 +0100 Subject: [PATCH 4/4] cleanup --- packages/core/src/baseeditableholder/BaseEditableHolder.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/core/src/baseeditableholder/BaseEditableHolder.vue b/packages/core/src/baseeditableholder/BaseEditableHolder.vue index 496ab04572..f5ed9bde56 100644 --- a/packages/core/src/baseeditableholder/BaseEditableHolder.vue +++ b/packages/core/src/baseeditableholder/BaseEditableHolder.vue @@ -120,9 +120,6 @@ export default { // @deprecated use $filled instead filled() { return this.$filled; - }, - formValue() { - return this.$pcForm?.states?.[this.$formName]?.value; } } };