@salla.sa/twilight-components 2.14.312 → 2.14.338
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-CiAt5i10.js → filepond-hpLROc_m.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DdEJEgnf.js → filepond-plugin-file-poster-C8gskRGl.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-0E5awx2w.js → filepond-plugin-file-validate-size-CaO6qVs6.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-gT-JewGH.js → filepond-plugin-file-validate-type-mUUtcgCs.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DtBf5E5M.js → filepond-plugin-image-edit-rptDhPuc.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-DlG1UV1W.js → filepond-plugin-image-exif-orientation-B6L8W0Qe.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-Dub3Jpec.js → filepond-plugin-image-preview-BoqOfOki.js} +1 -1
- package/dist/cjs/{index-BP5-4y-K.js → index-2liYDuhx.js} +583 -420
- package/dist/cjs/{index-i_mnWz5-.js → index-ChHHnqio.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion_62.cjs.entry.js +173 -94
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +2 -2
- 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 +60 -12
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-hook.cjs.entry.js +2 -2
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +2 -2
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
- 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 +3 -3
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-review-card.cjs.entry.js +2 -2
- package/dist/cjs/salla-reviews-page.cjs.entry.js +2 -2
- package/dist/cjs/salla-reviews.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +1 -1
- package/dist/collection/components/salla-button/salla-button.js +29 -13
- package/dist/collection/components/salla-comments/salla-comment-item.js +8 -3
- package/dist/collection/components/salla-comments/salla-comments.js +1 -1
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +62 -12
- package/dist/collection/components/salla-gifting/salla-gifting.js +3 -3
- package/dist/collection/components/salla-hook/salla-hook.js +1 -1
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
- package/dist/collection/components/salla-loading/salla-loading.js +1 -1
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +15 -2
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-program.js +1 -1
- package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
- package/dist/collection/components/salla-map/salla-map.js +3 -3
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
- package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
- package/dist/collection/components/salla-payments/salla-payments.js +2 -2
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
- package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
- package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
- package/dist/collection/components/salla-product-options/salla-product-options.js +37 -16
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +13 -2
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +2 -2
- package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
- package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
- package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
- package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
- package/dist/collection/components/salla-search/salla-search.js +3 -3
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-slider/salla-slider.js +2 -2
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +5 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +9 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/collection/plugins/commonjs-cache-fix.js +21 -0
- package/dist/components/axios.js +583 -420
- package/dist/components/index.js +2 -2
- package/dist/components/salla-apps-icons.js +1 -1
- package/dist/components/salla-button2.js +29 -13
- package/dist/components/salla-comment-item2.js +8 -3
- package/dist/components/salla-comments.js +1 -1
- package/dist/components/salla-filters-widget2.js +61 -11
- package/dist/components/salla-gifting.js +3 -3
- package/dist/components/salla-hook.js +1 -1
- package/dist/components/salla-list-tile2.js +1 -1
- package/dist/components/salla-loading2.js +1 -1
- package/dist/components/salla-localization-modal.js +1 -1
- package/dist/components/salla-login-modal.js +15 -2
- package/dist/components/salla-loyalty-prize-item.js +1 -1
- package/dist/components/salla-loyalty-program.js +1 -1
- package/dist/components/salla-maintenance-alert.js +1 -1
- package/dist/components/salla-map2.js +3 -3
- package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
- package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
- package/dist/components/salla-multiple-bundle-product-slider2.js +2 -2
- package/dist/components/salla-multiple-bundle-product.js +1 -1
- package/dist/components/salla-notification-item2.js +1 -1
- package/dist/components/salla-offer-modal.js +1 -1
- package/dist/components/salla-order-details-multiple-bundle-product2.js +1 -1
- package/dist/components/salla-order-details.js +1 -1
- package/dist/components/salla-order-summary.js +1 -1
- package/dist/components/salla-payments.js +2 -2
- package/dist/components/salla-placeholder2.js +1 -1
- package/dist/components/salla-price-range2.js +2 -2
- package/dist/components/salla-product-availability2.js +1 -1
- package/dist/components/salla-product-card2.js +5 -5
- package/dist/components/salla-product-options2.js +37 -16
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-quantity-input.js +13 -2
- package/dist/components/salla-quick-buy2.js +6 -4
- package/dist/components/salla-review-card2.js +1 -1
- package/dist/components/salla-reviews-page.js +1 -1
- package/dist/components/salla-reviews.js +1 -1
- package/dist/components/salla-scopes.js +1 -1
- package/dist/components/salla-search.js +3 -3
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-slider2.js +2 -2
- package/dist/components/salla-social-share.js +5 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-menu.js +9 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/esm/{filepond-aj0Vz3hN.js → filepond-CwjnR_95.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-lPOvqQlG.js → filepond-plugin-file-poster-DES9KQfe.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-CV5FbyeW.js → filepond-plugin-file-validate-size-BcloWdhO.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-B7RUT3W_.js → filepond-plugin-file-validate-type-CbjGxksB.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CXPgbHP6.js → filepond-plugin-image-edit-BtZ6aJg8.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-BKxDLyfR.js → filepond-plugin-image-exif-orientation-BVNb0UTU.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-B3b6dOj7.js → filepond-plugin-image-preview-t1v2q4Jq.js} +1 -1
- package/dist/esm/{index-BVJkSSs6.js → index-CRmtzwUF.js} +583 -420
- package/dist/esm/{index-CvvOXX3k.js → index-HmYGeOpS.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion_62.entry.js +173 -94
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +2 -2
- 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 +60 -12
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-hook.entry.js +2 -2
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
- package/dist/esm/salla-loyalty-program.entry.js +2 -2
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +2 -2
- package/dist/esm/salla-order-summary.entry.js +2 -2
- 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 +3 -3
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-review-card.entry.js +2 -2
- package/dist/esm/salla-reviews-page.entry.js +2 -2
- package/dist/esm/salla-reviews.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- 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 +3 -3
- package/dist/twilight/p-057e38a1.entry.js +4 -0
- package/dist/twilight/p-19f40612.entry.js +4 -0
- package/dist/twilight/{p-56e70b23.entry.js → p-1c31f335.entry.js} +1 -1
- package/dist/twilight/{p-3ba6d234.entry.js → p-1f31af27.entry.js} +1 -1
- package/dist/twilight/{p-caac78a8.entry.js → p-21ced14f.entry.js} +1 -1
- package/dist/twilight/{p-e7eeebf1.entry.js → p-2bb93ed0.entry.js} +1 -1
- package/dist/twilight/{p-a5780098.entry.js → p-3862a37f.entry.js} +1 -1
- package/dist/twilight/{p-65ce7926.entry.js → p-3f45a06b.entry.js} +1 -1
- package/dist/twilight/{p-0dcda629.entry.js → p-403bef37.entry.js} +1 -1
- package/dist/twilight/{p-62e50e0c.entry.js → p-4317d018.entry.js} +1 -1
- package/dist/twilight/{p-da2c81c6.entry.js → p-45053a9b.entry.js} +1 -1
- package/dist/twilight/{p-615331d4.entry.js → p-48d76aa7.entry.js} +1 -1
- package/dist/twilight/{p-366c2a7d.entry.js → p-56d3794f.entry.js} +1 -1
- package/dist/twilight/{p-061ec27c.entry.js → p-69600ceb.entry.js} +1 -1
- package/dist/twilight/{p-3c7c63ee.entry.js → p-817fca09.entry.js} +1 -1
- package/dist/twilight/{p-5606e8dd.entry.js → p-877ee446.entry.js} +1 -1
- package/dist/twilight/p-878f405f.entry.js +4 -0
- package/dist/twilight/{p-883a04da.entry.js → p-88c9cdc0.entry.js} +1 -1
- package/dist/twilight/p-8d231ba5.entry.js +4 -0
- package/dist/twilight/p-9108e972.entry.js +4 -0
- package/dist/twilight/p-95f3e7ea.entry.js +4 -0
- package/dist/twilight/{p-Bf2ln7Tf.js → p-BgkeXrDK.js} +1 -1
- package/dist/twilight/{p-CimxEIO_.js → p-BxtqlawD.js} +2 -2
- package/dist/twilight/p-CRmtzwUF.js +5 -0
- package/dist/twilight/{p-Cau1tMDQ.js → p-DTy6dAEi.js} +1 -1
- package/dist/twilight/{p-CtmyX8MN.js → p-DdMTtNYY.js} +1 -1
- package/dist/twilight/{p-CslymsND.js → p-VCBBJkYb.js} +1 -1
- package/dist/twilight/{p-CJWu6tW6.js → p-YYVkPdoE.js} +1 -1
- package/dist/twilight/{p-7d6d19b9.entry.js → p-a3ae644b.entry.js} +1 -1
- package/dist/twilight/{p-b3311168.entry.js → p-a4ad6d0b.entry.js} +1 -1
- package/dist/twilight/{p-3939ed34.entry.js → p-a665ff5d.entry.js} +1 -1
- package/dist/twilight/{p-032b235d.entry.js → p-a9bec6cf.entry.js} +1 -1
- package/dist/twilight/{p-41b68e9a.entry.js → p-b7f1e672.entry.js} +1 -1
- package/dist/twilight/p-c0f8d377.entry.js +11 -0
- package/dist/twilight/{p-0979d5a6.entry.js → p-e98f8bae.entry.js} +1 -1
- package/dist/twilight/{p-b9090ce1.entry.js → p-eb6378eb.entry.js} +1 -1
- package/dist/twilight/{p-0e4a8f9f.entry.js → p-ef827c32.entry.js} +1 -1
- package/dist/twilight/{p-c133896d.entry.js → p-f01949b5.entry.js} +1 -1
- package/dist/twilight/{p-5afe6962.entry.js → p-f10087fd.entry.js} +1 -1
- package/dist/twilight/{p-f586994e.entry.js → p-f33a5658.entry.js} +1 -1
- package/dist/twilight/p-f4dc16e8.entry.js +4 -0
- package/dist/twilight/{p-eb9bf011.entry.js → p-f6a7b2cf.entry.js} +1 -1
- package/dist/twilight/{p-DZVGmyCg.js → p-sFNa2aTl.js} +1 -1
- package/dist/twilight/{p-BQe0WtLQ.js → p-xAxNmkBV.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-button/salla-button.d.ts +0 -1
- package/dist/types/components/salla-comments/interfaces.d.ts +1 -0
- package/dist/types/components/salla-comments/salla-comment-item.d.ts +1 -0
- package/dist/types/components/salla-filters-widget/salla-filters-widget.d.ts +7 -2
- package/dist/types/components/salla-product-options/salla-product-options.d.ts +8 -0
- package/dist/types/components/salla-quantity-input/salla-quantity-input.d.ts +5 -1
- package/dist/types/components/salla-social-share/salla-social-share.d.ts +1 -0
- package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +1 -0
- package/package.json +5 -5
- package/dist/twilight/p-4657145b.entry.js +0 -11
- package/dist/twilight/p-7f03a939.entry.js +0 -4
- package/dist/twilight/p-87fe3f74.entry.js +0 -4
- package/dist/twilight/p-96f53e45.entry.js +0 -4
- package/dist/twilight/p-BVJkSSs6.js +0 -5
- package/dist/twilight/p-b81e66b2.entry.js +0 -4
- package/dist/twilight/p-d46b3cb6.entry.js +0 -4
- package/dist/twilight/p-e0c73f9b.entry.js +0 -4
- package/dist/twilight/p-f4383a51.entry.js +0 -4
|
@@ -22,6 +22,7 @@ export class SallaProductOptions {
|
|
|
22
22
|
this.selectAmount = salla.lang.getWithDefault('pages.products.select_amount', 'اختر المبلغ');
|
|
23
23
|
this.isCustomDonation = false;
|
|
24
24
|
this.selectedOptions = [];
|
|
25
|
+
this.canDisabled = false;
|
|
25
26
|
this.disableCardValue = true;
|
|
26
27
|
this.availableDigitalCardValues = [];
|
|
27
28
|
this.userInitiatedValidation = false;
|
|
@@ -77,7 +78,6 @@ export class SallaProductOptions {
|
|
|
77
78
|
const completed = option.donation.target_amount <= option.donation.collected_amount;
|
|
78
79
|
return h("div", { class: { "s-product-options-donation-message": true, "s-product-options-donation-completed": completed, "s-product-options-donation-expired": !completed } }, h("p", null, option.donation.target_message), h("span", { innerHTML: completed ? salla.money(option.donation.target_amount) : '' }));
|
|
79
80
|
};
|
|
80
|
-
this.canDisabled = !salla.config.get('store.settings.product.notify_options_availability') || salla.url.is_page('cart');
|
|
81
81
|
salla.lang.onLoaded(() => {
|
|
82
82
|
this.outOfStockText = salla.lang.get("pages.products.out_of_stock");
|
|
83
83
|
this.donationAmount = salla.lang.get('pages.products.donation_amount');
|
|
@@ -177,7 +177,7 @@ export class SallaProductOptions {
|
|
|
177
177
|
if (!closestProductOption.classList.contains('s-product-options-option-error')) {
|
|
178
178
|
closestProductOption.classList.add('s-product-options-option-error');
|
|
179
179
|
}
|
|
180
|
-
if (this.userInitiatedValidation && !salla.url.is_page('cart')) {
|
|
180
|
+
if ((this.userInitiatedValidation || salla.helpers.isIOSDevice()) && !salla.url.is_page('cart')) {
|
|
181
181
|
const firstInvalidElement = this.host.querySelector('.s-product-options-option-error');
|
|
182
182
|
if (firstInvalidElement === closestProductOption) {
|
|
183
183
|
this.scrollToElement(closestProductOption);
|
|
@@ -185,9 +185,9 @@ export class SallaProductOptions {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
scrollToElement(element) {
|
|
188
|
-
if (element)
|
|
189
|
-
|
|
190
|
-
}
|
|
188
|
+
if (!element)
|
|
189
|
+
return;
|
|
190
|
+
element.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
191
191
|
}
|
|
192
192
|
changedHandler(event, option, fireChangeEvent = true) {
|
|
193
193
|
const data = {
|
|
@@ -382,10 +382,17 @@ export class SallaProductOptions {
|
|
|
382
382
|
}
|
|
383
383
|
this.outOfStockText = salla.lang.get('pages.products.out_of_stock');
|
|
384
384
|
await salla.onReady();
|
|
385
|
-
|
|
385
|
+
this.canDisabled = !salla.config.get('store.settings.product.notify_options_availability') || salla.url.is_page('cart');
|
|
386
|
+
this.pasteHandler = this.handlePaste.bind(this);
|
|
387
|
+
document.addEventListener("paste", this.pasteHandler);
|
|
386
388
|
const needsCartId = (!salla.storage.get('cart.id') && this.optionsData.some(option => ['file', 'image'].includes(option.type)));
|
|
387
389
|
return needsCartId ? salla.api.cart.getCurrentCartId(false, "salla-product-options") : null;
|
|
388
390
|
}
|
|
391
|
+
disconnectedCallback() {
|
|
392
|
+
if (this.pasteHandler) {
|
|
393
|
+
document.removeEventListener("paste", this.pasteHandler);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
389
396
|
/**
|
|
390
397
|
* This is a workaround for a bug in iOS 26 Safari, when pasting English text to RTL inputs, it adds extra text!!
|
|
391
398
|
* To avoid any break changes, we will make it only work on these conditions:
|
|
@@ -399,7 +406,8 @@ export class SallaProductOptions {
|
|
|
399
406
|
const target = event.target;
|
|
400
407
|
if (!Salla.helpers.isAppleDevice()
|
|
401
408
|
|| !(target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement)
|
|
402
|
-
|| !target.classList.contains('s-form-control')
|
|
409
|
+
|| !target.classList.contains('s-form-control')
|
|
410
|
+
|| !this.host.contains(target)) {
|
|
403
411
|
return;
|
|
404
412
|
}
|
|
405
413
|
// Prevent default paste (to avoid Safari inserting extra content)
|
|
@@ -429,7 +437,7 @@ export class SallaProductOptions {
|
|
|
429
437
|
}
|
|
430
438
|
return (h(Host, { class: "s-product-options-wrapper" }, h("salla-conditional-fields", null, this.optionsData.map((option) => h("div", { key: option.id, class: `s-product-options-option-container${option.visibility_condition || this.hideDigitalCardsOptions(option) ? ' hidden' : ''}`, "data-option-id": option.id, ...this.getOptionShownWhen(option) }, option.name === 'splitter' ?
|
|
431
439
|
this.splitterOption()
|
|
432
|
-
: h("div", { class: { "s-product-options-option": true, "s-product-options-option-booking": option.type === DisplayType.BOOKING && salla.url.is_page("cart") }, "data-option-type": option.type, "data-option-required": `${option.required}` }, h("label", { htmlFor: this.
|
|
440
|
+
: h("div", { class: { "s-product-options-option": true, "s-product-options-option-booking": option.type === DisplayType.BOOKING && salla.url.is_page("cart") }, "data-option-type": option.type, "data-option-required": `${option.required}` }, h("label", { htmlFor: this.generateInputId(option.id), class: `s-product-options-option-label ${this.hideLabel(option) ? 's-product-options-option-label-hidden' : ''}` }, h("b", null, option.name, option.required && h("span", null, " * "), " "), h("small", null, option.placeholder)), h("div", { class: `s-product-options-option-content ${this.hideLabel(option) || (option.type === DisplayType.BOOKING && salla.url.is_page("cart")) ? 's-product-options-option-content-full-width' : ''}` }, this.getDisplayForType(option))))))));
|
|
433
441
|
}
|
|
434
442
|
generateUniqueKey(defaultValue) {
|
|
435
443
|
const contextData = this.bundleContext;
|
|
@@ -449,6 +457,14 @@ export class SallaProductOptions {
|
|
|
449
457
|
}
|
|
450
458
|
return baseKey;
|
|
451
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* Generate a valid HTML id for option inputs.
|
|
462
|
+
* @param optionId - The option ID
|
|
463
|
+
* @returns The formatted id string
|
|
464
|
+
*/
|
|
465
|
+
generateInputId(optionId) {
|
|
466
|
+
return this.generateUniqueKey(`option-${optionId}`);
|
|
467
|
+
}
|
|
452
468
|
/**
|
|
453
469
|
* Generate the correct input name based on bundle context
|
|
454
470
|
* @param optionId - The option ID
|
|
@@ -456,6 +472,7 @@ export class SallaProductOptions {
|
|
|
456
472
|
*/
|
|
457
473
|
generateInputName(optionId) {
|
|
458
474
|
const contextData = this.bundleContext;
|
|
475
|
+
const baseOptionId = optionId.toString();
|
|
459
476
|
if (contextData) {
|
|
460
477
|
try {
|
|
461
478
|
// Handle both string and object types
|
|
@@ -463,13 +480,13 @@ export class SallaProductOptions {
|
|
|
463
480
|
? JSON.parse(contextData)
|
|
464
481
|
: contextData;
|
|
465
482
|
const { sectionId, productId } = context;
|
|
466
|
-
return `bundle[${sectionId}][${productId}][options][${
|
|
483
|
+
return `bundle[${sectionId}][${productId}][options][${baseOptionId}]`;
|
|
467
484
|
}
|
|
468
485
|
catch (e) {
|
|
469
|
-
return `options[${
|
|
486
|
+
return `options[${baseOptionId}]`;
|
|
470
487
|
}
|
|
471
488
|
}
|
|
472
|
-
return `options[${
|
|
489
|
+
return `options[${baseOptionId}]`;
|
|
473
490
|
}
|
|
474
491
|
fillSelectedOptions() {
|
|
475
492
|
this.selectedOptions = this.optionsData.reduce((acc, opt) => {
|
|
@@ -547,7 +564,7 @@ export class SallaProductOptions {
|
|
|
547
564
|
// TODO: (ONLY FOR TESTING!) find a better way to make it testable, e.g. wrap it with a unique class like textOption
|
|
548
565
|
//@ts-ignore
|
|
549
566
|
numberOption(option) {
|
|
550
|
-
return h("input", { type: "text", value: option.value, class: "s-form-control", required: !option.visibility_condition && option.required, name: this.generateInputName(option.id), placeholder: option.placeholder, onBlur: e => this.changedHandler(e, option), onInvalid: (e) => this.invalidHandler(e, option), onInput: e => salla.helpers.inputDigitsOnly(e.target) });
|
|
567
|
+
return h("input", { type: "text", value: option.value, class: "s-form-control", required: !option.visibility_condition && option.required, id: this.generateInputId(option.id), name: this.generateInputName(option.id), placeholder: option.placeholder, onBlur: e => this.changedHandler(e, option), onInvalid: (e) => this.invalidHandler(e, option), onInput: e => salla.helpers.inputDigitsOnly(e.target) });
|
|
551
568
|
}
|
|
552
569
|
//@ts-ignore
|
|
553
570
|
splitterOption() {
|
|
@@ -555,12 +572,12 @@ export class SallaProductOptions {
|
|
|
555
572
|
}
|
|
556
573
|
//@ts-ignore
|
|
557
574
|
textOption(option) {
|
|
558
|
-
return h("div", { class: "s-product-options-text" }, h("input", { type: "text", value: option.value, maxLength: option?.length, class: 's-form-control', required: !option.visibility_condition && option.required, name: this.generateInputName(option.id), placeholder: option.placeholder, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option) }));
|
|
575
|
+
return h("div", { class: "s-product-options-text" }, h("input", { type: "text", value: option.value, maxLength: option?.length, class: 's-form-control', required: !option.visibility_condition && option.required, id: this.generateInputId(option.id), name: this.generateInputName(option.id), placeholder: option.placeholder, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option) }));
|
|
559
576
|
}
|
|
560
577
|
//@ts-ignore
|
|
561
578
|
textareaOption(option) {
|
|
562
579
|
//todo::remove mt-1 class, and if it's okay to remove the tag itself will be great
|
|
563
|
-
return h("div", { class: "s-product-options-textarea" }, h("div", { class: "mt-1" }, h("textarea", { rows: 4, value: option.value, maxLength: option?.length, class: "s-form-control", required: !option.visibility_condition && option.required, id: this.
|
|
580
|
+
return h("div", { class: "s-product-options-textarea" }, h("div", { class: "mt-1" }, h("textarea", { rows: 4, value: option.value, maxLength: option?.length, class: "s-form-control", required: !option.visibility_condition && option.required, id: this.generateInputId(option.id), name: this.generateInputName(option.id), placeholder: option.placeholder, onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) })));
|
|
564
581
|
}
|
|
565
582
|
//@ts-ignore
|
|
566
583
|
mapOption(option) {
|
|
@@ -656,7 +673,7 @@ export class SallaProductOptions {
|
|
|
656
673
|
* @returns HTMLElement - A select dropdown element with all option details.
|
|
657
674
|
*/
|
|
658
675
|
renderSelect(option) {
|
|
659
|
-
return (h("div", null, h("select", { name: this.generateInputName(option.id), required: !option.visibility_condition && option.required, class: "s-form-control", onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) }, h("option", { value: "" }, option.placeholder), option?.details.map((detail) => (h("option", { key: detail.id, value: detail.id, disabled: this.canDisabled && this.isOptionDetailOut(detail), selected: detail.is_selected }, this.getOptionDetailName(detail)))))));
|
|
676
|
+
return (h("div", null, h("select", { id: this.generateInputId(option.id), name: this.generateInputName(option.id), required: !option.visibility_condition && option.required, class: "s-form-control", onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) }, h("option", { value: "" }, option.placeholder), option?.details.map((detail) => (h("option", { key: detail.id, value: detail.id, disabled: this.canDisabled && this.isOptionDetailOut(detail), selected: detail.is_selected }, this.getOptionDetailName(detail)))))));
|
|
660
677
|
}
|
|
661
678
|
/**
|
|
662
679
|
* Renders a grid-based layout for option inputs (radio or checkbox).
|
|
@@ -732,7 +749,11 @@ export class SallaProductOptions {
|
|
|
732
749
|
}
|
|
733
750
|
countryOption(option) {
|
|
734
751
|
return h("div", { class: "s-product-options-digital-card-wrapper" }, option.details.map((detail) => {
|
|
735
|
-
return h("label", { htmlFor: this.generateUniqueKey(detail.id.toString()), key: detail.id, class: { "s-product-options-digital-card-option": true, "s-product-options-digital-card-option-stock-out": detail.is_out } }, h("input", { id: this.generateUniqueKey(detail.id.toString()), type: "radio", class: "s-form-control s-product-options-digital-card-input", value: detail.id, name: this.generateInputName(option.id), disabled: detail.is_out, required: !option.visibility_condition && option.required, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option), onClick: () => { this.disableCardValue = false; }, ...(salla.url.is_page("cart") ? { defaultChecked: this.getSelectedDigitalCardOptions(option)?.id === detail.id } : {}) }), h("img", { loading:
|
|
752
|
+
return h("label", { htmlFor: this.generateUniqueKey(detail.id.toString()), key: detail.id, class: { "s-product-options-digital-card-option": true, "s-product-options-digital-card-option-stock-out": detail.is_out } }, h("input", { id: this.generateUniqueKey(detail.id.toString()), type: "radio", class: "s-form-control s-product-options-digital-card-input", value: detail.id, name: this.generateInputName(option.id), disabled: detail.is_out, required: !option.visibility_condition && option.required, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option), onClick: () => { this.disableCardValue = false; }, ...(salla.url.is_page("cart") ? { defaultChecked: this.getSelectedDigitalCardOptions(option)?.id === detail.id } : {}) }), h("img", { loading: "lazy", alt: detail.code, height: 24, width: 24, class: "s-product-options-country-flag", src: `https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(detail.code).toLocaleLowerCase()}.svg`, onError: e => {
|
|
753
|
+
e.currentTarget.onerror = null;
|
|
754
|
+
e.currentTarget.src =
|
|
755
|
+
salla.url.cdn('images/globe.svg');
|
|
756
|
+
} }), h("span", null, detail.name));
|
|
736
757
|
}));
|
|
737
758
|
}
|
|
738
759
|
static get is() { return "salla-product-options"; }
|
|
@@ -45,11 +45,11 @@ export class SallaProductSizeGuide {
|
|
|
45
45
|
return h("salla-placeholder", { alignment: "center", iconSize: "xl" }, h("div", { slot: "title" }, this.placeholder_title), h("div", { slot: "description" }, this.placeholder_description));
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h("salla-modal", { key: '
|
|
48
|
+
return (h("salla-modal", { key: '6c952c6cdd01f99332809112fd5921c4b43cd518', class: "s-product-size-guide-wrapper", id: 'salla-product-size-guide-modal', isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, h("span", { key: 'f4260144f981da0081e09895b7a065cad1fa66bc', slot: 'icon', class: "s-product-size-guide-header-icon", innerHTML: PencilRuler }), h("div", { key: '80e28a80741f103fdc788a6afa8809dfabfd64f6', slot: "loading" }, h("div", { key: 'e190d657a6a03e48a813c2f78321c12cf95eadcb', class: "s-product-size-guide-skeleton" }, h("salla-skeleton", { key: '94cb87240b52244a86ba76893261048aa3f356d9', height: '15px', width: '25%' }), h("div", { key: 'c8bba70713c78829d0973b845a3ed942cb7fa150', class: "s-product-size-guide-skeleton-header" }, h("salla-skeleton", { key: '13b2fe8a4655457567d087e5763e43abb8b2d2a5', height: '40px' }), h("salla-skeleton", { key: '4b23015076c7c44794eecf85a4355264f778ef10', height: '40px' }), h("salla-skeleton", { key: '3cd58dfafb05cc2bac89ad6973247075d0dd9571', height: '40px' }), h("salla-skeleton", { key: '36f28def58893e567e6186d94ec3a84abed159ab', height: '40px' })), h("div", { key: '854881c782f372b2ed1b08874dfa4bd5d64edef2', class: "s-product-size-guide-skeleton-content" }, h("salla-skeleton", { key: 'a790751c95177a49135859f5810b4cd947fa4314', height: '15px', width: '25%' }), h("salla-skeleton", { key: 'a9e4bd9a0bf55bd391da7f68ba85db7893f1eb81', height: '10px', width: '75%' }), h("salla-skeleton", { key: 'b0f73c83abd9b6e8521dacb823d65f13f9ba54bb', height: '10px', width: '50%' }), h("salla-skeleton", { key: 'fe92879eedf28801c4d267e4595e5f4aa5c7b871', height: '10px', width: '75%' }), h("salla-skeleton", { key: '652d460114bc710073adcb2e31a6627c938259c5', height: '10px', width: '100%' }), h("salla-skeleton", { key: '71f461d5256a05d4ac407b00daf2e20dccef0cf5', height: '10px', width: '25%' }), h("salla-skeleton", { key: 'dbd224caad4233eb0bf8a5012fab7160d067d371', height: '10px', width: '60%' }), h("salla-skeleton", { key: 'c87baa836ae0282047ccc8b7fb122a80cdf7256a', height: '10px', width: '45%' }), h("salla-skeleton", { key: '2c02db790ed567de556d7fa74f48843d156dedb6', height: '10px', width: '30%' })))), h("slot", { key: '155efc69836cfc62382a8b3f7929c7200244f4ba', name: "header" }), !this.hasError && !!this.guides ?
|
|
49
49
|
[
|
|
50
50
|
h("salla-tabs", null, this.guides.map((guide) => h("salla-tab-header", { slot: "header", name: guide.name }, h("span", null, guide.name))), this.guides.map((guide) => h("salla-tab-content", { slot: "content", name: guide.name }, h("div", { innerHTML: guide.description }))))
|
|
51
51
|
]
|
|
52
|
-
: this.showPlaceholder(), h("slot", { key: '
|
|
52
|
+
: this.showPlaceholder(), h("slot", { key: '6d212a3d48df9363485e77f37f71276a1c3f8ee7', name: "footer" })));
|
|
53
53
|
}
|
|
54
54
|
static get is() { return "salla-product-size-guide"; }
|
|
55
55
|
static get originalStyleUrls() {
|
|
@@ -7,6 +7,10 @@ import Minus from "../../assets/svg/minus.svg";
|
|
|
7
7
|
import Helper from "../../Helpers/Helper";
|
|
8
8
|
export class SallaQuantityInput {
|
|
9
9
|
constructor() {
|
|
10
|
+
/**
|
|
11
|
+
* Based on store setting: store.settings.product.manual_quantity
|
|
12
|
+
*/
|
|
13
|
+
this.disableInput = false;
|
|
10
14
|
this.hostAttributes = {};
|
|
11
15
|
this.hasIncrementSlot = false;
|
|
12
16
|
this.hasDecrementSlot = false;
|
|
@@ -32,7 +36,9 @@ export class SallaQuantityInput {
|
|
|
32
36
|
});
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
|
-
componentWillLoad() {
|
|
39
|
+
async componentWillLoad() {
|
|
40
|
+
await salla.onReady();
|
|
41
|
+
this.disableInput = salla.config.get('store.settings.product.manual_quantity');
|
|
36
42
|
this.quantity = parseInt(this.host.getAttribute('value')) || 1;
|
|
37
43
|
this.hasIncrementSlot = !!this.host.querySelector('[slot="increment-button"]');
|
|
38
44
|
this.hasDecrementSlot = !!this.host.querySelector('[slot="decrement-button"]');
|
|
@@ -80,7 +86,11 @@ export class SallaQuantityInput {
|
|
|
80
86
|
return this.host;
|
|
81
87
|
}
|
|
82
88
|
render() {
|
|
83
|
-
|
|
89
|
+
const inputAttributes = this.getInputAttributes();
|
|
90
|
+
if (!inputAttributes['aria-label'] && !inputAttributes['aria-labelledby']) {
|
|
91
|
+
inputAttributes['aria-label'] = salla.lang.getWithDefault('common.elements.quantity', 'Quantity');
|
|
92
|
+
}
|
|
93
|
+
return (h(Host, { key: '4dfc6c39c86047493c7b37057c877657fc6206ab', class: "s-quantity-input" }, h("div", { key: '246b30299c5b318d9412d7b065e0a219a77ba342', class: "s-quantity-input-container" }, h("button", { key: '1e8f61c6014f36e257fbc7958547228481393624', onClick: () => this.increase(), class: "s-quantity-input-increase-button s-quantity-input-button", type: "button", "aria-label": salla.lang.getWithDefault('common.elements.increase_quantity', 'Increase quantity') }, !this.hasIncrementSlot ? h("span", { innerHTML: Add }) : '', h("slot", { key: '1da4aa703d8f135437e49b35c8bd664a39c207cc', name: "increment-button" })), h("input", { key: 'd781816bc3fa9b2fc5d004c5284a583f0dc4f75b', class: "s-quantity-input-input", ...inputAttributes, ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", readOnly: this.disableInput, value: this.quantity }), h("button", { key: 'a52ed57453eeae844e435de4f1d0e9ae66768892', class: "s-quantity-input-decrease-button s-quantity-input-button", onClick: () => this.decrease(), type: "button", "aria-label": salla.lang.getWithDefault('common.elements.decrease_quantity', 'Decrease quantity') }, !this.hasDecrementSlot ? h("span", { innerHTML: Minus }) : '', h("slot", { key: '9c2b8ef10df5dc976120249dbc5fb6d3e3b68d31', name: "decrement-button" })))));
|
|
84
94
|
}
|
|
85
95
|
static get is() { return "salla-quantity-input"; }
|
|
86
96
|
static get originalStyleUrls() {
|
|
@@ -118,6 +128,7 @@ export class SallaQuantityInput {
|
|
|
118
128
|
}
|
|
119
129
|
static get states() {
|
|
120
130
|
return {
|
|
131
|
+
"disableInput": {},
|
|
121
132
|
"quantity": {},
|
|
122
133
|
"fireChangeEvent": {}
|
|
123
134
|
};
|
|
@@ -129,7 +129,7 @@ export class SallaQuickBuy {
|
|
|
129
129
|
return new Promise((resolve, reject) => {
|
|
130
130
|
salla.onReady(async () => {
|
|
131
131
|
if (!this.currency) {
|
|
132
|
-
this.currency = salla.config.get('user.currency_code');
|
|
132
|
+
this.currency = salla.config.get('store.settings.buy_now.multi_currency') ? salla.config.get('user.currency_code') : 'SAR';
|
|
133
133
|
}
|
|
134
134
|
if (!this.productId && salla.config.get('page.id')) {
|
|
135
135
|
this.productId = salla.config.get('page.id');
|
|
@@ -184,7 +184,7 @@ export class SallaQuickBuy {
|
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
render() {
|
|
187
|
-
return h(Host, { key: '
|
|
187
|
+
return h(Host, { key: 'a6093f9df07d58cc290a3376c44847c8b4c345ce' }, this.quickBuyButton());
|
|
188
188
|
}
|
|
189
189
|
quickBuyButton() {
|
|
190
190
|
return h("apple-pay-button", { locale: salla.config.get('user.language_code'), onClick: () => this.quickBuyHandler(), "data-quick-purchase": "applepay", class: "s-quick-buy-apple-pay", "data-is-applepay": "1", buttonstyle: "black", type: this.type });
|
|
@@ -158,7 +158,7 @@ export class SallaReviewCard {
|
|
|
158
158
|
return (h("a", { href: this.review?.product?.url, class: "s-review-card-product-container" }, h("img", { alt: product.image?.alt || "Product", src: product.image?.url, class: "s-review-card-product-image", width: 60, height: 60, loading: "lazy", decoding: "async", draggable: false }), h("div", { class: "s-review-card-product-details" }, h("p", { class: "s-review-card-product-details-name" }, product.name), this.showPurchaseCount ? h("p", { class: "s-review-card-product-details-purchase-count" }, h("span", { innerHTML: IconFire2 }), this.purchasedCount) : null)));
|
|
159
159
|
}
|
|
160
160
|
render() {
|
|
161
|
-
return h("div", { key: '
|
|
161
|
+
return h("div", { key: '251b76f2f2935ab7be248f589badaebe0f297cb2', class: "s-review-card-container" }, this.renderSlider(), this.renderSingleImage(), renderDivider(), h("div", { key: '2621097a4115e278b1b99d46b6be22341a7ea064', class: "s-review-card-content" }, this.renderHeader(), h("p", { key: 'cd641970280867954f431fc3a2812080ebe32bd9', class: "s-review-card-review-content", innerHTML: this.review?.content }), renderDivider(), this.renderProductInfo()));
|
|
162
162
|
}
|
|
163
163
|
static get is() { return "salla-review-card"; }
|
|
164
164
|
static get originalStyleUrls() {
|
|
@@ -85,7 +85,7 @@ export class SallaReviews {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
render() {
|
|
88
|
-
return (h("div", { key: '
|
|
88
|
+
return (h("div", { key: 'aa4937182950d1b0fbcb67aa577d6fb3c413af79', class: "s-reviews-container" }, h("div", { key: 'dbfb22a037c29a0bf88b73481aa8ea4988ef819a', class: "s-reviews-header-wrapper" }, h("h1", { key: '7b874af56f8933777942d829d1311cd0854e5a12', class: "s-reviews-header" }, this.testimonialText), !!this.displayAllLink ? (h("a", { href: this.displayAllURL, class: "s-reviews-display-all" }, this.displayAllLinkText, h("span", { class: "s-reviews-display-all-icon", innerHTML: IconArrowLeft }))) : null), h("salla-slider", { key: '0050aac87a3aadc858aa352ba7ac82158bb586de', centered: true, "slides-per-view": 1, type: "testimonials", class: "s-reviews-testimonials-slider", "controls-outer": true, "auto-play": true, id: `testimonials-${this.source}-slider` }, h("div", { key: '7d1801d35aeba19fa913609202128b6866ca7118', slot: "items" }, this.reviews.map((item, index) => (h("div", { key: index, class: "s-reviews-swiper-slide" }, h("div", { class: "s-reviews-testimonial" }, h("div", { class: "s-reviews-testimonial__inner" }, h("div", { class: "s-reviews-testimonial__avatar" }, h("img", { src: 'images/s-empty.png', "data-src": item.avatar, alt: item.name ? item.name : 'testimonial-' + index, class: "lazy" })), h("div", { class: "s-reviews-testimonial__text" }, h("p", { innerHTML: item.content }), h("div", { class: "s-reviews-testimonial__name_wrapper" }, h("div", { class: "s-reviews-testimonial__info" }, item.name && h("h2", null, `${item.name}`)), h("div", { class: "s-reviews-testimonial__rating" }, h("salla-rating-stars", { size: "small", value: item.stars })))), h("span", { class: "s-reviews-testimonial__icon", innerHTML: IconQuoteOpen }))))))))));
|
|
89
89
|
}
|
|
90
90
|
static get is() { return "salla-reviews"; }
|
|
91
91
|
static get originalStyleUrls() {
|
|
@@ -142,7 +142,7 @@ export class SallaReviewsPage {
|
|
|
142
142
|
return options.map(option => (h("option", { key: option.value, value: option.value, selected: option.value === this.sort }, option.label)));
|
|
143
143
|
}
|
|
144
144
|
render() {
|
|
145
|
-
return (h("host", { key: '
|
|
145
|
+
return (h("host", { key: '5e3b4042e6412dd2fdef3d776d4204c731df6c80' }, h("div", { key: 'a9daf869bac109b7c627c9fd8fd7c84cd4dd2965', class: "s-reviews-page-header-wrapper" }, h("h2", { key: '01cd6892650d8288003d79b4c12e82c4693e1cb6', class: "s-reviews-page-title" }, this.langTitlesReviews, h("span", { key: '935329858a3cc699da6fb6fb8c8515348ded9eb4', class: "s-reviews-page-count" }, "(", this.langRatingReviews, ")")), h("div", { key: 'e74312403c6dc7625c0c2090e6627a8a6b5fca9b', class: "s-reviews-page-filter-wrapper" }, h("label", { key: 'bf51576936b030ee59836861b03fa3b06471ed1f', class: "s-reviews-page-filter-label", htmlFor: "testimonials-filter" }, this.langSorting), h("select", { key: '72f09a679c5f42b08f55b908f67f3d3627b3a50c', onChange: (e) => this.handleSorting(e), disabled: !this.reviews.length, class: "s-reviews-page-filter" }, this.renderSortingOptions()))), this.reviews.length ? h("main", { class: "s-reviews-page-grid", ref: el => {
|
|
146
146
|
this.wrapper = el;
|
|
147
147
|
} }, this.reviews.map(review => (h("salla-review-card", { key: review.id, review: review }))))
|
|
148
148
|
: h("div", { class: "s-products-list-placeholder" }, h("span", { innerHTML: ShoppingBag }), h("p", null, this.placeholderText)), this.pagination?.links?.next && this.reviews.length ? (h("div", { class: "s-reviews-page-load-more-container" }, h("salla-button", { class: "s-reviews-page-load-more-btn", loading: this.isLoading, onClick: () => this.infiniteScroll?.loadNextPage(), onKeyUp: () => this.infiniteScroll?.loadNextPage() }, this.langLoadMore))) : null));
|
|
@@ -146,7 +146,7 @@ export class SallaScopees {
|
|
|
146
146
|
return salla.onReady();
|
|
147
147
|
}
|
|
148
148
|
render() {
|
|
149
|
-
return (h(Host, { key: '
|
|
149
|
+
return (h(Host, { key: '8cbe5fbbe87bff9b835ae59fc92278725a9d09cf' }, h("salla-modal", { key: '82017d18802be5fa8fff95b2cbe32886308bb23e', ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: this.loading, "has-skeleton": true }, this.loading ?
|
|
150
150
|
h("div", { slot: "loading" }, h("div", { class: "s-scopes-skeleton" }, h("salla-list-tile", { class: "s-scopes-header" }, h("div", { slot: "icon", class: "s-scopes-header-icon" }, h("salla-skeleton", { type: "circle" })), h("div", { slot: "title", class: "s-scopes-header-title mb-5" }, h("salla-skeleton", { height: '15px', width: '50%' })), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, h("salla-skeleton", { height: '10px' }), h("salla-skeleton", { height: '10px', width: '75%' }))), h("div", { class: "s-scopes-skeleton-search" }, h("salla-skeleton", { height: '10px', width: '50%' }), h("salla-skeleton", { height: '30px', width: '100%' })), h("div", { class: "s-scopes-skeleton-scopes" }, h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' })), h("div", { class: "s-scopes-skeleton-btn" }, h("salla-skeleton", { height: '40px', width: '100%' }))))
|
|
151
151
|
:
|
|
152
152
|
[h("salla-list-tile", { class: this.originalScopesList?.length ? "s-scopes-header block" : "s-hidden" }, h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), h("div", { slot: "title", class: "s-scopes-header-title" }, salla.lang.get('blocks.scope.you_are_browse_store_from')), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, !!this.selected_scope ? this.selected_scope.name : "")), h("div", { class: "s-scopes-wrap" }, !!this.originalScopesList?.length && h("h4", { class: "s-scopes-title" }, this.getFormTitle()), this.originalScopesList?.length > this.searchDisplayLimit ?
|
|
@@ -121,12 +121,12 @@ export class SallaSearch {
|
|
|
121
121
|
this.inputValue.length < 3 ? this.container.classList.remove('s-search-no-results') : '';
|
|
122
122
|
}
|
|
123
123
|
render() {
|
|
124
|
-
const searchContent = h("div", { key: '
|
|
125
|
-
h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search })) : null), h("div", { key: '
|
|
124
|
+
const searchContent = h("div", { key: '2e945555af379b5992375336c5b33a1dbb92589b', class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => this.container = container }, h("div", { key: '28c948e49a1d72a3a79e87477f37cc5f26dd4b3a', class: "s-search-input-wrapper" }, h("span", { key: 'b053ea1b4e6ed3c4030010dd61923421fcfeb214', class: "s-search-icon-wrap" }, h("span", { key: 'e1ecd01ab77d0ddd0b7b2010788fe28deaebd2af', class: "s-search-icon", innerHTML: this.loading ? '<i class="s-search-spinner-loader"/>' : Search })), h("input", { key: 'bca441ce72aac9bb85f2862413c77fa853e703c6', type: "search", enterkeyhint: "search", autocomplete: "off", class: "s-search-input", placeholder: salla.lang.get('blocks.header.search_placeholder'), onInput: (e) => this.limitWordsAndSearch(e), onKeyDown: e => this.handleKeyDown(e), ref: input => this.searchInput = input, style: { height: this.height + 'px', borderRadius: this.oval ? this.height / 2 + 'px' : '' } }), this.showAction ?
|
|
125
|
+
h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search })) : null), h("div", { key: '07ed4d8828b8343dd05bacb3a6904ad30eacce7a', class: "s-search-results" }, this.results?.data.map((product) => h("a", { href: product.url + '?from=search-bar', class: { "s-search-product": true, 's-search-product-not-available': !product.is_available }, innerHTML: this.productSlot
|
|
126
126
|
.replace(/\{name\}/g, product.name)
|
|
127
127
|
.replace(/\{price\}/g, product.price ? salla.money(product.price) : '')
|
|
128
128
|
.replace(/\{regular_price\}/g, product.is_on_sale && product.regular_price ? salla.money(product.regular_price) : '')
|
|
129
|
-
.replace(/\{image\}/g, product.image.url) })), h("p", { key: '
|
|
129
|
+
.replace(/\{image\}/g, product.image.url) })), h("p", { key: '7a3420f60f2172f39c44633176a454f9ae06f0ce', ref: el => this.noResults = el, class: "s-search-no-results-placeholder" }, salla.lang.get('common.elements.no_options'))));
|
|
130
130
|
return (this.inline ?
|
|
131
131
|
h("div", { class: "s-search-modal" }, searchContent)
|
|
132
132
|
:
|
|
@@ -22,7 +22,7 @@ export class SallaSkeleton {
|
|
|
22
22
|
's-skeleton-item': true,
|
|
23
23
|
's-skeleton-item-circular': this.type == 'circle',
|
|
24
24
|
};
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: 'ad465a77b10e2f1d739c802643076f63985cfda5', class: "s-skeleton-wrapper", style: { width: this.width, height: this.height } }, h("div", { key: '0b05bcfc21d3bcb85389a2a0c9b63c3a7aa28d60', class: classes }, "\u00A0")));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "salla-skeleton"; }
|
|
28
28
|
static get originalStyleUrls() {
|
|
@@ -507,7 +507,7 @@ export class SallaSlider {
|
|
|
507
507
|
classes += this.verticalThumbs ? ' s-slider-vertical ' : ' s-slider-horizontal ';
|
|
508
508
|
classes += this.arrowsCentered ? ' s-slider-v-centered ' : '';
|
|
509
509
|
classes += this.gridThumbs ? ' s-slider-with-grid-thumbs ' : '';
|
|
510
|
-
return (h(Host, { key: '
|
|
510
|
+
return (h(Host, { key: '1ea8cca50a8069cfa57617a79d84a1d9a9f85d8a', class: 's-slider-wrapper ' + classes }, this.blockTitle || this.showControls ?
|
|
511
511
|
h("div", { class: "s-slider-block__title" }, this.blockTitle ?
|
|
512
512
|
h("div", { class: "s-slider-block__title-right" }, h("h2", null, this.blockTitle), this.blockSubtitle ? h("p", { innerHTML: this.blockSubtitle }) : '')
|
|
513
513
|
: '', h("div", { class: "s-slider-block__title-left" }, this.displayAllUrl ?
|
|
@@ -515,7 +515,7 @@ export class SallaSlider {
|
|
|
515
515
|
: '', this.showControls ?
|
|
516
516
|
h("div", { class: "s-slider-block__title-nav", dir: "rtl" }, h("button", { "aria-label": "Previous Slide", class: "s-slider-prev s-slider-nav-arrow" }, h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon })), h("button", { "aria-label": "Next Slide", class: "s-slider-next s-slider-nav-arrow" }, h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon })))
|
|
517
517
|
: ''))
|
|
518
|
-
: '', h("div", { key: '
|
|
518
|
+
: '', h("div", { key: 'e782e1a255ef74387e143be5e54ec8212b133f63', class: "swiper s-slider-container", ref: el => this.sliderContainer = el, dir: this.vertical ? "ltr" : this.direction }, h("slot", { key: 'e69fb142f47b11d749a0ea2676177118eaa2093a' }), h("div", { key: '469f85e0a975a1de25c6c6c47918b85bb640e271', class: "swiper-wrapper s-slider-swiper-wrapper", ref: el => this.sliderWrapper = el }, h("slot", { key: '87d7c9b65e2d499bbd716a17ec5ce1f3079cc750', name: 'items' })), this.pagination ? h("div", { class: "swiper-pagination" }) : ''), this.type == 'thumbs' && this.hasThumbSlot ? h("div", { class: "s-slider-thumbs" }, h("div", { class: "swiper s-slider-thumbs-container", dir: this.getThumbsDirection(), ref: el => this.thumbsSliderContainer = el }, h("div", { class: { "s-slider-swiper-wrapper swiper-wrapper": true, "s-slider-grid-thumbs": this.gridThumbs }, ref: el => this.thumbsSliderWrapper = el }, h("slot", { name: "thumbs" })), this.showThumbsControls ?
|
|
519
519
|
h("div", { class: "s-slider-thumbs-nav", dir: "rtl" }, h("button", { "aria-label": "Previous Slide", class: "s-slider-thumbs-prev s-slider-nav-arrow" }, h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon })), h("button", { "aria-label": "Next Slide", class: "s-slider-thumbs-next s-slider-nav-arrow" }, h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon })))
|
|
520
520
|
: null))
|
|
521
521
|
: null));
|
|
@@ -31,7 +31,7 @@ export class SallaSocial {
|
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
33
|
const linksArray = this.getLinksArray();
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: 'a0bcd60fddd2fd8e86f32cd71d484ec76d02cf49' }, h("ul", { key: 'b595d8de59199de5081370b9440c8a46cb8c751f', class: "s-social-list" }, linksArray.map((link) => (h("li", { class: "s-social-link" }, h("div", { id: "social-slot", innerHTML: this.socialSlot
|
|
35
35
|
.replace(/\{icon\}/g, this.iconsList[link.type])
|
|
36
36
|
.replace(/\{type\}/g, link.type)
|
|
37
37
|
.replace(/\{link\}/g, link.value.toString()) })))))));
|
|
@@ -40,6 +40,9 @@ export class SallaSocialShare {
|
|
|
40
40
|
this.platforms = 'facebook,twitter,whatsapp,email,copy_link';
|
|
41
41
|
}
|
|
42
42
|
componentWillLoad() {
|
|
43
|
+
if (this.host.hasAttribute('aria-label')) {
|
|
44
|
+
this.host.removeAttribute('aria-label');
|
|
45
|
+
}
|
|
43
46
|
if (document.getElementById('a2a-script')) {
|
|
44
47
|
return;
|
|
45
48
|
}
|
|
@@ -119,7 +122,7 @@ export class SallaSocialShare {
|
|
|
119
122
|
window.a2a?.init('page');
|
|
120
123
|
}
|
|
121
124
|
render() {
|
|
122
|
-
return (h("div", { key: '
|
|
125
|
+
return (h("div", { key: 'c4ac8faea4a8ec8aa5ba9f4e744710d508387d78', class: "s-social-share-wrapper" }, h("slot", { key: '6c6b54513f67be8818a9a042570286d09b7115f8', name: 'widget' }, h("salla-button", { key: '8a57650940dad634cf3576dada4cc35687ed447c', "aria-label": "Share", onClick: () => this.open(), class: "s-social-share-btn", shape: "icon", fill: "outline", color: "light" }, h("span", { key: '207f2fb0e2f89e7057775153ffcc68eebb069824', innerHTML: this.opened ? Cancel : ShareAlt }))), h("ul", { key: 'fd9b25a483a93efa10994c2a7a876b6741d976c2', ref: el => this.shareMenu = el, class: "s-social-share-list a2a_kit share", "data-a2a-url": this.url ? this.url : window.location.href, "data-a2a-title": this.urlName ? this.urlName : document.title }, this.platforms.split(',').map(platform => {
|
|
123
126
|
return (h("li", null, h("a", { class: `a2a_button_${platform}`, "aria-label": `Share Via ${platform}` }, this.platformIcons.map((icon) => {
|
|
124
127
|
if (icon.name === platform) {
|
|
125
128
|
return h("span", { class: "s-social-share-icon", innerHTML: icon.icon });
|
|
@@ -263,4 +266,5 @@ export class SallaSocialShare {
|
|
|
263
266
|
}
|
|
264
267
|
};
|
|
265
268
|
}
|
|
269
|
+
static get elementRef() { return "host"; }
|
|
266
270
|
}
|
|
@@ -30,7 +30,7 @@ export class SallaTabContent {
|
|
|
30
30
|
's-tabs-content': true,
|
|
31
31
|
's-tabs-content-selected': this.isSelected
|
|
32
32
|
};
|
|
33
|
-
return (h("div", { key: '
|
|
33
|
+
return (h("div", { key: '6b11ec3a839c759e64e1766de55f9ac1be18931e', class: classes }, h("slot", { key: '17300d7a52e068428ea956b2c5d5be6d0ab69fca' })));
|
|
34
34
|
}
|
|
35
35
|
static get is() { return "salla-tab-content"; }
|
|
36
36
|
static get originalStyleUrls() {
|
|
@@ -52,7 +52,7 @@ export class SallaTabHeader {
|
|
|
52
52
|
's-tabs-active': this.isSelected,
|
|
53
53
|
};
|
|
54
54
|
return [
|
|
55
|
-
h("div", { key: '
|
|
55
|
+
h("div", { key: '08c51c1ad15c6b0efbeb165c89fc7d73748467d0', class: classes, onClick: this.onClick.bind(this) }, h("slot", { key: 'ba5045dab7c254eb4533dc64630ab0c1f561701b' })),
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
58
|
static get is() { return "salla-tab-header"; }
|
|
@@ -50,7 +50,7 @@ export class SallaTabs {
|
|
|
50
50
|
}
|
|
51
51
|
render() {
|
|
52
52
|
return [
|
|
53
|
-
h("div", { key: '
|
|
53
|
+
h("div", { key: '3195e8954179d52867093b5e861b3c0caa6d7af6', class: "s-tabs" }, h("div", { key: 'cf75a77b6cc9b9cd288e963ee56acf19e177029a', class: "s-tabs-header" }, h("slot", { key: 'fa345597be2fbb8ff4f1cb420a030c5ec821bc8b', name: "header" })), h("div", { key: 'f7fd939608e5341b6d9c1d75e7d9dc909a4d8912', class: "s-tabs-content-wrapper" }, h("slot", { key: '86ce2c9bcb3be06264e75369a6be81b2e1361619', name: "content" })))
|
|
54
54
|
];
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "salla-tabs"; }
|
|
@@ -123,7 +123,7 @@ export class SallaTelInput {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
render() {
|
|
126
|
-
return (h(Host, { key: '
|
|
126
|
+
return (h(Host, { key: '362e48d1b39b0715c10df0c15c730ca21793a46b', class: "s-tel-input" }, h("input", { key: '07dcb2fcf639c2d7b95c250079bd24a80441e0ca', type: "tel", disabled: this.disabled, name: this.name, value: this.phone, onChange: (event) => this.handleCountryInput(event), ref: el => this.phoneInput = el, enterkeyhint: "next", autocomplete: "tel", class: "s-tel-input-control tel-input s-ltr" }), h("span", { key: 'c50f81a50debf37dc92f81fc61c3ddd3e622031f', class: "s-tel-input-error-msg", ref: el => this.errorMsg = el }), h("input", { key: '2217131b313a32c5b62dcce6132a4914f30dc005', type: "hidden", name: "country_code", value: this.countryCode, ref: el => this.countryCodeInput = el, class: "country_code" })));
|
|
127
127
|
}
|
|
128
128
|
componentDidLoad() {
|
|
129
129
|
this.initTelInput();
|
|
@@ -22,7 +22,7 @@ export class SallaTooltip {
|
|
|
22
22
|
this.targetElement = document.getElementById(this.targetId);
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
|
-
return (h("div", { key: '
|
|
25
|
+
return (h("div", { key: 'f2a52de43a80ec8fe2f7f2120c8ba38c7228183f', class: "s-tooltip-container" }, h("slot", { key: 'dc6ac92e0b894fa4f6c01c2aa0fad39a195a8047' }), this.show && h("div", { key: '8d4f57501bbcdb423781f6711a4af7610b89faf7', class: "s-tooltip-item" }, this.text)));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "salla-tooltip"; }
|
|
28
28
|
static get originalStyleUrls() {
|
|
@@ -124,6 +124,7 @@ export class SallaUserMenu {
|
|
|
124
124
|
async componentWillLoad() {
|
|
125
125
|
await salla.onReady();
|
|
126
126
|
await salla.lang.onLoaded();
|
|
127
|
+
Salla.event.on('api::token.injected', (token) => this.profileUrl = this.buildProfileUrl(token));
|
|
127
128
|
this.sallaAccountEnabled = Salla.config.get('store.features')?.includes('salla-account');
|
|
128
129
|
this.items = this.sallaAccountEnabled ? { ...this.items, settings: SettingstIcon } : this.items;
|
|
129
130
|
//we need it only in theme-y
|
|
@@ -132,7 +133,11 @@ export class SallaUserMenu {
|
|
|
132
133
|
}
|
|
133
134
|
//we need it to be the last item
|
|
134
135
|
this.items.logout = LogoutIcon;
|
|
135
|
-
|
|
136
|
+
let token = Salla.storage.get('token');
|
|
137
|
+
if (!token) {
|
|
138
|
+
token = '';
|
|
139
|
+
}
|
|
140
|
+
this.profileUrl = this.buildProfileUrl(token);
|
|
136
141
|
const trigger = this.host.querySelector('[slot="trigger"]');
|
|
137
142
|
this.triggerSlot =
|
|
138
143
|
'<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>';
|
|
@@ -230,6 +235,9 @@ export class SallaUserMenu {
|
|
|
230
235
|
componentDidLoad() {
|
|
231
236
|
document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));
|
|
232
237
|
}
|
|
238
|
+
buildProfileUrl(token) {
|
|
239
|
+
return `${Salla.config.get('account.url', 'https://accounts.salla.com')}/${salla.config.get('user.language_code')}/user?store=${Salla.config.get('store.id')}&info=${encodeURIComponent(token)}`;
|
|
240
|
+
}
|
|
233
241
|
static get is() { return "salla-user-menu"; }
|
|
234
242
|
static get originalStyleUrls() {
|
|
235
243
|
return {
|
|
@@ -56,7 +56,7 @@ export class SallaUserSettings {
|
|
|
56
56
|
await salla.profile.delete().finally(() => this.confirmationModal.close());
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: 'e47b5c39666443b29de9d54ec8f05cb97950ace1', class: "s-user-settings-wrapper" }, this.canHideName && h("div", { key: '54b3098aa736c43d6d3ef53f6a49710dc039a16d', class: "s-user-settings-section" }, h("salla-list-tile", { key: 'dd1d06cd2ad3e0696c76cfd3f4c8b342e774b679' }, h("div", { key: '2e8b8fb48d36ce6f183698cb60a856ee0b74c639', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: '0f7158ae21c5a93c5458c38388c79fb7cfa1e88d', innerHTML: UserCancel })), h("div", { key: 'f3f648e8f55f5998362107654d3a3c438bec2999', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.hideMyName)), h("div", { key: 'eddfaf2a9faf242123db36f1aa5a87fc242f6ccc', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.hideMyNameDesc)), h("div", { key: '1112ebcb125325688758d57de115ed36d965752d', slot: 'action', class: "s-user-settings-section-action" }, h("label", { key: '4bacd7e71a3f9ccef749d091d70be45b0184d195', class: "s-toggle" }, h("input", { key: '64db5795f938f72a5c0710c03c46f84bb0248b68', class: "s-toggle-input", checked: this.isHiddenName, onChange: (e) => this.toggleSetting('is_hidden_name', e), type: "checkbox" }), h("div", { key: 'b1e178372d37f63992ba81ee6d5645fb17f5ce33', class: "s-toggle-switcher" }))))), h("div", { key: 'a11d585e1b5fe0430ca00757394e5c9a085192f9', class: "s-user-settings-section" }, h("salla-list-tile", { key: '61ad291644bc8314b443eec5d3a32abccc9c46ba' }, h("div", { key: 'e54526b5f18ce365d68efb9292af2d67ae20b77b', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: 'e2bb0f2b30ac57d6336785485ef99279acf09617', innerHTML: Bullhorn })), h("div", { key: '2f6ec0835993e79b1923778bfe0d6442d71809f0', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.promotionalMsgs)), h("div", { key: '6ad65576302c12e2298abd3de70fd5edd54aa542', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.promotionalMsgsDesc)), h("div", { key: '05f00c6ed5511bd6a21b3e01a54a01549c758940', slot: 'action', class: "s-user-settings-section-action" }, h("label", { key: '5c3520e04e57205dfe2e7f441e45c46682a56ad4', class: "s-toggle" }, h("input", { key: '8f7f59433b3685acbc0d35c6ceca93a9a6a4ebbf', class: "s-toggle-input", checked: this.isNotifiable, onChange: (e) => this.toggleSetting('is_notifiable', e), type: "checkbox" }), h("div", { key: 'a92abe23b596360bfb3e516ffb0789b53abaabd0', class: "s-toggle-switcher" }))))), h("div", { key: '0996cc090ab85a67e763b5acd19cc87db11c090d', class: "s-user-settings-section s-user-settings-section-deactivate-user" }, h("salla-list-tile", { key: 'f6b43aa4a618d75981fed8844ed1f4ebc3947239' }, h("div", { key: '3027e7c901c1ec214a9effdbd36e1c25d96cdb75', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: '11468d7a54fa406e697e07b2ff2fe5c945a28746', innerHTML: UserOff })), h("div", { key: 'c2fd73f5d313daaba740c89ad2654144f6f54bb1', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.deactivateAccount)), h("div", { key: 'e2bad2737f3ca8e30bbb375ad7691d607366551c', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.deactivateDesc)), h("div", { key: 'df155e019df0514ed77faaeef107845ce144ca08', slot: 'action', class: "s-user-settings-section-action" }, h("salla-button", { key: 'e7bd07fcbc49ba9e991adf52854b35c9ca8d0344', fill: "outline", color: "danger", shape: "btn", size: "medium", width: "normal", onClick: () => this.openDeactivateModal() }, this.capitalizeText(this.deactivateAccount))))), h("salla-modal", { key: '730df3b04afb89a1eba96651899cf84818d49b6b', width: "sm", subTitle: this.capitalizeText(this.sorryForLeavingText), ref: modal => this.confirmationModal = modal }, h("span", { key: '5254b44fac993e1e1454da4eae346afc5ad7211c', slot: 'icon', class: "s-user-settings-confirmation-icon", innerHTML: UserOff }), h("div", { key: '9c07be490266024dee72ca4a244c8dd4ffdd9d71', class: "s-user-settings-confirmation" }, h("div", { key: 'd42ac2fa9cc0030778b444b21958992677667cc3', class: "s-user-settings-confirmation-warning" }, this.capitalizeText(this.warningText)), h("div", { key: 'b3cd6b31255244c469571beaf05a0f266eb431af', class: "s-user-settings-confirmation-actions" }, h("salla-button", { key: 'aadfefcd7e2561542adb10c416bac0ff14b25fef', width: "wide", onClick: () => this.confirmationModal.close() }, this.capitalizeText(this.keepAccount)), h("salla-button", { key: '12693adf31b54a4ca993632fb527dac91ec810b2', fill: 'outline', loading: this.buttonLoading, width: "wide", onClick: () => this.deleteAccount() }, this.capitalizeText(this.deactivateAccount)))))));
|
|
60
60
|
}
|
|
61
61
|
static get is() { return "salla-user-settings"; }
|
|
62
62
|
static get originalStyleUrls() {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Plugin to fix @rollup/plugin-commonjs "Cannot read properties of undefined (reading 'resolved')" error
|
|
2
|
+
// in watch/dev mode. This only affects dev builds - production builds retain full caching.
|
|
3
|
+
|
|
4
|
+
function isDevMode() {
|
|
5
|
+
return process.argv.includes('-w') || process.argv.includes('--watch') || process.argv.includes('--dev');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function commonjsCacheFix() {
|
|
9
|
+
const devMode = isDevMode();
|
|
10
|
+
return {
|
|
11
|
+
name: 'commonjs-cache-fix',
|
|
12
|
+
options(options) {
|
|
13
|
+
if (devMode) {
|
|
14
|
+
return { ...options, cache: false };
|
|
15
|
+
}
|
|
16
|
+
return null; // return null to preserve original options unchanged
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = { commonjsCacheFix, isDevMode };
|