@energysage/es-ds-components 3.0.0-alpha.5 → 3.0.0-alpha.7
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/.eslintignore +9 -0
- package/.eslintrc.json +3 -0
- package/.prettierrc.json +10 -0
- package/components/es-accordion-list.vue +112 -0
- package/components/es-accordion.vue +7 -0
- package/components/es-badge.vue +20 -0
- package/components/es-breadcrumbs.vue +43 -30
- package/components/es-button.vue +112 -0
- package/components/es-card.vue +64 -0
- package/components/es-carousel.vue +160 -0
- package/components/{b-col.vue → es-col.vue} +11 -11
- package/components/es-collapse.vue +40 -36
- package/components/es-cta-banner.vue +95 -0
- package/components/es-cta-card.vue +60 -0
- package/components/es-data-table-simple.vue +73 -0
- package/components/es-data-table.vue +126 -0
- package/components/es-error-page.vue +120 -0
- package/components/es-file-input.vue +331 -0
- package/components/es-file-preview-modal.vue +61 -0
- package/components/es-footer.vue +163 -0
- package/components/es-form-checkbox.vue +40 -0
- package/components/es-form-input.vue +130 -0
- package/components/es-form-msg.vue +81 -0
- package/components/es-form-radio-card.vue +57 -0
- package/components/es-form-radio-cards.vue +78 -0
- package/components/es-form-textarea.vue +124 -0
- package/components/es-form.vue +16 -0
- package/components/es-modal.vue +103 -0
- package/components/es-nav-bar-account-menu.vue +67 -0
- package/components/es-nav-bar-featured-article.vue +60 -0
- package/components/es-nav-bar-link.vue +27 -0
- package/components/es-nav-bar-product-menu.vue +215 -0
- package/components/es-nav-bar-top-level-menu.vue +193 -0
- package/components/es-nav-bar-topic-menu.vue +194 -0
- package/components/es-nav-bar.vue +396 -0
- package/components/es-pagination.vue +66 -0
- package/components/es-popover.vue +113 -0
- package/components/es-progress-circle.vue +81 -0
- package/components/es-progress.vue +36 -0
- package/components/es-radio-button-group.vue +53 -0
- package/components/es-radio-button.vue +50 -55
- package/components/es-rating.vue +120 -0
- package/components/es-reviews-io-card-carousel.vue +275 -0
- package/components/es-slider.vue +147 -0
- package/components/es-spinner.vue +22 -0
- package/components/es-support-card.vue +150 -0
- package/components/es-support.vue +66 -0
- package/components/es-tab.vue +7 -0
- package/components/es-tabs.vue +67 -0
- package/components/es-verification-code.vue +94 -0
- package/components/es-view-more.vue +63 -0
- package/components/es-zip-code-form.vue +204 -0
- package/components/icon/arrow-clockwise.vue +51 -0
- package/components/icon/arrow-counter-clockwise.vue +37 -0
- package/components/icon/arrow-cycle.vue +43 -0
- package/components/icon/arrow-left.vue +39 -0
- package/components/icon/arrow-right.vue +39 -0
- package/components/icon/arrow-up.vue +39 -0
- package/components/icon/arrow.vue +68 -0
- package/components/icon/bank.vue +38 -0
- package/components/icon/battery.vue +40 -0
- package/components/icon/bell.vue +42 -0
- package/components/icon/block.vue +46 -0
- package/components/icon/bolt.vue +38 -0
- package/components/icon/business.vue +42 -0
- package/components/icon/calculator.vue +37 -0
- package/components/icon/calendar.vue +46 -0
- package/components/icon/cart.vue +46 -0
- package/components/icon/chat-add.vue +44 -0
- package/components/icon/chat-approve.vue +42 -0
- package/components/icon/chat-bubble.vue +40 -0
- package/components/icon/chat-dots.vue +42 -0
- package/components/icon/check.vue +39 -0
- package/components/{icon-chevron-down.vue → icon/chevron-down.vue} +16 -16
- package/components/icon/chevron-horizontal.vue +39 -0
- package/components/icon/chevron-left.vue +39 -0
- package/components/{icon-chevron-right.vue → icon/chevron-right.vue} +16 -16
- package/components/icon/chevron-up.vue +39 -0
- package/components/icon/circle-alert.vue +46 -0
- package/components/icon/circle-check.vue +46 -0
- package/components/icon/circle-chevron-down.vue +47 -0
- package/components/icon/circle-chevron-left.vue +46 -0
- package/components/icon/circle-chevron-right.vue +46 -0
- package/components/icon/circle-chevron-up.vue +46 -0
- package/components/icon/circle-minus.vue +46 -0
- package/components/icon/circle-plus.vue +46 -0
- package/components/icon/circle-x.vue +46 -0
- package/components/icon/circle.vue +42 -0
- package/components/icon/clock.vue +46 -0
- package/components/icon/community-solar.vue +37 -0
- package/components/icon/companies.vue +43 -0
- package/components/icon/contact-us.vue +37 -0
- package/components/icon/copy.vue +45 -0
- package/components/icon/credit-card.vue +37 -0
- package/components/icon/document.vue +45 -0
- package/components/icon/electric-vehicle.vue +37 -0
- package/components/icon/electricity-circle.vue +39 -0
- package/components/icon/envelope.vue +45 -0
- package/components/icon/es-leaf.vue +39 -0
- package/components/icon/eye.vue +41 -0
- package/components/icon/facebook.vue +41 -0
- package/components/icon/file-doc.vue +72 -0
- package/components/icon/file-docx.vue +72 -0
- package/components/icon/file-pdf.vue +72 -0
- package/components/icon/flag.vue +37 -0
- package/components/icon/folder.vue +41 -0
- package/components/icon/gear.vue +37 -0
- package/components/icon/gift.vue +37 -0
- package/components/icon/hamburger.vue +38 -0
- package/components/icon/heart.vue +39 -0
- package/components/icon/heat-pump.vue +41 -0
- package/components/icon/image.vue +45 -0
- package/components/icon/info-blog-post.vue +47 -0
- package/components/icon/info.vue +45 -0
- package/components/icon/instagram.vue +49 -0
- package/components/icon/light-bulb.vue +36 -0
- package/components/icon/link-out.vue +38 -0
- package/components/icon/linkedin.vue +41 -0
- package/components/icon/location.vue +45 -0
- package/components/icon/lock-off.vue +45 -0
- package/components/icon/lock-on.vue +48 -0
- package/components/icon/marketplace.vue +43 -0
- package/components/icon/minus.vue +38 -0
- package/components/icon/money-bag.vue +37 -0
- package/components/icon/money.vue +35 -0
- package/components/icon/open-envelope.vue +45 -0
- package/components/icon/paper.vue +45 -0
- package/components/icon/payback.vue +37 -0
- package/components/icon/pencil.vue +45 -0
- package/components/icon/person-add.vue +41 -0
- package/components/icon/person-check.vue +41 -0
- package/components/icon/person-cross.vue +41 -0
- package/components/icon/person.vue +41 -0
- package/components/icon/phone.vue +41 -0
- package/components/icon/play.vue +41 -0
- package/components/icon/plus.vue +38 -0
- package/components/icon/roof.vue +37 -0
- package/components/icon/rooftop-solar.vue +37 -0
- package/components/icon/saving.vue +37 -0
- package/components/icon/search.vue +43 -0
- package/components/icon/settings-horizontal.vue +57 -0
- package/components/icon/settings-vertical.vue +57 -0
- package/components/icon/shield-with-check.vue +38 -0
- package/components/icon/shield.vue +41 -0
- package/components/icon/shopping-bag.vue +39 -0
- package/components/icon/solar.vue +37 -0
- package/components/icon/sound-down.vue +45 -0
- package/components/icon/sound-off.vue +41 -0
- package/components/icon/sound-on.vue +41 -0
- package/components/icon/sound-up.vue +41 -0
- package/components/icon/star-empty.vue +38 -0
- package/components/icon/star-full.vue +36 -0
- package/components/icon/star-half.vue +55 -0
- package/components/icon/state-ak.vue +53 -0
- package/components/icon/state-al.vue +38 -0
- package/components/icon/state-ar.vue +38 -0
- package/components/icon/state-az.vue +38 -0
- package/components/icon/state-ca.vue +38 -0
- package/components/icon/state-co.vue +38 -0
- package/components/icon/state-ct.vue +38 -0
- package/components/icon/state-dc.vue +52 -0
- package/components/icon/state-de.vue +38 -0
- package/components/icon/state-fl.vue +38 -0
- package/components/icon/state-ga.vue +38 -0
- package/components/icon/state-hi.vue +59 -0
- package/components/icon/state-ia.vue +38 -0
- package/components/icon/state-id.vue +38 -0
- package/components/icon/state-il.vue +38 -0
- package/components/icon/state-in.vue +38 -0
- package/components/icon/state-ks.vue +38 -0
- package/components/icon/state-ky.vue +38 -0
- package/components/icon/state-la.vue +38 -0
- package/components/icon/state-ma.vue +38 -0
- package/components/icon/state-md.vue +39 -0
- package/components/icon/state-me.vue +38 -0
- package/components/icon/state-mi.vue +38 -0
- package/components/icon/state-mn.vue +38 -0
- package/components/icon/state-mo.vue +38 -0
- package/components/icon/state-ms.vue +38 -0
- package/components/icon/state-mt.vue +38 -0
- package/components/icon/state-nc.vue +38 -0
- package/components/icon/state-nd.vue +38 -0
- package/components/icon/state-ne.vue +38 -0
- package/components/icon/state-nh.vue +38 -0
- package/components/icon/state-nj.vue +37 -0
- package/components/icon/state-nm.vue +38 -0
- package/components/icon/state-nv.vue +38 -0
- package/components/icon/state-ny.vue +41 -0
- package/components/icon/state-oh.vue +38 -0
- package/components/icon/state-ok.vue +38 -0
- package/components/icon/state-or.vue +38 -0
- package/components/icon/state-pa.vue +38 -0
- package/components/icon/state-ri.vue +38 -0
- package/components/icon/state-sc.vue +38 -0
- package/components/icon/state-sd.vue +38 -0
- package/components/icon/state-tn.vue +38 -0
- package/components/icon/state-tx.vue +38 -0
- package/components/icon/state-ut.vue +38 -0
- package/components/icon/state-va.vue +38 -0
- package/components/icon/state-vt.vue +38 -0
- package/components/icon/state-wa.vue +38 -0
- package/components/icon/state-wi.vue +38 -0
- package/components/icon/state-wv.vue +38 -0
- package/components/icon/state-wy.vue +38 -0
- package/components/icon/thumbs-up.vue +39 -0
- package/components/icon/trash-can.vue +41 -0
- package/components/icon/tree.vue +37 -0
- package/components/icon/twitter.vue +43 -0
- package/components/icon/upload.vue +41 -0
- package/components/icon/verified.vue +40 -0
- package/components/icon/video-play.vue +41 -0
- package/components/icon/wifi.vue +38 -0
- package/components/icon/x.vue +38 -0
- package/components/icon/youtube.vue +45 -0
- package/composables/forms.ts +124 -0
- package/lib-utils/mime-type-finder.js +48 -0
- package/nuxt.config.ts +43 -9
- package/package.json +29 -6
- package/tsconfig.json +2 -2
- package/utils/get-es-footer-content.js +90 -0
- package/utils/get-es-nav-bar-account-content.js +55 -0
- package/utils/get-es-nav-bar-global-content.js +474 -0
- /package/components/{b-container.vue → es-container.vue} +0 -0
- /package/components/{b-row.vue → es-row.vue} +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import TabPanel from 'primevue/tabpanel';
|
|
3
|
+
import TabView from 'primevue/tabview';
|
|
4
|
+
|
|
5
|
+
// allow use of v-model on this component
|
|
6
|
+
const model = defineModel<number>();
|
|
7
|
+
|
|
8
|
+
// get the list of elements provided as children to the default slot
|
|
9
|
+
const panels = useSlots().default?.() || [];
|
|
10
|
+
|
|
11
|
+
// keep track of the active tab index
|
|
12
|
+
// - from above, if v-model is used
|
|
13
|
+
// - from below, if the tab component receives a click
|
|
14
|
+
const activeIndex = ref(0);
|
|
15
|
+
|
|
16
|
+
// watch the v-model for changes and update the active index if it does change
|
|
17
|
+
watch(model, (newVal) => {
|
|
18
|
+
activeIndex.value = newVal;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// called from the TabView when the user clicks a tab to make it active
|
|
22
|
+
const updateActiveIndex = (index) => {
|
|
23
|
+
model.value = index;
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<tab-view
|
|
29
|
+
:active-index="activeIndex"
|
|
30
|
+
:pt="{
|
|
31
|
+
root: 'tabs es-tabs',
|
|
32
|
+
nav: 'list-unstyled nav position-relative',
|
|
33
|
+
tab: 'nav-link',
|
|
34
|
+
inkbar: 'inkbar position-absolute',
|
|
35
|
+
panelContainer: 'tab-content',
|
|
36
|
+
}"
|
|
37
|
+
@update:active-index="updateActiveIndex">
|
|
38
|
+
<tab-panel
|
|
39
|
+
v-for="(panel, index) in panels"
|
|
40
|
+
:key="index"
|
|
41
|
+
:header="panel.props.title"
|
|
42
|
+
:pt="{
|
|
43
|
+
header: 'nav-item',
|
|
44
|
+
headerAction: ({ context }) => ({
|
|
45
|
+
class: [
|
|
46
|
+
'nav-link',
|
|
47
|
+
{
|
|
48
|
+
'active active-tab font-weight-bolder': context.active,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
}),
|
|
52
|
+
content: ({ context }) => ({
|
|
53
|
+
class: [
|
|
54
|
+
'tab-pane mt-100',
|
|
55
|
+
{
|
|
56
|
+
active: context.active,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
}),
|
|
60
|
+
}">
|
|
61
|
+
<component
|
|
62
|
+
:is="item"
|
|
63
|
+
v-for="(item, idx) in panel.children.default()"
|
|
64
|
+
:key="idx" />
|
|
65
|
+
</tab-panel>
|
|
66
|
+
</tab-view>
|
|
67
|
+
</template>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import InputOtp from 'primevue/inputotp';
|
|
3
|
+
|
|
4
|
+
const model = defineModel<Array<string>>();
|
|
5
|
+
const verificationCode = ref<string>();
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
charCount: {
|
|
9
|
+
type: Number,
|
|
10
|
+
default: 5,
|
|
11
|
+
},
|
|
12
|
+
disabled: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const count = ref(props.charCount);
|
|
19
|
+
watch(model, (newVal) => {
|
|
20
|
+
verificationCode.value = newVal ? newVal.join('') : '';
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Note: @update:model-value is erroneously requiring a boolean function argument,
|
|
24
|
+
// workaround for error is to specify any
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
+
const updateCode = (newValue: any) => {
|
|
27
|
+
model.value = newValue.split('');
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div>
|
|
33
|
+
<input-otp
|
|
34
|
+
v-model="verificationCode"
|
|
35
|
+
class="custom-otp"
|
|
36
|
+
v-bind="$attrs"
|
|
37
|
+
:length="count"
|
|
38
|
+
integer-only
|
|
39
|
+
@update:model-value="updateCode">
|
|
40
|
+
<template #default="{ attrs, events, index }">
|
|
41
|
+
<input
|
|
42
|
+
:id="index.toString()"
|
|
43
|
+
type="text"
|
|
44
|
+
class="custom-otp-input form-control"
|
|
45
|
+
:disabled="props.disabled"
|
|
46
|
+
v-bind="attrs"
|
|
47
|
+
v-on="events" />
|
|
48
|
+
</template>
|
|
49
|
+
</input-otp>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<style lang="scss" scoped>
|
|
54
|
+
@use '@energysage/es-ds-styles/scss/variables' as variables;
|
|
55
|
+
@use '@energysage/es-ds-styles/scss/mixins/breakpoints' as breakpoints;
|
|
56
|
+
|
|
57
|
+
.custom-otp {
|
|
58
|
+
display: flex;
|
|
59
|
+
gap: 10px;
|
|
60
|
+
}
|
|
61
|
+
.custom-otp-input {
|
|
62
|
+
font-weight: 600 !important;
|
|
63
|
+
font-size: 1.875rem !important;
|
|
64
|
+
line-height: 2.25rem !important;
|
|
65
|
+
text-align: center;
|
|
66
|
+
height: 5rem;
|
|
67
|
+
width: 5rem;
|
|
68
|
+
appearance: textfield;
|
|
69
|
+
border: variables.$verification-code-border;
|
|
70
|
+
border-radius: variables.$verification-code-border-radius !important;
|
|
71
|
+
box-shadow: variables.$verification-code-shadow;
|
|
72
|
+
height: variables.$verification-code-dimension-lg;
|
|
73
|
+
width: variables.$verification-code-dimension-lg;
|
|
74
|
+
flex: 0 0 auto;
|
|
75
|
+
|
|
76
|
+
&:focus {
|
|
77
|
+
border-color: variables.$verification-code-focus-border-color;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@include breakpoints.media-breakpoint-down(md) {
|
|
81
|
+
height: variables.$verification-code-dimension-xs;
|
|
82
|
+
width: variables.$verification-code-dimension-xs;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&::-webkit-outer-spin-button,
|
|
86
|
+
&::-webkit-inner-spin-button {
|
|
87
|
+
appearance: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:last-child {
|
|
91
|
+
margin-right: 0 !important;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import truncate from 'html-truncate';
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
/**
|
|
6
|
+
* Full text content
|
|
7
|
+
*/
|
|
8
|
+
content: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* Maximum character length of text before it is truncated
|
|
14
|
+
*/
|
|
15
|
+
length: {
|
|
16
|
+
type: Number,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* Text for button to show more text
|
|
21
|
+
*/
|
|
22
|
+
clamp: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false,
|
|
25
|
+
default: 'Show more',
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Text for button to hide text
|
|
29
|
+
*/
|
|
30
|
+
less: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false,
|
|
33
|
+
default: 'Show less',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const isClamped = ref(true);
|
|
38
|
+
|
|
39
|
+
const truncatedContent = computed(() => truncate(props.content, props.length));
|
|
40
|
+
const isTruncated = computed(() => truncatedContent.value !== props.content);
|
|
41
|
+
const buttonText = computed(() => (isClamped.value ? props.clamp : props.less));
|
|
42
|
+
const bodyContent = computed(() => {
|
|
43
|
+
if (isClamped.value) {
|
|
44
|
+
return truncatedContent.value;
|
|
45
|
+
}
|
|
46
|
+
return props.content;
|
|
47
|
+
});
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<div>
|
|
52
|
+
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
53
|
+
<span v-html="bodyContent" />
|
|
54
|
+
<es-button
|
|
55
|
+
v-if="isTruncated"
|
|
56
|
+
inline
|
|
57
|
+
variant="link"
|
|
58
|
+
class="ml-50 p-0"
|
|
59
|
+
@click="isClamped = !isClamped">
|
|
60
|
+
{{ buttonText }}
|
|
61
|
+
</es-button>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
constrained: {
|
|
4
|
+
type: Boolean,
|
|
5
|
+
default: false,
|
|
6
|
+
},
|
|
7
|
+
dark: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: false,
|
|
10
|
+
},
|
|
11
|
+
fieldName: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'zip_code',
|
|
14
|
+
},
|
|
15
|
+
inputId: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
newTab: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false,
|
|
22
|
+
},
|
|
23
|
+
placeholder: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'ZIP code',
|
|
26
|
+
},
|
|
27
|
+
showPrivacySection: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true,
|
|
30
|
+
},
|
|
31
|
+
privacyPolicyLink: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: '',
|
|
34
|
+
},
|
|
35
|
+
privacyPolicyNewTab: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
stackUntil: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: '',
|
|
42
|
+
},
|
|
43
|
+
url: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
zipCodeValue: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '',
|
|
50
|
+
},
|
|
51
|
+
selectedProduct: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: '',
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const state = reactive({
|
|
58
|
+
zipCode: props.zipCodeValue,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
watch(
|
|
62
|
+
() => props.zipCodeValue,
|
|
63
|
+
(newVal) => {
|
|
64
|
+
state.zipCode = newVal;
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const stackBreak = computed(() => {
|
|
69
|
+
let { stackUntil } = props;
|
|
70
|
+
if (stackUntil === 'xs') {
|
|
71
|
+
stackUntil = '';
|
|
72
|
+
}
|
|
73
|
+
return stackUntil ? `${stackUntil}-` : '';
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
/* Set up validation using Vuelidate */
|
|
77
|
+
const rules = {
|
|
78
|
+
zipCode: {
|
|
79
|
+
[vuelidateKeys.MAX_LENGTH]: vuelidateMaxLength(5),
|
|
80
|
+
[vuelidateKeys.MIN_LENGTH]: vuelidateMinLength(5),
|
|
81
|
+
[vuelidateKeys.INTEGER]: vuelidateInteger,
|
|
82
|
+
[vuelidateKeys.REQUIRED]: vuelidateRequired,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const { v$, validateState } = useEsForms(rules, state);
|
|
87
|
+
|
|
88
|
+
const ctaForm = ref<HTMLFormElement>('ctaForm');
|
|
89
|
+
|
|
90
|
+
const handleSubmit = () => {
|
|
91
|
+
if (v$.value.$invalid) {
|
|
92
|
+
v$.value.$touch();
|
|
93
|
+
} else {
|
|
94
|
+
ctaForm.value.submit();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<div
|
|
101
|
+
class="EsZipCodeForm d-flex"
|
|
102
|
+
:class="{
|
|
103
|
+
'EsZipCodeForm--constrained': constrained,
|
|
104
|
+
'text-white': dark,
|
|
105
|
+
}"
|
|
106
|
+
v-bind="$attrs">
|
|
107
|
+
<div class="d-flex flex-column">
|
|
108
|
+
<form
|
|
109
|
+
ref="ctaForm"
|
|
110
|
+
class="justify-content-center w-100"
|
|
111
|
+
:class="{
|
|
112
|
+
[`d-${stackBreak}flex`]: stackUntil,
|
|
113
|
+
'mb-100': showPrivacySection,
|
|
114
|
+
}"
|
|
115
|
+
:action="url"
|
|
116
|
+
method="get"
|
|
117
|
+
novalidate
|
|
118
|
+
:target="newTab ? '_blank' : '_self'"
|
|
119
|
+
@submit.prevent.stop="handleSubmit">
|
|
120
|
+
<es-form-input
|
|
121
|
+
:id="inputId"
|
|
122
|
+
v-model="state.zipCode"
|
|
123
|
+
:state="validateState('zipCode')"
|
|
124
|
+
autocomplete="postal-code"
|
|
125
|
+
class="mb-100"
|
|
126
|
+
:class="{
|
|
127
|
+
[`mb-${stackBreak}0 mr-${stackBreak}50`]: stackUntil,
|
|
128
|
+
}"
|
|
129
|
+
inputmode="numeric"
|
|
130
|
+
label-sr-only
|
|
131
|
+
maxlength="5"
|
|
132
|
+
:name="fieldName"
|
|
133
|
+
pattern="\d*"
|
|
134
|
+
:placeholder="placeholder"
|
|
135
|
+
required>
|
|
136
|
+
<template #prefixIcon>
|
|
137
|
+
<icon-location class="text-gray-800" />
|
|
138
|
+
</template>
|
|
139
|
+
<template #label>
|
|
140
|
+
{{ placeholder }}
|
|
141
|
+
</template>
|
|
142
|
+
<template #errorMessage>
|
|
143
|
+
<span :class="{ 'text-white': dark }">
|
|
144
|
+
<slot name="errorMessage"> Please enter a 5-digit zip code. </slot>
|
|
145
|
+
</span>
|
|
146
|
+
</template>
|
|
147
|
+
</es-form-input>
|
|
148
|
+
<input
|
|
149
|
+
v-if="selectedProduct"
|
|
150
|
+
type="hidden"
|
|
151
|
+
name="product"
|
|
152
|
+
:value="selectedProduct" />
|
|
153
|
+
<es-button
|
|
154
|
+
class="text-nowrap w-100"
|
|
155
|
+
:class="{
|
|
156
|
+
[`ml-${stackBreak}50 w-${stackBreak}auto`]: stackUntil,
|
|
157
|
+
'px-100': constrained,
|
|
158
|
+
}"
|
|
159
|
+
type="submit"
|
|
160
|
+
:variant="dark ? 'dark-bg' : 'primary'">
|
|
161
|
+
<slot name="buttonText"> Submit </slot>
|
|
162
|
+
</es-button>
|
|
163
|
+
</form>
|
|
164
|
+
<div
|
|
165
|
+
v-if="showPrivacySection"
|
|
166
|
+
class="d-flex text-left"
|
|
167
|
+
:class="{ 'font-size-75': constrained }">
|
|
168
|
+
<icon-lock-on
|
|
169
|
+
aria-hidden="true"
|
|
170
|
+
class="privacy-lock-icon flex-shrink-0 mr-50 position-relative"
|
|
171
|
+
:class="{ 'mt-25': !constrained }"
|
|
172
|
+
height="1.125rem"
|
|
173
|
+
width="1.125rem" />
|
|
174
|
+
<div>
|
|
175
|
+
<span>
|
|
176
|
+
<slot name="privacyExplanation"> Your information is safe with us. </slot>
|
|
177
|
+
</span>
|
|
178
|
+
<nuxt-link
|
|
179
|
+
v-if="privacyPolicyLink"
|
|
180
|
+
:href="privacyPolicyLink"
|
|
181
|
+
class="text-nowrap"
|
|
182
|
+
:class="dark ? 'text-white' : ''"
|
|
183
|
+
:target="privacyPolicyNewTab ? '_blank' : '_self'">
|
|
184
|
+
<slot name="privacyPolicyLinkText"> Privacy Policy </slot>
|
|
185
|
+
</nuxt-link>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
</template>
|
|
191
|
+
|
|
192
|
+
<style lang="scss" scoped>
|
|
193
|
+
.EsZipCodeForm {
|
|
194
|
+
.privacy-lock-icon {
|
|
195
|
+
top: -0.02em;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&--constrained {
|
|
199
|
+
.privacy-lock-icon {
|
|
200
|
+
top: 0.02em;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'IconArrowClockwise',
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* Width
|
|
7
|
+
*/
|
|
8
|
+
width: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: '24px',
|
|
11
|
+
required: false,
|
|
12
|
+
},
|
|
13
|
+
/**
|
|
14
|
+
* Height
|
|
15
|
+
*/
|
|
16
|
+
height: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: '24px',
|
|
19
|
+
required: false,
|
|
20
|
+
},
|
|
21
|
+
orientation: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'clockwise',
|
|
24
|
+
required: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
<template>
|
|
30
|
+
<svg
|
|
31
|
+
:class="{
|
|
32
|
+
'counter-clockwise': orientation === 'counter-clockwise',
|
|
33
|
+
}"
|
|
34
|
+
:style="{
|
|
35
|
+
height: height,
|
|
36
|
+
width: width,
|
|
37
|
+
}"
|
|
38
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
39
|
+
viewBox="0 0 24 24"
|
|
40
|
+
fill="currentColor">
|
|
41
|
+
<!-- eslint-disable-next-line max-len -->
|
|
42
|
+
<path
|
|
43
|
+
d="M3.246 7.123c.997-1.81 2.591-3.418 4.485-4.222 1.894-.905 4.087-1.106 6.08-.704 2.193.403 3.788 1.408 5.183 3.016.2.201.4.503.598.704l.4-2.513c.099-.603.597-.905 1.195-.905.499.1.897.704.798 1.206l-.897 5.127c0 .301-.2.502-.4.603-.198.1-.398.201-.597.201h-.2l-4.983-.905a1.042 1.042 0 0 1-.798-1.206c.1-.503.598-.905 1.197-.804l2.79.603c-.1-.302-.299-.503-.598-.804-1.096-1.307-2.492-2.111-4.086-2.413-1.595-.402-3.39-.2-4.884.503A7.896 7.896 0 0 0 4.94 8.028c-.797 1.507-1.096 3.216-.897 4.925.2 1.709.897 3.317 2.093 4.524 1.097 1.206 2.692 2.11 4.286 2.311 1.595.302 3.39 0 4.785-.703a8.444 8.444 0 0 0 3.488-3.518c.2-.503.798-.704 1.296-.503.498.201.698.804.498 1.307-.797 2.11-2.292 3.619-4.186 4.624-1.395.703-2.89 1.005-4.485 1.005-.598 0-1.096 0-1.695-.1-2.093-.403-3.987-1.408-5.382-2.916a10.256 10.256 0 0 1-2.691-5.629c-.2-2.211.2-4.322 1.196-6.232Z" />
|
|
44
|
+
</svg>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<style lang="scss" scoped>
|
|
48
|
+
.counter-clockwise {
|
|
49
|
+
transform: scale(-1, 1);
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'ArrowCounterClockwiseIcon',
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* Width
|
|
7
|
+
*/
|
|
8
|
+
width: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: '24px',
|
|
11
|
+
required: false,
|
|
12
|
+
},
|
|
13
|
+
/**
|
|
14
|
+
* Height
|
|
15
|
+
*/
|
|
16
|
+
height: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: '24px',
|
|
19
|
+
required: false,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
</script>
|
|
24
|
+
<template>
|
|
25
|
+
<svg
|
|
26
|
+
:style="{
|
|
27
|
+
height: height,
|
|
28
|
+
width: width,
|
|
29
|
+
}"
|
|
30
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
fill="currentColor">
|
|
33
|
+
<!-- eslint-disable-next-line max-len -->
|
|
34
|
+
<path
|
|
35
|
+
d="M20.754 7.123c-.997-1.81-2.591-3.418-4.485-4.222-1.894-.905-4.087-1.106-6.08-.704C7.996 2.6 6.4 3.605 5.006 5.213c-.2.201-.4.503-.598.704l-.4-2.513c-.099-.603-.597-.905-1.195-.905-.499.1-.897.704-.798 1.206l.897 5.127c0 .301.2.502.4.603.198.1.398.201.597.201h.2l4.983-.905c.499-.1.897-.603.798-1.206a1.034 1.034 0 0 0-1.196-.804l-2.791.603c.1-.302.299-.503.598-.804 1.096-1.307 2.492-2.111 4.086-2.413 1.595-.402 3.39-.2 4.884.503a7.896 7.896 0 0 1 3.589 3.418c.797 1.507 1.096 3.216.897 4.925-.2 1.709-.897 3.317-2.094 4.524-1.096 1.206-2.69 2.11-4.285 2.311-1.595.302-3.39 0-4.785-.703a8.444 8.444 0 0 1-3.488-3.518c-.2-.503-.798-.704-1.296-.503-.499.201-.698.804-.499 1.307.798 2.11 2.293 3.619 4.187 4.624 1.395.703 2.89 1.005 4.485 1.005.598 0 1.096 0 1.695-.1 2.093-.403 3.986-1.408 5.382-2.916a10.257 10.257 0 0 0 2.691-5.629c.2-2.211-.2-4.322-1.196-6.232Z" />
|
|
36
|
+
</svg>
|
|
37
|
+
</template>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- eslint-disable max-len -->
|
|
2
|
+
<script>
|
|
3
|
+
export default {
|
|
4
|
+
name: 'IconArrowCycle',
|
|
5
|
+
props: {
|
|
6
|
+
/**
|
|
7
|
+
* Width
|
|
8
|
+
*/
|
|
9
|
+
width: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: '24px',
|
|
12
|
+
required: false,
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* Height
|
|
16
|
+
*/
|
|
17
|
+
height: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '24px',
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
<template>
|
|
26
|
+
<svg
|
|
27
|
+
:style="{
|
|
28
|
+
height: height,
|
|
29
|
+
width: width,
|
|
30
|
+
}"
|
|
31
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
32
|
+
viewBox="0 0 24 24"
|
|
33
|
+
fill="currentColor">
|
|
34
|
+
<path
|
|
35
|
+
fill-rule="evenodd"
|
|
36
|
+
clip-rule="evenodd"
|
|
37
|
+
d="M11.806 3C6.929 3 3 6.565 3 12a1 1 0 1 1-2 0C1 5.435 5.85 1 11.806 1c4.759 0 8.742 2.543 10.141 6.68a1 1 0 0 1-1.894.64C18.973 5.127 15.853 3 11.806 3ZM22 11a1 1 0 0 1 1 1c0 6.565-4.85 11-10.806 11-4.758 0-8.742-2.543-10.141-6.68a1 1 0 0 1 1.894-.64c1.08 3.193 4.2 5.32 8.247 5.32C17.071 21 21 17.435 21 12a1 1 0 0 1 1-1Z" />
|
|
38
|
+
<path
|
|
39
|
+
fill-rule="evenodd"
|
|
40
|
+
clip-rule="evenodd"
|
|
41
|
+
d="M22.242 3.03a1 1 0 0 1 .728 1.213l-1 4a1 1 0 0 1-1.212.727l-4-1a1 1 0 1 1 .485-1.94l3.03.757.757-3.03a1 1 0 0 1 1.212-.727ZM2.03 15.758a1 1 0 0 1 1.213-.728l4 1a1 1 0 1 1-.486 1.94l-3.03-.757-.757 3.03a1 1 0 1 1-1.94-.485l1-4Z" />
|
|
42
|
+
</svg>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- eslint-disable max-len -->
|
|
2
|
+
<script>
|
|
3
|
+
export default {
|
|
4
|
+
name: 'ArrowLeftIcon',
|
|
5
|
+
props: {
|
|
6
|
+
/**
|
|
7
|
+
* Width
|
|
8
|
+
*/
|
|
9
|
+
width: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: '24px',
|
|
12
|
+
required: false,
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* Height
|
|
16
|
+
*/
|
|
17
|
+
height: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '24px',
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
<template>
|
|
26
|
+
<svg
|
|
27
|
+
:style="{
|
|
28
|
+
height: height,
|
|
29
|
+
width: width,
|
|
30
|
+
}"
|
|
31
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
32
|
+
viewBox="0 0 24 24"
|
|
33
|
+
fill="currentColor">
|
|
34
|
+
<path
|
|
35
|
+
fill-rule="evenodd"
|
|
36
|
+
clip-rule="evenodd"
|
|
37
|
+
d="M11.707 4.293a1 1 0 0 1 0 1.414L6.414 11H20a1 1 0 1 1 0 2H6.414l5.293 5.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z" />
|
|
38
|
+
</svg>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- eslint-disable max-len -->
|
|
2
|
+
<script>
|
|
3
|
+
export default {
|
|
4
|
+
name: 'ArrowRightIcon',
|
|
5
|
+
props: {
|
|
6
|
+
/**
|
|
7
|
+
* Width
|
|
8
|
+
*/
|
|
9
|
+
width: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: '24px',
|
|
12
|
+
required: false,
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* Height
|
|
16
|
+
*/
|
|
17
|
+
height: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '24px',
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
<template>
|
|
26
|
+
<svg
|
|
27
|
+
:style="{
|
|
28
|
+
height: height,
|
|
29
|
+
width: width,
|
|
30
|
+
}"
|
|
31
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
32
|
+
viewBox="0 0 24 24"
|
|
33
|
+
fill="currentColor">
|
|
34
|
+
<path
|
|
35
|
+
fill-rule="evenodd"
|
|
36
|
+
clip-rule="evenodd"
|
|
37
|
+
d="M12.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L17.586 13H4a1 1 0 1 1 0-2h13.586l-5.293-5.293a1 1 0 0 1 0-1.414Z" />
|
|
38
|
+
</svg>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- eslint-disable max-len -->
|
|
2
|
+
<script>
|
|
3
|
+
export default {
|
|
4
|
+
name: 'ArrowUpIcon',
|
|
5
|
+
props: {
|
|
6
|
+
/**
|
|
7
|
+
* Width
|
|
8
|
+
*/
|
|
9
|
+
width: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: '24px',
|
|
12
|
+
required: false,
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* Height
|
|
16
|
+
*/
|
|
17
|
+
height: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '24px',
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
<template>
|
|
26
|
+
<svg
|
|
27
|
+
:style="{
|
|
28
|
+
height: height,
|
|
29
|
+
width: width,
|
|
30
|
+
}"
|
|
31
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
32
|
+
viewBox="0 0 24 24"
|
|
33
|
+
fill="currentColor">
|
|
34
|
+
<path
|
|
35
|
+
fill-rule="evenodd"
|
|
36
|
+
clip-rule="evenodd"
|
|
37
|
+
d="M11.293 3.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1-1.414 1.414L13 6.414V20a1 1 0 1 1-2 0V6.414l-5.293 5.293a1 1 0 0 1-1.414-1.414l7-7Z" />
|
|
38
|
+
</svg>
|
|
39
|
+
</template>
|