@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
package/components/icon/wifi.vue
CHANGED
package/components/icon/x.vue
CHANGED
package/composables/forms.ts
CHANGED
|
@@ -15,7 +15,7 @@ export function useEsForms<
|
|
|
15
15
|
|
|
16
16
|
const isSubmitInProgress = computed(() => submitInProgress.value);
|
|
17
17
|
|
|
18
|
-
const getFields = (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
|
|
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
|
|
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
|
+
};
|
|
File without changes
|
|
File without changes
|