@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.
Files changed (183) hide show
  1. package/README.md +0 -3
  2. package/components/es-accordion-list.vue +29 -7
  3. package/components/es-breadcrumbs.vue +1 -1
  4. package/components/es-button.vue +13 -3
  5. package/components/es-carousel.vue +524 -69
  6. package/components/es-col.vue +5 -5
  7. package/components/es-collapse.vue +2 -2
  8. package/components/es-container.vue +10 -1
  9. package/components/es-cta-banner.vue +1 -1
  10. package/components/es-cta-card.vue +1 -1
  11. package/components/es-data-table-column.vue +20 -0
  12. package/components/es-data-table-simple.vue +1 -1
  13. package/components/es-data-table.vue +35 -86
  14. package/components/es-file-input.vue +8 -5
  15. package/components/es-footer.vue +33 -4
  16. package/components/es-modal.vue +1 -1
  17. package/components/es-nav-bar-account-menu.vue +4 -1
  18. package/components/es-nav-bar-featured-article.vue +1 -1
  19. package/components/es-nav-bar-link.vue +1 -1
  20. package/components/es-nav-bar-product-menu.vue +5 -1
  21. package/components/es-nav-bar-top-level-menu.vue +2 -1
  22. package/components/es-nav-bar-topic-menu.vue +4 -1
  23. package/components/es-nav-bar.vue +19 -4
  24. package/components/es-pagination.vue +1 -0
  25. package/components/es-reviews-io-card-carousel.vue +5 -1
  26. package/components/es-segmented-control.vue +237 -0
  27. package/components/es-tabs.vue +13 -3
  28. package/components/es-video.vue +4 -2
  29. package/components/es-view-more.vue +1 -0
  30. package/components/es-zip-code-form.vue +2 -2
  31. package/components/icon/arrow-clockwise.vue +1 -1
  32. package/components/icon/arrow-counter-clockwise.vue +1 -1
  33. package/components/icon/arrow-cycle.vue +1 -1
  34. package/components/icon/arrow-left.vue +1 -1
  35. package/components/icon/arrow-right.vue +1 -1
  36. package/components/icon/arrow-up.vue +1 -1
  37. package/components/icon/arrow.vue +1 -1
  38. package/components/icon/bank.vue +1 -1
  39. package/components/icon/bell.vue +1 -1
  40. package/components/icon/block.vue +1 -1
  41. package/components/icon/calculator.vue +1 -1
  42. package/components/icon/calendar.vue +1 -1
  43. package/components/icon/cart.vue +1 -1
  44. package/components/icon/ccpa-opt-out.vue +61 -0
  45. package/components/icon/chat-add.vue +1 -1
  46. package/components/icon/chat-approve.vue +1 -1
  47. package/components/icon/chat-bubble.vue +1 -1
  48. package/components/icon/chat-dots.vue +1 -1
  49. package/components/icon/check.vue +1 -1
  50. package/components/icon/chevron-down.vue +1 -1
  51. package/components/icon/chevron-horizontal.vue +1 -1
  52. package/components/icon/chevron-left.vue +1 -1
  53. package/components/icon/chevron-right.vue +1 -1
  54. package/components/icon/chevron-up.vue +1 -1
  55. package/components/icon/circle-alert.vue +1 -1
  56. package/components/icon/circle-check.vue +1 -1
  57. package/components/icon/circle-chevron-down.vue +1 -1
  58. package/components/icon/circle-chevron-left.vue +1 -1
  59. package/components/icon/circle-chevron-right.vue +1 -1
  60. package/components/icon/circle-chevron-up.vue +1 -1
  61. package/components/icon/circle-minus.vue +1 -1
  62. package/components/icon/circle-plus.vue +1 -1
  63. package/components/icon/circle-x.vue +1 -1
  64. package/components/icon/circle.vue +1 -1
  65. package/components/icon/clock.vue +1 -1
  66. package/components/icon/companies.vue +1 -1
  67. package/components/icon/contact-us.vue +1 -1
  68. package/components/icon/copy.vue +1 -1
  69. package/components/icon/credit-card.vue +1 -1
  70. package/components/icon/document.vue +1 -1
  71. package/components/icon/electricity-circle.vue +1 -1
  72. package/components/icon/envelope.vue +1 -1
  73. package/components/icon/es-leaf.vue +1 -1
  74. package/components/icon/eye.vue +1 -1
  75. package/components/icon/facebook.vue +1 -1
  76. package/components/icon/flag.vue +1 -1
  77. package/components/icon/folder.vue +1 -1
  78. package/components/icon/gift.vue +1 -1
  79. package/components/icon/hamburger.vue +1 -1
  80. package/components/icon/heart.vue +1 -1
  81. package/components/icon/image.vue +1 -1
  82. package/components/icon/info-blog-post.vue +1 -1
  83. package/components/icon/info.vue +1 -1
  84. package/components/icon/instagram.vue +1 -1
  85. package/components/icon/light-bulb.vue +1 -1
  86. package/components/icon/link-out.vue +1 -1
  87. package/components/icon/linkedin.vue +1 -1
  88. package/components/icon/location.vue +1 -1
  89. package/components/icon/lock-off.vue +1 -1
  90. package/components/icon/lock-on.vue +1 -1
  91. package/components/icon/marketplace.vue +1 -1
  92. package/components/icon/minus.vue +1 -1
  93. package/components/icon/open-envelope.vue +1 -1
  94. package/components/icon/paper.vue +1 -1
  95. package/components/icon/pencil.vue +1 -1
  96. package/components/icon/person-add.vue +1 -1
  97. package/components/icon/person-check.vue +1 -1
  98. package/components/icon/person-cross.vue +1 -1
  99. package/components/icon/person.vue +1 -1
  100. package/components/icon/phone.vue +1 -1
  101. package/components/icon/play.vue +1 -1
  102. package/components/icon/plus.vue +1 -1
  103. package/components/icon/settings-horizontal.vue +1 -1
  104. package/components/icon/settings-vertical.vue +1 -1
  105. package/components/icon/shield-with-check.vue +1 -1
  106. package/components/icon/shield.vue +1 -1
  107. package/components/icon/shopping-bag.vue +1 -1
  108. package/components/icon/sound-down.vue +1 -1
  109. package/components/icon/sound-off.vue +1 -1
  110. package/components/icon/sound-on.vue +1 -1
  111. package/components/icon/sound-up.vue +1 -1
  112. package/components/icon/star-empty.vue +1 -1
  113. package/components/icon/star-full.vue +1 -1
  114. package/components/icon/star-half.vue +1 -1
  115. package/components/icon/state-ak.vue +1 -1
  116. package/components/icon/state-al.vue +1 -1
  117. package/components/icon/state-ar.vue +1 -1
  118. package/components/icon/state-az.vue +1 -1
  119. package/components/icon/state-ca.vue +1 -1
  120. package/components/icon/state-co.vue +1 -1
  121. package/components/icon/state-ct.vue +1 -1
  122. package/components/icon/state-dc.vue +1 -1
  123. package/components/icon/state-de.vue +1 -1
  124. package/components/icon/state-fl.vue +1 -1
  125. package/components/icon/state-ga.vue +1 -1
  126. package/components/icon/state-hi.vue +1 -1
  127. package/components/icon/state-ia.vue +1 -1
  128. package/components/icon/state-id.vue +1 -1
  129. package/components/icon/state-il.vue +1 -1
  130. package/components/icon/state-in.vue +1 -1
  131. package/components/icon/state-ks.vue +1 -1
  132. package/components/icon/state-ky.vue +1 -1
  133. package/components/icon/state-la.vue +1 -1
  134. package/components/icon/state-ma.vue +1 -1
  135. package/components/icon/state-md.vue +1 -1
  136. package/components/icon/state-me.vue +1 -1
  137. package/components/icon/state-mi.vue +1 -1
  138. package/components/icon/state-mn.vue +1 -1
  139. package/components/icon/state-mo.vue +1 -1
  140. package/components/icon/state-ms.vue +1 -1
  141. package/components/icon/state-mt.vue +1 -1
  142. package/components/icon/state-nc.vue +1 -1
  143. package/components/icon/state-nd.vue +1 -1
  144. package/components/icon/state-ne.vue +1 -1
  145. package/components/icon/state-nh.vue +1 -1
  146. package/components/icon/state-nj.vue +1 -1
  147. package/components/icon/state-nm.vue +1 -1
  148. package/components/icon/state-nv.vue +1 -1
  149. package/components/icon/state-ny.vue +1 -1
  150. package/components/icon/state-oh.vue +1 -1
  151. package/components/icon/state-ok.vue +1 -1
  152. package/components/icon/state-or.vue +1 -1
  153. package/components/icon/state-pa.vue +1 -1
  154. package/components/icon/state-ri.vue +1 -1
  155. package/components/icon/state-sc.vue +1 -1
  156. package/components/icon/state-sd.vue +1 -1
  157. package/components/icon/state-tn.vue +1 -1
  158. package/components/icon/state-tx.vue +1 -1
  159. package/components/icon/state-ut.vue +1 -1
  160. package/components/icon/state-va.vue +1 -1
  161. package/components/icon/state-vt.vue +1 -1
  162. package/components/icon/state-wa.vue +1 -1
  163. package/components/icon/state-wi.vue +1 -1
  164. package/components/icon/state-wv.vue +1 -1
  165. package/components/icon/state-wy.vue +1 -1
  166. package/components/icon/thumbs-up.vue +1 -1
  167. package/components/icon/trash-can.vue +1 -1
  168. package/components/icon/twitter.vue +1 -1
  169. package/components/icon/verified.vue +1 -1
  170. package/components/icon/wifi.vue +1 -1
  171. package/components/icon/x.vue +1 -1
  172. package/components/icon/youtube.vue +1 -1
  173. package/composables/forms.ts +1 -1
  174. package/nuxt.config.ts +9 -0
  175. package/package.json +2 -1
  176. package/types/es-carousel.ts +12 -0
  177. package/types/index.ts +1 -0
  178. package/utils/forms.ts +120 -0
  179. package/utils/{get-es-footer-content.js → get-es-footer-content.ts} +1 -0
  180. package/{lib-utils/mime-type-finder.js → utils/mime-type-finder.ts} +2 -2
  181. package/utils/vuelidate-keys.ts +39 -0
  182. /package/utils/{get-es-nav-bar-account-content.js → get-es-nav-bar-account-content.ts} +0 -0
  183. /package/utils/{get-es-nav-bar-global-content.js → get-es-nav-bar-global-content.ts} +0 -0
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateSc',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateSd',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateTn',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateTx',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateUt',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateVa',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateVt',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateWa',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateWi',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateWv',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconStateWy',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconThumbsUp',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconTrashCan',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconTwitter',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconVerified',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconWifi',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'XIcon',
4
4
  props: {
@@ -1,4 +1,4 @@
1
- <script>
1
+ <script lang="ts">
2
2
  export default {
3
3
  name: 'IconYoutube',
4
4
  props: {
@@ -15,7 +15,7 @@ export function useEsForms<
15
15
 
16
16
  const isSubmitInProgress = computed(() => submitInProgress.value);
17
17
 
18
- const getFields = (obj: unknown, valueKey = 'obj') => {
18
+ const getFields = (obj: any, valueKey = 'obj') => {
19
19
  let objKeys = null;
20
20
  try {
21
21
  objKeys = Object.keys(obj);
package/nuxt.config.ts CHANGED
@@ -18,6 +18,11 @@ export default defineNuxtConfig({
18
18
  },
19
19
  },
20
20
 
21
+ // Configure how Nuxt auto-imports composables into your application.
22
+ imports: {
23
+ dirs: ['composables', 'types'],
24
+ },
25
+
21
26
  modules: [
22
27
  // https://google-fonts.nuxtjs.org/getting-started/setup
23
28
  '@nuxtjs/google-fonts',
@@ -66,6 +71,7 @@ export default defineNuxtConfig({
66
71
  'primevue/progressbar',
67
72
  'primevue/radiobutton',
68
73
  'primevue/rating',
74
+ 'primevue/selectbutton',
69
75
  'primevue/skeleton',
70
76
  'primevue/slider',
71
77
  'primevue/tabpanel',
@@ -73,4 +79,7 @@ export default defineNuxtConfig({
73
79
  ],
74
80
  },
75
81
  },
82
+ typescript: {
83
+ typeCheck: true,
84
+ },
76
85
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energysage/es-ds-components",
3
- "version": "3.0.0-alpha.8",
3
+ "version": "3.0.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "An EnergySage Vue component library",
@@ -17,6 +17,7 @@
17
17
  "author": "EnergySage",
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
+ "@energysage/es-ds-styles": "^3.0.0",
20
21
  "@nuxtjs/google-fonts": "^3.2.0",
21
22
  "@vuelidate/core": "^2.0.3",
22
23
  "@vuelidate/validators": "^2.0.4",
@@ -0,0 +1,12 @@
1
+ export interface EsCarouselBreakpointInterface {
2
+ numScroll?: number;
3
+ numVisible: number;
4
+ }
5
+
6
+ export interface EsCarouselBreakpointsInterface {
7
+ sm?: EsCarouselBreakpointInterface;
8
+ md?: EsCarouselBreakpointInterface;
9
+ lg?: EsCarouselBreakpointInterface;
10
+ xl?: EsCarouselBreakpointInterface;
11
+ xxl?: EsCarouselBreakpointInterface;
12
+ }
package/types/index.ts ADDED
@@ -0,0 +1 @@
1
+ export type * from './es-carousel';
package/utils/forms.ts ADDED
@@ -0,0 +1,120 @@
1
+ import {
2
+ helpers,
3
+ required,
4
+ minValue,
5
+ maxValue,
6
+ requiredIf,
7
+ numeric,
8
+ integer,
9
+ minLength,
10
+ maxLength,
11
+ } from '@vuelidate/validators';
12
+
13
+ // Only some vuelidate validators can be reused; others don't work well
14
+ export const vuelidateRequired = required;
15
+ export const vuelidateMinValue = minValue;
16
+ export const vuelidateMaxValue = maxValue;
17
+ export const vuelidateRequiredIf = requiredIf;
18
+ export const vuelidateNumeric = numeric;
19
+ export const vuelidateInteger = integer;
20
+ export const vuelidateMinLength = minLength;
21
+ export const vuelidateMaxLength = maxLength;
22
+ export const vuelidateHelpers = helpers;
23
+
24
+ /**
25
+ * @returns a function that takes a number, and returns another function which takes a string param
26
+ * that will ultimately be what you're comparing the pattern against N times.
27
+ */
28
+ // eslint-disable-next-line max-len
29
+ const matchesPatternNTimes =
30
+ (pattern: RegExp) =>
31
+ (N = 1) =>
32
+ (param: string) =>
33
+ [...String(param).matchAll(pattern)].length >= N;
34
+
35
+ /**
36
+ * @param { Number } number of times the resulting function will need to match
37
+ * @returns { Function } function that will take a string param that will compare against a
38
+ * pattern N times. The pattern is defined in the functional closure.
39
+ *
40
+ * Usage: hasNumber(1)('s0me string')
41
+ */
42
+ const hasNumber = matchesPatternNTimes(/[0-9]/g);
43
+
44
+ /**
45
+ * @param { Number } number of times the resulting function will need to match
46
+ * @returns { Function } function that will take a string param that will compare against a
47
+ * pattern N times. The pattern is defined in the functional closure.
48
+ *
49
+ * Usage: hasSpecialCharacter(1)('some $tring')
50
+ */
51
+ const hasSpecialCharacter = matchesPatternNTimes(/\W|_/g);
52
+
53
+ /**
54
+ * @param { Number } number of times the resulting function will need to match
55
+ * @returns { Function } function that will take a string param that will compare against a
56
+ * pattern N times. The pattern is defined in the functional closure.
57
+ *
58
+ * Usage: hasUppercaseLetter(1)('some String')
59
+ */
60
+ const hasUppercaseLetter = matchesPatternNTimes(/[A-Z]/g);
61
+
62
+ /**
63
+ * @param { Number } number of times the resulting function will need to match
64
+ * @returns { Function } function that will take a string param that will compare against a
65
+ * pattern N times. The pattern is defined in the functional closure.
66
+ *
67
+ * Usage: hasLowercaseLetter(1)('some String')
68
+ */
69
+ const hasLowercaseLetter = matchesPatternNTimes(/[a-z]/g);
70
+
71
+ /**
72
+ * @param emailAddress Email Address
73
+ * @returns if valid
74
+ */
75
+ export function vuelidateEmail(emailAddress: string) {
76
+ const valid = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z][\w]{1,}$/i.test(emailAddress);
77
+ return !helpers.req(emailAddress) || valid;
78
+ }
79
+
80
+ /**
81
+ * @param number US Based phone number
82
+ * @returns if valid
83
+ */
84
+ export function vuelidatePhone(number: string) {
85
+ return !helpers.req(number) || /^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/.test(number);
86
+ }
87
+
88
+ /**
89
+ * @returns if not required or string contains a number
90
+ */
91
+ // eslint-disable-next-line max-len
92
+ export const vuelidateHasNumber = (X: number) =>
93
+ helpers.withParams({ type: 'xTimes', value: X }, (value: string) => !helpers.req(value) || hasNumber(X)(value));
94
+
95
+ /**
96
+ * @returns if not required or string contains a special character
97
+ */
98
+ export const vuelidateHasSpecialCharacter = (X: number) =>
99
+ helpers.withParams(
100
+ { type: 'xTimes', value: X },
101
+ (value: string) => !helpers.req(value) || hasSpecialCharacter(X)(value),
102
+ );
103
+
104
+ /**
105
+ * @returns if not required or string contains an uppercase letter
106
+ */
107
+ export const vuelidateHasUppercaseLetter = (X: number) =>
108
+ helpers.withParams(
109
+ { type: 'xTimes', value: X },
110
+ (value: string) => !helpers.req(value) || hasUppercaseLetter(X)(value),
111
+ );
112
+
113
+ /**
114
+ * @returns if not required or string contains an lowercase letter
115
+ */
116
+ export const vuelidateHasLowercaseLetter = (X: number) =>
117
+ helpers.withParams(
118
+ { type: 'xTimes', value: X },
119
+ (value: string) => !helpers.req(value) || hasLowercaseLetter(X)(value),
120
+ );
@@ -76,6 +76,7 @@ export default (
76
76
  { text: 'Privacy policy', url: `${ES_DOMAIN}/privacy-policy/` },
77
77
  { text: 'Mobile terms of use', url: `${ES_DOMAIN}/mobile-terms-of-use/` },
78
78
  { text: 'Non-discrimination policy', url: `${ES_DOMAIN}/nondiscrimination/` },
79
+ { text: 'Your privacy choices' },
79
80
  ],
80
81
  copyrightText: '© Copyright 2009-{currentYear} EnergySage, Inc. All rights reserved.',
81
82
  trademarkText: `ENERGYSAGE is a registered trademark and the EnergySage logo is a trademark of EnergySage, Inc.
@@ -39,10 +39,10 @@ const mimeTypesAndHexes = [
39
39
 
40
40
  export const mimeTypes = mimeTypesAndHexes.map(({ mime }) => mime);
41
41
 
42
- export function getHumanReadableTypeFromMime(mimeType) {
42
+ export function getHumanReadableTypeFromMime(mimeType: any) {
43
43
  return mimeTypesAndHexes.find((mimeTypeAndHex) => mimeTypeAndHex.mime === mimeType)?.humanReadable;
44
44
  }
45
45
 
46
- export default function findMimeType(hex) {
46
+ export function findMimeType(hex: any) {
47
47
  return mimeTypesAndHexes.find((mimeType) => mimeType.hexes.includes(hex))?.mime;
48
48
  }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * constants.js
3
+ *
4
+ * String constants that can be used when defining validations objects
5
+ */
6
+
7
+ const REQUIRED = 'vuelidateRequired';
8
+ const MIN_VALUE = 'vuelidateMinValue';
9
+ const MAX_VALUE = 'vuelidateMaxValue';
10
+ const REQUIRED_IF = 'vuelidateRequiredIf';
11
+ const NUMERIC = 'vuelidateNumeric';
12
+ const INTEGER = 'vuelidateInteger';
13
+ const MIN_LENGTH = 'vuelidateMinLength';
14
+ const MAX_LENGTH = 'vuelidateMaxLength';
15
+ const HAS_NUMBER = 'vuelidateHasNumber';
16
+ const HAS_SPECIAL_CHARACTER = 'vuelidateHasSpecialCharacter';
17
+ const HAS_UPPERCASE_LETTER = 'vuelidateHasUppercaseLetter';
18
+ const HAS_LOWERCASE_LETTER = 'vuelidateHasLowercaseLetter';
19
+ const EMAIL = 'vuelidateEmail';
20
+ const PHONE = 'vuelidatePhone';
21
+ const HELPERS = 'vuelidateHelpers';
22
+
23
+ export default {
24
+ REQUIRED,
25
+ REQUIRED_IF,
26
+ MIN_VALUE,
27
+ MAX_VALUE,
28
+ MIN_LENGTH,
29
+ MAX_LENGTH,
30
+ NUMERIC,
31
+ INTEGER,
32
+ EMAIL,
33
+ PHONE,
34
+ HAS_NUMBER,
35
+ HAS_SPECIAL_CHARACTER,
36
+ HAS_UPPERCASE_LETTER,
37
+ HAS_LOWERCASE_LETTER,
38
+ HELPERS,
39
+ };