@energysage/es-ds-components 3.0.0-alpha.8 → 3.0.0-alpha.9

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.
Files changed (174) hide show
  1. package/components/es-accordion-list.vue +6 -1
  2. package/components/es-breadcrumbs.vue +1 -1
  3. package/components/es-button.vue +13 -3
  4. package/components/es-collapse.vue +2 -2
  5. package/components/es-cta-banner.vue +1 -1
  6. package/components/es-cta-card.vue +1 -1
  7. package/components/es-data-table-simple.vue +1 -1
  8. package/components/es-data-table.vue +4 -2
  9. package/components/es-file-input.vue +8 -5
  10. package/components/es-footer.vue +1 -1
  11. package/components/es-modal.vue +1 -1
  12. package/components/es-nav-bar-account-menu.vue +4 -1
  13. package/components/es-nav-bar-featured-article.vue +1 -1
  14. package/components/es-nav-bar-link.vue +1 -1
  15. package/components/es-nav-bar-product-menu.vue +5 -1
  16. package/components/es-nav-bar-top-level-menu.vue +2 -1
  17. package/components/es-nav-bar-topic-menu.vue +4 -1
  18. package/components/es-nav-bar.vue +19 -4
  19. package/components/es-pagination.vue +1 -0
  20. package/components/es-reviews-io-card-carousel.vue +5 -1
  21. package/components/es-tabs.vue +5 -2
  22. package/components/es-video.vue +4 -2
  23. package/components/es-view-more.vue +1 -0
  24. package/components/es-zip-code-form.vue +2 -2
  25. package/components/icon/arrow-clockwise.vue +1 -1
  26. package/components/icon/arrow-counter-clockwise.vue +1 -1
  27. package/components/icon/arrow-cycle.vue +1 -1
  28. package/components/icon/arrow-left.vue +1 -1
  29. package/components/icon/arrow-right.vue +1 -1
  30. package/components/icon/arrow-up.vue +1 -1
  31. package/components/icon/arrow.vue +1 -1
  32. package/components/icon/bank.vue +1 -1
  33. package/components/icon/bell.vue +1 -1
  34. package/components/icon/block.vue +1 -1
  35. package/components/icon/calculator.vue +1 -1
  36. package/components/icon/calendar.vue +1 -1
  37. package/components/icon/cart.vue +1 -1
  38. package/components/icon/chat-add.vue +1 -1
  39. package/components/icon/chat-approve.vue +1 -1
  40. package/components/icon/chat-bubble.vue +1 -1
  41. package/components/icon/chat-dots.vue +1 -1
  42. package/components/icon/check.vue +1 -1
  43. package/components/icon/chevron-down.vue +1 -1
  44. package/components/icon/chevron-horizontal.vue +1 -1
  45. package/components/icon/chevron-left.vue +1 -1
  46. package/components/icon/chevron-right.vue +1 -1
  47. package/components/icon/chevron-up.vue +1 -1
  48. package/components/icon/circle-alert.vue +1 -1
  49. package/components/icon/circle-check.vue +1 -1
  50. package/components/icon/circle-chevron-down.vue +1 -1
  51. package/components/icon/circle-chevron-left.vue +1 -1
  52. package/components/icon/circle-chevron-right.vue +1 -1
  53. package/components/icon/circle-chevron-up.vue +1 -1
  54. package/components/icon/circle-minus.vue +1 -1
  55. package/components/icon/circle-plus.vue +1 -1
  56. package/components/icon/circle-x.vue +1 -1
  57. package/components/icon/circle.vue +1 -1
  58. package/components/icon/clock.vue +1 -1
  59. package/components/icon/companies.vue +1 -1
  60. package/components/icon/contact-us.vue +1 -1
  61. package/components/icon/copy.vue +1 -1
  62. package/components/icon/credit-card.vue +1 -1
  63. package/components/icon/document.vue +1 -1
  64. package/components/icon/electricity-circle.vue +1 -1
  65. package/components/icon/envelope.vue +1 -1
  66. package/components/icon/es-leaf.vue +1 -1
  67. package/components/icon/eye.vue +1 -1
  68. package/components/icon/facebook.vue +1 -1
  69. package/components/icon/flag.vue +1 -1
  70. package/components/icon/folder.vue +1 -1
  71. package/components/icon/gift.vue +1 -1
  72. package/components/icon/hamburger.vue +1 -1
  73. package/components/icon/heart.vue +1 -1
  74. package/components/icon/image.vue +1 -1
  75. package/components/icon/info-blog-post.vue +1 -1
  76. package/components/icon/info.vue +1 -1
  77. package/components/icon/instagram.vue +1 -1
  78. package/components/icon/light-bulb.vue +1 -1
  79. package/components/icon/link-out.vue +1 -1
  80. package/components/icon/linkedin.vue +1 -1
  81. package/components/icon/location.vue +1 -1
  82. package/components/icon/lock-off.vue +1 -1
  83. package/components/icon/lock-on.vue +1 -1
  84. package/components/icon/marketplace.vue +1 -1
  85. package/components/icon/minus.vue +1 -1
  86. package/components/icon/open-envelope.vue +1 -1
  87. package/components/icon/paper.vue +1 -1
  88. package/components/icon/pencil.vue +1 -1
  89. package/components/icon/person-add.vue +1 -1
  90. package/components/icon/person-check.vue +1 -1
  91. package/components/icon/person-cross.vue +1 -1
  92. package/components/icon/person.vue +1 -1
  93. package/components/icon/phone.vue +1 -1
  94. package/components/icon/play.vue +1 -1
  95. package/components/icon/plus.vue +1 -1
  96. package/components/icon/settings-horizontal.vue +1 -1
  97. package/components/icon/settings-vertical.vue +1 -1
  98. package/components/icon/shield-with-check.vue +1 -1
  99. package/components/icon/shield.vue +1 -1
  100. package/components/icon/shopping-bag.vue +1 -1
  101. package/components/icon/sound-down.vue +1 -1
  102. package/components/icon/sound-off.vue +1 -1
  103. package/components/icon/sound-on.vue +1 -1
  104. package/components/icon/sound-up.vue +1 -1
  105. package/components/icon/star-empty.vue +1 -1
  106. package/components/icon/star-full.vue +1 -1
  107. package/components/icon/star-half.vue +1 -1
  108. package/components/icon/state-ak.vue +1 -1
  109. package/components/icon/state-al.vue +1 -1
  110. package/components/icon/state-ar.vue +1 -1
  111. package/components/icon/state-az.vue +1 -1
  112. package/components/icon/state-ca.vue +1 -1
  113. package/components/icon/state-co.vue +1 -1
  114. package/components/icon/state-ct.vue +1 -1
  115. package/components/icon/state-dc.vue +1 -1
  116. package/components/icon/state-de.vue +1 -1
  117. package/components/icon/state-fl.vue +1 -1
  118. package/components/icon/state-ga.vue +1 -1
  119. package/components/icon/state-hi.vue +1 -1
  120. package/components/icon/state-ia.vue +1 -1
  121. package/components/icon/state-id.vue +1 -1
  122. package/components/icon/state-il.vue +1 -1
  123. package/components/icon/state-in.vue +1 -1
  124. package/components/icon/state-ks.vue +1 -1
  125. package/components/icon/state-ky.vue +1 -1
  126. package/components/icon/state-la.vue +1 -1
  127. package/components/icon/state-ma.vue +1 -1
  128. package/components/icon/state-md.vue +1 -1
  129. package/components/icon/state-me.vue +1 -1
  130. package/components/icon/state-mi.vue +1 -1
  131. package/components/icon/state-mn.vue +1 -1
  132. package/components/icon/state-mo.vue +1 -1
  133. package/components/icon/state-ms.vue +1 -1
  134. package/components/icon/state-mt.vue +1 -1
  135. package/components/icon/state-nc.vue +1 -1
  136. package/components/icon/state-nd.vue +1 -1
  137. package/components/icon/state-ne.vue +1 -1
  138. package/components/icon/state-nh.vue +1 -1
  139. package/components/icon/state-nj.vue +1 -1
  140. package/components/icon/state-nm.vue +1 -1
  141. package/components/icon/state-nv.vue +1 -1
  142. package/components/icon/state-ny.vue +1 -1
  143. package/components/icon/state-oh.vue +1 -1
  144. package/components/icon/state-ok.vue +1 -1
  145. package/components/icon/state-or.vue +1 -1
  146. package/components/icon/state-pa.vue +1 -1
  147. package/components/icon/state-ri.vue +1 -1
  148. package/components/icon/state-sc.vue +1 -1
  149. package/components/icon/state-sd.vue +1 -1
  150. package/components/icon/state-tn.vue +1 -1
  151. package/components/icon/state-tx.vue +1 -1
  152. package/components/icon/state-ut.vue +1 -1
  153. package/components/icon/state-va.vue +1 -1
  154. package/components/icon/state-vt.vue +1 -1
  155. package/components/icon/state-wa.vue +1 -1
  156. package/components/icon/state-wi.vue +1 -1
  157. package/components/icon/state-wv.vue +1 -1
  158. package/components/icon/state-wy.vue +1 -1
  159. package/components/icon/thumbs-up.vue +1 -1
  160. package/components/icon/trash-can.vue +1 -1
  161. package/components/icon/twitter.vue +1 -1
  162. package/components/icon/verified.vue +1 -1
  163. package/components/icon/wifi.vue +1 -1
  164. package/components/icon/x.vue +1 -1
  165. package/components/icon/youtube.vue +1 -1
  166. package/composables/forms.ts +1 -1
  167. package/nuxt.config.ts +3 -0
  168. package/package.json +2 -1
  169. package/utils/forms.ts +120 -0
  170. package/{lib-utils/mime-type-finder.js → utils/mime-type-finder.ts} +2 -2
  171. package/utils/vuelidate-keys.ts +39 -0
  172. /package/utils/{get-es-footer-content.js → get-es-footer-content.ts} +0 -0
  173. /package/utils/{get-es-nav-bar-account-content.js → get-es-nav-bar-account-content.ts} +0 -0
  174. /package/utils/{get-es-nav-bar-global-content.js → get-es-nav-bar-global-content.ts} +0 -0
@@ -23,19 +23,22 @@ const activeIndex = ref();
23
23
 
24
24
  watch(model, (newVal) => {
25
25
  if (newVal) {
26
+ // @ts-expect-error not sure
26
27
  activeIndex.value = children.findIndex((child) => child.props.id === newVal);
27
28
  }
28
29
  });
29
30
 
30
31
  const accordionTabs = children.map((child, index) => {
32
+ // @ts-expect-error not sure
31
33
  if (child.props.id === props.initialExpandedId || child.props.id === model.value) {
32
34
  activeIndex.value = index;
33
35
  }
34
36
  return child.children;
35
37
  });
36
38
 
37
- const updateActiveIndex = (index) => {
39
+ const updateActiveIndex = (index: any) => {
38
40
  if (model.value) {
41
+ // @ts-expect-error not sure
39
42
  model.value = children[index]?.props.id || '';
40
43
  }
41
44
  };
@@ -96,6 +99,7 @@ const updateActiveIndex = (index) => {
96
99
  role="heading"
97
100
  aria-level="3"
98
101
  :class="{ 'h3 mb-0': variant === 'minimal' }">
102
+ <!-- @vue-expect-error -->
99
103
  <component
100
104
  :is="item"
101
105
  v-for="item in tab.title()"
@@ -103,6 +107,7 @@ const updateActiveIndex = (index) => {
103
107
  </span>
104
108
  <icon-chevron-down class="es-accordion-icon flex-shrink-0 ml-200" />
105
109
  </template>
110
+ <!-- @vue-expect-error -->
106
111
  <component
107
112
  :is="item"
108
113
  v-for="item in tab.default()"
@@ -13,7 +13,7 @@ const model = computed(() => {
13
13
  return [];
14
14
  }
15
15
 
16
- return props.items.map((item) => ({
16
+ return props.items.map((item: any) => ({
17
17
  ...item,
18
18
  // mark breadcrumb as active if manually set or if it matches this route
19
19
  active: item.active || route.path === item.to || route.path === item.href,
@@ -83,10 +83,20 @@ const getRootClasses = computed(() => {
83
83
  </script>
84
84
 
85
85
  <template>
86
+ <!--
87
+ <a> is needed for href because a root-relative link like /market/start/
88
+ that is passed to <nuxt-link :to="" /> will attempt to internally navigate
89
+ within a micro frontend, which will result in a 404
90
+ -->
91
+ <a
92
+ v-if="props.href"
93
+ :class="getRootClasses"
94
+ :href="props.href">
95
+ <slot />
96
+ </a>
86
97
  <nuxt-link
87
- v-if="props.href || props.to"
88
- :href="props.href || undefined"
89
- :to="props.to || undefined"
98
+ v-else-if="props.to"
99
+ :to="props.to"
90
100
  :class="getRootClasses">
91
101
  <slot />
92
102
  </nuxt-link>
@@ -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,4 +1,4 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  const props = defineProps({
3
3
  dark: {
4
4
  type: Boolean,
@@ -1,4 +1,4 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  const props = defineProps({
3
3
  imageFirst: {
4
4
  type: Boolean,
@@ -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
  }
@@ -21,7 +21,7 @@ const props = defineProps({
21
21
  },
22
22
  });
23
23
 
24
- const checkFrozenRow = (index) => {
24
+ const checkFrozenRow = (index: any) => {
25
25
  if (index === 0 && props.stickyFirstCol) {
26
26
  return true;
27
27
  }
@@ -39,7 +39,7 @@ const startCase = (str: string) =>
39
39
  .replace(/([a-z])([A-Z])/g, (_, $1, $2) => `${$1} ${$2}`)
40
40
  .replace(/(\s|^)(\w)/g, (_, $1, $2) => $1 + $2.toUpperCase());
41
41
 
42
- const label = (col) => {
42
+ const label = (col: any) => {
43
43
  if (typeof col === 'string') {
44
44
  return startCase(col);
45
45
  }
@@ -50,6 +50,7 @@ const columns = computed(() => {
50
50
  if (props.fields) {
51
51
  return props.fields;
52
52
  }
53
+ // @ts-expect-error not sure
53
54
  return Object.keys(props.items[0]);
54
55
  });
55
56
 
@@ -81,6 +82,7 @@ const scrollHeight = computed(() => {
81
82
  :value="props.items"
82
83
  class="border table__data-table table-spacing table"
83
84
  :scroll-height="scrollHeight">
85
+ <!-- @vue-expect-error -->
84
86
  <column
85
87
  v-for="(col, index) of columns"
86
88
  :key="col?.key ? col.key : col"
@@ -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(correctlyNamedFiles.map(async (file) => verifyMimeType(file)));
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
  };
@@ -1,4 +1,4 @@
1
- <script lang="js">
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';
@@ -13,7 +13,7 @@ const props = defineProps({
13
13
  size: {
14
14
  type: String,
15
15
  default: 'md',
16
- validator: (val) => ['sm', 'md', 'lg', 'xl'].includes(val),
16
+ validator: (val: string) => ['sm', 'md', 'lg', 'xl'].includes(val),
17
17
  },
18
18
  bodyClass: {
19
19
  type: String,
@@ -1,4 +1,4 @@
1
- <script lang="js">
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 lang="js">
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'EsNavBarFeaturedArticle',
4
4
  props: {
@@ -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="js">
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="js">
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="js">
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">&nbsp;</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="js">
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
@@ -24,6 +24,7 @@ const model = defineModel<number>();
24
24
  const first = ref();
25
25
 
26
26
  watch(model, (newVal) => {
27
+ // @ts-expect-error I don't know
27
28
  first.value = (newVal - 1) * props.perPage;
28
29
  });
29
30
 
@@ -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
  };
@@ -11,15 +11,16 @@ const panels = useSlots().default?.() || [];
11
11
  // keep track of the active tab index
12
12
  // - from above, if v-model is used
13
13
  // - from below, if the tab component receives a click
14
- const activeIndex = ref(model.value || 0);
14
+ const activeIndex: Ref<number> = ref(model.value || 0);
15
15
 
16
16
  // watch the v-model for changes and update the active index if it does change
17
17
  watch(model, (newVal) => {
18
+ // @ts-expect-error I don't know why
18
19
  activeIndex.value = newVal;
19
20
  });
20
21
 
21
22
  // called from the TabView when the user clicks a tab to make it active
22
- const updateActiveIndex = (index) => {
23
+ const updateActiveIndex = (index: number) => {
23
24
  model.value = index;
24
25
  };
25
26
  </script>
@@ -35,6 +36,7 @@ const updateActiveIndex = (index) => {
35
36
  panelContainer: 'tab-content',
36
37
  }"
37
38
  @update:active-index="updateActiveIndex">
39
+ <!-- @vue-expect-error -->
38
40
  <tab-panel
39
41
  v-for="(panel, index) in panels"
40
42
  :key="index"
@@ -58,6 +60,7 @@ const updateActiveIndex = (index) => {
58
60
  ],
59
61
  }),
60
62
  }">
63
+ <!-- @vue-expect-error -->
61
64
  <component
62
65
  :is="item"
63
66
  v-for="(item, idx) in panel.children.default()"
@@ -2,10 +2,12 @@
2
2
  // Props
3
3
  interface IProps {
4
4
  altText: string;
5
- coverImageUrl: string;
5
+ coverImageUrl?: string;
6
6
  embedUrl: string;
7
7
  }
8
- const props = defineProps<IProps>();
8
+ const props = withDefaults(defineProps<IProps>(), {
9
+ coverImageUrl: '',
10
+ });
9
11
  const showVideo = ref(false);
10
12
 
11
13
  // Methods
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ // @ts-expect-error module has no types
2
3
  import truncate from 'html-truncate';
3
4
 
4
5
  const props = defineProps({
@@ -85,13 +85,13 @@ const rules = {
85
85
 
86
86
  const { v$, validateState } = useEsForms(rules, state);
87
87
 
88
- const ctaForm = ref<HTMLFormElement>('ctaForm');
88
+ const ctaForm = useTemplateRef<HTMLFormElement>('ctaForm');
89
89
 
90
90
  const handleSubmit = () => {
91
91
  if (v$.value.$invalid) {
92
92
  v$.value.$touch();
93
93
  } else {
94
- ctaForm.value.submit();
94
+ ctaForm.value?.submit();
95
95
  }
96
96
  };
97
97
  </script>
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconArrowClockwise',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'ArrowCounterClockwiseIcon',
4
4
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'IconArrowCycle',
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'ArrowLeftIcon',
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'ArrowRightIcon',
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'ArrowUpIcon',
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'IconArrow',
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'IconBank',
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'IconBell',
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'IconBlock',
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'IconCalculator',
5
5
  props: {
@@ -1,5 +1,5 @@
1
1
  <!-- eslint-disable max-len -->
2
- <script>
2
+ <script lang="ts">
3
3
  export default {
4
4
  name: 'IconCalendar',
5
5
  props: {