@energysage/es-ds-components 4.0.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/app/components/es-zip-code-form.vue +31 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.1.0](https://github.com/EnergySage/es-ds/compare/es-ds-components-v4.0.3...es-ds-components-v4.1.0) (2026-01-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add prop to allow replacements in zip code form URL ([#1695](https://github.com/EnergySage/es-ds/issues/1695)) ([001feb5](https://github.com/EnergySage/es-ds/commit/001feb52b9bbfd84c31390449c0810517c726a6f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* fix dependency vulnerabilities reported by jit ([#1697](https://github.com/EnergySage/es-ds/issues/1697)) ([db13818](https://github.com/EnergySage/es-ds/commit/db13818d9e83593f06c49d774fd219e96f6702dd))
|
|
14
|
+
|
|
3
15
|
## [4.0.3](https://github.com/EnergySage/es-ds/compare/es-ds-components-v4.0.2...es-ds-components-v4.0.3) (2025-10-30)
|
|
4
16
|
|
|
5
17
|
|
|
@@ -4,6 +4,10 @@ const props = defineProps({
|
|
|
4
4
|
type: Boolean,
|
|
5
5
|
default: false,
|
|
6
6
|
},
|
|
7
|
+
contextMessage: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: '',
|
|
10
|
+
},
|
|
7
11
|
dark: {
|
|
8
12
|
type: Boolean,
|
|
9
13
|
default: false,
|
|
@@ -24,10 +28,6 @@ const props = defineProps({
|
|
|
24
28
|
type: String,
|
|
25
29
|
default: 'ZIP code',
|
|
26
30
|
},
|
|
27
|
-
showPrivacySection: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: true,
|
|
30
|
-
},
|
|
31
31
|
privacyPolicyLink: {
|
|
32
32
|
type: String,
|
|
33
33
|
default: '',
|
|
@@ -36,23 +36,27 @@ const props = defineProps({
|
|
|
36
36
|
type: Boolean,
|
|
37
37
|
default: false,
|
|
38
38
|
},
|
|
39
|
-
|
|
39
|
+
replaceFieldNameInUrl: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
selectedProduct: {
|
|
40
44
|
type: String,
|
|
41
45
|
default: '',
|
|
42
46
|
},
|
|
43
|
-
|
|
44
|
-
type:
|
|
45
|
-
|
|
47
|
+
showPrivacySection: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true,
|
|
46
50
|
},
|
|
47
|
-
|
|
51
|
+
stackUntil: {
|
|
48
52
|
type: String,
|
|
49
53
|
default: '',
|
|
50
54
|
},
|
|
51
|
-
|
|
55
|
+
url: {
|
|
52
56
|
type: String,
|
|
53
|
-
|
|
57
|
+
required: true,
|
|
54
58
|
},
|
|
55
|
-
|
|
59
|
+
zipCodeValue: {
|
|
56
60
|
type: String,
|
|
57
61
|
default: '',
|
|
58
62
|
},
|
|
@@ -87,6 +91,10 @@ const rules = {
|
|
|
87
91
|
},
|
|
88
92
|
};
|
|
89
93
|
|
|
94
|
+
const replacementUrl = computed(() => {
|
|
95
|
+
return props.url.replace(`{${props.fieldName}}`, state.zipCode);
|
|
96
|
+
});
|
|
97
|
+
|
|
90
98
|
const { v$, validateState } = useEsForms(rules, state);
|
|
91
99
|
|
|
92
100
|
const ctaForm = useTemplateRef<HTMLFormElement>('ctaForm');
|
|
@@ -95,7 +103,16 @@ const handleSubmit = () => {
|
|
|
95
103
|
if (v$.value.$invalid) {
|
|
96
104
|
v$.value.$touch();
|
|
97
105
|
} else {
|
|
98
|
-
|
|
106
|
+
if (props.replaceFieldNameInUrl) {
|
|
107
|
+
navigateTo(replacementUrl.value, {
|
|
108
|
+
external: true,
|
|
109
|
+
open: {
|
|
110
|
+
target: props.newTab ? '_blank' : '_self',
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
} else {
|
|
114
|
+
ctaForm.value?.submit();
|
|
115
|
+
}
|
|
99
116
|
}
|
|
100
117
|
};
|
|
101
118
|
</script>
|
|
@@ -121,7 +138,7 @@ const handleSubmit = () => {
|
|
|
121
138
|
[`d-${stackBreak}flex`]: stackUntil,
|
|
122
139
|
'mb-100': showPrivacySection,
|
|
123
140
|
}"
|
|
124
|
-
:action="url"
|
|
141
|
+
:action="replaceFieldNameInUrl ? replacementUrl : url"
|
|
125
142
|
method="get"
|
|
126
143
|
novalidate
|
|
127
144
|
:target="newTab ? '_blank' : '_self'"
|