@salla.sa/twilight-components 2.14.297 → 2.14.299
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/{filepond-B40UxVrp.js → filepond-DsdfFzci.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BJ2is-CR.js → filepond-plugin-file-poster-D7EBBVBw.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-jaoaOCNL.js → filepond-plugin-file-validate-size-Dh6MxbpO.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CjxCZWaY.js → filepond-plugin-file-validate-type-D40rBF9e.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-JEKYuBL0.js → filepond-plugin-image-edit-BXE5dQVb.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DmK-aAfe.js → filepond-plugin-image-exif-orientation-DbGi6rNR.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-BZxhd7ci.js → filepond-plugin-image-preview-CDgGkap0.js} +1 -1
- package/dist/cjs/{index-Bc1Blm9E.js → index-Bo6u9vKr.js} +2 -2
- package/dist/cjs/{index-CYgngxgk.js → index-Cd0WMShL.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-accordion_62.cjs.entry.js +29 -28
- package/dist/cjs/salla-advertisement.cjs.entry.js +28 -6
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/collection/components/salla-advertisement/salla-advertisement.js +27 -5
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +4 -4
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +12 -9
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +4 -6
- package/dist/components/index.js +2 -2
- package/dist/components/salla-advertisement.js +27 -5
- package/dist/components/salla-multiple-bundle-product-details2.js +4 -4
- package/dist/components/salla-multiple-bundle-product-slider2.js +12 -9
- package/dist/components/salla-user-menu.js +4 -6
- package/dist/esm/{filepond-DjIxwPi0.js → filepond-CS1gpTBr.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CYvspSki.js → filepond-plugin-file-poster-hYRi6NyQ.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-Cf09KKtA.js → filepond-plugin-file-validate-size-Bq1DeGGt.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-ByZikBAG.js → filepond-plugin-file-validate-type-cKS428EA.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-DbT6_H2k.js → filepond-plugin-image-edit-Czrr7OFb.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-BhEk_QOu.js → filepond-plugin-image-exif-orientation-D5NuOSvg.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-Bsa9hzKo.js → filepond-plugin-image-preview-CPQU6Nfl.js} +1 -1
- package/dist/esm/{index-D8Ikl-5X.js → index-BcEZj_a_.js} +2 -2
- package/dist/esm/{index-CYhDRQ7q.js → index-CRHDw9qX.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-accordion_62.entry.js +29 -28
- package/dist/esm/salla-advertisement.entry.js +28 -6
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/twilight/{p-9bb74d00.entry.js → p-0d7f2c4f.entry.js} +1 -1
- package/dist/twilight/{p-c0804853.entry.js → p-1df02ecb.entry.js} +1 -1
- package/dist/twilight/{p-747b3306.entry.js → p-22478bc6.entry.js} +1 -1
- package/dist/twilight/{p-62b33ee4.entry.js → p-35dd8271.entry.js} +1 -1
- package/dist/twilight/{p-199025a7.entry.js → p-3a156d84.entry.js} +1 -1
- package/dist/twilight/{p-243e9c31.entry.js → p-47d610c9.entry.js} +1 -1
- package/dist/twilight/{p-407a5e84.entry.js → p-48fcb842.entry.js} +1 -1
- package/dist/twilight/{p-37249106.entry.js → p-5013bc5d.entry.js} +1 -1
- package/dist/twilight/{p-8713ed50.entry.js → p-61171611.entry.js} +1 -1
- package/dist/twilight/{p-6781caef.entry.js → p-618c18ef.entry.js} +1 -1
- package/dist/twilight/{p-28eae4bb.entry.js → p-6c5a9d29.entry.js} +1 -1
- package/dist/twilight/{p-03907a0b.entry.js → p-720e6cd2.entry.js} +1 -1
- package/dist/twilight/{p-26c2b559.entry.js → p-75d4b225.entry.js} +1 -1
- package/dist/twilight/{p-00042305.entry.js → p-7a7008a1.entry.js} +1 -1
- package/dist/twilight/{p-a608994f.entry.js → p-7ba50aa5.entry.js} +1 -1
- package/dist/twilight/{p-e7b610b8.entry.js → p-7c68bcc8.entry.js} +2 -2
- package/dist/twilight/{p-3f2a0489.entry.js → p-7f11dbdb.entry.js} +1 -1
- package/dist/twilight/{p-067eafaf.entry.js → p-7faf3b7b.entry.js} +1 -1
- package/dist/twilight/{p-f8beff97.entry.js → p-802f41e9.entry.js} +1 -1
- package/dist/twilight/{p-5fe10b3f.entry.js → p-8752f63e.entry.js} +1 -1
- package/dist/twilight/{p-3d7b61c6.entry.js → p-9bbb9da8.entry.js} +1 -1
- package/dist/twilight/{p-e82e0803.entry.js → p-9e1fde84.entry.js} +1 -1
- package/dist/twilight/{p-CYIyfWLw.js → p-BSB44NuH.js} +1 -1
- package/dist/twilight/{p-D8Ikl-5X.js → p-BcEZj_a_.js} +1 -1
- package/dist/twilight/{p-CFX5Won9.js → p-Bzhd8VNC.js} +1 -1
- package/dist/twilight/{p-BdPzpmIq.js → p-D94zCCrv.js} +1 -1
- package/dist/twilight/{p-fl5mSXGV.js → p-DSERK81u.js} +1 -1
- package/dist/twilight/{p-DQJu53PU.js → p-DdybBqQi.js} +1 -1
- package/dist/twilight/{p-CdhBe5Fz.js → p-DosNklS4.js} +2 -2
- package/dist/twilight/{p-f30f7e03.entry.js → p-a78482f2.entry.js} +1 -1
- package/dist/twilight/{p-dded0945.entry.js → p-a845dc62.entry.js} +1 -1
- package/dist/twilight/{p-3fe694f7.entry.js → p-ac60f7a8.entry.js} +1 -1
- package/dist/twilight/p-b1b7f8d6.entry.js +4 -0
- package/dist/twilight/{p-ecdb32fb.entry.js → p-ba943da7.entry.js} +1 -1
- package/dist/twilight/{p-ade5c1b4.entry.js → p-be4026a8.entry.js} +1 -1
- package/dist/twilight/p-c4a0b3b7.entry.js +4 -0
- package/dist/twilight/{p-60aa330e.entry.js → p-cc426b8e.entry.js} +1 -1
- package/dist/twilight/{p-4713b2c5.entry.js → p-d2e0a44b.entry.js} +1 -1
- package/dist/twilight/p-eaOyQUpB.js +9 -0
- package/dist/twilight/{p-66ccff79.entry.js → p-eb2d4571.entry.js} +1 -1
- package/dist/twilight/{p-60a1cceb.entry.js → p-f8621694.entry.js} +1 -1
- package/dist/twilight/{p-87c26055.entry.js → p-fbf8ed58.entry.js} +1 -1
- package/dist/twilight/{p-BENXSP8S.js → p-rKgX27tV.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-advertisement/salla-advertisement.d.ts +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-2a59b701.entry.js +0 -4
- package/dist/twilight/p-D7xuopBR.js +0 -9
- package/dist/twilight/p-f0267809.entry.js +0 -4
|
@@ -26,6 +26,10 @@ const SallaAdvertisement$1 = /*@__PURE__*/ proxyCustomElement(class SallaAdverti
|
|
|
26
26
|
* @returns True if the advertisement is not visible, false otherwise.
|
|
27
27
|
*/
|
|
28
28
|
isNotVisible(advert) {
|
|
29
|
+
const isPreview = salla.config.isDebug() || salla.helpers.isPreview();
|
|
30
|
+
// ? Show advertisement in preview mode
|
|
31
|
+
if (isPreview)
|
|
32
|
+
return false;
|
|
29
33
|
return !!salla.storage.get(`statusAd-${advert.id}`);
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
@@ -74,11 +78,29 @@ const SallaAdvertisement$1 = /*@__PURE__*/ proxyCustomElement(class SallaAdverti
|
|
|
74
78
|
* Lifecycle method that fetches advertisements before the component is loaded.
|
|
75
79
|
*/
|
|
76
80
|
componentWillLoad() {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
const getData = async () => {
|
|
82
|
+
const isPreview = salla.config.isDebug() || salla.helpers.isPreview();
|
|
83
|
+
// Wait for salla to be ready
|
|
84
|
+
await new Promise(resolve => salla.onReady(resolve));
|
|
85
|
+
// Fetch advertisements based on the current page
|
|
86
|
+
const pageSlug = !isPreview ? this.currentSlug : null;
|
|
87
|
+
const response = await salla.api.advertisement.fetch(pageSlug);
|
|
88
|
+
if (Array.isArray(response.data)) {
|
|
89
|
+
const advertisements = response.data;
|
|
90
|
+
// Show all active advertisements in preview mode
|
|
91
|
+
if (isPreview) {
|
|
92
|
+
this.advertisements = advertisements;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.advertisements = advertisements.filter(ad => !salla.storage.get(`statusAd-${ad.id}`));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
this.advertisements = [];
|
|
100
|
+
}
|
|
101
|
+
return this.advertisements;
|
|
102
|
+
};
|
|
103
|
+
return getData();
|
|
82
104
|
}
|
|
83
105
|
componentDidRender() {
|
|
84
106
|
if ((Array.isArray(this.advertisements) && !this.advertisements.length) || !this.advertisements) {
|
|
@@ -146,9 +146,9 @@ const SallaMultipleBundleProductDetails = /*@__PURE__*/ proxyCustomElement(class
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
renderAccordionHeader(section, selectedCount) {
|
|
149
|
-
return (h(Fragment, null, h("h2", { slot: "title" }, section?.name), section?.obligatory_products
|
|
149
|
+
return (h(Fragment, null, h("h2", { slot: "title" }, section?.name), section?.obligatory_products ? (h("span", { slot: "note" }, salla.lang.get('pages.products.obligatory_products', {
|
|
150
150
|
count: section?.obligatory_products || 0,
|
|
151
|
-
}))), h("span", { slot: "progress" }, selectedCount, "/", section?.products?.length || 0)));
|
|
151
|
+
}))) : '', h("span", { slot: "progress" }, selectedCount, "/", section?.products?.length || 0)));
|
|
152
152
|
}
|
|
153
153
|
componentDidLoad() {
|
|
154
154
|
// Listen for product selected event from modal
|
|
@@ -179,10 +179,10 @@ const SallaMultipleBundleProductDetails = /*@__PURE__*/ proxyCustomElement(class
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
render() {
|
|
182
|
-
return (h(Host, { key: '
|
|
182
|
+
return (h(Host, { key: 'faef370736cdde4ad6b8d1bfce7a5ae80a807f3c', class: "s-multiple-bundle-product-wrapper" }, h("div", { key: '66bfb5f5f5736cd7ea37b9e620079c0ec3399685', class: "s-multiple-bundle-product-wrapper-sections" }, this.sections.map((section, index) => {
|
|
183
183
|
const selectedCount = this.selectedProducts[section.id]?.size || 0;
|
|
184
184
|
return (h("salla-accordion", { key: section.id, collapsed: index === 0 ? false : true }, h("salla-accordion-head", null, this.renderAccordionHeader(section, selectedCount)), h("salla-accordion-body", null, h("salla-multiple-bundle-product-slider", { section: section, sectionIndex: index, selectedProducts: this.selectedProducts, onProductSelected: this.handleBundleSliderProductSelected, onProductOptionsSelected: this.handleBundleSliderProductOptionsSelected }))));
|
|
185
|
-
})), h("salla-multiple-bundle-product-options-modal", { key: '
|
|
185
|
+
})), h("salla-multiple-bundle-product-options-modal", { key: 'ea258265b6cf53de022afcaeddf5f7c407706156' })));
|
|
186
186
|
}
|
|
187
187
|
get host() { return this; }
|
|
188
188
|
static get style() { return sallaMultipleBundleProductDetailsCss; }
|
|
@@ -22,15 +22,18 @@ const SallaMultipleBundleProductSlider = /*@__PURE__*/ proxyCustomElement(class
|
|
|
22
22
|
if (!checkbox)
|
|
23
23
|
return;
|
|
24
24
|
if (checkbox) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// Dispatch a change event to trigger form validation/submission
|
|
28
|
-
const changeEvent = new window.Event('change', { bubbles: true });
|
|
29
|
-
checkbox.dispatchEvent(changeEvent);
|
|
30
|
-
if (!checkbox.checked) {
|
|
31
|
-
this.clearSavedOptionsState(this.section.id, productIndex);
|
|
25
|
+
const willBeChecked = !checkbox.checked;
|
|
26
|
+
if (!willBeChecked) {
|
|
32
27
|
this.dispatchClearOptionsEvent(product, productIndex);
|
|
28
|
+
this.clearSavedOptionsState(this.section.id, productIndex);
|
|
33
29
|
}
|
|
30
|
+
// Toggle the checkbox state
|
|
31
|
+
checkbox.checked = willBeChecked;
|
|
32
|
+
// Dispatch a change event to trigger form validation/submission
|
|
33
|
+
requestAnimationFrame(() => {
|
|
34
|
+
const changeEvent = new window.Event('change', { bubbles: true });
|
|
35
|
+
checkbox.dispatchEvent(changeEvent);
|
|
36
|
+
});
|
|
34
37
|
}
|
|
35
38
|
this.productSelected.emit({
|
|
36
39
|
product,
|
|
@@ -90,9 +93,9 @@ const SallaMultipleBundleProductSlider = /*@__PURE__*/ proxyCustomElement(class
|
|
|
90
93
|
return `bundle[${sectionId}][${productIndex}][id]`;
|
|
91
94
|
}
|
|
92
95
|
render() {
|
|
93
|
-
return (h(Host, { key: '
|
|
96
|
+
return (h(Host, { key: '0aeceebde05ad98ab11016dda3bd65f118b656dc' }, h("salla-slider", { key: '7def91aaa69d09caf6c5876b5d3221cc1db386f5', type: "carousel", controlsOuter: false, showControls: false, id: "accordion-multiple-bundle-product", pagination: true, class: "s-multiple-bundle-product-wrapper-slider", sliderConfig: {
|
|
94
97
|
spaceBetween: 0,
|
|
95
|
-
} }, h("div", { key: '
|
|
98
|
+
} }, h("div", { key: 'b9983965c9ba86120540d6df6bedaaca22ea0cd1', slot: "items" }, this?.section?.products?.map((product, productIndex) => {
|
|
96
99
|
const isChecked = this.selectedProducts[this.section.id]?.has(product.id) || false;
|
|
97
100
|
const hasSavedOptions = this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id, productIndex)];
|
|
98
101
|
const optionsButtonLabel = hasSavedOptions
|
|
@@ -220,20 +220,18 @@ const SallaUserMenu$1 = /*@__PURE__*/ proxyCustomElement(class SallaUserMenu ext
|
|
|
220
220
|
}, id: "trigger-slot", onClick: e => this.open(e), onKeyUp: e => this.open(e), innerHTML: this.replaceParams(this.triggerSlot) }));
|
|
221
221
|
}
|
|
222
222
|
getItemAnchorLinkAttrs(itemKey) {
|
|
223
|
-
if (itemKey === 'profile' && this.profileUrl) {
|
|
224
|
-
return this.
|
|
225
|
-
{ href: this.profileUrl, target: '_blank', rel: 'noopener noreferrer' } :
|
|
226
|
-
{ href: '/profile' };
|
|
223
|
+
if (itemKey === 'profile' && this.profileUrl && this.sallaAccountEnabled) {
|
|
224
|
+
return { href: this.profileUrl, target: '_blank', rel: 'noopener noreferrer' };
|
|
227
225
|
}
|
|
228
226
|
// Fix loyalty program URL mapping from master
|
|
229
227
|
const urlKey = itemKey === 'loyalty_program' ? 'loyalty' : itemKey;
|
|
230
|
-
return { href:
|
|
228
|
+
return { href: Salla.url.get(urlKey) };
|
|
231
229
|
}
|
|
232
230
|
getMenuItem([itemKey, itemValue], i) {
|
|
233
231
|
//todo:: enhancement support slot here
|
|
234
232
|
if (itemKey === 'wallet' && !window.can_access_wallet)
|
|
235
233
|
return;
|
|
236
|
-
if (itemKey === 'loyalty_program' && !
|
|
234
|
+
if (itemKey === 'loyalty_program' && !Salla.config.get('store.features').includes('loyalty-system'))
|
|
237
235
|
return;
|
|
238
236
|
return (h("li", { class: {
|
|
239
237
|
's-user-menu-dropdown-item': true,
|