@energysage/es-ds-components 3.0.0-alpha.8 → 3.0.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/README.md +0 -3
- package/components/es-accordion-list.vue +29 -7
- package/components/es-breadcrumbs.vue +1 -1
- package/components/es-button.vue +13 -3
- package/components/es-carousel.vue +524 -69
- package/components/es-col.vue +5 -5
- package/components/es-collapse.vue +2 -2
- package/components/es-container.vue +10 -1
- package/components/es-cta-banner.vue +1 -1
- package/components/es-cta-card.vue +1 -1
- package/components/es-data-table-column.vue +20 -0
- package/components/es-data-table-simple.vue +1 -1
- package/components/es-data-table.vue +35 -86
- package/components/es-file-input.vue +8 -5
- package/components/es-footer.vue +33 -4
- package/components/es-modal.vue +1 -1
- package/components/es-nav-bar-account-menu.vue +4 -1
- package/components/es-nav-bar-featured-article.vue +1 -1
- package/components/es-nav-bar-link.vue +1 -1
- package/components/es-nav-bar-product-menu.vue +5 -1
- package/components/es-nav-bar-top-level-menu.vue +2 -1
- package/components/es-nav-bar-topic-menu.vue +4 -1
- package/components/es-nav-bar.vue +19 -4
- package/components/es-pagination.vue +1 -0
- package/components/es-reviews-io-card-carousel.vue +5 -1
- package/components/es-segmented-control.vue +237 -0
- package/components/es-tabs.vue +13 -3
- package/components/es-video.vue +4 -2
- package/components/es-view-more.vue +1 -0
- package/components/es-zip-code-form.vue +2 -2
- package/components/icon/arrow-clockwise.vue +1 -1
- package/components/icon/arrow-counter-clockwise.vue +1 -1
- package/components/icon/arrow-cycle.vue +1 -1
- package/components/icon/arrow-left.vue +1 -1
- package/components/icon/arrow-right.vue +1 -1
- package/components/icon/arrow-up.vue +1 -1
- package/components/icon/arrow.vue +1 -1
- package/components/icon/bank.vue +1 -1
- package/components/icon/bell.vue +1 -1
- package/components/icon/block.vue +1 -1
- package/components/icon/calculator.vue +1 -1
- package/components/icon/calendar.vue +1 -1
- package/components/icon/cart.vue +1 -1
- package/components/icon/ccpa-opt-out.vue +61 -0
- package/components/icon/chat-add.vue +1 -1
- package/components/icon/chat-approve.vue +1 -1
- package/components/icon/chat-bubble.vue +1 -1
- package/components/icon/chat-dots.vue +1 -1
- package/components/icon/check.vue +1 -1
- package/components/icon/chevron-down.vue +1 -1
- package/components/icon/chevron-horizontal.vue +1 -1
- package/components/icon/chevron-left.vue +1 -1
- package/components/icon/chevron-right.vue +1 -1
- package/components/icon/chevron-up.vue +1 -1
- package/components/icon/circle-alert.vue +1 -1
- package/components/icon/circle-check.vue +1 -1
- package/components/icon/circle-chevron-down.vue +1 -1
- package/components/icon/circle-chevron-left.vue +1 -1
- package/components/icon/circle-chevron-right.vue +1 -1
- package/components/icon/circle-chevron-up.vue +1 -1
- package/components/icon/circle-minus.vue +1 -1
- package/components/icon/circle-plus.vue +1 -1
- package/components/icon/circle-x.vue +1 -1
- package/components/icon/circle.vue +1 -1
- package/components/icon/clock.vue +1 -1
- package/components/icon/companies.vue +1 -1
- package/components/icon/contact-us.vue +1 -1
- package/components/icon/copy.vue +1 -1
- package/components/icon/credit-card.vue +1 -1
- package/components/icon/document.vue +1 -1
- package/components/icon/electricity-circle.vue +1 -1
- package/components/icon/envelope.vue +1 -1
- package/components/icon/es-leaf.vue +1 -1
- package/components/icon/eye.vue +1 -1
- package/components/icon/facebook.vue +1 -1
- package/components/icon/flag.vue +1 -1
- package/components/icon/folder.vue +1 -1
- package/components/icon/gift.vue +1 -1
- package/components/icon/hamburger.vue +1 -1
- package/components/icon/heart.vue +1 -1
- package/components/icon/image.vue +1 -1
- package/components/icon/info-blog-post.vue +1 -1
- package/components/icon/info.vue +1 -1
- package/components/icon/instagram.vue +1 -1
- package/components/icon/light-bulb.vue +1 -1
- package/components/icon/link-out.vue +1 -1
- package/components/icon/linkedin.vue +1 -1
- package/components/icon/location.vue +1 -1
- package/components/icon/lock-off.vue +1 -1
- package/components/icon/lock-on.vue +1 -1
- package/components/icon/marketplace.vue +1 -1
- package/components/icon/minus.vue +1 -1
- package/components/icon/open-envelope.vue +1 -1
- package/components/icon/paper.vue +1 -1
- package/components/icon/pencil.vue +1 -1
- package/components/icon/person-add.vue +1 -1
- package/components/icon/person-check.vue +1 -1
- package/components/icon/person-cross.vue +1 -1
- package/components/icon/person.vue +1 -1
- package/components/icon/phone.vue +1 -1
- package/components/icon/play.vue +1 -1
- package/components/icon/plus.vue +1 -1
- package/components/icon/settings-horizontal.vue +1 -1
- package/components/icon/settings-vertical.vue +1 -1
- package/components/icon/shield-with-check.vue +1 -1
- package/components/icon/shield.vue +1 -1
- package/components/icon/shopping-bag.vue +1 -1
- package/components/icon/sound-down.vue +1 -1
- package/components/icon/sound-off.vue +1 -1
- package/components/icon/sound-on.vue +1 -1
- package/components/icon/sound-up.vue +1 -1
- package/components/icon/star-empty.vue +1 -1
- package/components/icon/star-full.vue +1 -1
- package/components/icon/star-half.vue +1 -1
- package/components/icon/state-ak.vue +1 -1
- package/components/icon/state-al.vue +1 -1
- package/components/icon/state-ar.vue +1 -1
- package/components/icon/state-az.vue +1 -1
- package/components/icon/state-ca.vue +1 -1
- package/components/icon/state-co.vue +1 -1
- package/components/icon/state-ct.vue +1 -1
- package/components/icon/state-dc.vue +1 -1
- package/components/icon/state-de.vue +1 -1
- package/components/icon/state-fl.vue +1 -1
- package/components/icon/state-ga.vue +1 -1
- package/components/icon/state-hi.vue +1 -1
- package/components/icon/state-ia.vue +1 -1
- package/components/icon/state-id.vue +1 -1
- package/components/icon/state-il.vue +1 -1
- package/components/icon/state-in.vue +1 -1
- package/components/icon/state-ks.vue +1 -1
- package/components/icon/state-ky.vue +1 -1
- package/components/icon/state-la.vue +1 -1
- package/components/icon/state-ma.vue +1 -1
- package/components/icon/state-md.vue +1 -1
- package/components/icon/state-me.vue +1 -1
- package/components/icon/state-mi.vue +1 -1
- package/components/icon/state-mn.vue +1 -1
- package/components/icon/state-mo.vue +1 -1
- package/components/icon/state-ms.vue +1 -1
- package/components/icon/state-mt.vue +1 -1
- package/components/icon/state-nc.vue +1 -1
- package/components/icon/state-nd.vue +1 -1
- package/components/icon/state-ne.vue +1 -1
- package/components/icon/state-nh.vue +1 -1
- package/components/icon/state-nj.vue +1 -1
- package/components/icon/state-nm.vue +1 -1
- package/components/icon/state-nv.vue +1 -1
- package/components/icon/state-ny.vue +1 -1
- package/components/icon/state-oh.vue +1 -1
- package/components/icon/state-ok.vue +1 -1
- package/components/icon/state-or.vue +1 -1
- package/components/icon/state-pa.vue +1 -1
- package/components/icon/state-ri.vue +1 -1
- package/components/icon/state-sc.vue +1 -1
- package/components/icon/state-sd.vue +1 -1
- package/components/icon/state-tn.vue +1 -1
- package/components/icon/state-tx.vue +1 -1
- package/components/icon/state-ut.vue +1 -1
- package/components/icon/state-va.vue +1 -1
- package/components/icon/state-vt.vue +1 -1
- package/components/icon/state-wa.vue +1 -1
- package/components/icon/state-wi.vue +1 -1
- package/components/icon/state-wv.vue +1 -1
- package/components/icon/state-wy.vue +1 -1
- package/components/icon/thumbs-up.vue +1 -1
- package/components/icon/trash-can.vue +1 -1
- package/components/icon/twitter.vue +1 -1
- package/components/icon/verified.vue +1 -1
- package/components/icon/wifi.vue +1 -1
- package/components/icon/x.vue +1 -1
- package/components/icon/youtube.vue +1 -1
- package/composables/forms.ts +1 -1
- package/nuxt.config.ts +9 -0
- package/package.json +2 -1
- package/types/es-carousel.ts +12 -0
- package/types/index.ts +1 -0
- package/utils/forms.ts +120 -0
- package/utils/{get-es-footer-content.js → get-es-footer-content.ts} +1 -0
- package/{lib-utils/mime-type-finder.js → utils/mime-type-finder.ts} +2 -2
- package/utils/vuelidate-keys.ts +39 -0
- /package/utils/{get-es-nav-bar-account-content.js → get-es-nav-bar-account-content.ts} +0 -0
- /package/utils/{get-es-nav-bar-global-content.js → get-es-nav-bar-global-content.ts} +0 -0
|
@@ -19,7 +19,7 @@ const props = defineProps({
|
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
const userDeterminedState = ref(null);
|
|
22
|
+
const userDeterminedState: Ref<boolean | null> = ref(null);
|
|
23
23
|
|
|
24
24
|
// directly determines the expanded/collapsed state of the panel
|
|
25
25
|
const expanded = computed(() => {
|
|
@@ -34,7 +34,7 @@ const expanded = computed(() => {
|
|
|
34
34
|
return props.visible || model.value;
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
const onClick = ({ value }) => {
|
|
37
|
+
const onClick = ({ value }: { value: boolean }) => {
|
|
38
38
|
// save the state toggled by the user
|
|
39
39
|
// convert from "collapsed" semantics internal to the primevue panel
|
|
40
40
|
// to the "expanded" semantics exposed by this component
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface IProps {
|
|
3
|
+
fluid?: boolean;
|
|
4
|
+
}
|
|
5
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
6
|
+
fluid: false,
|
|
7
|
+
});
|
|
8
|
+
</script>
|
|
9
|
+
|
|
1
10
|
<template>
|
|
2
|
-
<div class="container">
|
|
11
|
+
<div :class="props.fluid ? 'container-fluid' : 'container'">
|
|
3
12
|
<slot />
|
|
4
13
|
</div>
|
|
5
14
|
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Column from 'primevue/column';
|
|
3
|
+
import type { ComponentOptionsMixin } from 'vue';
|
|
4
|
+
|
|
5
|
+
// magic solution for wrapping Column successfully
|
|
6
|
+
// https://www.reddit.com/r/vuejs/comments/1g17u7u/comment/lvjv91h/
|
|
7
|
+
defineOptions({
|
|
8
|
+
name: 'Column',
|
|
9
|
+
extends: (Column as unknown as ComponentOptionsMixin).extends,
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<!-- eslint-disable vue/valid-template-root -->
|
|
15
|
+
<template>
|
|
16
|
+
<!--
|
|
17
|
+
While this file needs to exist to keep Nuxt happy, it doesn't actually do anything.
|
|
18
|
+
Instances of es-data-table-column are placed inside es-data-table, and es-data-table handles their display.
|
|
19
|
+
-->
|
|
20
|
+
</template>
|
|
@@ -19,7 +19,7 @@ const props = defineProps({
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
const isSingleCol = computed(() => !props.fields);
|
|
22
|
-
const computedItems = computed(() => {
|
|
22
|
+
const computedItems: ComputedRef<any[]> = computed(() => {
|
|
23
23
|
if (!props.items.length && !useSlots().default) {
|
|
24
24
|
throw new Error('Neither items prop nor slot content is defined.');
|
|
25
25
|
}
|
|
@@ -1,74 +1,38 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import DataTable from 'primevue/datatable';
|
|
3
|
-
import Column from 'primevue/column';
|
|
4
3
|
|
|
5
4
|
const props = defineProps({
|
|
6
|
-
fields: {
|
|
7
|
-
type: Array,
|
|
8
|
-
default: null,
|
|
9
|
-
},
|
|
10
5
|
items: {
|
|
11
6
|
type: Array,
|
|
12
7
|
required: true,
|
|
13
8
|
},
|
|
14
|
-
|
|
9
|
+
scrollable: {
|
|
15
10
|
type: Boolean,
|
|
16
11
|
default: false,
|
|
17
12
|
},
|
|
18
|
-
|
|
19
|
-
type:
|
|
20
|
-
default:
|
|
13
|
+
scrollHeight: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: '',
|
|
21
16
|
},
|
|
22
17
|
});
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// Code is taken from BootStrap Vue to implemnt <b-table> feature that automatically
|
|
32
|
-
// samples the first row to extract field name and "humanize" by converting kebab-case,
|
|
33
|
-
// snake_case, and camelCase to individual words and capitalizes each word.
|
|
34
|
-
// Doc: https://bootstrap-vue.org/docs/components/table
|
|
35
|
-
// Source Code: https://github.com/bootstrap-vue/bootstrap-vue/blob/5173dd19f6f46dc9d125cd7233fb59ccd2ef9296/src/utils/string.js#L30
|
|
36
|
-
const startCase = (str: string) =>
|
|
37
|
-
str
|
|
38
|
-
.replace(/_/g, ' ')
|
|
39
|
-
.replace(/([a-z])([A-Z])/g, (_, $1, $2) => `${$1} ${$2}`)
|
|
40
|
-
.replace(/(\s|^)(\w)/g, (_, $1, $2) => $1 + $2.toUpperCase());
|
|
41
|
-
|
|
42
|
-
const label = (col) => {
|
|
43
|
-
if (typeof col === 'string') {
|
|
44
|
-
return startCase(col);
|
|
19
|
+
// avoid passing in default scrollHeight value when scrollable is false
|
|
20
|
+
// otherwise it will limit the height when we don't want it to
|
|
21
|
+
const defaultScrollHeight = computed(() => {
|
|
22
|
+
if (props.scrollable) {
|
|
23
|
+
return props.scrollHeight || '305px';
|
|
45
24
|
}
|
|
46
|
-
return col?.label ? col.label : startCase(col?.key);
|
|
47
|
-
};
|
|
48
25
|
|
|
49
|
-
const columns = computed(() => {
|
|
50
|
-
if (props.fields) {
|
|
51
|
-
return props.fields;
|
|
52
|
-
}
|
|
53
|
-
return Object.keys(props.items[0]);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const scrollHeight = computed(() => {
|
|
57
|
-
if (props.stickyHeader) {
|
|
58
|
-
if (typeof props.stickyHeader === 'string') {
|
|
59
|
-
return props.stickyHeader;
|
|
60
|
-
}
|
|
61
|
-
return '300px';
|
|
62
|
-
}
|
|
63
26
|
return '';
|
|
64
27
|
});
|
|
65
28
|
</script>
|
|
29
|
+
|
|
66
30
|
<template>
|
|
67
31
|
<data-table
|
|
68
|
-
|
|
32
|
+
class="border table__data-table table-spacing table"
|
|
69
33
|
:pt="{
|
|
70
34
|
table: {
|
|
71
|
-
class: 'font-size-75 font-size-md-100',
|
|
35
|
+
class: 'font-size-75 font-size-md-100 w-100',
|
|
72
36
|
style: 'border-collapse: separate; border-spacing: 0;',
|
|
73
37
|
},
|
|
74
38
|
wrapper: {
|
|
@@ -78,49 +42,34 @@ const scrollHeight = computed(() => {
|
|
|
78
42
|
style: 'top: 0px; z-index: 2',
|
|
79
43
|
},
|
|
80
44
|
}"
|
|
81
|
-
:
|
|
82
|
-
|
|
83
|
-
:
|
|
84
|
-
<
|
|
85
|
-
v-for="(col, index) of columns"
|
|
86
|
-
:key="col?.key ? col.key : col"
|
|
87
|
-
:field="col?.key ? col.key : col"
|
|
88
|
-
:header="label(col)"
|
|
89
|
-
:sortable="col?.sortable"
|
|
90
|
-
:frozen="checkFrozenRow(index)"
|
|
91
|
-
align-frozen="left"
|
|
92
|
-
:pt="{
|
|
93
|
-
sortIcon: {
|
|
94
|
-
style: 'display: none',
|
|
95
|
-
},
|
|
96
|
-
headerCell: (options) => ({
|
|
97
|
-
class: [
|
|
98
|
-
{
|
|
99
|
-
sortable: options.props.sortable,
|
|
100
|
-
stickyFirstColHeader: options.props.frozen,
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
}),
|
|
104
|
-
bodyCell: (options) => ({
|
|
105
|
-
class: [
|
|
106
|
-
{
|
|
107
|
-
stickyFirstCol: options.props.frozen,
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
}),
|
|
111
|
-
}">
|
|
112
|
-
</column>
|
|
45
|
+
:scrollable="scrollable"
|
|
46
|
+
:scroll-height="defaultScrollHeight"
|
|
47
|
+
:value="items">
|
|
48
|
+
<slot />
|
|
113
49
|
</data-table>
|
|
114
50
|
</template>
|
|
51
|
+
|
|
115
52
|
<style scoped lang="scss">
|
|
116
|
-
:deep(
|
|
117
|
-
|
|
53
|
+
:deep(th[data-p-sortable-column='true']) {
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
user-select: none;
|
|
56
|
+
|
|
57
|
+
div[data-pc-section='headercontent'] {
|
|
58
|
+
align-items: center;
|
|
59
|
+
display: flex;
|
|
60
|
+
}
|
|
61
|
+
span[data-pc-section='sort'] {
|
|
62
|
+
display: inline-block;
|
|
63
|
+
margin-left: 0.5rem;
|
|
64
|
+
}
|
|
118
65
|
}
|
|
119
|
-
|
|
66
|
+
|
|
67
|
+
:deep(td[data-p-frozen-column='true']),
|
|
68
|
+
:deep(th[data-p-frozen-column='true']) {
|
|
120
69
|
position: sticky !important;
|
|
121
|
-
background: inherit;
|
|
122
70
|
}
|
|
123
|
-
|
|
124
|
-
|
|
71
|
+
|
|
72
|
+
:deep(td[data-p-frozen-column='true']) {
|
|
73
|
+
background: inherit;
|
|
125
74
|
}
|
|
126
75
|
</style>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import findMimeType, { mimeTypes } from '../lib-utils/mime-type-finder';
|
|
3
|
-
|
|
4
2
|
type UploadInfo = {
|
|
5
3
|
name: string;
|
|
6
4
|
uploadUrl: string;
|
|
@@ -29,7 +27,7 @@ const props = defineProps({
|
|
|
29
27
|
type: Array,
|
|
30
28
|
default: () => [],
|
|
31
29
|
required: true,
|
|
32
|
-
validator(fileTypes) {
|
|
30
|
+
validator(fileTypes: any[]) {
|
|
33
31
|
return fileTypes.every((fileType) => mimeTypes.includes(fileType));
|
|
34
32
|
},
|
|
35
33
|
},
|
|
@@ -101,6 +99,7 @@ async function verifyMimeType(file: File) {
|
|
|
101
99
|
return new Promise((resolve, reject) => {
|
|
102
100
|
const fileReader = new FileReader();
|
|
103
101
|
fileReader.onload = (evt) => {
|
|
102
|
+
// @ts-expect-error not sure
|
|
104
103
|
const uint = new Uint8Array(evt.target.result);
|
|
105
104
|
const bytes: string[] = [];
|
|
106
105
|
uint.forEach((byte) => {
|
|
@@ -198,8 +197,11 @@ async function verifyFiles(files: Array<File>) {
|
|
|
198
197
|
const correctlyNamedFiles = removeSpaceFromFileNames(correctlySizedFiles);
|
|
199
198
|
|
|
200
199
|
// Make sure the file is the correct mime type
|
|
201
|
-
let newValidFiles = await Promise.allSettled(
|
|
200
|
+
let newValidFiles = (await Promise.allSettled(
|
|
201
|
+
correctlyNamedFiles.map(async (file) => verifyMimeType(file)),
|
|
202
|
+
)) as unknown as File[];
|
|
202
203
|
// Filter out undefined values and "rejected"
|
|
204
|
+
// @ts-expect-error basically we're filtering out the non-Files here
|
|
203
205
|
newValidFiles = newValidFiles.filter((file) => file && file.status === 'fulfilled').map((file) => file.value);
|
|
204
206
|
|
|
205
207
|
// If the new file with name already exists in the current files
|
|
@@ -240,7 +242,7 @@ async function onFileChanged($event: Event) {
|
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
244
|
|
|
243
|
-
const onDrop = (event) => {
|
|
245
|
+
const onDrop = (event: any) => {
|
|
244
246
|
// The user has dropped files onto the component. We have to apply the same logic as if they had
|
|
245
247
|
// selected the files from the file picker which limits the file types to the ones specified in the
|
|
246
248
|
// fileTypes prop.
|
|
@@ -262,6 +264,7 @@ const onDrop = (event) => {
|
|
|
262
264
|
|
|
263
265
|
const openFilePicker = () => {
|
|
264
266
|
if (fileInput.value) {
|
|
267
|
+
// @ts-expect-error not sure
|
|
265
268
|
fileInput.value.click();
|
|
266
269
|
}
|
|
267
270
|
};
|
package/components/es-footer.vue
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
import IconFacebook from './icon/facebook.vue';
|
|
3
3
|
import IconInstagram from './icon/instagram.vue';
|
|
4
4
|
import IconLinkedin from './icon/linkedin.vue';
|
|
@@ -25,6 +25,25 @@ export default {
|
|
|
25
25
|
return this.content.copyrightText.replace('{currentYear}', new Date().getFullYear());
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
|
+
mounted() {
|
|
29
|
+
// https://energysage.atlassian.net/wiki/spaces/FG/pages/1427865649/One-trust+Consent+Initialization+and+GTM
|
|
30
|
+
window.addEventListener('OneTrustLoadedCb', () => {
|
|
31
|
+
(window as any).OneTrust.OnConsentChanged(() => {
|
|
32
|
+
// OneTrust modal should modify cookie values, a hard-refresh will
|
|
33
|
+
// trigger re-loading GTM with updated cookie values, which in turn
|
|
34
|
+
// will only fire tags aligned with new preferences
|
|
35
|
+
window.location.reload();
|
|
36
|
+
return false;
|
|
37
|
+
});
|
|
38
|
+
document.querySelectorAll('.toggle-info-display').forEach((elem) => {
|
|
39
|
+
// Function closure to ensure event only fires on one elem
|
|
40
|
+
elem.addEventListener('click', (e) => {
|
|
41
|
+
e.stopImmediatePropagation();
|
|
42
|
+
(window as any).OneTrust.ToggleInfoDisplay();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
},
|
|
28
47
|
};
|
|
29
48
|
</script>
|
|
30
49
|
|
|
@@ -120,16 +139,26 @@ export default {
|
|
|
120
139
|
<!-- Trademark Info -->
|
|
121
140
|
<!-- Legal -->
|
|
122
141
|
<hr class="border-top border-blue-500 m-0" />
|
|
123
|
-
<div class="row
|
|
142
|
+
<div class="row pt-100">
|
|
124
143
|
<div
|
|
125
144
|
v-for="link in content.legalLinks"
|
|
126
145
|
:key="link.text"
|
|
127
|
-
class="col col-6 col-lg-auto
|
|
146
|
+
class="col col-6 col-lg-auto mt-25 mb-50 pr-lg-300">
|
|
128
147
|
<es-nav-bar-link
|
|
148
|
+
v-if="link.url"
|
|
129
149
|
:href="link.url"
|
|
130
|
-
class="text-reset font-weight-normal">
|
|
150
|
+
class="text-reset font-weight-normal font-size-75 font-size-md-50 font-weight-md-normal">
|
|
131
151
|
{{ link.text }}
|
|
132
152
|
</es-nav-bar-link>
|
|
153
|
+
<div v-else>
|
|
154
|
+
<icon-ccpa-opt-out />
|
|
155
|
+
<es-button
|
|
156
|
+
inline
|
|
157
|
+
class="toggle-info-display text-reset font-weight-normal font-size-75 font-size-md-50 font-weight-md-normal ml-1"
|
|
158
|
+
variant="link">
|
|
159
|
+
{{ link.text }}
|
|
160
|
+
</es-button>
|
|
161
|
+
</div>
|
|
133
162
|
</div>
|
|
134
163
|
</div>
|
|
135
164
|
<!-- Legal -->
|
package/components/es-modal.vue
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
export default {
|
|
3
3
|
name: 'EsNavBarAccountMenu',
|
|
4
4
|
props: {
|
|
@@ -30,13 +30,16 @@ export default {
|
|
|
30
30
|
<ul
|
|
31
31
|
class="loggedIn dropdown-menu account-menu rounded mt-0 py-100 list-unstyled"
|
|
32
32
|
style="display: none">
|
|
33
|
+
<!-- @vue-expect-error -->
|
|
33
34
|
<li
|
|
34
35
|
v-for="item in authItems"
|
|
35
36
|
:key="item.name">
|
|
37
|
+
<!-- @vue-expect-error -->
|
|
36
38
|
<es-nav-bar-link
|
|
37
39
|
class="dropdown-item nav-link"
|
|
38
40
|
:href="item.link">
|
|
39
41
|
<span class="mx-50">
|
|
42
|
+
<!-- @vue-expect-error -->
|
|
40
43
|
{{ item.name }}
|
|
41
44
|
</span>
|
|
42
45
|
</es-nav-bar-link>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
2
2
|
// specific workaround for getting a reference to an auto-imported but not globally registered
|
|
3
3
|
// component like NuxtLink, so that it can be used in a <component :is=""> context.
|
|
4
4
|
// this resolves to an import statement, according to:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
export default {
|
|
3
3
|
name: 'EsNavBarProductMenu',
|
|
4
4
|
props: {
|
|
@@ -141,14 +141,17 @@ export default {
|
|
|
141
141
|
<div class="col-2" />
|
|
142
142
|
</li>
|
|
143
143
|
<!-- subnav items -->
|
|
144
|
+
<!-- @vue-expect-error -->
|
|
144
145
|
<li
|
|
145
146
|
v-for="item in items"
|
|
146
147
|
:key="item.name">
|
|
148
|
+
<!-- @vue-expect-error -->
|
|
147
149
|
<es-nav-bar-link
|
|
148
150
|
class="dropdown-item nav-item nav-item-border-mobile nav-link align-items-center d-flex px-lg-100 py-lg-50 product-menu-link"
|
|
149
151
|
:class="{ 'font-weight-bold': item.emphasize }"
|
|
150
152
|
:href="item.link"
|
|
151
153
|
:target="item.newTab ? '_blank' : null">
|
|
154
|
+
<!-- @vue-expect-error -->
|
|
152
155
|
{{ item.name }}
|
|
153
156
|
</es-nav-bar-link>
|
|
154
157
|
</li>
|
|
@@ -183,6 +186,7 @@ export default {
|
|
|
183
186
|
<es-row
|
|
184
187
|
tag="ul"
|
|
185
188
|
class="d-block d-lg-flex list-unstyled">
|
|
189
|
+
<!-- @vue-expect-error -->
|
|
186
190
|
<es-nav-bar-topic-menu
|
|
187
191
|
v-for="topic in topics"
|
|
188
192
|
:key="topic.name"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
export default {
|
|
3
3
|
name: 'EsNavBarTopLevelMenu',
|
|
4
4
|
props: {
|
|
@@ -154,6 +154,7 @@ export default {
|
|
|
154
154
|
</div>
|
|
155
155
|
<div class="col-2" />
|
|
156
156
|
</li>
|
|
157
|
+
<!-- @vue-expect-error -->
|
|
157
158
|
<es-nav-bar-topic-menu
|
|
158
159
|
v-for="topic in topics"
|
|
159
160
|
:key="topic.name"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
export default {
|
|
3
3
|
name: 'EsNavBarTopicMenu',
|
|
4
4
|
props: {
|
|
@@ -158,14 +158,17 @@ export default {
|
|
|
158
158
|
</div>
|
|
159
159
|
<div class="col-2"> </div>
|
|
160
160
|
</li>
|
|
161
|
+
<!-- @vue-expect-error -->
|
|
161
162
|
<li
|
|
162
163
|
v-for="item in items"
|
|
163
164
|
:key="item.name">
|
|
165
|
+
<!-- @vue-expect-error -->
|
|
164
166
|
<es-nav-bar-link
|
|
165
167
|
class="dropdown-item nav-item nav-item-border-mobile nav-link d-flex align-items-center ml-lg-0 px-lg-0 py-lg-50"
|
|
166
168
|
:class="{ 'font-weight-bold': item.emphasize }"
|
|
167
169
|
:href="item.link"
|
|
168
170
|
:target="item.newTab ? '_blank' : null">
|
|
171
|
+
<!-- @vue-expect-error -->
|
|
169
172
|
{{ item.name }}
|
|
170
173
|
</es-nav-bar-link>
|
|
171
174
|
</li>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
export default {
|
|
3
3
|
name: 'EsNavBar',
|
|
4
4
|
props: {
|
|
@@ -18,6 +18,7 @@ export default {
|
|
|
18
18
|
function uncheck_menus() {
|
|
19
19
|
document.querySelectorAll('.menu-checkbox').forEach((element) => {
|
|
20
20
|
const checkbox = element;
|
|
21
|
+
// @ts-expect-error legacy code
|
|
21
22
|
checkbox.checked = false;
|
|
22
23
|
});
|
|
23
24
|
}
|
|
@@ -26,10 +27,12 @@ export default {
|
|
|
26
27
|
const overlay = document.querySelector('.content-overlay');
|
|
27
28
|
|
|
28
29
|
// Function to show/hide overlay
|
|
29
|
-
function show_overlay(overlay_visible) {
|
|
30
|
+
function show_overlay(overlay_visible: boolean) {
|
|
30
31
|
if (overlay_visible) {
|
|
32
|
+
// @ts-expect-error legacy code
|
|
31
33
|
overlay.classList.add('show');
|
|
32
34
|
} else {
|
|
35
|
+
// @ts-expect-error legacy code
|
|
33
36
|
overlay.classList.remove('show');
|
|
34
37
|
}
|
|
35
38
|
}
|
|
@@ -53,12 +56,14 @@ export default {
|
|
|
53
56
|
|
|
54
57
|
// Collapse all open menus on window resize
|
|
55
58
|
window.addEventListener('resize', () => {
|
|
59
|
+
// @ts-expect-error legacy code
|
|
56
60
|
if (mainMenuCheckbox.checked || accountMenuCheckbox.checked) {
|
|
57
61
|
collapse_mobile_menus();
|
|
58
62
|
}
|
|
59
63
|
});
|
|
60
64
|
|
|
61
65
|
// Collapse all open menus on overlay click
|
|
66
|
+
// @ts-expect-error legacy code
|
|
62
67
|
overlay.addEventListener('click', () => {
|
|
63
68
|
collapse_mobile_menus();
|
|
64
69
|
});
|
|
@@ -74,13 +79,16 @@ export default {
|
|
|
74
79
|
show_overlay(true);
|
|
75
80
|
});
|
|
76
81
|
element.addEventListener('mouseout', () => {
|
|
82
|
+
// @ts-expect-error legacy code
|
|
77
83
|
// Hide overlay on mouseout on desktop not mobile
|
|
78
84
|
show_overlay(mainMenuCheckbox.checked || accountMenuCheckbox.checked);
|
|
79
85
|
});
|
|
80
86
|
});
|
|
81
87
|
|
|
88
|
+
// @ts-expect-error legacy code
|
|
82
89
|
// Toggle menu display on main menu open/close
|
|
83
90
|
mainMenuCheckbox.addEventListener('change', (event) => {
|
|
91
|
+
// @ts-expect-error legacy code
|
|
84
92
|
if (event.target.checked) {
|
|
85
93
|
show_mobile_menus();
|
|
86
94
|
} else {
|
|
@@ -88,8 +96,10 @@ export default {
|
|
|
88
96
|
}
|
|
89
97
|
});
|
|
90
98
|
|
|
99
|
+
// @ts-expect-error legacy code
|
|
91
100
|
// Toggle menu display on account menu open/close
|
|
92
101
|
accountMenuCheckbox.addEventListener('change', (event) => {
|
|
102
|
+
// @ts-expect-error legacy code
|
|
93
103
|
if (event.target.checked) {
|
|
94
104
|
show_mobile_menus();
|
|
95
105
|
} else {
|
|
@@ -98,22 +108,26 @@ export default {
|
|
|
98
108
|
});
|
|
99
109
|
|
|
100
110
|
// get logged in/out state and display appropriate menu
|
|
101
|
-
const menuDisplay = ({ loggedOut }) => {
|
|
111
|
+
const menuDisplay = ({ loggedOut }: { loggedOut: boolean }) => {
|
|
102
112
|
if (loggedOut) {
|
|
103
113
|
// logged out so allow loggedOut menu and the compare buttons to be visible
|
|
104
114
|
document.querySelectorAll('.nav-es-container .loggedOut').forEach((element) => {
|
|
115
|
+
// @ts-expect-error legacy code
|
|
105
116
|
// eslint-disable-next-line no-param-reassign
|
|
106
117
|
element.style.display = null;
|
|
107
118
|
});
|
|
108
119
|
} else {
|
|
109
120
|
// logged in so allow logged in menu to be visible, and show name with appropriate layout
|
|
110
121
|
document.querySelectorAll('.nav-es-container .loggedIn').forEach((element) => {
|
|
122
|
+
// @ts-expect-error legacy code
|
|
111
123
|
// eslint-disable-next-line no-param-reassign
|
|
112
124
|
element.style.display = null;
|
|
113
125
|
});
|
|
126
|
+
// @ts-expect-error legacy code
|
|
114
127
|
document.querySelector('.nav-es-container .icon-dropdown .dropdown-toggle').style.display = 'flex';
|
|
115
128
|
const selector = '.nav-es-container .icon-dropdown .dropdown-toggle .first-name';
|
|
116
129
|
document.querySelectorAll(selector).forEach((element) => {
|
|
130
|
+
// @ts-expect-error legacy code
|
|
117
131
|
// eslint-disable-next-line no-param-reassign
|
|
118
132
|
element.style.display = 'block';
|
|
119
133
|
});
|
|
@@ -153,7 +167,7 @@ export default {
|
|
|
153
167
|
};
|
|
154
168
|
|
|
155
169
|
// set up callback for sticky nav intersection observer
|
|
156
|
-
const intersectionCallback = (entries) => {
|
|
170
|
+
const intersectionCallback = (entries: IntersectionObserverEntry[]) => {
|
|
157
171
|
entries.forEach((entry) => {
|
|
158
172
|
if (entry.isIntersecting) {
|
|
159
173
|
entry.target.classList.remove('scrolled');
|
|
@@ -167,6 +181,7 @@ export default {
|
|
|
167
181
|
// https://www.smashingmagazine.com/2021/07/dynamic-header-intersection-observer/
|
|
168
182
|
const observer = new IntersectionObserver(intersectionCallback, intersectionOptions);
|
|
169
183
|
const targetEl = document.querySelector('#nav-main');
|
|
184
|
+
// @ts-expect-error legacy code
|
|
170
185
|
observer.observe(targetEl);
|
|
171
186
|
|
|
172
187
|
// CUSTOM GLOBAL-NAV SCRIPT ENDS
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
2
2
|
useHead({
|
|
3
3
|
link: [
|
|
4
4
|
{
|
|
@@ -34,7 +34,9 @@ onBeforeUnmount(() => {
|
|
|
34
34
|
|
|
35
35
|
const initializeWidget = () => {
|
|
36
36
|
// if the Reviews.io script loaded before
|
|
37
|
+
// @ts-expect-error global-scoped ReviewsIO stuff
|
|
37
38
|
if (typeof window !== 'undefined' && window.carouselInlineWidget) {
|
|
39
|
+
// @ts-expect-error global-scoped ReviewsIO stuff
|
|
38
40
|
// eslint-disable-next-line no-new, new-cap
|
|
39
41
|
new window.carouselInlineWidget('reviewsio-carousel-widget', {
|
|
40
42
|
/* Your REVIEWS.io account ID: */
|
|
@@ -256,11 +258,13 @@ onMounted(async () => {
|
|
|
256
258
|
// if we're server-side, get out
|
|
257
259
|
if (typeof window === 'undefined') return;
|
|
258
260
|
|
|
261
|
+
// @ts-expect-error global-scoped ReviewsIO stuff
|
|
259
262
|
if (window.carouselInlineWidget) {
|
|
260
263
|
// if the Reviews.io script has loaded, initialize the widget
|
|
261
264
|
initializeWidget();
|
|
262
265
|
} else {
|
|
263
266
|
// if the Reviews.io script has not loaded, set its callback function to trigger widget initialization
|
|
267
|
+
// @ts-expect-error global-scoped ReviewsIO stuff
|
|
264
268
|
window.carouselInlineWidgetCallback = () => {
|
|
265
269
|
initializeWidget();
|
|
266
270
|
};
|