@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/README.md
CHANGED
|
@@ -8,9 +8,6 @@ An EnergySage Nuxt layer library with design system components
|
|
|
8
8
|
npm install @energysage/es-ds-components
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
_*Note: this library is in pre-release development, so the above command won't yet work, as this package
|
|
12
|
-
is not yet published to NPM.*_
|
|
13
|
-
|
|
14
11
|
Once the package is installed, you'll need to add a reference to it in your nuxt.config.ts like so:
|
|
15
12
|
|
|
16
13
|
```
|
|
@@ -14,12 +14,23 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
14
14
|
variant: 'default',
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
const model = defineModel();
|
|
17
|
+
const model = defineModel<string>();
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
// get the list of elements provided as children to the default slot
|
|
20
|
+
const initialChildren = useSlots().default?.() || [];
|
|
21
|
+
const children: any[] = [];
|
|
22
|
+
initialChildren.forEach((child) => {
|
|
23
|
+
// unless this has a v-for element and we instead need to access its children
|
|
24
|
+
if (typeof child.type === 'symbol' && Array.isArray(child.children)) {
|
|
25
|
+
children.push(...child.children);
|
|
26
|
+
} else {
|
|
27
|
+
children.push(child);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
type ActiveChildren = null | number | number[];
|
|
21
32
|
|
|
22
|
-
const activeIndex = ref();
|
|
33
|
+
const activeIndex: Ref<ActiveChildren> = ref(null);
|
|
23
34
|
|
|
24
35
|
watch(model, (newVal) => {
|
|
25
36
|
if (newVal) {
|
|
@@ -29,19 +40,30 @@ watch(model, (newVal) => {
|
|
|
29
40
|
|
|
30
41
|
const accordionTabs = children.map((child, index) => {
|
|
31
42
|
if (child.props.id === props.initialExpandedId || child.props.id === model.value) {
|
|
32
|
-
|
|
43
|
+
if (props.allowMultipleExpand) {
|
|
44
|
+
activeIndex.value = [index];
|
|
45
|
+
} else {
|
|
46
|
+
activeIndex.value = index;
|
|
47
|
+
}
|
|
33
48
|
}
|
|
34
49
|
return child.children;
|
|
35
50
|
});
|
|
36
51
|
|
|
37
|
-
const updateActiveIndex = (index) => {
|
|
52
|
+
const updateActiveIndex = (index: ActiveChildren) => {
|
|
38
53
|
if (model.value) {
|
|
39
|
-
|
|
54
|
+
if (typeof index === 'number') {
|
|
55
|
+
model.value = children[index]?.props.id || '';
|
|
56
|
+
} else if (index === null) {
|
|
57
|
+
model.value = '';
|
|
58
|
+
}
|
|
59
|
+
// There's another case where index will be an array. In that case, v-model is unsupported as specified
|
|
60
|
+
// in the documentation, so no update is made
|
|
40
61
|
}
|
|
41
62
|
};
|
|
42
63
|
</script>
|
|
43
64
|
|
|
44
65
|
<template>
|
|
66
|
+
<!-- @vue-expect-error PrimeVue's type information is wrong -->
|
|
45
67
|
<accordion
|
|
46
68
|
:multiple="allowMultipleExpand"
|
|
47
69
|
:active-index="activeIndex"
|
|
@@ -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,
|
package/components/es-button.vue
CHANGED
|
@@ -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.
|
|
88
|
-
:
|
|
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>
|