@covet-pics/covet-pics-widget 0.125.2 → 0.125.3
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/dist/cjs/covet-pics-direct-buy_8.cjs.entry.js +12 -9
- package/dist/cjs/covet-pics-direct-buy_8.cjs.entry.js.map +1 -1
- package/dist/collection/components/covet-pics-direct-buy/covet-pics-direct-buy.js +12 -9
- package/dist/collection/components/covet-pics-direct-buy/covet-pics-direct-buy.js.map +1 -1
- package/dist/covet-pics-widget/covet-pics-widget.esm.js +1 -1
- package/dist/covet-pics-widget/{p-767af8da.entry.js → p-3a792ede.entry.js} +2 -2
- package/dist/covet-pics-widget/p-3a792ede.entry.js.map +1 -0
- package/dist/covet-pics-widget/p-52389fdb.system.js +1 -1
- package/dist/covet-pics-widget/{p-bc03bb07.system.entry.js → p-5450df83.system.entry.js} +2 -2
- package/dist/covet-pics-widget/p-5450df83.system.entry.js.map +1 -0
- package/dist/esm/covet-pics-direct-buy_8.entry.js +12 -9
- package/dist/esm/covet-pics-direct-buy_8.entry.js.map +1 -1
- package/dist/esm-es5/covet-pics-direct-buy_8.entry.js +1 -1
- package/dist/esm-es5/covet-pics-direct-buy_8.entry.js.map +1 -1
- package/dist/types/components/covet-pics-direct-buy/covet-pics-direct-buy.d.ts +2 -1
- package/package.json +1 -1
- package/dist/covet-pics-widget/p-767af8da.entry.js.map +0 -1
- package/dist/covet-pics-widget/p-bc03bb07.system.entry.js.map +0 -1
|
@@ -93,12 +93,19 @@ const CovetPicsDirectBuy = class {
|
|
|
93
93
|
}
|
|
94
94
|
componentWillLoad() {
|
|
95
95
|
this.initStore();
|
|
96
|
+
this.setSingleSelectedValues();
|
|
96
97
|
}
|
|
97
98
|
componentDidLoad() {
|
|
98
99
|
this.initSwiper();
|
|
99
100
|
const closeBtn = this.el.shadowRoot.querySelector(".close");
|
|
100
101
|
closeBtn.focus();
|
|
101
102
|
}
|
|
103
|
+
componentDidUpdate() {
|
|
104
|
+
// TODO check do we need this update in componentDidUpdate
|
|
105
|
+
if (this.mainGallery) {
|
|
106
|
+
this.mainGallery.update();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
102
109
|
disconnectedCallback() {
|
|
103
110
|
this.unsubscribe();
|
|
104
111
|
}
|
|
@@ -110,6 +117,11 @@ const CovetPicsDirectBuy = class {
|
|
|
110
117
|
this.settings = this.appState.settings;
|
|
111
118
|
});
|
|
112
119
|
}
|
|
120
|
+
setSingleSelectedValues() {
|
|
121
|
+
if (this.product.options && this.product.options.length > 0) {
|
|
122
|
+
this.product.options.forEach((option, index) => this.updateSelectedOptions(`option${index + 1}`, option.values[0]));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
113
125
|
get productId() {
|
|
114
126
|
if (typeof this.product !== "undefined") {
|
|
115
127
|
return this.product.id.toString();
|
|
@@ -163,9 +175,6 @@ const CovetPicsDirectBuy = class {
|
|
|
163
175
|
});
|
|
164
176
|
}
|
|
165
177
|
renderOptions(optionData, optionNumber) {
|
|
166
|
-
if (optionData && optionData.values.length === 1) {
|
|
167
|
-
this.updateSelectedOptions(`option${optionNumber}`, optionData.values[0]);
|
|
168
|
-
}
|
|
169
178
|
if (optionData && optionData.values.length > 1) {
|
|
170
179
|
return (
|
|
171
180
|
// TODO switch to native html select
|
|
@@ -193,12 +202,6 @@ const CovetPicsDirectBuy = class {
|
|
|
193
202
|
});
|
|
194
203
|
}
|
|
195
204
|
}
|
|
196
|
-
componentDidUpdate() {
|
|
197
|
-
// TODO check do we need this update in componentDidUpdate
|
|
198
|
-
if (this.mainGallery) {
|
|
199
|
-
this.mainGallery.update();
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
205
|
imgAltTag(caption, idx, itemsLength) {
|
|
203
206
|
return caption && caption.length > 0
|
|
204
207
|
? `${caption} product slide ${idx} of ${itemsLength}`
|